fs.readdirSync(themesDir).forEach(th => { if (!th.endsWith(".json")) return; th = th.replace(".json", ""); if (th === window.settings.theme) return; themes += `<option>${th}</option>`; });
window.si.fsSize().catch(() => { this.space_bar.text.innerHTML = "Could not calculate mountpoint usage."; this.space_bar.bar.value = 100; }).then(d => { d.forEach(fsBlock => { if (path.startsWith(fsBlock.mount)) { this.fsBlock = fsBlock; } }); this.renderDiskUsage(this.fsBlock); });
export function headers(headers, config, req) { const normalizedHeaders = new HTTPHeaders(headers); if (isFunction(config)) { return config(normalizedHeaders, req); } if (isObjectLike(config) && isArray(config.exclude)) { config.exclude.forEach(header => delete normalizedHeaders[header]); } return normalizedHeaders; }
constructor({ host, paths, global, handler }) { this.global = Boolean(global); this.handler = handler; this.host = host; this.paths = this.global ? [GLOBAL] : paths; this._routeRecognizer = new RouteRecognizer(); this.paths.forEach(path => this._routeRecognizer.add([{ path, handler: [handler] }]) ); }
describe('Unit | Index', function() { it('should export all the necessary modules', function() { ['Polly', 'Timing', 'setupQunit', 'setupMocha'].forEach(name => { expect(PollyExports[name]).to.be.ok; }); }); });
action.conditions.forEach((condition) => { const conditionVerified = compare(condition.operator, scope[condition.variable], condition.value); if (conditionVerified) { oneConditionVerified = true; } else { logger.debug( `Condition not verified. Condition = ${scope[condition.variable]} ${condition.operator} ${condition.value}`, ); } });
window.shortcuts.filter(e => e.type === "app").forEach(cut => { let action = (cut.action.startsWith("TAB_")) ? "TAB_X" : cut.action; appList += `<tr> <td>${(cut.enabled) ? 'YES' : 'NO'}</td> <td><input disabled type="text" maxlength=25 value="${cut.trigger}"></td> <td>${shortcutsDefinition[action]}</td> </tr>`; });
// foreach service services.forEach((service) => { // if the service has a controllers object if (service[1].get().controllers) { Object.assign(routes, service[1].get().controllers); } });
router.routes.forEach(route => { if (!route.pattern.includes(':')) { routes[route.pattern] = { page: route.page }; } });
Object.keys(publicEnv).forEach(key => { if (!process.env[key]) { process.env[key] = publicEnv[key]; } });
/** * @public * @memberof Polly */ play() { if (this[PAUSED_ADAPTERS]) { this[PAUSED_ADAPTERS].forEach(adapterId => this.connectTo(adapterId)); delete this[PAUSED_ADAPTERS]; } }
onDisconnect() { this[LISTENERS].forEach((_, target) => this._callListenersWith('removeListener', target) ); }
fs.readdirSync(themesDir).forEach(th => { if (!th.endsWith(".json")) return; th = th.replace(".json", ""); if (th === window.settings.theme) return; themes += `<option>${th}</option>`; });
window.shortcuts.filter(e => e.type === "app").forEach(cut => { let action = (cut.action.startsWith("TAB_")) ? "TAB_X" : cut.action; appList += `<tr> <td>${(cut.enabled) ? 'YES' : 'NO'}</td> <td><input disabled type="text" maxlength=25 value="${cut.trigger}"></td> <td>${shortcutsDefinition[action]}</td> </tr>`; });
window.si.fsSize().catch(() => { this.space_bar.text.innerHTML = "Could not calculate mountpoint usage."; this.space_bar.bar.value = 100; }).then(d => { d.forEach(fsBlock => { if (path.startsWith(fsBlock.mount)) { this.fsBlock = fsBlock; } }); this.renderDiskUsage(this.fsBlock); });