id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
50,400 | icelab/attache-upload.js | lib/index.js | uploadRequest | function uploadRequest(res, fileObject, showProgress) {
var url = res.url;
var expiration = res.expiration;
var hmac = res.hmac;
var uuid = res.uuid;
var file = fileObject.file;
var uid = fileObject.uid;
var upload_url = buildUploadURL(url, uuid, expiration, hmac, file.name);
return new Promise(functi... | javascript | function uploadRequest(res, fileObject, showProgress) {
var url = res.url;
var expiration = res.expiration;
var hmac = res.hmac;
var uuid = res.uuid;
var file = fileObject.file;
var uid = fileObject.uid;
var upload_url = buildUploadURL(url, uuid, expiration, hmac, file.name);
return new Promise(functi... | [
"function",
"uploadRequest",
"(",
"res",
",",
"fileObject",
",",
"showProgress",
")",
"{",
"var",
"url",
"=",
"res",
".",
"url",
";",
"var",
"expiration",
"=",
"res",
".",
"expiration",
";",
"var",
"hmac",
"=",
"res",
".",
"hmac",
";",
"var",
"uuid",
... | uploadRequest
Assign an XHR request to the `reqs` hash using the `uid`.
@param {Object} res - the response from presignRequest()
@param {File Object} file
@param {Function} on progress event handler
@return {Promise} | [
"uploadRequest",
"Assign",
"an",
"XHR",
"request",
"to",
"the",
"reqs",
"hash",
"using",
"the",
"uid",
"."
] | ff40a9d8caa45c53e147c810dc7449de685fcaf4 | https://github.com/icelab/attache-upload.js/blob/ff40a9d8caa45c53e147c810dc7449de685fcaf4/lib/index.js#L146-L171 |
50,401 | tndinhbao/ngoto | index.spec.js | parseMiddleware | function parseMiddleware(ctx, next) {
try {
ctx.event = JSON.parse(ctx.content.toString());
next();
} catch (e) {
throw e;
}
} | javascript | function parseMiddleware(ctx, next) {
try {
ctx.event = JSON.parse(ctx.content.toString());
next();
} catch (e) {
throw e;
}
} | [
"function",
"parseMiddleware",
"(",
"ctx",
",",
"next",
")",
"{",
"try",
"{",
"ctx",
".",
"event",
"=",
"JSON",
".",
"parse",
"(",
"ctx",
".",
"content",
".",
"toString",
"(",
")",
")",
";",
"next",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"... | Parse JSON middleware
@param {String} msg | [
"Parse",
"JSON",
"middleware"
] | ed9877af5b31cb7afaebb4da2c497b3342d61f3c | https://github.com/tndinhbao/ngoto/blob/ed9877af5b31cb7afaebb4da2c497b3342d61f3c/index.spec.js#L27-L34 |
50,402 | MakerCollider/node-red-contrib-smartnode-hook | html/scripts/RGraph/RGraph.common.resizing.js | function (e)
{
if (!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown) {
return;
}
if (RGraph.Resizing.div) {
var div = RGraph.Resizing.div;
var canvas = div.__canvas__;
... | javascript | function (e)
{
if (!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown) {
return;
}
if (RGraph.Resizing.div) {
var div = RGraph.Resizing.div;
var canvas = div.__canvas__;
... | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"RGraph",
".",
"Resizing",
"||",
"!",
"RGraph",
".",
"Resizing",
".",
"div",
"||",
"!",
"RGraph",
".",
"Resizing",
".",
"mousedown",
")",
"{",
"return",
";",
"}",
"if",
"(",
"RGraph",
".",
"Resizing",... | The window onmouseup function | [
"The",
"window",
"onmouseup",
"function"
] | 245c267e832968bad880ca009929043e82c7bc25 | https://github.com/MakerCollider/node-red-contrib-smartnode-hook/blob/245c267e832968bad880ca009929043e82c7bc25/html/scripts/RGraph/RGraph.common.resizing.js#L184-L283 | |
50,403 | aureooms/js-random | lib/kernel/_shuffle.js | _shuffle | function _shuffle(sample) {
var shuffle = function shuffle(a, i, j) {
sample(j - i, a, i, j);
};
return shuffle;
} | javascript | function _shuffle(sample) {
var shuffle = function shuffle(a, i, j) {
sample(j - i, a, i, j);
};
return shuffle;
} | [
"function",
"_shuffle",
"(",
"sample",
")",
"{",
"var",
"shuffle",
"=",
"function",
"shuffle",
"(",
"a",
",",
"i",
",",
"j",
")",
"{",
"sample",
"(",
"j",
"-",
"i",
",",
"a",
",",
"i",
",",
"j",
")",
";",
"}",
";",
"return",
"shuffle",
";",
"... | Shuffle array by sampling the complete array. | [
"Shuffle",
"array",
"by",
"sampling",
"the",
"complete",
"array",
"."
] | 4bc04ed5ddb90494d02d04ef4633915d383b9931 | https://github.com/aureooms/js-random/blob/4bc04ed5ddb90494d02d04ef4633915d383b9931/lib/kernel/_shuffle.js#L12-L19 |
50,404 | me-box-archive/nodeZestClient | zest.js | function (token, path, payload, contentFormat) {
return new Promise((resolve,reject)=>{
let zh = NewZestHeader();
zh.code = 2;
zh.token = token;
zh.tkl = token.length;
zh.payload = payload;
zh.oc = 3;
... | javascript | function (token, path, payload, contentFormat) {
return new Promise((resolve,reject)=>{
let zh = NewZestHeader();
zh.code = 2;
zh.token = token;
zh.tkl = token.length;
zh.payload = payload;
zh.oc = 3;
... | [
"function",
"(",
"token",
",",
"path",
",",
"payload",
",",
"contentFormat",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"let",
"zh",
"=",
"NewZestHeader",
"(",
")",
";",
"zh",
".",
"code",
"=",
"2",
";... | a dict to keep track of observers so they can be closed | [
"a",
"dict",
"to",
"keep",
"track",
"of",
"observers",
"so",
"they",
"can",
"be",
"closed"
] | 4c2ef36f4bd21d9cbf4cdde74fd030ec7c807dd6 | https://github.com/me-box-archive/nodeZestClient/blob/4c2ef36f4bd21d9cbf4cdde74fd030ec7c807dd6/zest.js#L27-L50 | |
50,405 | kulakowka/mithril-firebase-mixin | index.js | positionAfter | function positionAfter (arr, prevChild) {
var idx
if (prevChild === null) {
return 0
} else {
idx = findIndex(arr, prevChild)
return (idx === -1) ? arr.length : idx + 1
}
} | javascript | function positionAfter (arr, prevChild) {
var idx
if (prevChild === null) {
return 0
} else {
idx = findIndex(arr, prevChild)
return (idx === -1) ? arr.length : idx + 1
}
} | [
"function",
"positionAfter",
"(",
"arr",
",",
"prevChild",
")",
"{",
"var",
"idx",
"if",
"(",
"prevChild",
"===",
"null",
")",
"{",
"return",
"0",
"}",
"else",
"{",
"idx",
"=",
"findIndex",
"(",
"arr",
",",
"prevChild",
")",
"return",
"(",
"idx",
"==... | using the Firebase API's prevChild behavior, we place each element in the list after it's prev sibling or, if prevChild is null, at the beginning | [
"using",
"the",
"Firebase",
"API",
"s",
"prevChild",
"behavior",
"we",
"place",
"each",
"element",
"in",
"the",
"list",
"after",
"it",
"s",
"prev",
"sibling",
"or",
"if",
"prevChild",
"is",
"null",
"at",
"the",
"beginning"
] | d1ad7fde3918bed7df823b2da853d53a0f1358e9 | https://github.com/kulakowka/mithril-firebase-mixin/blob/d1ad7fde3918bed7df823b2da853d53a0f1358e9/index.js#L31-L39 |
50,406 | aarki/grunt-lessvars | tasks/lib/extractor.js | toJS | function toJS(node, options, context) {
switch (node.type) {
// process numeric values and units
case 'Dimension':
var value = node.value;
var unit = options.units ? node.unit.toCSS(context) : null;
// if given a list of units to preserve, check if compiled unit ... | javascript | function toJS(node, options, context) {
switch (node.type) {
// process numeric values and units
case 'Dimension':
var value = node.value;
var unit = options.units ? node.unit.toCSS(context) : null;
// if given a list of units to preserve, check if compiled unit ... | [
"function",
"toJS",
"(",
"node",
",",
"options",
",",
"context",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"// process numeric values and units",
"case",
"'Dimension'",
":",
"var",
"value",
"=",
"node",
".",
"value",
";",
"var",
"unit",
"=",
... | modify how value nodes are coerced into JS values, if different from CSS | [
"modify",
"how",
"value",
"nodes",
"are",
"coerced",
"into",
"JS",
"values",
"if",
"different",
"from",
"CSS"
] | 9e4f5a5ef2df62f9633b7278dc67361398bb601b | https://github.com/aarki/grunt-lessvars/blob/9e4f5a5ef2df62f9633b7278dc67361398bb601b/tasks/lib/extractor.js#L99-L125 |
50,407 | andrewscwei/requiem | src/dom/createElement.js | createElement | function createElement(value) {
if (!document) return null;
assertType(value, 'string', true, 'Value must be a string');
if (value.match(/^([a-z0-9]+-)+[a-z0-9]+$/)) {
return new (getElementRegistry(value))();
}
else {
let div = document.createElement('div');
if (value.indexOf('<') !== 0 && valu... | javascript | function createElement(value) {
if (!document) return null;
assertType(value, 'string', true, 'Value must be a string');
if (value.match(/^([a-z0-9]+-)+[a-z0-9]+$/)) {
return new (getElementRegistry(value))();
}
else {
let div = document.createElement('div');
if (value.indexOf('<') !== 0 && valu... | [
"function",
"createElement",
"(",
"value",
")",
"{",
"if",
"(",
"!",
"document",
")",
"return",
"null",
";",
"assertType",
"(",
"value",
",",
"'string'",
",",
"true",
",",
"'Value must be a string'",
")",
";",
"if",
"(",
"value",
".",
"match",
"(",
"/",
... | Creates a DOM element from the provided string.
@param {string} value - String describing the DOM element.
@return {Node} DOM element.
@alias module:requiem~dom.createElement | [
"Creates",
"a",
"DOM",
"element",
"from",
"the",
"provided",
"string",
"."
] | c4182bfffc9841c6de5718f689ad3c2060511777 | https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/dom/createElement.js#L17-L31 |
50,408 | fengzilong/regular-router | src/installSync.js | install | function install(definition, Component) {
const Ctor = register(definition, Component);
// no dependencies
if (!definition.components) {
return Ctor;
}
const components = definition.components || {};
// avoid unnecessary re-registering for next time
delete definition.components;
// register comp... | javascript | function install(definition, Component) {
const Ctor = register(definition, Component);
// no dependencies
if (!definition.components) {
return Ctor;
}
const components = definition.components || {};
// avoid unnecessary re-registering for next time
delete definition.components;
// register comp... | [
"function",
"install",
"(",
"definition",
",",
"Component",
")",
"{",
"const",
"Ctor",
"=",
"register",
"(",
"definition",
",",
"Component",
")",
";",
"// no dependencies",
"if",
"(",
"!",
"definition",
".",
"components",
")",
"{",
"return",
"Ctor",
";",
"... | install single component | [
"install",
"single",
"component"
] | 897a6c571a935cec31dd0e51da0fb39f61e3a5d3 | https://github.com/fengzilong/regular-router/blob/897a6c571a935cec31dd0e51da0fb39f61e3a5d3/src/installSync.js#L6-L26 |
50,409 | webmarketingroi/optimizely-x-node | lib/OptimizelyClient.js | parseHttpHeaders | function parseHttpHeaders(headers) {
var meta = {};
for (var headerName in headers) {
var headerValue = headers[headerName];
if (headerName=="x-ratelimit-limit") {
meta.rateLimit = headerValue;
} else if (headerName=="x-ratelimit-remaining") {
meta.r... | javascript | function parseHttpHeaders(headers) {
var meta = {};
for (var headerName in headers) {
var headerValue = headers[headerName];
if (headerName=="x-ratelimit-limit") {
meta.rateLimit = headerValue;
} else if (headerName=="x-ratelimit-remaining") {
meta.r... | [
"function",
"parseHttpHeaders",
"(",
"headers",
")",
"{",
"var",
"meta",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"headerName",
"in",
"headers",
")",
"{",
"var",
"headerValue",
"=",
"headers",
"[",
"headerName",
"]",
";",
"if",
"(",
"headerName",
"==",
"... | Private function that retrieves meta information from HTTP headers. | [
"Private",
"function",
"that",
"retrieves",
"meta",
"information",
"from",
"HTTP",
"headers",
"."
] | 64ac76f2aa44630c3d871d5003016f4910078c5e | https://github.com/webmarketingroi/optimizely-x-node/blob/64ac76f2aa44630c3d871d5003016f4910078c5e/lib/OptimizelyClient.js#L158-L197 |
50,410 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_CubeTexture | function getter_THREE_CubeTexture(inst) {
return [
inst.name,
inst.mipmaps,
inst.flipY,
inst.mapping,
inst.wrapS,
inst.wrapT,
inst.magFilter,
inst.minFilter,
inst.anisotropy,
inst.format,
inst.type,
inst.offset,
inst.repeat,
inst.unpackAlignment,
inst.image];
} | javascript | function getter_THREE_CubeTexture(inst) {
return [
inst.name,
inst.mipmaps,
inst.flipY,
inst.mapping,
inst.wrapS,
inst.wrapT,
inst.magFilter,
inst.minFilter,
inst.anisotropy,
inst.format,
inst.type,
inst.offset,
inst.repeat,
inst.unpackAlignment,
inst.image];
} | [
"function",
"getter_THREE_CubeTexture",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"mipmaps",
",",
"inst",
".",
"flipY",
",",
"inst",
".",
"mapping",
",",
"inst",
".",
"wrapS",
",",
"inst",
".",
"wrapT",
",",
"inst",
... | Property getter THREE.CubeTexture | [
"Property",
"getter",
"THREE",
".",
"CubeTexture"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L30-L47 |
50,411 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_LineBasicMaterial | function getter_THREE_LineBasicMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | javascript | function getter_THREE_LineBasicMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | [
"function",
"getter_THREE_LineBasicMaterial",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"side",
",",
"inst",
".",
"opacity",
",",
"inst",
".",
"blending",
",",
"inst",
".",
"blendSrc",
",",
"inst",
".",
"blendDst",
",",... | Property getter THREE.LineBasicMaterial | [
"Property",
"getter",
"THREE",
".",
"LineBasicMaterial"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L96-L126 |
50,412 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_SpriteMaterial | function getter_THREE_SpriteMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAlpha... | javascript | function getter_THREE_SpriteMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAlpha... | [
"function",
"getter_THREE_SpriteMaterial",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"side",
",",
"inst",
".",
"opacity",
",",
"inst",
".",
"blending",
",",
"inst",
".",
"blendSrc",
",",
"inst",
".",
"blendDst",
",",
... | Property getter THREE.SpriteMaterial | [
"Property",
"getter",
"THREE",
".",
"SpriteMaterial"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L131-L159 |
50,413 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_MeshDepthMaterial | function getter_THREE_MeshDepthMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | javascript | function getter_THREE_MeshDepthMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | [
"function",
"getter_THREE_MeshDepthMaterial",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"side",
",",
"inst",
".",
"opacity",
",",
"inst",
".",
"blending",
",",
"inst",
".",
"blendSrc",
",",
"inst",
".",
"blendDst",
",",... | Property getter THREE.MeshDepthMaterial | [
"Property",
"getter",
"THREE",
".",
"MeshDepthMaterial"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L231-L258 |
50,414 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_MeshLambertMaterial | function getter_THREE_MeshLambertMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDst... | javascript | function getter_THREE_MeshLambertMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDst... | [
"function",
"getter_THREE_MeshLambertMaterial",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"side",
",",
"inst",
".",
"opacity",
",",
"inst",
".",
"blending",
",",
"inst",
".",
"blendSrc",
",",
"inst",
".",
"blendDst",
",... | Property getter THREE.MeshLambertMaterial | [
"Property",
"getter",
"THREE",
".",
"MeshLambertMaterial"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L263-L305 |
50,415 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_MeshPhongMaterial | function getter_THREE_MeshPhongMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | javascript | function getter_THREE_MeshPhongMaterial(inst) {
return [
inst.name,
inst.side,
inst.opacity,
inst.blending,
inst.blendSrc,
inst.blendDst,
inst.blendEquation,
inst.depthFunc,
inst.polygonOffsetFactor,
inst.polygonOffsetUnits,
inst.alphaTest,
inst.overdraw,
inst.blendSrcAlpha,
inst.blendDstAl... | [
"function",
"getter_THREE_MeshPhongMaterial",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"side",
",",
"inst",
".",
"opacity",
",",
"inst",
".",
"blending",
",",
"inst",
".",
"blendSrc",
",",
"inst",
".",
"blendDst",
",",... | Property getter THREE.MeshPhongMaterial | [
"Property",
"getter",
"THREE",
".",
"MeshPhongMaterial"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L310-L369 |
50,416 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Scene | function getter_THREE_Scene(inst) {
return [
inst.name,
inst.up,
inst.position,
inst.quaternion,
inst.scale,
inst.rotationAutoUpdate,
inst.matrix,
inst.matrixWorld,
inst.matrixAutoUpdate,
inst.visible,
inst.castShadow,
inst.receiveShadow,
inst.frustumCulled,
inst.renderOrder,
inst.userDat... | javascript | function getter_THREE_Scene(inst) {
return [
inst.name,
inst.up,
inst.position,
inst.quaternion,
inst.scale,
inst.rotationAutoUpdate,
inst.matrix,
inst.matrixWorld,
inst.matrixAutoUpdate,
inst.visible,
inst.castShadow,
inst.receiveShadow,
inst.frustumCulled,
inst.renderOrder,
inst.userDat... | [
"function",
"getter_THREE_Scene",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"up",
",",
"inst",
".",
"position",
",",
"inst",
".",
"quaternion",
",",
"inst",
".",
"scale",
",",
"inst",
".",
"rotationAutoUpdate",
",",
"... | Property getter THREE.Scene | [
"Property",
"getter",
"THREE",
".",
"Scene"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L451-L471 |
50,417 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Mesh | function getter_THREE_Mesh(inst) {
return [
inst.name,
inst.up,
inst.position,
inst.quaternion,
inst.scale,
inst.rotationAutoUpdate,
inst.matrix,
inst.matrixWorld,
inst.matrixAutoUpdate,
inst.visible,
inst.castShadow,
inst.receiveShadow,
inst.frustumCulled,
inst.renderOrder,
inst.userData... | javascript | function getter_THREE_Mesh(inst) {
return [
inst.name,
inst.up,
inst.position,
inst.quaternion,
inst.scale,
inst.rotationAutoUpdate,
inst.matrix,
inst.matrixWorld,
inst.matrixAutoUpdate,
inst.visible,
inst.castShadow,
inst.receiveShadow,
inst.frustumCulled,
inst.renderOrder,
inst.userData... | [
"function",
"getter_THREE_Mesh",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"name",
",",
"inst",
".",
"up",
",",
"inst",
".",
"position",
",",
"inst",
".",
"quaternion",
",",
"inst",
".",
"scale",
",",
"inst",
".",
"rotationAutoUpdate",
",",
"i... | Property getter THREE.Mesh | [
"Property",
"getter",
"THREE",
".",
"Mesh"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L607-L629 |
50,418 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_BufferGeometry | function getter_THREE_BufferGeometry(inst) {
return [
inst.vertices,
inst.faces,
inst.faceVertexUvs,
inst.morphTargets,
inst.morphNormals,
inst.morphColors,
inst.animations,
inst.boundingSphere,
inst.boundingBox,
inst.name,
inst.attributes,
inst.index];
} | javascript | function getter_THREE_BufferGeometry(inst) {
return [
inst.vertices,
inst.faces,
inst.faceVertexUvs,
inst.morphTargets,
inst.morphNormals,
inst.morphColors,
inst.animations,
inst.boundingSphere,
inst.boundingBox,
inst.name,
inst.attributes,
inst.index];
} | [
"function",
"getter_THREE_BufferGeometry",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"vertices",
",",
"inst",
".",
"faces",
",",
"inst",
".",
"faceVertexUvs",
",",
"inst",
".",
"morphTargets",
",",
"inst",
".",
"morphNormals",
",",
"inst",
".",
"m... | Property getter THREE.BufferGeometry | [
"Property",
"getter",
"THREE",
".",
"BufferGeometry"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L657-L671 |
50,419 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Geometry | function getter_THREE_Geometry(inst) {
return [
inst.vertices,
inst.faces,
inst.faceVertexUvs,
inst.morphTargets,
inst.morphNormals,
inst.morphColors,
inst.animations,
inst.boundingSphere,
inst.boundingBox,
inst.name];
} | javascript | function getter_THREE_Geometry(inst) {
return [
inst.vertices,
inst.faces,
inst.faceVertexUvs,
inst.morphTargets,
inst.morphNormals,
inst.morphColors,
inst.animations,
inst.boundingSphere,
inst.boundingBox,
inst.name];
} | [
"function",
"getter_THREE_Geometry",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"vertices",
",",
"inst",
".",
"faces",
",",
"inst",
".",
"faceVertexUvs",
",",
"inst",
".",
"morphTargets",
",",
"inst",
".",
"morphNormals",
",",
"inst",
".",
"morphCo... | Property getter THREE.Geometry | [
"Property",
"getter",
"THREE",
".",
"Geometry"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L847-L859 |
50,420 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Vector4 | function getter_THREE_Vector4(inst) {
return [
inst.x,
inst.y,
inst.z,
inst.w];
} | javascript | function getter_THREE_Vector4(inst) {
return [
inst.x,
inst.y,
inst.z,
inst.w];
} | [
"function",
"getter_THREE_Vector4",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"x",
",",
"inst",
".",
"y",
",",
"inst",
".",
"z",
",",
"inst",
".",
"w",
"]",
";",
"}"
] | Property getter THREE.Vector4 | [
"Property",
"getter",
"THREE",
".",
"Vector4"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L883-L889 |
50,421 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Face3 | function getter_THREE_Face3(inst) {
return [
inst.a,
inst.b,
inst.c,
inst.materialIndex,
inst.normal,
inst.color,
inst.vertexNormals,
inst.vertexColors];
} | javascript | function getter_THREE_Face3(inst) {
return [
inst.a,
inst.b,
inst.c,
inst.materialIndex,
inst.normal,
inst.color,
inst.vertexNormals,
inst.vertexColors];
} | [
"function",
"getter_THREE_Face3",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"a",
",",
"inst",
".",
"b",
",",
"inst",
".",
"c",
",",
"inst",
".",
"materialIndex",
",",
"inst",
".",
"normal",
",",
"inst",
".",
"color",
",",
"inst",
".",
"ver... | Property getter THREE.Face3 | [
"Property",
"getter",
"THREE",
".",
"Face3"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L894-L904 |
50,422 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Quaternion | function getter_THREE_Quaternion(inst) {
return [
inst._x,
inst._y,
inst._z,
inst._w];
} | javascript | function getter_THREE_Quaternion(inst) {
return [
inst._x,
inst._y,
inst._z,
inst._w];
} | [
"function",
"getter_THREE_Quaternion",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"_x",
",",
"inst",
".",
"_y",
",",
"inst",
".",
"_z",
",",
"inst",
".",
"_w",
"]",
";",
"}"
] | Property getter THREE.Quaternion | [
"Property",
"getter",
"THREE",
".",
"Quaternion"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L919-L925 |
50,423 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_Euler | function getter_THREE_Euler(inst) {
return [
inst._x,
inst._y,
inst._z,
inst._order];
} | javascript | function getter_THREE_Euler(inst) {
return [
inst._x,
inst._y,
inst._z,
inst._order];
} | [
"function",
"getter_THREE_Euler",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"_x",
",",
"inst",
".",
"_y",
",",
"inst",
".",
"_z",
",",
"inst",
".",
"_order",
"]",
";",
"}"
] | Property getter THREE.Euler | [
"Property",
"getter",
"THREE",
".",
"Euler"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L930-L936 |
50,424 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_BufferAttribute | function getter_THREE_BufferAttribute(inst) {
return [
inst.array,
inst.itemSize,
inst.dynamic,
inst.updateRange];
} | javascript | function getter_THREE_BufferAttribute(inst) {
return [
inst.array,
inst.itemSize,
inst.dynamic,
inst.updateRange];
} | [
"function",
"getter_THREE_BufferAttribute",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"array",
",",
"inst",
".",
"itemSize",
",",
"inst",
".",
"dynamic",
",",
"inst",
".",
"updateRange",
"]",
";",
"}"
] | Property getter THREE.BufferAttribute | [
"Property",
"getter",
"THREE",
".",
"BufferAttribute"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L984-L990 |
50,425 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_PerspectiveCamera | function getter_THREE_PerspectiveCamera(inst) {
return [
inst.fov,
inst.aspect,
inst.near,
inst.far];
} | javascript | function getter_THREE_PerspectiveCamera(inst) {
return [
inst.fov,
inst.aspect,
inst.near,
inst.far];
} | [
"function",
"getter_THREE_PerspectiveCamera",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"fov",
",",
"inst",
".",
"aspect",
",",
"inst",
".",
"near",
",",
"inst",
".",
"far",
"]",
";",
"}"
] | Property getter THREE.PerspectiveCamera | [
"Property",
"getter",
"THREE",
".",
"PerspectiveCamera"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L1078-L1084 |
50,426 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_OrthographicCamera | function getter_THREE_OrthographicCamera(inst) {
return [
inst.left,
inst.right,
inst.top,
inst.bottom,
inst.near,
inst.far];
} | javascript | function getter_THREE_OrthographicCamera(inst) {
return [
inst.left,
inst.right,
inst.top,
inst.bottom,
inst.near,
inst.far];
} | [
"function",
"getter_THREE_OrthographicCamera",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"left",
",",
"inst",
".",
"right",
",",
"inst",
".",
"top",
",",
"inst",
".",
"bottom",
",",
"inst",
".",
"near",
",",
"inst",
".",
"far",
"]",
";",
"}"... | Property getter THREE.OrthographicCamera | [
"Property",
"getter",
"THREE",
".",
"OrthographicCamera"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L1089-L1097 |
50,427 | wavesoft/jbb-profile-three | profile-encode.js | getter_THREE_MD2Character | function getter_THREE_MD2Character(inst) {
return [
inst.scale,
inst.animationFPS,
inst.root,
inst.meshBody,
inst.skinsBody,
inst.meshWeapon,
inst.skinsWeapon,
inst.weapons,
inst.activeAnimation];
} | javascript | function getter_THREE_MD2Character(inst) {
return [
inst.scale,
inst.animationFPS,
inst.root,
inst.meshBody,
inst.skinsBody,
inst.meshWeapon,
inst.skinsWeapon,
inst.weapons,
inst.activeAnimation];
} | [
"function",
"getter_THREE_MD2Character",
"(",
"inst",
")",
"{",
"return",
"[",
"inst",
".",
"scale",
",",
"inst",
".",
"animationFPS",
",",
"inst",
".",
"root",
",",
"inst",
".",
"meshBody",
",",
"inst",
".",
"skinsBody",
",",
"inst",
".",
"meshWeapon",
... | Property getter THREE.MD2Character | [
"Property",
"getter",
"THREE",
".",
"MD2Character"
] | 8539cfbb2d04b67999eee6e530fcaf03083e0e04 | https://github.com/wavesoft/jbb-profile-three/blob/8539cfbb2d04b67999eee6e530fcaf03083e0e04/profile-encode.js#L1112-L1123 |
50,428 | Lindurion/closure-pro-build | lib/graph-util.js | addSetValues | function addSetValues(args) {
for (var key in args.from) {
if (args.from[key]) {
args.to[key] = true;
}
}
} | javascript | function addSetValues(args) {
for (var key in args.from) {
if (args.from[key]) {
args.to[key] = true;
}
}
} | [
"function",
"addSetValues",
"(",
"args",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"args",
".",
"from",
")",
"{",
"if",
"(",
"args",
".",
"from",
"[",
"key",
"]",
")",
"{",
"args",
".",
"to",
"[",
"key",
"]",
"=",
"true",
";",
"}",
"}",
"}"
] | Makes 'to' the set union of 'from' and 'to'.
@param {!{from: !Object.<string, boolean>, to: !Object.<string, boolean>}}
args | [
"Makes",
"to",
"the",
"set",
"union",
"of",
"from",
"and",
"to",
"."
] | c279d0fcc3a65969d2fe965f55e627b074792f1a | https://github.com/Lindurion/closure-pro-build/blob/c279d0fcc3a65969d2fe965f55e627b074792f1a/lib/graph-util.js#L32-L38 |
50,429 | sendanor/nor-errors | src/HTTPError.js | HTTPError | function HTTPError() {
var args = Array.prototype.slice.call(arguments);
if(!(this instanceof HTTPError)) {
if(args.length === 1) {
return new HTTPError(args[0]);
} else if(args.length === 2) {
return new HTTPError(args[0], args[1]);
} else if(args.length === 3) {
return new HTTPError(args[0], args[1],... | javascript | function HTTPError() {
var args = Array.prototype.slice.call(arguments);
if(!(this instanceof HTTPError)) {
if(args.length === 1) {
return new HTTPError(args[0]);
} else if(args.length === 2) {
return new HTTPError(args[0], args[1]);
} else if(args.length === 3) {
return new HTTPError(args[0], args[1],... | [
"function",
"HTTPError",
"(",
")",
"{",
"var",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
";",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"HTTPError",
")",
")",
"{",
"if",
"(",
"args",
".",
"length",
"... | Exception type for HTTP errors | [
"Exception",
"type",
"for",
"HTTP",
"errors"
] | 17e0f00816db53023fcae4847ed7ce67e993ddbf | https://github.com/sendanor/nor-errors/blob/17e0f00816db53023fcae4847ed7ce67e993ddbf/src/HTTPError.js#L10-L46 |
50,430 | nodejitsu/packages-pagelet | resolve.js | reduce | function reduce(data, fn) {
delete data.package.readmeFilename; // README is already parsed.
delete data.package.versions; // Adds to much bloat.
delete data.package.readme; // README is already parsed.
//
// Remove circular references as it would prevent us from caching in Redis or
// ... | javascript | function reduce(data, fn) {
delete data.package.readmeFilename; // README is already parsed.
delete data.package.versions; // Adds to much bloat.
delete data.package.readme; // README is already parsed.
//
// Remove circular references as it would prevent us from caching in Redis or
// ... | [
"function",
"reduce",
"(",
"data",
",",
"fn",
")",
"{",
"delete",
"data",
".",
"package",
".",
"readmeFilename",
";",
"// README is already parsed.",
"delete",
"data",
".",
"package",
".",
"versions",
";",
"// Adds to much bloat.",
"delete",
"data",
".",
"packag... | Reduce the massive data structure to something useful.
@param {Object} data The received data structure.
@param {Function} fn The callback.
@api private | [
"Reduce",
"the",
"massive",
"data",
"structure",
"to",
"something",
"useful",
"."
] | 10c4bdb1a99a808b58e41d87c8e7ec8c9947a3d8 | https://github.com/nodejitsu/packages-pagelet/blob/10c4bdb1a99a808b58e41d87c8e7ec8c9947a3d8/resolve.js#L105-L160 |
50,431 | nodejitsu/packages-pagelet | resolve.js | clients | function clients(options) {
options = options || {};
options.registry = options.registry || Registry.mirrors.nodejitsu;
var githulk = options.githulk || new GitHulk();
//
// Only create a new Registry instance if we've been supplied with a string.
//
var npm = 'string' !== typeof options.registry
? ... | javascript | function clients(options) {
options = options || {};
options.registry = options.registry || Registry.mirrors.nodejitsu;
var githulk = options.githulk || new GitHulk();
//
// Only create a new Registry instance if we've been supplied with a string.
//
var npm = 'string' !== typeof options.registry
? ... | [
"function",
"clients",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"options",
".",
"registry",
"=",
"options",
".",
"registry",
"||",
"Registry",
".",
"mirrors",
".",
"nodejitsu",
";",
"var",
"githulk",
"=",
"options",
".",
... | Simple helper function to get a working npm and githulk client.
@param {Object} options Configuration.
@returns {Object} Pre-configured npm and git.
@api private | [
"Simple",
"helper",
"function",
"to",
"get",
"a",
"working",
"npm",
"and",
"githulk",
"client",
"."
] | 10c4bdb1a99a808b58e41d87c8e7ec8c9947a3d8 | https://github.com/nodejitsu/packages-pagelet/blob/10c4bdb1a99a808b58e41d87c8e7ec8c9947a3d8/resolve.js#L169-L189 |
50,432 | ayan4m1/pg-redis | dist/index.js | function(text, options) {
var execute, queried;
queried = p.defer();
// caching disabled unless duration is specified
options = options != null ? options : {
duration: 0
};
execute = function(params) {
return db.prepare(text).then(function(stmt) {
return stmt.execute(params).... | javascript | function(text, options) {
var execute, queried;
queried = p.defer();
// caching disabled unless duration is specified
options = options != null ? options : {
duration: 0
};
execute = function(params) {
return db.prepare(text).then(function(stmt) {
return stmt.execute(params).... | [
"function",
"(",
"text",
",",
"options",
")",
"{",
"var",
"execute",
",",
"queried",
";",
"queried",
"=",
"p",
".",
"defer",
"(",
")",
";",
"// caching disabled unless duration is specified",
"options",
"=",
"options",
"!=",
"null",
"?",
"options",
":",
"{",... | expose simplified, cache-enabled api | [
"expose",
"simplified",
"cache",
"-",
"enabled",
"api"
] | 131b1a7e566bfc73472bd53e42a07a753ed1b528 | https://github.com/ayan4m1/pg-redis/blob/131b1a7e566bfc73472bd53e42a07a753ed1b528/dist/index.js#L14-L42 | |
50,433 | feedhenry/fh-mbaas-middleware | lib/middleware/app.js | findOrCreateMbaasApp | function findOrCreateMbaasApp(req, res, next){
log.logger.debug("findOrCreateMbaasApp ", req.params);
var models = mbaas.getModels();
//Checking For Required Params
var missingParams = _.filter(["appGuid", "apiKey", "coreHost"], function(requiredKey){
return validation.validateParamPresent(requiredKey, re... | javascript | function findOrCreateMbaasApp(req, res, next){
log.logger.debug("findOrCreateMbaasApp ", req.params);
var models = mbaas.getModels();
//Checking For Required Params
var missingParams = _.filter(["appGuid", "apiKey", "coreHost"], function(requiredKey){
return validation.validateParamPresent(requiredKey, re... | [
"function",
"findOrCreateMbaasApp",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"log",
".",
"logger",
".",
"debug",
"(",
"\"findOrCreateMbaasApp \"",
",",
"req",
".",
"params",
")",
";",
"var",
"models",
"=",
"mbaas",
".",
"getModels",
"(",
")",
";",
... | Middleware To Find Or Create An Mbaas App
@param req
@param res
@param next | [
"Middleware",
"To",
"Find",
"Or",
"Create",
"An",
"Mbaas",
"App"
] | f906e98efbb4b0963bf5137b34b5e0589ba24e69 | https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/app.js#L14-L65 |
50,434 | feedhenry/fh-mbaas-middleware | lib/middleware/app.js | findMbaasApp | function findMbaasApp(req, res, next){
log.logger.debug("findMbaasApp for appname " + req.params.appname);
getMbaasApp({
'$or': [{name: req.params.appname}, {guid: req.params.appname}]
}, function(err, appMbaas){
if(err){
log.logger.debug("findMbaasApp Error ", err);
return next(err);
}
... | javascript | function findMbaasApp(req, res, next){
log.logger.debug("findMbaasApp for appname " + req.params.appname);
getMbaasApp({
'$or': [{name: req.params.appname}, {guid: req.params.appname}]
}, function(err, appMbaas){
if(err){
log.logger.debug("findMbaasApp Error ", err);
return next(err);
}
... | [
"function",
"findMbaasApp",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"log",
".",
"logger",
".",
"debug",
"(",
"\"findMbaasApp for appname \"",
"+",
"req",
".",
"params",
".",
"appname",
")",
";",
"getMbaasApp",
"(",
"{",
"'$or'",
":",
"[",
"{",
"... | Middleware For Finding An App
@param req
@param res
@param next | [
"Middleware",
"For",
"Finding",
"An",
"App"
] | f906e98efbb4b0963bf5137b34b5e0589ba24e69 | https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/app.js#L73-L87 |
50,435 | feedhenry/fh-mbaas-middleware | lib/middleware/app.js | getMbaasApp | function getMbaasApp(params, cb){
var models = mbaas.getModels();
models.AppMbaas.findOne(params, cb);
} | javascript | function getMbaasApp(params, cb){
var models = mbaas.getModels();
models.AppMbaas.findOne(params, cb);
} | [
"function",
"getMbaasApp",
"(",
"params",
",",
"cb",
")",
"{",
"var",
"models",
"=",
"mbaas",
".",
"getModels",
"(",
")",
";",
"models",
".",
"AppMbaas",
".",
"findOne",
"(",
"params",
",",
"cb",
")",
";",
"}"
] | Function to get an mbaas app model. | [
"Function",
"to",
"get",
"an",
"mbaas",
"app",
"model",
"."
] | f906e98efbb4b0963bf5137b34b5e0589ba24e69 | https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/app.js#L90-L93 |
50,436 | feedhenry/fh-mbaas-middleware | lib/middleware/app.js | updateMbaasApp | function updateMbaasApp(req, res, next){
var model = req.appMbaasModel;
model.name = req.params.appname;
model.domain = req.params.domain;
model.environment = req.params.environment;
model.guid = req.body.appGuid;
model.apiKey = req.body.apiKey;
model.coreHost = req.body.coreHost;
model.type = req.body... | javascript | function updateMbaasApp(req, res, next){
var model = req.appMbaasModel;
model.name = req.params.appname;
model.domain = req.params.domain;
model.environment = req.params.environment;
model.guid = req.body.appGuid;
model.apiKey = req.body.apiKey;
model.coreHost = req.body.coreHost;
model.type = req.body... | [
"function",
"updateMbaasApp",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"var",
"model",
"=",
"req",
".",
"appMbaasModel",
";",
"model",
".",
"name",
"=",
"req",
".",
"params",
".",
"appname",
";",
"model",
".",
"domain",
"=",
"req",
".",
"params... | Middleware To Update An Existing App Deployment
@param req
@param res
@param next | [
"Middleware",
"To",
"Update",
"An",
"Existing",
"App",
"Deployment"
] | f906e98efbb4b0963bf5137b34b5e0589ba24e69 | https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/app.js#L101-L118 |
50,437 | redisjs/jsr-server | lib/command/transaction/discard.js | execute | function execute(req, res) {
// unwatch keys, clear references,
// and destroy the transaction reference on the conn
// and send the reply
req.conn.transaction.destroy(req, res, null, Constants.OK);
} | javascript | function execute(req, res) {
// unwatch keys, clear references,
// and destroy the transaction reference on the conn
// and send the reply
req.conn.transaction.destroy(req, res, null, Constants.OK);
} | [
"function",
"execute",
"(",
"req",
",",
"res",
")",
"{",
"// unwatch keys, clear references,",
"// and destroy the transaction reference on the conn",
"// and send the reply",
"req",
".",
"conn",
".",
"transaction",
".",
"destroy",
"(",
"req",
",",
"res",
",",
"null",
... | Respond to the DISCARD command. | [
"Respond",
"to",
"the",
"DISCARD",
"command",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/transaction/discard.js#L19-L24 |
50,438 | redisjs/jsr-server | lib/command/transaction/discard.js | validate | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
if(!info.conn.transaction) {
throw DiscardWithoutMulti;
}
} | javascript | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
if(!info.conn.transaction) {
throw DiscardWithoutMulti;
}
} | [
"function",
"validate",
"(",
"cmd",
",",
"args",
",",
"info",
")",
"{",
"AbstractCommand",
".",
"prototype",
".",
"validate",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"if",
"(",
"!",
"info",
".",
"conn",
".",
"transaction",
")",
"{",
"t... | Validate the DISCARD command. | [
"Validate",
"the",
"DISCARD",
"command",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/transaction/discard.js#L29-L34 |
50,439 | ottojs/otto-errors | lib/unauthorized.error.js | ErrorUnauthorized | function ErrorUnauthorized (message) {
Error.call(this);
// Add Information
this.name = 'ErrorUnauthorized';
this.type = 'client';
this.status = 401;
if (message) {
this.message = message;
}
} | javascript | function ErrorUnauthorized (message) {
Error.call(this);
// Add Information
this.name = 'ErrorUnauthorized';
this.type = 'client';
this.status = 401;
if (message) {
this.message = message;
}
} | [
"function",
"ErrorUnauthorized",
"(",
"message",
")",
"{",
"Error",
".",
"call",
"(",
"this",
")",
";",
"// Add Information",
"this",
".",
"name",
"=",
"'ErrorUnauthorized'",
";",
"this",
".",
"type",
"=",
"'client'",
";",
"this",
".",
"status",
"=",
"401"... | Error - ErrorUnauthorized | [
"Error",
"-",
"ErrorUnauthorized"
] | a3c6d98fd5d35ce3c136ed7e1edd2f800af268d9 | https://github.com/ottojs/otto-errors/blob/a3c6d98fd5d35ce3c136ed7e1edd2f800af268d9/lib/unauthorized.error.js#L8-L20 |
50,440 | skylarklangx/skylark-langx | dist/uncompressed/skylark-langx/objects.js | allKeys | function allKeys(obj) {
if (!isObject(obj)) return [];
var keys = [];
for (var key in obj) keys.push(key);
return keys;
} | javascript | function allKeys(obj) {
if (!isObject(obj)) return [];
var keys = [];
for (var key in obj) keys.push(key);
return keys;
} | [
"function",
"allKeys",
"(",
"obj",
")",
"{",
"if",
"(",
"!",
"isObject",
"(",
"obj",
")",
")",
"return",
"[",
"]",
";",
"var",
"keys",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"key",
"in",
"obj",
")",
"keys",
".",
"push",
"(",
"key",
")",
";",
... | Retrieve all the property names of an object. | [
"Retrieve",
"all",
"the",
"property",
"names",
"of",
"an",
"object",
"."
] | 49a5ca4de8d292a0fb902564566af8e149ac4e65 | https://github.com/skylarklangx/skylark-langx/blob/49a5ca4de8d292a0fb902564566af8e149ac4e65/dist/uncompressed/skylark-langx/objects.js#L144-L149 |
50,441 | folktale/core.inspect | index.js | showArray | function showArray(maxDepth, array) {
return '['
+ array.map(function(a) {
return show(maxDepth - 1, a)
}).join(', ')
+ ']';
} | javascript | function showArray(maxDepth, array) {
return '['
+ array.map(function(a) {
return show(maxDepth - 1, a)
}).join(', ')
+ ']';
} | [
"function",
"showArray",
"(",
"maxDepth",
",",
"array",
")",
"{",
"return",
"'['",
"+",
"array",
".",
"map",
"(",
"function",
"(",
"a",
")",
"{",
"return",
"show",
"(",
"maxDepth",
"-",
"1",
",",
"a",
")",
"}",
")",
".",
"join",
"(",
"', '",
")",... | Displays the representation of an array.
@method
@private
@summary Number → [α] → String | [
"Displays",
"the",
"representation",
"of",
"an",
"array",
"."
] | aaf5cab00abbcaa3e5140e9f9581a2c4c7ffb57c | https://github.com/folktale/core.inspect/blob/aaf5cab00abbcaa3e5140e9f9581a2c4c7ffb57c/index.js#L118-L124 |
50,442 | folktale/core.inspect | index.js | showObject | function showObject(maxDepth, object) {
return '{'
+ pairs(object).map(function(pair){
return showString(pair.key) + ': ' + show(maxDepth - 1, pair.value)
}).join(', ')
+ '}'
} | javascript | function showObject(maxDepth, object) {
return '{'
+ pairs(object).map(function(pair){
return showString(pair.key) + ': ' + show(maxDepth - 1, pair.value)
}).join(', ')
+ '}'
} | [
"function",
"showObject",
"(",
"maxDepth",
",",
"object",
")",
"{",
"return",
"'{'",
"+",
"pairs",
"(",
"object",
")",
".",
"map",
"(",
"function",
"(",
"pair",
")",
"{",
"return",
"showString",
"(",
"pair",
".",
"key",
")",
"+",
"': '",
"+",
"show",... | Displays the representation of an object.
@method
@private
@summary Number → { String → * } → String | [
"Displays",
"the",
"representation",
"of",
"an",
"object",
"."
] | aaf5cab00abbcaa3e5140e9f9581a2c4c7ffb57c | https://github.com/folktale/core.inspect/blob/aaf5cab00abbcaa3e5140e9f9581a2c4c7ffb57c/index.js#L133-L139 |
50,443 | avetjs/avet-styled-jsx | lib/utils.js | styledJsxOptions | function styledJsxOptions(opts) {
if (!opts) {
return {};
}
if (!Array.isArray(opts.plugins)) {
return opts;
}
opts.plugins = opts.plugins.map(plugin => {
if (Array.isArray(plugin)) {
const [ name, options ] = plugin;
return [ require.resolve(name), options ];
}
return requi... | javascript | function styledJsxOptions(opts) {
if (!opts) {
return {};
}
if (!Array.isArray(opts.plugins)) {
return opts;
}
opts.plugins = opts.plugins.map(plugin => {
if (Array.isArray(plugin)) {
const [ name, options ] = plugin;
return [ require.resolve(name), options ];
}
return requi... | [
"function",
"styledJsxOptions",
"(",
"opts",
")",
"{",
"if",
"(",
"!",
"opts",
")",
"{",
"return",
"{",
"}",
";",
"}",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"opts",
".",
"plugins",
")",
")",
"{",
"return",
"opts",
";",
"}",
"opts",
".",
... | Resolve styled-jsx plugins | [
"Resolve",
"styled",
"-",
"jsx",
"plugins"
] | 306fb476b65f978110ac60291e0893dc3d0556c7 | https://github.com/avetjs/avet-styled-jsx/blob/306fb476b65f978110ac60291e0893dc3d0556c7/lib/utils.js#L2-L21 |
50,444 | derdesign/protos | drivers/mongodb.js | MongoDB | function MongoDB(config) {
var self = this;
this.events = new EventEmitter();
config = protos.extend({
host: 'localhost',
port: 27017,
database: 'default',
storage: null,
username: '',
password: '',
safe: true
}, config || {});
if (typeof confi... | javascript | function MongoDB(config) {
var self = this;
this.events = new EventEmitter();
config = protos.extend({
host: 'localhost',
port: 27017,
database: 'default',
storage: null,
username: '',
password: '',
safe: true
}, config || {});
if (typeof confi... | [
"function",
"MongoDB",
"(",
"config",
")",
"{",
"var",
"self",
"=",
"this",
";",
"this",
".",
"events",
"=",
"new",
"EventEmitter",
"(",
")",
";",
"config",
"=",
"protos",
".",
"extend",
"(",
"{",
"host",
":",
"'localhost'",
",",
"port",
":",
"27017"... | MongoDB Driver class
@class MongoDB
@extends Driver
@constructor
@param {object} app Application instance
@param {object} config Driver configuration | [
"MongoDB",
"Driver",
"class"
] | 0b679b2a7581dfbb5d065fd4b0914436ef4ef2c9 | https://github.com/derdesign/protos/blob/0b679b2a7581dfbb5d065fd4b0914436ef4ef2c9/drivers/mongodb.js#L25-L123 |
50,445 | andrewscwei/requiem | src/helpers/debounce.js | debounce | function debounce(method, delay, leading) {
assertType(method, 'function', false, 'Invalid parameter: method');
assertType(delay, 'number', true, 'Invalid optional parameter: delay');
assertType(leading, 'boolean', true, 'Invalid optional parameter: leading');
if (delay === undefined) delay = 0;
if (leading ... | javascript | function debounce(method, delay, leading) {
assertType(method, 'function', false, 'Invalid parameter: method');
assertType(delay, 'number', true, 'Invalid optional parameter: delay');
assertType(leading, 'boolean', true, 'Invalid optional parameter: leading');
if (delay === undefined) delay = 0;
if (leading ... | [
"function",
"debounce",
"(",
"method",
",",
"delay",
",",
"leading",
")",
"{",
"assertType",
"(",
"method",
",",
"'function'",
",",
"false",
",",
"'Invalid parameter: method'",
")",
";",
"assertType",
"(",
"delay",
",",
"'number'",
",",
"true",
",",
"'Invali... | Returns a function that, as long as it continues to be invoked, will not be
triggered. The function will be called after it stops being called for N
milliseconds. If 'leading' is passed, the function will be triggered on the
leading edge instead of the trailing.
@param {Function} method - Method to be debounced.
@para... | [
"Returns",
"a",
"function",
"that",
"as",
"long",
"as",
"it",
"continues",
"to",
"be",
"invoked",
"will",
"not",
"be",
"triggered",
".",
"The",
"function",
"will",
"be",
"called",
"after",
"it",
"stops",
"being",
"called",
"for",
"N",
"milliseconds",
".",
... | c4182bfffc9841c6de5718f689ad3c2060511777 | https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/helpers/debounce.js#L23-L48 |
50,446 | rearjs/rear | packages/rear-sql/query.js | exec | function exec(sqlQuery, poolName) {
return new Promise((resolve, reject) => {
db.connect((err, client, done) => {
if (err) {
reject(err);
}
client.query(sqlQuery, (err, results) => {
if (err) {
reject(err);
}
resolve(results);
});
}, poolName |... | javascript | function exec(sqlQuery, poolName) {
return new Promise((resolve, reject) => {
db.connect((err, client, done) => {
if (err) {
reject(err);
}
client.query(sqlQuery, (err, results) => {
if (err) {
reject(err);
}
resolve(results);
});
}, poolName |... | [
"function",
"exec",
"(",
"sqlQuery",
",",
"poolName",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"db",
".",
"connect",
"(",
"(",
"err",
",",
"client",
",",
"done",
")",
"=>",
"{",
"if",
"(",
"err",
"... | Execute a sql query with pg.Pool
@param {ParametizedQuery} sqlQuery Parametized pg query object
@return {Promise<Object>} Resolve with query results
@example
const query = require('./query')
const SQL = query.SQL
const id = 2
query.exec(SQL`SELECT * FROM "Users" WHERE id = ${id}`)
.then((result) => {
co... | [
"Execute",
"a",
"sql",
"query",
"with",
"pg",
".",
"Pool"
] | 0b4a1fa42653a1b9ef200994cc9eef49baa43052 | https://github.com/rearjs/rear/blob/0b4a1fa42653a1b9ef200994cc9eef49baa43052/packages/rear-sql/query.js#L49-L63 |
50,447 | koumoul-dev/sd-express | index.js | _cors | function _cors (cookieDomain, publicUrl) {
return ({ acceptServers, acceptAllOrigins }) => {
// accept server 2 server requests by default
acceptServers = acceptServers === undefined ? true : acceptServers
// do not accept call by outside origins by default
acceptAllOrigins = acceptAllOrigins === unde... | javascript | function _cors (cookieDomain, publicUrl) {
return ({ acceptServers, acceptAllOrigins }) => {
// accept server 2 server requests by default
acceptServers = acceptServers === undefined ? true : acceptServers
// do not accept call by outside origins by default
acceptAllOrigins = acceptAllOrigins === unde... | [
"function",
"_cors",
"(",
"cookieDomain",
",",
"publicUrl",
")",
"{",
"return",
"(",
"{",
"acceptServers",
",",
"acceptAllOrigins",
"}",
")",
"=>",
"{",
"// accept server 2 server requests by default",
"acceptServers",
"=",
"acceptServers",
"===",
"undefined",
"?",
... | Return a function that can build a CORS middleware | [
"Return",
"a",
"function",
"that",
"can",
"build",
"a",
"CORS",
"middleware"
] | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L61-L95 |
50,448 | koumoul-dev/sd-express | index.js | _getCookieToken | function _getCookieToken (cookies, req, cookieName, cookieDomain, publicUrl) {
let token = cookies.get(cookieName)
if (!token) return null
const reqOrigin = req.headers['origin']
const originDomain = reqOrigin && new URL(reqOrigin).host
// check that the origin of the request is part of the accepted domain
... | javascript | function _getCookieToken (cookies, req, cookieName, cookieDomain, publicUrl) {
let token = cookies.get(cookieName)
if (!token) return null
const reqOrigin = req.headers['origin']
const originDomain = reqOrigin && new URL(reqOrigin).host
// check that the origin of the request is part of the accepted domain
... | [
"function",
"_getCookieToken",
"(",
"cookies",
",",
"req",
",",
"cookieName",
",",
"cookieDomain",
",",
"publicUrl",
")",
"{",
"let",
"token",
"=",
"cookies",
".",
"get",
"(",
"cookieName",
")",
"if",
"(",
"!",
"token",
")",
"return",
"null",
"const",
"r... | Fetch a session token from cookies if the same site policy is respected | [
"Fetch",
"a",
"session",
"token",
"from",
"cookies",
"if",
"the",
"same",
"site",
"policy",
"is",
"respected"
] | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L98-L123 |
50,449 | koumoul-dev/sd-express | index.js | _setCookieToken | function _setCookieToken (cookies, cookieName, cookieDomain, token, payload) {
const parts = token.split('.')
const opts = { sameSite: 'lax', expires: new Date(payload.exp * 1000) }
if (cookieDomain) {
opts.domain = cookieDomain
// to support subdomains we can't use the sameSite opt
// we rely on our ... | javascript | function _setCookieToken (cookies, cookieName, cookieDomain, token, payload) {
const parts = token.split('.')
const opts = { sameSite: 'lax', expires: new Date(payload.exp * 1000) }
if (cookieDomain) {
opts.domain = cookieDomain
// to support subdomains we can't use the sameSite opt
// we rely on our ... | [
"function",
"_setCookieToken",
"(",
"cookies",
",",
"cookieName",
",",
"cookieDomain",
",",
"token",
",",
"payload",
")",
"{",
"const",
"parts",
"=",
"token",
".",
"split",
"(",
"'.'",
")",
"const",
"opts",
"=",
"{",
"sameSite",
":",
"'lax'",
",",
"expir... | Split JWT strategy, the signature is in a httpOnly cookie for XSS prevention the header and payload are not httpOnly to be readable by client all cookies use sameSite for CSRF prevention | [
"Split",
"JWT",
"strategy",
"the",
"signature",
"is",
"in",
"a",
"httpOnly",
"cookie",
"for",
"XSS",
"prevention",
"the",
"header",
"and",
"payload",
"are",
"not",
"httpOnly",
"to",
"be",
"readable",
"by",
"client",
"all",
"cookies",
"use",
"sameSite",
"for"... | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L128-L139 |
50,450 | koumoul-dev/sd-express | index.js | _setOrganization | function _setOrganization (cookies, cookieName, req, user) {
if (!user) return
// The order is important. The header can set explicitly on a query even if the cookie contradicts.
const organizationId = req.headers['x-organizationid'] || cookies.get(cookieName + '_org')
if (organizationId) {
user.organizatio... | javascript | function _setOrganization (cookies, cookieName, req, user) {
if (!user) return
// The order is important. The header can set explicitly on a query even if the cookie contradicts.
const organizationId = req.headers['x-organizationid'] || cookies.get(cookieName + '_org')
if (organizationId) {
user.organizatio... | [
"function",
"_setOrganization",
"(",
"cookies",
",",
"cookieName",
",",
"req",
",",
"user",
")",
"{",
"if",
"(",
"!",
"user",
")",
"return",
"// The order is important. The header can set explicitly on a query even if the cookie contradicts.",
"const",
"organizationId",
"="... | Use complementary cookie id_token_org to set the current active organization of the user also set consumerFlag that is used by applications to decide if they should ask confirmation to the user of the right quotas or other organization related context to apply it is 'user' if id_token_org is an empty string or is equal... | [
"Use",
"complementary",
"cookie",
"id_token_org",
"to",
"set",
"the",
"current",
"active",
"organization",
"of",
"the",
"user",
"also",
"set",
"consumerFlag",
"that",
"is",
"used",
"by",
"applications",
"to",
"decide",
"if",
"they",
"should",
"ask",
"confirmatio... | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L147-L160 |
50,451 | koumoul-dev/sd-express | index.js | _verifyToken | async function _verifyToken (jwksClient, token) {
const decoded = jwt.decode(token, { complete: true })
const signingKey = await jwksClient.getSigningKeyAsync(decoded.header.kid)
return jwt.verifyAsync(token, signingKey.publicKey || signingKey.rsaPublicKey)
} | javascript | async function _verifyToken (jwksClient, token) {
const decoded = jwt.decode(token, { complete: true })
const signingKey = await jwksClient.getSigningKeyAsync(decoded.header.kid)
return jwt.verifyAsync(token, signingKey.publicKey || signingKey.rsaPublicKey)
} | [
"async",
"function",
"_verifyToken",
"(",
"jwksClient",
",",
"token",
")",
"{",
"const",
"decoded",
"=",
"jwt",
".",
"decode",
"(",
"token",
",",
"{",
"complete",
":",
"true",
"}",
")",
"const",
"signingKey",
"=",
"await",
"jwksClient",
".",
"getSigningKey... | Fetch the public info of signing key from the directory that acts as jwks provider | [
"Fetch",
"the",
"public",
"info",
"of",
"signing",
"key",
"from",
"the",
"directory",
"that",
"acts",
"as",
"jwks",
"provider"
] | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L163-L167 |
50,452 | koumoul-dev/sd-express | index.js | _decode | function _decode (cookieName, cookieDomain, publicUrl) {
return (req, res, next) => {
// JWT in a cookie = already active session
const cookies = new Cookies(req, res)
const token = _getCookieToken(cookies, req, cookieName, cookieDomain, publicUrl)
if (token) {
req.user = jwt.decode(token)
... | javascript | function _decode (cookieName, cookieDomain, publicUrl) {
return (req, res, next) => {
// JWT in a cookie = already active session
const cookies = new Cookies(req, res)
const token = _getCookieToken(cookies, req, cookieName, cookieDomain, publicUrl)
if (token) {
req.user = jwt.decode(token)
... | [
"function",
"_decode",
"(",
"cookieName",
",",
"cookieDomain",
",",
"publicUrl",
")",
"{",
"return",
"(",
"req",
",",
"res",
",",
"next",
")",
"=>",
"{",
"// JWT in a cookie = already active session",
"const",
"cookies",
"=",
"new",
"Cookies",
"(",
"req",
",",... | This middleware checks if a user has an active session and defines req.user Contrary to auth it does not validate the token, only decode it.. so it faster but it is limited to routes where req.user is informative | [
"This",
"middleware",
"checks",
"if",
"a",
"user",
"has",
"an",
"active",
"session",
"and",
"defines",
"req",
".",
"user",
"Contrary",
"to",
"auth",
"it",
"does",
"not",
"validate",
"the",
"token",
"only",
"decode",
"it",
"..",
"so",
"it",
"faster",
"but... | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L208-L219 |
50,453 | koumoul-dev/sd-express | index.js | _auth | function _auth (privateDirectoryUrl, publicUrl, jwksClient, cookieName, cookieDomain, forceExchange) {
return asyncWrap(async (req, res, next) => {
// JWT in a cookie = already active session
const cookies = new Cookies(req, res)
const token = _getCookieToken(cookies, req, cookieName, cookieDomain, public... | javascript | function _auth (privateDirectoryUrl, publicUrl, jwksClient, cookieName, cookieDomain, forceExchange) {
return asyncWrap(async (req, res, next) => {
// JWT in a cookie = already active session
const cookies = new Cookies(req, res)
const token = _getCookieToken(cookies, req, cookieName, cookieDomain, public... | [
"function",
"_auth",
"(",
"privateDirectoryUrl",
",",
"publicUrl",
",",
"jwksClient",
",",
"cookieName",
",",
"cookieDomain",
",",
"forceExchange",
")",
"{",
"return",
"asyncWrap",
"(",
"async",
"(",
"req",
",",
"res",
",",
"next",
")",
"=>",
"{",
"// JWT in... | This middleware checks if a user has an active session with a valid token it defines req.user and it can extend the session if necessary. | [
"This",
"middleware",
"checks",
"if",
"a",
"user",
"has",
"an",
"active",
"session",
"with",
"a",
"valid",
"token",
"it",
"defines",
"req",
".",
"user",
"and",
"it",
"can",
"extend",
"the",
"session",
"if",
"necessary",
"."
] | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L223-L268 |
50,454 | koumoul-dev/sd-express | index.js | _login | function _login (directoryUrl, publicUrl) {
return (req, res) => {
res.redirect(directoryUrl + '/login?redirect=' + encodeURIComponent(req.query.redirect || publicUrl))
}
} | javascript | function _login (directoryUrl, publicUrl) {
return (req, res) => {
res.redirect(directoryUrl + '/login?redirect=' + encodeURIComponent(req.query.redirect || publicUrl))
}
} | [
"function",
"_login",
"(",
"directoryUrl",
",",
"publicUrl",
")",
"{",
"return",
"(",
"req",
",",
"res",
")",
"=>",
"{",
"res",
".",
"redirect",
"(",
"directoryUrl",
"+",
"'/login?redirect='",
"+",
"encodeURIComponent",
"(",
"req",
".",
"query",
".",
"redi... | Login is simply a link to the right page of the directory. Going to the directory through a redirect, not throug a link in UI allows us to send along some optional client id or any kind of trust enhancing secret | [
"Login",
"is",
"simply",
"a",
"link",
"to",
"the",
"right",
"page",
"of",
"the",
"directory",
".",
"Going",
"to",
"the",
"directory",
"through",
"a",
"redirect",
"not",
"throug",
"a",
"link",
"in",
"UI",
"allows",
"us",
"to",
"send",
"along",
"some",
"... | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L273-L277 |
50,455 | koumoul-dev/sd-express | index.js | _logout | function _logout (cookieName, cookieDomain) {
return (req, res) => {
const cookies = new Cookies(req, res)
cookies.set(cookieName, null, { domain: cookieDomain })
cookies.set(cookieName + '_sign', null, { domain: cookieDomain })
// case where the cookies were set before assigning domain
if (cookie... | javascript | function _logout (cookieName, cookieDomain) {
return (req, res) => {
const cookies = new Cookies(req, res)
cookies.set(cookieName, null, { domain: cookieDomain })
cookies.set(cookieName + '_sign', null, { domain: cookieDomain })
// case where the cookies were set before assigning domain
if (cookie... | [
"function",
"_logout",
"(",
"cookieName",
",",
"cookieDomain",
")",
"{",
"return",
"(",
"req",
",",
"res",
")",
"=>",
"{",
"const",
"cookies",
"=",
"new",
"Cookies",
"(",
"req",
",",
"res",
")",
"cookies",
".",
"set",
"(",
"cookieName",
",",
"null",
... | Sessions are only the persistence of the JWT token in cookies no need to call the directory | [
"Sessions",
"are",
"only",
"the",
"persistence",
"of",
"the",
"JWT",
"token",
"in",
"cookies",
"no",
"need",
"to",
"call",
"the",
"directory"
] | d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9 | https://github.com/koumoul-dev/sd-express/blob/d7da1af5b9bcf893d9f9f82a67668f0d4b8099f9/index.js#L281-L293 |
50,456 | francium/highlight-page | src/highlight-page.js | refineRangeBoundaries | function refineRangeBoundaries(range) {
let startContainer = range.startContainer,
endContainer = range.endContainer,
ancestor = range.commonAncestorContainer,
goDeeper = true;
if (range.endOffset === 0) {
while (!endContainer.previousSibling && endContainer.parentNode !== ances... | javascript | function refineRangeBoundaries(range) {
let startContainer = range.startContainer,
endContainer = range.endContainer,
ancestor = range.commonAncestorContainer,
goDeeper = true;
if (range.endOffset === 0) {
while (!endContainer.previousSibling && endContainer.parentNode !== ances... | [
"function",
"refineRangeBoundaries",
"(",
"range",
")",
"{",
"let",
"startContainer",
"=",
"range",
".",
"startContainer",
",",
"endContainer",
"=",
"range",
".",
"endContainer",
",",
"ancestor",
"=",
"range",
".",
"commonAncestorContainer",
",",
"goDeeper",
"=",
... | Takes range object as parameter and refines it boundaries
@param range
@returns {object} refined boundaries and initial state of highlighting algorithm. | [
"Takes",
"range",
"object",
"as",
"parameter",
"and",
"refines",
"it",
"boundaries"
] | 4e67fc531321f9987397dc247abba59b9d5ee521 | https://github.com/francium/highlight-page/blob/4e67fc531321f9987397dc247abba59b9d5ee521/src/highlight-page.js#L72-L111 |
50,457 | francium/highlight-page | src/highlight-page.js | groupHighlights | function groupHighlights(highlights) {
let order = [],
chunks = {},
grouped = [];
highlights.forEach(function (hl) {
let timestamp = hl.getAttribute(TIMESTAMP_ATTR);
if (typeof chunks[timestamp] === 'undefined') {
chunks[timestamp] = [];
order.push(times... | javascript | function groupHighlights(highlights) {
let order = [],
chunks = {},
grouped = [];
highlights.forEach(function (hl) {
let timestamp = hl.getAttribute(TIMESTAMP_ATTR);
if (typeof chunks[timestamp] === 'undefined') {
chunks[timestamp] = [];
order.push(times... | [
"function",
"groupHighlights",
"(",
"highlights",
")",
"{",
"let",
"order",
"=",
"[",
"]",
",",
"chunks",
"=",
"{",
"}",
",",
"grouped",
"=",
"[",
"]",
";",
"highlights",
".",
"forEach",
"(",
"function",
"(",
"hl",
")",
"{",
"let",
"timestamp",
"=",
... | Groups given highlights by timestamp.
@param {Array} highlights
@returns {Array} Grouped highlights. | [
"Groups",
"given",
"highlights",
"by",
"timestamp",
"."
] | 4e67fc531321f9987397dc247abba59b9d5ee521 | https://github.com/francium/highlight-page/blob/4e67fc531321f9987397dc247abba59b9d5ee521/src/highlight-page.js#L129-L160 |
50,458 | francium/highlight-page | src/highlight-page.js | function (nodesToAppend) {
let nodes = Array.prototype.slice.call(nodesToAppend);
for (let i = 0, len = nodes.length; i < len; ++i) {
el.appendChild(nodes[i]);
}
} | javascript | function (nodesToAppend) {
let nodes = Array.prototype.slice.call(nodesToAppend);
for (let i = 0, len = nodes.length; i < len; ++i) {
el.appendChild(nodes[i]);
}
} | [
"function",
"(",
"nodesToAppend",
")",
"{",
"let",
"nodes",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"nodesToAppend",
")",
";",
"for",
"(",
"let",
"i",
"=",
"0",
",",
"len",
"=",
"nodes",
".",
"length",
";",
"i",
"<",
"len",
... | Appends child nodes to base element.
@param {Node[]} nodesToAppend | [
"Appends",
"child",
"nodes",
"to",
"base",
"element",
"."
] | 4e67fc531321f9987397dc247abba59b9d5ee521 | https://github.com/francium/highlight-page/blob/4e67fc531321f9987397dc247abba59b9d5ee521/src/highlight-page.js#L214-L220 | |
50,459 | francium/highlight-page | src/highlight-page.js | function () {
if (!el) {
return;
}
if (el.nodeType === NODE_TYPE.TEXT_NODE) {
while (el.nextSibling && el.nextSibling.nodeType === NODE_TYPE.TEXT_NODE) {
el.nodeValue += el.nextSibling.nodeValue;
el.parentNode.r... | javascript | function () {
if (!el) {
return;
}
if (el.nodeType === NODE_TYPE.TEXT_NODE) {
while (el.nextSibling && el.nextSibling.nodeType === NODE_TYPE.TEXT_NODE) {
el.nodeValue += el.nextSibling.nodeValue;
el.parentNode.r... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"el",
")",
"{",
"return",
";",
"}",
"if",
"(",
"el",
".",
"nodeType",
"===",
"NODE_TYPE",
".",
"TEXT_NODE",
")",
"{",
"while",
"(",
"el",
".",
"nextSibling",
"&&",
"el",
".",
"nextSibling",
".",
"nodeType"... | Normalizes text nodes within base element, ie. merges sibling text nodes and assures that every
element node has only one text node.
It should does the same as standard element.normalize, but IE implements it incorrectly. | [
"Normalizes",
"text",
"nodes",
"within",
"base",
"element",
"ie",
".",
"merges",
"sibling",
"text",
"nodes",
"and",
"assures",
"that",
"every",
"element",
"node",
"has",
"only",
"one",
"text",
"node",
".",
"It",
"should",
"does",
"the",
"same",
"as",
"stan... | 4e67fc531321f9987397dc247abba59b9d5ee521 | https://github.com/francium/highlight-page/blob/4e67fc531321f9987397dc247abba59b9d5ee521/src/highlight-page.js#L308-L322 | |
50,460 | francium/highlight-page | src/highlight-page.js | function () {
let selection = dom(el).getSelection(),
range;
if (selection.rangeCount > 0) {
range = selection.getRangeAt(0);
}
return range;
} | javascript | function () {
let selection = dom(el).getSelection(),
range;
if (selection.rangeCount > 0) {
range = selection.getRangeAt(0);
}
return range;
} | [
"function",
"(",
")",
"{",
"let",
"selection",
"=",
"dom",
"(",
"el",
")",
".",
"getSelection",
"(",
")",
",",
"range",
";",
"if",
"(",
"selection",
".",
"rangeCount",
">",
"0",
")",
"{",
"range",
"=",
"selection",
".",
"getRangeAt",
"(",
"0",
")",... | Returns first range of the window of base element.
@returns {Range} | [
"Returns",
"first",
"range",
"of",
"the",
"window",
"of",
"base",
"element",
"."
] | 4e67fc531321f9987397dc247abba59b9d5ee521 | https://github.com/francium/highlight-page/blob/4e67fc531321f9987397dc247abba59b9d5ee521/src/highlight-page.js#L347-L356 | |
50,461 | insacjs/field-creator | lib/class/Field.js | _isTHIS | function _isTHIS (obj) {
if (obj && obj._this && (obj._this === true)) {
return true
}
return false
} | javascript | function _isTHIS (obj) {
if (obj && obj._this && (obj._this === true)) {
return true
}
return false
} | [
"function",
"_isTHIS",
"(",
"obj",
")",
"{",
"if",
"(",
"obj",
"&&",
"obj",
".",
"_this",
"&&",
"(",
"obj",
".",
"_this",
"===",
"true",
")",
")",
"{",
"return",
"true",
"}",
"return",
"false",
"}"
] | Indica si un objeto es una referencia THIS.
@param {Object} obj - Objeto.
@return {Boolean} | [
"Indica",
"si",
"un",
"objeto",
"es",
"una",
"referencia",
"THIS",
"."
] | bbba706852966b61658288d9b42659fdc42f342b | https://github.com/insacjs/field-creator/blob/bbba706852966b61658288d9b42659fdc42f342b/lib/class/Field.js#L245-L250 |
50,462 | insacjs/field-creator | lib/class/Field.js | _isField | function _isField (obj) {
if (obj && obj._modelAttribute && (obj._modelAttribute === true)) {
return true
}
return false
} | javascript | function _isField (obj) {
if (obj && obj._modelAttribute && (obj._modelAttribute === true)) {
return true
}
return false
} | [
"function",
"_isField",
"(",
"obj",
")",
"{",
"if",
"(",
"obj",
"&&",
"obj",
".",
"_modelAttribute",
"&&",
"(",
"obj",
".",
"_modelAttribute",
"===",
"true",
")",
")",
"{",
"return",
"true",
"}",
"return",
"false",
"}"
] | Indica si un objeto es atributo de un modelo.
@param {Object} obj - Objeto.
@return {Boolean} | [
"Indica",
"si",
"un",
"objeto",
"es",
"atributo",
"de",
"un",
"modelo",
"."
] | bbba706852966b61658288d9b42659fdc42f342b | https://github.com/insacjs/field-creator/blob/bbba706852966b61658288d9b42659fdc42f342b/lib/class/Field.js#L257-L262 |
50,463 | insacjs/field-creator | lib/class/Field.js | _updateTHIS | function _updateTHIS (model, obj) {
const RESULT = {}
if (Array.isArray(obj)) {
return [_updateTHIS(model, obj[0])]
}
Object.keys(obj).forEach(prop => {
const OBJ = obj[prop]
if (_isTHIS(OBJ)) {
delete OBJ._this
RESULT[prop] = Object.assign(_.cloneDeep(model.attributes[prop]), OBJ)
... | javascript | function _updateTHIS (model, obj) {
const RESULT = {}
if (Array.isArray(obj)) {
return [_updateTHIS(model, obj[0])]
}
Object.keys(obj).forEach(prop => {
const OBJ = obj[prop]
if (_isTHIS(OBJ)) {
delete OBJ._this
RESULT[prop] = Object.assign(_.cloneDeep(model.attributes[prop]), OBJ)
... | [
"function",
"_updateTHIS",
"(",
"model",
",",
"obj",
")",
"{",
"const",
"RESULT",
"=",
"{",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"obj",
")",
")",
"{",
"return",
"[",
"_updateTHIS",
"(",
"model",
",",
"obj",
"[",
"0",
"]",
")",
"]",
"}",
... | Devuelve un objeto cuyos campos han sido definidos como THIS, con el valor que le corresponde.
Si el atributo no tiene un fieldName, se le asigna uno.
@param {SequelizeModel} model - Modelo Sequelize
@param {Object} obj - Objeto (grupo de fields).
@return {Object} | [
"Devuelve",
"un",
"objeto",
"cuyos",
"campos",
"han",
"sido",
"definidos",
"como",
"THIS",
"con",
"el",
"valor",
"que",
"le",
"corresponde",
".",
"Si",
"el",
"atributo",
"no",
"tiene",
"un",
"fieldName",
"se",
"le",
"asigna",
"uno",
"."
] | bbba706852966b61658288d9b42659fdc42f342b | https://github.com/insacjs/field-creator/blob/bbba706852966b61658288d9b42659fdc42f342b/lib/class/Field.js#L271-L295 |
50,464 | insacjs/field-creator | lib/class/Field.js | _createValidate | function _createValidate (type, defaultValidate = {}, customValidate) {
if (customValidate === null) { return null }
let val = {}
if (type.key === 'STRING') { val = { len: [0, type.options.length] } }
if (type.key === 'TEXT') { val = { len: [0, 2147483647] } }
if (type.key === 'INTEGER') { val = { isIn... | javascript | function _createValidate (type, defaultValidate = {}, customValidate) {
if (customValidate === null) { return null }
let val = {}
if (type.key === 'STRING') { val = { len: [0, type.options.length] } }
if (type.key === 'TEXT') { val = { len: [0, 2147483647] } }
if (type.key === 'INTEGER') { val = { isIn... | [
"function",
"_createValidate",
"(",
"type",
",",
"defaultValidate",
"=",
"{",
"}",
",",
"customValidate",
")",
"{",
"if",
"(",
"customValidate",
"===",
"null",
")",
"{",
"return",
"null",
"}",
"let",
"val",
"=",
"{",
"}",
"if",
"(",
"type",
".",
"key",... | Devuelve un objeto validate.
@param {!SequelizeType} type - Propiedad tipo del atributo de un modelo sequelize.
@param {Object} [defaultValidate] - Propiedad validate por defecto.
@param {Object} [customValidate] - Propiedad validate personalizado.
@return {Object} | [
"Devuelve",
"un",
"objeto",
"validate",
"."
] | bbba706852966b61658288d9b42659fdc42f342b | https://github.com/insacjs/field-creator/blob/bbba706852966b61658288d9b42659fdc42f342b/lib/class/Field.js#L304-L323 |
50,465 | insacjs/field-creator | lib/class/Field.js | _normalizeValidate | function _normalizeValidate (field) {
if (field.validate) {
Object.keys(field.validate).forEach(key => {
let validateItem = field.validate[key]
if (typeof validateItem === 'function') { return }
// Adiciona la propiedad args, si el validador no lo tuviera.
// Ejemplo: min: 10 -> min... | javascript | function _normalizeValidate (field) {
if (field.validate) {
Object.keys(field.validate).forEach(key => {
let validateItem = field.validate[key]
if (typeof validateItem === 'function') { return }
// Adiciona la propiedad args, si el validador no lo tuviera.
// Ejemplo: min: 10 -> min... | [
"function",
"_normalizeValidate",
"(",
"field",
")",
"{",
"if",
"(",
"field",
".",
"validate",
")",
"{",
"Object",
".",
"keys",
"(",
"field",
".",
"validate",
")",
".",
"forEach",
"(",
"key",
"=>",
"{",
"let",
"validateItem",
"=",
"field",
".",
"valida... | Normaliza la propiedad validate.
@param {Object} field Atributo de un modelo sequelize. | [
"Normaliza",
"la",
"propiedad",
"validate",
"."
] | bbba706852966b61658288d9b42659fdc42f342b | https://github.com/insacjs/field-creator/blob/bbba706852966b61658288d9b42659fdc42f342b/lib/class/Field.js#L404-L430 |
50,466 | expedit85/valichain | index.js | function(v) {
return _.isNil(v) || (_.isString(v) && _.isEmpty(v));
} | javascript | function(v) {
return _.isNil(v) || (_.isString(v) && _.isEmpty(v));
} | [
"function",
"(",
"v",
")",
"{",
"return",
"_",
".",
"isNil",
"(",
"v",
")",
"||",
"(",
"_",
".",
"isString",
"(",
"v",
")",
"&&",
"_",
".",
"isEmpty",
"(",
"v",
")",
")",
";",
"}"
] | Returns true if argument is null, undefined or empty string.
@param {*} v - the value to be tested
@return {boolean} true if nil or "", false otherwise.
@memberof Valichain.$
@static | [
"Returns",
"true",
"if",
"argument",
"is",
"null",
"undefined",
"or",
"empty",
"string",
"."
] | 56f79fb9d53f879bbd81b25d573c8287993811f1 | https://github.com/expedit85/valichain/blob/56f79fb9d53f879bbd81b25d573c8287993811f1/index.js#L433-L435 | |
50,467 | expedit85/valichain | index.js | function(v) {
return _.isNull(v) || (_.isString(v) && _.isEmpty(v));
} | javascript | function(v) {
return _.isNull(v) || (_.isString(v) && _.isEmpty(v));
} | [
"function",
"(",
"v",
")",
"{",
"return",
"_",
".",
"isNull",
"(",
"v",
")",
"||",
"(",
"_",
".",
"isString",
"(",
"v",
")",
"&&",
"_",
".",
"isEmpty",
"(",
"v",
")",
")",
";",
"}"
] | Returns true if argument is null or empty string.
@param {*} v - the value to be tested
@return {boolean} true if null or "", false otherwise.
@memberof Valichain.$
@static | [
"Returns",
"true",
"if",
"argument",
"is",
"null",
"or",
"empty",
"string",
"."
] | 56f79fb9d53f879bbd81b25d573c8287993811f1 | https://github.com/expedit85/valichain/blob/56f79fb9d53f879bbd81b25d573c8287993811f1/index.js#L446-L448 | |
50,468 | expedit85/valichain | index.js | function(v) {
return !_.isNil(v)
&& (_.isString(v) || _.isNumber(v) || _.isBoolean)
&& !_.isObject(v);
} | javascript | function(v) {
return !_.isNil(v)
&& (_.isString(v) || _.isNumber(v) || _.isBoolean)
&& !_.isObject(v);
} | [
"function",
"(",
"v",
")",
"{",
"return",
"!",
"_",
".",
"isNil",
"(",
"v",
")",
"&&",
"(",
"_",
".",
"isString",
"(",
"v",
")",
"||",
"_",
".",
"isNumber",
"(",
"v",
")",
"||",
"_",
".",
"isBoolean",
")",
"&&",
"!",
"_",
".",
"isObject",
"... | Returns true if argument is not nil primitive. A not nil primitive is
a boolean, number or string, but neither null, undefined nor object.
@param {*} v - the value to be tested
@return {boolean} true if boolean, number or string, false otherwise.
@memberof Valichain.$
@static | [
"Returns",
"true",
"if",
"argument",
"is",
"not",
"nil",
"primitive",
".",
"A",
"not",
"nil",
"primitive",
"is",
"a",
"boolean",
"number",
"or",
"string",
"but",
"neither",
"null",
"undefined",
"nor",
"object",
"."
] | 56f79fb9d53f879bbd81b25d573c8287993811f1 | https://github.com/expedit85/valichain/blob/56f79fb9d53f879bbd81b25d573c8287993811f1/index.js#L460-L464 | |
50,469 | DeadAlready/node-foldermap | lib/map.js | normalize | function normalize(opts) {
if (typeof opts === 'string') {
opts = {path: opts};
}
opts.path = path.resolve(opts.path);
return opts;
} | javascript | function normalize(opts) {
if (typeof opts === 'string') {
opts = {path: opts};
}
opts.path = path.resolve(opts.path);
return opts;
} | [
"function",
"normalize",
"(",
"opts",
")",
"{",
"if",
"(",
"typeof",
"opts",
"===",
"'string'",
")",
"{",
"opts",
"=",
"{",
"path",
":",
"opts",
"}",
";",
"}",
"opts",
".",
"path",
"=",
"path",
".",
"resolve",
"(",
"opts",
".",
"path",
")",
";",
... | Function for normalizing input
@param opts
@returns {*} | [
"Function",
"for",
"normalizing",
"input"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L13-L19 |
50,470 | DeadAlready/node-foldermap | lib/map.js | mapObjects | function mapObjects(root, list, callback) {
var ret = {};
var sent = false;
var count = list.length;
if (count === 0) {
callback(null, ret);
}
list.forEach(function (pointer) {
var name = path.join(root._path, pointer);
fp.define({filePath: name, parent: root}, function (err, obj) {
if (err) {
if (!s... | javascript | function mapObjects(root, list, callback) {
var ret = {};
var sent = false;
var count = list.length;
if (count === 0) {
callback(null, ret);
}
list.forEach(function (pointer) {
var name = path.join(root._path, pointer);
fp.define({filePath: name, parent: root}, function (err, obj) {
if (err) {
if (!s... | [
"function",
"mapObjects",
"(",
"root",
",",
"list",
",",
"callback",
")",
"{",
"var",
"ret",
"=",
"{",
"}",
";",
"var",
"sent",
"=",
"false",
";",
"var",
"count",
"=",
"list",
".",
"length",
";",
"if",
"(",
"count",
"===",
"0",
")",
"{",
"callbac... | Function for mapping a list of objects relative to root object
@param root - Folder object
@param list - Array of file names
@param callback(err, result) - Function | [
"Function",
"for",
"mapping",
"a",
"list",
"of",
"objects",
"relative",
"to",
"root",
"object"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L28-L55 |
50,471 | DeadAlready/node-foldermap | lib/map.js | filter | function filter(pObjects, opts, returnArray) {
var filtered = returnArray ? [] : {};
function addToFiltered(key) {
if(returnArray) {
filtered.push((returnArray === 'keys' ? key : pObjects[key]));
} else {
filtered[key] = pObjects[key];
}
}
if (!opts) {
... | javascript | function filter(pObjects, opts, returnArray) {
var filtered = returnArray ? [] : {};
function addToFiltered(key) {
if(returnArray) {
filtered.push((returnArray === 'keys' ? key : pObjects[key]));
} else {
filtered[key] = pObjects[key];
}
}
if (!opts) {
... | [
"function",
"filter",
"(",
"pObjects",
",",
"opts",
",",
"returnArray",
")",
"{",
"var",
"filtered",
"=",
"returnArray",
"?",
"[",
"]",
":",
"{",
"}",
";",
"function",
"addToFiltered",
"(",
"key",
")",
"{",
"if",
"(",
"returnArray",
")",
"{",
"filtered... | Function for filtering pointer objects based on options
@param pObjects - object with subobjects being pointer objects
@param opts - options to use when filtering
@param returnArray - return an array instead of object
@returns {*} || [*] - object or array with filtered results | [
"Function",
"for",
"filtering",
"pointer",
"objects",
"based",
"on",
"options"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L65-L121 |
50,472 | DeadAlready/node-foldermap | lib/map.js | transfer | function transfer(root, map, opts) {
map = filter(map, opts);
var folders = [];
function getIndex(k) {
var index = k;
if (opts.relative) {
var replace = opts.relative === true ? (root._path + path.sep) : opts.relative;
index = k.replace(replace, '');
}
return index;
}
Object.keys(map).forEach(func... | javascript | function transfer(root, map, opts) {
map = filter(map, opts);
var folders = [];
function getIndex(k) {
var index = k;
if (opts.relative) {
var replace = opts.relative === true ? (root._path + path.sep) : opts.relative;
index = k.replace(replace, '');
}
return index;
}
Object.keys(map).forEach(func... | [
"function",
"transfer",
"(",
"root",
",",
"map",
",",
"opts",
")",
"{",
"map",
"=",
"filter",
"(",
"map",
",",
"opts",
")",
";",
"var",
"folders",
"=",
"[",
"]",
";",
"function",
"getIndex",
"(",
"k",
")",
"{",
"var",
"index",
"=",
"k",
";",
"i... | Function for transferring properties from map to root using opts
@param root {Object} - object to attach new pointers to
@param map {Object} - object with properties being pointer objects
@param opts {Object} - options
@returns {Array} - Folders for recursive mapping | [
"Function",
"for",
"transferring",
"properties",
"from",
"map",
"to",
"root",
"using",
"opts"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L131-L159 |
50,473 | DeadAlready/node-foldermap | lib/map.js | simpleMap | function simpleMap(map, lvls, opts, type, ext, callback) {
opts = utils.clone(opts);
lvls--;
if(lvls < 1) {
opts.simple = false;
opts.recursive = true;
opts.type = type;
opts.ext = ext;
}
var folders = map.__filter({type:'directory'}, true);
var count = folders.le... | javascript | function simpleMap(map, lvls, opts, type, ext, callback) {
opts = utils.clone(opts);
lvls--;
if(lvls < 1) {
opts.simple = false;
opts.recursive = true;
opts.type = type;
opts.ext = ext;
}
var folders = map.__filter({type:'directory'}, true);
var count = folders.le... | [
"function",
"simpleMap",
"(",
"map",
",",
"lvls",
",",
"opts",
",",
"type",
",",
"ext",
",",
"callback",
")",
"{",
"opts",
"=",
"utils",
".",
"clone",
"(",
"opts",
")",
";",
"lvls",
"--",
";",
"if",
"(",
"lvls",
"<",
"1",
")",
"{",
"opts",
".",... | Function for mapping simple first x lvls
@param map -> root map
@param lvls -> nr of levels
@param opts -> the options
@param type -> the final type to use
@param callback | [
"Function",
"for",
"mapping",
"simple",
"first",
"x",
"lvls"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L327-L366 |
50,474 | DeadAlready/node-foldermap | lib/map.js | map | function map(opts, callback) {
if(utils.isArray(opts)) {
mapWithArrayInput(opts, callback);
return;
}
opts = normalize(opts);
// Assume that the root is a folder
var root = new fp.Folder(opts.path);
var sent = false;
root.__listen('error', function (err) {
if (!sent)... | javascript | function map(opts, callback) {
if(utils.isArray(opts)) {
mapWithArrayInput(opts, callback);
return;
}
opts = normalize(opts);
// Assume that the root is a folder
var root = new fp.Folder(opts.path);
var sent = false;
root.__listen('error', function (err) {
if (!sent)... | [
"function",
"map",
"(",
"opts",
",",
"callback",
")",
"{",
"if",
"(",
"utils",
".",
"isArray",
"(",
"opts",
")",
")",
"{",
"mapWithArrayInput",
"(",
"opts",
",",
"callback",
")",
";",
"return",
";",
"}",
"opts",
"=",
"normalize",
"(",
"opts",
")",
... | Function for mapping a folder and returning a foldermap
@param opts -> object or array of objects
@param callback | [
"Function",
"for",
"mapping",
"a",
"folder",
"and",
"returning",
"a",
"foldermap"
] | be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d | https://github.com/DeadAlready/node-foldermap/blob/be6048cb3b3e9fa3b6f36542cb8835d48c7bde1d/lib/map.js#L405-L468 |
50,475 | kvnneff/incremental | index.js | increment | function increment(value, skip, incrementBy) {
var str = (typeof value === 'string');
var incrementBy = incrementBy || 1;
var numeric = !isNaN(value);
var skip = skip || [];
var nextVal;
if (numeric) {
value = parseInt(value) + parseInt(incrementBy);
} else {
value = String.... | javascript | function increment(value, skip, incrementBy) {
var str = (typeof value === 'string');
var incrementBy = incrementBy || 1;
var numeric = !isNaN(value);
var skip = skip || [];
var nextVal;
if (numeric) {
value = parseInt(value) + parseInt(incrementBy);
} else {
value = String.... | [
"function",
"increment",
"(",
"value",
",",
"skip",
",",
"incrementBy",
")",
"{",
"var",
"str",
"=",
"(",
"typeof",
"value",
"===",
"'string'",
")",
";",
"var",
"incrementBy",
"=",
"incrementBy",
"||",
"1",
";",
"var",
"numeric",
"=",
"!",
"isNaN",
"("... | Increment a number or alpha character
@param {String|Number} value
@param {Array} skip
@param {Number} incrementBy
@return {String|Number}
@api public | [
"Increment",
"a",
"number",
"or",
"alpha",
"character"
] | ed412879d3c22a3912ebfb9e7fc6a41f789196bb | https://github.com/kvnneff/incremental/blob/ed412879d3c22a3912ebfb9e7fc6a41f789196bb/index.js#L15-L31 |
50,476 | samleybrize/node-package-json-discover | lib/package-json-discover.js | discover | function discover(from) {
from = from || caller();
// check 'from' validity
if ("string" != typeof from) {
var given = typeof from;
throw new Error("'from' must be a string, [" + given + "] given");
}
// if 'from' is not absolute, make it absolute
if (!pathIsAbsolute(from)) {
... | javascript | function discover(from) {
from = from || caller();
// check 'from' validity
if ("string" != typeof from) {
var given = typeof from;
throw new Error("'from' must be a string, [" + given + "] given");
}
// if 'from' is not absolute, make it absolute
if (!pathIsAbsolute(from)) {
... | [
"function",
"discover",
"(",
"from",
")",
"{",
"from",
"=",
"from",
"||",
"caller",
"(",
")",
";",
"// check 'from' validity",
"if",
"(",
"\"string\"",
"!=",
"typeof",
"from",
")",
"{",
"var",
"given",
"=",
"typeof",
"from",
";",
"throw",
"new",
"Error",... | Discovers the closest package.json file and returns its absolute path
@param {string} [from] - The path to the directory where to start discovering. If omitted, it is the path to the file that calls this function.
@returns {string} | [
"Discovers",
"the",
"closest",
"package",
".",
"json",
"file",
"and",
"returns",
"its",
"absolute",
"path"
] | 1e95d15406ba32b80d3998a5bb4016a1431ebd5c | https://github.com/samleybrize/node-package-json-discover/blob/1e95d15406ba32b80d3998a5bb4016a1431ebd5c/lib/package-json-discover.js#L21-L87 |
50,477 | enricostara/get-log | lib/get-log.js | Logger | function Logger(name) {
var prjName = module.exports.PROJECT_NAME;
this.name = prjName ? prjName + ':' + name : name;
this._debug = debug(this.name);
this._debug.log = logDebug;
this.debugEnabled = debug.enabled(this.name);
if (this.debugEnabled) {
logDebug('[%s] debug is %s', this.name.... | javascript | function Logger(name) {
var prjName = module.exports.PROJECT_NAME;
this.name = prjName ? prjName + ':' + name : name;
this._debug = debug(this.name);
this._debug.log = logDebug;
this.debugEnabled = debug.enabled(this.name);
if (this.debugEnabled) {
logDebug('[%s] debug is %s', this.name.... | [
"function",
"Logger",
"(",
"name",
")",
"{",
"var",
"prjName",
"=",
"module",
".",
"exports",
".",
"PROJECT_NAME",
";",
"this",
".",
"name",
"=",
"prjName",
"?",
"prjName",
"+",
"':'",
"+",
"name",
":",
"name",
";",
"this",
".",
"_debug",
"=",
"debug... | The constructor requires the logger name | [
"The",
"constructor",
"requires",
"the",
"logger",
"name"
] | 2a78a8397e4282064979bcd4291685cbe8e52745 | https://github.com/enricostara/get-log/blob/2a78a8397e4282064979bcd4291685cbe8e52745/lib/get-log.js#L55-L64 |
50,478 | schwarzkopfb/extw | index.js | extractWords | function extractWords(str, store) {
if (!str)
return []
if (Array.isArray(str))
return str
assert.equal(typeof str, 'string', 'first parameter must be an array or string')
switch (store) {
case undefined:
if (cache)
return parseWordListCached(str, c... | javascript | function extractWords(str, store) {
if (!str)
return []
if (Array.isArray(str))
return str
assert.equal(typeof str, 'string', 'first parameter must be an array or string')
switch (store) {
case undefined:
if (cache)
return parseWordListCached(str, c... | [
"function",
"extractWords",
"(",
"str",
",",
"store",
")",
"{",
"if",
"(",
"!",
"str",
")",
"return",
"[",
"]",
"if",
"(",
"Array",
".",
"isArray",
"(",
"str",
")",
")",
"return",
"str",
"assert",
".",
"equal",
"(",
"typeof",
"str",
",",
"'string'"... | Extract words from a given string.
@param {string|Array} str The string to parse.
@param {null|Object} [store] Pass an object to use for caching instead of the default one. Or pass `null` to disable caching for this call.
@returns {[string]} | [
"Extract",
"words",
"from",
"a",
"given",
"string",
"."
] | d95befe35cdd3c2ed5b10bbe83176323a3f86521 | https://github.com/schwarzkopfb/extw/blob/d95befe35cdd3c2ed5b10bbe83176323a3f86521/index.js#L26-L50 |
50,479 | nathanhood/postcss-variable-media | index.js | registerBreakpoints | function registerBreakpoints(breakpoints) {
let register = [];
Object.keys(breakpoints).forEach(name => {
register.push('(^' + escRgx(name) + '$)');
});
if (! register.length) {
return false;
}
return new RegExp(register.join('|'));
} | javascript | function registerBreakpoints(breakpoints) {
let register = [];
Object.keys(breakpoints).forEach(name => {
register.push('(^' + escRgx(name) + '$)');
});
if (! register.length) {
return false;
}
return new RegExp(register.join('|'));
} | [
"function",
"registerBreakpoints",
"(",
"breakpoints",
")",
"{",
"let",
"register",
"=",
"[",
"]",
";",
"Object",
".",
"keys",
"(",
"breakpoints",
")",
".",
"forEach",
"(",
"name",
"=>",
"{",
"register",
".",
"push",
"(",
"'(^'",
"+",
"escRgx",
"(",
"n... | Create regex to identify breakpoints
@param {object} breakpoints
@returns {RegExp} | [
"Create",
"regex",
"to",
"identify",
"breakpoints"
] | c8a761e6dc6d925309197e39e4e650b8ef5cdab7 | https://github.com/nathanhood/postcss-variable-media/blob/c8a761e6dc6d925309197e39e4e650b8ef5cdab7/index.js#L19-L31 |
50,480 | nathanhood/postcss-variable-media | index.js | convertBreakpointToMedia | function convertBreakpointToMedia(rule) {
rule.params = `(min-width: ${breakpoints[rule.name]}px)`;
rule.name = 'media';
rule.raws.afterName = ' ';
rule.raws.between = ' ';
return rule;
} | javascript | function convertBreakpointToMedia(rule) {
rule.params = `(min-width: ${breakpoints[rule.name]}px)`;
rule.name = 'media';
rule.raws.afterName = ' ';
rule.raws.between = ' ';
return rule;
} | [
"function",
"convertBreakpointToMedia",
"(",
"rule",
")",
"{",
"rule",
".",
"params",
"=",
"`",
"${",
"breakpoints",
"[",
"rule",
".",
"name",
"]",
"}",
"`",
";",
"rule",
".",
"name",
"=",
"'media'",
";",
"rule",
".",
"raws",
".",
"afterName",
"=",
"... | Turn breakpoint to media
@param {postcss.Container} rule - AtRule
@returns {*} | [
"Turn",
"breakpoint",
"to",
"media"
] | c8a761e6dc6d925309197e39e4e650b8ef5cdab7 | https://github.com/nathanhood/postcss-variable-media/blob/c8a761e6dc6d925309197e39e4e650b8ef5cdab7/index.js#L39-L46 |
50,481 | nathanhood/postcss-variable-media | index.js | addToRegistry | function addToRegistry(rule) {
let name = rule.name;
if (registry.hasOwnProperty(name)) {
// `each` allows for safe looping while modifying the
// array being looped over. `append` is removing the rule
// from the array being looped over, so it is necessary
// to use this method instead of forEach
... | javascript | function addToRegistry(rule) {
let name = rule.name;
if (registry.hasOwnProperty(name)) {
// `each` allows for safe looping while modifying the
// array being looped over. `append` is removing the rule
// from the array being looped over, so it is necessary
// to use this method instead of forEach
... | [
"function",
"addToRegistry",
"(",
"rule",
")",
"{",
"let",
"name",
"=",
"rule",
".",
"name",
";",
"if",
"(",
"registry",
".",
"hasOwnProperty",
"(",
"name",
")",
")",
"{",
"// `each` allows for safe looping while modifying the",
"// array being looped over. `append` i... | Add breakpoint to registry
@param {object} rule - AtRule | [
"Add",
"breakpoint",
"to",
"registry"
] | c8a761e6dc6d925309197e39e4e650b8ef5cdab7 | https://github.com/nathanhood/postcss-variable-media/blob/c8a761e6dc6d925309197e39e4e650b8ef5cdab7/index.js#L53-L65 |
50,482 | gethuman/pancakes-hapi | lib/pancakes.hapi.web.js | processRoute | function processRoute(opts) {
if (routeHandler) {
routeHandler(opts.request, opts.reply, opts.urlOverride, opts.returnCode);
}
else {
opts.reply.continue();
}
} | javascript | function processRoute(opts) {
if (routeHandler) {
routeHandler(opts.request, opts.reply, opts.urlOverride, opts.returnCode);
}
else {
opts.reply.continue();
}
} | [
"function",
"processRoute",
"(",
"opts",
")",
"{",
"if",
"(",
"routeHandler",
")",
"{",
"routeHandler",
"(",
"opts",
".",
"request",
",",
"opts",
".",
"reply",
",",
"opts",
".",
"urlOverride",
",",
"opts",
".",
"returnCode",
")",
";",
"}",
"else",
"{",... | The idea here is to use the same request and reply
but a different route handler based on the given URL override | [
"The",
"idea",
"here",
"is",
"to",
"use",
"the",
"same",
"request",
"and",
"reply",
"but",
"a",
"different",
"route",
"handler",
"based",
"on",
"the",
"given",
"URL",
"override"
] | 1167cd7564cd8949c446c6fd8d95185f52b14492 | https://github.com/gethuman/pancakes-hapi/blob/1167cd7564cd8949c446c6fd8d95185f52b14492/lib/pancakes.hapi.web.js#L80-L87 |
50,483 | gethuman/pancakes-hapi | lib/pancakes.hapi.web.js | getServerPreProcessing | function getServerPreProcessing(request, reply) {
var me = this;
return function (routeInfo, page, model) {
if (!page.serverPreprocessing) { return false; }
var deps = { request: request, reply: reply, model: model, routeInfo: routeInfo };
return me.pancakes.cook(page.serverPreprocessi... | javascript | function getServerPreProcessing(request, reply) {
var me = this;
return function (routeInfo, page, model) {
if (!page.serverPreprocessing) { return false; }
var deps = { request: request, reply: reply, model: model, routeInfo: routeInfo };
return me.pancakes.cook(page.serverPreprocessi... | [
"function",
"getServerPreProcessing",
"(",
"request",
",",
"reply",
")",
"{",
"var",
"me",
"=",
"this",
";",
"return",
"function",
"(",
"routeInfo",
",",
"page",
",",
"model",
")",
"{",
"if",
"(",
"!",
"page",
".",
"serverPreprocessing",
")",
"{",
"retur... | Execute the server preprocessing method and return true if the preprocessor
handled the request
@param request
@param reply
@returns {Function} | [
"Execute",
"the",
"server",
"preprocessing",
"method",
"and",
"return",
"true",
"if",
"the",
"preprocessor",
"handled",
"the",
"request"
] | 1167cd7564cd8949c446c6fd8d95185f52b14492 | https://github.com/gethuman/pancakes-hapi/blob/1167cd7564cd8949c446c6fd8d95185f52b14492/lib/pancakes.hapi.web.js#L97-L106 |
50,484 | gethuman/pancakes-hapi | lib/pancakes.hapi.web.js | getWebRouteHandler | function getWebRouteHandler(opts) {
var webRouteHandler = this.pancakes.webRouteHandler;
var me = this;
return function handleWebRoute(request, reply, urlOverride, returnCode) {
var appName = request.app.name;
var url = urlOverride || request.url.pathname;
var routeInfo = null;
... | javascript | function getWebRouteHandler(opts) {
var webRouteHandler = this.pancakes.webRouteHandler;
var me = this;
return function handleWebRoute(request, reply, urlOverride, returnCode) {
var appName = request.app.name;
var url = urlOverride || request.url.pathname;
var routeInfo = null;
... | [
"function",
"getWebRouteHandler",
"(",
"opts",
")",
"{",
"var",
"webRouteHandler",
"=",
"this",
".",
"pancakes",
".",
"webRouteHandler",
";",
"var",
"me",
"=",
"this",
";",
"return",
"function",
"handleWebRoute",
"(",
"request",
",",
"reply",
",",
"urlOverride... | Render the web route for one of the dynamic routes. These routes are based off of
the .app config files for each app.
@param opts | [
"Render",
"the",
"web",
"route",
"for",
"one",
"of",
"the",
"dynamic",
"routes",
".",
"These",
"routes",
"are",
"based",
"off",
"of",
"the",
".",
"app",
"config",
"files",
"for",
"each",
"app",
"."
] | 1167cd7564cd8949c446c6fd8d95185f52b14492 | https://github.com/gethuman/pancakes-hapi/blob/1167cd7564cd8949c446c6fd8d95185f52b14492/lib/pancakes.hapi.web.js#L114-L196 |
50,485 | konfirm/node-wanted | lib/wanted.js | error | function error(message) {
if (EventEmitter.listenerCount(wanted, 'error') > 0) {
return wanted.emit('error', message);
}
throw new Error(message);
} | javascript | function error(message) {
if (EventEmitter.listenerCount(wanted, 'error') > 0) {
return wanted.emit('error', message);
}
throw new Error(message);
} | [
"function",
"error",
"(",
"message",
")",
"{",
"if",
"(",
"EventEmitter",
".",
"listenerCount",
"(",
"wanted",
",",
"'error'",
")",
">",
"0",
")",
"{",
"return",
"wanted",
".",
"emit",
"(",
"'error'",
",",
"message",
")",
";",
"}",
"throw",
"new",
"E... | Trigger an error emission or throw it, depending on where a listener for error emission is present
@name error
@access internal
@param string message
@return void | [
"Trigger",
"an",
"error",
"emission",
"or",
"throw",
"it",
"depending",
"on",
"where",
"a",
"listener",
"for",
"error",
"emission",
"is",
"present"
] | 797cf41bde7bf67f74bcd59a97cc28ddb084e2ca | https://github.com/konfirm/node-wanted/blob/797cf41bde7bf67f74bcd59a97cc28ddb084e2ca/lib/wanted.js#L52-L58 |
50,486 | konfirm/node-wanted | lib/wanted.js | processed | function processed(module) {
pool.processed.push(module);
if (!module.installed) {
pool.install.push(module);
}
setImmediate(next);
} | javascript | function processed(module) {
pool.processed.push(module);
if (!module.installed) {
pool.install.push(module);
}
setImmediate(next);
} | [
"function",
"processed",
"(",
"module",
")",
"{",
"pool",
".",
"processed",
".",
"push",
"(",
"module",
")",
";",
"if",
"(",
"!",
"module",
".",
"installed",
")",
"{",
"pool",
".",
"install",
".",
"push",
"(",
"module",
")",
";",
"}",
"setImmediate",... | Remove a module from the queue
@name processed
@access internal
@param object module
@return void | [
"Remove",
"a",
"module",
"from",
"the",
"queue"
] | 797cf41bde7bf67f74bcd59a97cc28ddb084e2ca | https://github.com/konfirm/node-wanted/blob/797cf41bde7bf67f74bcd59a97cc28ddb084e2ca/lib/wanted.js#L67-L75 |
50,487 | konfirm/node-wanted | lib/wanted.js | next | function next() {
var module;
if (pool.queue.length <= 0) {
if (pool.install.length) {
error('Update needed: ' + pool.install.map(function(module) {
return module.name;
}).join(', '));
}
else {
wanted.emit('ready', pool.processed.map(shallow));
}
return reset();
}
module = poo... | javascript | function next() {
var module;
if (pool.queue.length <= 0) {
if (pool.install.length) {
error('Update needed: ' + pool.install.map(function(module) {
return module.name;
}).join(', '));
}
else {
wanted.emit('ready', pool.processed.map(shallow));
}
return reset();
}
module = poo... | [
"function",
"next",
"(",
")",
"{",
"var",
"module",
";",
"if",
"(",
"pool",
".",
"queue",
".",
"length",
"<=",
"0",
")",
"{",
"if",
"(",
"pool",
".",
"install",
".",
"length",
")",
"{",
"error",
"(",
"'Update needed: '",
"+",
"pool",
".",
"install"... | Pick the next item from the queue and process it
@name next
@return void | [
"Pick",
"the",
"next",
"item",
"from",
"the",
"queue",
"and",
"process",
"it"
] | 797cf41bde7bf67f74bcd59a97cc28ddb084e2ca | https://github.com/konfirm/node-wanted/blob/797cf41bde7bf67f74bcd59a97cc28ddb084e2ca/lib/wanted.js#L82-L119 |
50,488 | konfirm/node-wanted | lib/wanted.js | fileExists | function fileExists(file, handle) {
fs.exists(file, function(exists) {
handle.apply(null, exists ? [file] : []);
});
} | javascript | function fileExists(file, handle) {
fs.exists(file, function(exists) {
handle.apply(null, exists ? [file] : []);
});
} | [
"function",
"fileExists",
"(",
"file",
",",
"handle",
")",
"{",
"fs",
".",
"exists",
"(",
"file",
",",
"function",
"(",
"exists",
")",
"{",
"handle",
".",
"apply",
"(",
"null",
",",
"exists",
"?",
"[",
"file",
"]",
":",
"[",
"]",
")",
";",
"}",
... | Simple wrapper around fs.exists, allowing us to provide the filename in case it does exist
@name fileExists
@access internal
@param string file
@param function handle
@return void | [
"Simple",
"wrapper",
"around",
"fs",
".",
"exists",
"allowing",
"us",
"to",
"provide",
"the",
"filename",
"in",
"case",
"it",
"does",
"exist"
] | 797cf41bde7bf67f74bcd59a97cc28ddb084e2ca | https://github.com/konfirm/node-wanted/blob/797cf41bde7bf67f74bcd59a97cc28ddb084e2ca/lib/wanted.js#L170-L174 |
50,489 | konfirm/node-wanted | lib/wanted.js | shallow | function shallow(module) {
return {
name: module.name,
version: module.version,
installed: module.installed,
scope: module.scope,
state: module.current ? 'current' : (module.upgrade ? 'upgrade' : 'install')
};
} | javascript | function shallow(module) {
return {
name: module.name,
version: module.version,
installed: module.installed,
scope: module.scope,
state: module.current ? 'current' : (module.upgrade ? 'upgrade' : 'install')
};
} | [
"function",
"shallow",
"(",
"module",
")",
"{",
"return",
"{",
"name",
":",
"module",
".",
"name",
",",
"version",
":",
"module",
".",
"version",
",",
"installed",
":",
"module",
".",
"installed",
",",
"scope",
":",
"module",
".",
"scope",
",",
"state"... | Reduce the internal module configuration for external exposure
@name shallow
@param Object module
@return Object shallow module | [
"Reduce",
"the",
"internal",
"module",
"configuration",
"for",
"external",
"exposure"
] | 797cf41bde7bf67f74bcd59a97cc28ddb084e2ca | https://github.com/konfirm/node-wanted/blob/797cf41bde7bf67f74bcd59a97cc28ddb084e2ca/lib/wanted.js#L255-L263 |
50,490 | syntheticore/declaire | src/bootstrap.js | function(name) {
var handler = function(e) {
//XXX add id to element
_declaireLog.push(e);
};
var html = document.getElementsByTagName('html')[0];
html.addEventListener(name, handler);
return handler;
} | javascript | function(name) {
var handler = function(e) {
//XXX add id to element
_declaireLog.push(e);
};
var html = document.getElementsByTagName('html')[0];
html.addEventListener(name, handler);
return handler;
} | [
"function",
"(",
"name",
")",
"{",
"var",
"handler",
"=",
"function",
"(",
"e",
")",
"{",
"//XXX add id to element",
"_declaireLog",
".",
"push",
"(",
"e",
")",
";",
"}",
";",
"var",
"html",
"=",
"document",
".",
"getElementsByTagName",
"(",
"'html'",
")... | Listen for events on html element and save these to the log | [
"Listen",
"for",
"events",
"on",
"html",
"element",
"and",
"save",
"these",
"to",
"the",
"log"
] | cb5ea205eeb3aa26fd0c6348e86d840c04e9ba9f | https://github.com/syntheticore/declaire/blob/cb5ea205eeb3aa26fd0c6348e86d840c04e9ba9f/src/bootstrap.js#L6-L14 | |
50,491 | scrapjs/rela | lib/server.js | Server | function Server(opts){
// Shorthand, no "new" required.
if (!(this instanceof Server))
return new Server(...arguments);
if (typeof opts !== 'object')
opts = {};
this.clients = opts.dummies || [];
this.server = opts.server || new SocketServer(socket => {
let client = new Client(socket);
this... | javascript | function Server(opts){
// Shorthand, no "new" required.
if (!(this instanceof Server))
return new Server(...arguments);
if (typeof opts !== 'object')
opts = {};
this.clients = opts.dummies || [];
this.server = opts.server || new SocketServer(socket => {
let client = new Client(socket);
this... | [
"function",
"Server",
"(",
"opts",
")",
"{",
"// Shorthand, no \"new\" required.",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Server",
")",
")",
"return",
"new",
"Server",
"(",
"...",
"arguments",
")",
";",
"if",
"(",
"typeof",
"opts",
"!==",
"'object'",
... | The server object, Rela. | [
"The",
"server",
"object",
"Rela",
"."
] | 7e3ed535fea68a3292bad9d9ce220360c45389e8 | https://github.com/scrapjs/rela/blob/7e3ed535fea68a3292bad9d9ce220360c45389e8/lib/server.js#L17-L37 |
50,492 | xiamidaxia/xiami | meteor/minimongo/selector_modifier.js | function (obj, keys) {
return _.all(obj, function (v, k) {
return _.contains(keys, k);
});
} | javascript | function (obj, keys) {
return _.all(obj, function (v, k) {
return _.contains(keys, k);
});
} | [
"function",
"(",
"obj",
",",
"keys",
")",
"{",
"return",
"_",
".",
"all",
"(",
"obj",
",",
"function",
"(",
"v",
",",
"k",
")",
"{",
"return",
"_",
".",
"contains",
"(",
"keys",
",",
"k",
")",
";",
"}",
")",
";",
"}"
] | A helper to ensure object has only certain keys | [
"A",
"helper",
"to",
"ensure",
"object",
"has",
"only",
"certain",
"keys"
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/minimongo/selector_modifier.js#L214-L218 | |
50,493 | alexpods/ClazzJS | src/components/meta/Methods.js | function(clazz, metaData) {
this.applyMethods(clazz, metaData.clazz_methods || {});
this.applyMethods(clazz.prototype, metaData.methods || {});
} | javascript | function(clazz, metaData) {
this.applyMethods(clazz, metaData.clazz_methods || {});
this.applyMethods(clazz.prototype, metaData.methods || {});
} | [
"function",
"(",
"clazz",
",",
"metaData",
")",
"{",
"this",
".",
"applyMethods",
"(",
"clazz",
",",
"metaData",
".",
"clazz_methods",
"||",
"{",
"}",
")",
";",
"this",
".",
"applyMethods",
"(",
"clazz",
".",
"prototype",
",",
"metaData",
".",
"methods",... | Applies methods to clazz and its prototype
@param {clazz} clazz Clazz
@param {object} metaData Meta data with properties 'methods' and 'clazz_methods'
@this {metaProcessor} | [
"Applies",
"methods",
"to",
"clazz",
"and",
"its",
"prototype"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Methods.js#L15-L18 | |
50,494 | alexpods/ClazzJS | src/components/meta/Methods.js | function(object, methods) {
_.each(methods, function(method, name) {
if (!_.isFunction(method)) {
throw new Error('Method "' + name + '" must be a function!');
}
object[name] = method
});
} | javascript | function(object, methods) {
_.each(methods, function(method, name) {
if (!_.isFunction(method)) {
throw new Error('Method "' + name + '" must be a function!');
}
object[name] = method
});
} | [
"function",
"(",
"object",
",",
"methods",
")",
"{",
"_",
".",
"each",
"(",
"methods",
",",
"function",
"(",
"method",
",",
"name",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isFunction",
"(",
"method",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Me... | Applies methods to specified object
@param {object} object Object for methods applying
@param {object} methods Hash of methods
@this {Error} if method is not a funciton
@this {metaProcessor} | [
"Applies",
"methods",
"to",
"specified",
"object"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Methods.js#L30-L37 | |
50,495 | cli-kit/cli-locale | index.js | sanitize | function sanitize(lang, filter) {
if(!(typeof lang == 'string')) return lang;
lang = lang.replace(/\..*$/, '').toLowerCase();
if(typeof filter == 'function') {
lang = filter(lang);
}
return lang;
} | javascript | function sanitize(lang, filter) {
if(!(typeof lang == 'string')) return lang;
lang = lang.replace(/\..*$/, '').toLowerCase();
if(typeof filter == 'function') {
lang = filter(lang);
}
return lang;
} | [
"function",
"sanitize",
"(",
"lang",
",",
"filter",
")",
"{",
"if",
"(",
"!",
"(",
"typeof",
"lang",
"==",
"'string'",
")",
")",
"return",
"lang",
";",
"lang",
"=",
"lang",
".",
"replace",
"(",
"/",
"\\..*$",
"/",
",",
"''",
")",
".",
"toLowerCase"... | Sanitize the value of an LC variable removing any character
encoding portion, such that en_GB.UTF-8 becomes en_gb.
@param lang A language identifier extracted from an LC variable.
@param filter A filter function.
@return A sanitized language identifier. | [
"Sanitize",
"the",
"value",
"of",
"an",
"LC",
"variable",
"removing",
"any",
"character",
"encoding",
"portion",
"such",
"that",
"en_GB",
".",
"UTF",
"-",
"8",
"becomes",
"en_gb",
"."
] | 5e1c759d551207de80b4bd9206101df077f61a14 | https://github.com/cli-kit/cli-locale/blob/5e1c759d551207de80b4bd9206101df077f61a14/index.js#L12-L19 |
50,496 | cli-kit/cli-locale | index.js | find | function find(search, filter, strict) {
var lang, search = search || [], i, k, v, re = /^(LC_|LANG)/;
for(i = 0;i < search.length;i++) {
lang = sanitize(process.env[search[i]] || '', filter);
if(lang) return c(lang);
}
// nothing found in search array, find first available
for(k in process.env) {
... | javascript | function find(search, filter, strict) {
var lang, search = search || [], i, k, v, re = /^(LC_|LANG)/;
for(i = 0;i < search.length;i++) {
lang = sanitize(process.env[search[i]] || '', filter);
if(lang) return c(lang);
}
// nothing found in search array, find first available
for(k in process.env) {
... | [
"function",
"find",
"(",
"search",
",",
"filter",
",",
"strict",
")",
"{",
"var",
"lang",
",",
"search",
"=",
"search",
"||",
"[",
"]",
",",
"i",
",",
"k",
",",
"v",
",",
"re",
"=",
"/",
"^(LC_|LANG)",
"/",
";",
"for",
"(",
"i",
"=",
"0",
";"... | Find the value of an LC environment variable and return a
sanitized represention of the locale.
If no variable value is found in the search array then this
method returns the first available LC variable.
@param search An array of LC variables to prefer.
@param filter A filter function.
@param strict A boolean indicat... | [
"Find",
"the",
"value",
"of",
"an",
"LC",
"environment",
"variable",
"and",
"return",
"a",
"sanitized",
"represention",
"of",
"the",
"locale",
"."
] | 5e1c759d551207de80b4bd9206101df077f61a14 | https://github.com/cli-kit/cli-locale/blob/5e1c759d551207de80b4bd9206101df077f61a14/index.js#L45-L61 |
50,497 | aMarCruz/flatten-brunch-map | index.js | flattenBrunchMap | function flattenBrunchMap (sourceFile, compiled, sourceMap) {
let asString = false
let prevMap = sourceFile.map
let newMap = sourceMap
// make sure the current map is an object
if (prevMap && (typeof prevMap == 'string' || prevMap instanceof String)) {
prevMap = JSON.parse(prevMap)
}
const result = ... | javascript | function flattenBrunchMap (sourceFile, compiled, sourceMap) {
let asString = false
let prevMap = sourceFile.map
let newMap = sourceMap
// make sure the current map is an object
if (prevMap && (typeof prevMap == 'string' || prevMap instanceof String)) {
prevMap = JSON.parse(prevMap)
}
const result = ... | [
"function",
"flattenBrunchMap",
"(",
"sourceFile",
",",
"compiled",
",",
"sourceMap",
")",
"{",
"let",
"asString",
"=",
"false",
"let",
"prevMap",
"=",
"sourceFile",
".",
"map",
"let",
"newMap",
"=",
"sourceMap",
"// make sure the current map is an object",
"if",
... | Return a re-mapped source map string
@param {object} [sourceFile] - The param received by the plugin
@param {string} compiled - Processed or compiled code
@param {object|string} sourceMap - Generated source map
@returns {object} The resulting file object with flatten source map, if any. | [
"Return",
"a",
"re",
"-",
"mapped",
"source",
"map",
"string"
] | 4b37048700403bf74b7bc1e76f26e82e6b973356 | https://github.com/aMarCruz/flatten-brunch-map/blob/4b37048700403bf74b7bc1e76f26e82e6b973356/index.js#L46-L97 |
50,498 | iwillwen/watchman.js | dist/watchman.js | pathToRegExp | function pathToRegExp(path) {
if (path instanceof RegExp) {
return {
keys: [],
regexp: path
};
}
if (path instanceof Array) {
path = '(' + path.join('|') + ')';
}
var rtn = {
keys: [],
regexp: null
};
rtn.regexp = new RegExp((isHashRouter(path)... | javascript | function pathToRegExp(path) {
if (path instanceof RegExp) {
return {
keys: [],
regexp: path
};
}
if (path instanceof Array) {
path = '(' + path.join('|') + ')';
}
var rtn = {
keys: [],
regexp: null
};
rtn.regexp = new RegExp((isHashRouter(path)... | [
"function",
"pathToRegExp",
"(",
"path",
")",
"{",
"if",
"(",
"path",
"instanceof",
"RegExp",
")",
"{",
"return",
"{",
"keys",
":",
"[",
"]",
",",
"regexp",
":",
"path",
"}",
";",
"}",
"if",
"(",
"path",
"instanceof",
"Array",
")",
"{",
"path",
"="... | Convert the path string to a RegExp object
@param {String} path path
@return {RegExp} RegExp object | [
"Convert",
"the",
"path",
"string",
"to",
"a",
"RegExp",
"object"
] | 54b380f53311aa03422cf7ce4e41a5fb7a2c067a | https://github.com/iwillwen/watchman.js/blob/54b380f53311aa03422cf7ce4e41a5fb7a2c067a/dist/watchman.js#L303-L334 |
50,499 | iwillwen/watchman.js | dist/watchman.js | paramsParser | function paramsParser(url, rule) {
var matches = rule.regexp.exec(url).slice(1);
var keys = rule.keys;
var params = {};
for (var i = 0; i < keys.length; i++) {
params[keys[i]] = matches[i];
}
return params;
} | javascript | function paramsParser(url, rule) {
var matches = rule.regexp.exec(url).slice(1);
var keys = rule.keys;
var params = {};
for (var i = 0; i < keys.length; i++) {
params[keys[i]] = matches[i];
}
return params;
} | [
"function",
"paramsParser",
"(",
"url",
",",
"rule",
")",
"{",
"var",
"matches",
"=",
"rule",
".",
"regexp",
".",
"exec",
"(",
"url",
")",
".",
"slice",
"(",
"1",
")",
";",
"var",
"keys",
"=",
"rule",
".",
"keys",
";",
"var",
"params",
"=",
"{",
... | url params parser
@param {String} url current url
@param {Object} rule matched rule
@return {Object} params | [
"url",
"params",
"parser"
] | 54b380f53311aa03422cf7ce4e41a5fb7a2c067a | https://github.com/iwillwen/watchman.js/blob/54b380f53311aa03422cf7ce4e41a5fb7a2c067a/dist/watchman.js#L402-L412 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.