function getExpectedUrls(urlMappings: UrlMapping[]) { const expectedUrls = []; urlMappings.forEach(urlMapping => { expectedUrls.push(urlMapping.url); urlMapping.model.children.forEach(reflection => { expectedUrls.push(reflection.url); }); }); return expectedUrls; }
filterTokens(params, "inline", function forToken(token) { token.children.forEach(function forChild(child) { if (child.type === type) { handler(child, token); } }); });
const parseFile = (file) => { const ast = parser.parse(fs.readFileSync(file).toString()); for (const child of ast.feature.children) { if (child.type === 'ScenarioOutline') continue; // skip scenario outline parseSteps(child.steps).map((step) => { return Object.assign(step, { file: file.replace(global.codecept_dir, '').slice(1) }); }).map((step) => newSteps.set(`${step.type}(${step})`, step)); } }
render() { const classes = classnames('application__view', { [`application__view--${this.props.modifier}`]: this.props.modifier != null, }); return <div className={classes}>{this.props.children}</div>; }
const cloneItemContent = (li: Element): Element[] => { const children = Traverse.children(li); const content = hasLastChildList(li) ? children.slice(0, -1) : children; return Arr.map(content, Replication.deep); }
const RouteStatus = function (outerProps) { const inline = function (innerProps) { if (innerProps.staticContext) { innerProps.staticContext.code = outerProps.code; } return outerProps.children; }; return ( <Route render={inline} /> ); }
_addSuite(mode, name, callback) { const oldSuite = this._currentSuite; const suite = new Suite(this._currentSuite, name, mode); this._currentSuite.children.push(suite); this._currentSuite = suite; callback(); this._currentSuite = oldSuite; this._hasFocusedTestsOrSuites = this._hasFocusedTestsOrSuites || mode === TestMode.Focus; }
// tutorials can have only one parent so there is no risk for loops function saveChildren(node) { node.children.forEach(function(child) { generateTutorial('Tutorial: ' + child.title, child, helper.tutorialToUrl(child.name)); saveChildren(child); }); }
render() { return ( <div className="application"> <WindowTitle /> <TransitionGroup>{this.renderOverlay()}</TransitionGroup> {this.props.children} </div> ); }
function getVariant(props) { let variant = variantKeys[0]; let text = getFirstLeaf(props.children); let firstWord = text.split(' ')[0]; variantKeys.forEach(key => { if (firstWord.toLowerCase() === `${key}:`) { variant = key; } }); return variant; }
filterTokens(params, "inline", function (token) { var childTokenTypes = ""; token.children.forEach(function (child) { if (child.type !== "text" || child.content !== "") { childTokenTypes += tokenTypeMap[child.type] || "x"; } }); if (linkOrImageOnlyLineRe.test(childTokenTypes)) { linkOnlyLineNumbers.push(token.lineNumber); } });
function getVariant(props) { let variant = variantKeys[0]; let text = getFirstLeaf(props.children); let firstWord = text.split(' ')[0]; variantKeys.forEach(key => { if (firstWord.toLowerCase() === `${key}:`) { variant = key; } }); return variant; }