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,400
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (memberValue, visibility) { _gpfAsserts({ "Constructor must be a function": "function" === typeof memberValue, "Own constructor can't be overridden": null === this._definitionConstructor }); if (_gpfUsesSuper(memberValue)) { memberValue = _gpfGenSuperMember(this._Super, memberValue); } _gpfIgnore(visibility); // TODO Handle constructor visibility this._definitionConstructor = memberValue; }
javascript
function (memberValue, visibility) { _gpfAsserts({ "Constructor must be a function": "function" === typeof memberValue, "Own constructor can't be overridden": null === this._definitionConstructor }); if (_gpfUsesSuper(memberValue)) { memberValue = _gpfGenSuperMember(this._Super, memberValue); } _gpfIgnore(visibility); // TODO Handle constructor visibility this._definitionConstructor = memberValue; }
[ "function", "(", "memberValue", ",", "visibility", ")", "{", "_gpfAsserts", "(", "{", "\"Constructor must be a function\"", ":", "\"function\"", "===", "typeof", "memberValue", ",", "\"Own constructor can't be overridden\"", ":", "null", "===", "this", ".", "_definition...
Adds a constructor the class definition @param {*} memberValue Must be a function @param {number} visibility @gpf:closure
[ "Adds", "a", "constructor", "the", "class", "definition" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L238-L248
29,401
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (member, memberValue, visibility) { var newType = typeof memberValue, baseMemberValue, baseType, prototype = this._Constructor.prototype; _gpfAssert(!prototype.hasOwnProperty(member), "Existing own member can't be overridden"); baseMemberValue = this._Super.prototype[member]; baseType = typeof baseMemberValue; if ("undefined" !== baseType) { if (null !== baseMemberValue && newType !== baseType) { gpf.Error.classMemberOverloadWithTypeChange(); } if ("function" === newType && _gpfUsesSuper(memberValue)) { memberValue = _gpfGenSuperMember(baseMemberValue, memberValue); } } _gpfIgnore(visibility); // TODO Handle constructor visibility prototype[member] = memberValue; }
javascript
function (member, memberValue, visibility) { var newType = typeof memberValue, baseMemberValue, baseType, prototype = this._Constructor.prototype; _gpfAssert(!prototype.hasOwnProperty(member), "Existing own member can't be overridden"); baseMemberValue = this._Super.prototype[member]; baseType = typeof baseMemberValue; if ("undefined" !== baseType) { if (null !== baseMemberValue && newType !== baseType) { gpf.Error.classMemberOverloadWithTypeChange(); } if ("function" === newType && _gpfUsesSuper(memberValue)) { memberValue = _gpfGenSuperMember(baseMemberValue, memberValue); } } _gpfIgnore(visibility); // TODO Handle constructor visibility prototype[member] = memberValue; }
[ "function", "(", "member", ",", "memberValue", ",", "visibility", ")", "{", "var", "newType", "=", "typeof", "memberValue", ",", "baseMemberValue", ",", "baseType", ",", "prototype", "=", "this", ".", "_Constructor", ".", "prototype", ";", "_gpfAssert", "(", ...
Defines a new non-static member of the class @param {String} member Name of the member to define @param {*} memberValue @param {Number} visibility Visibility of the members @gpf:closure
[ "Defines", "a", "new", "non", "-", "static", "member", "of", "the", "class" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L258-L276
29,402
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (member) { if ("[" !== member.charAt(0) || "]" !== member.charAt(member.length - 1)) { return ""; } return _gpfEncodeAttributeMember(member.substr(1, member.length - 2)); // Extract & encode member name }
javascript
function (member) { if ("[" !== member.charAt(0) || "]" !== member.charAt(member.length - 1)) { return ""; } return _gpfEncodeAttributeMember(member.substr(1, member.length - 2)); // Extract & encode member name }
[ "function", "(", "member", ")", "{", "if", "(", "\"[\"", "!==", "member", ".", "charAt", "(", "0", ")", "||", "\"]\"", "!==", "member", ".", "charAt", "(", "member", ".", "length", "-", "1", ")", ")", "{", "return", "\"\"", ";", "}", "return", "_...
Check if the member represents an attribute and extracts the name
[ "Check", "if", "the", "member", "represents", "an", "attribute", "and", "extracts", "the", "name" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L279-L284
29,403
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (attributeName, attributeValue) { var attributeArray; if (this._definitionAttributes) { attributeArray = this._definitionAttributes[attributeName]; } else { this._definitionAttributes = {}; } if (undefined === attributeArray) { attributeArray = []; } this._definitionAttributes[attributeName] = attributeArray.concat(attributeValue); }
javascript
function (attributeName, attributeValue) { var attributeArray; if (this._definitionAttributes) { attributeArray = this._definitionAttributes[attributeName]; } else { this._definitionAttributes = {}; } if (undefined === attributeArray) { attributeArray = []; } this._definitionAttributes[attributeName] = attributeArray.concat(attributeValue); }
[ "function", "(", "attributeName", ",", "attributeValue", ")", "{", "var", "attributeArray", ";", "if", "(", "this", ".", "_definitionAttributes", ")", "{", "attributeArray", "=", "this", ".", "_definitionAttributes", "[", "attributeName", "]", ";", "}", "else", ...
store the attribute for later usage
[ "store", "the", "attribute", "for", "later", "usage" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L287-L298
29,404
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (member, memberValue) { var attributeName = this._extractAttributeName(member); if (!attributeName) { return false; } this._addToDefinitionAttributes(attributeName, memberValue); return true; }
javascript
function (member, memberValue) { var attributeName = this._extractAttributeName(member); if (!attributeName) { return false; } this._addToDefinitionAttributes(attributeName, memberValue); return true; }
[ "function", "(", "member", ",", "memberValue", ")", "{", "var", "attributeName", "=", "this", ".", "_extractAttributeName", "(", "member", ")", ";", "if", "(", "!", "attributeName", ")", "{", "return", "false", ";", "}", "this", ".", "_addToDefinitionAttribu...
Check if the current member is an attribute declaration. If so, stores it into a temporary map that will be processed as the last step. @param {String} member @param {*} memberValue @returns {Boolean} True when an attribute is detected
[ "Check", "if", "the", "current", "member", "is", "an", "attribute", "declaration", ".", "If", "so", "stores", "it", "into", "a", "temporary", "map", "that", "will", "be", "processed", "as", "the", "last", "step", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L308-L315
29,405
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (memberName) { var visibility = this._defaultVisibility; if (_GPF_VISIBILITY_UNKNOWN === visibility) { if (memberName.charAt(0) === "_") { visibility = _GPF_VISIBILITY_PROTECTED; } else { visibility = _GPF_VISIBILITY_PUBLIC; } } return visibility; }
javascript
function (memberName) { var visibility = this._defaultVisibility; if (_GPF_VISIBILITY_UNKNOWN === visibility) { if (memberName.charAt(0) === "_") { visibility = _GPF_VISIBILITY_PROTECTED; } else { visibility = _GPF_VISIBILITY_PUBLIC; } } return visibility; }
[ "function", "(", "memberName", ")", "{", "var", "visibility", "=", "this", ".", "_defaultVisibility", ";", "if", "(", "_GPF_VISIBILITY_UNKNOWN", "===", "visibility", ")", "{", "if", "(", "memberName", ".", "charAt", "(", "0", ")", "===", "\"_\"", ")", "{",...
Compute member visibility from default visibility & member name
[ "Compute", "member", "visibility", "from", "default", "visibility", "&", "member", "name" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L321-L331
29,406
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (memberValue, memberName) { if (this._filterAttribute(memberName, memberValue)) { return; } var newVisibility = _gpfVisibilityKeywords.indexOf(memberName); if (_GPF_VISIBILITY_UNKNOWN === newVisibility) { return this._addMember(memberName, memberValue, this._deduceVisibility(memberName)); } if (_GPF_VISIBILITY_UNKNOWN !== this._defaultVisibility) { gpf.Error.classInvalidVisibility(); } this._processDefinition(memberValue, newVisibility); }
javascript
function (memberValue, memberName) { if (this._filterAttribute(memberName, memberValue)) { return; } var newVisibility = _gpfVisibilityKeywords.indexOf(memberName); if (_GPF_VISIBILITY_UNKNOWN === newVisibility) { return this._addMember(memberName, memberValue, this._deduceVisibility(memberName)); } if (_GPF_VISIBILITY_UNKNOWN !== this._defaultVisibility) { gpf.Error.classInvalidVisibility(); } this._processDefinition(memberValue, newVisibility); }
[ "function", "(", "memberValue", ",", "memberName", ")", "{", "if", "(", "this", ".", "_filterAttribute", "(", "memberName", ",", "memberValue", ")", ")", "{", "return", ";", "}", "var", "newVisibility", "=", "_gpfVisibilityKeywords", ".", "indexOf", "(", "me...
Process definition member. The member may be a visibility keyword, in that case _processDefinition is called recursively @param {*} memberValue @param {string} memberName
[ "Process", "definition", "member", ".", "The", "member", "may", "be", "a", "visibility", "keyword", "in", "that", "case", "_processDefinition", "is", "called", "recursively" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L340-L352
29,407
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function (definition, visibility) { var isWScript = _GPF_HOST.WSCRIPT === _gpfHost; this._defaultVisibility = visibility; _gpfObjectForEach(definition, this._processDefinitionMember, this); if (isWScript && definition.hasOwnProperty("toString")) { this._processDefinitionMember(definition.toString, "toString"); } this._defaultVisibility = _GPF_VISIBILITY_UNKNOWN; if (isWScript && definition.hasOwnProperty("constructor")) { this._addConstructor(definition.constructor, this._defaultVisibility); } }
javascript
function (definition, visibility) { var isWScript = _GPF_HOST.WSCRIPT === _gpfHost; this._defaultVisibility = visibility; _gpfObjectForEach(definition, this._processDefinitionMember, this); if (isWScript && definition.hasOwnProperty("toString")) { this._processDefinitionMember(definition.toString, "toString"); } this._defaultVisibility = _GPF_VISIBILITY_UNKNOWN; if (isWScript && definition.hasOwnProperty("constructor")) { this._addConstructor(definition.constructor, this._defaultVisibility); } }
[ "function", "(", "definition", ",", "visibility", ")", "{", "var", "isWScript", "=", "_GPF_HOST", ".", "WSCRIPT", "===", "_gpfHost", ";", "this", ".", "_defaultVisibility", "=", "visibility", ";", "_gpfObjectForEach", "(", "definition", ",", "this", ".", "_pro...
Process class definition @param {Object} definition @param {Number} visibility
[ "Process", "class", "definition" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L360-L371
29,408
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function () { var attributes = this._definitionAttributes, Constructor, newPrototype; if (attributes) { _gpfAssert("function" === typeof _gpfAttributesAdd, "Attributes can't be defined before they exist"); Constructor = this._Constructor; newPrototype = Constructor.prototype; _gpfObjectForEach(attributes, function (attributeList, attributeName) { attributeName = _gpfDecodeAttributeMember(attributeName); if (attributeName in newPrototype || attributeName === "Class") { _gpfAttributesAdd(Constructor, attributeName, attributeList); } else { // 2013-12-15 ABZ Exceptional, trace it only console.error("gpf.define: Invalid attribute name '" + attributeName + "'"); } }); } }
javascript
function () { var attributes = this._definitionAttributes, Constructor, newPrototype; if (attributes) { _gpfAssert("function" === typeof _gpfAttributesAdd, "Attributes can't be defined before they exist"); Constructor = this._Constructor; newPrototype = Constructor.prototype; _gpfObjectForEach(attributes, function (attributeList, attributeName) { attributeName = _gpfDecodeAttributeMember(attributeName); if (attributeName in newPrototype || attributeName === "Class") { _gpfAttributesAdd(Constructor, attributeName, attributeList); } else { // 2013-12-15 ABZ Exceptional, trace it only console.error("gpf.define: Invalid attribute name '" + attributeName + "'"); } }); } }
[ "function", "(", ")", "{", "var", "attributes", "=", "this", ".", "_definitionAttributes", ",", "Constructor", ",", "newPrototype", ";", "if", "(", "attributes", ")", "{", "_gpfAssert", "(", "\"function\"", "===", "typeof", "_gpfAttributesAdd", ",", "\"Attribute...
Process the attributes collected in the definition NOTE: gpf.attributes._add is defined in attributes.js
[ "Process", "the", "attributes", "collected", "in", "the", "definition" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L378-L397
29,409
ArnaudBuchholz/gpf-js
lost+found/src/define_/classdef.js
function () { var newClass, newPrototype, baseClassDef; // The new class constructor newClass = _getOldNewClassConstructor(this); this._Constructor = newClass; newClass[_GPF_CLASSDEF_MARKER] = this._uid; // Basic JavaScript inheritance mechanism: Defines the newClass prototype as an instance of the super class newPrototype = Object.create(this._Super.prototype); // Populate our constructed prototype object newClass.prototype = newPrototype; // Enforce the constructor to be what we expect newPrototype.constructor = newClass; /* * Defines the link between this class and its base one * (It is necessary to do it here because of the gpf.addAttributes that will test the parent class) */ baseClassDef = _gpfGetClassDefinition(this._Super); baseClassDef._Subs.push(newClass); /* * 2014-04-28 ABZ Changed again from two passes on all members to two passes in which the first one also * collects attributes to simplify the second pass. */ this._processDefinition(this._definition, _GPF_VISIBILITY_UNKNOWN); this._processAttributes(); // Optimization for the constructor this._resolveConstructor(); }
javascript
function () { var newClass, newPrototype, baseClassDef; // The new class constructor newClass = _getOldNewClassConstructor(this); this._Constructor = newClass; newClass[_GPF_CLASSDEF_MARKER] = this._uid; // Basic JavaScript inheritance mechanism: Defines the newClass prototype as an instance of the super class newPrototype = Object.create(this._Super.prototype); // Populate our constructed prototype object newClass.prototype = newPrototype; // Enforce the constructor to be what we expect newPrototype.constructor = newClass; /* * Defines the link between this class and its base one * (It is necessary to do it here because of the gpf.addAttributes that will test the parent class) */ baseClassDef = _gpfGetClassDefinition(this._Super); baseClassDef._Subs.push(newClass); /* * 2014-04-28 ABZ Changed again from two passes on all members to two passes in which the first one also * collects attributes to simplify the second pass. */ this._processDefinition(this._definition, _GPF_VISIBILITY_UNKNOWN); this._processAttributes(); // Optimization for the constructor this._resolveConstructor(); }
[ "function", "(", ")", "{", "var", "newClass", ",", "newPrototype", ",", "baseClassDef", ";", "// The new class constructor", "newClass", "=", "_getOldNewClassConstructor", "(", "this", ")", ";", "this", ".", "_Constructor", "=", "newClass", ";", "newClass", "[", ...
Create the new Class constructor
[ "Create", "the", "new", "Class", "constructor" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/define_/classdef.js#L400-L436
29,410
ArnaudBuchholz/gpf-js
src/http/mock.js
_gpfHttMockMatchRequest
function _gpfHttMockMatchRequest (mockedRequest, request) { var url = mockedRequest.url, match; url.lastIndex = 0; match = url.exec(request.url); if (match) { return mockedRequest.response.apply(mockedRequest, [request].concat(_gpfArrayTail(match))); } }
javascript
function _gpfHttMockMatchRequest (mockedRequest, request) { var url = mockedRequest.url, match; url.lastIndex = 0; match = url.exec(request.url); if (match) { return mockedRequest.response.apply(mockedRequest, [request].concat(_gpfArrayTail(match))); } }
[ "function", "_gpfHttMockMatchRequest", "(", "mockedRequest", ",", "request", ")", "{", "var", "url", "=", "mockedRequest", ".", "url", ",", "match", ";", "url", ".", "lastIndex", "=", "0", ";", "match", "=", "url", ".", "exec", "(", "request", ".", "url"...
Match the provided request with the mocked one @param {gpf.typedef.mockedRequest} mockedRequest Mocked request to match @param {gpf.typedef.httpRequestSettings} request Request to match @return {Promise<gpf.typedef.httpRequestResponse>|undefined} undefined if not matching @since 0.2.2
[ "Match", "the", "provided", "request", "with", "the", "mocked", "one" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http/mock.js#L57-L65
29,411
ArnaudBuchholz/gpf-js
src/http/mock.js
_gpfHttMockMatch
function _gpfHttMockMatch (mockedRequests, request) { var result; mockedRequests.every(function (mockedRequest) { result = _gpfHttMockMatchRequest(mockedRequest, request); return result === undefined; }); return result; }
javascript
function _gpfHttMockMatch (mockedRequests, request) { var result; mockedRequests.every(function (mockedRequest) { result = _gpfHttMockMatchRequest(mockedRequest, request); return result === undefined; }); return result; }
[ "function", "_gpfHttMockMatch", "(", "mockedRequests", ",", "request", ")", "{", "var", "result", ";", "mockedRequests", ".", "every", "(", "function", "(", "mockedRequest", ")", "{", "result", "=", "_gpfHttMockMatchRequest", "(", "mockedRequest", ",", "request", ...
Match the provided request to the list of mocked ones @param {gpf.typedef.mockedRequest[]} mockedRequests List of mocked requests for the given method @param {gpf.typedef.httpRequestSettings} request Request to match @return {Promise<gpf.typedef.httpRequestResponse>|undefined} undefined if no mocked request matches @since 0.2.2
[ "Match", "the", "provided", "request", "to", "the", "list", "of", "mocked", "ones" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http/mock.js#L75-L82
29,412
ArnaudBuchholz/gpf-js
src/http/mock.js
_gpfHttpMockAdd
function _gpfHttpMockAdd (definition) { var method = definition.method.toUpperCase(), id = method + "." + _gpfHttpMockLastId++; _gpfHttpMockGetMockedRequests(method).unshift(Object.assign({ id: id }, definition)); return id; }
javascript
function _gpfHttpMockAdd (definition) { var method = definition.method.toUpperCase(), id = method + "." + _gpfHttpMockLastId++; _gpfHttpMockGetMockedRequests(method).unshift(Object.assign({ id: id }, definition)); return id; }
[ "function", "_gpfHttpMockAdd", "(", "definition", ")", "{", "var", "method", "=", "definition", ".", "method", ".", "toUpperCase", "(", ")", ",", "id", "=", "method", "+", "\".\"", "+", "_gpfHttpMockLastId", "++", ";", "_gpfHttpMockGetMockedRequests", "(", "me...
Add a mocked request @param {gpf.typedef.mockedRequest} definition Mocked request definition @return {gpf.typedef.mockedRequestID} Mocked request identifier, to be used with {@link gpf.http.mock.remove} @see gpf.http @since 0.2.2
[ "Add", "a", "mocked", "request" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http/mock.js#L112-L119
29,413
ArnaudBuchholz/gpf-js
src/http/mock.js
_gpfHttpMockRemove
function _gpfHttpMockRemove (id) { var method = id.substring(_GPF_START, id.indexOf(".")); _gpfHttpMockedRequests[method] = _gpfHttpMockGetMockedRequests(method).filter(function (mockedRequest) { return mockedRequest.id !== id; }); }
javascript
function _gpfHttpMockRemove (id) { var method = id.substring(_GPF_START, id.indexOf(".")); _gpfHttpMockedRequests[method] = _gpfHttpMockGetMockedRequests(method).filter(function (mockedRequest) { return mockedRequest.id !== id; }); }
[ "function", "_gpfHttpMockRemove", "(", "id", ")", "{", "var", "method", "=", "id", ".", "substring", "(", "_GPF_START", ",", "id", ".", "indexOf", "(", "\".\"", ")", ")", ";", "_gpfHttpMockedRequests", "[", "method", "]", "=", "_gpfHttpMockGetMockedRequests", ...
Removes a mocked request @param {gpf.typedef.mockedRequestID} id Mocked request identifier returned by {@link gpf.http.mock} @since 0.2.2
[ "Removes", "a", "mocked", "request" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http/mock.js#L127-L132
29,414
popeindustries/buddy
lib/resolver/config.js
resolveEnvSources
function resolveEnvSources(env) { let paths = []; if (process.env[env]) { paths = process.env[env].includes(path.delimiter) ? process.env[env].split(path.delimiter) : [process.env[env]]; } return paths; }
javascript
function resolveEnvSources(env) { let paths = []; if (process.env[env]) { paths = process.env[env].includes(path.delimiter) ? process.env[env].split(path.delimiter) : [process.env[env]]; } return paths; }
[ "function", "resolveEnvSources", "(", "env", ")", "{", "let", "paths", "=", "[", "]", ";", "if", "(", "process", ".", "env", "[", "env", "]", ")", "{", "paths", "=", "process", ".", "env", "[", "env", "]", ".", "includes", "(", "path", ".", "deli...
Resolve environment variable sources for 'env' @param {String} env @returns {Array}
[ "Resolve", "environment", "variable", "sources", "for", "env" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/resolver/config.js#L66-L74
29,415
makeup-js/makeup-expander
docs/static/bundle.js
function(target) { // Only store the `module` in the local cache since `module.exports` may not be accurate // if there was a circular dependency var module = localCache[target] || (localCache[target] = requireModule(target, dirname)); return module.exports; }
javascript
function(target) { // Only store the `module` in the local cache since `module.exports` may not be accurate // if there was a circular dependency var module = localCache[target] || (localCache[target] = requireModule(target, dirname)); return module.exports; }
[ "function", "(", "target", ")", "{", "// Only store the `module` in the local cache since `module.exports` may not be accurate", "// if there was a circular dependency", "var", "module", "=", "localCache", "[", "target", "]", "||", "(", "localCache", "[", "target", "]", "=", ...
this is the require used by the module
[ "this", "is", "the", "require", "used", "by", "the", "module" ]
9274abb14e4fd051ddcc609dbc9fe9ac6605631c
https://github.com/makeup-js/makeup-expander/blob/9274abb14e4fd051ddcc609dbc9fe9ac6605631c/docs/static/bundle.js#L127-L132
29,416
makeup-js/makeup-expander
docs/static/bundle.js
define
function define(path, factoryOrObject, options) { /* $_mod.def('/baz$3.0.0/lib/index', function(require, exports, module, __filename, __dirname) { // module source code goes here }); */ var globals = options && options.globals; definitions[path] = factoryOrObject; if (globals) { var target = win || global; for (var i=0;i<globals.length; i++) { var globalVarName = globals[i]; var globalModule = loadedGlobalsByRealPath[path] = requireModule(path); target[globalVarName] = globalModule.exports; } } }
javascript
function define(path, factoryOrObject, options) { /* $_mod.def('/baz$3.0.0/lib/index', function(require, exports, module, __filename, __dirname) { // module source code goes here }); */ var globals = options && options.globals; definitions[path] = factoryOrObject; if (globals) { var target = win || global; for (var i=0;i<globals.length; i++) { var globalVarName = globals[i]; var globalModule = loadedGlobalsByRealPath[path] = requireModule(path); target[globalVarName] = globalModule.exports; } } }
[ "function", "define", "(", "path", ",", "factoryOrObject", ",", "options", ")", "{", "/*\n $_mod.def('/baz$3.0.0/lib/index', function(require, exports, module, __filename, __dirname) {\n // module source code goes here\n });\n */", "var", "globals", "=", "...
Defines a packages whose metadata is used by raptor-loader to load the package.
[ "Defines", "a", "packages", "whose", "metadata", "is", "used", "by", "raptor", "-", "loader", "to", "load", "the", "package", "." ]
9274abb14e4fd051ddcc609dbc9fe9ac6605631c
https://github.com/makeup-js/makeup-expander/blob/9274abb14e4fd051ddcc609dbc9fe9ac6605631c/docs/static/bundle.js#L177-L196
29,417
makeup-js/makeup-expander
docs/static/bundle.js
normalizePathParts
function normalizePathParts(parts) { // IMPORTANT: It is assumed that parts[0] === "" because this method is used to // join an absolute path to a relative path var i; var len = 0; var numParts = parts.length; for (i = 0; i < numParts; i++) { var part = parts[i]; if (part === '.') { // ignore parts with just "." /* // if the "." is at end of parts (e.g. ["a", "b", "."]) then trim it off if (i === numParts - 1) { //len--; } */ } else if (part === '..') { // overwrite the previous item by decrementing length len--; } else { // add this part to result and increment length parts[len] = part; len++; } } if (len === 1) { // if we end up with just one part that is empty string // (which can happen if input is ["", "."]) then return // string with just the leading slash return '/'; } else if (len > 2) { // parts i s // ["", "a", ""] // ["", "a", "b", ""] if (parts[len - 1].length === 0) { // last part is an empty string which would result in trailing slash len--; } } // truncate parts to remove unused parts.length = len; return parts.join('/'); }
javascript
function normalizePathParts(parts) { // IMPORTANT: It is assumed that parts[0] === "" because this method is used to // join an absolute path to a relative path var i; var len = 0; var numParts = parts.length; for (i = 0; i < numParts; i++) { var part = parts[i]; if (part === '.') { // ignore parts with just "." /* // if the "." is at end of parts (e.g. ["a", "b", "."]) then trim it off if (i === numParts - 1) { //len--; } */ } else if (part === '..') { // overwrite the previous item by decrementing length len--; } else { // add this part to result and increment length parts[len] = part; len++; } } if (len === 1) { // if we end up with just one part that is empty string // (which can happen if input is ["", "."]) then return // string with just the leading slash return '/'; } else if (len > 2) { // parts i s // ["", "a", ""] // ["", "a", "b", ""] if (parts[len - 1].length === 0) { // last part is an empty string which would result in trailing slash len--; } } // truncate parts to remove unused parts.length = len; return parts.join('/'); }
[ "function", "normalizePathParts", "(", "parts", ")", "{", "// IMPORTANT: It is assumed that parts[0] === \"\" because this method is used to", "// join an absolute path to a relative path", "var", "i", ";", "var", "len", "=", "0", ";", "var", "numParts", "=", "parts", ".", ...
This function will take an array of path parts and normalize them by handling handle ".." and "." and then joining the resultant string. @param {Array} parts an array of parts that presumedly was split on the "/" character.
[ "This", "function", "will", "take", "an", "array", "of", "path", "parts", "and", "normalize", "them", "by", "handling", "handle", "..", "and", ".", "and", "then", "joining", "the", "resultant", "string", "." ]
9274abb14e4fd051ddcc609dbc9fe9ac6605631c
https://github.com/makeup-js/makeup-expander/blob/9274abb14e4fd051ddcc609dbc9fe9ac6605631c/docs/static/bundle.js#L222-L270
29,418
ArnaudBuchholz/gpf-js
src/context.js
_gpfReduceContext
function _gpfReduceContext (path, reducer) { var rootContext, pathToReduce; if (path[_GPF_START] === "gpf") { rootContext = gpf; pathToReduce = _gpfArrayTail(path); } else { rootContext = _gpfMainContext; pathToReduce = path; } return pathToReduce.reduce(reducer, rootContext); }
javascript
function _gpfReduceContext (path, reducer) { var rootContext, pathToReduce; if (path[_GPF_START] === "gpf") { rootContext = gpf; pathToReduce = _gpfArrayTail(path); } else { rootContext = _gpfMainContext; pathToReduce = path; } return pathToReduce.reduce(reducer, rootContext); }
[ "function", "_gpfReduceContext", "(", "path", ",", "reducer", ")", "{", "var", "rootContext", ",", "pathToReduce", ";", "if", "(", "path", "[", "_GPF_START", "]", "===", "\"gpf\"", ")", "{", "rootContext", "=", "gpf", ";", "pathToReduce", "=", "_gpfArrayTail...
Apply reducer on path
[ "Apply", "reducer", "on", "path" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/context.js#L28-L39
29,419
ArnaudBuchholz/gpf-js
lost+found/src/params.js
function (definitions) { var result = [], len = definitions.length, idx, definition; for (idx = 0; idx < len; ++idx) { definition = definitions[idx]; if (!(definition instanceof gpf.Parameter)) { definition = this._createFromObject(definition); } result.push(definition); } return result; }
javascript
function (definitions) { var result = [], len = definitions.length, idx, definition; for (idx = 0; idx < len; ++idx) { definition = definitions[idx]; if (!(definition instanceof gpf.Parameter)) { definition = this._createFromObject(definition); } result.push(definition); } return result; }
[ "function", "(", "definitions", ")", "{", "var", "result", "=", "[", "]", ",", "len", "=", "definitions", ".", "length", ",", "idx", ",", "definition", ";", "for", "(", "idx", "=", "0", ";", "idx", "<", "len", ";", "++", "idx", ")", "{", "definit...
Create a list of parameters @param {Object[]} definitions @return {gpf.Parameter[]}
[ "Create", "a", "list", "of", "parameters" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/params.js#L130-L144
29,420
ArnaudBuchholz/gpf-js
lost+found/src/params.js
function (definition) { var result = new gpf.Parameter(), typeDefaultValue; if (definition === gpf.Parameter.VERBOSE || definition.prefix === gpf.Parameter.VERBOSE) { definition = { name: "verbose", description: "Enable verbose mode", type: "boolean", defaultValue: false, prefix: gpf.Parameter.VERBOSE }; } else if (definition === gpf.Parameter.HELP || definition.prefix === gpf.Parameter.HELP) { definition = { name: "help", description: "Display help", type: "boolean", defaultValue: false, prefix: gpf.Parameter.HELP }; } gpf.json.load(result, definition); // name is required if (!result._name) { gpf.Error.paramsNameRequired(); } if (!result._multiple) { /** * When multiple is used, the default value will be an array * if not specified. * Otherwise, we get the default value based on the type */ typeDefaultValue = this.DEFAULTS[result._type]; if (undefined === typeDefaultValue) { gpf.Error.paramsTypeUnknown(); } if (result.hasOwnProperty("_defaultValue")) { result._defaultValue = gpf.value(result._defaultValue, typeDefaultValue, result._type); } } return result; }
javascript
function (definition) { var result = new gpf.Parameter(), typeDefaultValue; if (definition === gpf.Parameter.VERBOSE || definition.prefix === gpf.Parameter.VERBOSE) { definition = { name: "verbose", description: "Enable verbose mode", type: "boolean", defaultValue: false, prefix: gpf.Parameter.VERBOSE }; } else if (definition === gpf.Parameter.HELP || definition.prefix === gpf.Parameter.HELP) { definition = { name: "help", description: "Display help", type: "boolean", defaultValue: false, prefix: gpf.Parameter.HELP }; } gpf.json.load(result, definition); // name is required if (!result._name) { gpf.Error.paramsNameRequired(); } if (!result._multiple) { /** * When multiple is used, the default value will be an array * if not specified. * Otherwise, we get the default value based on the type */ typeDefaultValue = this.DEFAULTS[result._type]; if (undefined === typeDefaultValue) { gpf.Error.paramsTypeUnknown(); } if (result.hasOwnProperty("_defaultValue")) { result._defaultValue = gpf.value(result._defaultValue, typeDefaultValue, result._type); } } return result; }
[ "function", "(", "definition", ")", "{", "var", "result", "=", "new", "gpf", ".", "Parameter", "(", ")", ",", "typeDefaultValue", ";", "if", "(", "definition", "===", "gpf", ".", "Parameter", ".", "VERBOSE", "||", "definition", ".", "prefix", "===", "gpf...
Create a parameter from the definition object @param {Object} definition @return {gpf.Parameter} @private
[ "Create", "a", "parameter", "from", "the", "definition", "object" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/params.js#L153-L198
29,421
ArnaudBuchholz/gpf-js
lost+found/src/params.js
function (parameters, argumentsToParse) { var result = {}, len, idx, argument, parameter, name, lastNonPrefixIdx = 0; parameters = gpf.Parameter.create(parameters); len = argumentsToParse.length; for (idx = 0; idx < len; ++idx) { // Check if a prefix was used and find parameter argument = this.getPrefixValuePair(argumentsToParse[idx]); if (argument instanceof Array) { parameter = this.getOnPrefix(parameters, argument[0]); argument = argument[1]; } else { parameter = this.getOnPrefix(parameters, lastNonPrefixIdx); lastNonPrefixIdx = parameters.indexOf(parameter) + 1; } // If no parameter corresponds, ignore if (!parameter) { // TODO maybe an error might be more appropriate continue; } // Sometimes, the prefix might be used without value if (undefined === argument) { if ("boolean" === parameter._type) { argument = !parameter._defaultValue; } else { // Nothing to do with it // TODO maybe an error might be more appropriate continue; } } // Convert the value to match the type // TODO change when type will be an object argument = gpf.value(argument, parameter._defaultValue, parameter._type); // Assign the corresponding member of the result object name = parameter._name; if (parameter._multiple) { if (undefined === result[name]) { result[name] = []; } result[name].push(argument); if (parameter._prefix === "") { --lastNonPrefixIdx; } } else { // The last one wins result[name] = argument; } } this._finalizeParse(parameters, result); return result; }
javascript
function (parameters, argumentsToParse) { var result = {}, len, idx, argument, parameter, name, lastNonPrefixIdx = 0; parameters = gpf.Parameter.create(parameters); len = argumentsToParse.length; for (idx = 0; idx < len; ++idx) { // Check if a prefix was used and find parameter argument = this.getPrefixValuePair(argumentsToParse[idx]); if (argument instanceof Array) { parameter = this.getOnPrefix(parameters, argument[0]); argument = argument[1]; } else { parameter = this.getOnPrefix(parameters, lastNonPrefixIdx); lastNonPrefixIdx = parameters.indexOf(parameter) + 1; } // If no parameter corresponds, ignore if (!parameter) { // TODO maybe an error might be more appropriate continue; } // Sometimes, the prefix might be used without value if (undefined === argument) { if ("boolean" === parameter._type) { argument = !parameter._defaultValue; } else { // Nothing to do with it // TODO maybe an error might be more appropriate continue; } } // Convert the value to match the type // TODO change when type will be an object argument = gpf.value(argument, parameter._defaultValue, parameter._type); // Assign the corresponding member of the result object name = parameter._name; if (parameter._multiple) { if (undefined === result[name]) { result[name] = []; } result[name].push(argument); if (parameter._prefix === "") { --lastNonPrefixIdx; } } else { // The last one wins result[name] = argument; } } this._finalizeParse(parameters, result); return result; }
[ "function", "(", "parameters", ",", "argumentsToParse", ")", "{", "var", "result", "=", "{", "}", ",", "len", ",", "idx", ",", "argument", ",", "parameter", ",", "name", ",", "lastNonPrefixIdx", "=", "0", ";", "parameters", "=", "gpf", ".", "Parameter", ...
Parse the arguments and return an object with the recognized parameters. Throws an error if required parameters are missing. @param {gpf.Parameter[]|Object[]} parameters @param {String[]} argumentsToParse @return {Object}
[ "Parse", "the", "arguments", "and", "return", "an", "object", "with", "the", "recognized", "parameters", ".", "Throws", "an", "error", "if", "required", "parameters", "are", "missing", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/params.js#L264-L323
29,422
ArnaudBuchholz/gpf-js
lost+found/src/params.js
function (parameters, result) { var len, idx, parameter, name, value; len = parameters.length; for (idx = 0; idx < len; ++idx) { parameter = parameters[idx]; name = parameter._name; if (undefined === result[name]) { if (parameter._required) { gpf.Error.paramsRequiredMissing({ name: name }); } value = parameter._defaultValue; if (undefined !== value) { if (parameter._multiple) { value = [value]; } result[name] = value; } else if (parameter._multiple) { result[name] = []; } } } }
javascript
function (parameters, result) { var len, idx, parameter, name, value; len = parameters.length; for (idx = 0; idx < len; ++idx) { parameter = parameters[idx]; name = parameter._name; if (undefined === result[name]) { if (parameter._required) { gpf.Error.paramsRequiredMissing({ name: name }); } value = parameter._defaultValue; if (undefined !== value) { if (parameter._multiple) { value = [value]; } result[name] = value; } else if (parameter._multiple) { result[name] = []; } } } }
[ "function", "(", "parameters", ",", "result", ")", "{", "var", "len", ",", "idx", ",", "parameter", ",", "name", ",", "value", ";", "len", "=", "parameters", ".", "length", ";", "for", "(", "idx", "=", "0", ";", "idx", "<", "len", ";", "++", "idx...
Check that all required fields are set, apply default values @param {gpf.Parameter[]} parameters @param {Object} result @private
[ "Check", "that", "all", "required", "fields", "are", "set", "apply", "default", "values" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/params.js#L333-L361
29,423
ArnaudBuchholz/gpf-js
src/define/class/super.js
_gpfClassSuperCreateWeakBoundWithSameSignature
function _gpfClassSuperCreateWeakBoundWithSameSignature (that, $super, superMethod) { var definition = _gpfFunctionDescribe(superMethod); definition.body = "return _superMethod_.apply(this === _$super_ ? _that_ : this, arguments);"; return _gpfFunctionBuild(definition, { _that_: that, _$super_: $super, _superMethod_: superMethod }); }
javascript
function _gpfClassSuperCreateWeakBoundWithSameSignature (that, $super, superMethod) { var definition = _gpfFunctionDescribe(superMethod); definition.body = "return _superMethod_.apply(this === _$super_ ? _that_ : this, arguments);"; return _gpfFunctionBuild(definition, { _that_: that, _$super_: $super, _superMethod_: superMethod }); }
[ "function", "_gpfClassSuperCreateWeakBoundWithSameSignature", "(", "that", ",", "$super", ",", "superMethod", ")", "{", "var", "definition", "=", "_gpfFunctionDescribe", "(", "superMethod", ")", ";", "definition", ".", "body", "=", "\"return _superMethod_.apply(this === _...
Copy super method signature and apply weak binding. @param {Object} that Object instance @param {Function} $super $super member @param {*} superMethod superMember Member extracted from inherited prototype @return {Function} $super method @since 0.1.7
[ "Copy", "super", "method", "signature", "and", "apply", "weak", "binding", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/define/class/super.js#L94-L102
29,424
ArnaudBuchholz/gpf-js
src/define/class/super.js
function (method, methodName, superMembers) { return { _method_: method, _methodName_: methodName, _superMembers_: superMembers, _classDef_: this }; }
javascript
function (method, methodName, superMembers) { return { _method_: method, _methodName_: methodName, _superMembers_: superMembers, _classDef_: this }; }
[ "function", "(", "method", ",", "methodName", ",", "superMembers", ")", "{", "return", "{", "_method_", ":", "method", ",", "_methodName_", ":", "methodName", ",", "_superMembers_", ":", "superMembers", ",", "_classDef_", ":", "this", "}", ";", "}" ]
Generates context for the superified method @param {Function} method Method to superify @param {String} methodName Name of the method (used to search in object prototype) @param {String[]} superMembers Detected $super members used in the method @return {Object} Context of superified method @since 0.1.7
[ "Generates", "context", "for", "the", "superified", "method" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/define/class/super.js#L194-L201
29,425
ArnaudBuchholz/gpf-js
src/define/class/super.js
function (method, methodName, superMembers) { // Keep signature var description = _gpfFunctionDescribe(method); description.body = this._superifiedBody; return _gpfFunctionBuild(description, this._getSuperifiedContext(method, methodName, superMembers)); }
javascript
function (method, methodName, superMembers) { // Keep signature var description = _gpfFunctionDescribe(method); description.body = this._superifiedBody; return _gpfFunctionBuild(description, this._getSuperifiedContext(method, methodName, superMembers)); }
[ "function", "(", "method", ",", "methodName", ",", "superMembers", ")", "{", "// Keep signature", "var", "description", "=", "_gpfFunctionDescribe", "(", "method", ")", ";", "description", ".", "body", "=", "this", ".", "_superifiedBody", ";", "return", "_gpfFun...
Generates the superified version of the method @param {Function} method Method to superify @param {String} methodName Name of the method (used to search in object prototype) @param {String[]} superMembers Detected $super members used in the method @return {Function} Superified method @since 0.1.7
[ "Generates", "the", "superified", "version", "of", "the", "method" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/define/class/super.js#L212-L217
29,426
ArnaudBuchholz/gpf-js
src/stream/pipe.js
_gpfStreamPipeToFlushableWrite
function _gpfStreamPipeToFlushableWrite (intermediate, destination) { var state = _gpfStreamPipeAllocateState(intermediate, destination), read = _gpfStreamPipeAllocateRead(state), iFlushableIntermediate = state.iFlushableIntermediate, iFlushableDestination = state.iFlushableDestination, iWritableIntermediate = state.iWritableIntermediate; read(); return { flush: function () { return _gpfStreamPipeCheckIfReadError(state) || iFlushableIntermediate.flush() .then(function () { return iFlushableDestination.flush(); }); }, write: function (data) { read(); return _gpfStreamPipeCheckIfReadError(state) || _gpfStreamPipeWrapWrite(state, iWritableIntermediate.write(data)); } }; }
javascript
function _gpfStreamPipeToFlushableWrite (intermediate, destination) { var state = _gpfStreamPipeAllocateState(intermediate, destination), read = _gpfStreamPipeAllocateRead(state), iFlushableIntermediate = state.iFlushableIntermediate, iFlushableDestination = state.iFlushableDestination, iWritableIntermediate = state.iWritableIntermediate; read(); return { flush: function () { return _gpfStreamPipeCheckIfReadError(state) || iFlushableIntermediate.flush() .then(function () { return iFlushableDestination.flush(); }); }, write: function (data) { read(); return _gpfStreamPipeCheckIfReadError(state) || _gpfStreamPipeWrapWrite(state, iWritableIntermediate.write(data)); } }; }
[ "function", "_gpfStreamPipeToFlushableWrite", "(", "intermediate", ",", "destination", ")", "{", "var", "state", "=", "_gpfStreamPipeAllocateState", "(", "intermediate", ",", "destination", ")", ",", "read", "=", "_gpfStreamPipeAllocateRead", "(", "state", ")", ",", ...
Create a flushable & writable stream by combining the intermediate stream with the writable destination @param {Object} intermediate Must implements IReadableStream interface. If it implements the IFlushableStream interface, it is assumed that it retains data until it receives the Flush. Meaning, the read won't complete until the flush call. If it does not implement the IFlushableStream, the read may end before the whole sequence has finished. It means that the next write should trigger a new read and flush must be simulated at least to pass it to the destination @param {Object} destination Must implements IWritableStream interface. If it implements the IFlushableStream, it will be called when the intermediate completes. @return {Object} Implementing IWritableStream and IFlushableStream @since 0.2.3
[ "Create", "a", "flushable", "&", "writable", "stream", "by", "combining", "the", "intermediate", "stream", "with", "the", "writable", "destination" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/stream/pipe.js#L93-L118
29,427
ArnaudBuchholz/gpf-js
src/stream/pipe.js
_gpfStreamPipe
function _gpfStreamPipe (source, destination) { _gpfIgnore(destination); var iReadableStream = _gpfStreamQueryReadable(source), iWritableStream = _gpfStreamPipeToWritable(_gpfArrayTail(arguments)), iFlushableStream = _gpfStreamPipeToFlushable(iWritableStream); try { return iReadableStream.read(iWritableStream) .then(function () { return iFlushableStream.flush(); }); } catch (e) { return Promise.reject(e); } }
javascript
function _gpfStreamPipe (source, destination) { _gpfIgnore(destination); var iReadableStream = _gpfStreamQueryReadable(source), iWritableStream = _gpfStreamPipeToWritable(_gpfArrayTail(arguments)), iFlushableStream = _gpfStreamPipeToFlushable(iWritableStream); try { return iReadableStream.read(iWritableStream) .then(function () { return iFlushableStream.flush(); }); } catch (e) { return Promise.reject(e); } }
[ "function", "_gpfStreamPipe", "(", "source", ",", "destination", ")", "{", "_gpfIgnore", "(", "destination", ")", ";", "var", "iReadableStream", "=", "_gpfStreamQueryReadable", "(", "source", ")", ",", "iWritableStream", "=", "_gpfStreamPipeToWritable", "(", "_gpfAr...
Pipe streams. @param {gpf.interfaces.IReadableStream} source Source stream @param {...gpf.interfaces.IWritableStream} destination Writable streams @return {Promise} Resolved when reading (and subsequent writings) are done @since 0.2.3
[ "Pipe", "streams", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/stream/pipe.js#L144-L157
29,428
ArnaudBuchholz/gpf-js
src/boot.js
_gpfLoadSources
function _gpfLoadSources () { //jshint ignore:line var sourceListContent = _gpfSyncReadForBoot(gpfSourcesPath + "sources.json"), _gpfSources = _GpfFunc("return " + sourceListContent)(), allContent = [], idx = 0; for (; idx < _gpfSources.length; ++idx) { _gpfProcessSource(_gpfSources[idx], allContent); } return allContent.join("\n"); }
javascript
function _gpfLoadSources () { //jshint ignore:line var sourceListContent = _gpfSyncReadForBoot(gpfSourcesPath + "sources.json"), _gpfSources = _GpfFunc("return " + sourceListContent)(), allContent = [], idx = 0; for (; idx < _gpfSources.length; ++idx) { _gpfProcessSource(_gpfSources[idx], allContent); } return allContent.join("\n"); }
[ "function", "_gpfLoadSources", "(", ")", "{", "//jshint ignore:line", "var", "sourceListContent", "=", "_gpfSyncReadForBoot", "(", "gpfSourcesPath", "+", "\"sources.json\"", ")", ",", "_gpfSources", "=", "_GpfFunc", "(", "\"return \"", "+", "sourceListContent", ")", "...
Load content of all sources @return {String} Consolidated sources @since 0.1.9
[ "Load", "content", "of", "all", "sources" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/boot.js#L299-L308
29,429
ArnaudBuchholz/gpf-js
lost+found/src/attributes/class.js
_gpfBuildPropertyFunc
function _gpfBuildPropertyFunc (template, member) { var src, params, start, end; // Replace all occurrences of _MEMBER_ with the right name src = template.toString().split("_MEMBER_").join(member); // Extract parameters start = src.indexOf("(") + 1; end = src.indexOf(")", start) - 1; params = src.substr(start, end - start + 1).split(",").map(function (name) { return name.trim(); }); // Extract body start = src.indexOf("{") + 1; end = src.lastIndexOf("}") - 1; src = src.substr(start, end - start + 1); return _gpfFunc(params, src); }
javascript
function _gpfBuildPropertyFunc (template, member) { var src, params, start, end; // Replace all occurrences of _MEMBER_ with the right name src = template.toString().split("_MEMBER_").join(member); // Extract parameters start = src.indexOf("(") + 1; end = src.indexOf(")", start) - 1; params = src.substr(start, end - start + 1).split(",").map(function (name) { return name.trim(); }); // Extract body start = src.indexOf("{") + 1; end = src.lastIndexOf("}") - 1; src = src.substr(start, end - start + 1); return _gpfFunc(params, src); }
[ "function", "_gpfBuildPropertyFunc", "(", "template", ",", "member", ")", "{", "var", "src", ",", "params", ",", "start", ",", "end", ";", "// Replace all occurrences of _MEMBER_ with the right name", "src", "=", "template", ".", "toString", "(", ")", ".", "split"...
Builds a new property function @param {Boolean} template Template to be used @param {String} member Value of _MEMBER_ @return {Function}
[ "Builds", "a", "new", "property", "function" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/attributes/class.js#L60-L78
29,430
Keenpoint/smart-circular
smart-circular.js
function(object, customizer) { var foundStack = [], //Stack to keep track of discovered objects queueOfModifiers = [], //Necessary to change our JSON as we take elements from the queue (BFS algorithm) queue = []; //queue of JSON elements, following the BFS algorithm //We instantiate our result root. var result = _.isArray(object) ? [] : {}; //We first put all the JSON source in our queues queue.push(object); queueOfModifiers.push(new ObjectEditor(object, "")); var positionStack; var nextInsertion; //BFS algorithm while(queue.length > 0) { //JSON to be modified and its editor var value = queue.shift(); var editor = queueOfModifiers.shift(); //The path that leads to this JSON, so we can build other paths from it var path = editor.path; //We first attempt to make any personalized replacements //If customizer doesn't affect the value, customizer(value) returns undefined and we jump this if if(customizer !== undefined) { //By using this variable, customizer(value) is called only once. var customizedValue = customizer(value); if(customizedValue !== undefined) value = customizedValue; } if(typeof value === "object") { positionStack = _.chain(foundStack) .map("value") .indexOf(value) .value(); //If the value has already been discovered, we only fix its circular reference if(positionStack !== -1) { nextInsertion = foundStack[positionStack].makePathName(); } else { //At the first time we discover a certain value, we put it in the stack foundStack.push(new FoundObject(value, path)); nextInsertion = value; for(var component in value) { if(_.has(value, component)) { queue.push(value[component]); var newPath = path + "[" + component + "]"; queueOfModifiers.push(new ObjectEditor(result, newPath)); } } } } //If it's an elementary value, it can't be circular, so we just put this value in our JSON result. else { nextInsertion = value; } editor.editObject(nextInsertion); } return result; }
javascript
function(object, customizer) { var foundStack = [], //Stack to keep track of discovered objects queueOfModifiers = [], //Necessary to change our JSON as we take elements from the queue (BFS algorithm) queue = []; //queue of JSON elements, following the BFS algorithm //We instantiate our result root. var result = _.isArray(object) ? [] : {}; //We first put all the JSON source in our queues queue.push(object); queueOfModifiers.push(new ObjectEditor(object, "")); var positionStack; var nextInsertion; //BFS algorithm while(queue.length > 0) { //JSON to be modified and its editor var value = queue.shift(); var editor = queueOfModifiers.shift(); //The path that leads to this JSON, so we can build other paths from it var path = editor.path; //We first attempt to make any personalized replacements //If customizer doesn't affect the value, customizer(value) returns undefined and we jump this if if(customizer !== undefined) { //By using this variable, customizer(value) is called only once. var customizedValue = customizer(value); if(customizedValue !== undefined) value = customizedValue; } if(typeof value === "object") { positionStack = _.chain(foundStack) .map("value") .indexOf(value) .value(); //If the value has already been discovered, we only fix its circular reference if(positionStack !== -1) { nextInsertion = foundStack[positionStack].makePathName(); } else { //At the first time we discover a certain value, we put it in the stack foundStack.push(new FoundObject(value, path)); nextInsertion = value; for(var component in value) { if(_.has(value, component)) { queue.push(value[component]); var newPath = path + "[" + component + "]"; queueOfModifiers.push(new ObjectEditor(result, newPath)); } } } } //If it's an elementary value, it can't be circular, so we just put this value in our JSON result. else { nextInsertion = value; } editor.editObject(nextInsertion); } return result; }
[ "function", "(", "object", ",", "customizer", ")", "{", "var", "foundStack", "=", "[", "]", ",", "//Stack to keep track of discovered objects", "queueOfModifiers", "=", "[", "]", ",", "//Necessary to change our JSON as we take elements from the queue (BFS algorithm)", "queue"...
Main function to travel through the JSON and transform the circular references and personalized replacements
[ "Main", "function", "to", "travel", "through", "the", "JSON", "and", "transform", "the", "circular", "references", "and", "personalized", "replacements" ]
c73cddc663fd8a9ccb2513408e2161ce60417658
https://github.com/Keenpoint/smart-circular/blob/c73cddc663fd8a9ccb2513408e2161ce60417658/smart-circular.js#L65-L136
29,431
ArnaudBuchholz/gpf-js
src/define/interface/build.js
function (newPrototype) { _gpfObjectForEach(this._initialDefinition, function (value, memberName) { if (!memberName.startsWith("$")) { newPrototype[memberName] = value; } }, this); }
javascript
function (newPrototype) { _gpfObjectForEach(this._initialDefinition, function (value, memberName) { if (!memberName.startsWith("$")) { newPrototype[memberName] = value; } }, this); }
[ "function", "(", "newPrototype", ")", "{", "_gpfObjectForEach", "(", "this", ".", "_initialDefinition", ",", "function", "(", "value", ",", "memberName", ")", "{", "if", "(", "!", "memberName", ".", "startsWith", "(", "\"$\"", ")", ")", "{", "newPrototype", ...
Build the new class prototype @param {Object} newPrototype New class prototype @since 0.1.7
[ "Build", "the", "new", "class", "prototype" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/define/interface/build.js#L36-L42
29,432
ArnaudBuchholz/gpf-js
lost+found/src/events.js
_gpfEventsIsValidHandler
function _gpfEventsIsValidHandler (eventHandler) { var type = typeof eventHandler, validator = _gpfEventsHandlerValidators[type]; if (validator === undefined) { return false; } return validator(eventHandler); }
javascript
function _gpfEventsIsValidHandler (eventHandler) { var type = typeof eventHandler, validator = _gpfEventsHandlerValidators[type]; if (validator === undefined) { return false; } return validator(eventHandler); }
[ "function", "_gpfEventsIsValidHandler", "(", "eventHandler", ")", "{", "var", "type", "=", "typeof", "eventHandler", ",", "validator", "=", "_gpfEventsHandlerValidators", "[", "type", "]", ";", "if", "(", "validator", "===", "undefined", ")", "{", "return", "fal...
Check if the provided parameter is a valid Event Handler @param {*} eventHandler Object to test @return {Boolean} True if the parameter is valid eventHandler
[ "Check", "if", "the", "provided", "parameter", "is", "a", "valid", "Event", "Handler" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/events.js#L75-L82
29,433
ArnaudBuchholz/gpf-js
lost+found/src/events.js
_gpfEventsTriggerHandler
function _gpfEventsTriggerHandler (event, eventsHandler, resolvePromise) { var eventHandler = _getEventHandler(event, eventsHandler); eventHandler(event); if (undefined !== resolvePromise) { resolvePromise(event); } }
javascript
function _gpfEventsTriggerHandler (event, eventsHandler, resolvePromise) { var eventHandler = _getEventHandler(event, eventsHandler); eventHandler(event); if (undefined !== resolvePromise) { resolvePromise(event); } }
[ "function", "_gpfEventsTriggerHandler", "(", "event", ",", "eventsHandler", ",", "resolvePromise", ")", "{", "var", "eventHandler", "=", "_getEventHandler", "(", "event", ",", "eventsHandler", ")", ";", "eventHandler", "(", "event", ")", ";", "if", "(", "undefin...
Fire the event by triggering the eventsHandler @param {gpf.events.Event} event event object to fire @param {gpf.events.Handler} eventsHandler @param {Function} [resolvePromise=undefined] resolvePromise Promise resolver
[ "Fire", "the", "event", "by", "triggering", "the", "eventsHandler" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/events.js#L169-L175
29,434
ArnaudBuchholz/gpf-js
lost+found/src/events.js
_gpfEventsFire
function _gpfEventsFire (event, params, eventsHandler) { /*jshint validthis:true*/ // will be invoked with apply _gpfAssert(_gpfEventsIsValidHandler(eventsHandler), "Expected a valid event handler"); if (!(event instanceof _GpfEvent)) { event = new gpf.events.Event(event, params, this); } return new Promise(function (resolve/*, reject*/) { // This is used both to limit the number of recursion and increase the efficiency of the algorithm. if (++_gpfEventsFiring > 10) { // Too much recursion, use setTimeout to free some space on the stack setTimeout(_gpfEventsTriggerHandler.bind(null, event, eventsHandler, resolve), 0); } else { _gpfEventsTriggerHandler(event, eventsHandler); resolve(event); } --_gpfEventsFiring; }); }
javascript
function _gpfEventsFire (event, params, eventsHandler) { /*jshint validthis:true*/ // will be invoked with apply _gpfAssert(_gpfEventsIsValidHandler(eventsHandler), "Expected a valid event handler"); if (!(event instanceof _GpfEvent)) { event = new gpf.events.Event(event, params, this); } return new Promise(function (resolve/*, reject*/) { // This is used both to limit the number of recursion and increase the efficiency of the algorithm. if (++_gpfEventsFiring > 10) { // Too much recursion, use setTimeout to free some space on the stack setTimeout(_gpfEventsTriggerHandler.bind(null, event, eventsHandler, resolve), 0); } else { _gpfEventsTriggerHandler(event, eventsHandler); resolve(event); } --_gpfEventsFiring; }); }
[ "function", "_gpfEventsFire", "(", "event", ",", "params", ",", "eventsHandler", ")", "{", "/*jshint validthis:true*/", "// will be invoked with apply", "_gpfAssert", "(", "_gpfEventsIsValidHandler", "(", "eventsHandler", ")", ",", "\"Expected a valid event handler\"", ")", ...
gpf.events.fire implementation @param {String/gpf.events.Event} event event name or event object to fire @param {Object} params dictionary of parameters for the event object creation, they are ignored if an event object is specified @param {gpf.events.Handler} eventsHandler @return {Promise<gpf.events.Event>} fulfilled when the event has been fired
[ "gpf", ".", "events", ".", "fire", "implementation" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/events.js#L190-L207
29,435
popeindustries/buddy
lib/utils/filepath.js
exists
function exists(filepath) { const cached = existsCache.has(filepath); // Only return positive to allow for generated files if (cached) return true; const filepathExists = fs.existsSync(filepath); if (filepathExists) existsCache.add(filepath); return filepathExists; }
javascript
function exists(filepath) { const cached = existsCache.has(filepath); // Only return positive to allow for generated files if (cached) return true; const filepathExists = fs.existsSync(filepath); if (filepathExists) existsCache.add(filepath); return filepathExists; }
[ "function", "exists", "(", "filepath", ")", "{", "const", "cached", "=", "existsCache", ".", "has", "(", "filepath", ")", ";", "// Only return positive to allow for generated files", "if", "(", "cached", ")", "return", "true", ";", "const", "filepathExists", "=", ...
Determine if 'filepath' exists @param {String} filepath @returns {Boolean}
[ "Determine", "if", "filepath", "exists" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/filepath.js#L178-L189
29,436
ArnaudBuchholz/gpf-js
src/define/entities.js
_gpfDefineEntitiesAdd
function _gpfDefineEntitiesAdd (entityDefinition) { _gpfAssert(entityDefinition._instanceBuilder !== null, "Instance builder must be set"); _gpfAssert(!_gpfDefineEntitiesFindByConstructor(entityDefinition.getInstanceBuilder()), "Already added"); _gpfDefinedEntities.push(entityDefinition); }
javascript
function _gpfDefineEntitiesAdd (entityDefinition) { _gpfAssert(entityDefinition._instanceBuilder !== null, "Instance builder must be set"); _gpfAssert(!_gpfDefineEntitiesFindByConstructor(entityDefinition.getInstanceBuilder()), "Already added"); _gpfDefinedEntities.push(entityDefinition); }
[ "function", "_gpfDefineEntitiesAdd", "(", "entityDefinition", ")", "{", "_gpfAssert", "(", "entityDefinition", ".", "_instanceBuilder", "!==", "null", ",", "\"Instance builder must be set\"", ")", ";", "_gpfAssert", "(", "!", "_gpfDefineEntitiesFindByConstructor", "(", "e...
Store the entity definition to be retreived later @param {_GpfEntityDefinition} entityDefinition Entity definition @since 0.2.9
[ "Store", "the", "entity", "definition", "to", "be", "retreived", "later" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/define/entities.js#L41-L45
29,437
ArnaudBuchholz/gpf-js
src/fs/nodejs.js
function (unnormalizedPath) { var path = _gpfPathNormalize(unnormalizedPath); return new Promise(function (resolve) { _gpfNodeFs.exists(path, resolve); }) .then(function (exists) { if (exists) { return _gpfFsNodeFsCallWithPath("stat", path) .then(function (stats) { return { fileName: _gpfNodePath.basename(path), filePath: _gpfPathNormalize(_gpfNodePath.resolve(path)), size: stats.size, createdDateTime: stats.ctime, modifiedDateTime: stats.mtime, type: _gpfFsNodeGetType(stats) }; }); } return { type: _GPF_FS_TYPES.NOT_FOUND }; }); }
javascript
function (unnormalizedPath) { var path = _gpfPathNormalize(unnormalizedPath); return new Promise(function (resolve) { _gpfNodeFs.exists(path, resolve); }) .then(function (exists) { if (exists) { return _gpfFsNodeFsCallWithPath("stat", path) .then(function (stats) { return { fileName: _gpfNodePath.basename(path), filePath: _gpfPathNormalize(_gpfNodePath.resolve(path)), size: stats.size, createdDateTime: stats.ctime, modifiedDateTime: stats.mtime, type: _gpfFsNodeGetType(stats) }; }); } return { type: _GPF_FS_TYPES.NOT_FOUND }; }); }
[ "function", "(", "unnormalizedPath", ")", "{", "var", "path", "=", "_gpfPathNormalize", "(", "unnormalizedPath", ")", ";", "return", "new", "Promise", "(", "function", "(", "resolve", ")", "{", "_gpfNodeFs", ".", "exists", "(", "path", ",", "resolve", ")", ...
region gpf.interfaces.IFileStorage @gpf:sameas gpf.interfaces.IFileStorage#getInfo @since 0.1.9
[ "region", "gpf", ".", "interfaces", ".", "IFileStorage" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/fs/nodejs.js#L133-L157
29,438
popeindustries/buddy
packages/buddy-cli/index.js
getOptions
function getOptions () { return { compress: ('compress' in program) ? program.compress : false, debug: ('debug' in program) ? program.debug : false, deploy: false, grep: ('grep' in program) ? program.grep : false, invert: ('invert' in program) ? program.invert : false, maps: ('maps' in program) ? program.maps : false, reload: ('reload' in program) ? program.reload : false, script: ('script' in program) ? program.script : false, serve: ('serve' in program) ? program.serve : false, watch: false }; }
javascript
function getOptions () { return { compress: ('compress' in program) ? program.compress : false, debug: ('debug' in program) ? program.debug : false, deploy: false, grep: ('grep' in program) ? program.grep : false, invert: ('invert' in program) ? program.invert : false, maps: ('maps' in program) ? program.maps : false, reload: ('reload' in program) ? program.reload : false, script: ('script' in program) ? program.script : false, serve: ('serve' in program) ? program.serve : false, watch: false }; }
[ "function", "getOptions", "(", ")", "{", "return", "{", "compress", ":", "(", "'compress'", "in", "program", ")", "?", "program", ".", "compress", ":", "false", ",", "debug", ":", "(", "'debug'", "in", "program", ")", "?", "program", ".", "debug", ":",...
Retrieve options object @returns {Object}
[ "Retrieve", "options", "object" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/packages/buddy-cli/index.js#L100-L113
29,439
popeindustries/buddy
lib/plugins/react/index.js
define
function define(JSFile, utils) { return class JSXFile extends JSFile { /** * Parse 'content' for dependency references * @param {String} content * @returns {Array} */ parseDependencyReferences(content) { const references = super.parseDependencyReferences(content); references[0].push({ context: "require('react')", match: 'react', id: 'react' }); return references; } /** * Transpile file contents * @param {Object} buildOptions * - {Boolean} batch * - {Boolean} bootstrap * - {Boolean} boilerplate * - {Boolean} browser * - {Boolean} bundle * - {Boolean} compress * - {Boolean} helpers * - {Array} ignoredFiles * - {Boolean} import * - {Boolean} watchOnly * @param {Function} fn(err) */ transpile(buildOptions, fn) { super.transpile(buildOptions, (err) => { if (err) return fn && fn(); this.prependContent("var React = $m['react'].exports;"); fn(); }); } }; }
javascript
function define(JSFile, utils) { return class JSXFile extends JSFile { /** * Parse 'content' for dependency references * @param {String} content * @returns {Array} */ parseDependencyReferences(content) { const references = super.parseDependencyReferences(content); references[0].push({ context: "require('react')", match: 'react', id: 'react' }); return references; } /** * Transpile file contents * @param {Object} buildOptions * - {Boolean} batch * - {Boolean} bootstrap * - {Boolean} boilerplate * - {Boolean} browser * - {Boolean} bundle * - {Boolean} compress * - {Boolean} helpers * - {Array} ignoredFiles * - {Boolean} import * - {Boolean} watchOnly * @param {Function} fn(err) */ transpile(buildOptions, fn) { super.transpile(buildOptions, (err) => { if (err) return fn && fn(); this.prependContent("var React = $m['react'].exports;"); fn(); }); } }; }
[ "function", "define", "(", "JSFile", ",", "utils", ")", "{", "return", "class", "JSXFile", "extends", "JSFile", "{", "/**\n * Parse 'content' for dependency references\n * @param {String} content\n * @returns {Array}\n */", "parseDependencyReferences", "(", "content...
Extend 'JSFile' with new behaviour @param {Class} JSFile @param {Object} utils @returns {Class}
[ "Extend", "JSFile", "with", "new", "behaviour" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/plugins/react/index.js#L30-L68
29,440
ArnaudBuchholz/gpf-js
src/literal.js
_gpfIsLiteralObject
function _gpfIsLiteralObject (value) { return value instanceof Object && _gpfObjectToString.call(value) === "[object Object]" && Object.getPrototypeOf(value) === Object.getPrototypeOf({}); }
javascript
function _gpfIsLiteralObject (value) { return value instanceof Object && _gpfObjectToString.call(value) === "[object Object]" && Object.getPrototypeOf(value) === Object.getPrototypeOf({}); }
[ "function", "_gpfIsLiteralObject", "(", "value", ")", "{", "return", "value", "instanceof", "Object", "&&", "_gpfObjectToString", ".", "call", "(", "value", ")", "===", "\"[object Object]\"", "&&", "Object", ".", "getPrototypeOf", "(", "value", ")", "===", "Obje...
Check if the parameter is a literal object @param {*} value Value to check @return {Boolean} True if the value is a literal object @since 0.2.1
[ "Check", "if", "the", "parameter", "is", "a", "literal", "object" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/literal.js#L19-L23
29,441
popeindustries/buddy
lib/utils/serverfarm.js
startAppServer
function startAppServer(fn) { if (!checkingAppServerPort) { server = fork(appServer.file, [], appServer.options); server.on('exit', code => { checkingAppServerPort = false; server.removeAllListeners(); server = null; fn(Error('failed to start server')); }); checkingAppServerPort = true; waitForPortOpen(appServer.port, fn); } }
javascript
function startAppServer(fn) { if (!checkingAppServerPort) { server = fork(appServer.file, [], appServer.options); server.on('exit', code => { checkingAppServerPort = false; server.removeAllListeners(); server = null; fn(Error('failed to start server')); }); checkingAppServerPort = true; waitForPortOpen(appServer.port, fn); } }
[ "function", "startAppServer", "(", "fn", ")", "{", "if", "(", "!", "checkingAppServerPort", ")", "{", "server", "=", "fork", "(", "appServer", ".", "file", ",", "[", "]", ",", "appServer", ".", "options", ")", ";", "server", ".", "on", "(", "'exit'", ...
Start app server @param {Function} fn(err)
[ "Start", "app", "server" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/serverfarm.js#L151-L164
29,442
SockDrawer/SockBot
plugins/echo.js
echo
function echo(command) { return command.getUser() .then((user) => { const content = (command.parent.text || '').split('\n').map((line) => `> ${line}`); content.unshift(`@${user.username} said:`); command.reply(content.join('\n')); }); }
javascript
function echo(command) { return command.getUser() .then((user) => { const content = (command.parent.text || '').split('\n').map((line) => `> ${line}`); content.unshift(`@${user.username} said:`); command.reply(content.join('\n')); }); }
[ "function", "echo", "(", "command", ")", "{", "return", "command", ".", "getUser", "(", ")", ".", "then", "(", "(", "user", ")", "=>", "{", "const", "content", "=", "(", "command", ".", "parent", ".", "text", "||", "''", ")", ".", "split", "(", "...
Echo the command contents back to the user @param {Command} command The command that contains the `!echo` command @returns {Promise} Resolves when processing is complete
[ "Echo", "the", "command", "contents", "back", "to", "the", "user" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/plugins/echo.js#L24-L31
29,443
ArnaudBuchholz/gpf-js
src/require/configure.js
_gpfRequireConfigureAddOption
function _gpfRequireConfigureAddOption (name, handler, highPriority) { if (highPriority) { _gpfRequireConfigureOptionNames.unshift(name); } else { _gpfRequireConfigureOptionNames.push(name); } _gpfRequireConfigureHandler[name] = handler; }
javascript
function _gpfRequireConfigureAddOption (name, handler, highPriority) { if (highPriority) { _gpfRequireConfigureOptionNames.unshift(name); } else { _gpfRequireConfigureOptionNames.push(name); } _gpfRequireConfigureHandler[name] = handler; }
[ "function", "_gpfRequireConfigureAddOption", "(", "name", ",", "handler", ",", "highPriority", ")", "{", "if", "(", "highPriority", ")", "{", "_gpfRequireConfigureOptionNames", ".", "unshift", "(", "name", ")", ";", "}", "else", "{", "_gpfRequireConfigureOptionNames...
Declare a configuration option @param {String} name Option name @param {Function} handler Option handler (will receive context and value) @param {Boolean} [highPriority=false] Option must be handled before the others @since 0.2.9
[ "Declare", "a", "configuration", "option" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/require/configure.js#L87-L94
29,444
popeindustries/buddy
lib/config/buddyPlugins.js
loadPluginsFromDir
function loadPluginsFromDir(dir, config) { try { fs .readdirSync(dir) .filter(resource => { if (path.basename(dir) != 'plugins') return RE_PLUGIN.test(resource); return RE_JS_FILE.test(resource) || fs.statSync(path.join(dir, resource)).isDirectory(); }) .forEach(resource => { registerPlugin(path.join(dir, resource), config); }); } catch (err) { /* ignore */ } }
javascript
function loadPluginsFromDir(dir, config) { try { fs .readdirSync(dir) .filter(resource => { if (path.basename(dir) != 'plugins') return RE_PLUGIN.test(resource); return RE_JS_FILE.test(resource) || fs.statSync(path.join(dir, resource)).isDirectory(); }) .forEach(resource => { registerPlugin(path.join(dir, resource), config); }); } catch (err) { /* ignore */ } }
[ "function", "loadPluginsFromDir", "(", "dir", ",", "config", ")", "{", "try", "{", "fs", ".", "readdirSync", "(", "dir", ")", ".", "filter", "(", "resource", "=>", "{", "if", "(", "path", ".", "basename", "(", "dir", ")", "!=", "'plugins'", ")", "ret...
Load plugins in 'dir' @param {String} dir @param {Object} config
[ "Load", "plugins", "in", "dir" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buddyPlugins.js#L48-L62
29,445
popeindustries/buddy
lib/config/buddyPlugins.js
registerPlugin
function registerPlugin(resource, config, silent) { let module; try { module = 'string' == typeof resource ? require(resource) : resource; } catch (err) { return warn(`unable to load plugin ${strong(resource)}`); } if (!('register' in module)) return warn(`invalid plugin ${strong(resource)}`); module.register(config); if (!silent) print(`registered plugin ${strong(module.name)}`, 0); }
javascript
function registerPlugin(resource, config, silent) { let module; try { module = 'string' == typeof resource ? require(resource) : resource; } catch (err) { return warn(`unable to load plugin ${strong(resource)}`); } if (!('register' in module)) return warn(`invalid plugin ${strong(resource)}`); module.register(config); if (!silent) print(`registered plugin ${strong(module.name)}`, 0); }
[ "function", "registerPlugin", "(", "resource", ",", "config", ",", "silent", ")", "{", "let", "module", ";", "try", "{", "module", "=", "'string'", "==", "typeof", "resource", "?", "require", "(", "resource", ")", ":", "resource", ";", "}", "catch", "(",...
Register plugin 'resource' @param {String} resource @param {Object} config @param {Boolean} [silent] @returns {null}
[ "Register", "plugin", "resource" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/config/buddyPlugins.js#L71-L84
29,446
ArnaudBuchholz/gpf-js
src/compatibility/json/stringify.js
_gpfJsonStringifyPolyfill
function _gpfJsonStringifyPolyfill (value, replacer, space) { return _gpfJsonStringifyMapping[typeof value](value, _gpfJsonStringifyCheckReplacer(replacer), _gpfJsonStringifyCheckSpaceValue(space)); }
javascript
function _gpfJsonStringifyPolyfill (value, replacer, space) { return _gpfJsonStringifyMapping[typeof value](value, _gpfJsonStringifyCheckReplacer(replacer), _gpfJsonStringifyCheckSpaceValue(space)); }
[ "function", "_gpfJsonStringifyPolyfill", "(", "value", ",", "replacer", ",", "space", ")", "{", "return", "_gpfJsonStringifyMapping", "[", "typeof", "value", "]", "(", "value", ",", "_gpfJsonStringifyCheckReplacer", "(", "replacer", ")", ",", "_gpfJsonStringifyCheckSp...
JSON.stringify polyfill @param {*} value The value to convert to a JSON string @param {Function|Array} [replacer] A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string @param {String|Number} [space] A String or Number object that's used to insert white space into the output JSON string for readability purposes. If this is a Number, it indicates the number of space characters to use as white space; this number is capped at 10 (if it is greater, the value is just 10). @return {String} JSON representation of the value @since 0.1.5
[ "JSON", ".", "stringify", "polyfill" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/compatibility/json/stringify.js#L127-L130
29,447
ArnaudBuchholz/gpf-js
src/function.js
_gpfFunctionDescribe
function _gpfFunctionDescribe (functionToDescribe) { var result = {}; _gpfFunctionDescribeName(functionToDescribe, result); _gpfFunctionDescribeSource(functionToDescribe, result); return result; }
javascript
function _gpfFunctionDescribe (functionToDescribe) { var result = {}; _gpfFunctionDescribeName(functionToDescribe, result); _gpfFunctionDescribeSource(functionToDescribe, result); return result; }
[ "function", "_gpfFunctionDescribe", "(", "functionToDescribe", ")", "{", "var", "result", "=", "{", "}", ";", "_gpfFunctionDescribeName", "(", "functionToDescribe", ",", "result", ")", ";", "_gpfFunctionDescribeSource", "(", "functionToDescribe", ",", "result", ")", ...
Extract function description @param {Function} functionToDescribe Function to describe @return {gpf.typedef._functionDescription} Function description @since 0.1.6
[ "Extract", "function", "description" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/function.js#L106-L111
29,448
ArnaudBuchholz/gpf-js
lost+found/src/xml.js
function (event) { var eventsHandler; if (event && event.type() === _gpfI.IWritableStream.EVENT_ERROR) { gpfFireEvent.call(this, event, this._eventsHandler); } else if (0 === this._buffer.length) { eventsHandler = this._eventsHandler; this._eventsHandler = null; gpfFireEvent.call(this, _gpfI.IWritableStream.EVENT_READY, eventsHandler); } else { this._stream.write(this._buffer.shift(), this._flushed.bind(this)); } }
javascript
function (event) { var eventsHandler; if (event && event.type() === _gpfI.IWritableStream.EVENT_ERROR) { gpfFireEvent.call(this, event, this._eventsHandler); } else if (0 === this._buffer.length) { eventsHandler = this._eventsHandler; this._eventsHandler = null; gpfFireEvent.call(this, _gpfI.IWritableStream.EVENT_READY, eventsHandler); } else { this._stream.write(this._buffer.shift(), this._flushed.bind(this)); } }
[ "function", "(", "event", ")", "{", "var", "eventsHandler", ";", "if", "(", "event", "&&", "event", ".", "type", "(", ")", "===", "_gpfI", ".", "IWritableStream", ".", "EVENT_ERROR", ")", "{", "gpfFireEvent", ".", "call", "(", "this", ",", "event", ","...
Handle write event on stream @param {gpf.events.Event} event @private
[ "Handle", "write", "event", "on", "stream" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/xml.js#L109-L122
29,449
ArnaudBuchholz/gpf-js
lost+found/src/xml.js
function (name) { var newName; if (gpf.xml.isValidName(name)) { return name; } // Try with a starting _ newName = "_" + name; if (!gpf.xml.isValidName(newName)) { gpf.Error.xmlInvalidName(); } return newName; }
javascript
function (name) { var newName; if (gpf.xml.isValidName(name)) { return name; } // Try with a starting _ newName = "_" + name; if (!gpf.xml.isValidName(newName)) { gpf.Error.xmlInvalidName(); } return newName; }
[ "function", "(", "name", ")", "{", "var", "newName", ";", "if", "(", "gpf", ".", "xml", ".", "isValidName", "(", "name", ")", ")", "{", "return", "name", ";", "}", "// Try with a starting _", "newName", "=", "\"_\"", "+", "name", ";", "if", "(", "!",...
Make sure that the provided name can be use as an element or attribute name @param {String} name @return {String} a valid attribute/element name
[ "Make", "sure", "that", "the", "provided", "name", "can", "be", "use", "as", "an", "element", "or", "attribute", "name" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/xml.js#L364-L375
29,450
ArnaudBuchholz/gpf-js
lost+found/src/html.js
function (char) { var newState, tagsOpened = 0 < this._openedTags.length; if ("#" === char) { this._hLevel = 1; newState = this._parseTitle; } else if ("*" === char || "0" <= char && "9" >= char ) { if (char !== "*") { this._numericList = 1; } else { this._numericList = 0; } newState = this._parseList; tagsOpened = false; // Wait for disambiguation } else if (" " !== char && "\t" !== char && "\n" !== char) { if (tagsOpened) { this._output(" "); tagsOpened = false; // Avoid closing below } else { this._openTag("p"); } newState = this._parseContent(char); if (!newState) { newState = this._parseContent; } } if (tagsOpened) { this._closeTags(); } return newState; }
javascript
function (char) { var newState, tagsOpened = 0 < this._openedTags.length; if ("#" === char) { this._hLevel = 1; newState = this._parseTitle; } else if ("*" === char || "0" <= char && "9" >= char ) { if (char !== "*") { this._numericList = 1; } else { this._numericList = 0; } newState = this._parseList; tagsOpened = false; // Wait for disambiguation } else if (" " !== char && "\t" !== char && "\n" !== char) { if (tagsOpened) { this._output(" "); tagsOpened = false; // Avoid closing below } else { this._openTag("p"); } newState = this._parseContent(char); if (!newState) { newState = this._parseContent; } } if (tagsOpened) { this._closeTags(); } return newState; }
[ "function", "(", "char", ")", "{", "var", "newState", ",", "tagsOpened", "=", "0", "<", "this", ".", "_openedTags", ".", "length", ";", "if", "(", "\"#\"", "===", "char", ")", "{", "this", ".", "_hLevel", "=", "1", ";", "newState", "=", "this", "."...
\r Initial state @param {String} char @protected
[ "\\", "r", "Initial", "state" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L124-L155
29,451
ArnaudBuchholz/gpf-js
lost+found/src/html.js
function () { var url = this._linkUrl.join(""), text = this._linkText.join(""); if (0 === this._linkType) { this._output("<a href=\""); this._output(url); this._output("\">"); this._output(text); this._output("</a>"); } else if (1 === this._linkType) { this._output("<img src=\""); this._output(url); this._output("\" alt=\""); this._output(text); this._output("\" title=\""); this._output(text); this._output("\">"); } return this._parseContent; }
javascript
function () { var url = this._linkUrl.join(""), text = this._linkText.join(""); if (0 === this._linkType) { this._output("<a href=\""); this._output(url); this._output("\">"); this._output(text); this._output("</a>"); } else if (1 === this._linkType) { this._output("<img src=\""); this._output(url); this._output("\" alt=\""); this._output(text); this._output("\" title=\""); this._output(text); this._output("\">"); } return this._parseContent; }
[ "function", "(", ")", "{", "var", "url", "=", "this", ".", "_linkUrl", ".", "join", "(", "\"\"", ")", ",", "text", "=", "this", ".", "_linkText", ".", "join", "(", "\"\"", ")", ";", "if", "(", "0", "===", "this", ".", "_linkType", ")", "{", "th...
Finalize link parsing @return {Function} @private
[ "Finalize", "link", "parsing" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L513-L533
29,452
ArnaudBuchholz/gpf-js
lost+found/src/html.js
function (event) { var reader = event.target, buffer, len, result, idx; _gpfAssert(reader === this._reader, "Unexpected change of reader"); if (reader.error) { gpfFireEvent.call(this, gpfI.IReadableStream.ERROR, { // According to W3C // http://www.w3.org/TR/domcore/#interface-domerror error: { name: reader.error.name, message: reader.error.message } }, this._eventsHandler ); } else if (reader.readyState === FileReader.DONE) { buffer = new Int8Array(reader.result); len = buffer.length; result = []; for (idx = 0; idx < len; ++idx) { result.push(buffer[idx]); } gpfFireEvent.call(this, gpfI.IReadableStream.EVENT_DATA, {buffer: result}, this._eventsHandler); } }
javascript
function (event) { var reader = event.target, buffer, len, result, idx; _gpfAssert(reader === this._reader, "Unexpected change of reader"); if (reader.error) { gpfFireEvent.call(this, gpfI.IReadableStream.ERROR, { // According to W3C // http://www.w3.org/TR/domcore/#interface-domerror error: { name: reader.error.name, message: reader.error.message } }, this._eventsHandler ); } else if (reader.readyState === FileReader.DONE) { buffer = new Int8Array(reader.result); len = buffer.length; result = []; for (idx = 0; idx < len; ++idx) { result.push(buffer[idx]); } gpfFireEvent.call(this, gpfI.IReadableStream.EVENT_DATA, {buffer: result}, this._eventsHandler); } }
[ "function", "(", "event", ")", "{", "var", "reader", "=", "event", ".", "target", ",", "buffer", ",", "len", ",", "result", ",", "idx", ";", "_gpfAssert", "(", "reader", "===", "this", ".", "_reader", ",", "\"Unexpected change of reader\"", ")", ";", "if...
Wrapper for the onloadend event handler @param {DOM Event} event @private
[ "Wrapper", "for", "the", "onloadend", "event", "handler" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L678-L708
29,453
ArnaudBuchholz/gpf-js
lost+found/src/html.js
function (domObject) { var selector = this._selector; if (selector) { if (this._globalSelector) { return document.querySelector(selector); } else { return domObject.querySelector(selector); } } return undefined; }
javascript
function (domObject) { var selector = this._selector; if (selector) { if (this._globalSelector) { return document.querySelector(selector); } else { return domObject.querySelector(selector); } } return undefined; }
[ "function", "(", "domObject", ")", "{", "var", "selector", "=", "this", ".", "_selector", ";", "if", "(", "selector", ")", "{", "if", "(", "this", ".", "_globalSelector", ")", "{", "return", "document", ".", "querySelector", "(", "selector", ")", ";", ...
Apply selection starting from the provided object @param {Object} domObject @return {Object|undefined} @private
[ "Apply", "selection", "starting", "from", "the", "provided", "object" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L754-L764
29,454
ArnaudBuchholz/gpf-js
lost+found/src/html.js
_getHandlerAttribute
function _getHandlerAttribute (member, handlerAttributeArray) { var attribute; if (1 !== handlerAttributeArray.length()) { gpf.Error.htmlHandlerMultiplicityError({ member: member }); } attribute = handlerAttributeArray.get(0); if (!(attribute instanceof _HtmEvent)) { return attribute; } return null; }
javascript
function _getHandlerAttribute (member, handlerAttributeArray) { var attribute; if (1 !== handlerAttributeArray.length()) { gpf.Error.htmlHandlerMultiplicityError({ member: member }); } attribute = handlerAttributeArray.get(0); if (!(attribute instanceof _HtmEvent)) { return attribute; } return null; }
[ "function", "_getHandlerAttribute", "(", "member", ",", "handlerAttributeArray", ")", "{", "var", "attribute", ";", "if", "(", "1", "!==", "handlerAttributeArray", ".", "length", "(", ")", ")", "{", "gpf", ".", "Error", ".", "htmlHandlerMultiplicityError", "(", ...
endregion region HTML event handlers mappers through attributes
[ "endregion", "region", "HTML", "event", "handlers", "mappers", "through", "attributes" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L825-L837
29,455
ArnaudBuchholz/gpf-js
lost+found/src/html.js
_onResize
function _onResize () { _width = window.innerWidth; _height = window.innerHeight; var orientation, orientationChanged = false, toRemove = [], toAdd = []; if (_width > _height) { orientation = "gpf-landscape"; } else { orientation = "gpf-portrait"; } if (_orientation !== orientation) { toRemove.push(_orientation); _orientation = orientation; toAdd.push(orientation); orientationChanged = true; } gpf.html.alterClass(document.body, toAdd, toRemove); _broadcaster.broadcastEvent("resize", { width: _width, height: _height }); if (orientationChanged) { _broadcaster.broadcastEvent("rotate", { orientation: orientation }); } }
javascript
function _onResize () { _width = window.innerWidth; _height = window.innerHeight; var orientation, orientationChanged = false, toRemove = [], toAdd = []; if (_width > _height) { orientation = "gpf-landscape"; } else { orientation = "gpf-portrait"; } if (_orientation !== orientation) { toRemove.push(_orientation); _orientation = orientation; toAdd.push(orientation); orientationChanged = true; } gpf.html.alterClass(document.body, toAdd, toRemove); _broadcaster.broadcastEvent("resize", { width: _width, height: _height }); if (orientationChanged) { _broadcaster.broadcastEvent("rotate", { orientation: orientation }); } }
[ "function", "_onResize", "(", ")", "{", "_width", "=", "window", ".", "innerWidth", ";", "_height", "=", "window", ".", "innerHeight", ";", "var", "orientation", ",", "orientationChanged", "=", "false", ",", "toRemove", "=", "[", "]", ",", "toAdd", "=", ...
HTML Event "resize" listener @private
[ "HTML", "Event", "resize", "listener" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L1126-L1155
29,456
ArnaudBuchholz/gpf-js
lost+found/src/html.js
_onScroll
function _onScroll () { _scrollY = window.scrollY; if (_monitorTop && _dynamicCss) { _updateDynamicCss(); } _broadcaster.broadcastEvent("scroll", { top: _scrollY }); }
javascript
function _onScroll () { _scrollY = window.scrollY; if (_monitorTop && _dynamicCss) { _updateDynamicCss(); } _broadcaster.broadcastEvent("scroll", { top: _scrollY }); }
[ "function", "_onScroll", "(", ")", "{", "_scrollY", "=", "window", ".", "scrollY", ";", "if", "(", "_monitorTop", "&&", "_dynamicCss", ")", "{", "_updateDynamicCss", "(", ")", ";", "}", "_broadcaster", ".", "broadcastEvent", "(", "\"scroll\"", ",", "{", "t...
HTML Event "scroll" listener @private
[ "HTML", "Event", "scroll", "listener" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/html.js#L1162-L1170
29,457
back4app/parse-cli-server
spec/helper.js
create
function create(options, callback) { var t = new TestObject(options); t.save(null, { success: callback }); }
javascript
function create(options, callback) { var t = new TestObject(options); t.save(null, { success: callback }); }
[ "function", "create", "(", "options", ",", "callback", ")", "{", "var", "t", "=", "new", "TestObject", "(", "options", ")", ";", "t", ".", "save", "(", "null", ",", "{", "success", ":", "callback", "}", ")", ";", "}" ]
Convenience method to create a new TestObject with a callback
[ "Convenience", "method", "to", "create", "a", "new", "TestObject", "with", "a", "callback" ]
188e7b3feeb27e080a57fdd802c226e77fc776ce
https://github.com/back4app/parse-cli-server/blob/188e7b3feeb27e080a57fdd802c226e77fc776ce/spec/helper.js#L224-L227
29,458
back4app/parse-cli-server
spec/helper.js
normalize
function normalize(obj) { if (obj === null || typeof obj !== 'object') { return JSON.stringify(obj); } if (obj instanceof Array) { return '[' + obj.map(normalize).join(', ') + ']'; } var answer = '{'; for (var key of Object.keys(obj).sort()) { answer += key + ': '; answer += normalize(obj[key]); answer += ', '; } answer += '}'; return answer; }
javascript
function normalize(obj) { if (obj === null || typeof obj !== 'object') { return JSON.stringify(obj); } if (obj instanceof Array) { return '[' + obj.map(normalize).join(', ') + ']'; } var answer = '{'; for (var key of Object.keys(obj).sort()) { answer += key + ': '; answer += normalize(obj[key]); answer += ', '; } answer += '}'; return answer; }
[ "function", "normalize", "(", "obj", ")", "{", "if", "(", "obj", "===", "null", "||", "typeof", "obj", "!==", "'object'", ")", "{", "return", "JSON", ".", "stringify", "(", "obj", ")", ";", "}", "if", "(", "obj", "instanceof", "Array", ")", "{", "r...
Normalizes a JSON object.
[ "Normalizes", "a", "JSON", "object", "." ]
188e7b3feeb27e080a57fdd802c226e77fc776ce
https://github.com/back4app/parse-cli-server/blob/188e7b3feeb27e080a57fdd802c226e77fc776ce/spec/helper.js#L298-L313
29,459
ArnaudBuchholz/gpf-js
src/constants.js
_gpfFuncUnsafe
function _gpfFuncUnsafe (params, source) { var args; if (!params.length) { return _GpfFunc(source); } args = [].concat(params); args.push(source); return _GpfFunc.apply(null, args); }
javascript
function _gpfFuncUnsafe (params, source) { var args; if (!params.length) { return _GpfFunc(source); } args = [].concat(params); args.push(source); return _GpfFunc.apply(null, args); }
[ "function", "_gpfFuncUnsafe", "(", "params", ",", "source", ")", "{", "var", "args", ";", "if", "(", "!", "params", ".", "length", ")", "{", "return", "_GpfFunc", "(", "source", ")", ";", "}", "args", "=", "[", "]", ".", "concat", "(", "params", ")...
Unprotected version of _gpfFunc
[ "Unprotected", "version", "of", "_gpfFunc" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/constants.js#L69-L77
29,460
ArnaudBuchholz/gpf-js
src/constants.js
_gpfFunc
function _gpfFunc (params, source) { if (undefined === source) { return _gpfFuncImpl([], params); } return _gpfFuncImpl(params, source); }
javascript
function _gpfFunc (params, source) { if (undefined === source) { return _gpfFuncImpl([], params); } return _gpfFuncImpl(params, source); }
[ "function", "_gpfFunc", "(", "params", ",", "source", ")", "{", "if", "(", "undefined", "===", "source", ")", "{", "return", "_gpfFuncImpl", "(", "[", "]", ",", "params", ")", ";", "}", "return", "_gpfFuncImpl", "(", "params", ",", "source", ")", ";", ...
Create a new function from the source and parameter list. In DEBUG mode, it catches any error to log the problem. @param {String[]} [params] params Parameter names list @param {String} source Body of the function @return {Function} New function @since 0.1.5
[ "Create", "a", "new", "function", "from", "the", "source", "and", "parameter", "list", ".", "In", "DEBUG", "mode", "it", "catches", "any", "error", "to", "log", "the", "problem", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/constants.js#L112-L117
29,461
popeindustries/buddy
lib/utils/stopwatch.js
start
function start(id) { if (!timers[id]) { timers[id] = { start: 0, elapsed: 0 }; } timers[id].start = process.hrtime(); }
javascript
function start(id) { if (!timers[id]) { timers[id] = { start: 0, elapsed: 0 }; } timers[id].start = process.hrtime(); }
[ "function", "start", "(", "id", ")", "{", "if", "(", "!", "timers", "[", "id", "]", ")", "{", "timers", "[", "id", "]", "=", "{", "start", ":", "0", ",", "elapsed", ":", "0", "}", ";", "}", "timers", "[", "id", "]", ".", "start", "=", "proc...
Start timer with 'id' @param {String} id
[ "Start", "timer", "with", "id" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/stopwatch.js#L17-L25
29,462
popeindustries/buddy
lib/utils/stopwatch.js
pause
function pause(id) { if (!timers[id]) return start(id); timers[id].elapsed += msDiff(process.hrtime(), timers[id].start); }
javascript
function pause(id) { if (!timers[id]) return start(id); timers[id].elapsed += msDiff(process.hrtime(), timers[id].start); }
[ "function", "pause", "(", "id", ")", "{", "if", "(", "!", "timers", "[", "id", "]", ")", "return", "start", "(", "id", ")", ";", "timers", "[", "id", "]", ".", "elapsed", "+=", "msDiff", "(", "process", ".", "hrtime", "(", ")", ",", "timers", "...
Pause timer with 'id' @param {String} id @returns {null}
[ "Pause", "timer", "with", "id" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/stopwatch.js#L32-L36
29,463
popeindustries/buddy
lib/utils/stopwatch.js
stop
function stop(id, formatted) { const elapsed = timers[id].elapsed + msDiff(process.hrtime(), timers[id].start); clear(id); return formatted ? format(elapsed) : elapsed; }
javascript
function stop(id, formatted) { const elapsed = timers[id].elapsed + msDiff(process.hrtime(), timers[id].start); clear(id); return formatted ? format(elapsed) : elapsed; }
[ "function", "stop", "(", "id", ",", "formatted", ")", "{", "const", "elapsed", "=", "timers", "[", "id", "]", ".", "elapsed", "+", "msDiff", "(", "process", ".", "hrtime", "(", ")", ",", "timers", "[", "id", "]", ".", "start", ")", ";", "clear", ...
Stop timer with 'id' and return elapsed @param {String} id @param {Boolean} formatted @returns {Number}
[ "Stop", "timer", "with", "id", "and", "return", "elapsed" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/stopwatch.js#L44-L49
29,464
popeindustries/buddy
lib/utils/stopwatch.js
msDiff
function msDiff(t1, t2) { t1 = (t1[0] * 1e9 + t1[1]) / 1e6; t2 = (t2[0] * 1e9 + t2[1]) / 1e6; return Math.ceil((t1 - t2) * 100) / 100; }
javascript
function msDiff(t1, t2) { t1 = (t1[0] * 1e9 + t1[1]) / 1e6; t2 = (t2[0] * 1e9 + t2[1]) / 1e6; return Math.ceil((t1 - t2) * 100) / 100; }
[ "function", "msDiff", "(", "t1", ",", "t2", ")", "{", "t1", "=", "(", "t1", "[", "0", "]", "*", "1e9", "+", "t1", "[", "1", "]", ")", "/", "1e6", ";", "t2", "=", "(", "t2", "[", "0", "]", "*", "1e9", "+", "t2", "[", "1", "]", ")", "/"...
Retrieve difference in ms @param {Array} t1 @param {Array} t2 @returns {Number}
[ "Retrieve", "difference", "in", "ms" ]
c38afc2e6915743eb6cfcf5aba59a8699142c7a5
https://github.com/popeindustries/buddy/blob/c38afc2e6915743eb6cfcf5aba59a8699142c7a5/lib/utils/stopwatch.js#L65-L69
29,465
ArnaudBuchholz/gpf-js
src/require/load.js
_gpfRequireLoad
function _gpfRequireLoad (name) { var me = this; return _gpfLoadOrPreload(me, name) .then(function (content) { return me.preprocess({ name: name, content: content, type: _gpfPathExtension(name).toLowerCase() }); }) .then(function (resource) { return _gpfLoadGetProcessor(resource).call(me, resource.name, resource.content); }); }
javascript
function _gpfRequireLoad (name) { var me = this; return _gpfLoadOrPreload(me, name) .then(function (content) { return me.preprocess({ name: name, content: content, type: _gpfPathExtension(name).toLowerCase() }); }) .then(function (resource) { return _gpfLoadGetProcessor(resource).call(me, resource.name, resource.content); }); }
[ "function", "_gpfRequireLoad", "(", "name", ")", "{", "var", "me", "=", "this", ";", "return", "_gpfLoadOrPreload", "(", "me", ",", "name", ")", ".", "then", "(", "function", "(", "content", ")", "{", "return", "me", ".", "preprocess", "(", "{", "name"...
Load the resource @param {String} name Resource name @return {Promise<*>} Resolved with the resource result @since 0.2.2
[ "Load", "the", "resource" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/require/load.js#L50-L63
29,466
ArnaudBuchholz/gpf-js
res/sources/main.js
upToSourceRow
function upToSourceRow (target) { var current = target; while (current && (!current.tagName || current.tagName.toLowerCase() !== "tr")) { current = current.parentNode; } return current; }
javascript
function upToSourceRow (target) { var current = target; while (current && (!current.tagName || current.tagName.toLowerCase() !== "tr")) { current = current.parentNode; } return current; }
[ "function", "upToSourceRow", "(", "target", ")", "{", "var", "current", "=", "target", ";", "while", "(", "current", "&&", "(", "!", "current", ".", "tagName", "||", "current", ".", "tagName", ".", "toLowerCase", "(", ")", "!==", "\"tr\"", ")", ")", "{...
region HTML page logic Whatever the target node, get the parent TR corresponding to the source row
[ "region", "HTML", "page", "logic", "Whatever", "the", "target", "node", "get", "the", "parent", "TR", "corresponding", "to", "the", "source", "row" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/res/sources/main.js#L28-L34
29,467
ArnaudBuchholz/gpf-js
res/sources/main.js
refreshSourceRow
function refreshSourceRow (target, source) { var row = upToSourceRow(target), newRow = rowFactory(source, source.getIndex()); sourceRows.replaceChild(newRow, row); updateSourceRow(source); }
javascript
function refreshSourceRow (target, source) { var row = upToSourceRow(target), newRow = rowFactory(source, source.getIndex()); sourceRows.replaceChild(newRow, row); updateSourceRow(source); }
[ "function", "refreshSourceRow", "(", "target", ",", "source", ")", "{", "var", "row", "=", "upToSourceRow", "(", "target", ")", ",", "newRow", "=", "rowFactory", "(", "source", ",", "source", ".", "getIndex", "(", ")", ")", ";", "sourceRows", ".", "repla...
Regenerate the source row
[ "Regenerate", "the", "source", "row" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/res/sources/main.js#L63-L68
29,468
ArnaudBuchholz/gpf-js
res/sources/main.js
reload
function reload () { sourceRows.innerHTML = ""; // Clear content sources.forEach(function (source, index) { if (flavor && !flavor[index]) { return; } sourceRows.appendChild(rowFactory(source, index)); updateSourceRow(source); }); }
javascript
function reload () { sourceRows.innerHTML = ""; // Clear content sources.forEach(function (source, index) { if (flavor && !flavor[index]) { return; } sourceRows.appendChild(rowFactory(source, index)); updateSourceRow(source); }); }
[ "function", "reload", "(", ")", "{", "sourceRows", ".", "innerHTML", "=", "\"\"", ";", "// Clear content", "sources", ".", "forEach", "(", "function", "(", "source", ",", "index", ")", "{", "if", "(", "flavor", "&&", "!", "flavor", "[", "index", "]", "...
Regenerate all source rows
[ "Regenerate", "all", "source", "rows" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/res/sources/main.js#L71-L80
29,469
ArnaudBuchholz/gpf-js
res/sources/main.js
compare
function compare (checkDictionary, path, pathContent) { var subPromises = []; pathContent.forEach(function (name) { var JS_EXT = ".js", JS_EXT_LENGTH = JS_EXT.length, contentFullName = path + name, contentFullNameLength = contentFullName.length; if (contentFullNameLength > JS_EXT_LENGTH && contentFullName.indexOf(JS_EXT) === contentFullNameLength - JS_EXT_LENGTH) { contentFullName = contentFullName.substring(START, contentFullNameLength - JS_EXT_LENGTH); if (checkDictionary[contentFullName] === "obsolete") { checkDictionary[contentFullName] = "exists"; } else { checkDictionary[contentFullName] = "new"; } } else if (name.indexOf(".") === NOT_FOUND) { subPromises.push(gpf.http.get("/fs/src/" + contentFullName) .then(function (response) { return JSON.parse(response.responseText); }) .then(function (subPathContent) { return compare(checkDictionary, contentFullName + "/", subPathContent); })); } }); if (!subPromises.length) { return Promise.resolve(); } return Promise.all(subPromises); }
javascript
function compare (checkDictionary, path, pathContent) { var subPromises = []; pathContent.forEach(function (name) { var JS_EXT = ".js", JS_EXT_LENGTH = JS_EXT.length, contentFullName = path + name, contentFullNameLength = contentFullName.length; if (contentFullNameLength > JS_EXT_LENGTH && contentFullName.indexOf(JS_EXT) === contentFullNameLength - JS_EXT_LENGTH) { contentFullName = contentFullName.substring(START, contentFullNameLength - JS_EXT_LENGTH); if (checkDictionary[contentFullName] === "obsolete") { checkDictionary[contentFullName] = "exists"; } else { checkDictionary[contentFullName] = "new"; } } else if (name.indexOf(".") === NOT_FOUND) { subPromises.push(gpf.http.get("/fs/src/" + contentFullName) .then(function (response) { return JSON.parse(response.responseText); }) .then(function (subPathContent) { return compare(checkDictionary, contentFullName + "/", subPathContent); })); } }); if (!subPromises.length) { return Promise.resolve(); } return Promise.all(subPromises); }
[ "function", "compare", "(", "checkDictionary", ",", "path", ",", "pathContent", ")", "{", "var", "subPromises", "=", "[", "]", ";", "pathContent", ".", "forEach", "(", "function", "(", "name", ")", "{", "var", "JS_EXT", "=", "\".js\"", ",", "JS_EXT_LENGTH"...
endregion region Compare sources.json with repository
[ "endregion", "region", "Compare", "sources", ".", "json", "with", "repository" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/res/sources/main.js#L181-L210
29,470
zetapush/zetapush
packages/user-management/samples/standard-user-workflow/front/js/signup.js
signupUser
async function signupUser(form) { await client.connect(); try { await api.signup( { credentials: { login: form.login.value, password: form.password.value }, profile: { email: form.email.value } }, 'user' ); displayMessage( 'Account created', 'Your account has been created, please check your emails to confirm your account', 'is-success' ); goTo('login'); } catch (e) { displayMessage('Account not created', `Your account could not been created. Cause: ${e.message}`, 'is-danger'); } }
javascript
async function signupUser(form) { await client.connect(); try { await api.signup( { credentials: { login: form.login.value, password: form.password.value }, profile: { email: form.email.value } }, 'user' ); displayMessage( 'Account created', 'Your account has been created, please check your emails to confirm your account', 'is-success' ); goTo('login'); } catch (e) { displayMessage('Account not created', `Your account could not been created. Cause: ${e.message}`, 'is-danger'); } }
[ "async", "function", "signupUser", "(", "form", ")", "{", "await", "client", ".", "connect", "(", ")", ";", "try", "{", "await", "api", ".", "signup", "(", "{", "credentials", ":", "{", "login", ":", "form", ".", "login", ".", "value", ",", "password...
Launch the creation of the user account into the application
[ "Launch", "the", "creation", "of", "the", "user", "account", "into", "the", "application" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/user-management/samples/standard-user-workflow/front/js/signup.js#L4-L28
29,471
SockDrawer/SockBot
lib/config.js
readYaml
function readYaml(filePath) { return new Promise((resolve, reject) => { if (!filePath || typeof filePath !== 'string') { throw new Error('Path must be a string'); } fs.readFile(filePath, (err, data) => { if (err) { return reject(err); } // Remove UTF-8 BOM if present if (data.length >= 3 && data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf) { data = data.slice(3); } try { return resolve(yaml.safeLoad(data)); } catch (yamlerr) { return reject(yamlerr); } }); }); }
javascript
function readYaml(filePath) { return new Promise((resolve, reject) => { if (!filePath || typeof filePath !== 'string') { throw new Error('Path must be a string'); } fs.readFile(filePath, (err, data) => { if (err) { return reject(err); } // Remove UTF-8 BOM if present if (data.length >= 3 && data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf) { data = data.slice(3); } try { return resolve(yaml.safeLoad(data)); } catch (yamlerr) { return reject(yamlerr); } }); }); }
[ "function", "readYaml", "(", "filePath", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "if", "(", "!", "filePath", "||", "typeof", "filePath", "!==", "'string'", ")", "{", "throw", "new", "Error", "(", "'Path...
Read and parse configuration file from disc @param {string} filePath Path of file to read @param {configComplete} callback Completion callback @returns {Promise<*>} Resolves tyo YAML parsed configuration file
[ "Read", "and", "parse", "configuration", "file", "from", "disc" ]
043f7e9aa9ec12250889fd825ddcf86709b095a3
https://github.com/SockDrawer/SockBot/blob/043f7e9aa9ec12250889fd825ddcf86709b095a3/lib/config.js#L77-L98
29,472
ArnaudBuchholz/gpf-js
src/path.js
_gpfPathJoin
function _gpfPathJoin (path) { var splitPath = _gpfPathDecompose(path); _gpfArrayTail(arguments).forEach(_gpfPathAppend.bind(null, splitPath)); return splitPath.join("/"); }
javascript
function _gpfPathJoin (path) { var splitPath = _gpfPathDecompose(path); _gpfArrayTail(arguments).forEach(_gpfPathAppend.bind(null, splitPath)); return splitPath.join("/"); }
[ "function", "_gpfPathJoin", "(", "path", ")", "{", "var", "splitPath", "=", "_gpfPathDecompose", "(", "path", ")", ";", "_gpfArrayTail", "(", "arguments", ")", ".", "forEach", "(", "_gpfPathAppend", ".", "bind", "(", "null", ",", "splitPath", ")", ")", ";"...
Join all arguments together and normalize the resulting path @param {String} path Base path @param {...String} relativePath Relative parts to append to the base path @return {String} Joined path @throws {gpf.Error.UnreachablePath} @since 0.1.9
[ "Join", "all", "arguments", "together", "and", "normalize", "the", "resulting", "path" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/path.js#L157-L161
29,473
ArnaudBuchholz/gpf-js
src/path.js
_gpfPathRelative
function _gpfPathRelative (from, to) { var length, splitFrom = _gpfPathDecompose(from), splitTo = _gpfPathDecompose(to); _gpfPathShiftIdenticalBeginning(splitFrom, splitTo); // For each remaining part in from, unshift .. in to length = splitFrom.length; while (length--) { splitTo.unshift(".."); } return splitTo.join("/"); }
javascript
function _gpfPathRelative (from, to) { var length, splitFrom = _gpfPathDecompose(from), splitTo = _gpfPathDecompose(to); _gpfPathShiftIdenticalBeginning(splitFrom, splitTo); // For each remaining part in from, unshift .. in to length = splitFrom.length; while (length--) { splitTo.unshift(".."); } return splitTo.join("/"); }
[ "function", "_gpfPathRelative", "(", "from", ",", "to", ")", "{", "var", "length", ",", "splitFrom", "=", "_gpfPathDecompose", "(", "from", ")", ",", "splitTo", "=", "_gpfPathDecompose", "(", "to", ")", ";", "_gpfPathShiftIdenticalBeginning", "(", "splitFrom", ...
Solve the relative path from from to to @param {String} from From path @param {String} to To path @return {String} Relative path @since 0.1.9
[ "Solve", "the", "relative", "path", "from", "from", "to", "to" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/path.js#L198-L209
29,474
ArnaudBuchholz/gpf-js
src/path.js
function (path) { var name = _gpfPathName(path), pos = name.lastIndexOf("."); if (pos === _GPF_NOT_FOUND) { return name; } return name.substring(_GPF_START, pos); }
javascript
function (path) { var name = _gpfPathName(path), pos = name.lastIndexOf("."); if (pos === _GPF_NOT_FOUND) { return name; } return name.substring(_GPF_START, pos); }
[ "function", "(", "path", ")", "{", "var", "name", "=", "_gpfPathName", "(", "path", ")", ",", "pos", "=", "name", ".", "lastIndexOf", "(", "\".\"", ")", ";", "if", "(", "pos", "===", "_GPF_NOT_FOUND", ")", "{", "return", "name", ";", "}", "return", ...
Get the last name of a path without the extension @param {String} path Path to analyze @return {String} Name without the extension @since 0.1.9
[ "Get", "the", "last", "name", "of", "a", "path", "without", "the", "extension" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/path.js#L254-L261
29,475
ForbesLindesay-Unmaintained/transformers
lib/transformers.js
sync
function sync(str, options) { var tmpl = this.cache(options) || this.cache(options, this.engine.compile(str, options)); return tmpl(options); }
javascript
function sync(str, options) { var tmpl = this.cache(options) || this.cache(options, this.engine.compile(str, options)); return tmpl(options); }
[ "function", "sync", "(", "str", ",", "options", ")", "{", "var", "tmpl", "=", "this", ".", "cache", "(", "options", ")", "||", "this", ".", "cache", "(", "options", ",", "this", ".", "engine", ".", "compile", "(", "str", ",", "options", ")", ")", ...
Synchronous Templating Languages
[ "Synchronous", "Templating", "Languages" ]
c9684a78516784ed169bca12b30b8ea1f73b1e12
https://github.com/ForbesLindesay-Unmaintained/transformers/blob/c9684a78516784ed169bca12b30b8ea1f73b1e12/lib/transformers.js#L50-L53
29,476
ForbesLindesay-Unmaintained/transformers
lib/transformers.js
function (str, options, cb) { var ECT = this.engine; var tmpl = this.cache(options) || this.cache(options, new ECT({ root: { page: str }})); tmpl.render('page', options, cb); }
javascript
function (str, options, cb) { var ECT = this.engine; var tmpl = this.cache(options) || this.cache(options, new ECT({ root: { page: str }})); tmpl.render('page', options, cb); }
[ "function", "(", "str", ",", "options", ",", "cb", ")", "{", "var", "ECT", "=", "this", ".", "engine", ";", "var", "tmpl", "=", "this", ".", "cache", "(", "options", ")", "||", "this", ".", "cache", "(", "options", ",", "new", "ECT", "(", "{", ...
Always runs synchronously
[ "Always", "runs", "synchronously" ]
c9684a78516784ed169bca12b30b8ea1f73b1e12
https://github.com/ForbesLindesay-Unmaintained/transformers/blob/c9684a78516784ed169bca12b30b8ea1f73b1e12/lib/transformers.js#L289-L293
29,477
ForbesLindesay-Unmaintained/transformers
lib/transformers.js
function (str, options, cb) { var tmpl = this.cache(options) || this.cache(options, this.engine.compile(str, options)); tmpl.eval(options, function(str){ cb(null, str); }); }
javascript
function (str, options, cb) { var tmpl = this.cache(options) || this.cache(options, this.engine.compile(str, options)); tmpl.eval(options, function(str){ cb(null, str); }); }
[ "function", "(", "str", ",", "options", ",", "cb", ")", "{", "var", "tmpl", "=", "this", ".", "cache", "(", "options", ")", "||", "this", ".", "cache", "(", "options", ",", "this", ".", "engine", ".", "compile", "(", "str", ",", "options", ")", "...
except when an async function is passed to locals
[ "except", "when", "an", "async", "function", "is", "passed", "to", "locals" ]
c9684a78516784ed169bca12b30b8ea1f73b1e12
https://github.com/ForbesLindesay-Unmaintained/transformers/blob/c9684a78516784ed169bca12b30b8ea1f73b1e12/lib/transformers.js#L339-L344
29,478
ForbesLindesay-Unmaintained/transformers
lib/transformers.js
function (str, options, cb) { var self = this; if (self.cache(options)) return cb(null, self.cache(options)); if (options.filename) { options.paths = options.paths || [dirname(options.filename)]; } // If this.cache is enabled, compress by default if (options.compress !== true && options.compress !== false) { options.compress = options.cache || false; } var initial = this.engine(str); // Special handling for stylus js api functions // given { define: { foo: 'bar', baz: 'quux' } } // runs initial.define('foo', 'bar').define('baz', 'quux') var allowed = ['set', 'include', 'import', 'define', 'use']; var special = {} var normal = clone(options); for (var v in options) { if (allowed.indexOf(v) > -1) { special[v] = options[v]; delete normal[v]; } } // special options through their function names for (var k in special) { for (var v in special[k]) { initial[k](v, special[k][v]); } } // normal options through set() for (var k in normal) { initial.set(k, normal[k]); } initial.render(function (err, res) { if (err) return cb(err); self.cache(options, res); cb(null, res); }); }
javascript
function (str, options, cb) { var self = this; if (self.cache(options)) return cb(null, self.cache(options)); if (options.filename) { options.paths = options.paths || [dirname(options.filename)]; } // If this.cache is enabled, compress by default if (options.compress !== true && options.compress !== false) { options.compress = options.cache || false; } var initial = this.engine(str); // Special handling for stylus js api functions // given { define: { foo: 'bar', baz: 'quux' } } // runs initial.define('foo', 'bar').define('baz', 'quux') var allowed = ['set', 'include', 'import', 'define', 'use']; var special = {} var normal = clone(options); for (var v in options) { if (allowed.indexOf(v) > -1) { special[v] = options[v]; delete normal[v]; } } // special options through their function names for (var k in special) { for (var v in special[k]) { initial[k](v, special[k][v]); } } // normal options through set() for (var k in normal) { initial.set(k, normal[k]); } initial.render(function (err, res) { if (err) return cb(err); self.cache(options, res); cb(null, res); }); }
[ "function", "(", "str", ",", "options", ",", "cb", ")", "{", "var", "self", "=", "this", ";", "if", "(", "self", ".", "cache", "(", "options", ")", ")", "return", "cb", "(", "null", ",", "self", ".", "cache", "(", "options", ")", ")", ";", "if"...
always runs synchronously
[ "always", "runs", "synchronously" ]
c9684a78516784ed169bca12b30b8ea1f73b1e12
https://github.com/ForbesLindesay-Unmaintained/transformers/blob/c9684a78516784ed169bca12b30b8ea1f73b1e12/lib/transformers.js#L409-L449
29,479
zetapush/zetapush
packages/example/front/js/reset-password.js
askResetPassword
async function askResetPassword(form) { await client.connect(); try { await api.askResetPassword( { login: form.login.value }, "user" ); displayMessage( "Reset password", "A link was sent to reset your password", "is-success" ); goTo("login"); } catch (e) { displayMessage( "Reset password", `Failed to send the link to reset your password. Cause: ${e.message}`, "is-danger" ); } }
javascript
async function askResetPassword(form) { await client.connect(); try { await api.askResetPassword( { login: form.login.value }, "user" ); displayMessage( "Reset password", "A link was sent to reset your password", "is-success" ); goTo("login"); } catch (e) { displayMessage( "Reset password", `Failed to send the link to reset your password. Cause: ${e.message}`, "is-danger" ); } }
[ "async", "function", "askResetPassword", "(", "form", ")", "{", "await", "client", ".", "connect", "(", ")", ";", "try", "{", "await", "api", ".", "askResetPassword", "(", "{", "login", ":", "form", ".", "login", ".", "value", "}", ",", "\"user\"", ")"...
Ask reset password
[ "Ask", "reset", "password" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/example/front/js/reset-password.js#L4-L27
29,480
zetapush/zetapush
packages/example/front/js/reset-password.js
confirmResetPassword
async function confirmResetPassword(form) { await client.connect(); try { console.log("token : ", sessionStorage.getItem("token")); await api.confirmResetPassword( { token: sessionStorage.getItem("token"), firstPassword: form.firstPassword.value, secondPassword: form.secondPassword.value }, "user" ); displayMessage("Reset password", "Password changed", "is-success"); goTo("login"); sessionStorage.clear(); } catch (e) { displayMessage( "Reset password", `Failed to reset the password. Cause: ${e.message}`, "is-danger" ); } }
javascript
async function confirmResetPassword(form) { await client.connect(); try { console.log("token : ", sessionStorage.getItem("token")); await api.confirmResetPassword( { token: sessionStorage.getItem("token"), firstPassword: form.firstPassword.value, secondPassword: form.secondPassword.value }, "user" ); displayMessage("Reset password", "Password changed", "is-success"); goTo("login"); sessionStorage.clear(); } catch (e) { displayMessage( "Reset password", `Failed to reset the password. Cause: ${e.message}`, "is-danger" ); } }
[ "async", "function", "confirmResetPassword", "(", "form", ")", "{", "await", "client", ".", "connect", "(", ")", ";", "try", "{", "console", ".", "log", "(", "\"token : \"", ",", "sessionStorage", ".", "getItem", "(", "\"token\"", ")", ")", ";", "await", ...
Confirm reset password
[ "Confirm", "reset", "password" ]
ad3383b8e332050eaecd55be9bdff6cf76db699e
https://github.com/zetapush/zetapush/blob/ad3383b8e332050eaecd55be9bdff6cf76db699e/packages/example/front/js/reset-password.js#L32-L54
29,481
ArnaudBuchholz/gpf-js
src/http.js
_gpfHttpSetRequestImplIf
function _gpfHttpSetRequestImplIf (host, httpRequestImpl) { var result = _gpfHttpRequestImpl; if (host === _gpfHost) { _gpfHttpRequestImpl = httpRequestImpl; } return result; }
javascript
function _gpfHttpSetRequestImplIf (host, httpRequestImpl) { var result = _gpfHttpRequestImpl; if (host === _gpfHost) { _gpfHttpRequestImpl = httpRequestImpl; } return result; }
[ "function", "_gpfHttpSetRequestImplIf", "(", "host", ",", "httpRequestImpl", ")", "{", "var", "result", "=", "_gpfHttpRequestImpl", ";", "if", "(", "host", "===", "_gpfHost", ")", "{", "_gpfHttpRequestImpl", "=", "httpRequestImpl", ";", "}", "return", "result", ...
Set the http request implementation if the host matches @param {String} host host to test, if matching with the current one, the http request implementation is set @param {Function} httpRequestImpl http request implementation function @return {Function} Previous host specific implementation @since 0.2.6
[ "Set", "the", "http", "request", "implementation", "if", "the", "host", "matches" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http.js#L55-L61
29,482
ArnaudBuchholz/gpf-js
src/http.js
_gpfProcessAlias
function _gpfProcessAlias (method, url, data) { if (typeof url === "string") { return _gpfHttpRequest({ method: method, url: url, data: data }); } return _gpfHttpRequest(Object.assign({ method: method }, url)); }
javascript
function _gpfProcessAlias (method, url, data) { if (typeof url === "string") { return _gpfHttpRequest({ method: method, url: url, data: data }); } return _gpfHttpRequest(Object.assign({ method: method }, url)); }
[ "function", "_gpfProcessAlias", "(", "method", ",", "url", ",", "data", ")", "{", "if", "(", "typeof", "url", "===", "\"string\"", ")", "{", "return", "_gpfHttpRequest", "(", "{", "method", ":", "method", ",", "url", ":", "url", ",", "data", ":", "data...
Implementation of aliases @param {String} method HTTP method to apply @param {String|gpf.typedef.httpRequestSettings} url Url to send the request to or a request settings object @param {*} [data] Data to be sent to the server @return {Promise<gpf.typedef.httpRequestResponse>} HTTP request promise @since 0.2.1
[ "Implementation", "of", "aliases" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/http.js#L85-L96
29,483
ArnaudBuchholz/gpf-js
src/serial/property.js
_gpfSerialPropertyCheck
function _gpfSerialPropertyCheck (property) { var clonedProperty = Object.assign(property); [ _gpfSerialPropertyCheckName, _gpfSerialPropertyCheckType, _gpfSerialPropertyCheckRequired, _gpfSerialPropertyCheckReadOnly ].forEach(function (checkFunction) { checkFunction(clonedProperty); }); return clonedProperty; }
javascript
function _gpfSerialPropertyCheck (property) { var clonedProperty = Object.assign(property); [ _gpfSerialPropertyCheckName, _gpfSerialPropertyCheckType, _gpfSerialPropertyCheckRequired, _gpfSerialPropertyCheckReadOnly ].forEach(function (checkFunction) { checkFunction(clonedProperty); }); return clonedProperty; }
[ "function", "_gpfSerialPropertyCheck", "(", "property", ")", "{", "var", "clonedProperty", "=", "Object", ".", "assign", "(", "property", ")", ";", "[", "_gpfSerialPropertyCheckName", ",", "_gpfSerialPropertyCheckType", ",", "_gpfSerialPropertyCheckRequired", ",", "_gpf...
Check that the serializable property definition is valid. Returns a copy with defaulted properties. @param {gpf.typedef.serializableProperty} property Property definition to validate @return {gpf.typedef.serializableProperty} Completed property definition @throws {gpf.Error.InvalidSerialName} @throws {gpf.Error.InvalidSerialType} @throws {gpf.Error.InvalidSerialRequired} @since 0.2.8
[ "Check", "that", "the", "serializable", "property", "definition", "is", "valid", ".", "Returns", "a", "copy", "with", "defaulted", "properties", "." ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/serial/property.js#L190-L201
29,484
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfArrayForEachFalsy
function _gpfArrayForEachFalsy(array, callback, thisArg) { var result, index = 0, length = array.length; for (; index < length && !result; ++index) { result = callback.call(thisArg, array[index], index, array); } return result; }
javascript
function _gpfArrayForEachFalsy(array, callback, thisArg) { var result, index = 0, length = array.length; for (; index < length && !result; ++index) { result = callback.call(thisArg, array[index], index, array); } return result; }
[ "function", "_gpfArrayForEachFalsy", "(", "array", ",", "callback", ",", "thisArg", ")", "{", "var", "result", ",", "index", "=", "0", ",", "length", "=", "array", ".", "length", ";", "for", "(", ";", "index", "<", "length", "&&", "!", "result", ";", ...
_gpfArrayForEach that returns first truthy value computed by the callback @param {Array} array Array-like object @param {gpf.typedef.forEachCallback} callback Callback function executed on each array item @param {*} [thisArg] thisArg Value to use as this when executing callback @return {*} first truthy value returned by the callback or undefined after all items were enumerated @since 0.2.2
[ "_gpfArrayForEach", "that", "returns", "first", "truthy", "value", "computed", "by", "the", "callback" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L394-L400
29,485
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfCompatibilityInstallMethods
function _gpfCompatibilityInstallMethods(typeName, description) { var on = description.on; _gpfInstallCompatibleMethods(on, description.methods); _gpfInstallCompatibleStatics(on, description.statics); }
javascript
function _gpfCompatibilityInstallMethods(typeName, description) { var on = description.on; _gpfInstallCompatibleMethods(on, description.methods); _gpfInstallCompatibleStatics(on, description.statics); }
[ "function", "_gpfCompatibilityInstallMethods", "(", "typeName", ",", "description", ")", "{", "var", "on", "=", "description", ".", "on", ";", "_gpfInstallCompatibleMethods", "(", "on", ",", "description", ".", "methods", ")", ";", "_gpfInstallCompatibleStatics", "(...
Define and install compatible methods on standard objects @param {String} typeName Type name ("Object", "String"...) @param {_GpfCompatibilityDescription} description Description of compatible methods @since 0.1.5
[ "Define", "and", "install", "compatible", "methods", "on", "standard", "objects" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L664-L668
29,486
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfArrayFromString
function _gpfArrayFromString(array, string) { var length = string.length, index = 0; for (; index < length; ++index) { array.push(string.charAt(index)); } }
javascript
function _gpfArrayFromString(array, string) { var length = string.length, index = 0; for (; index < length; ++index) { array.push(string.charAt(index)); } }
[ "function", "_gpfArrayFromString", "(", "array", ",", "string", ")", "{", "var", "length", "=", "string", ".", "length", ",", "index", "=", "0", ";", "for", "(", ";", "index", "<", "length", ";", "++", "index", ")", "{", "array", ".", "push", "(", ...
endregion region Array.from
[ "endregion", "region", "Array", ".", "from" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L716-L721
29,487
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (searchElement) { var result = -1; _gpfArrayEveryOwn(this, function (value, index) { if (value === searchElement) { result = index; return false; } return true; }, _gpfArrayGetFromIndex(arguments)); return result; }
javascript
function (searchElement) { var result = -1; _gpfArrayEveryOwn(this, function (value, index) { if (value === searchElement) { result = index; return false; } return true; }, _gpfArrayGetFromIndex(arguments)); return result; }
[ "function", "(", "searchElement", ")", "{", "var", "result", "=", "-", "1", ";", "_gpfArrayEveryOwn", "(", "this", ",", "function", "(", "value", ",", "index", ")", "{", "if", "(", "value", "===", "searchElement", ")", "{", "result", "=", "index", ";",...
Introduced with JavaScript 1.5
[ "Introduced", "with", "JavaScript", "1", ".", "5" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L778-L788
29,488
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (callback) { var REDUCE_INITIAL_VALUE_INDEX = 1, initialValue = arguments[REDUCE_INITIAL_VALUE_INDEX], thisLength = this.length, index = 0, value; if (undefined === initialValue) { value = this[index++]; } else { value = initialValue; } for (; index < thisLength; ++index) { value = callback(value, this[index], index, this); } return value; }
javascript
function (callback) { var REDUCE_INITIAL_VALUE_INDEX = 1, initialValue = arguments[REDUCE_INITIAL_VALUE_INDEX], thisLength = this.length, index = 0, value; if (undefined === initialValue) { value = this[index++]; } else { value = initialValue; } for (; index < thisLength; ++index) { value = callback(value, this[index], index, this); } return value; }
[ "function", "(", "callback", ")", "{", "var", "REDUCE_INITIAL_VALUE_INDEX", "=", "1", ",", "initialValue", "=", "arguments", "[", "REDUCE_INITIAL_VALUE_INDEX", "]", ",", "thisLength", "=", "this", ".", "length", ",", "index", "=", "0", ",", "value", ";", "if...
Introduced with JavaScript 1.8
[ "Introduced", "with", "JavaScript", "1", ".", "8" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L805-L816
29,489
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_GpfDate
function _GpfDate() { var firstArgument = arguments[_GPF_START], values = _gpfIsISO8601String(firstArgument); if (values) { return new _GpfGenuineDate(_GpfGenuineDate.UTC.apply(_GpfGenuineDate.UTC, values)); } return _gpfNewApply(_GpfGenuineDate, arguments); }
javascript
function _GpfDate() { var firstArgument = arguments[_GPF_START], values = _gpfIsISO8601String(firstArgument); if (values) { return new _GpfGenuineDate(_GpfGenuineDate.UTC.apply(_GpfGenuineDate.UTC, values)); } return _gpfNewApply(_GpfGenuineDate, arguments); }
[ "function", "_GpfDate", "(", ")", "{", "var", "firstArgument", "=", "arguments", "[", "_GPF_START", "]", ",", "values", "=", "_gpfIsISO8601String", "(", "firstArgument", ")", ";", "if", "(", "values", ")", "{", "return", "new", "_GpfGenuineDate", "(", "_GpfG...
Date constructor supporting ISO 8601 format @constructor @since 0.1.5
[ "Date", "constructor", "supporting", "ISO", "8601", "format" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L1100-L1106
29,490
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfSortOnDt
function _gpfSortOnDt(a, b) { if (a.dt === b.dt) { return a.id - b.id; } return a.dt - b.dt; }
javascript
function _gpfSortOnDt(a, b) { if (a.dt === b.dt) { return a.id - b.id; } return a.dt - b.dt; }
[ "function", "_gpfSortOnDt", "(", "a", ",", "b", ")", "{", "if", "(", "a", ".", "dt", "===", "b", ".", "dt", ")", "{", "return", "a", ".", "id", "-", "b", ".", "id", ";", "}", "return", "a", ".", "dt", "-", "b", ".", "dt", ";", "}" ]
Sorting function used to reorder the async queue
[ "Sorting", "function", "used", "to", "reorder", "the", "async", "queue" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L1368-L1373
29,491
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfJsonParsePolyfill
function _gpfJsonParsePolyfill(text, reviver) { var result = _gpfFunc("return " + text)(); if (reviver) { return _gpfJsonParseApplyReviver(result, "", reviver); } return result; }
javascript
function _gpfJsonParsePolyfill(text, reviver) { var result = _gpfFunc("return " + text)(); if (reviver) { return _gpfJsonParseApplyReviver(result, "", reviver); } return result; }
[ "function", "_gpfJsonParsePolyfill", "(", "text", ",", "reviver", ")", "{", "var", "result", "=", "_gpfFunc", "(", "\"return \"", "+", "text", ")", "(", ")", ";", "if", "(", "reviver", ")", "{", "return", "_gpfJsonParseApplyReviver", "(", "result", ",", "\...
JSON.parse polyfill @param {*} text The string to parse as JSON @param {Function} [reviver] Describes how the value originally produced by parsing is transformed, before being returned @return {Object} Parsed value @since 0.1.5
[ "JSON", ".", "parse", "polyfill" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L1432-L1438
29,492
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfDefineClassImport
function _gpfDefineClassImport(InstanceBuilder) { var entityDefinition = _gpfDefineEntitiesFindByConstructor(InstanceBuilder); if (entityDefinition) { return entityDefinition; } return _gpfDefineClassImportFrom(InstanceBuilder, _gpfDefineClassImportGetDefinition(InstanceBuilder)); }
javascript
function _gpfDefineClassImport(InstanceBuilder) { var entityDefinition = _gpfDefineEntitiesFindByConstructor(InstanceBuilder); if (entityDefinition) { return entityDefinition; } return _gpfDefineClassImportFrom(InstanceBuilder, _gpfDefineClassImportGetDefinition(InstanceBuilder)); }
[ "function", "_gpfDefineClassImport", "(", "InstanceBuilder", ")", "{", "var", "entityDefinition", "=", "_gpfDefineEntitiesFindByConstructor", "(", "InstanceBuilder", ")", ";", "if", "(", "entityDefinition", ")", "{", "return", "entityDefinition", ";", "}", "return", "...
Import a class as an entity definition @param {Function} InstanceBuilder Instance builder (must be an ES6 class) @return {_GpfEntityDefinition} Entity definition @since 0.2.9
[ "Import", "a", "class", "as", "an", "entity", "definition" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L2497-L2503
29,493
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (name, value) { var overriddenMember = this._extend.prototype[name]; if (undefined !== overriddenMember) { this._checkOverridenMember(value, overriddenMember); } }
javascript
function (name, value) { var overriddenMember = this._extend.prototype[name]; if (undefined !== overriddenMember) { this._checkOverridenMember(value, overriddenMember); } }
[ "function", "(", "name", ",", "value", ")", "{", "var", "overriddenMember", "=", "this", ".", "_extend", ".", "prototype", "[", "name", "]", ";", "if", "(", "undefined", "!==", "overriddenMember", ")", "{", "this", ".", "_checkOverridenMember", "(", "value...
Check if the member overrides an inherited one @param {String} name Member name @param {*} value Member value @throws {gpf.Error.InvalidClassOverride} @since 0.1.7
[ "Check", "if", "the", "member", "overrides", "an", "inherited", "one" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L2625-L2630
29,494
ArnaudBuchholz/gpf-js
build/gpf-debug.js
function (newPrototype, memberName, value) { if (typeof value === "function") { this._addMethodToPrototype(newPrototype, memberName, value); } else { newPrototype[memberName] = value; } }
javascript
function (newPrototype, memberName, value) { if (typeof value === "function") { this._addMethodToPrototype(newPrototype, memberName, value); } else { newPrototype[memberName] = value; } }
[ "function", "(", "newPrototype", ",", "memberName", ",", "value", ")", "{", "if", "(", "typeof", "value", "===", "\"function\"", ")", "{", "this", ".", "_addMethodToPrototype", "(", "newPrototype", ",", "memberName", ",", "value", ")", ";", "}", "else", "{...
Add member to the new class prototype @param {Object} newPrototype New class prototype @param {String} memberName Member name @param {*} value Member value @since 0.1.7
[ "Add", "member", "to", "the", "new", "class", "prototype" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3020-L3026
29,495
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfInterfaceIsImplementedBy
function _gpfInterfaceIsImplementedBy(interfaceSpecifier, inspectedObject) { var result = true; _gpfObjectForEach(interfaceSpecifier.prototype, function (referenceMethod, name) { if (name === "constructor") { // ignore return; } if (_gpfInterfaceIsInvalidMethod(referenceMethod, inspectedObject[name])) { result = false; } }); return result; }
javascript
function _gpfInterfaceIsImplementedBy(interfaceSpecifier, inspectedObject) { var result = true; _gpfObjectForEach(interfaceSpecifier.prototype, function (referenceMethod, name) { if (name === "constructor") { // ignore return; } if (_gpfInterfaceIsInvalidMethod(referenceMethod, inspectedObject[name])) { result = false; } }); return result; }
[ "function", "_gpfInterfaceIsImplementedBy", "(", "interfaceSpecifier", ",", "inspectedObject", ")", "{", "var", "result", "=", "true", ";", "_gpfObjectForEach", "(", "interfaceSpecifier", ".", "prototype", ",", "function", "(", "referenceMethod", ",", "name", ")", "...
Verify that the object implements the specified interface @param {Function} interfaceSpecifier Reference interface @param {Object} inspectedObject Object (or class prototype) to inspect @return {Boolean} True if implemented @since 0.1.8
[ "Verify", "that", "the", "object", "implements", "the", "specified", "interface" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3359-L3371
29,496
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfInterfaceQueryThroughIUnknown
function _gpfInterfaceQueryThroughIUnknown(interfaceSpecifier, queriedObject) { var result = queriedObject.queryInterface(interfaceSpecifier); _gpfAssert(result === null || _gpfInterfaceIsImplementedBy(interfaceSpecifier, result), "Invalid result of queryInterface (must be null or an object implementing the interface)"); return result; }
javascript
function _gpfInterfaceQueryThroughIUnknown(interfaceSpecifier, queriedObject) { var result = queriedObject.queryInterface(interfaceSpecifier); _gpfAssert(result === null || _gpfInterfaceIsImplementedBy(interfaceSpecifier, result), "Invalid result of queryInterface (must be null or an object implementing the interface)"); return result; }
[ "function", "_gpfInterfaceQueryThroughIUnknown", "(", "interfaceSpecifier", ",", "queriedObject", ")", "{", "var", "result", "=", "queriedObject", ".", "queryInterface", "(", "interfaceSpecifier", ")", ";", "_gpfAssert", "(", "result", "===", "null", "||", "_gpfInterf...
Retrieve an object implementing the expected interface from an object using the IUnknown interface @param {Function} interfaceSpecifier Reference interface @param {Object} queriedObject Object to query @return {Object|null} Object implementing the interface or null @since 0.1.8
[ "Retrieve", "an", "object", "implementing", "the", "expected", "interface", "from", "an", "object", "using", "the", "IUnknown", "interface" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3380-L3384
29,497
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfInterfaceQueryTryIUnknown
function _gpfInterfaceQueryTryIUnknown(interfaceSpecifier, queriedObject) { if (_gpfInterfaceIsImplementedBy(gpf.interfaces.IUnknown, queriedObject)) { return _gpfInterfaceQueryThroughIUnknown(interfaceSpecifier, queriedObject); } }
javascript
function _gpfInterfaceQueryTryIUnknown(interfaceSpecifier, queriedObject) { if (_gpfInterfaceIsImplementedBy(gpf.interfaces.IUnknown, queriedObject)) { return _gpfInterfaceQueryThroughIUnknown(interfaceSpecifier, queriedObject); } }
[ "function", "_gpfInterfaceQueryTryIUnknown", "(", "interfaceSpecifier", ",", "queriedObject", ")", "{", "if", "(", "_gpfInterfaceIsImplementedBy", "(", "gpf", ".", "interfaces", ".", "IUnknown", ",", "queriedObject", ")", ")", "{", "return", "_gpfInterfaceQueryThroughIU...
Retrieve an object implementing the expected interface from an object trying the IUnknown interface @param {Function} interfaceSpecifier Reference interface @param {Object} queriedObject Object to query @return {Object|null|undefined} Object implementing the interface or null, undefined is returned when IUnknown is not implemented @since 0.1.8
[ "Retrieve", "an", "object", "implementing", "the", "expected", "interface", "from", "an", "object", "trying", "the", "IUnknown", "interface" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3394-L3398
29,498
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfDefineInterface
function _gpfDefineInterface(name, definition) { var interfaceDefinition = { $interface: "gpf.interfaces.I" + name }; Object.keys(definition).forEach(function (methodName) { interfaceDefinition[methodName] = _gpfCreateAbstractFunction(definition[methodName]); }); return _gpfDefine(interfaceDefinition); }
javascript
function _gpfDefineInterface(name, definition) { var interfaceDefinition = { $interface: "gpf.interfaces.I" + name }; Object.keys(definition).forEach(function (methodName) { interfaceDefinition[methodName] = _gpfCreateAbstractFunction(definition[methodName]); }); return _gpfDefine(interfaceDefinition); }
[ "function", "_gpfDefineInterface", "(", "name", ",", "definition", ")", "{", "var", "interfaceDefinition", "=", "{", "$interface", ":", "\"gpf.interfaces.I\"", "+", "name", "}", ";", "Object", ".", "keys", "(", "definition", ")", ".", "forEach", "(", "function...
Internal interface definition helper @param {String} name Interface name @param {Object} definition Interface definition association method names to the number of parameters @return {Function} Interface specifier @since 0.1.9
[ "Internal", "interface", "definition", "helper" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3472-L3478
29,499
ArnaudBuchholz/gpf-js
build/gpf-debug.js
_gpfStreamSecureInstallProgressFlag
function _gpfStreamSecureInstallProgressFlag(constructor) { constructor.prototype[_gpfStreamProgressRead] = false; constructor.prototype[_gpfStreamProgressWrite] = false; }
javascript
function _gpfStreamSecureInstallProgressFlag(constructor) { constructor.prototype[_gpfStreamProgressRead] = false; constructor.prototype[_gpfStreamProgressWrite] = false; }
[ "function", "_gpfStreamSecureInstallProgressFlag", "(", "constructor", ")", "{", "constructor", ".", "prototype", "[", "_gpfStreamProgressRead", "]", "=", "false", ";", "constructor", ".", "prototype", "[", "_gpfStreamProgressWrite", "]", "=", "false", ";", "}" ]
Install the progress flag used by _gpfStreamSecureRead and Write @param {Function} constructor Class constructor @since 0.1.9
[ "Install", "the", "progress", "flag", "used", "by", "_gpfStreamSecureRead", "and", "Write" ]
0888295c99a1ff285ead60273cc7ef656e7fd812
https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L3697-L3700