function Member(electron) { this.encodeToken=function (token) { let wordArray = crypto.enc.Utf8.parse(token); let str = crypto.enc.Base64.stringify(wordArray); str+=Math.floor(Math.random() * (99 - 10 + 1) + 10); str=str.split("").reverse().join(""); return str; } }
/** * @desc Get string for a particular function name * @param {String} functionName - Function name to trace from. If null, it returns the WHOLE builder stack * @returns {String} settings - The string, of all the various functions. Trace optimized if functionName given */ getString(functionName) { if (functionName) { return this.getStringFromFunctionNames(this.traceFunctionCalls(functionName).reverse()); } return this.getStringFromFunctionNames(Object.keys(this.functionMap)); }
function generateRecordingName(context) { const { currentTest } = context; const parts = [currentTest.title]; let parent = currentTest.parent; while (parent && parent.title) { parts.push(parent.title); parent = parent.parent; } return parts.reverse().join('/'); }
prev() { let parts = [].concat(this.parts).reverse(); const currentIdx = parts.indexOf(this); return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart); }
t('transform column', async() => { const sql = postgres({ ...options, transform: { column: x => x.split('').reverse().join('') } }) await sql`create table test (hello_world int)` await sql`insert into test values (1)` return ['dlrow_olleh', Object.keys((await sql`select * from test`)[0])[0], await sql`drop table test`] })
/** * @desc Return the string for a function * @param {String} [functionName] - Function name to trace from. If null, it returns the WHOLE builder stack * @returns {Array} The full string, of all the various functions. Trace optimized if functionName given */ getPrototypes(functionName) { if (this.rootNode) { this.rootNode.toString(); } if (functionName) { return this.getPrototypesFromFunctionNames(this.traceFunctionCalls(functionName, []).reverse()); } return this.getPrototypesFromFunctionNames(Object.keys(this.functionMap)); }
(function() { var l = []; for (var m in j) { i[j[m]] = m; l.push(j[m]); } l.reverse(); h = new RegExp(l.join("|"), "g"); })();
const getItemSelection = (editor: Editor): Option<ItemSelection> => { const selectedListItems = Arr.map(Selection.getSelectedListItems(editor), Element.fromDom); return Options.lift2( Arr.find(selectedListItems, Fun.not(hasFirstChildList)), Arr.find(Arr.reverse(selectedListItems), Fun.not(hasFirstChildList)), (start, end) => ({ start, end })); }
/** * @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'); }
/** * Wrap a method * * @param {string} method * @param {Function} handler * @param {any} bindTo * @param {Object} opts * @returns {Function} * @memberof MiddlewareHandler */ wrapMethod(method, handler, bindTo = this.broker, opts = {}) { if (this.registeredHooks[method] && this.registeredHooks[method].length) { const list = opts.reverse ? Array.from(this.registeredHooks[method]).reverse() : this.registeredHooks[method]; handler = list.reduce((next, fn) => fn.call(bindTo, next), handler.bind(bindTo)); } return handler; }
/** * Call a handler asynchronously in all middlewares * * @param {String} method * @param {Array<any>} args * @param {Object} opts * @returns {Promise} * @memberof MiddlewareHandler */ callHandlers(method, args, opts = {}) { if (this.registeredHooks[method] && this.registeredHooks[method].length) { const list = opts.reverse ? Array.from(this.registeredHooks[method]).reverse() : this.registeredHooks[method]; return list.reduce((p, fn) => p.then(() => fn.apply(this.broker, args)), this.broker.Promise.resolve()); } return this.broker.Promise.resolve(); }
toJSON() { return this.traceFunctionCalls(this.rootNode.name).reverse().map(name => { const nativeIndex = this.nativeFunctions.indexOf(name); if (nativeIndex > -1) { return { name, source: this.nativeFunctions[nativeIndex].source }; } else if (this.functionMap[name]) { return this.functionMap[name].toJSON(); } else { throw new Error(`function ${ name } not found`); } }); }
/** * Call a handler synchronously in all middlewares * * @param {String} method * @param {Array<any>} args * @param {Object} opts * @returns {Array<any} * @memberof MiddlewareHandler */ callSyncHandlers(method, args, opts = {}) { if (this.registeredHooks[method] && this.registeredHooks[method].length) { const list = opts.reverse ? Array.from(this.registeredHooks[method]).reverse() : this.registeredHooks[method]; return list.map(fn => fn.apply(this.broker, args)); } return; }
function Member(electron) { this.encodeToken=function (token) { let wordArray = crypto.enc.Utf8.parse(token); let str = crypto.enc.Base64.stringify(wordArray); str+=Math.floor(Math.random() * (99 - 10 + 1) + 10); str=str.split("").reverse().join(""); return str; } }
function generateRecordingName(context) { const { currentTest } = context; const parts = [currentTest.title]; let parent = currentTest.parent; while (parent && parent.title) { parts.push(parent.title); parent = parent.parent; } return parts.reverse().join('/'); }