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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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] = factoryOrO... | 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] = factoryOrO... | [
"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 | train |
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 = par... | 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 = par... | [
"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 | train |
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(reduc... | 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(reduc... | [
"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 | train |
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 i... | javascript | function (definitions) {
var
result = [],
len = definitions.length,
idx,
definition;
for (idx = 0; idx < len; ++idx) {
definition = definitions[idx];
if (!(definition i... | [
"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 | train | |
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 = {
na... | javascript | function (definition) {
var
result = new gpf.Parameter(),
typeDefaultValue;
if (definition === gpf.Parameter.VERBOSE
|| definition.prefix === gpf.Parameter.VERBOSE) {
definition = {
na... | [
"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 | train | |
ArnaudBuchholz/gpf-js | lost+found/src/params.js | function (parameters, argumentsToParse) {
var
result = {},
len,
idx,
argument,
parameter,
name,
lastNonPrefixIdx = 0;
parameters = gpf.Parameter.cre... | javascript | function (parameters, argumentsToParse) {
var
result = {},
len,
idx,
argument,
parameter,
name,
lastNonPrefixIdx = 0;
parameters = gpf.Parameter.cre... | [
"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 | train | |
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[... | javascript | function (parameters, result) {
var
len,
idx,
parameter,
name,
value;
len = parameters.length;
for (idx = 0; idx < len; ++idx) {
parameter = parameters[... | [
"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 | train | |
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,
_$supe... | 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,
_$supe... | [
"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 | train |
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 | train | |
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 | train | |
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,
... | javascript | function _gpfStreamPipeToFlushableWrite (intermediate, destination) {
var state = _gpfStreamPipeAllocateState(intermediate, destination),
read = _gpfStreamPipeAllocateRead(state),
iFlushableIntermediate = state.iFlushableIntermediate,
iFlushableDestination = state.iFlushableDestination,
... | [
"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 comple... | [
"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 | train |
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 iReadableS... | javascript | function _gpfStreamPipe (source, destination) {
_gpfIgnore(destination);
var iReadableStream = _gpfStreamQueryReadable(source),
iWritableStream = _gpfStreamPipeToWritable(_gpfArrayTail(arguments)),
iFlushableStream = _gpfStreamPipeToFlushable(iWritableStream);
try {
return iReadableS... | [
"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 | train |
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(_gpfSour... | 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(_gpfSour... | [
"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 | train |
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(")",... | 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(")",... | [
"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 | train |
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... | 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... | [
"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 | train | |
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 | train | |
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 | train |
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 | train |
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);
}
re... | 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);
}
re... | [
"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>} fulfille... | [
"gpf",
".",
"events",
".",
"fire",
"implementation"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/lost+found/src/events.js#L190-L207 | train |
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 | train |
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 | train |
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", p... | javascript | function (unnormalizedPath) {
var path = _gpfPathNormalize(unnormalizedPath);
return new Promise(function (resolve) {
_gpfNodeFs.exists(path, resolve);
})
.then(function (exists) {
if (exists) {
return _gpfFsNodeFsCallWithPath("stat", p... | [
"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 | train | |
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... | 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... | [
"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 | train |
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... | 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... | [
"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 | train |
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 | train |
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'));
});
checkingAppServerPo... | 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'));
});
checkingAppServerPo... | [
"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 | train |
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 | train |
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 | train |
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 =>... | 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 =>... | [
"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 | train |
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)}`);
mo... | 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)}`);
mo... | [
"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 | train |
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
inclu... | [
"JSON",
".",
"stringify",
"polyfill"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/src/compatibility/json/stringify.js#L127-L130 | train |
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 | train |
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._... | 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._... | [
"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 | train | |
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 | train | |
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" >= ch... | javascript | function (char) {
var
newState,
tagsOpened = 0 < this._openedTags.length;
if ("#" === char) {
this._hLevel = 1;
newState = this._parseTitle;
} else if ("*" === char || "0" <= char && "9" >= ch... | [
"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 | train | |
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("\">");
... | javascript | function () {
var
url = this._linkUrl.join(""),
text = this._linkText.join("");
if (0 === this._linkType) {
this._output("<a href=\"");
this._output(url);
this._output("\">");
... | [
"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 | train | |
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) {
... | javascript | function (event) {
var
reader = event.target,
buffer,
len,
result,
idx;
_gpfAssert(reader === this._reader, "Unexpected change of reader");
if (reader.error) {
... | [
"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 | train | |
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.querySelect... | javascript | function (domObject) {
var selector = this._selector;
if (selector) {
if (this._globalSelector) {
return document.querySelector(selector);
} else {
return domObject.querySelect... | [
"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 | train | |
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 (!(attribu... | javascript | function _getHandlerAttribute (member, handlerAttributeArray) {
var attribute;
if (1 !== handlerAttributeArray.length()) {
gpf.Error.htmlHandlerMultiplicityError({
member: member
});
}
attribute = handlerAttributeArray.get(0);
if (!(attribu... | [
"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 | train |
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 {
... | javascript | function _onResize () {
_width = window.innerWidth;
_height = window.innerHeight;
var
orientation,
orientationChanged = false,
toRemove = [],
toAdd = [];
if (_width > _height) {
orientation = "gpf-landscape";
} else {
... | [
"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 | train |
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 | train |
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 | train |
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[ke... | 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[ke... | [
"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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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()
});
})
.... | 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()
});
})
.... | [
"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 | train |
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 | train |
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 | train |
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 | train |
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... | 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... | [
"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 | train |
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(
... | 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(
... | [
"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 | train |
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);
}
... | 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);
}
... | [
"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 | train |
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 | train |
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--) {
spl... | 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--) {
spl... | [
"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 | train |
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 | train | |
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 | train |
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 | train | |
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 | train | |
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.c... | 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.c... | [
"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 | train | |
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");
} cat... | 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");
} cat... | [
"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 | train |
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.secondPass... | 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.secondPass... | [
"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 | train |
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 | train |
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 | train |
ArnaudBuchholz/gpf-js | src/serial/property.js | _gpfSerialPropertyCheck | function _gpfSerialPropertyCheck (property) {
var clonedProperty = Object.assign(property);
[
_gpfSerialPropertyCheckName,
_gpfSerialPropertyCheckType,
_gpfSerialPropertyCheckRequired,
_gpfSerialPropertyCheckReadOnly
].forEach(function (checkFunction) {
checkFunction(... | javascript | function _gpfSerialPropertyCheck (property) {
var clonedProperty = Object.assign(property);
[
_gpfSerialPropertyCheckName,
_gpfSerialPropertyCheckType,
_gpfSerialPropertyCheckRequired,
_gpfSerialPropertyCheckReadOnly
].forEach(function (checkFunction) {
checkFunction(... | [
"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.Invali... | [
"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 | train |
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 ... | [
"_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 | train |
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 | train |
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 | train |
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;
... | javascript | function (searchElement) {
var result = -1;
_gpfArrayEveryOwn(this, function (value, index) {
if (value === searchElement) {
result = index;
return false;
}
return true;
... | [
"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 | train | |
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 = in... | 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 = in... | [
"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 | train | |
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 | train |
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 | train |
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 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | _gpfDefineClassImport | function _gpfDefineClassImport(InstanceBuilder) {
var entityDefinition = _gpfDefineEntitiesFindByConstructor(InstanceBuilder);
if (entityDefinition) {
return entityDefinition;
}
return _gpfDefineClassImportFrom(InstanceBuilder, _gpfDefineClassImportGetDefinition(InstanceBuild... | javascript | function _gpfDefineClassImport(InstanceBuilder) {
var entityDefinition = _gpfDefineEntitiesFindByConstructor(InstanceBuilder);
if (entityDefinition) {
return entityDefinition;
}
return _gpfDefineClassImportFrom(InstanceBuilder, _gpfDefineClassImportGetDefinition(InstanceBuild... | [
"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 | train |
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 | train | |
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 | train | |
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 (_gp... | javascript | function _gpfInterfaceIsImplementedBy(interfaceSpecifier, inspectedObject) {
var result = true;
_gpfObjectForEach(interfaceSpecifier.prototype, function (referenceMethod, name) {
if (name === "constructor") {
// ignore
return;
}
if (_gp... | [
"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 | train |
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... | 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... | [
"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 | train |
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 no... | [
"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 | train |
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 _gpfD... | javascript | function _gpfDefineInterface(name, definition) {
var interfaceDefinition = { $interface: "gpf.interfaces.I" + name };
Object.keys(definition).forEach(function (methodName) {
interfaceDefinition[methodName] = _gpfCreateAbstractFunction(definition[methodName]);
});
return _gpfD... | [
"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 | train |
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 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | _gpfFsExploreEnumerator | function _gpfFsExploreEnumerator(iFileStorage, listOfPaths) {
var pos = GPF_FS_EXPLORE_BEFORE_START, info;
return {
reset: function () {
pos = GPF_FS_EXPLORE_BEFORE_START;
return Promise.resolve();
},
moveNext: function () {
... | javascript | function _gpfFsExploreEnumerator(iFileStorage, listOfPaths) {
var pos = GPF_FS_EXPLORE_BEFORE_START, info;
return {
reset: function () {
pos = GPF_FS_EXPLORE_BEFORE_START;
return Promise.resolve();
},
moveNext: function () {
... | [
"function",
"_gpfFsExploreEnumerator",
"(",
"iFileStorage",
",",
"listOfPaths",
")",
"{",
"var",
"pos",
"=",
"GPF_FS_EXPLORE_BEFORE_START",
",",
"info",
";",
"return",
"{",
"reset",
":",
"function",
"(",
")",
"{",
"pos",
"=",
"GPF_FS_EXPLORE_BEFORE_START",
";",
... | Automate the use of getInfo on a path array to implement IFileStorage.explore
@param {gpf.interfaces.IFileStorage} iFileStorage File storage to get info from
@param {String[]} listOfPaths List of paths to return
@return {gpf.interfaces.IEnumerator} IEnumerator interface
@gpf:closure
@since 0.1.9 | [
"Automate",
"the",
"use",
"of",
"getInfo",
"on",
"a",
"path",
"array",
"to",
"implement",
"IFileStorage",
".",
"explore"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4203-L4225 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (stream, close) {
this._stream = stream;
if (typeof close === "function") {
this._close = close;
}
stream.on("error", this._onError.bind(this));
} | javascript | function (stream, close) {
this._stream = stream;
if (typeof close === "function") {
this._close = close;
}
stream.on("error", this._onError.bind(this));
} | [
"function",
"(",
"stream",
",",
"close",
")",
"{",
"this",
".",
"_stream",
"=",
"stream",
";",
"if",
"(",
"typeof",
"close",
"===",
"\"function\"",
")",
"{",
"this",
".",
"_close",
"=",
"close",
";",
"}",
"stream",
".",
"on",
"(",
"\"error\"",
",",
... | Base class wrapping NodeJS streams
@param {Object} stream NodeJS stream object
@param {Function} [close] Close handler
@constructor gpf.node.BaseStream
@since 0.1.9 | [
"Base",
"class",
"wrapping",
"NodeJS",
"streams"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4237-L4243 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (output, chunk) {
var me = this, stream = me._stream;
stream.pause();
output.write(chunk).then(function () {
stream.resume();
}, me._reject);
} | javascript | function (output, chunk) {
var me = this, stream = me._stream;
stream.pause();
output.write(chunk).then(function () {
stream.resume();
}, me._reject);
} | [
"function",
"(",
"output",
",",
"chunk",
")",
"{",
"var",
"me",
"=",
"this",
",",
"stream",
"=",
"me",
".",
"_stream",
";",
"stream",
".",
"pause",
"(",
")",
";",
"output",
".",
"write",
"(",
"chunk",
")",
".",
"then",
"(",
"function",
"(",
")",
... | endregion
Stream 'data' event handler
@param {gpf.interfaces.IWritableStream} output Output stream
@param {Object} chunk Buffer
@since 0.1.9 | [
"endregion",
"Stream",
"data",
"event",
"handler"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L4338-L4344 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (e) {
if (e instanceof java.util.NoSuchElementException || e.message.startsWith("java.util.NoSuchElementException")) {
// Empty stream
return Promise.resolve();
}
return Promise.reject(e);
} | javascript | function (e) {
if (e instanceof java.util.NoSuchElementException || e.message.startsWith("java.util.NoSuchElementException")) {
// Empty stream
return Promise.resolve();
}
return Promise.reject(e);
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
"instanceof",
"java",
".",
"util",
".",
"NoSuchElementException",
"||",
"e",
".",
"message",
".",
"startsWith",
"(",
"\"java.util.NoSuchElementException\"",
")",
")",
"{",
"// Empty stream",
"return",
"Promise",
... | region gpf.interfaces.IReadableStream
Process error that occurred during the stream reading
@param {Error} e Error coming from read
@return {Promise} Read result replacement
@since 0.2.4 | [
"region",
"gpf",
".",
"interfaces",
".",
"IReadableStream",
"Process",
"error",
"that",
"occurred",
"during",
"the",
"stream",
"reading"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5471-L5477 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function () {
var me = this;
if (me._readNotWriting) {
me._readNotWriting = false;
me._readWriteToOutput().then(undefined, function (reason) {
me._readReject(reason);
});
}
} | javascript | function () {
var me = this;
if (me._readNotWriting) {
me._readNotWriting = false;
me._readWriteToOutput().then(undefined, function (reason) {
me._readReject(reason);
});
}
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"me",
".",
"_readNotWriting",
")",
"{",
"me",
".",
"_readNotWriting",
"=",
"false",
";",
"me",
".",
"_readWriteToOutput",
"(",
")",
".",
"then",
"(",
"undefined",
",",
"function",
"... | Triggers write only if no write is in progress
@since 0.2.3 | [
"Triggers",
"write",
"only",
"if",
"no",
"write",
"is",
"in",
"progress"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5802-L5810 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function () {
var me = this, lines = me._consolidateLines();
me._buffer.length = 0;
me._pushBackLastLineIfNotEmpty(lines);
_gpfArrayForEach(lines, function (line) {
me._appendToReadBuffer(line);
});
} | javascript | function () {
var me = this, lines = me._consolidateLines();
me._buffer.length = 0;
me._pushBackLastLineIfNotEmpty(lines);
_gpfArrayForEach(lines, function (line) {
me._appendToReadBuffer(line);
});
} | [
"function",
"(",
")",
"{",
"var",
"me",
"=",
"this",
",",
"lines",
"=",
"me",
".",
"_consolidateLines",
"(",
")",
";",
"me",
".",
"_buffer",
".",
"length",
"=",
"0",
";",
"me",
".",
"_pushBackLastLineIfNotEmpty",
"(",
"lines",
")",
";",
"_gpfArrayForEa... | Check if the buffer contains any carriage return and write to output
@since 0.2.1 | [
"Check",
"if",
"the",
"buffer",
"contains",
"any",
"carriage",
"return",
"and",
"write",
"to",
"output"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L5960-L5967 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | _gpfRequireWrapGpf | function _gpfRequireWrapGpf(context, name) {
return _gpfRequirePlugWrapper(_gpfRequireAllocateWrapper(), _gpfRequireAllocate(context, { base: _gpfPathParent(name) }));
} | javascript | function _gpfRequireWrapGpf(context, name) {
return _gpfRequirePlugWrapper(_gpfRequireAllocateWrapper(), _gpfRequireAllocate(context, { base: _gpfPathParent(name) }));
} | [
"function",
"_gpfRequireWrapGpf",
"(",
"context",
",",
"name",
")",
"{",
"return",
"_gpfRequirePlugWrapper",
"(",
"_gpfRequireAllocateWrapper",
"(",
")",
",",
"_gpfRequireAllocate",
"(",
"context",
",",
"{",
"base",
":",
"_gpfPathParent",
"(",
"name",
")",
"}",
... | Wrap gpf to fit the new context and give access to gpf.require.define promise
@param {Object} context Require context
@param {String} name Resource (resolved) name
@return {gpf.typedef._requireWrapper} Wrapper
@since 0.2.2 | [
"Wrap",
"gpf",
"to",
"fit",
"the",
"new",
"context",
"and",
"give",
"access",
"to",
"gpf",
".",
"require",
".",
"define",
"promise"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6135-L6137 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | _gpfRequireGet | function _gpfRequireGet(name) {
var me = this, promise;
if (me.cache[name]) {
return me.cache[name];
}
promise = _gpfRequireLoad.call(me, name);
me.cache[name] = promise;
return promise["catch"](function (reason) {
_gpfRequireDocumentStack(reason, ... | javascript | function _gpfRequireGet(name) {
var me = this, promise;
if (me.cache[name]) {
return me.cache[name];
}
promise = _gpfRequireLoad.call(me, name);
me.cache[name] = promise;
return promise["catch"](function (reason) {
_gpfRequireDocumentStack(reason, ... | [
"function",
"_gpfRequireGet",
"(",
"name",
")",
"{",
"var",
"me",
"=",
"this",
",",
"promise",
";",
"if",
"(",
"me",
".",
"cache",
"[",
"name",
"]",
")",
"{",
"return",
"me",
".",
"cache",
"[",
"name",
"]",
";",
"}",
"promise",
"=",
"_gpfRequireLoa... | Get the cached resource or load it
@param {String} name Resource name
@return {Promise<*>} Resource association
@since 0.2.2 | [
"Get",
"the",
"cached",
"resource",
"or",
"load",
"it"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6441-L6452 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | _gpfRequireAllocate | function _gpfRequireAllocate(parentContext, options) {
var context = Object.create(parentContext),
// cache content is shared but other properties are protected
require = {};
require.define = _gpfRequireDefine.bind(context);
require.resolve = _gpfRequireResolve.bind(conte... | javascript | function _gpfRequireAllocate(parentContext, options) {
var context = Object.create(parentContext),
// cache content is shared but other properties are protected
require = {};
require.define = _gpfRequireDefine.bind(context);
require.resolve = _gpfRequireResolve.bind(conte... | [
"function",
"_gpfRequireAllocate",
"(",
"parentContext",
",",
"options",
")",
"{",
"var",
"context",
"=",
"Object",
".",
"create",
"(",
"parentContext",
")",
",",
"// cache content is shared but other properties are protected",
"require",
"=",
"{",
"}",
";",
"require"... | Allocate a new require context with the proper methods
@param {Object} parentContext Context to inherit from
@param {gpf.typedef.requireOptions} [options] Options to configure
@return {Object} Containing {@link gpf.require.define}, {@link gpf.require.resolve} and {@link gpf.require.configure}
@since 0.2.2 | [
"Allocate",
"a",
"new",
"require",
"context",
"with",
"the",
"proper",
"methods"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6495-L6506 | train |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (parserOptions) {
var me = this;
if (parserOptions) {
_gpfArrayForEach([
"header",
"separator",
"quote",
"newLine"
], function (optionName) {
if (parserOpt... | javascript | function (parserOptions) {
var me = this;
if (parserOptions) {
_gpfArrayForEach([
"header",
"separator",
"quote",
"newLine"
], function (optionName) {
if (parserOpt... | [
"function",
"(",
"parserOptions",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"parserOptions",
")",
"{",
"_gpfArrayForEach",
"(",
"[",
"\"header\"",
",",
"\"separator\"",
",",
"\"quote\"",
",",
"\"newLine\"",
"]",
",",
"function",
"(",
"optionName",
... | region Parser options
Read parser options
@param {gpf.typedef.csvParserOptions} [parserOptions] Parser options
@since 0.2.3 | [
"region",
"Parser",
"options",
"Read",
"parser",
"options"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6795-L6809 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function () {
var header = this._header;
this._separator = _gpfArrayForEachFalsy(_gpfCsvSeparators, function (separator) {
if (header.includes(separator)) {
return separator;
}
}) || _gpfCsvSeparators[_GPF_START];
} | javascript | function () {
var header = this._header;
this._separator = _gpfArrayForEachFalsy(_gpfCsvSeparators, function (separator) {
if (header.includes(separator)) {
return separator;
}
}) || _gpfCsvSeparators[_GPF_START];
} | [
"function",
"(",
")",
"{",
"var",
"header",
"=",
"this",
".",
"_header",
";",
"this",
".",
"_separator",
"=",
"_gpfArrayForEachFalsy",
"(",
"_gpfCsvSeparators",
",",
"function",
"(",
"separator",
")",
"{",
"if",
"(",
"header",
".",
"includes",
"(",
"separa... | Deduce separator from header line
@since 0.2.3 | [
"Deduce",
"separator",
"from",
"header",
"line"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6828-L6835 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (match) {
var UNQUOTED = 1, QUOTED = 2;
if (match[UNQUOTED]) {
this._values.push(match[UNQUOTED]);
} else
/* if (match[QUOTED]) */
{
this._values.push(this._unescapeQuoted(match[QUOTED]));
}
... | javascript | function (match) {
var UNQUOTED = 1, QUOTED = 2;
if (match[UNQUOTED]) {
this._values.push(match[UNQUOTED]);
} else
/* if (match[QUOTED]) */
{
this._values.push(this._unescapeQuoted(match[QUOTED]));
}
... | [
"function",
"(",
"match",
")",
"{",
"var",
"UNQUOTED",
"=",
"1",
",",
"QUOTED",
"=",
"2",
";",
"if",
"(",
"match",
"[",
"UNQUOTED",
"]",
")",
"{",
"this",
".",
"_values",
".",
"push",
"(",
"match",
"[",
"UNQUOTED",
"]",
")",
";",
"}",
"else",
"... | Add the matching value to the array of values
@param {Object} match Regular expression match
@since 0.2.3 | [
"Add",
"the",
"matching",
"value",
"to",
"the",
"array",
"of",
"values"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6915-L6924 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (match) {
var lengthOfMatchedString = match[_GPF_START].length, charAfterValue = this._content.charAt(lengthOfMatchedString);
if (charAfterValue) {
_gpfAssert(charAfterValue === this._separator, "Positive lookahead works");
return this._nextValue(++length... | javascript | function (match) {
var lengthOfMatchedString = match[_GPF_START].length, charAfterValue = this._content.charAt(lengthOfMatchedString);
if (charAfterValue) {
_gpfAssert(charAfterValue === this._separator, "Positive lookahead works");
return this._nextValue(++length... | [
"function",
"(",
"match",
")",
"{",
"var",
"lengthOfMatchedString",
"=",
"match",
"[",
"_GPF_START",
"]",
".",
"length",
",",
"charAfterValue",
"=",
"this",
".",
"_content",
".",
"charAt",
"(",
"lengthOfMatchedString",
")",
";",
"if",
"(",
"charAfterValue",
... | Check what appears after the extracted value
@param {Object} match Regular expression match
@return {Boolean} True if some remaining content must be parsed
@since 0.2.3 | [
"Check",
"what",
"appears",
"after",
"the",
"extracted",
"value"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L6943-L6951 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (line) {
if (this._content) {
this._content = this._content + this._newLine + line;
} else {
this._values = [];
this._content = line;
}
return this._parseContent();
} | javascript | function (line) {
if (this._content) {
this._content = this._content + this._newLine + line;
} else {
this._values = [];
this._content = line;
}
return this._parseContent();
} | [
"function",
"(",
"line",
")",
"{",
"if",
"(",
"this",
".",
"_content",
")",
"{",
"this",
".",
"_content",
"=",
"this",
".",
"_content",
"+",
"this",
".",
"_newLine",
"+",
"line",
";",
"}",
"else",
"{",
"this",
".",
"_values",
"=",
"[",
"]",
";",
... | If some content remains from previous parsing, concatenate it and parse
@param {String} line CSV line
@return {String[]|undefined} Resulting values or undefined if not yet finalized
@since 0.2.3 | [
"If",
"some",
"content",
"remains",
"from",
"previous",
"parsing",
"concatenate",
"it",
"and",
"parse"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7010-L7018 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function (values) {
var record = {};
_gpfArrayForEach(this._columns, function (name, idx) {
var value = values[idx];
if (value !== undefined) {
record[name] = values[idx];
}
});
return record;
} | javascript | function (values) {
var record = {};
_gpfArrayForEach(this._columns, function (name, idx) {
var value = values[idx];
if (value !== undefined) {
record[name] = values[idx];
}
});
return record;
} | [
"function",
"(",
"values",
")",
"{",
"var",
"record",
"=",
"{",
"}",
";",
"_gpfArrayForEach",
"(",
"this",
".",
"_columns",
",",
"function",
"(",
"name",
",",
"idx",
")",
"{",
"var",
"value",
"=",
"values",
"[",
"idx",
"]",
";",
"if",
"(",
"value",... | Generate a record from values
@param {String[]} values Array of values
@return {Object} Record based on header names
@since 0.2.3 | [
"Generate",
"a",
"record",
"from",
"values"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7026-L7035 | train | |
ArnaudBuchholz/gpf-js | build/gpf-debug.js | function () {
if (this._content) {
var error = new gpf.Error.InvalidCSV();
this._setReadError(error);
return Promise.reject(error);
}
this._completeReadBuffer();
return Promise.resolve();
} | javascript | function () {
if (this._content) {
var error = new gpf.Error.InvalidCSV();
this._setReadError(error);
return Promise.reject(error);
}
this._completeReadBuffer();
return Promise.resolve();
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_content",
")",
"{",
"var",
"error",
"=",
"new",
"gpf",
".",
"Error",
".",
"InvalidCSV",
"(",
")",
";",
"this",
".",
"_setReadError",
"(",
"error",
")",
";",
"return",
"Promise",
".",
"reject",
"(... | endregion region gpf.interfaces.IFlushableStream
@gpf:sameas gpf.interfaces.IFlushableStream#flush
@since 0.2.3 | [
"endregion",
"region",
"gpf",
".",
"interfaces",
".",
"IFlushableStream"
] | 0888295c99a1ff285ead60273cc7ef656e7fd812 | https://github.com/ArnaudBuchholz/gpf-js/blob/0888295c99a1ff285ead60273cc7ef656e7fd812/build/gpf-debug.js#L7066-L7074 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.