function getReqRaw(req) { removeEncodingFields(req.headers); var headers = getHeadersRaw(req.headers, req.rawHeaderNames); var url = String(req.url || '').replace(/^ws/, 'http'); headers.unshift([getMethod(req.method), url, 'HTTP/1.1'].join(' ')); return decodeRaw(headers, req); }
/** * @params {!Array<string>} pathFolders * @param {!Array<string>} fileNameParts * @return {!Promise<string>} */ async function loadSource(pathFolders, ...fileNameParts) { const paths = lookupFile(pathFolders, ...fileNameParts).reverse(); return (await Promise.all(paths.map(name => fs.readFile(name, 'utf8')))).join('\n'); }
function genComponent(item) { const component = JSON.stringify(item.component) const chunkName = JSON.stringify(item.chunkName) return [ `const ${item.variableName} = `, `() => import(/* webpackChunkName: ${chunkName} */ ${component})` ].join('') }
_.map(overrides.volumes, volume => { if (!_.includes(volume, ':')) { return volume; } else { const local = exports.getHostPath(volume); const remote = _.last(volume.split(':')); // @TODO: I don't think below does anything? const excludes = _.keys(volumes).concat(_.keys(volumes)); const host = exports.normalizePath(local, base, excludes); return [host, remote].join(':'); } })
// Add in the hostname infos app.events.on('post-init', 1, () => { app.log.debug('adding hostnames to the app...'); _.forEach(app.info, data => { data.hostnames = _.get(data, 'hostnames', []); data.hostnames.push([data.service, app.project, 'internal'].join('.')); app.log.debug('hostnames added to %s', data.service, data.hostnames); }); });
const generateClassSection = (doclet) => { const header = `## ${doclet.name}\n`; let classSection = [header, (doclet.classdesc || doclet.description).trim(), '\n'].join('\n'); if (doclet.params && doclet.params.length) { classSection = classSection.concat(generateFunctionDocletSection(doclet, true)); } return classSection; }
async renderChoices() { if (this.state.submitted) return ''; this.tableize(); let choices = this.visible.map(async(ch, i) => await this.renderChoice(ch, i)); let visible = await Promise.all(choices); let heading = await this.renderScaleHeading(); return this.margin[0] + [heading, ...visible.map(v => v.join(' '))].join('\n'); }
function assertEventName(eventName, eventNames) { assert( `Invalid event name provided. Expected string, received: "${typeof eventName}".`, typeof eventName === 'string' ); assert( `Invalid event name provided: "${eventName}". Possible events: ${[ ...eventNames ].join(', ')}.`, eventNames.has(eventName) ); }
[ // `this.{map, filter, …}()` '[callee.object.type!="ThisExpression"]', ...ignoredCallee.map(name => toSelector(name)) ].join('')
// add transition css for floating labels setTimeout(function() { var css = '.mui-textfield.mui-textfield--float-label > label {' + [ '-webkit-transition', '-moz-transition', '-o-transition', 'transition', '' ].join(':all .15s ease-out;') + '}'; util.loadStyle(css); }, 150);
function getResRaw(res) { removeEncodingFields(res.headers); var headers = getHeadersRaw(res.headers, res.rawHeaderNames); var statusCode = res.statusCode === 'aborted' ? 502 : res.statusCode; var statusMessage = !statusCode ? '' : res.statusMessage || STATUS_CODES[statusCode] || 'unknown'; headers.unshift(['HTTP/1.1', statusCode, statusMessage].join(' ')); return decodeRaw(headers, res); }
dealTime(seconds) { var seconds = seconds | 0; var day = (seconds / (3600 * 24)) | 0; var hours = ((seconds - day * 3600) / 3600) | 0; var minutes = ((seconds - day * 3600 * 24 - hours * 3600) / 60) | 0; var second = seconds % 60; (day < 10) && (day = '0' + day); (hours < 10) && (hours = '0' + hours); (minutes < 10) && (minutes = '0' + minutes); (second < 10) && (second = '0' + second); return [day, hours, minutes, second].join(':'); }
function genComponent(item) { const component = JSON.stringify(item.component) const chunkName = JSON.stringify(item.chunkName) return [ `const ${item.variableName} = `, `() => import(/* webpackChunkName: ${chunkName} */ ${component})` ].join('') }