id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
29,500
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfFsExploreEnumerator
function _gpfFsExploreEnumerator(iFileStorage, listOfPaths) { var pos = GPF_FS_EXPLORE_BEFORE_START, info; return { reset: function () { pos = GPF_FS_EXPLORE_BEFORE_START; return Promise.resolve(); }, moveNext: function () { ...
javascript
function _gpfFsExploreEnumerator(iFileStorage, listOfPaths) { var pos = GPF_FS_EXPLORE_BEFORE_START, info; return { reset: function () { pos = GPF_FS_EXPLORE_BEFORE_START; return Promise.resolve(); }, moveNext: function () { ...
[ "function", "_gpfFsExploreEnumerator", "(", "iFileStorage", ",", "listOfPaths", ")", "{", "var", "pos", "=", "GPF_FS_EXPLORE_BEFORE_START", ",", "info", ";", "return", "{", "reset", ":", "function", "(", ")", "{", "pos", "=", "GPF_FS_EXPLORE_BEFORE_START", ";", ...
Automate the use of getInfo on a path array to implement IFileStorage.explore @param {gpf.interfaces.IFileStorage} iFileStorage File storage to get info from @param {String[]} listOfPaths List of paths to return @return {gpf.interfaces.IEnumerator} IEnumerator interface @gpf:closure @since 0.1.9
[ "Automate", "the", "use", "of", "getInfo", "on", "a", "path", "array", "to", "implement", "IFileStorage", ".", "explore" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4203-L4225
29,501
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (stream, close) { this._stream = stream; if (typeof close === "function") { this._close = close; } stream.on("error", this._onError.bind(this)); }
javascript
function (stream, close) { this._stream = stream; if (typeof close === "function") { this._close = close; } stream.on("error", this._onError.bind(this)); }
[ "function", "(", "stream", ",", "close", ")", "{", "this", ".", "_stream", "=", "stream", ";", "if", "(", "typeof", "close", "===", "\"function\"", ")", "{", "this", ".", "_close", "=", "close", ";", "}", "stream", ".", "on", "(", "\"error\"", ",", ...
Base class wrapping NodeJS streams @param {Object} stream NodeJS stream object @param {Function} [close] Close handler @constructor gpf.node.BaseStream @since 0.1.9
[ "Base", "class", "wrapping", "NodeJS", "streams" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4237-L4243
29,502
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (output, chunk) { var me = this, stream = me._stream; stream.pause(); output.write(chunk).then(function () { stream.resume(); }, me._reject); }
javascript
function (output, chunk) { var me = this, stream = me._stream; stream.pause(); output.write(chunk).then(function () { stream.resume(); }, me._reject); }
[ "function", "(", "output", ",", "chunk", ")", "{", "var", "me", "=", "this", ",", "stream", "=", "me", ".", "_stream", ";", "stream", ".", "pause", "(", ")", ";", "output", ".", "write", "(", "chunk", ")", ".", "then", "(", "function", "(", ")", ...
endregion Stream 'data' event handler @param {gpf.interfaces.IWritableStream} output Output stream @param {Object} chunk Buffer @since 0.1.9
[ "endregion", "Stream", "data", "event", "handler" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4338-L4344
29,503
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (e) { if (e instanceof java.util.NoSuchElementException || e.message.startsWith("java.util.NoSuchElementException")) { // Empty stream return Promise.resolve(); } return Promise.reject(e); }
javascript
function (e) { if (e instanceof java.util.NoSuchElementException || e.message.startsWith("java.util.NoSuchElementException")) { // Empty stream return Promise.resolve(); } return Promise.reject(e); }
[ "function", "(", "e", ")", "{", "if", "(", "e", "instanceof", "java", ".", "util", ".", "NoSuchElementException", "||", "e", ".", "message", ".", "startsWith", "(", "\"java.util.NoSuchElementException\"", ")", ")", "{", "// Empty stream", "return", "Promise", ...
region gpf.interfaces.IReadableStream Process error that occurred during the stream reading @param {Error} e Error coming from read @return {Promise} Read result replacement @since 0.2.4
[ "region", "gpf", ".", "interfaces", ".", "IReadableStream", "Process", "error", "that", "occurred", "during", "the", "stream", "reading" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5471-L5477
29,504
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function () { var me = this; if (me._readNotWriting) { me._readNotWriting = false; me._readWriteToOutput().then(undefined, function (reason) { me._readReject(reason); }); } }
javascript
function () { var me = this; if (me._readNotWriting) { me._readNotWriting = false; me._readWriteToOutput().then(undefined, function (reason) { me._readReject(reason); }); } }
[ "function", "(", ")", "{", "var", "me", "=", "this", ";", "if", "(", "me", ".", "_readNotWriting", ")", "{", "me", ".", "_readNotWriting", "=", "false", ";", "me", ".", "_readWriteToOutput", "(", ")", ".", "then", "(", "undefined", ",", "function", "...
Triggers write only if no write is in progress @since 0.2.3
[ "Triggers", "write", "only", "if", "no", "write", "is", "in", "progress" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5802-L5810
29,505
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function () { var me = this, lines = me._consolidateLines(); me._buffer.length = 0; me._pushBackLastLineIfNotEmpty(lines); _gpfArrayForEach(lines, function (line) { me._appendToReadBuffer(line); }); }
javascript
function () { var me = this, lines = me._consolidateLines(); me._buffer.length = 0; me._pushBackLastLineIfNotEmpty(lines); _gpfArrayForEach(lines, function (line) { me._appendToReadBuffer(line); }); }
[ "function", "(", ")", "{", "var", "me", "=", "this", ",", "lines", "=", "me", ".", "_consolidateLines", "(", ")", ";", "me", ".", "_buffer", ".", "length", "=", "0", ";", "me", ".", "_pushBackLastLineIfNotEmpty", "(", "lines", ")", ";", "_gpfArrayForEa...
Check if the buffer contains any carriage return and write to output @since 0.2.1
[ "Check", "if", "the", "buffer", "contains", "any", "carriage", "return", "and", "write", "to", "output" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5960-L5967
29,506
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfRequireWrapGpf
function _gpfRequireWrapGpf(context, name) { return _gpfRequirePlugWrapper(_gpfRequireAllocateWrapper(), _gpfRequireAllocate(context, { base: _gpfPathParent(name) })); }
javascript
function _gpfRequireWrapGpf(context, name) { return _gpfRequirePlugWrapper(_gpfRequireAllocateWrapper(), _gpfRequireAllocate(context, { base: _gpfPathParent(name) })); }
[ "function", "_gpfRequireWrapGpf", "(", "context", ",", "name", ")", "{", "return", "_gpfRequirePlugWrapper", "(", "_gpfRequireAllocateWrapper", "(", ")", ",", "_gpfRequireAllocate", "(", "context", ",", "{", "base", ":", "_gpfPathParent", "(", "name", ")", "}", ...
Wrap gpf to fit the new context and give access to gpf.require.define promise @param {Object} context Require context @param {String} name Resource (resolved) name @return {gpf.typedef._requireWrapper} Wrapper @since 0.2.2
[ "Wrap", "gpf", "to", "fit", "the", "new", "context", "and", "give", "access", "to", "gpf", ".", "require", ".", "define", "promise" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6135-L6137
29,507
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfRequireGet
function _gpfRequireGet(name) { var me = this, promise; if (me.cache[name]) { return me.cache[name]; } promise = _gpfRequireLoad.call(me, name); me.cache[name] = promise; return promise["catch"](function (reason) { _gpfRequireDocumentStack(reason, ...
javascript
function _gpfRequireGet(name) { var me = this, promise; if (me.cache[name]) { return me.cache[name]; } promise = _gpfRequireLoad.call(me, name); me.cache[name] = promise; return promise["catch"](function (reason) { _gpfRequireDocumentStack(reason, ...
[ "function", "_gpfRequireGet", "(", "name", ")", "{", "var", "me", "=", "this", ",", "promise", ";", "if", "(", "me", ".", "cache", "[", "name", "]", ")", "{", "return", "me", ".", "cache", "[", "name", "]", ";", "}", "promise", "=", "_gpfRequireLoa...
Get the cached resource or load it @param {String} name Resource name @return {Promise<*>} Resource association @since 0.2.2
[ "Get", "the", "cached", "resource", "or", "load", "it" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6441-L6452
29,508
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfRequireAllocate
function _gpfRequireAllocate(parentContext, options) { var context = Object.create(parentContext), // cache content is shared but other properties are protected require = {}; require.define = _gpfRequireDefine.bind(context); require.resolve = _gpfRequireResolve.bind(conte...
javascript
function _gpfRequireAllocate(parentContext, options) { var context = Object.create(parentContext), // cache content is shared but other properties are protected require = {}; require.define = _gpfRequireDefine.bind(context); require.resolve = _gpfRequireResolve.bind(conte...
[ "function", "_gpfRequireAllocate", "(", "parentContext", ",", "options", ")", "{", "var", "context", "=", "Object", ".", "create", "(", "parentContext", ")", ",", "// cache content is shared but other properties are protected", "require", "=", "{", "}", ";", "require"...
Allocate a new require context with the proper methods @param {Object} parentContext Context to inherit from @param {gpf.typedef.requireOptions} [options] Options to configure @return {Object} Containing {@link gpf.require.define}, {@link gpf.require.resolve} and {@link gpf.require.configure} @since 0.2.2
[ "Allocate", "a", "new", "require", "context", "with", "the", "proper", "methods" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6495-L6506
29,509
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (parserOptions) { var me = this; if (parserOptions) { _gpfArrayForEach([ "header", "separator", "quote", "newLine" ], function (optionName) { if (parserOpt...
javascript
function (parserOptions) { var me = this; if (parserOptions) { _gpfArrayForEach([ "header", "separator", "quote", "newLine" ], function (optionName) { if (parserOpt...
[ "function", "(", "parserOptions", ")", "{", "var", "me", "=", "this", ";", "if", "(", "parserOptions", ")", "{", "_gpfArrayForEach", "(", "[", "\"header\"", ",", "\"separator\"", ",", "\"quote\"", ",", "\"newLine\"", "]", ",", "function", "(", "optionName", ...
region Parser options Read parser options @param {gpf.typedef.csvParserOptions} [parserOptions] Parser options @since 0.2.3
[ "region", "Parser", "options", "Read", "parser", "options" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6795-L6809
29,510
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function () { var header = this._header; this._separator = _gpfArrayForEachFalsy(_gpfCsvSeparators, function (separator) { if (header.includes(separator)) { return separator; } }) || _gpfCsvSeparators[_GPF_START]; }
javascript
function () { var header = this._header; this._separator = _gpfArrayForEachFalsy(_gpfCsvSeparators, function (separator) { if (header.includes(separator)) { return separator; } }) || _gpfCsvSeparators[_GPF_START]; }
[ "function", "(", ")", "{", "var", "header", "=", "this", ".", "_header", ";", "this", ".", "_separator", "=", "_gpfArrayForEachFalsy", "(", "_gpfCsvSeparators", ",", "function", "(", "separator", ")", "{", "if", "(", "header", ".", "includes", "(", "separa...
Deduce separator from header line @since 0.2.3
[ "Deduce", "separator", "from", "header", "line" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6828-L6835
29,511
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (match) { var UNQUOTED = 1, QUOTED = 2; if (match[UNQUOTED]) { this._values.push(match[UNQUOTED]); } else /* if (match[QUOTED]) */ { this._values.push(this._unescapeQuoted(match[QUOTED])); } ...
javascript
function (match) { var UNQUOTED = 1, QUOTED = 2; if (match[UNQUOTED]) { this._values.push(match[UNQUOTED]); } else /* if (match[QUOTED]) */ { this._values.push(this._unescapeQuoted(match[QUOTED])); } ...
[ "function", "(", "match", ")", "{", "var", "UNQUOTED", "=", "1", ",", "QUOTED", "=", "2", ";", "if", "(", "match", "[", "UNQUOTED", "]", ")", "{", "this", ".", "_values", ".", "push", "(", "match", "[", "UNQUOTED", "]", ")", ";", "}", "else", "...
Add the matching value to the array of values @param {Object} match Regular expression match @since 0.2.3
[ "Add", "the", "matching", "value", "to", "the", "array", "of", "values" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6915-L6924
29,512
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (match) { var lengthOfMatchedString = match[_GPF_START].length, charAfterValue = this._content.charAt(lengthOfMatchedString); if (charAfterValue) { _gpfAssert(charAfterValue === this._separator, "Positive lookahead works"); return this._nextValue(++length...
javascript
function (match) { var lengthOfMatchedString = match[_GPF_START].length, charAfterValue = this._content.charAt(lengthOfMatchedString); if (charAfterValue) { _gpfAssert(charAfterValue === this._separator, "Positive lookahead works"); return this._nextValue(++length...
[ "function", "(", "match", ")", "{", "var", "lengthOfMatchedString", "=", "match", "[", "_GPF_START", "]", ".", "length", ",", "charAfterValue", "=", "this", ".", "_content", ".", "charAt", "(", "lengthOfMatchedString", ")", ";", "if", "(", "charAfterValue", ...
Check what appears after the extracted value @param {Object} match Regular expression match @return {Boolean} True if some remaining content must be parsed @since 0.2.3
[ "Check", "what", "appears", "after", "the", "extracted", "value" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6943-L6951
29,513
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (line) { if (this._content) { this._content = this._content + this._newLine + line; } else { this._values = []; this._content = line; } return this._parseContent(); }
javascript
function (line) { if (this._content) { this._content = this._content + this._newLine + line; } else { this._values = []; this._content = line; } return this._parseContent(); }
[ "function", "(", "line", ")", "{", "if", "(", "this", ".", "_content", ")", "{", "this", ".", "_content", "=", "this", ".", "_content", "+", "this", ".", "_newLine", "+", "line", ";", "}", "else", "{", "this", ".", "_values", "=", "[", "]", ";", ...
If some content remains from previous parsing, concatenate it and parse @param {String} line CSV line @return {String[]|undefined} Resulting values or undefined if not yet finalized @since 0.2.3
[ "If", "some", "content", "remains", "from", "previous", "parsing", "concatenate", "it", "and", "parse" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7010-L7018
29,514
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (values) { var record = {}; _gpfArrayForEach(this._columns, function (name, idx) { var value = values[idx]; if (value !== undefined) { record[name] = values[idx]; } }); return record; }
javascript
function (values) { var record = {}; _gpfArrayForEach(this._columns, function (name, idx) { var value = values[idx]; if (value !== undefined) { record[name] = values[idx]; } }); return record; }
[ "function", "(", "values", ")", "{", "var", "record", "=", "{", "}", ";", "_gpfArrayForEach", "(", "this", ".", "_columns", ",", "function", "(", "name", ",", "idx", ")", "{", "var", "value", "=", "values", "[", "idx", "]", ";", "if", "(", "value",...
Generate a record from values @param {String[]} values Array of values @return {Object} Record based on header names @since 0.2.3
[ "Generate", "a", "record", "from", "values" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7026-L7035
29,515
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function () { if (this._content) { var error = new gpf.Error.InvalidCSV(); this._setReadError(error); return Promise.reject(error); } this._completeReadBuffer(); return Promise.resolve(); }
javascript
function () { if (this._content) { var error = new gpf.Error.InvalidCSV(); this._setReadError(error); return Promise.reject(error); } this._completeReadBuffer(); return Promise.resolve(); }
[ "function", "(", ")", "{", "if", "(", "this", ".", "_content", ")", "{", "var", "error", "=", "new", "gpf", ".", "Error", ".", "InvalidCSV", "(", ")", ";", "this", ".", "_setReadError", "(", "error", ")", ";", "return", "Promise", ".", "reject", "(...
endregion region gpf.interfaces.IFlushableStream @gpf:sameas gpf.interfaces.IFlushableStream#flush @since 0.2.3
[ "endregion", "region", "gpf", ".", "interfaces", ".", "IFlushableStream" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7066-L7074
29,516
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function () { var me = this; if (!me._dataInPromise) { me._dataInPromise = new Promise(function (resolve) { me._dataInResolve = resolve; }).then(function (data) { delete me._dataInPromise; ...
javascript
function () { var me = this; if (!me._dataInPromise) { me._dataInPromise = new Promise(function (resolve) { me._dataInResolve = resolve; }).then(function (data) { delete me._dataInPromise; ...
[ "function", "(", ")", "{", "var", "me", "=", "this", ";", "if", "(", "!", "me", ".", "_dataInPromise", ")", "{", "me", ".", "_dataInPromise", "=", "new", "Promise", "(", "function", "(", "resolve", ")", "{", "me", ".", "_dataInResolve", "=", "resolve...
Wait until data was written to this stream @return {Promise} Resolved when a data as been written to this stream @since 0.2.5
[ "Wait", "until", "data", "was", "written", "to", "this", "stream" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7459-L7471
29,517
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (data) { var me = this; me._waitForData(); me._dataInResolve(data); return new Promise(function (resolve, reject) { me._dataOutResolve = resolve; me._dataOutReject = reject; }).then(function ...
javascript
function (data) { var me = this; me._waitForData(); me._dataInResolve(data); return new Promise(function (resolve, reject) { me._dataOutResolve = resolve; me._dataOutReject = reject; }).then(function ...
[ "function", "(", "data", ")", "{", "var", "me", "=", "this", ";", "me", ".", "_waitForData", "(", ")", ";", "me", ".", "_dataInResolve", "(", "data", ")", ";", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "m...
Waits for the read API to write it out @param {*} data Data to write @return {Promise} Resolved when write operation has been done on output @protected @since 0.2.5
[ "Waits", "for", "the", "read", "API", "to", "write", "it", "out" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7480-L7496
29,518
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfXmlCheckDefinableNamespacePrefixName
function _gpfXmlCheckDefinableNamespacePrefixName(name) { _gpfXmlCheckValidNamespacePrefixName(name); _gpfXmlCheckNoXmlns(name); if (name === "xml") { gpf.Error.invalidXmlUseOfPrefixXml(); } }
javascript
function _gpfXmlCheckDefinableNamespacePrefixName(name) { _gpfXmlCheckValidNamespacePrefixName(name); _gpfXmlCheckNoXmlns(name); if (name === "xml") { gpf.Error.invalidXmlUseOfPrefixXml(); } }
[ "function", "_gpfXmlCheckDefinableNamespacePrefixName", "(", "name", ")", "{", "_gpfXmlCheckValidNamespacePrefixName", "(", "name", ")", ";", "_gpfXmlCheckNoXmlns", "(", "name", ")", ";", "if", "(", "name", "===", "\"xml\"", ")", "{", "gpf", ".", "Error", ".", "...
Check if the given XML namespace prefix name can be defined @param {String} name Namespace prefix name to check @throws {gpf.Error.InvalidXmlNamespacePrefix} @throws {gpf.Error.InvalidXmlUseOfPrefixXmlns} @throws {gpf.Error.InvalidXmlUseOfPrefixXml} @since 0.2.7
[ "Check", "if", "the", "given", "XML", "namespace", "prefix", "name", "can", "be", "defined" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7778-L7784
29,519
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfInterfacesPromisify
function _gpfInterfacesPromisify(interfaceSpecifier) { return function (object) { var iInterfaceImpl = _gpfInterfaceQuery(interfaceSpecifier, object); if (!iInterfaceImpl) { gpf.Error.interfaceExpected({ name: _gpfGetFunctionName(interfaceSpecifier) }); } ...
javascript
function _gpfInterfacesPromisify(interfaceSpecifier) { return function (object) { var iInterfaceImpl = _gpfInterfaceQuery(interfaceSpecifier, object); if (!iInterfaceImpl) { gpf.Error.interfaceExpected({ name: _gpfGetFunctionName(interfaceSpecifier) }); } ...
[ "function", "_gpfInterfacesPromisify", "(", "interfaceSpecifier", ")", "{", "return", "function", "(", "object", ")", "{", "var", "iInterfaceImpl", "=", "_gpfInterfaceQuery", "(", "interfaceSpecifier", ",", "object", ")", ";", "if", "(", "!", "iInterfaceImpl", ")"...
Build promisified interface wrapper @param {Function} interfaceSpecifier Reference interface @return {Function} Interface Wrapper constructor @since 0.2.8
[ "Build", "promisified", "interface", "wrapper" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7807-L7815
29,520
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfAttributesDecorator
function _gpfAttributesDecorator() { var attributes = _gpfArraySlice(arguments); return function (ClassConstructor, member) { if (!_gpfIsClass(ClassConstructor)) { gpf.Error.es6classOnly(); } _gpfAttributesDecoratorAddAttributes(_gpfDefineClassImport(C...
javascript
function _gpfAttributesDecorator() { var attributes = _gpfArraySlice(arguments); return function (ClassConstructor, member) { if (!_gpfIsClass(ClassConstructor)) { gpf.Error.es6classOnly(); } _gpfAttributesDecoratorAddAttributes(_gpfDefineClassImport(C...
[ "function", "_gpfAttributesDecorator", "(", ")", "{", "var", "attributes", "=", "_gpfArraySlice", "(", "arguments", ")", ";", "return", "function", "(", "ClassConstructor", ",", "member", ")", "{", "if", "(", "!", "_gpfIsClass", "(", "ClassConstructor", ")", "...
Bridge ES6 decorators with attributes @param {...gpf.attributes.Attribute} attribute Attributes to add @return {Function} decorator function @throws {gpf.Error.InvalidParameter} @since 0.2.9
[ "Bridge", "ES6", "decorators", "with", "attributes" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L8646-L8654
29,521
popeindustries/buddy
lib/config/buildParser.js
parseBuild
function parseBuild(builds, fileExtensions, fileFactory, npmModulepaths, runtimeOptions, serverConfig, parent, level) { if (!parent) { numBuilds = 0; level = 1; } // Deprecate sources if ('sources' in builds) { warn(DEPRECATED_SOURCES, 1); } // Deprecate targets if ('targets' in builds) { ...
javascript
function parseBuild(builds, fileExtensions, fileFactory, npmModulepaths, runtimeOptions, serverConfig, parent, level) { if (!parent) { numBuilds = 0; level = 1; } // Deprecate sources if ('sources' in builds) { warn(DEPRECATED_SOURCES, 1); } // Deprecate targets if ('targets' in builds) { ...
[ "function", "parseBuild", "(", "builds", ",", "fileExtensions", ",", "fileFactory", ",", "npmModulepaths", ",", "runtimeOptions", ",", "serverConfig", ",", "parent", ",", "level", ")", "{", "if", "(", "!", "parent", ")", "{", "numBuilds", "=", "0", ";", "l...
Parse and validate build targets @param {Array} builds @param {Object} fileExtensions @param {Function} fileFactory @param {Array} npmModulepaths @param {Object} runtimeOptions @param {Object} serverConfig @param {Object} [parent] @param {Number} [level] @returns {Array}
[ "Parse", "and", "validate", "build", "targets" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L54-L151
29,522
popeindustries/buddy
lib/config/buildParser.js
getFileFactoryOptions
function getFileFactoryOptions(build, parent, version, options, fileFactoryOptions) { const { fileFactory, runtimeOptions } = fileFactoryOptions; const hasPlugins = parent ? !!(options || version) : true; const needsPlugins = 'input' in build && build.input != null && !build.watchOnly; fileFactoryOptions.brows...
javascript
function getFileFactoryOptions(build, parent, version, options, fileFactoryOptions) { const { fileFactory, runtimeOptions } = fileFactoryOptions; const hasPlugins = parent ? !!(options || version) : true; const needsPlugins = 'input' in build && build.input != null && !build.watchOnly; fileFactoryOptions.brows...
[ "function", "getFileFactoryOptions", "(", "build", ",", "parent", ",", "version", ",", "options", ",", "fileFactoryOptions", ")", "{", "const", "{", "fileFactory", ",", "runtimeOptions", "}", "=", "fileFactoryOptions", ";", "const", "hasPlugins", "=", "parent", ...
Retrieve file factory options for 'build' @param {Build} build @param {Build} [parent] @param {Object} version @param {Object} options @param {Object} fileFactoryOptions @returns {Function}
[ "Retrieve", "file", "factory", "options", "for", "build" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L162-L189
29,523
popeindustries/buddy
lib/config/buildParser.js
getBuildFactory
function getBuildFactory(build) { return function createBuild(inputpath, outputname) { const input = path.relative(process.cwd(), inputpath); let parent = build; if (!parent.builds.some(build => build.input == input)) { const outputpath = path.join(path.dirname(parent.outputpaths[0]), outputname); ...
javascript
function getBuildFactory(build) { return function createBuild(inputpath, outputname) { const input = path.relative(process.cwd(), inputpath); let parent = build; if (!parent.builds.some(build => build.input == input)) { const outputpath = path.join(path.dirname(parent.outputpaths[0]), outputname); ...
[ "function", "getBuildFactory", "(", "build", ")", "{", "return", "function", "createBuild", "(", "inputpath", ",", "outputname", ")", "{", "const", "input", "=", "path", ".", "relative", "(", "process", ".", "cwd", "(", ")", ",", "inputpath", ")", ";", "...
Retrieve build factory for 'build' @param {Object} build @returns {Function}
[ "Retrieve", "build", "factory", "for", "build" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L196-L244
29,524
popeindustries/buddy
lib/config/buildParser.js
parseChildInputpaths
function parseChildInputpaths(build) { function parse(build) { let inputpaths = []; build.forEach(build => { inputpaths = inputpaths.concat(build.inputpaths, build.builds ? parse(build.builds) : []); }); return inputpaths; } build.childInputpaths = parse(build.builds); }
javascript
function parseChildInputpaths(build) { function parse(build) { let inputpaths = []; build.forEach(build => { inputpaths = inputpaths.concat(build.inputpaths, build.builds ? parse(build.builds) : []); }); return inputpaths; } build.childInputpaths = parse(build.builds); }
[ "function", "parseChildInputpaths", "(", "build", ")", "{", "function", "parse", "(", "build", ")", "{", "let", "inputpaths", "=", "[", "]", ";", "build", ".", "forEach", "(", "build", "=>", "{", "inputpaths", "=", "inputpaths", ".", "concat", "(", "buil...
Parse nested child input paths @param {Build} build
[ "Parse", "nested", "child", "input", "paths" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L425-L437
29,525
popeindustries/buddy
lib/config/buildParser.js
isAppServer
function isAppServer(inputpaths, serverConfig) { // Test if 'p' is in 'dirs' function contains(dirs, p) { if (!Array.isArray(dirs)) dirs = [dirs]; return dirs.some(dir => { return indir(dir, p); }); } return serverConfig != undefined && serverConfig.file != undefined && contains(inputpaths, s...
javascript
function isAppServer(inputpaths, serverConfig) { // Test if 'p' is in 'dirs' function contains(dirs, p) { if (!Array.isArray(dirs)) dirs = [dirs]; return dirs.some(dir => { return indir(dir, p); }); } return serverConfig != undefined && serverConfig.file != undefined && contains(inputpaths, s...
[ "function", "isAppServer", "(", "inputpaths", ",", "serverConfig", ")", "{", "// Test if 'p' is in 'dirs'", "function", "contains", "(", "dirs", ",", "p", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "dirs", ")", ")", "dirs", "=", "[", "dirs", ...
Determine if 'inputpaths' contain server file @param {Array} inputpaths @param {Object} serverConfig @returns {Boolean}
[ "Determine", "if", "inputpaths", "contain", "server", "file" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L445-L455
29,526
popeindustries/buddy
lib/config/buildParser.js
contains
function contains(dirs, p) { if (!Array.isArray(dirs)) dirs = [dirs]; return dirs.some(dir => { return indir(dir, p); }); }
javascript
function contains(dirs, p) { if (!Array.isArray(dirs)) dirs = [dirs]; return dirs.some(dir => { return indir(dir, p); }); }
[ "function", "contains", "(", "dirs", ",", "p", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "dirs", ")", ")", "dirs", "=", "[", "dirs", "]", ";", "return", "dirs", ".", "some", "(", "dir", "=>", "{", "return", "indir", "(", "dir", ",...
Test if 'p' is in 'dirs'
[ "Test", "if", "p", "is", "in", "dirs" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildParser.js#L447-L452
29,527
babel/acorn-to-esprima
src/convertTemplateType.js
createTemplateValue
function createTemplateValue(start, end) { var value = ""; while (start <= end) { if (tokens[start].value) { value += tokens[start].value; } else if (tokens[start].type !== tt.template) { value += tokens[start].type.label; } start++; } return value; }
javascript
function createTemplateValue(start, end) { var value = ""; while (start <= end) { if (tokens[start].value) { value += tokens[start].value; } else if (tokens[start].type !== tt.template) { value += tokens[start].type.label; } start++; } return value; }
[ "function", "createTemplateValue", "(", "start", ",", "end", ")", "{", "var", "value", "=", "\"\"", ";", "while", "(", "start", "<=", "end", ")", "{", "if", "(", "tokens", "[", "start", "]", ".", "value", ")", "{", "value", "+=", "tokens", "[", "st...
append the values between start and end
[ "append", "the", "values", "between", "start", "and", "end" ]
b20845f56af9a02b4e7ae45a97a53702e480ec34
https://github.com/babel/acorn-to-esprima/blob/b20845f56af9a02b4e7ae45a97a53702e480ec34/src/convertTemplateType.js#L23-L34
29,528
babel/acorn-to-esprima
src/convertTemplateType.js
replaceWithTemplateType
function replaceWithTemplateType(start, end) { var templateToken = { type: "Template", value: createTemplateValue(start, end), start: tokens[start].start, end: tokens[end].end, loc: { start: tokens[start].loc.start, end: tokens[end].loc.end } }; // put ne...
javascript
function replaceWithTemplateType(start, end) { var templateToken = { type: "Template", value: createTemplateValue(start, end), start: tokens[start].start, end: tokens[end].end, loc: { start: tokens[start].loc.start, end: tokens[end].loc.end } }; // put ne...
[ "function", "replaceWithTemplateType", "(", "start", ",", "end", ")", "{", "var", "templateToken", "=", "{", "type", ":", "\"Template\"", ",", "value", ":", "createTemplateValue", "(", "start", ",", "end", ")", ",", "start", ":", "tokens", "[", "start", "]...
create Template token
[ "create", "Template", "token" ]
b20845f56af9a02b4e7ae45a97a53702e480ec34
https://github.com/babel/acorn-to-esprima/blob/b20845f56af9a02b4e7ae45a97a53702e480ec34/src/convertTemplateType.js#L37-L51
29,529
ArnaudBuchholz/gpf-js
lost+found/src/mimetype.js
_gpfBuildMimeTypeFromMappings
function _gpfBuildMimeTypeFromMappings (path, mappings) { _gpfObjectForEach(mappings, function (extensions, key) { var mimeType = path + key; if (0 === extensions) { _createMimeTypeExtensionMapping(mimeType, "." + key); } else if ("string" === typeof extensions) { ex...
javascript
function _gpfBuildMimeTypeFromMappings (path, mappings) { _gpfObjectForEach(mappings, function (extensions, key) { var mimeType = path + key; if (0 === extensions) { _createMimeTypeExtensionMapping(mimeType, "." + key); } else if ("string" === typeof extensions) { ex...
[ "function", "_gpfBuildMimeTypeFromMappings", "(", "path", ",", "mappings", ")", "{", "_gpfObjectForEach", "(", "mappings", ",", "function", "(", "extensions", ",", "key", ")", "{", "var", "mimeType", "=", "path", "+", "key", ";", "if", "(", "0", "===", "ex...
Recursive function that fills _gpfMimeTypesToExtension & _gpfMimeTypesFromExtension @param {String} path @param {Object} mappings @private
[ "Recursive", "function", "that", "fills", "_gpfMimeTypesToExtension", "&", "_gpfMimeTypesFromExtension" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/mimetype.js#L60-L75
29,530
popeindustries/buddy
lib/resolver/package.js
resolvePath
function resolvePath(filepath) { filepath = filepath.replace(RE_TRAILING, ''); const cwd = process.cwd(); const npmPackage = filepath.includes('node_modules'); // Find nearest node_modules directory if (npmPackage) { const parts = filepath.split(path.sep); let idx = parts.lastIndexOf('node_modules');...
javascript
function resolvePath(filepath) { filepath = filepath.replace(RE_TRAILING, ''); const cwd = process.cwd(); const npmPackage = filepath.includes('node_modules'); // Find nearest node_modules directory if (npmPackage) { const parts = filepath.split(path.sep); let idx = parts.lastIndexOf('node_modules');...
[ "function", "resolvePath", "(", "filepath", ")", "{", "filepath", "=", "filepath", ".", "replace", "(", "RE_TRAILING", ",", "''", ")", ";", "const", "cwd", "=", "process", ".", "cwd", "(", ")", ";", "const", "npmPackage", "=", "filepath", ".", "includes"...
Resolve package path from 'filepath' @param {String} filepath @returns {String}
[ "Resolve", "package", "path", "from", "filepath" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/resolver/package.js#L124-L168
29,531
popeindustries/buddy
lib/resolver/package.js
resolveName
function resolveName(pkgpath) { pkgpath = pkgpath.replace(RE_TRAILING, ''); const cwd = process.cwd(); const parts = pkgpath.split(path.sep); const len = parts.length; let idx = 1; // Handle packages nested under root if (!pkgpath.includes('node_modules') && cwd != pkgpath) { // Increase by distanc...
javascript
function resolveName(pkgpath) { pkgpath = pkgpath.replace(RE_TRAILING, ''); const cwd = process.cwd(); const parts = pkgpath.split(path.sep); const len = parts.length; let idx = 1; // Handle packages nested under root if (!pkgpath.includes('node_modules') && cwd != pkgpath) { // Increase by distanc...
[ "function", "resolveName", "(", "pkgpath", ")", "{", "pkgpath", "=", "pkgpath", ".", "replace", "(", "RE_TRAILING", ",", "''", ")", ";", "const", "cwd", "=", "process", ".", "cwd", "(", ")", ";", "const", "parts", "=", "pkgpath", ".", "split", "(", "...
Resolve package name from 'pkgpath' @param {String} pkgpath @returns {String}
[ "Resolve", "package", "name", "from", "pkgpath" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/resolver/package.js#L175-L194
29,532
popeindustries/buddy
lib/resolver/package.js
resolveId
function resolveId(details, filepath) { let id = ''; if ('string' == typeof filepath) { // Only version if more than one package const version = details.id.includes(versionDelimiter) ? versionDelimiter + details.version : ''; const versioned = (id, stripExtension) => { // Strip extension if...
javascript
function resolveId(details, filepath) { let id = ''; if ('string' == typeof filepath) { // Only version if more than one package const version = details.id.includes(versionDelimiter) ? versionDelimiter + details.version : ''; const versioned = (id, stripExtension) => { // Strip extension if...
[ "function", "resolveId", "(", "details", ",", "filepath", ")", "{", "let", "id", "=", "''", ";", "if", "(", "'string'", "==", "typeof", "filepath", ")", "{", "// Only version if more than one package", "const", "version", "=", "details", ".", "id", ".", "inc...
Resolve id for 'filepath' @param {Object} details @param {String} filepath @returns {String}
[ "Resolve", "id", "for", "filepath" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/resolver/package.js#L202-L242
29,533
popeindustries/buddy
lib/resolver/package.js
resolveNodeModules
function resolveNodeModules(pkgpath) { let dir = pkgpath; let dirs = []; let depth = maxFileSystemDepth; let parent; let nodeModulespath; while (true) { parent = path.dirname(dir); // Stop if we hit max file system depth or root // Convert to lowercase to fix problems on Windows if (!--dept...
javascript
function resolveNodeModules(pkgpath) { let dir = pkgpath; let dirs = []; let depth = maxFileSystemDepth; let parent; let nodeModulespath; while (true) { parent = path.dirname(dir); // Stop if we hit max file system depth or root // Convert to lowercase to fix problems on Windows if (!--dept...
[ "function", "resolveNodeModules", "(", "pkgpath", ")", "{", "let", "dir", "=", "pkgpath", ";", "let", "dirs", "=", "[", "]", ";", "let", "depth", "=", "maxFileSystemDepth", ";", "let", "parent", ";", "let", "nodeModulespath", ";", "while", "(", "true", "...
Gather all node_modules directories reachable from 'pkgpath' @param {String} pkgpath @returns {Array}
[ "Gather", "all", "node_modules", "directories", "reachable", "from", "pkgpath" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/resolver/package.js#L249-L273
29,534
ArnaudBuchholz/gpf-js
lost+found/src/interfaces_.js
_gpfIsImplementedBy
function _gpfIsImplementedBy (inspectedObject, interfaceDefinition) { var member, memberReference, memberValue, memberType; /* * IMPORTANT note: we test the object itself (i.e. own members and the prototype). * That's why the hasOwnProperty is skipped */ /*jslint forin...
javascript
function _gpfIsImplementedBy (inspectedObject, interfaceDefinition) { var member, memberReference, memberValue, memberType; /* * IMPORTANT note: we test the object itself (i.e. own members and the prototype). * That's why the hasOwnProperty is skipped */ /*jslint forin...
[ "function", "_gpfIsImplementedBy", "(", "inspectedObject", ",", "interfaceDefinition", ")", "{", "var", "member", ",", "memberReference", ",", "memberValue", ",", "memberType", ";", "/*\n * IMPORTANT note: we test the object itself (i.e. own members and the prototype).\n * ...
Verify that the object implements the current interface @param {Object} inspectedObject Object (or class) to inspect @param {gpf.interfaces.Interface} interfaceDefinition Reference interface @return {Boolean} True if implemented
[ "Verify", "that", "the", "object", "implements", "the", "current", "interface" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/interfaces_.js#L31-L56
29,535
ArnaudBuchholz/gpf-js
lost+found/src/interfaces_.js
_wrapQueryInterface
function _wrapQueryInterface (orgQueryInterface) { return function (interfaceDefinition) { /*eslint-disable no-invalid-this*/ _gpfIgnore(interfaceDefinition); var result = _queryInterface.apply(this, arguments); if (null === result) { result = orgQueryInterface.apply(this...
javascript
function _wrapQueryInterface (orgQueryInterface) { return function (interfaceDefinition) { /*eslint-disable no-invalid-this*/ _gpfIgnore(interfaceDefinition); var result = _queryInterface.apply(this, arguments); if (null === result) { result = orgQueryInterface.apply(this...
[ "function", "_wrapQueryInterface", "(", "orgQueryInterface", ")", "{", "return", "function", "(", "interfaceDefinition", ")", "{", "/*eslint-disable no-invalid-this*/", "_gpfIgnore", "(", "interfaceDefinition", ")", ";", "var", "result", "=", "_queryInterface", ".", "ap...
Creates a wrapper calling _queryInterface and, if no result is built, the original one defined in the object prototype @param {Function} orgQueryInterface Interface to retreive @return {Function} Default queryInterface implementation @gpf:closure
[ "Creates", "a", "wrapper", "calling", "_queryInterface", "and", "if", "no", "result", "is", "built", "the", "original", "one", "defined", "in", "the", "object", "prototype" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/interfaces_.js#L238-L249
29,536
popeindustries/buddy
lib/build.js
generatePathString
function generatePathString(paths) { let pathString = ''; if (!paths || !paths.length) return pathString; if (paths.length > 1) { pathString = paths.map(pathItem => filepathName(pathItem)); // Trim long lists if (pathString.length > maxInputStringLength) { const remainder = pathString.length -...
javascript
function generatePathString(paths) { let pathString = ''; if (!paths || !paths.length) return pathString; if (paths.length > 1) { pathString = paths.map(pathItem => filepathName(pathItem)); // Trim long lists if (pathString.length > maxInputStringLength) { const remainder = pathString.length -...
[ "function", "generatePathString", "(", "paths", ")", "{", "let", "pathString", "=", "''", ";", "if", "(", "!", "paths", "||", "!", "paths", ".", "length", ")", "return", "pathString", ";", "if", "(", "paths", ".", "length", ">", "1", ")", "{", "pathS...
Generate path string for 'paths' @param {Array} paths @returns {String}
[ "Generate", "path", "string", "for", "paths" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/build.js#L544-L566
29,537
popeindustries/buddy
lib/config/buildPlugins.js
loadPluginsForType
function loadPluginsForType(type, options, version, compress) { // Start with default if available let plugins = type in allPlugins && allPlugins[type].default ? allPlugins[type].default.slice() : []; // Add plugins based on version presets plugins = version.reduce((plugins, preset) => { let presetPlugins;...
javascript
function loadPluginsForType(type, options, version, compress) { // Start with default if available let plugins = type in allPlugins && allPlugins[type].default ? allPlugins[type].default.slice() : []; // Add plugins based on version presets plugins = version.reduce((plugins, preset) => { let presetPlugins;...
[ "function", "loadPluginsForType", "(", "type", ",", "options", ",", "version", ",", "compress", ")", "{", "// Start with default if available", "let", "plugins", "=", "type", "in", "allPlugins", "&&", "allPlugins", "[", "type", "]", ".", "default", "?", "allPlug...
Load plugins for 'type' @param {String} type @param {Object} options @param {Array} version @param {Boolean} compress
[ "Load", "plugins", "for", "type" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildPlugins.js#L154-L240
29,538
popeindustries/buddy
lib/config/buildPlugins.js
extractDependencyIds
function extractDependencyIds(options) { const dependencies = []; function extract(items) { // Invalid if not Array if (Array.isArray(items)) { items.reduce((dependencies, item) => { // Items can be Array with depedency as first param const dep = Array.isArray(item) ? item[0] : item; ...
javascript
function extractDependencyIds(options) { const dependencies = []; function extract(items) { // Invalid if not Array if (Array.isArray(items)) { items.reduce((dependencies, item) => { // Items can be Array with depedency as first param const dep = Array.isArray(item) ? item[0] : item; ...
[ "function", "extractDependencyIds", "(", "options", ")", "{", "const", "dependencies", "=", "[", "]", ";", "function", "extract", "(", "items", ")", "{", "// Invalid if not Array", "if", "(", "Array", ".", "isArray", "(", "items", ")", ")", "{", "items", "...
Extract dependency ids from 'options' @param {Object} options @returns {Array}
[ "Extract", "dependency", "ids", "from", "options" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildPlugins.js#L247-L268
29,539
popeindustries/buddy
lib/config/buildPlugins.js
resolveDependencyPaths
function resolveDependencyPaths(options) { function init(items) { // Invalid if not Array if (Array.isArray(items)) { items.forEach((item, idx, items) => { const isArray = Array.isArray(item); const id = isArray ? item[0] : item; // Ignore already resolved if ('string' =...
javascript
function resolveDependencyPaths(options) { function init(items) { // Invalid if not Array if (Array.isArray(items)) { items.forEach((item, idx, items) => { const isArray = Array.isArray(item); const id = isArray ? item[0] : item; // Ignore already resolved if ('string' =...
[ "function", "resolveDependencyPaths", "(", "options", ")", "{", "function", "init", "(", "items", ")", "{", "// Invalid if not Array", "if", "(", "Array", ".", "isArray", "(", "items", ")", ")", "{", "items", ".", "forEach", "(", "(", "item", ",", "idx", ...
Resolve dependency paths in 'options' to modules @param {Object} options
[ "Resolve", "dependency", "paths", "in", "options", "to", "modules" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildPlugins.js#L274-L300
29,540
popeindustries/buddy
lib/config/buildPlugins.js
resolvePluginsForBrowsers
function resolvePluginsForBrowsers(browsers) { const plugins = []; if (!Array.isArray(browsers)) browsers = [browsers]; browsers.forEach(browser => { const name = Object.keys(browser)[0]; const version = browser[name]; for (const pluginName in babelPluginsByEnvironmentVersion) { if ( ...
javascript
function resolvePluginsForBrowsers(browsers) { const plugins = []; if (!Array.isArray(browsers)) browsers = [browsers]; browsers.forEach(browser => { const name = Object.keys(browser)[0]; const version = browser[name]; for (const pluginName in babelPluginsByEnvironmentVersion) { if ( ...
[ "function", "resolvePluginsForBrowsers", "(", "browsers", ")", "{", "const", "plugins", "=", "[", "]", ";", "if", "(", "!", "Array", ".", "isArray", "(", "browsers", ")", ")", "browsers", "=", "[", "browsers", "]", ";", "browsers", ".", "forEach", "(", ...
Resolve Babel plugins for all 'browsers' @param {Array} browsers @returns {Array}
[ "Resolve", "Babel", "plugins", "for", "all", "browsers" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buildPlugins.js#L307-L327
29,541
zetapush/zetapush
packages/cometd/lib/CometD.js
_send
function _send(sync, messages, metaConnect, extraPath) { // We must be sure that the messages have a clientId. // This is not guaranteed since the handshake may take time to return // (and hence the clientId is not known yet) and the application // may create other messages. for ...
javascript
function _send(sync, messages, metaConnect, extraPath) { // We must be sure that the messages have a clientId. // This is not guaranteed since the handshake may take time to return // (and hence the clientId is not known yet) and the application // may create other messages. for ...
[ "function", "_send", "(", "sync", ",", "messages", ",", "metaConnect", ",", "extraPath", ")", "{", "// We must be sure that the messages have a clientId.", "// This is not guaranteed since the handshake may take time to return", "// (and hence the clientId is not known yet) and the appli...
Delivers the messages to the CometD server @param sync whether the send is synchronous @param messages the array of messages to send @param metaConnect true if this send is on /meta/connect @param extraPath an extra path to append to the Bayeux server URL
[ "Delivers", "the", "messages", "to", "the", "CometD", "server" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/cometd/lib/CometD.js#L420-L482
29,542
zetapush/zetapush
packages/cometd/lib/CometD.js
_endBatch
function _endBatch() { --_batch; _cometd._debug('Ending batch, depth', _batch); if (_batch < 0) { throw 'Calls to startBatch() and endBatch() are not paired'; } if (_batch === 0 && !_isDisconnected() && !_internalBatch) { _flushBatch(); } }
javascript
function _endBatch() { --_batch; _cometd._debug('Ending batch, depth', _batch); if (_batch < 0) { throw 'Calls to startBatch() and endBatch() are not paired'; } if (_batch === 0 && !_isDisconnected() && !_internalBatch) { _flushBatch(); } }
[ "function", "_endBatch", "(", ")", "{", "--", "_batch", ";", "_cometd", ".", "_debug", "(", "'Ending batch, depth'", ",", "_batch", ")", ";", "if", "(", "_batch", "<", "0", ")", "{", "throw", "'Calls to startBatch() and endBatch() are not paired'", ";", "}", "...
Ends the batch of messages to be sent in a single request, optionally sending messages present in the message queue depending on the given argument. @see #_startBatch()
[ "Ends", "the", "batch", "of", "messages", "to", "be", "sent", "in", "a", "single", "request", "optionally", "sending", "messages", "present", "in", "the", "message", "queue", "depending", "on", "the", "given", "argument", "." ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/cometd/lib/CometD.js#L535-L545
29,543
zetapush/zetapush
packages/cometd/lib/CometD.js
_connect
function _connect() { if (!_isDisconnected()) { var bayeuxMessage = { id: _nextMessageId(), channel: '/meta/connect', connectionType: _transport.getType() }; // In case of reload or temporary loss of connection // w...
javascript
function _connect() { if (!_isDisconnected()) { var bayeuxMessage = { id: _nextMessageId(), channel: '/meta/connect', connectionType: _transport.getType() }; // In case of reload or temporary loss of connection // w...
[ "function", "_connect", "(", ")", "{", "if", "(", "!", "_isDisconnected", "(", ")", ")", "{", "var", "bayeuxMessage", "=", "{", "id", ":", "_nextMessageId", "(", ")", ",", "channel", ":", "'/meta/connect'", ",", "connectionType", ":", "_transport", ".", ...
Sends the connect message
[ "Sends", "the", "connect", "message" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/cometd/lib/CometD.js#L550-L571
29,544
zetapush/zetapush
packages/cometd/lib/CometD.js
_handshake
function _handshake(handshakeProps, handshakeCallback) { if (_isFunction(handshakeProps)) { handshakeCallback = handshakeProps; handshakeProps = undefined; } _clientId = null; _clearSubscriptions(); // Reset the transports if we're not retrying the hand...
javascript
function _handshake(handshakeProps, handshakeCallback) { if (_isFunction(handshakeProps)) { handshakeCallback = handshakeProps; handshakeProps = undefined; } _clientId = null; _clearSubscriptions(); // Reset the transports if we're not retrying the hand...
[ "function", "_handshake", "(", "handshakeProps", ",", "handshakeCallback", ")", "{", "if", "(", "_isFunction", "(", "handshakeProps", ")", ")", "{", "handshakeCallback", "=", "handshakeProps", ";", "handshakeProps", "=", "undefined", ";", "}", "_clientId", "=", ...
Sends the initial handshake message
[ "Sends", "the", "initial", "handshake", "message" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/cometd/lib/CometD.js#L623-L702
29,545
GitbookIO/plugin-quizzes
lib/retro.js
retro
function retro(content) { // Lex incoming markdown file var lexed = lex(content); // Break it into sections var newSections = sections.split(lexed) .map(function(section) { // Leave non quiz sections untouched if(!isQuiz(section)) { return section; } // C...
javascript
function retro(content) { // Lex incoming markdown file var lexed = lex(content); // Break it into sections var newSections = sections.split(lexed) .map(function(section) { // Leave non quiz sections untouched if(!isQuiz(section)) { return section; } // C...
[ "function", "retro", "(", "content", ")", "{", "// Lex incoming markdown file", "var", "lexed", "=", "lex", "(", "content", ")", ";", "// Break it into sections", "var", "newSections", "=", "sections", ".", "split", "(", "lexed", ")", ".", "map", "(", "functio...
retro takes an input markdown file and outputs a new markdown file converting in the process old quizs to new ones
[ "retro", "takes", "an", "input", "markdown", "file", "and", "outputs", "a", "new", "markdown", "file", "converting", "in", "the", "process", "old", "quizs", "to", "new", "ones" ]
02a54e4149454c77c9e5cbbe9e938c7b4684ddaf
https://github.com/GitbookIO/plugin-quizzes/blob/02a54e4149454c77c9e5cbbe9e938c7b4684ddaf/lib/retro.js#L57-L77
29,546
ArnaudBuchholz/gpf-js
lost+found/src/interfaces/enumerator_.js
_gpfEnumeratorEach
function _gpfEnumeratorEach (enumerator, callback, eventsHandler) { var iEnumerator = _gpfI.query(enumerator, _gpfI.IEnumerator), process; function end (event) { _gpfEventsFire.call(enumerator, event, {}, eventsHandler); } if (1 < callback.length) { process = function (event) { ...
javascript
function _gpfEnumeratorEach (enumerator, callback, eventsHandler) { var iEnumerator = _gpfI.query(enumerator, _gpfI.IEnumerator), process; function end (event) { _gpfEventsFire.call(enumerator, event, {}, eventsHandler); } if (1 < callback.length) { process = function (event) { ...
[ "function", "_gpfEnumeratorEach", "(", "enumerator", ",", "callback", ",", "eventsHandler", ")", "{", "var", "iEnumerator", "=", "_gpfI", ".", "query", "(", "enumerator", ",", "_gpfI", ".", "IEnumerator", ")", ",", "process", ";", "function", "end", "(", "ev...
Enumerates all elements of the enumerator and call the callback function. NOTE: reset is *not* called. NOTE: if an error occurs during the enumeration, the process stops @param {gpf.interfaces.IEnumerator} enumerator @param {Function} callback receive each item of the enumerator, signature is either: - {*} element or...
[ "Enumerates", "all", "elements", "of", "the", "enumerator", "and", "call", "the", "callback", "function", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/interfaces/enumerator_.js#L53-L89
29,547
ArnaudBuchholz/gpf-js
lost+found/src/interfaces/enumerator_.js
_gpfArrayEnumerator
function _gpfArrayEnumerator (array) { var pos = -1; return { reset: function () { pos = -1; }, moveNext: function (eventsHandler) { var result; ++pos; result = pos < array.length; if (!result && eventsHandler) { ...
javascript
function _gpfArrayEnumerator (array) { var pos = -1; return { reset: function () { pos = -1; }, moveNext: function (eventsHandler) { var result; ++pos; result = pos < array.length; if (!result && eventsHandler) { ...
[ "function", "_gpfArrayEnumerator", "(", "array", ")", "{", "var", "pos", "=", "-", "1", ";", "return", "{", "reset", ":", "function", "(", ")", "{", "pos", "=", "-", "1", ";", "}", ",", "moveNext", ":", "function", "(", "eventsHandler", ")", "{", "...
Builds an enumerable interface based on an array @param {Object[]} array Base of the enumeration @return {Object} Object implementing the IEnumerable interface
[ "Builds", "an", "enumerable", "interface", "based", "on", "an", "array" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/interfaces/enumerator_.js#L97-L116
29,548
ArnaudBuchholz/gpf-js
lost+found/src/interfaces/enumerator_.js
_buildEnumeratorOnObjectArray
function _buildEnumeratorOnObjectArray (object) { var attributes = new _gpfA.Map(object).filter(_gpfA.EnumerableAttribute), members = attributes.getMembers(); return _gpfArrayEnumerator(object[members[0]]); }
javascript
function _buildEnumeratorOnObjectArray (object) { var attributes = new _gpfA.Map(object).filter(_gpfA.EnumerableAttribute), members = attributes.getMembers(); return _gpfArrayEnumerator(object[members[0]]); }
[ "function", "_buildEnumeratorOnObjectArray", "(", "object", ")", "{", "var", "attributes", "=", "new", "_gpfA", ".", "Map", "(", "object", ")", ".", "filter", "(", "_gpfA", ".", "EnumerableAttribute", ")", ",", "members", "=", "attributes", ".", "getMembers", ...
Interface builder that connects to the EnumerableAttribute attribute @param {Object} object @return {Object} Object implementing the IEnumerable interface
[ "Interface", "builder", "that", "connects", "to", "the", "EnumerableAttribute", "attribute" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/interfaces/enumerator_.js#L183-L187
29,549
ArnaudBuchholz/gpf-js
lost+found/src/attributes/attributes.js
function (objPrototype) { var me = this, statics = _gpfA.AttrConstraintAttribute, originalAlterPrototype = statics.originalAlterPrototype, attributes = new _gpfA.Map(me); // Get constraints set for THIS attribute ...
javascript
function (objPrototype) { var me = this, statics = _gpfA.AttrConstraintAttribute, originalAlterPrototype = statics.originalAlterPrototype, attributes = new _gpfA.Map(me); // Get constraints set for THIS attribute ...
[ "function", "(", "objPrototype", ")", "{", "var", "me", "=", "this", ",", "statics", "=", "_gpfA", ".", "AttrConstraintAttribute", ",", "originalAlterPrototype", "=", "statics", ".", "originalAlterPrototype", ",", "attributes", "=", "new", "_gpfA", ".", "Map", ...
Check that all attribute constraints are respected before calling the original _alterPrototype @param {Object} objPrototype @this {gpf.attributes.Attribute} the child class attribute
[ "Check", "that", "all", "attribute", "constraints", "are", "respected", "before", "calling", "the", "original", "_alterPrototype" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/attributes/attributes.js#L108-L121
29,550
GitbookIO/plugin-quizzes
lib/section2obj.js
render
function render(lexed) { // Options to parser var options = Object.create(kramed.defaults); options.renderer = renderer(); if(!lexed.links) { lexed.links = {}; } return kramed.parser(lexed, options); }
javascript
function render(lexed) { // Options to parser var options = Object.create(kramed.defaults); options.renderer = renderer(); if(!lexed.links) { lexed.links = {}; } return kramed.parser(lexed, options); }
[ "function", "render", "(", "lexed", ")", "{", "// Options to parser", "var", "options", "=", "Object", ".", "create", "(", "kramed", ".", "defaults", ")", ";", "options", ".", "renderer", "=", "renderer", "(", ")", ";", "if", "(", "!", "lexed", ".", "l...
Render a section using our custom renderer
[ "Render", "a", "section", "using", "our", "custom", "renderer" ]
02a54e4149454c77c9e5cbbe9e938c7b4684ddaf
https://github.com/GitbookIO/plugin-quizzes/blob/02a54e4149454c77c9e5cbbe9e938c7b4684ddaf/lib/section2obj.js#L7-L17
29,551
ArnaudBuchholz/gpf-js
lost+found/src/bin.js
_gpfSkipPad
function _gpfSkipPad (text, pad) { var idx = 0; while (idx < text.length && -1 !== pad.indexOf(text.charAt(idx))) { ++idx; } return idx; }
javascript
function _gpfSkipPad (text, pad) { var idx = 0; while (idx < text.length && -1 !== pad.indexOf(text.charAt(idx))) { ++idx; } return idx; }
[ "function", "_gpfSkipPad", "(", "text", ",", "pad", ")", "{", "var", "idx", "=", "0", ";", "while", "(", "idx", "<", "text", ".", "length", "&&", "-", "1", "!==", "pad", ".", "indexOf", "(", "text", ".", "charAt", "(", "idx", ")", ")", ")", "{"...
region _gpfFromBaseANY Skip initial padding characters
[ "region", "_gpfFromBaseANY", "Skip", "initial", "padding", "characters" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/bin.js#L107-L113
29,552
ArnaudBuchholz/gpf-js
lost+found/src/bin.js
_gpfFromBaseANY
function _gpfFromBaseANY (base, text, pad) { var baseLength = base.length, result = 0, idx = _gpfSkipPad(text, pad || base.charAt(0)); while (idx < text.length) { result = baseLength * result + base.indexOf(text.charAt(idx++)); } return result; }
javascript
function _gpfFromBaseANY (base, text, pad) { var baseLength = base.length, result = 0, idx = _gpfSkipPad(text, pad || base.charAt(0)); while (idx < text.length) { result = baseLength * result + base.indexOf(text.charAt(idx++)); } return result; }
[ "function", "_gpfFromBaseANY", "(", "base", ",", "text", ",", "pad", ")", "{", "var", "baseLength", "=", "base", ".", "length", ",", "result", "=", "0", ",", "idx", "=", "_gpfSkipPad", "(", "text", ",", "pad", "||", "base", ".", "charAt", "(", "0", ...
Decodes the text value using the specified base. @param {String} base @param {String} text @param {String} [pad=base.charAt(0)] pad @return {Number}
[ "Decodes", "the", "text", "value", "using", "the", "specified", "base", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/bin.js#L123-L131
29,553
ArnaudBuchholz/gpf-js
lost+found/src/bin.js
_gpfPow2
function _gpfPow2 (n) { var result = _gpfPow2[n]; if (result) { return result; } result = _gpfComputePow2(n); _gpfPow2[n] = result; return result; }
javascript
function _gpfPow2 (n) { var result = _gpfPow2[n]; if (result) { return result; } result = _gpfComputePow2(n); _gpfPow2[n] = result; return result; }
[ "function", "_gpfPow2", "(", "n", ")", "{", "var", "result", "=", "_gpfPow2", "[", "n", "]", ";", "if", "(", "result", ")", "{", "return", "result", ";", "}", "result", "=", "_gpfComputePow2", "(", "n", ")", ";", "_gpfPow2", "[", "n", "]", "=", "...
Gives the power of 2 @param {Number} n the power to get @return {Number}
[ "Gives", "the", "power", "of", "2" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/bin.js#L161-L169
29,554
ArnaudBuchholz/gpf-js
lost+found/src/bin.js
function (value, length, pad) { return _gpfToBaseANY(_gpfB16, value, { length: length, pad: pad }); }
javascript
function (value, length, pad) { return _gpfToBaseANY(_gpfB16, value, { length: length, pad: pad }); }
[ "function", "(", "value", ",", "length", ",", "pad", ")", "{", "return", "_gpfToBaseANY", "(", "_gpfB16", ",", "value", ",", "{", "length", ":", "length", ",", "pad", ":", "pad", "}", ")", ";", "}" ]
Returns the hexadecimal encoding of value. @param {Number} value @param {Number} length of encoding @param {String} [pad="0"] pad @return {String}
[ "Returns", "the", "hexadecimal", "encoding", "of", "value", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/bin.js#L220-L225
29,555
ArnaudBuchholz/gpf-js
lost+found/src/bin.js
function (value, length, pad) { return _gpfToBaseANY(_gpfB64, value, { length: length, pad: pad }); }
javascript
function (value, length, pad) { return _gpfToBaseANY(_gpfB64, value, { length: length, pad: pad }); }
[ "function", "(", "value", ",", "length", ",", "pad", ")", "{", "return", "_gpfToBaseANY", "(", "_gpfB64", ",", "value", ",", "{", "length", ":", "length", ",", "pad", ":", "pad", "}", ")", ";", "}" ]
Returns the base 64 encoding of value. @param {Number} value @param {Number} length of encoding @param {String} [pad="0"] pad @return {String}
[ "Returns", "the", "base", "64", "encoding", "of", "value", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/bin.js#L246-L251
29,556
zetapush/zetapush
packages/user-management/samples/standard-user-workflow/front/js/login.js
connectUser
async function connectUser(form) { if (!form.login.value || !form.password.value) { document.getElementById('login-errors').innerHTML += `<p>Login and password are required</p>`; return; } await client.setCredentials({ login: form.login.value, password: form.password.value }); client .connect() ...
javascript
async function connectUser(form) { if (!form.login.value || !form.password.value) { document.getElementById('login-errors').innerHTML += `<p>Login and password are required</p>`; return; } await client.setCredentials({ login: form.login.value, password: form.password.value }); client .connect() ...
[ "async", "function", "connectUser", "(", "form", ")", "{", "if", "(", "!", "form", ".", "login", ".", "value", "||", "!", "form", ".", "password", ".", "value", ")", "{", "document", ".", "getElementById", "(", "'login-errors'", ")", ".", "innerHTML", ...
Launch the connection of the user into the application
[ "Launch", "the", "connection", "of", "the", "user", "into", "the", "application" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/user-management/samples/standard-user-workflow/front/js/login.js#L4-L24
29,557
tuchk4/bivrost
example/weather-axios-tcomb/index.js
printWeatherForecast
function printWeatherForecast() { return weather .dailyForecast('Kiev') .then(forecast => console.log('WEATHER FORECAST:', forecast)) .catch(error => console.error(error)); }
javascript
function printWeatherForecast() { return weather .dailyForecast('Kiev') .then(forecast => console.log('WEATHER FORECAST:', forecast)) .catch(error => console.error(error)); }
[ "function", "printWeatherForecast", "(", ")", "{", "return", "weather", ".", "dailyForecast", "(", "'Kiev'", ")", ".", "then", "(", "forecast", "=>", "console", ".", "log", "(", "'WEATHER FORECAST:'", ",", "forecast", ")", ")", ".", "catch", "(", "error", ...
call datasource methods
[ "call", "datasource", "methods" ]
f6d6d5973bee77c02ee050dd34ed19a5f96b0a42
https://github.com/tuchk4/bivrost/blob/f6d6d5973bee77c02ee050dd34ed19a5f96b0a42/example/weather-axios-tcomb/index.js#L59-L64
29,558
ArnaudBuchholz/gpf-js
make/coverage.js
_class
function _class (Constructor, members, Base) { var ResultConstructor; if (Base) { ResultConstructor = function () { Base.apply(this, arguments); Constructor.apply(this, arguments); }; ResultConstructor.prototype = new Base(); } else { ResultConstructor...
javascript
function _class (Constructor, members, Base) { var ResultConstructor; if (Base) { ResultConstructor = function () { Base.apply(this, arguments); Constructor.apply(this, arguments); }; ResultConstructor.prototype = new Base(); } else { ResultConstructor...
[ "function", "_class", "(", "Constructor", ",", "members", ",", "Base", ")", "{", "var", "ResultConstructor", ";", "if", "(", "Base", ")", "{", "ResultConstructor", "=", "function", "(", ")", "{", "Base", ".", "apply", "(", "this", ",", "arguments", ")", ...
Simple class helper @param {Function} Constructor Constructor function @param {Object} members Members dictionary @param {Function} [Base] Base class @return {Function} New class constructor @private
[ "Simple", "class", "helper" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L16-L35
29,559
ArnaudBuchholz/gpf-js
make/coverage.js
function (partStatistics) { this.count += partStatistics.count; this.tested += partStatistics.tested; this.ignored += partStatistics.ignored; }
javascript
function (partStatistics) { this.count += partStatistics.count; this.tested += partStatistics.tested; this.ignored += partStatistics.ignored; }
[ "function", "(", "partStatistics", ")", "{", "this", ".", "count", "+=", "partStatistics", ".", "count", ";", "this", ".", "tested", "+=", "partStatistics", ".", "tested", ";", "this", ".", "ignored", "+=", "partStatistics", ".", "ignored", ";", "}" ]
Adds information from another part statistics @param {CoverageReport.PartStatistics} partStatistics Statistics to add
[ "Adds", "information", "from", "another", "part", "statistics" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L85-L89
29,560
ArnaudBuchholz/gpf-js
make/coverage.js
function (count, total, rounded) { var scale; if (rounded) { scale = this._0digitsScale; } else { scale = this._2digitsScale; } return Math.floor(this._percentage * scale * count / total) / scale; }
javascript
function (count, total, rounded) { var scale; if (rounded) { scale = this._0digitsScale; } else { scale = this._2digitsScale; } return Math.floor(this._percentage * scale * count / total) / scale; }
[ "function", "(", "count", ",", "total", ",", "rounded", ")", "{", "var", "scale", ";", "if", "(", "rounded", ")", "{", "scale", "=", "this", ".", "_0digitsScale", ";", "}", "else", "{", "scale", "=", "this", ".", "_2digitsScale", ";", "}", "return", ...
Generates percent value
[ "Generates", "percent", "value" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L96-L104
29,561
ArnaudBuchholz/gpf-js
make/coverage.js
function (numberOfCalls, branchDefinition) { ["if", "else"].forEach(function (label, index) { ++this.count; this._testedOrIgnored(numberOfCalls[index], branchDefinition.locations[index]); }, this); }
javascript
function (numberOfCalls, branchDefinition) { ["if", "else"].forEach(function (label, index) { ++this.count; this._testedOrIgnored(numberOfCalls[index], branchDefinition.locations[index]); }, this); }
[ "function", "(", "numberOfCalls", ",", "branchDefinition", ")", "{", "[", "\"if\"", ",", "\"else\"", "]", ".", "forEach", "(", "function", "(", "label", ",", "index", ")", "{", "++", "this", ".", "count", ";", "this", ".", "_testedOrIgnored", "(", "numbe...
Branch-specific coverage processing @param {Number[]} numberOfCalls Number of calls extracted from the coverage report (one per branch) @param {Object} branchDefinition Branch definition locations array will used to fetch skip property of each branch
[ "Branch", "-", "specific", "coverage", "processing" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L163-L168
29,562
ArnaudBuchholz/gpf-js
make/coverage.js
function (fileName) { var result = new _File(fileName), fileData = this._data[fileName]; [{ type: "statements", data: "s", map: "statementMap" }, { type: "functions", data: "f", map: "fnMap" }, { ...
javascript
function (fileName) { var result = new _File(fileName), fileData = this._data[fileName]; [{ type: "statements", data: "s", map: "statementMap" }, { type: "functions", data: "f", map: "fnMap" }, { ...
[ "function", "(", "fileName", ")", "{", "var", "result", "=", "new", "_File", "(", "fileName", ")", ",", "fileData", "=", "this", ".", "_data", "[", "fileName", "]", ";", "[", "{", "type", ":", "\"statements\"", ",", "data", ":", "\"s\"", ",", "map", ...
Compute coverage for one file @param {String} fileName File name @return {CoverageReport.File} Coverage for one file
[ "Compute", "coverage", "for", "one", "file" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L248-L274
29,563
ArnaudBuchholz/gpf-js
make/coverage.js
function () { this._files = {}; this._global = new _File(); Object.keys(this._data).forEach(function (fileName) { var fileCoverage = this._computeFileCoverage(fileName); this._files[fileCoverage.name] = fileCoverage; this._global.statements.add(fileCoverage.st...
javascript
function () { this._files = {}; this._global = new _File(); Object.keys(this._data).forEach(function (fileName) { var fileCoverage = this._computeFileCoverage(fileName); this._files[fileCoverage.name] = fileCoverage; this._global.statements.add(fileCoverage.st...
[ "function", "(", ")", "{", "this", ".", "_files", "=", "{", "}", ";", "this", ".", "_global", "=", "new", "_File", "(", ")", ";", "Object", ".", "keys", "(", "this", ".", "_data", ")", ".", "forEach", "(", "function", "(", "fileName", ")", "{", ...
Compute all coverages
[ "Compute", "all", "coverages" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/make/coverage.js#L277-L287
29,564
popeindustries/buddy
lib/config/dependencies.js
find
function find(id) { let filepath = ''; if ('string' == typeof id) { try { // Resolve relative to buddy package filepath = require.resolve(id); } catch (err) { // Resolve relative to project package filepath = resolve(path.resolve('package.json'), id); } } return filepath; }
javascript
function find(id) { let filepath = ''; if ('string' == typeof id) { try { // Resolve relative to buddy package filepath = require.resolve(id); } catch (err) { // Resolve relative to project package filepath = resolve(path.resolve('package.json'), id); } } return filepath; }
[ "function", "find", "(", "id", ")", "{", "let", "filepath", "=", "''", ";", "if", "(", "'string'", "==", "typeof", "id", ")", "{", "try", "{", "// Resolve relative to buddy package", "filepath", "=", "require", ".", "resolve", "(", "id", ")", ";", "}", ...
Resolve dependency filepath from 'id' @param {String} id @returns {String}
[ "Resolve", "dependency", "filepath", "from", "id" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/dependencies.js#L21-L35
29,565
popeindustries/buddy
lib/config/dependencies.js
install
function install(ids) { if (!ids || !ids.length) return; const missingDependencies = ids.filter(id => find(id) == ''); if (missingDependencies.length) { try { const cmd = useNPM ? `npm --save-dev --save-exact install ${missingDependencies.join(' ')}` : `yarn add --dev --exact ${missing...
javascript
function install(ids) { if (!ids || !ids.length) return; const missingDependencies = ids.filter(id => find(id) == ''); if (missingDependencies.length) { try { const cmd = useNPM ? `npm --save-dev --save-exact install ${missingDependencies.join(' ')}` : `yarn add --dev --exact ${missing...
[ "function", "install", "(", "ids", ")", "{", "if", "(", "!", "ids", "||", "!", "ids", ".", "length", ")", "return", ";", "const", "missingDependencies", "=", "ids", ".", "filter", "(", "id", "=>", "find", "(", "id", ")", "==", "''", ")", ";", "if...
Install dependencies based on 'ids' @param {Array} ids
[ "Install", "dependencies", "based", "on", "ids" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/dependencies.js#L41-L61
29,566
ArnaudBuchholz/gpf-js
lost+found/src/xpath.js
_filter
function _filter (node, expr, resultSet) { var selectedNodes, conditions, type, idx, condition; if (expr.and) { conditions = expr.and; type = 0; } else if (expr.or) { conditions = expr.or; ...
javascript
function _filter (node, expr, resultSet) { var selectedNodes, conditions, type, idx, condition; if (expr.and) { conditions = expr.and; type = 0; } else if (expr.or) { conditions = expr.or; ...
[ "function", "_filter", "(", "node", ",", "expr", ",", "resultSet", ")", "{", "var", "selectedNodes", ",", "conditions", ",", "type", ",", "idx", ",", "condition", ";", "if", "(", "expr", ".", "and", ")", "{", "conditions", "=", "expr", ".", "and", ";...
Apply the filter expression on the node @param {gpf.xml.IXmlConstNode} node @param {Object} expr @param {gpf.xml.IXmlConstNode[]} resultSet @private
[ "Apply", "the", "filter", "expression", "on", "the", "node" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/xpath.js#L169-L202
29,567
ArnaudBuchholz/gpf-js
lost+found/src/xpath.js
_select
function _select (node, expr) { var resultSet, nodeSet = [node]; while (expr) { resultSet = []; _test(nodeSet, expr, resultSet); if (0 === resultSet.length) { return []; } nodeSet = resultSet; ...
javascript
function _select (node, expr) { var resultSet, nodeSet = [node]; while (expr) { resultSet = []; _test(nodeSet, expr, resultSet); if (0 === resultSet.length) { return []; } nodeSet = resultSet; ...
[ "function", "_select", "(", "node", ",", "expr", ")", "{", "var", "resultSet", ",", "nodeSet", "=", "[", "node", "]", ";", "while", "(", "expr", ")", "{", "resultSet", "=", "[", "]", ";", "_test", "(", "nodeSet", ",", "expr", ",", "resultSet", ")",...
Select the expression on the current node @param {gpf.xml.IXmlConstNode} node @param {Object} expr @private
[ "Select", "the", "expression", "on", "the", "current", "node" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/xpath.js#L211-L233
29,568
ArnaudBuchholz/gpf-js
lost+found/src/define_.js
_gpfDefineCore
function _gpfDefineCore (name, Super, definition) { var NewClass = _gpfDefineFactory(name, Super, definition); _gpfDefineUpdateContext(name, NewClass); return NewClass; }
javascript
function _gpfDefineCore (name, Super, definition) { var NewClass = _gpfDefineFactory(name, Super, definition); _gpfDefineUpdateContext(name, NewClass); return NewClass; }
[ "function", "_gpfDefineCore", "(", "name", ",", "Super", ",", "definition", ")", "{", "var", "NewClass", "=", "_gpfDefineFactory", "(", "name", ",", "Super", ",", "definition", ")", ";", "_gpfDefineUpdateContext", "(", "name", ",", "NewClass", ")", ";", "ret...
Defines a new class by setting a contextual name @param {String} name New class contextual name @param {Function} Super Super class @param {Object} definition Class definition @return {Function} New class constructor
[ "Defines", "a", "new", "class", "by", "setting", "a", "contextual", "name" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_.js#L33-L37
29,569
ArnaudBuchholz/gpf-js
lost+found/src/define_.js
_gpfDefineProcessParamsAndCallCore
function _gpfDefineProcessParamsAndCallCore (params, processFunction) { processFunction("", Object, params); return _gpfDefineCore.apply(null, params); }
javascript
function _gpfDefineProcessParamsAndCallCore (params, processFunction) { processFunction("", Object, params); return _gpfDefineCore.apply(null, params); }
[ "function", "_gpfDefineProcessParamsAndCallCore", "(", "params", ",", "processFunction", ")", "{", "processFunction", "(", "\"\"", ",", "Object", ",", "params", ")", ";", "return", "_gpfDefineCore", ".", "apply", "(", "null", ",", "params", ")", ";", "}" ]
Apply the processing function and call _gpfDefineCore
[ "Apply", "the", "processing", "function", "and", "call", "_gpfDefineCore" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_.js#L40-L43
29,570
SockDrawer/SockBot
lib/commands.js
parseLine
function parseLine(line) { let args, mention, commandText; if (new RegExp(`^@${forum.username}\\s\\S{3,}(\\s|$)`, 'i').test(line)) { args = line.split(/\s+/); args.shift(); commandText = args.shift(); mention = true; } else if (/^!\w\S{2,}(\s|$)/.t...
javascript
function parseLine(line) { let args, mention, commandText; if (new RegExp(`^@${forum.username}\\s\\S{3,}(\\s|$)`, 'i').test(line)) { args = line.split(/\s+/); args.shift(); commandText = args.shift(); mention = true; } else if (/^!\w\S{2,}(\s|$)/.t...
[ "function", "parseLine", "(", "line", ")", "{", "let", "args", ",", "mention", ",", "commandText", ";", "if", "(", "new", "RegExp", "(", "`", "${", "forum", ".", "username", "}", "\\\\", "\\\\", "\\\\", "`", ",", "'i'", ")", ".", "test", "(", "line...
Parse command definitions from a line of text @private @param {string} line Text to parse @returns {object} Parsed command definition
[ "Parse", "command", "definitions", "from", "a", "line", "of", "text" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L641-L663
29,571
SockDrawer/SockBot
lib/commands.js
onComplete
function onComplete(commands) { const content = commands.commands.map((command) => command.replyText) .filter((text) => (text || '').trim()) .join('\n\n---\n\n'); if (!content) { return Promise.resolve(); } return commands._replyFn(content); }
javascript
function onComplete(commands) { const content = commands.commands.map((command) => command.replyText) .filter((text) => (text || '').trim()) .join('\n\n---\n\n'); if (!content) { return Promise.resolve(); } return commands._replyFn(content); }
[ "function", "onComplete", "(", "commands", ")", "{", "const", "content", "=", "commands", ".", "commands", ".", "map", "(", "(", "command", ")", "=>", "command", ".", "replyText", ")", ".", "filter", "(", "(", "text", ")", "=>", "(", "text", "||", "'...
Handle Commands object once execution is complete. Post a reply if `replyText` of any contained command is non empty @private @param {Commands} commands Commands that have completed execution @returns {Promise} Resolves when after execution processing is complete
[ "Handle", "Commands", "object", "once", "execution", "is", "complete", "." ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L675-L683
29,572
SockDrawer/SockBot
lib/commands.js
onError
function onError(reason, commands) { if (typeof reason !== 'string' && typeof reason.message === 'string') { reason = reason.message; } return commands._replyFn(`An unexpected error \`${reason}\` occured and your commands could not be processed!`); }
javascript
function onError(reason, commands) { if (typeof reason !== 'string' && typeof reason.message === 'string') { reason = reason.message; } return commands._replyFn(`An unexpected error \`${reason}\` occured and your commands could not be processed!`); }
[ "function", "onError", "(", "reason", ",", "commands", ")", "{", "if", "(", "typeof", "reason", "!==", "'string'", "&&", "typeof", "reason", ".", "message", "===", "'string'", ")", "{", "reason", "=", "reason", ".", "message", ";", "}", "return", "comman...
Handle Commands object that error'd durring execution Post an error message in reply to post @private @param {string} reason Error Reason @param {Commands} commands Commands that errored @returns {Promise} Resolves after onError steps have completed
[ "Handle", "Commands", "object", "that", "error", "d", "durring", "execution" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L696-L701
29,573
SockDrawer/SockBot
lib/commands.js
defaultHandler
function defaultHandler(command) { debug(`executing default handler for unrecognized command ${command.commandText}`); if (!command.mention) { command.reply(`Command \`${command.command}\` is not recognized`); } return Promise.resolve(); }
javascript
function defaultHandler(command) { debug(`executing default handler for unrecognized command ${command.commandText}`); if (!command.mention) { command.reply(`Command \`${command.command}\` is not recognized`); } return Promise.resolve(); }
[ "function", "defaultHandler", "(", "command", ")", "{", "debug", "(", "`", "${", "command", ".", "commandText", "}", "`", ")", ";", "if", "(", "!", "command", ".", "mention", ")", "{", "command", ".", "reply", "(", "`", "\\`", "${", "command", ".", ...
Default Handler for unknown commands Post an error reply only if command is not a mention command @private @param {Command} command Unknown Command @returns {Promise} Resolves after action is taken
[ "Default", "Handler", "for", "unknown", "commands" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L729-L735
29,574
SockDrawer/SockBot
lib/commands.js
cmdHelp
function cmdHelp(command) { let ext = ''; if (command.args && command.args.length > 0) { ext = command.args.join(' '); } if (ext && helpTopics[ext]) { const txt = `Help topic for \`${ext}\`\n\n${helpTopics[ext]}` + '\n\nIssue the `help` command wit...
javascript
function cmdHelp(command) { let ext = ''; if (command.args && command.args.length > 0) { ext = command.args.join(' '); } if (ext && helpTopics[ext]) { const txt = `Help topic for \`${ext}\`\n\n${helpTopics[ext]}` + '\n\nIssue the `help` command wit...
[ "function", "cmdHelp", "(", "command", ")", "{", "let", "ext", "=", "''", ";", "if", "(", "command", ".", "args", "&&", "command", ".", "args", ".", "length", ">", "0", ")", "{", "ext", "=", "command", ".", "args", ".", "join", "(", "' '", ")", ...
Reply with help to the command !help @private @param {command} command help command @returns {Promise} Resolves after help text is generated
[ "Reply", "with", "help", "to", "the", "command", "!help" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L745-L761
29,575
SockDrawer/SockBot
lib/commands.js
getCommandHelps
function getCommandHelps() { const cmds = {}, topics = {}, result = ['Registered commands:']; let keys = {}; Object.keys(handlers).map((key) => { keys[key] = 1; }); Object.keys(helpTopics).map((key) => { keys[key] = 1; }); ...
javascript
function getCommandHelps() { const cmds = {}, topics = {}, result = ['Registered commands:']; let keys = {}; Object.keys(handlers).map((key) => { keys[key] = 1; }); Object.keys(helpTopics).map((key) => { keys[key] = 1; }); ...
[ "function", "getCommandHelps", "(", ")", "{", "const", "cmds", "=", "{", "}", ",", "topics", "=", "{", "}", ",", "result", "=", "[", "'Registered commands:'", "]", ";", "let", "keys", "=", "{", "}", ";", "Object", ".", "keys", "(", "handlers", ")", ...
Get help text for commands @private @returns {string} Command help text
[ "Get", "help", "text", "for", "commands" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L770-L802
29,576
SockDrawer/SockBot
lib/commands.js
checkAvailable
function checkAvailable(map, command, logType, logMsg) { if (map[command]) { const prefix = logType === 'error' ? 'ERROR' : 'WARNING'; forum.emit(logType, `${prefix}, ${command} is already registered: ${logMsg}`); return false; } return true; }
javascript
function checkAvailable(map, command, logType, logMsg) { if (map[command]) { const prefix = logType === 'error' ? 'ERROR' : 'WARNING'; forum.emit(logType, `${prefix}, ${command} is already registered: ${logMsg}`); return false; } return true; }
[ "function", "checkAvailable", "(", "map", ",", "command", ",", "logType", ",", "logMsg", ")", "{", "if", "(", "map", "[", "command", "]", ")", "{", "const", "prefix", "=", "logType", "===", "'error'", "?", "'ERROR'", ":", "'WARNING'", ";", "forum", "."...
Check the availability of a command @param {object} map A map of commands to check availability against @param {string} command Name of command to check @param {string} logType Type of log to log if command isn't available @param {string} logMsg Message to log if command is not available @returns {boolean} True if ava...
[ "Check", "the", "availability", "of", "a", "command" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/commands.js#L813-L820
29,577
SockDrawer/SockBot
providers/nodebb/format.js
threeParts
function threeParts(before, item1, defaultItem1, middle, item2, after) { item2 = stringify(item2); item1 = stringify(item1); if (!item2) { return ''; } return before + (item1 || defaultItem1) + middle + item2 + after; }
javascript
function threeParts(before, item1, defaultItem1, middle, item2, after) { item2 = stringify(item2); item1 = stringify(item1); if (!item2) { return ''; } return before + (item1 || defaultItem1) + middle + item2 + after; }
[ "function", "threeParts", "(", "before", ",", "item1", ",", "defaultItem1", ",", "middle", ",", "item2", ",", "after", ")", "{", "item2", "=", "stringify", "(", "item2", ")", ";", "item1", "=", "stringify", "(", "item1", ")", ";", "if", "(", "!", "it...
Construct a result consisting of two data points in three parts @private @param {string} before Prefix @param {*} item1 First part @param {string} defaultItem1 Value to use for item1 when item1 is falsy @param {string} middle part to go between item1 and item2 @param {*} item2 Second Part @param {string} after Suffix ...
[ "Construct", "a", "result", "consisting", "of", "two", "data", "points", "in", "three", "parts" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/providers/nodebb/format.js#L117-L124
29,578
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (state, char) { gpf.interfaces.ignoreParameter(state); gpf.interfaces.ignoreParameter(char); gpf.Error.abstract(); // return -1; }
javascript
function (state, char) { gpf.interfaces.ignoreParameter(state); gpf.interfaces.ignoreParameter(char); gpf.Error.abstract(); // return -1; }
[ "function", "(", "state", ",", "char", ")", "{", "gpf", ".", "interfaces", ".", "ignoreParameter", "(", "state", ")", ";", "gpf", ".", "interfaces", ".", "ignoreParameter", "(", "char", ")", ";", "gpf", ".", "Error", ".", "abstract", "(", ")", ";", "...
item evaluation with a character @param {Object} state Free structure containing current state @param {String} char character to test the pattern with @return {Number} Matching result, see PatternItem.WRITE_xxx @abstract
[ "item", "evaluation", "with", "a", "character" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L187-L192
29,579
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (char, chars) { var first, last; if ("^" === char) { this._exc = []; } else if ("]" === char) { if (this._inRange) { gpf.Error.patternInvalidSyntax(); ...
javascript
function (char, chars) { var first, last; if ("^" === char) { this._exc = []; } else if ("]" === char) { if (this._inRange) { gpf.Error.patternInvalidSyntax(); ...
[ "function", "(", "char", ",", "chars", ")", "{", "var", "first", ",", "last", ";", "if", "(", "\"^\"", "===", "char", ")", "{", "this", ".", "_exc", "=", "[", "]", ";", "}", "else", "if", "(", "\"]\"", "===", "char", ")", "{", "if", "(", "thi...
Reduce the cyclomatic complexity of parse @param {String} char Character to parse @param {String[]} chars Character array of already parsed chars @return {Boolean} True means PARSE_PROCESSED_EOP, otherwise PARSE_PROCESSED is returned
[ "Reduce", "the", "cyclomatic", "complexity", "of", "parse" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L309-L340
29,580
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (pos) { if (this._choice) { if (undefined === pos) { pos = this._items.length - 1; } return this._items[pos]; } return this._items; }
javascript
function (pos) { if (this._choice) { if (undefined === pos) { pos = this._items.length - 1; } return this._items[pos]; } return this._items; }
[ "function", "(", "pos", ")", "{", "if", "(", "this", ".", "_choice", ")", "{", "if", "(", "undefined", "===", "pos", ")", "{", "pos", "=", "this", ".", "_items", ".", "length", "-", "1", ";", "}", "return", "this", ".", "_items", "[", "pos", "]...
Get the current list of items @param {Number} [pos=undefined] When choices, get the items at the given position (last one when undefined). Ignored otherwise. @return {PatternItem[]} @private
[ "Get", "the", "current", "list", "of", "items" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L469-L477
29,581
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (char) { var parsedItem = this._parsedItem, result; if (parsedItem) { result = parsedItem.parse(char); if (bitTest(result, PatternItem.PARSE_END_OF_PATTERN)) { parsedItem.fina...
javascript
function (char) { var parsedItem = this._parsedItem, result; if (parsedItem) { result = parsedItem.parse(char); if (bitTest(result, PatternItem.PARSE_END_OF_PATTERN)) { parsedItem.fina...
[ "function", "(", "char", ")", "{", "var", "parsedItem", "=", "this", ".", "_parsedItem", ",", "result", ";", "if", "(", "parsedItem", ")", "{", "result", "=", "parsedItem", ".", "parse", "(", "char", ")", ";", "if", "(", "bitTest", "(", "result", ","...
Reduce the cyclomatic complexity of parse Process current item @param {String} char @return {Number} @private
[ "Reduce", "the", "cyclomatic", "complexity", "of", "parse", "Process", "current", "item" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L512-L529
29,582
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (char) { var parsedItem = this._lastItem(); if ("*" === char) { parsedItem._min = 0; parsedItem._max = 0; } else if ("+" === char) { parsedItem._max = 0; } else if ("?...
javascript
function (char) { var parsedItem = this._lastItem(); if ("*" === char) { parsedItem._min = 0; parsedItem._max = 0; } else if ("+" === char) { parsedItem._max = 0; } else if ("?...
[ "function", "(", "char", ")", "{", "var", "parsedItem", "=", "this", ".", "_lastItem", "(", ")", ";", "if", "(", "\"*\"", "===", "char", ")", "{", "parsedItem", ".", "_min", "=", "0", ";", "parsedItem", ".", "_max", "=", "0", ";", "}", "else", "i...
Reduce the cyclomatic complexity of parse Process quantification char @param {String} char @return {Number} @private
[ "Reduce", "the", "cyclomatic", "complexity", "of", "parse", "Process", "quantification", "char" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L539-L551
29,583
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (items) { var idx; idx = items.length; while (idx--) { if (0 !== items[idx].min()) { ++idx; break; } } return idx; ...
javascript
function (items) { var idx; idx = items.length; while (idx--) { if (0 !== items[idx].min()) { ++idx; break; } } return idx; ...
[ "function", "(", "items", ")", "{", "var", "idx", ";", "idx", "=", "items", ".", "length", ";", "while", "(", "idx", "--", ")", "{", "if", "(", "0", "!==", "items", "[", "idx", "]", ".", "min", "(", ")", ")", "{", "++", "idx", ";", "break", ...
Return the position from which all items can be optional @param {PatterItem[]} items @return {Number} @private
[ "Return", "the", "position", "from", "which", "all", "items", "can", "be", "optional" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L560-L571
29,584
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (item, state) { state.count = 0; state.sub = {}; item.reset(state.sub); }
javascript
function (item, state) { state.count = 0; state.sub = {}; item.reset(state.sub); }
[ "function", "(", "item", ",", "state", ")", "{", "state", ".", "count", "=", "0", ";", "state", ".", "sub", "=", "{", "}", ";", "item", ".", "reset", "(", "state", ".", "sub", ")", ";", "}" ]
Reset for the provided item @param {PatternItem} item @param {Object} state @private
[ "Reset", "for", "the", "provided", "item" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L580-L584
29,585
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (item, state, char) { if (state.count < item.min() // Not enough match // or at least two characters went through || state.length > state.matchingLength + 1) { // Terminal error return PatternItem.WRITE_NO_MATCH...
javascript
function (item, state, char) { if (state.count < item.min() // Not enough match // or at least two characters went through || state.length > state.matchingLength + 1) { // Terminal error return PatternItem.WRITE_NO_MATCH...
[ "function", "(", "item", ",", "state", ",", "char", ")", "{", "if", "(", "state", ".", "count", "<", "item", ".", "min", "(", ")", "// Not enough match", "// or at least two characters went through", "||", "state", ".", "length", ">", "state", ".", "matching...
Handles situation when current item does not match on char @param {PatternItem} item @param {Object} state @param {String} char @return {Number} write result @private
[ "Handles", "situation", "when", "current", "item", "does", "not", "match", "on", "char" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L611-L625
29,586
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (item, state) { var nextItem = this._getItem(state, state.index + 1), optional; if (this._choice && -1 < state.choice) { optional = this._optionals[state.choice]; } else { optional = ...
javascript
function (item, state) { var nextItem = this._getItem(state, state.index + 1), optional; if (this._choice && -1 < state.choice) { optional = this._optionals[state.choice]; } else { optional = ...
[ "function", "(", "item", ",", "state", ")", "{", "var", "nextItem", "=", "this", ".", "_getItem", "(", "state", ",", "state", ".", "index", "+", "1", ")", ",", "optional", ";", "if", "(", "this", ".", "_choice", "&&", "-", "1", "<", "state", ".",...
Handles situation when current item matches on char @param {PatternItem} item @return {Number} write result @private
[ "Handles", "situation", "when", "current", "item", "matches", "on", "char" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L634-L664
29,587
ArnaudBuchholz/gpf-js
lost+found/src/pattern.js
function (pattern) { var parser = new PatternParser(); parser.parse(pattern, null); this._patternItem = parser.patternItem(); }
javascript
function (pattern) { var parser = new PatternParser(); parser.parse(pattern, null); this._patternItem = parser.patternItem(); }
[ "function", "(", "pattern", ")", "{", "var", "parser", "=", "new", "PatternParser", "(", ")", ";", "parser", ".", "parse", "(", "pattern", ",", "null", ")", ";", "this", ".", "_patternItem", "=", "parser", ".", "patternItem", "(", ")", ";", "}" ]
Constructor, check and compile the pattern @param {String} pattern
[ "Constructor", "check", "and", "compile", "the", "pattern" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/pattern.js#L1036-L1041
29,588
ArnaudBuchholz/gpf-js
lost+found/src/base.js
_gpfNodeBuffer2JsArray
function _gpfNodeBuffer2JsArray (buffer) { var result = [], len = buffer.length, idx; for (idx = 0; idx < len; ++idx) { result.push(buffer.readUInt8(idx)); } return result; }
javascript
function _gpfNodeBuffer2JsArray (buffer) { var result = [], len = buffer.length, idx; for (idx = 0; idx < len; ++idx) { result.push(buffer.readUInt8(idx)); } return result; }
[ "function", "_gpfNodeBuffer2JsArray", "(", "buffer", ")", "{", "var", "result", "=", "[", "]", ",", "len", "=", "buffer", ".", "length", ",", "idx", ";", "for", "(", "idx", "=", "0", ";", "idx", "<", "len", ";", "++", "idx", ")", "{", "result", "...
region NodeJS helpers Converts a NodeJS buffer into a native array containing unsigned bytes @param {Buffer} buffer @return {Number[]}
[ "region", "NodeJS", "helpers", "Converts", "a", "NodeJS", "buffer", "into", "a", "native", "array", "containing", "unsigned", "bytes" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/base.js#L57-L65
29,589
ArnaudBuchholz/gpf-js
lost+found/src/websvr.js
function (statusCode, text) { var resp = this._response; resp.writeHead(statusCode, {"Content-Type": "text/plain"}); resp.write([ "port : " + this._options.port, "method : " + this._request.method, ...
javascript
function (statusCode, text) { var resp = this._response; resp.writeHead(statusCode, {"Content-Type": "text/plain"}); resp.write([ "port : " + this._options.port, "method : " + this._request.method, ...
[ "function", "(", "statusCode", ",", "text", ")", "{", "var", "resp", "=", "this", ".", "_response", ";", "resp", ".", "writeHead", "(", "statusCode", ",", "{", "\"Content-Type\"", ":", "\"text/plain\"", "}", ")", ";", "resp", ".", "write", "(", "[", "\...
Generates a PLAIN response to the server @param {Number} statusCode @param {String} text
[ "Generates", "a", "PLAIN", "response", "to", "the", "server" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/websvr.js#L203-L217
29,590
ArnaudBuchholz/gpf-js
lost+found/src/websvr.js
function (filePath) { var me = this, extName = _path.extname(filePath).toLowerCase(), size, stream; _fs.stat(filePath, function (err, stats) { var mimeType; ...
javascript
function (filePath) { var me = this, extName = _path.extname(filePath).toLowerCase(), size, stream; _fs.stat(filePath, function (err, stats) { var mimeType; ...
[ "function", "(", "filePath", ")", "{", "var", "me", "=", "this", ",", "extName", "=", "_path", ".", "extname", "(", "filePath", ")", ".", "toLowerCase", "(", ")", ",", "size", ",", "stream", ";", "_fs", ".", "stat", "(", "filePath", ",", "function", ...
Generates a response that contains the specified file @param {String} filePath @private
[ "Generates", "a", "response", "that", "contains", "the", "specified", "file" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/websvr.js#L225-L275
29,591
ArnaudBuchholz/gpf-js
lost+found/src/encoding.js
function (input, encoding) { var module = _gpfEncodings[encoding]; if (undefined === module) { gpf.Error.encodingNotSupported(); } return new EncoderStream(module[0], input); }
javascript
function (input, encoding) { var module = _gpfEncodings[encoding]; if (undefined === module) { gpf.Error.encodingNotSupported(); } return new EncoderStream(module[0], input); }
[ "function", "(", "input", ",", "encoding", ")", "{", "var", "module", "=", "_gpfEncodings", "[", "encoding", "]", ";", "if", "(", "undefined", "===", "module", ")", "{", "gpf", ".", "Error", ".", "encodingNotSupported", "(", ")", ";", "}", "return", "n...
Create a encoder to convert an input text stream into an output binary buffer. @param {gpf.interfaces.IReadableStream} input @param {String} encoding @return {gpf.interfaces.IReadableStream}
[ "Create", "a", "encoder", "to", "convert", "an", "input", "text", "stream", "into", "an", "output", "binary", "buffer", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/encoding.js#L145-L151
29,592
ArnaudBuchholz/gpf-js
lost+found/src/path/matcher.js
_gpfPathMatchApply
function _gpfPathMatchApply (pathMatcher) { /*jshint validthis:true*/ if (pathMatcher.match(this.parts)) { this.result = !pathMatcher.negative; return false; // Stop the main loop } return _gpfPathMatchAfterApplyNonMatching.call(this, pathMatcher); }
javascript
function _gpfPathMatchApply (pathMatcher) { /*jshint validthis:true*/ if (pathMatcher.match(this.parts)) { this.result = !pathMatcher.negative; return false; // Stop the main loop } return _gpfPathMatchAfterApplyNonMatching.call(this, pathMatcher); }
[ "function", "_gpfPathMatchApply", "(", "pathMatcher", ")", "{", "/*jshint validthis:true*/", "if", "(", "pathMatcher", ".", "match", "(", "this", ".", "parts", ")", ")", "{", "this", ".", "result", "=", "!", "pathMatcher", ".", "negative", ";", "return", "fa...
Match a path item @param pathMatcher @this An object containing - {String[]} parts the path being tested split in parts - {Boolean} [result=undefined] result the result
[ "Match", "a", "path", "item" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/path/matcher.js#L124-L131
29,593
ArnaudBuchholz/gpf-js
lost+found/src/path/matcher.js
_gpfPathMatch
function _gpfPathMatch (pattern, path) { var parts = _gpfPathDecompose(path), matchers = _gpfPathMatchCompilePatterns(pattern), scope = { parts: parts }; matchers.every(_gpfPathMatchApply, scope); return scope.result; }
javascript
function _gpfPathMatch (pattern, path) { var parts = _gpfPathDecompose(path), matchers = _gpfPathMatchCompilePatterns(pattern), scope = { parts: parts }; matchers.every(_gpfPathMatchApply, scope); return scope.result; }
[ "function", "_gpfPathMatch", "(", "pattern", ",", "path", ")", "{", "var", "parts", "=", "_gpfPathDecompose", "(", "path", ")", ",", "matchers", "=", "_gpfPathMatchCompilePatterns", "(", "pattern", ")", ",", "scope", "=", "{", "parts", ":", "parts", "}", "...
Match the pattern with the path @param {Array|String} pattern @param {String} path @return {Boolean|undefined}
[ "Match", "the", "pattern", "with", "the", "path" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/path/matcher.js#L139-L147
29,594
ArnaudBuchholz/gpf-js
lost+found/src/path/matcher.js
function (context) { var parts = context.parts, partsLen = parts.length, startPos = context.startPos, array = this.start, len = array.length, idx; for (idx = 0; idx < len; ++idx) { if (this._matchName(array[idx], parts[startPos])) {...
javascript
function (context) { var parts = context.parts, partsLen = parts.length, startPos = context.startPos, array = this.start, len = array.length, idx; for (idx = 0; idx < len; ++idx) { if (this._matchName(array[idx], parts[startPos])) {...
[ "function", "(", "context", ")", "{", "var", "parts", "=", "context", ".", "parts", ",", "partsLen", "=", "parts", ".", "length", ",", "startPos", "=", "context", ".", "startPos", ",", "array", "=", "this", ".", "start", ",", "len", "=", "array", "."...
Match using this.start
[ "Match", "using", "this", ".", "start" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/path/matcher.js#L227-L249
29,595
ArnaudBuchholz/gpf-js
lost+found/src/path/matcher.js
function (context) { var parts = context.parts, startPos = context.startPos, endPos = parts.length - 1, array = this.end, len = array.length, idx; for (idx = 0; idx < len; ++idx) { if (-1 < endPos && this._matchName(array[idx], part...
javascript
function (context) { var parts = context.parts, startPos = context.startPos, endPos = parts.length - 1, array = this.end, len = array.length, idx; for (idx = 0; idx < len; ++idx) { if (-1 < endPos && this._matchName(array[idx], part...
[ "function", "(", "context", ")", "{", "var", "parts", "=", "context", ".", "parts", ",", "startPos", "=", "context", ".", "startPos", ",", "endPos", "=", "parts", ".", "length", "-", "1", ",", "array", "=", "this", ".", "end", ",", "len", "=", "arr...
Match using this.end
[ "Match", "using", "this", ".", "end" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/path/matcher.js#L260-L277
29,596
ArnaudBuchholz/gpf-js
lost+found/src/path/matcher.js
function (parts) { var result, context = { parts: parts, startPos: 0 }; result = this._matchStart(context) || this._matchEnd(context); return result !== _GPF_PATHMATCH_KO; }
javascript
function (parts) { var result, context = { parts: parts, startPos: 0 }; result = this._matchStart(context) || this._matchEnd(context); return result !== _GPF_PATHMATCH_KO; }
[ "function", "(", "parts", ")", "{", "var", "result", ",", "context", "=", "{", "parts", ":", "parts", ",", "startPos", ":", "0", "}", ";", "result", "=", "this", ".", "_matchStart", "(", "context", ")", "||", "this", ".", "_matchEnd", "(", "context",...
Matches the provided path @param {String[]} parts @return {Boolean}
[ "Matches", "the", "provided", "path" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/path/matcher.js#L285-L293
29,597
popeindustries/buddy
lib/plugins/js/babel-plugin-transform-flatten.js
renameRootDeclarations
function renameRootDeclarations(path, namespace) { const { scope } = path; const oldName = path.node.name; const rootScope = scope.getProgramParent(); const isRootScope = scope === rootScope; const newName = `${namespace}${oldName}`; let binding = scope.getBinding(oldName); if (binding) { if (!path.i...
javascript
function renameRootDeclarations(path, namespace) { const { scope } = path; const oldName = path.node.name; const rootScope = scope.getProgramParent(); const isRootScope = scope === rootScope; const newName = `${namespace}${oldName}`; let binding = scope.getBinding(oldName); if (binding) { if (!path.i...
[ "function", "renameRootDeclarations", "(", "path", ",", "namespace", ")", "{", "const", "{", "scope", "}", "=", "path", ";", "const", "oldName", "=", "path", ".", "node", ".", "name", ";", "const", "rootScope", "=", "scope", ".", "getProgramParent", "(", ...
Rename declarations and references in global scope @param {NodePath} path @param {String} namespace
[ "Rename", "declarations", "and", "references", "in", "global", "scope" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/plugins/js/babel-plugin-transform-flatten.js#L64-L91
29,598
popeindustries/buddy
lib/plugins/js/babel-plugin-transform-flatten.js
shouldRenameDeclaration
function shouldRenameDeclaration(name, path, binding, rootScope) { const isRootScope = path.scope === rootScope; const isGlobal = isRootScope && name in rootScope.globals; const program = rootScope.path; if (isGlobal) return false; if (!isRootScope) { const functionParent = path.getFunctionParent(); ...
javascript
function shouldRenameDeclaration(name, path, binding, rootScope) { const isRootScope = path.scope === rootScope; const isGlobal = isRootScope && name in rootScope.globals; const program = rootScope.path; if (isGlobal) return false; if (!isRootScope) { const functionParent = path.getFunctionParent(); ...
[ "function", "shouldRenameDeclaration", "(", "name", ",", "path", ",", "binding", ",", "rootScope", ")", "{", "const", "isRootScope", "=", "path", ".", "scope", "===", "rootScope", ";", "const", "isGlobal", "=", "isRootScope", "&&", "name", "in", "rootScope", ...
Determine if declaration 'path' should be renamed @param {String} name @param {NodePath} path @param {Binding} binding @param {Scope} rootScope @returns {Boolean}
[ "Determine", "if", "declaration", "path", "should", "be", "renamed" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/plugins/js/babel-plugin-transform-flatten.js#L101-L135
29,599
popeindustries/buddy
lib/plugins/js/babel-plugin-transform-flatten.js
getDeclarationParent
function getDeclarationParent(path) { do { if ( path.isFunctionDeclaration() || path.isVariableDeclaration() || path.isClassDeclaration() || path.isAssignmentExpression() ) { return path; } } while ((path = path.parentPath)); }
javascript
function getDeclarationParent(path) { do { if ( path.isFunctionDeclaration() || path.isVariableDeclaration() || path.isClassDeclaration() || path.isAssignmentExpression() ) { return path; } } while ((path = path.parentPath)); }
[ "function", "getDeclarationParent", "(", "path", ")", "{", "do", "{", "if", "(", "path", ".", "isFunctionDeclaration", "(", ")", "||", "path", ".", "isVariableDeclaration", "(", ")", "||", "path", ".", "isClassDeclaration", "(", ")", "||", "path", ".", "is...
Retrieve declaration parent for 'path' @param {NodePath} path @returns {NodePath}
[ "Retrieve", "declaration", "parent", "for", "path" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/plugins/js/babel-plugin-transform-flatten.js#L142-L153