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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
37,300 | tadam313/sheet-db | src/query.js | updateObject | function updateObject(entities, descriptor) {
if (!entities) {
return entities;
}
let result = Array.isArray(entities) ? entities : [entities];
if (!isUpdateDescriptor(descriptor)) {
return descriptor && typeof descriptor === 'object'
? [util.copyMetaProperties(descriptor,... | javascript | function updateObject(entities, descriptor) {
if (!entities) {
return entities;
}
let result = Array.isArray(entities) ? entities : [entities];
if (!isUpdateDescriptor(descriptor)) {
return descriptor && typeof descriptor === 'object'
? [util.copyMetaProperties(descriptor,... | [
"function",
"updateObject",
"(",
"entities",
",",
"descriptor",
")",
"{",
"if",
"(",
"!",
"entities",
")",
"{",
"return",
"entities",
";",
"}",
"let",
"result",
"=",
"Array",
".",
"isArray",
"(",
"entities",
")",
"?",
"entities",
":",
"[",
"entities",
... | Updates the object based on the MongoDB specification. It wont mutate the original object
@param {object} entities Original object
@param {object} descriptor Update description
@returns {*} | [
"Updates",
"the",
"object",
"based",
"on",
"the",
"MongoDB",
"specification",
".",
"It",
"wont",
"mutate",
"the",
"original",
"object"
] | 2ca1b85b8a6086a327d65b98b68b543fade84848 | https://github.com/tadam313/sheet-db/blob/2ca1b85b8a6086a327d65b98b68b543fade84848/src/query.js#L202-L226 |
37,301 | tadam313/sheet-db | src/query.js | mutate | function mutate(entities, operationDescription, transformation) {
if (!operationDescription) {
return object;
}
return entities.map(item => {
Object.keys(operationDescription)
.forEach(key => transformation(item, key, operationDescription[key]));
return item;
});
} | javascript | function mutate(entities, operationDescription, transformation) {
if (!operationDescription) {
return object;
}
return entities.map(item => {
Object.keys(operationDescription)
.forEach(key => transformation(item, key, operationDescription[key]));
return item;
});
} | [
"function",
"mutate",
"(",
"entities",
",",
"operationDescription",
",",
"transformation",
")",
"{",
"if",
"(",
"!",
"operationDescription",
")",
"{",
"return",
"object",
";",
"}",
"return",
"entities",
".",
"map",
"(",
"item",
"=>",
"{",
"Object",
".",
"k... | Mutates the object according to the transform logic.
@param {object} entities Original entity object
@param {object} operationDescription Update descriptor
@param {function} transformation Transformator function
@returns {object} | [
"Mutates",
"the",
"object",
"according",
"to",
"the",
"transform",
"logic",
"."
] | 2ca1b85b8a6086a327d65b98b68b543fade84848 | https://github.com/tadam313/sheet-db/blob/2ca1b85b8a6086a327d65b98b68b543fade84848/src/query.js#L236-L247 |
37,302 | tadam313/sheet-db | src/query.js | isUpdateDescriptor | function isUpdateDescriptor(descriptor) {
if (typeof descriptor !== 'object' || !descriptor) {
return false;
}
return Object.keys(descriptor).some(op => op in UPDATE_OPS);
} | javascript | function isUpdateDescriptor(descriptor) {
if (typeof descriptor !== 'object' || !descriptor) {
return false;
}
return Object.keys(descriptor).some(op => op in UPDATE_OPS);
} | [
"function",
"isUpdateDescriptor",
"(",
"descriptor",
")",
"{",
"if",
"(",
"typeof",
"descriptor",
"!==",
"'object'",
"||",
"!",
"descriptor",
")",
"{",
"return",
"false",
";",
"}",
"return",
"Object",
".",
"keys",
"(",
"descriptor",
")",
".",
"some",
"(",
... | Checks whether the given object is Mongo update descriptor or not.
@param {*} descriptor Candidate descriptor being checked
@returns {boolean} | [
"Checks",
"whether",
"the",
"given",
"object",
"is",
"Mongo",
"update",
"descriptor",
"or",
"not",
"."
] | 2ca1b85b8a6086a327d65b98b68b543fade84848 | https://github.com/tadam313/sheet-db/blob/2ca1b85b8a6086a327d65b98b68b543fade84848/src/query.js#L255-L261 |
37,303 | chip-js/fragments-js | src/template.js | function(doc) {
if (!doc) {
doc = document;
}
if (doc === document && this.pool.length) {
return this.pool.pop();
}
return View.makeInstanceOf(doc.importNode(this, true), this);
} | javascript | function(doc) {
if (!doc) {
doc = document;
}
if (doc === document && this.pool.length) {
return this.pool.pop();
}
return View.makeInstanceOf(doc.importNode(this, true), this);
} | [
"function",
"(",
"doc",
")",
"{",
"if",
"(",
"!",
"doc",
")",
"{",
"doc",
"=",
"document",
";",
"}",
"if",
"(",
"doc",
"===",
"document",
"&&",
"this",
".",
"pool",
".",
"length",
")",
"{",
"return",
"this",
".",
"pool",
".",
"pop",
"(",
")",
... | Creates a new view cloned from this template. | [
"Creates",
"a",
"new",
"view",
"cloned",
"from",
"this",
"template",
"."
] | 5d613ea42c3823423efb01fce4ffef80c7f5ce0f | https://github.com/chip-js/fragments-js/blob/5d613ea42c3823423efb01fce4ffef80c7f5ce0f/src/template.js#L25-L34 | |
37,304 | mikolalysenko/simplify-planar-graph | simplify.js | computeWeight | function computeWeight(i) {
if(dead[i]) {
return Infinity
}
//TODO: Check that the line segment doesn't cross once simplified
var s = inv[i]
var t = outv[i]
if((s<0) || (t<0)) {
return Infinity
} else {
return errorWeight(positions[i], positions[s], positions[t])
}
} | javascript | function computeWeight(i) {
if(dead[i]) {
return Infinity
}
//TODO: Check that the line segment doesn't cross once simplified
var s = inv[i]
var t = outv[i]
if((s<0) || (t<0)) {
return Infinity
} else {
return errorWeight(positions[i], positions[s], positions[t])
}
} | [
"function",
"computeWeight",
"(",
"i",
")",
"{",
"if",
"(",
"dead",
"[",
"i",
"]",
")",
"{",
"return",
"Infinity",
"}",
"//TODO: Check that the line segment doesn't cross once simplified",
"var",
"s",
"=",
"inv",
"[",
"i",
"]",
"var",
"t",
"=",
"outv",
"[",
... | Updates the weight for vertex i | [
"Updates",
"the",
"weight",
"for",
"vertex",
"i"
] | 0338fdadf415f75205a43d8b34329d0553567879 | https://github.com/mikolalysenko/simplify-planar-graph/blob/0338fdadf415f75205a43d8b34329d0553567879/simplify.js#L51-L63 |
37,305 | mikolalysenko/simplify-planar-graph | simplify.js | heapDown | function heapDown(i) {
var w = heapWeight(i)
while(true) {
var tw = w
var left = 2*i + 1
var right = 2*(i + 1)
var next = i
if(left < heapCount) {
var lw = heapWeight(left)
if(lw < tw) {
next = left
tw = lw
}
}
if(right < hea... | javascript | function heapDown(i) {
var w = heapWeight(i)
while(true) {
var tw = w
var left = 2*i + 1
var right = 2*(i + 1)
var next = i
if(left < heapCount) {
var lw = heapWeight(left)
if(lw < tw) {
next = left
tw = lw
}
}
if(right < hea... | [
"function",
"heapDown",
"(",
"i",
")",
"{",
"var",
"w",
"=",
"heapWeight",
"(",
"i",
")",
"while",
"(",
"true",
")",
"{",
"var",
"tw",
"=",
"w",
"var",
"left",
"=",
"2",
"*",
"i",
"+",
"1",
"var",
"right",
"=",
"2",
"*",
"(",
"i",
"+",
"1",... | Bubble element i down the heap | [
"Bubble",
"element",
"i",
"down",
"the",
"heap"
] | 0338fdadf415f75205a43d8b34329d0553567879 | https://github.com/mikolalysenko/simplify-planar-graph/blob/0338fdadf415f75205a43d8b34329d0553567879/simplify.js#L88-L114 |
37,306 | mikolalysenko/simplify-planar-graph | simplify.js | heapUp | function heapUp(i) {
var w = heapWeight(i)
while(i > 0) {
var parent = heapParent(i)
if(parent >= 0) {
var pw = heapWeight(parent)
if(w < pw) {
heapSwap(i, parent)
i = parent
continue
}
}
return i
}
} | javascript | function heapUp(i) {
var w = heapWeight(i)
while(i > 0) {
var parent = heapParent(i)
if(parent >= 0) {
var pw = heapWeight(parent)
if(w < pw) {
heapSwap(i, parent)
i = parent
continue
}
}
return i
}
} | [
"function",
"heapUp",
"(",
"i",
")",
"{",
"var",
"w",
"=",
"heapWeight",
"(",
"i",
")",
"while",
"(",
"i",
">",
"0",
")",
"{",
"var",
"parent",
"=",
"heapParent",
"(",
"i",
")",
"if",
"(",
"parent",
">=",
"0",
")",
"{",
"var",
"pw",
"=",
"hea... | Bubbles element i up the heap | [
"Bubbles",
"element",
"i",
"up",
"the",
"heap"
] | 0338fdadf415f75205a43d8b34329d0553567879 | https://github.com/mikolalysenko/simplify-planar-graph/blob/0338fdadf415f75205a43d8b34329d0553567879/simplify.js#L117-L131 |
37,307 | mikolalysenko/simplify-planar-graph | simplify.js | heapUpdate | function heapUpdate(i, w) {
var a = heap[i]
if(weights[a] === w) {
return i
}
weights[a] = -Infinity
heapUp(i)
heapPop()
weights[a] = w
heapCount += 1
return heapUp(heapCount-1)
} | javascript | function heapUpdate(i, w) {
var a = heap[i]
if(weights[a] === w) {
return i
}
weights[a] = -Infinity
heapUp(i)
heapPop()
weights[a] = w
heapCount += 1
return heapUp(heapCount-1)
} | [
"function",
"heapUpdate",
"(",
"i",
",",
"w",
")",
"{",
"var",
"a",
"=",
"heap",
"[",
"i",
"]",
"if",
"(",
"weights",
"[",
"a",
"]",
"===",
"w",
")",
"{",
"return",
"i",
"}",
"weights",
"[",
"a",
"]",
"=",
"-",
"Infinity",
"heapUp",
"(",
"i",... | Update heap item i | [
"Update",
"heap",
"item",
"i"
] | 0338fdadf415f75205a43d8b34329d0553567879 | https://github.com/mikolalysenko/simplify-planar-graph/blob/0338fdadf415f75205a43d8b34329d0553567879/simplify.js#L146-L157 |
37,308 | chip-js/fragments-js | src/util/animation.js | getComputedCSS | function getComputedCSS(styleName) {
if (this.ownerDocument.defaultView && this.ownerDocument.defaultView.opener) {
return this.ownerDocument.defaultView.getComputedStyle(this)[styleName];
}
return window.getComputedStyle(this)[styleName];
} | javascript | function getComputedCSS(styleName) {
if (this.ownerDocument.defaultView && this.ownerDocument.defaultView.opener) {
return this.ownerDocument.defaultView.getComputedStyle(this)[styleName];
}
return window.getComputedStyle(this)[styleName];
} | [
"function",
"getComputedCSS",
"(",
"styleName",
")",
"{",
"if",
"(",
"this",
".",
"ownerDocument",
".",
"defaultView",
"&&",
"this",
".",
"ownerDocument",
".",
"defaultView",
".",
"opener",
")",
"{",
"return",
"this",
".",
"ownerDocument",
".",
"defaultView",
... | Get the computed style on an element. | [
"Get",
"the",
"computed",
"style",
"on",
"an",
"element",
"."
] | 5d613ea42c3823423efb01fce4ffef80c7f5ce0f | https://github.com/chip-js/fragments-js/blob/5d613ea42c3823423efb01fce4ffef80c7f5ce0f/src/util/animation.js#L23-L28 |
37,309 | chip-js/fragments-js | src/util/animation.js | animateElement | function animateElement(css, options) {
var playback = { onfinish: null };
if (!Array.isArray(css) || css.length !== 2 || !options || !options.hasOwnProperty('duration')) {
Promise.resolve().then(function() {
if (playback.onfinish) {
playback.onfinish();
}
});
return playback;
}
... | javascript | function animateElement(css, options) {
var playback = { onfinish: null };
if (!Array.isArray(css) || css.length !== 2 || !options || !options.hasOwnProperty('duration')) {
Promise.resolve().then(function() {
if (playback.onfinish) {
playback.onfinish();
}
});
return playback;
}
... | [
"function",
"animateElement",
"(",
"css",
",",
"options",
")",
"{",
"var",
"playback",
"=",
"{",
"onfinish",
":",
"null",
"}",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"css",
")",
"||",
"css",
".",
"length",
"!==",
"2",
"||",
"!",
"option... | Very basic polyfill for Element.animate if it doesn't exist. If it does, use the native.
This only supports two css states. It will overwrite existing styles. It doesn't return an animation play control. It
only supports duration, delay, and easing. Returns an object with a property onfinish. | [
"Very",
"basic",
"polyfill",
"for",
"Element",
".",
"animate",
"if",
"it",
"doesn",
"t",
"exist",
".",
"If",
"it",
"does",
"use",
"the",
"native",
".",
"This",
"only",
"supports",
"two",
"css",
"states",
".",
"It",
"will",
"overwrite",
"existing",
"style... | 5d613ea42c3823423efb01fce4ffef80c7f5ce0f | https://github.com/chip-js/fragments-js/blob/5d613ea42c3823423efb01fce4ffef80c7f5ce0f/src/util/animation.js#L35-L91 |
37,310 | HaroldPutman/hubot-encourage | src/index.js | capitalize | function capitalize(str) {
let result = str.trim();
return result.substring(0, 1).toUpperCase() + result.substring(1);
} | javascript | function capitalize(str) {
let result = str.trim();
return result.substring(0, 1).toUpperCase() + result.substring(1);
} | [
"function",
"capitalize",
"(",
"str",
")",
"{",
"let",
"result",
"=",
"str",
".",
"trim",
"(",
")",
";",
"return",
"result",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"result",
".",
"substring",
"(",
"1",
")",
... | Capitalize the first letter in a string. | [
"Capitalize",
"the",
"first",
"letter",
"in",
"a",
"string",
"."
] | bf780dba2ad772d4f73f74e12c312686464a4990 | https://github.com/HaroldPutman/hubot-encourage/blob/bf780dba2ad772d4f73f74e12c312686464a4990/src/index.js#L41-L44 |
37,311 | koggdal/matrixmath | arrays.js | getWithLength | function getWithLength(length) {
var arrays = pool[length];
var array;
var i;
// Create the first array for the specified length
if (!arrays) {
array = create(length);
}
// Find an unused array among the created arrays for the specified length
if (!array) {
for (i = arrays.length; i--;) {
... | javascript | function getWithLength(length) {
var arrays = pool[length];
var array;
var i;
// Create the first array for the specified length
if (!arrays) {
array = create(length);
}
// Find an unused array among the created arrays for the specified length
if (!array) {
for (i = arrays.length; i--;) {
... | [
"function",
"getWithLength",
"(",
"length",
")",
"{",
"var",
"arrays",
"=",
"pool",
"[",
"length",
"]",
";",
"var",
"array",
";",
"var",
"i",
";",
"// Create the first array for the specified length",
"if",
"(",
"!",
"arrays",
")",
"{",
"array",
"=",
"create... | Get an array with the specified length from the pool.
@param {number} length The preferred length of the array.
@return {Array} An array. | [
"Get",
"an",
"array",
"with",
"the",
"specified",
"length",
"from",
"the",
"pool",
"."
] | 4bbc721be90149964bc80221f3afccc1c5f91953 | https://github.com/koggdal/matrixmath/blob/4bbc721be90149964bc80221f3afccc1c5f91953/arrays.js#L34-L61 |
37,312 | koggdal/matrixmath | arrays.js | giveBack | function giveBack(array) {
// Don't return arrays that didn't originate from this pool
if (!array.hasOwnProperty('originalLength')) return;
// Reset all the elements
for (var i = array.length; i--;) {
array[i] = undefined;
}
// Reset the length
array.length = array.originalLength;
// Remove cust... | javascript | function giveBack(array) {
// Don't return arrays that didn't originate from this pool
if (!array.hasOwnProperty('originalLength')) return;
// Reset all the elements
for (var i = array.length; i--;) {
array[i] = undefined;
}
// Reset the length
array.length = array.originalLength;
// Remove cust... | [
"function",
"giveBack",
"(",
"array",
")",
"{",
"// Don't return arrays that didn't originate from this pool",
"if",
"(",
"!",
"array",
".",
"hasOwnProperty",
"(",
"'originalLength'",
")",
")",
"return",
";",
"// Reset all the elements",
"for",
"(",
"var",
"i",
"=",
... | Give back an array to the pool.
This will reset the array to the original length and make all values
undefined.
@param {Array} array An array that was gotten from this pool before. | [
"Give",
"back",
"an",
"array",
"to",
"the",
"pool",
".",
"This",
"will",
"reset",
"the",
"array",
"to",
"the",
"original",
"length",
"and",
"make",
"all",
"values",
"undefined",
"."
] | 4bbc721be90149964bc80221f3afccc1c5f91953 | https://github.com/koggdal/matrixmath/blob/4bbc721be90149964bc80221f3afccc1c5f91953/arrays.js#L70-L89 |
37,313 | koggdal/matrixmath | arrays.js | create | function create(length) {
var array = new Array(length);
// Create a non-enumerable property as a flag to know if the array is in use
Object.defineProperties(array, {
inUse: {
enumerable: false,
writable: true,
value: false
},
originalLength: {
enumerable: false,
value: ... | javascript | function create(length) {
var array = new Array(length);
// Create a non-enumerable property as a flag to know if the array is in use
Object.defineProperties(array, {
inUse: {
enumerable: false,
writable: true,
value: false
},
originalLength: {
enumerable: false,
value: ... | [
"function",
"create",
"(",
"length",
")",
"{",
"var",
"array",
"=",
"new",
"Array",
"(",
"length",
")",
";",
"// Create a non-enumerable property as a flag to know if the array is in use",
"Object",
".",
"defineProperties",
"(",
"array",
",",
"{",
"inUse",
":",
"{",... | Create a new array and add it to the pool for the specified length.
@param {number} length The length of the array to create.
@return {Array} The new array. | [
"Create",
"a",
"new",
"array",
"and",
"add",
"it",
"to",
"the",
"pool",
"for",
"the",
"specified",
"length",
"."
] | 4bbc721be90149964bc80221f3afccc1c5f91953 | https://github.com/koggdal/matrixmath/blob/4bbc721be90149964bc80221f3afccc1c5f91953/arrays.js#L98-L118 |
37,314 | IonicaBizau/typpy | lib/index.js | Typpy | function Typpy(input, target) {
if (arguments.length === 2) {
return Typpy.is(input, target);
}
return Typpy.get(input, true);
} | javascript | function Typpy(input, target) {
if (arguments.length === 2) {
return Typpy.is(input, target);
}
return Typpy.get(input, true);
} | [
"function",
"Typpy",
"(",
"input",
",",
"target",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"2",
")",
"{",
"return",
"Typpy",
".",
"is",
"(",
"input",
",",
"target",
")",
";",
"}",
"return",
"Typpy",
".",
"get",
"(",
"input",
",",
"... | Typpy
Gets the type of the input value or compares it
with a provided type.
Usage:
```js
Typpy({}) // => "object"
Typpy(42, Number); // => true
Typpy.get([], "array"); => true
```
@name Typpy
@function
@param {Anything} input The input value.
@param {Constructor|String} target The target type.
It could be a string (... | [
"Typpy",
"Gets",
"the",
"type",
"of",
"the",
"input",
"value",
"or",
"compares",
"it",
"with",
"a",
"provided",
"type",
"."
] | 158e34a493cadc30e94cfd7dce8666f848fb31e7 | https://github.com/IonicaBizau/typpy/blob/158e34a493cadc30e94cfd7dce8666f848fb31e7/lib/index.js#L27-L32 |
37,315 | sorensen/event-proxy | event-proxy.js | bind | function bind(scope, method) {
var args = slice.call(arguments, 2)
if (typeof method === 'string') {
method = scope[method]
}
if (!method) {
throw new Error('Proxy: method `' + method + '` does not exist')
}
return function() {
return method.apply(scope, concat.apply(args, arguments))
}
} | javascript | function bind(scope, method) {
var args = slice.call(arguments, 2)
if (typeof method === 'string') {
method = scope[method]
}
if (!method) {
throw new Error('Proxy: method `' + method + '` does not exist')
}
return function() {
return method.apply(scope, concat.apply(args, arguments))
}
} | [
"function",
"bind",
"(",
"scope",
",",
"method",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"2",
")",
"if",
"(",
"typeof",
"method",
"===",
"'string'",
")",
"{",
"method",
"=",
"scope",
"[",
"method",
"]",
"}",
"if",... | Call a method of the given scope, prepending any given
args to the function call along with sent arguments
@param {Object} scope of method call
@param {String} method name
@param {...} additional arguments to be used every method call
@return {Object} js object
@api private | [
"Call",
"a",
"method",
"of",
"the",
"given",
"scope",
"prepending",
"any",
"given",
"args",
"to",
"the",
"function",
"call",
"along",
"with",
"sent",
"arguments"
] | 0e299607bb454b875b8d3102503285dde37ebd7a | https://github.com/sorensen/event-proxy/blob/0e299607bb454b875b8d3102503285dde37ebd7a/event-proxy.js#L43-L55 |
37,316 | sorensen/event-proxy | event-proxy.js | proxy | function proxy(scope, map, emitter) {
var args = slice.call(arguments, 3)
, tmp = {}, len, name, methods, method, i
if (isArray(map)) {
len = map.length
while (len--) {
tmp[map[len]] = map[len]
}
map = tmp
}
for (name in map) {
methods = map[name]
if (!isArray(methods)) {
... | javascript | function proxy(scope, map, emitter) {
var args = slice.call(arguments, 3)
, tmp = {}, len, name, methods, method, i
if (isArray(map)) {
len = map.length
while (len--) {
tmp[map[len]] = map[len]
}
map = tmp
}
for (name in map) {
methods = map[name]
if (!isArray(methods)) {
... | [
"function",
"proxy",
"(",
"scope",
",",
"map",
",",
"emitter",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"3",
")",
",",
"tmp",
"=",
"{",
"}",
",",
"len",
",",
"name",
",",
"methods",
",",
"method",
",",
"i",
"if... | Setup all proxy methods, if an array is supplied for the methods
the event will be proxied to a method of the same name
Examples:
proxy()
@param {Object} scope of method calls
@param {Array|Objects} methods to bind
@param {Object} event emitting object
@param {...} additional arguments to be used on every method
@ap... | [
"Setup",
"all",
"proxy",
"methods",
"if",
"an",
"array",
"is",
"supplied",
"for",
"the",
"methods",
"the",
"event",
"will",
"be",
"proxied",
"to",
"a",
"method",
"of",
"the",
"same",
"name"
] | 0e299607bb454b875b8d3102503285dde37ebd7a | https://github.com/sorensen/event-proxy/blob/0e299607bb454b875b8d3102503285dde37ebd7a/event-proxy.js#L72-L99 |
37,317 | chip-js/fragments-js | src/binding.js | function() {
ElementController.call(this, this.observations);
this.observersEnabled = false;
this.listenersEnabled = false;
if (this.expression && this.updated !== Binding.prototype.updated) {
// An observer to observe value changes to the expression within a context
this.observer = this.wa... | javascript | function() {
ElementController.call(this, this.observations);
this.observersEnabled = false;
this.listenersEnabled = false;
if (this.expression && this.updated !== Binding.prototype.updated) {
// An observer to observe value changes to the expression within a context
this.observer = this.wa... | [
"function",
"(",
")",
"{",
"ElementController",
".",
"call",
"(",
"this",
",",
"this",
".",
"observations",
")",
";",
"this",
".",
"observersEnabled",
"=",
"false",
";",
"this",
".",
"listenersEnabled",
"=",
"false",
";",
"if",
"(",
"this",
".",
"express... | Initialize a cloned binding. This happens after a compiled binding on a template is cloned for a view. | [
"Initialize",
"a",
"cloned",
"binding",
".",
"This",
"happens",
"after",
"a",
"compiled",
"binding",
"on",
"a",
"template",
"is",
"cloned",
"for",
"a",
"view",
"."
] | 5d613ea42c3823423efb01fce4ffef80c7f5ce0f | https://github.com/chip-js/fragments-js/blob/5d613ea42c3823423efb01fce4ffef80c7f5ce0f/src/binding.js#L46-L56 | |
37,318 | chip-js/fragments-js | src/binding.js | initNodePath | function initNodePath(node, view) {
var path = [];
while (node !== view) {
var parent = node.parentNode;
path.unshift(indexOf.call(parent.childNodes, node));
node = parent;
}
return path;
} | javascript | function initNodePath(node, view) {
var path = [];
while (node !== view) {
var parent = node.parentNode;
path.unshift(indexOf.call(parent.childNodes, node));
node = parent;
}
return path;
} | [
"function",
"initNodePath",
"(",
"node",
",",
"view",
")",
"{",
"var",
"path",
"=",
"[",
"]",
";",
"while",
"(",
"node",
"!==",
"view",
")",
"{",
"var",
"parent",
"=",
"node",
".",
"parentNode",
";",
"path",
".",
"unshift",
"(",
"indexOf",
".",
"ca... | Creates an array of indexes to help find the same element within a cloned view | [
"Creates",
"an",
"array",
"of",
"indexes",
"to",
"help",
"find",
"the",
"same",
"element",
"within",
"a",
"cloned",
"view"
] | 5d613ea42c3823423efb01fce4ffef80c7f5ce0f | https://github.com/chip-js/fragments-js/blob/5d613ea42c3823423efb01fce4ffef80c7f5ce0f/src/binding.js#L172-L180 |
37,319 | myfreeweb/broccoli-brotli | index.js | BrotliFilter | function BrotliFilter(inputNode, options) {
if (!(this instanceof BrotliFilter))
return new BrotliFilter(inputNode, options);
options = options || {};
this.brotliOptions = {
mode: options.mode || 0,
quality: options.quality || 11,
lgwin: options.lgwin || 22,
lgblock... | javascript | function BrotliFilter(inputNode, options) {
if (!(this instanceof BrotliFilter))
return new BrotliFilter(inputNode, options);
options = options || {};
this.brotliOptions = {
mode: options.mode || 0,
quality: options.quality || 11,
lgwin: options.lgwin || 22,
lgblock... | [
"function",
"BrotliFilter",
"(",
"inputNode",
",",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"BrotliFilter",
")",
")",
"return",
"new",
"BrotliFilter",
"(",
"inputNode",
",",
"options",
")",
";",
"options",
"=",
"options",
"||",
"{",
... | Brotli filter.
@constructor
@param {object} inputNode - Input node.
@param {object} options - Options. | [
"Brotli",
"filter",
"."
] | 07835b0726c59aba761cf4f83cd1c90cda0b2f4e | https://github.com/myfreeweb/broccoli-brotli/blob/07835b0726c59aba761cf4f83cd1c90cda0b2f4e/index.js#L20-L46 |
37,320 | LabsRS-Dev/sdk | dist/dovemax-sdk.esm.js | function (o, cb) {
try {
var reader = new FileReader();
reader.onload = function (event) {
cb && cb(reader.result);
};
reader.readAsText(o);
} catch (error) {
throw error
}
} | javascript | function (o, cb) {
try {
var reader = new FileReader();
reader.onload = function (event) {
cb && cb(reader.result);
};
reader.readAsText(o);
} catch (error) {
throw error
}
} | [
"function",
"(",
"o",
",",
"cb",
")",
"{",
"try",
"{",
"var",
"reader",
"=",
"new",
"FileReader",
"(",
")",
";",
"reader",
".",
"onload",
"=",
"function",
"(",
"event",
")",
"{",
"cb",
"&&",
"cb",
"(",
"reader",
".",
"result",
")",
";",
"}",
";... | Blob data convert to String
@param o Blob obj
@param cb callback function | [
"Blob",
"data",
"convert",
"to",
"String"
] | 5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce | https://github.com/LabsRS-Dev/sdk/blob/5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce/dist/dovemax-sdk.esm.js#L17780-L17790 | |
37,321 | LabsRS-Dev/sdk | dist/dovemax-sdk.esm.js | function (param, allowTypes) {
var t$ = Tool;
allowTypes = allowTypes || [];
if (t$.isUndefinedOrNull(param)) { return [] }
if (allowTypes.findIndex(function (value, index, err) {
return value === t$.getType(param)
}) > -1) {
return [param]
}
if (t$.isArray(param)) { return param... | javascript | function (param, allowTypes) {
var t$ = Tool;
allowTypes = allowTypes || [];
if (t$.isUndefinedOrNull(param)) { return [] }
if (allowTypes.findIndex(function (value, index, err) {
return value === t$.getType(param)
}) > -1) {
return [param]
}
if (t$.isArray(param)) { return param... | [
"function",
"(",
"param",
",",
"allowTypes",
")",
"{",
"var",
"t$",
"=",
"Tool",
";",
"allowTypes",
"=",
"allowTypes",
"||",
"[",
"]",
";",
"if",
"(",
"t$",
".",
"isUndefinedOrNull",
"(",
"param",
")",
")",
"{",
"return",
"[",
"]",
"}",
"if",
"(",
... | param wrapper to Array | [
"param",
"wrapper",
"to",
"Array"
] | 5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce | https://github.com/LabsRS-Dev/sdk/blob/5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce/dist/dovemax-sdk.esm.js#L17810-L17821 | |
37,322 | LabsRS-Dev/sdk | dist/dovemax-sdk.esm.js | function (err) {
var msg = '';
var t$ = Tool;
try {
if (t$.isString(err)) {
msg = err;
} else if (t$.isError(err)) {
msg = err.message;
} else if (t$.isObject(err)) {
var errMsg = [];
for (var p in err) {
if (err.hasOwnProperty(p)) {
er... | javascript | function (err) {
var msg = '';
var t$ = Tool;
try {
if (t$.isString(err)) {
msg = err;
} else if (t$.isError(err)) {
msg = err.message;
} else if (t$.isObject(err)) {
var errMsg = [];
for (var p in err) {
if (err.hasOwnProperty(p)) {
er... | [
"function",
"(",
"err",
")",
"{",
"var",
"msg",
"=",
"''",
";",
"var",
"t$",
"=",
"Tool",
";",
"try",
"{",
"if",
"(",
"t$",
".",
"isString",
"(",
"err",
")",
")",
"{",
"msg",
"=",
"err",
";",
"}",
"else",
"if",
"(",
"t$",
".",
"isError",
"(... | Format error string
@param err error object
@return String | [
"Format",
"error",
"string"
] | 5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce | https://github.com/LabsRS-Dev/sdk/blob/5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce/dist/dovemax-sdk.esm.js#L17833-L17862 | |
37,323 | LabsRS-Dev/sdk | dist/dovemax-sdk.esm.js | function (fileName, fileTypes) {
var _fileNameStr = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length).toLowerCase();
if (fileTypes.indexOf(_fileNameStr) > -1) { return true }
return false
} | javascript | function (fileName, fileTypes) {
var _fileNameStr = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length).toLowerCase();
if (fileTypes.indexOf(_fileNameStr) > -1) { return true }
return false
} | [
"function",
"(",
"fileName",
",",
"fileTypes",
")",
"{",
"var",
"_fileNameStr",
"=",
"fileName",
".",
"substring",
"(",
"fileName",
".",
"lastIndexOf",
"(",
"'.'",
")",
"+",
"1",
",",
"fileName",
".",
"length",
")",
".",
"toLowerCase",
"(",
")",
";",
"... | Check fileName's type in the fileTypes
@param fileName String
@param fileTypes Array []
@return Boolean {true, false} | [
"Check",
"fileName",
"s",
"type",
"in",
"the",
"fileTypes"
] | 5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce | https://github.com/LabsRS-Dev/sdk/blob/5b73ec7e5c50be54cc4bedd34cc2ee0c47db06ce/dist/dovemax-sdk.esm.js#L17899-L17903 | |
37,324 | bluemathsoft/bm-linalg | lib/ops.js | outer | function outer(A, B) {
if (A.shape.length === 1) {
A.reshape([A.shape[0], 1]);
}
else if (A.shape.length === 2) {
if (A.shape[1] !== 1) {
throw new Error('A is not a column vector');
}
}
else {
throw new Error('A has invalid dimensions');
}
if (B.s... | javascript | function outer(A, B) {
if (A.shape.length === 1) {
A.reshape([A.shape[0], 1]);
}
else if (A.shape.length === 2) {
if (A.shape[1] !== 1) {
throw new Error('A is not a column vector');
}
}
else {
throw new Error('A has invalid dimensions');
}
if (B.s... | [
"function",
"outer",
"(",
"A",
",",
"B",
")",
"{",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"===",
"1",
")",
"{",
"A",
".",
"reshape",
"(",
"[",
"A",
".",
"shape",
"[",
"0",
"]",
",",
"1",
"]",
")",
";",
"}",
"else",
"if",
"(",
"A",
... | Compute outer product of two vectors
@param A Vector of shape [m] or [m,1]
@param B Vector of shape [n] or [1,n]
@returns NDArray Matrix of dimension [m,n] | [
"Compute",
"outer",
"product",
"of",
"two",
"vectors"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L354-L381 |
37,325 | bluemathsoft/bm-linalg | lib/ops.js | cholesky | function cholesky(A) {
if (A.shape.length !== 2) {
throw new Error('A is not a matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var copyA = A.clone();
copyA.swapOrder();
lapack.potrf(copyA.data, copyA.shape[0]);
copyA.swapOrder... | javascript | function cholesky(A) {
if (A.shape.length !== 2) {
throw new Error('A is not a matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var copyA = A.clone();
copyA.swapOrder();
lapack.potrf(copyA.data, copyA.shape[0]);
copyA.swapOrder... | [
"function",
"cholesky",
"(",
"A",
")",
"{",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"!==",
"2",
")",
"{",
"throw",
"new",
"Error",
"(",
"'A is not a matrix'",
")",
";",
"}",
"if",
"(",
"A",
".",
"shape",
"[",
"0",
"]",
"!==",
"A",
".",
"sh... | Perform Cholesky decomposition on given Matrix | [
"Perform",
"Cholesky",
"decomposition",
"on",
"given",
"Matrix"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L386-L398 |
37,326 | bluemathsoft/bm-linalg | lib/ops.js | lstsq | function lstsq(A, B, rcond) {
if (rcond === void 0) { rcond = -1; }
var copyA = A.clone();
var copyB = B.clone();
var is_1d = false;
if (copyB.shape.length === 1) {
copyB.reshape([copyB.shape[0], 1]);
is_1d = true;
}
var m;
var n;
m = copyA.shape[0];
n = copyA.sha... | javascript | function lstsq(A, B, rcond) {
if (rcond === void 0) { rcond = -1; }
var copyA = A.clone();
var copyB = B.clone();
var is_1d = false;
if (copyB.shape.length === 1) {
copyB.reshape([copyB.shape[0], 1]);
is_1d = true;
}
var m;
var n;
m = copyA.shape[0];
n = copyA.sha... | [
"function",
"lstsq",
"(",
"A",
",",
"B",
",",
"rcond",
")",
"{",
"if",
"(",
"rcond",
"===",
"void",
"0",
")",
"{",
"rcond",
"=",
"-",
"1",
";",
"}",
"var",
"copyA",
"=",
"A",
".",
"clone",
"(",
")",
";",
"var",
"copyB",
"=",
"B",
".",
"clon... | Return the least-squares solution to a linear matrix equation.
Solves the equation `a x = b` by computing a vector `x` that
minimizes the Euclidean 2-norm `|| b - a x ||^2`. The equation may
be under-, well-, or over- determined (i.e., the number of
linearly independent rows of `a` can be less than, equal to, or
grea... | [
"Return",
"the",
"least",
"-",
"squares",
"solution",
"to",
"a",
"linear",
"matrix",
"equation",
"."
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L503-L557 |
37,327 | bluemathsoft/bm-linalg | lib/ops.js | slogdet | function slogdet(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var m = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var ipiv = new common_1.NDArray({ sh... | javascript | function slogdet(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var m = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var ipiv = new common_1.NDArray({ sh... | [
"function",
"slogdet",
"(",
"A",
")",
"{",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"!==",
"2",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Input is not matrix'",
")",
";",
"}",
"if",
"(",
"A",
".",
"shape",
"[",
"0",
"]",
"!==",
"A",
".",
"s... | Compute sign and natural logarithm of the determinant of given Matrix
If an array has a very small or very large determinant, then a call to
`det` may overflow or underflow. This routine is more robust against such
issues, because it computes the logarithm of the determinant rather than
the determinant itself.
@param A... | [
"Compute",
"sign",
"and",
"natural",
"logarithm",
"of",
"the",
"determinant",
"of",
"given",
"Matrix",
"If",
"an",
"array",
"has",
"a",
"very",
"small",
"or",
"very",
"large",
"determinant",
"then",
"a",
"call",
"to",
"det",
"may",
"overflow",
"or",
"under... | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L567-L602 |
37,328 | bluemathsoft/bm-linalg | lib/ops.js | det | function det(A) {
var _a = slogdet(A), sign = _a[0], log = _a[1];
return sign * Math.exp(log);
} | javascript | function det(A) {
var _a = slogdet(A), sign = _a[0], log = _a[1];
return sign * Math.exp(log);
} | [
"function",
"det",
"(",
"A",
")",
"{",
"var",
"_a",
"=",
"slogdet",
"(",
"A",
")",
",",
"sign",
"=",
"_a",
"[",
"0",
"]",
",",
"log",
"=",
"_a",
"[",
"1",
"]",
";",
"return",
"sign",
"*",
"Math",
".",
"exp",
"(",
"log",
")",
";",
"}"
] | Compute determinant of a matrix
@param A Square matrix to compute determinant | [
"Compute",
"determinant",
"of",
"a",
"matrix"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L608-L611 |
37,329 | bluemathsoft/bm-linalg | lib/ops.js | tril | function tril(A, k) {
if (k === void 0) { k = 0; }
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var copyA = A.clone();
for (var i = 0; i < copyA.shape[0]; i++) {
for (var j = 0; j < copyA.shape[1]; j++) {
if (i < j - k) {
copyA.set... | javascript | function tril(A, k) {
if (k === void 0) { k = 0; }
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var copyA = A.clone();
for (var i = 0; i < copyA.shape[0]; i++) {
for (var j = 0; j < copyA.shape[1]; j++) {
if (i < j - k) {
copyA.set... | [
"function",
"tril",
"(",
"A",
",",
"k",
")",
"{",
"if",
"(",
"k",
"===",
"void",
"0",
")",
"{",
"k",
"=",
"0",
";",
"}",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"!==",
"2",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Input is not matrix'",
... | Create Lower triangular matrix from given matrix | [
"Create",
"Lower",
"triangular",
"matrix",
"from",
"given",
"matrix"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L636-L650 |
37,330 | bluemathsoft/bm-linalg | lib/ops.js | qr | function qr(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var _a = A.shape, m = _a[0], n = _a[1];
if (m === 0 || n === 0) {
throw new Error('Empty matrix');
}
var copyA = A.clone();
var minmn = Math.min(m, n);
copyA.swapOrder();
var tau = ... | javascript | function qr(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var _a = A.shape, m = _a[0], n = _a[1];
if (m === 0 || n === 0) {
throw new Error('Empty matrix');
}
var copyA = A.clone();
var minmn = Math.min(m, n);
copyA.swapOrder();
var tau = ... | [
"function",
"qr",
"(",
"A",
")",
"{",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"!==",
"2",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Input is not matrix'",
")",
";",
"}",
"var",
"_a",
"=",
"A",
".",
"shape",
",",
"m",
"=",
"_a",
"[",
"0",
... | Compute QR decomposition of given Matrix | [
"Compute",
"QR",
"decomposition",
"of",
"given",
"Matrix"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L674-L694 |
37,331 | bluemathsoft/bm-linalg | lib/ops.js | eig | function eig(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var n = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var _a = lapack.geev(copyA.data, n, true... | javascript | function eig(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var n = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var _a = lapack.geev(copyA.data, n, true... | [
"function",
"eig",
"(",
"A",
")",
"{",
"if",
"(",
"A",
".",
"shape",
".",
"length",
"!==",
"2",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Input is not matrix'",
")",
";",
"}",
"if",
"(",
"A",
".",
"shape",
"[",
"0",
"]",
"!==",
"A",
".",
"shape... | Compute Eigen values and left, right eigen vectors of given Matrix | [
"Compute",
"Eigen",
"values",
"and",
"left",
"right",
"eigen",
"vectors",
"of",
"given",
"Matrix"
] | f4b96ec3f39480339898a587bf60b8aba0ad52bf | https://github.com/bluemathsoft/bm-linalg/blob/f4b96ec3f39480339898a587bf60b8aba0ad52bf/lib/ops.js#L699-L742 |
37,332 | derek-duncan/postcss-responsify | index.js | processBreakpoint | function processBreakpoint(root, breakpointOption) {
if (breakpointOption && breakpointOption !== Object(breakpointOption)) {
throw new Error('Breakpoint must be of type Object.');
}
const processedBreakpoint = Object.assign({}, breakpointOption);
let atRule;
/* search current rules to see if one exists... | javascript | function processBreakpoint(root, breakpointOption) {
if (breakpointOption && breakpointOption !== Object(breakpointOption)) {
throw new Error('Breakpoint must be of type Object.');
}
const processedBreakpoint = Object.assign({}, breakpointOption);
let atRule;
/* search current rules to see if one exists... | [
"function",
"processBreakpoint",
"(",
"root",
",",
"breakpointOption",
")",
"{",
"if",
"(",
"breakpointOption",
"&&",
"breakpointOption",
"!==",
"Object",
"(",
"breakpointOption",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Breakpoint must be of type Object.'",
"... | Processes a breakpoint option by creating a PostCSS @media atRule from the options
@param {Object} root Root postcss node
@param {Object} breakpointOption
@param {String} breakpointOption.name
@param {String} breakpointOption.mediaQuery
@return {Object} Processed breakpoint option | [
"Processes",
"a",
"breakpoint",
"option",
"by",
"creating",
"a",
"PostCSS"
] | 2e6a36386892d9c258986fdcd83401c2b3443593 | https://github.com/derek-duncan/postcss-responsify/blob/2e6a36386892d9c258986fdcd83401c2b3443593/index.js#L23-L47 |
37,333 | derek-duncan/postcss-responsify | index.js | processBreakpoints | function processBreakpoints(root, breakpointsOption) {
if (breakpointsOption && !Array.isArray(breakpointsOption)) {
throw new Error('Breakpoints option must be of type Array.');
}
const defaultBreakpoints = [
{
prefix: 'xs-',
mediaQuery: '(max-width: 40em)',
},
{
prefix: 'sm-',... | javascript | function processBreakpoints(root, breakpointsOption) {
if (breakpointsOption && !Array.isArray(breakpointsOption)) {
throw new Error('Breakpoints option must be of type Array.');
}
const defaultBreakpoints = [
{
prefix: 'xs-',
mediaQuery: '(max-width: 40em)',
},
{
prefix: 'sm-',... | [
"function",
"processBreakpoints",
"(",
"root",
",",
"breakpointsOption",
")",
"{",
"if",
"(",
"breakpointsOption",
"&&",
"!",
"Array",
".",
"isArray",
"(",
"breakpointsOption",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Breakpoints option must be of type Array.'... | Provides defaults for the breakpoints options and processes each one
@param {Object} root Root postcss node
@param {Array} breakpointsOption Array of breakpoint objects
@return {Array} Processed breakpoints option | [
"Provides",
"defaults",
"for",
"the",
"breakpoints",
"options",
"and",
"processes",
"each",
"one"
] | 2e6a36386892d9c258986fdcd83401c2b3443593 | https://github.com/derek-duncan/postcss-responsify/blob/2e6a36386892d9c258986fdcd83401c2b3443593/index.js#L55-L81 |
37,334 | derek-duncan/postcss-responsify | index.js | createPrefixedRule | function createPrefixedRule(rule, prefix) {
const prefixLength = prefix.length;
const selectorStart = rule.selector.slice(1, prefixLength + 1);
const isAlreadyPrefixed = selectorStart === prefix;
if (isAlreadyPrefixed) return false;
return rule.clone({
selector: `.${prefix + rule.selector.substring(1)}`,... | javascript | function createPrefixedRule(rule, prefix) {
const prefixLength = prefix.length;
const selectorStart = rule.selector.slice(1, prefixLength + 1);
const isAlreadyPrefixed = selectorStart === prefix;
if (isAlreadyPrefixed) return false;
return rule.clone({
selector: `.${prefix + rule.selector.substring(1)}`,... | [
"function",
"createPrefixedRule",
"(",
"rule",
",",
"prefix",
")",
"{",
"const",
"prefixLength",
"=",
"prefix",
".",
"length",
";",
"const",
"selectorStart",
"=",
"rule",
".",
"selector",
".",
"slice",
"(",
"1",
",",
"prefixLength",
"+",
"1",
")",
";",
"... | Creates a PostCSS rule based on breakpoint options
@param {Object} rule PostCSS rule to duplicate
@param {Object} prefix Prefix for selector
@return {Object} Responsified PostCSS rule | [
"Creates",
"a",
"PostCSS",
"rule",
"based",
"on",
"breakpoint",
"options"
] | 2e6a36386892d9c258986fdcd83401c2b3443593 | https://github.com/derek-duncan/postcss-responsify/blob/2e6a36386892d9c258986fdcd83401c2b3443593/index.js#L89-L98 |
37,335 | derek-duncan/postcss-responsify | index.js | responsifyRule | function responsifyRule(breakpoints) {
/**
* Closure function that handles each @responsive sub rule
* @param {Object} rule
*/
return (rule) => {
/* insert the base rule right before the @responsive rule */
const root = rule.parent.parent;
const clone = rule.clone();
root.insertBefore(rule.... | javascript | function responsifyRule(breakpoints) {
/**
* Closure function that handles each @responsive sub rule
* @param {Object} rule
*/
return (rule) => {
/* insert the base rule right before the @responsive rule */
const root = rule.parent.parent;
const clone = rule.clone();
root.insertBefore(rule.... | [
"function",
"responsifyRule",
"(",
"breakpoints",
")",
"{",
"/**\n * Closure function that handles each @responsive sub rule\n * @param {Object} rule\n */",
"return",
"(",
"rule",
")",
"=>",
"{",
"/* insert the base rule right before the @responsive rule */",
"const",
"root",
"... | Build a new PostCSS rule for every responsive state
@param {Array} breakpoints The processed breakpoints the build the rules off of
@return {Function} | [
"Build",
"a",
"new",
"PostCSS",
"rule",
"for",
"every",
"responsive",
"state"
] | 2e6a36386892d9c258986fdcd83401c2b3443593 | https://github.com/derek-duncan/postcss-responsify/blob/2e6a36386892d9c258986fdcd83401c2b3443593/index.js#L105-L127 |
37,336 | derek-duncan/postcss-responsify | index.js | loopResponsiveRules | function loopResponsiveRules(breakpoints) {
/**
* Closure function that handles each @responsive atRule
* @param {Object} rule
*/
return (rule) => {
const subRules = rule.nodes;
subRules.forEach(responsifyRule(breakpoints));
/* remove the @responsive structure since we've built the responsive r... | javascript | function loopResponsiveRules(breakpoints) {
/**
* Closure function that handles each @responsive atRule
* @param {Object} rule
*/
return (rule) => {
const subRules = rule.nodes;
subRules.forEach(responsifyRule(breakpoints));
/* remove the @responsive structure since we've built the responsive r... | [
"function",
"loopResponsiveRules",
"(",
"breakpoints",
")",
"{",
"/**\n * Closure function that handles each @responsive atRule\n * @param {Object} rule\n */",
"return",
"(",
"rule",
")",
"=>",
"{",
"const",
"subRules",
"=",
"rule",
".",
"nodes",
";",
"subRules",
".",... | Loops through all @responsive atRules in the css to find the rules that need to be responsified.
@param {Array} breakpoints The processed breakpoints to build the rules off of
@return {Function} | [
"Loops",
"through",
"all"
] | 2e6a36386892d9c258986fdcd83401c2b3443593 | https://github.com/derek-duncan/postcss-responsify/blob/2e6a36386892d9c258986fdcd83401c2b3443593/index.js#L134-L145 |
37,337 | peerigon/alamid-schema | lib/processDefinition.js | processDefinition | function processDefinition(definition) {
var fields = [];
var types = {};
var key;
var fieldDefinition;
var type;
for (key in definition) {
if (definition.hasOwnProperty(key)) {
fields.push(key);
fieldDefinition = definition[key];
type = determineTyp... | javascript | function processDefinition(definition) {
var fields = [];
var types = {};
var key;
var fieldDefinition;
var type;
for (key in definition) {
if (definition.hasOwnProperty(key)) {
fields.push(key);
fieldDefinition = definition[key];
type = determineTyp... | [
"function",
"processDefinition",
"(",
"definition",
")",
"{",
"var",
"fields",
"=",
"[",
"]",
";",
"var",
"types",
"=",
"{",
"}",
";",
"var",
"key",
";",
"var",
"fieldDefinition",
";",
"var",
"type",
";",
"for",
"(",
"key",
"in",
"definition",
")",
"... | Normalizes the schema definition and extracts fields and types.
@param {Object} definition
@returns {Object} | [
"Normalizes",
"the",
"schema",
"definition",
"and",
"extracts",
"fields",
"and",
"types",
"."
] | 7faa6e826f485b33ccc2e41b86b5861c61184a3c | https://github.com/peerigon/alamid-schema/blob/7faa6e826f485b33ccc2e41b86b5861c61184a3c/lib/processDefinition.js#L12-L55 |
37,338 | bustardcelly/grunt-forever | tasks/forever-task.js | findProcessWithIndex | function findProcessWithIndex( index, callback ) {
var i, process;
try {
forever.list(false, function(context, list) {
i = list ? list.length : 0;
while( --i > -1 ) {
process = list[i];
if( process.hasOwnProperty('file') &&
process.file === index ) {
break;
... | javascript | function findProcessWithIndex( index, callback ) {
var i, process;
try {
forever.list(false, function(context, list) {
i = list ? list.length : 0;
while( --i > -1 ) {
process = list[i];
if( process.hasOwnProperty('file') &&
process.file === index ) {
break;
... | [
"function",
"findProcessWithIndex",
"(",
"index",
",",
"callback",
")",
"{",
"var",
"i",
",",
"process",
";",
"try",
"{",
"forever",
".",
"list",
"(",
"false",
",",
"function",
"(",
"context",
",",
"list",
")",
"{",
"i",
"=",
"list",
"?",
"list",
"."... | Locates running process previously started by forever based on index file, and notifies callback. Will notify of undefined if not found, other wise the unformatted process object.
@param {String} index Index filename.
@param {Function} callback Delegate method to invoke with either the found process object or un... | [
"Locates",
"running",
"process",
"previously",
"started",
"by",
"forever",
"based",
"on",
"index",
"file",
"and",
"notifies",
"callback",
".",
"Will",
"notify",
"of",
"undefined",
"if",
"not",
"found",
"other",
"wise",
"the",
"unformatted",
"process",
"object",
... | ae91c2fa95229399b51c8bbd1d25ba9552d9669c | https://github.com/bustardcelly/grunt-forever/blob/ae91c2fa95229399b51c8bbd1d25ba9552d9669c/tasks/forever-task.js#L50-L70 |
37,339 | bustardcelly/grunt-forever | tasks/forever-task.js | startForeverWithIndex | function startForeverWithIndex( index, doneCB ) {
log( 'Attempting to start ' + index + ' as daemon.');
var config;
var appendConfig = function(prop, value) {
log('Adding to config: ' + prop + ', ' + value);
if(value !== undefined) {
config[prop] = value;
}
};
done = doneCB || this.async();... | javascript | function startForeverWithIndex( index, doneCB ) {
log( 'Attempting to start ' + index + ' as daemon.');
var config;
var appendConfig = function(prop, value) {
log('Adding to config: ' + prop + ', ' + value);
if(value !== undefined) {
config[prop] = value;
}
};
done = doneCB || this.async();... | [
"function",
"startForeverWithIndex",
"(",
"index",
",",
"doneCB",
")",
"{",
"log",
"(",
"'Attempting to start '",
"+",
"index",
"+",
"' as daemon.'",
")",
";",
"var",
"config",
";",
"var",
"appendConfig",
"=",
"function",
"(",
"prop",
",",
"value",
")",
"{",... | Attempts to start process using the index file.
@param {String} index Filename. | [
"Attempts",
"to",
"start",
"process",
"using",
"the",
"index",
"file",
"."
] | ae91c2fa95229399b51c8bbd1d25ba9552d9669c | https://github.com/bustardcelly/grunt-forever/blob/ae91c2fa95229399b51c8bbd1d25ba9552d9669c/tasks/forever-task.js#L75-L110 |
37,340 | bustardcelly/grunt-forever | tasks/forever-task.js | stopOnProcess | function stopOnProcess(index) {
log( 'Attempting to stop ' + index + '...' );
done = this.async();
findProcessWithIndex( index, function(process) {
if( typeof process !== 'undefined' ) {
log( forever.format(true,[process]) );
forever.stop( index )
.on('stop', function() {
done(... | javascript | function stopOnProcess(index) {
log( 'Attempting to stop ' + index + '...' );
done = this.async();
findProcessWithIndex( index, function(process) {
if( typeof process !== 'undefined' ) {
log( forever.format(true,[process]) );
forever.stop( index )
.on('stop', function() {
done(... | [
"function",
"stopOnProcess",
"(",
"index",
")",
"{",
"log",
"(",
"'Attempting to stop '",
"+",
"index",
"+",
"'...'",
")",
";",
"done",
"=",
"this",
".",
"async",
"(",
")",
";",
"findProcessWithIndex",
"(",
"index",
",",
"function",
"(",
"process",
")",
... | Attempts to stop a process previously started associated with index.
@param {String} index Filename associated with previously started process. | [
"Attempts",
"to",
"stop",
"a",
"process",
"previously",
"started",
"associated",
"with",
"index",
"."
] | ae91c2fa95229399b51c8bbd1d25ba9552d9669c | https://github.com/bustardcelly/grunt-forever/blob/ae91c2fa95229399b51c8bbd1d25ba9552d9669c/tasks/forever-task.js#L115-L137 |
37,341 | bustardcelly/grunt-forever | tasks/forever-task.js | restartOnProcess | function restartOnProcess( index ) {
log( 'Attempting to restart ' + index + '...' );
// generate delegate function to pass with proper contexts.
var startRequest = (function(context, index) {
return function(cb) {
startForeverWithIndex.call(context, index, cb);
};
}(this, index));
done = th... | javascript | function restartOnProcess( index ) {
log( 'Attempting to restart ' + index + '...' );
// generate delegate function to pass with proper contexts.
var startRequest = (function(context, index) {
return function(cb) {
startForeverWithIndex.call(context, index, cb);
};
}(this, index));
done = th... | [
"function",
"restartOnProcess",
"(",
"index",
")",
"{",
"log",
"(",
"'Attempting to restart '",
"+",
"index",
"+",
"'...'",
")",
";",
"// generate delegate function to pass with proper contexts.",
"var",
"startRequest",
"=",
"(",
"function",
"(",
"context",
",",
"inde... | Attempts to stop and restart a process previously started associated with index. If no process found as previously started, just starts a new one.
@param {String} index Filename associated with previously started process. | [
"Attempts",
"to",
"stop",
"and",
"restart",
"a",
"process",
"previously",
"started",
"associated",
"with",
"index",
".",
"If",
"no",
"process",
"found",
"as",
"previously",
"started",
"just",
"starts",
"a",
"new",
"one",
"."
] | ae91c2fa95229399b51c8bbd1d25ba9552d9669c | https://github.com/bustardcelly/grunt-forever/blob/ae91c2fa95229399b51c8bbd1d25ba9552d9669c/tasks/forever-task.js#L142-L164 |
37,342 | atomantic/undermore | libs/es6-shim.js | function(target, source) {
if (!ES.TypeIsObject(target)) {
throw new TypeError('target must be an object');
}
return Array.prototype.reduce.call(arguments, function(target, source) {
if (!ES.TypeIsObject(source)) {
throw new TypeError('source must be a... | javascript | function(target, source) {
if (!ES.TypeIsObject(target)) {
throw new TypeError('target must be an object');
}
return Array.prototype.reduce.call(arguments, function(target, source) {
if (!ES.TypeIsObject(source)) {
throw new TypeError('source must be a... | [
"function",
"(",
"target",
",",
"source",
")",
"{",
"if",
"(",
"!",
"ES",
".",
"TypeIsObject",
"(",
"target",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'target must be an object'",
")",
";",
"}",
"return",
"Array",
".",
"prototype",
".",
"reduce"... | 19.1.3.1 | [
"19",
".",
"1",
".",
"3",
".",
"1"
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/es6-shim.js#L783-L796 | |
37,343 | atomantic/undermore | libs/es6-shim.js | function(C) {
if (!ES.IsCallable(C)) {
throw new TypeError('bad promise constructor');
}
var capability = this;
var resolver = function(resolve, reject) {
capability.resolve = resolve;
capability.reject = reject;
};
capability.promise = ES.Co... | javascript | function(C) {
if (!ES.IsCallable(C)) {
throw new TypeError('bad promise constructor');
}
var capability = this;
var resolver = function(resolve, reject) {
capability.resolve = resolve;
capability.reject = reject;
};
capability.promise = ES.Co... | [
"function",
"(",
"C",
")",
"{",
"if",
"(",
"!",
"ES",
".",
"IsCallable",
"(",
"C",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'bad promise constructor'",
")",
";",
"}",
"var",
"capability",
"=",
"this",
";",
"var",
"resolver",
"=",
"function",
... | "PromiseCapability" in the spec is what most promise implementations call a "deferred". | [
"PromiseCapability",
"in",
"the",
"spec",
"is",
"what",
"most",
"promise",
"implementations",
"call",
"a",
"deferred",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/es6-shim.js#L1091-L1109 | |
37,344 | atomantic/undermore | libs/es6-shim.js | Set | function Set() {
var set = this;
set = emulateES6construct(set);
if (!set._es6set) {
throw new TypeError('bad set');
}
defineProperties(set, {
'[[SetData]]': null,
'_storage': emptyObject()
});
... | javascript | function Set() {
var set = this;
set = emulateES6construct(set);
if (!set._es6set) {
throw new TypeError('bad set');
}
defineProperties(set, {
'[[SetData]]': null,
'_storage': emptyObject()
});
... | [
"function",
"Set",
"(",
")",
"{",
"var",
"set",
"=",
"this",
";",
"set",
"=",
"emulateES6construct",
"(",
"set",
")",
";",
"if",
"(",
"!",
"set",
".",
"_es6set",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'bad set'",
")",
";",
"}",
"definePropertie... | Creating a Map is expensive. To speed up the common case of Sets containing only string or numeric keys, we use an object as backing storage and lazily create a full Map only when required. | [
"Creating",
"a",
"Map",
"is",
"expensive",
".",
"To",
"speed",
"up",
"the",
"common",
"case",
"of",
"Sets",
"containing",
"only",
"string",
"or",
"numeric",
"keys",
"we",
"use",
"an",
"object",
"as",
"backing",
"storage",
"and",
"lazily",
"create",
"a",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/es6-shim.js#L1676-L1702 |
37,345 | atomantic/undermore | libs/es6-shim.js | ensureMap | function ensureMap(set) {
if (!set['[[SetData]]']) {
var m = set['[[SetData]]'] = new collectionShims.Map();
Object.keys(set._storage).forEach(function(k) {
// fast check for leading '$'
if (k.charCodeAt(0) === 36) {
k = k.substri... | javascript | function ensureMap(set) {
if (!set['[[SetData]]']) {
var m = set['[[SetData]]'] = new collectionShims.Map();
Object.keys(set._storage).forEach(function(k) {
// fast check for leading '$'
if (k.charCodeAt(0) === 36) {
k = k.substri... | [
"function",
"ensureMap",
"(",
"set",
")",
"{",
"if",
"(",
"!",
"set",
"[",
"'[[SetData]]'",
"]",
")",
"{",
"var",
"m",
"=",
"set",
"[",
"'[[SetData]]'",
"]",
"=",
"new",
"collectionShims",
".",
"Map",
"(",
")",
";",
"Object",
".",
"keys",
"(",
"set... | Switch from the object backing storage to a full Map. | [
"Switch",
"from",
"the",
"object",
"backing",
"storage",
"to",
"a",
"full",
"Map",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/es6-shim.js#L1715-L1729 |
37,346 | petermbenjamin/exploitalert | src/details.js | details | function details(id) {
return new Promise((resolve, reject) => {
if (!id || id === '') throw new Error('id cannot be blank');
const options = {
method: 'GET',
hostname: 'www.exploitalert.com',
port: null,
path: `/view-details.html?id=${id}`,
headers: {},
};
const req = ... | javascript | function details(id) {
return new Promise((resolve, reject) => {
if (!id || id === '') throw new Error('id cannot be blank');
const options = {
method: 'GET',
hostname: 'www.exploitalert.com',
port: null,
path: `/view-details.html?id=${id}`,
headers: {},
};
const req = ... | [
"function",
"details",
"(",
"id",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"if",
"(",
"!",
"id",
"||",
"id",
"===",
"''",
")",
"throw",
"new",
"Error",
"(",
"'id cannot be blank'",
")",
";",
"const",
... | Get details of an exploit
@param {string} id - id of the exploit | [
"Get",
"details",
"of",
"an",
"exploit"
] | a250d497a6be13db968b72ab0139028d6d1744ac | https://github.com/petermbenjamin/exploitalert/blob/a250d497a6be13db968b72ab0139028d6d1744ac/src/details.js#L8-L40 |
37,347 | infrabel/themes-gnap | raw/ace/mustache/js/classes/Page.js | function(data_dir) {
var data_files = {}
var format = new RegExp("([0-9a-z\\-_]+)\\.(json|csv)$" , "i");
//see if there's a folder for partial data relating to this page or layout
//if so iterate all json/csv files and load the data
var partial_data_folder = data_dir + "/"+$type +"s/partials/" + $name;
var stat... | javascript | function(data_dir) {
var data_files = {}
var format = new RegExp("([0-9a-z\\-_]+)\\.(json|csv)$" , "i");
//see if there's a folder for partial data relating to this page or layout
//if so iterate all json/csv files and load the data
var partial_data_folder = data_dir + "/"+$type +"s/partials/" + $name;
var stat... | [
"function",
"(",
"data_dir",
")",
"{",
"var",
"data_files",
"=",
"{",
"}",
"var",
"format",
"=",
"new",
"RegExp",
"(",
"\"([0-9a-z\\\\-_]+)\\\\.(json|csv)$\"",
",",
"\"i\"",
")",
";",
"//see if there's a folder for partial data relating to this page or layout",
"//if so i... | This functions loads the data related to each page or layout
for a page we load all files in the related directory
for a layout we check the "datas-sources" attribute of our layout_file.json and load them
In your real world application you can load data only when it is needed according to each page inside controllers | [
"This",
"functions",
"loads",
"the",
"data",
"related",
"to",
"each",
"page",
"or",
"layout",
"for",
"a",
"page",
"we",
"load",
"all",
"files",
"in",
"the",
"related",
"directory",
"for",
"a",
"layout",
"we",
"check",
"the",
"datas",
"-",
"sources",
"att... | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/mustache/js/classes/Page.js#L65-L126 | |
37,348 | RoganMurley/hitagi.js | src/world.js | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickStart')) {
system.tickStart(dt);
}
}
);
} | javascript | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickStart')) {
system.tickStart(dt);
}
}
);
} | [
"function",
"(",
"dt",
")",
"{",
"_",
".",
"each",
"(",
"systems",
",",
"function",
"(",
"system",
")",
"{",
"if",
"(",
"_",
".",
"has",
"(",
"system",
",",
"'tickStart'",
")",
")",
"{",
"system",
".",
"tickStart",
"(",
"dt",
")",
";",
"}",
"}"... | Call all registered system's tick start function. | [
"Call",
"all",
"registered",
"system",
"s",
"tick",
"start",
"function",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/world.js#L126-L135 | |
37,349 | RoganMurley/hitagi.js | src/world.js | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'update')) {
_.each(
entities,
function (entity) {
if (!_.isUndefined(ent... | javascript | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'update')) {
_.each(
entities,
function (entity) {
if (!_.isUndefined(ent... | [
"function",
"(",
"dt",
")",
"{",
"_",
".",
"each",
"(",
"systems",
",",
"function",
"(",
"system",
")",
"{",
"if",
"(",
"_",
".",
"has",
"(",
"system",
",",
"'update'",
")",
")",
"{",
"_",
".",
"each",
"(",
"entities",
",",
"function",
"(",
"en... | Call all registered system's update function, passing a timestep. | [
"Call",
"all",
"registered",
"system",
"s",
"update",
"function",
"passing",
"a",
"timestep",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/world.js#L138-L158 | |
37,350 | RoganMurley/hitagi.js | src/world.js | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickEnd')) {
system.tickEnd(dt);
}
}
);
} | javascript | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickEnd')) {
system.tickEnd(dt);
}
}
);
} | [
"function",
"(",
"dt",
")",
"{",
"_",
".",
"each",
"(",
"systems",
",",
"function",
"(",
"system",
")",
"{",
"if",
"(",
"_",
".",
"has",
"(",
"system",
",",
"'tickEnd'",
")",
")",
"{",
"system",
".",
"tickEnd",
"(",
"dt",
")",
";",
"}",
"}",
... | Call all registered system's tick end function. | [
"Call",
"all",
"registered",
"system",
"s",
"tick",
"end",
"function",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/world.js#L161-L170 | |
37,351 | RoganMurley/hitagi.js | src/world.js | function (entity, just) {
_.each(
systems,
function (system) {
if (_.has(system, 'destroy')) {
_.each(system.destroy, function (func, id) {
if (entity.has(id)){
// Only rem... | javascript | function (entity, just) {
_.each(
systems,
function (system) {
if (_.has(system, 'destroy')) {
_.each(system.destroy, function (func, id) {
if (entity.has(id)){
// Only rem... | [
"function",
"(",
"entity",
",",
"just",
")",
"{",
"_",
".",
"each",
"(",
"systems",
",",
"function",
"(",
"system",
")",
"{",
"if",
"(",
"_",
".",
"has",
"(",
"system",
",",
"'destroy'",
")",
")",
"{",
"_",
".",
"each",
"(",
"system",
".",
"des... | Destroys an entity in all registered systems. If 'just' is given, just systems that deal with that component destroy the entity rather than all. | [
"Destroys",
"an",
"entity",
"in",
"all",
"registered",
"systems",
".",
"If",
"just",
"is",
"given",
"just",
"systems",
"that",
"deal",
"with",
"that",
"component",
"destroy",
"the",
"entity",
"rather",
"than",
"all",
"."
] | 6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053 | https://github.com/RoganMurley/hitagi.js/blob/6ad88d8df3af9b1708d70bb0c1f5a7a39ead9053/src/world.js#L200-L220 | |
37,352 | MeLlamoPablo/minimist-string | index.js | function(piece, quote_char) {
// Matches everything that is not a quote or \
var regex = new RegExp("[^" + quote_char + "\\\\]", 'g');
// Remove eveything that is not quote or \
var replaced = piece.replace(regex, '');
// Remove escaped quotes, then remov... | javascript | function(piece, quote_char) {
// Matches everything that is not a quote or \
var regex = new RegExp("[^" + quote_char + "\\\\]", 'g');
// Remove eveything that is not quote or \
var replaced = piece.replace(regex, '');
// Remove escaped quotes, then remov... | [
"function",
"(",
"piece",
",",
"quote_char",
")",
"{",
"// Matches everything that is not a quote or \\\r",
"var",
"regex",
"=",
"new",
"RegExp",
"(",
"\"[^\"",
"+",
"quote_char",
"+",
"\"\\\\\\\\]\"",
",",
"'g'",
")",
";",
"// Remove eveything that is not quote or \\\r... | Counts the number of unescaped quotes that the piece has.
@private
@param {string} piece The piece to evaluate.
@param {string} quote_char The quote character, either " or '.
@return {number} The number of unescaped quotes. | [
"Counts",
"the",
"number",
"of",
"unescaped",
"quotes",
"that",
"the",
"piece",
"has",
"."
] | befbe1a379166ba8942f80a6b1e1b538e9b27291 | https://github.com/MeLlamoPablo/minimist-string/blob/befbe1a379166ba8942f80a6b1e1b538e9b27291/index.js#L55-L66 | |
37,353 | MeLlamoPablo/minimist-string | index.js | function(piece, quote_char, position = 0) {
var i = position - 1; //-1 because we're incrementing it
do {
i = piece.indexOf(quote_char, i+1);
} while(piece.charAt(i-1) === '\\');
return i;
} | javascript | function(piece, quote_char, position = 0) {
var i = position - 1; //-1 because we're incrementing it
do {
i = piece.indexOf(quote_char, i+1);
} while(piece.charAt(i-1) === '\\');
return i;
} | [
"function",
"(",
"piece",
",",
"quote_char",
",",
"position",
"=",
"0",
")",
"{",
"var",
"i",
"=",
"position",
"-",
"1",
";",
"//-1 because we're incrementing it\r",
"do",
"{",
"i",
"=",
"piece",
".",
"indexOf",
"(",
"quote_char",
",",
"i",
"+",
"1",
"... | Returns the index of the first unescaped quote in the piece
@private
@param {string} piece The piece to evaluate.
@param {string} quote_char The quote character, either " or '.
@param {number} [position=0] Where to begin looking in the string
@return {number} The index of the first quote. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"unescaped",
"quote",
"in",
"the",
"piece"
] | befbe1a379166ba8942f80a6b1e1b538e9b27291 | https://github.com/MeLlamoPablo/minimist-string/blob/befbe1a379166ba8942f80a6b1e1b538e9b27291/index.js#L114-L120 | |
37,354 | MeLlamoPablo/minimist-string | index.js | function(pieces, quote_char) {
var unclosed_quote = false;
var result = [];
for (var i = 0; i < pieces.length; i++) {
if (unclosed_quote) {
// Two scenarios. Either we have a closing quote or we don't.
if (hasQuote(pieces[i], quote_char)) {
// If it does, then there are two sce... | javascript | function(pieces, quote_char) {
var unclosed_quote = false;
var result = [];
for (var i = 0; i < pieces.length; i++) {
if (unclosed_quote) {
// Two scenarios. Either we have a closing quote or we don't.
if (hasQuote(pieces[i], quote_char)) {
// If it does, then there are two sce... | [
"function",
"(",
"pieces",
",",
"quote_char",
")",
"{",
"var",
"unclosed_quote",
"=",
"false",
";",
"var",
"result",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"pieces",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"... | Detects strings in params and concatenates them into a single array element.
@private
@param {string[]} pieces An array with every piece of the cli sentence. Initially,
this is sentence.split(' ');
@param {string} quote_char The quote character, either " or '.
@returns {Array} The array with concatenated... | [
"Detects",
"strings",
"in",
"params",
"and",
"concatenates",
"them",
"into",
"a",
"single",
"array",
"element",
"."
] | befbe1a379166ba8942f80a6b1e1b538e9b27291 | https://github.com/MeLlamoPablo/minimist-string/blob/befbe1a379166ba8942f80a6b1e1b538e9b27291/index.js#L130-L220 | |
37,355 | zauni/pngmin | tasks/pngmin.js | runPngquant | function runPngquant(args, callback) {
grunt.log.debug('Trying to spawn "' + options.binary + '" with arguments: ');
grunt.log.debug(args.join(' '));
grunt.util.spawn({
cmd: options.binary,
args: args
}, callback);
} | javascript | function runPngquant(args, callback) {
grunt.log.debug('Trying to spawn "' + options.binary + '" with arguments: ');
grunt.log.debug(args.join(' '));
grunt.util.spawn({
cmd: options.binary,
args: args
}, callback);
} | [
"function",
"runPngquant",
"(",
"args",
",",
"callback",
")",
"{",
"grunt",
".",
"log",
".",
"debug",
"(",
"'Trying to spawn \"'",
"+",
"options",
".",
"binary",
"+",
"'\" with arguments: '",
")",
";",
"grunt",
".",
"log",
".",
"debug",
"(",
"args",
".",
... | Runs pngquant binary
@param {Array} args Command line arguments
@param {Function} callback Callback | [
"Runs",
"pngquant",
"binary"
] | a687761878ad73fc4d4672347671dd75652db9c0 | https://github.com/zauni/pngmin/blob/a687761878ad73fc4d4672347671dd75652db9c0/tasks/pngmin.js#L29-L36 |
37,356 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/date-time/moment.js | addOrSubtractDurationFromMoment | function addOrSubtractDurationFromMoment(mom, duration, isAdding) {
var ms = duration._milliseconds,
d = duration._days,
M = duration._months,
currentDate;
if (ms) {
mom._d.setTime(+mom + ms * isAdding);
}
if (d) {
mom.date(mom... | javascript | function addOrSubtractDurationFromMoment(mom, duration, isAdding) {
var ms = duration._milliseconds,
d = duration._days,
M = duration._months,
currentDate;
if (ms) {
mom._d.setTime(+mom + ms * isAdding);
}
if (d) {
mom.date(mom... | [
"function",
"addOrSubtractDurationFromMoment",
"(",
"mom",
",",
"duration",
",",
"isAdding",
")",
"{",
"var",
"ms",
"=",
"duration",
".",
"_milliseconds",
",",
"d",
"=",
"duration",
".",
"_days",
",",
"M",
"=",
"duration",
".",
"_months",
",",
"currentDate",... | helper function for _.addTime and _.subtractTime | [
"helper",
"function",
"for",
"_",
".",
"addTime",
"and",
"_",
".",
"subtractTime"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/date-time/moment.js#L292-L310 |
37,357 | joshfire/woodman | lib/layouts/jsonlayout.js | function (config, loggerContext) {
config = config || {};
Layout.call(this, config, loggerContext);
this.compact = config.compact || false;
this.depth = config.depth || 2;
this.messageAsObject = config.messageAsObject || false;
} | javascript | function (config, loggerContext) {
config = config || {};
Layout.call(this, config, loggerContext);
this.compact = config.compact || false;
this.depth = config.depth || 2;
this.messageAsObject = config.messageAsObject || false;
} | [
"function",
"(",
"config",
",",
"loggerContext",
")",
"{",
"config",
"=",
"config",
"||",
"{",
"}",
";",
"Layout",
".",
"call",
"(",
"this",
",",
"config",
",",
"loggerContext",
")",
";",
"this",
".",
"compact",
"=",
"config",
".",
"compact",
"||",
"... | Lays out a log event as a JSON string
Configuration parameters that may be used:
- compact: to serialize compact JSON structures. the serialization rather
produces a "prettyprint" JSON structure by default.
- messageAsObject: to serialize the message as an object structure. The
message gets serialized as a string by d... | [
"Lays",
"out",
"a",
"log",
"event",
"as",
"a",
"JSON",
"string"
] | fdc05de2124388780924980e6f27bf4483056d18 | https://github.com/joshfire/woodman/blob/fdc05de2124388780924980e6f27bf4483056d18/lib/layouts/jsonlayout.js#L39-L46 | |
37,358 | carsdotcom/windshieldjs | lib/handler.composer.js | requestHandlerComposer | function requestHandlerComposer(componentMap) {
const buildTemplateData = buildTemplateDataComposer(componentMap);
/**
* @async
* @callback {handler}
*
* Handles an incoming request to a Hapi route configured by a Windshield server.
* The request is handled with by using Windshield t... | javascript | function requestHandlerComposer(componentMap) {
const buildTemplateData = buildTemplateDataComposer(componentMap);
/**
* @async
* @callback {handler}
*
* Handles an incoming request to a Hapi route configured by a Windshield server.
* The request is handled with by using Windshield t... | [
"function",
"requestHandlerComposer",
"(",
"componentMap",
")",
"{",
"const",
"buildTemplateData",
"=",
"buildTemplateDataComposer",
"(",
"componentMap",
")",
";",
"/**\n * @async\n * @callback {handler}\n *\n * Handles an incoming request to a Hapi route configured by a ... | Composes a function that we can use as a Hapi route handler for Windshield.
We can't define the handler function at run-time because we won't know
all the required information until the Windshield plugin is registered. So
this function will build it for us when we're ready.
The resulting handler will use the Hapi Vi... | [
"Composes",
"a",
"function",
"that",
"we",
"can",
"use",
"as",
"a",
"Hapi",
"route",
"handler",
"for",
"Windshield",
"."
] | fddd841c5d9e09251437c9a30cc39700e5e4a1f6 | https://github.com/carsdotcom/windshieldjs/blob/fddd841c5d9e09251437c9a30cc39700e5e4a1f6/lib/handler.composer.js#L16-L59 |
37,359 | atomantic/undermore | libs/lodash.js | baseCompareAscending | function baseCompareAscending(value, other) {
if (value !== other) {
if (value > other || typeof value == 'undefined') {
return 1;
}
if (value < other || typeof other == 'undefined') {
return -1;
}
}
return 0;
} | javascript | function baseCompareAscending(value, other) {
if (value !== other) {
if (value > other || typeof value == 'undefined') {
return 1;
}
if (value < other || typeof other == 'undefined') {
return -1;
}
}
return 0;
} | [
"function",
"baseCompareAscending",
"(",
"value",
",",
"other",
")",
"{",
"if",
"(",
"value",
"!==",
"other",
")",
"{",
"if",
"(",
"value",
">",
"other",
"||",
"typeof",
"value",
"==",
"'undefined'",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"val... | The base implementation of `compareAscending` used to compare values and
sort them in ascending order without guaranteeing a stable sort.
@private
@param {*} value The value to compare to `other`.
@param {*} other The value to compare to `value`.
@returns {number} Returns the sort order indicator for `value`. | [
"The",
"base",
"implementation",
"of",
"compareAscending",
"used",
"to",
"compare",
"values",
"and",
"sort",
"them",
"in",
"ascending",
"order",
"without",
"guaranteeing",
"a",
"stable",
"sort",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L255-L265 |
37,360 | atomantic/undermore | libs/lodash.js | compareMultipleAscending | function compareMultipleAscending(object, other) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length;
while (++index < length) {
var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
if (result) {
... | javascript | function compareMultipleAscending(object, other) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length;
while (++index < length) {
var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
if (result) {
... | [
"function",
"compareMultipleAscending",
"(",
"object",
",",
"other",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"objCriteria",
"=",
"object",
".",
"criteria",
",",
"othCriteria",
"=",
"other",
".",
"criteria",
",",
"length",
"=",
"objCriteria",
".",
"le... | Used by `_.sortBy` to compare multiple properties of each element in a
collection and stable sort them in ascending order.
@private
@param {Object} object The object to compare to `other`.
@param {Object} other The object to compare to `object`.
@returns {number} Returns the sort order indicator for `object`. | [
"Used",
"by",
"_",
".",
"sortBy",
"to",
"compare",
"multiple",
"properties",
"of",
"each",
"element",
"in",
"a",
"collection",
"and",
"stable",
"sort",
"them",
"in",
"ascending",
"order",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L373-L392 |
37,361 | atomantic/undermore | libs/lodash.js | arrayEachRight | function arrayEachRight(array, callback) {
var length = array ? array.length : 0;
while (length--) {
if (callback(array[length], length, array) === false) {
break;
}
}
return array;
} | javascript | function arrayEachRight(array, callback) {
var length = array ? array.length : 0;
while (length--) {
if (callback(array[length], length, array) === false) {
break;
}
}
return array;
} | [
"function",
"arrayEachRight",
"(",
"array",
",",
"callback",
")",
"{",
"var",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
";",
"while",
"(",
"length",
"--",
")",
"{",
"if",
"(",
"callback",
"(",
"array",
"[",
"length",
"]",
",",
... | A specialized version of `_.forEachRight` for arrays without support for
callback shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} callback The function called per iteration.
@returns {Array} Returns `array`. | [
"A",
"specialized",
"version",
"of",
"_",
".",
"forEachRight",
"for",
"arrays",
"without",
"support",
"for",
"callback",
"shorthands",
"or",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L854-L862 |
37,362 | atomantic/undermore | libs/lodash.js | arrayMap | function arrayMap(array, callback) {
var index = -1,
length = array ? array.length >>> 0 : 0,
result = Array(length);
while (++index < length) {
result[index] = callback(array[index], index, array);
}
return result;
} | javascript | function arrayMap(array, callback) {
var index = -1,
length = array ? array.length >>> 0 : 0,
result = Array(length);
while (++index < length) {
result[index] = callback(array[index], index, array);
}
return result;
} | [
"function",
"arrayMap",
"(",
"array",
",",
"callback",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
".",
"length",
">>>",
"0",
":",
"0",
",",
"result",
"=",
"Array",
"(",
"length",
")",
";",
"while",
"(",
"+... | A specialized version of `_.map` for arrays without support for callback
shorthands or `this` binding.
@private
@param {Array} array The array to iterate over.
@param {Function} callback The function called per iteration.
@returns {Array} Returns the new mapped array. | [
"A",
"specialized",
"version",
"of",
"_",
".",
"map",
"for",
"arrays",
"without",
"support",
"for",
"callback",
"shorthands",
"or",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L873-L882 |
37,363 | atomantic/undermore | libs/lodash.js | baseClone | function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
}
}
var isObj = isObject(value);
if (isObj) {
var className = toString.call(value);
if ... | javascript | function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
}
}
var isObj = isObject(value);
if (isObj) {
var className = toString.call(value);
if ... | [
"function",
"baseClone",
"(",
"value",
",",
"isDeep",
",",
"callback",
",",
"stackA",
",",
"stackB",
")",
"{",
"if",
"(",
"callback",
")",
"{",
"var",
"result",
"=",
"callback",
"(",
"value",
")",
";",
"if",
"(",
"typeof",
"result",
"!=",
"'undefined'"... | The base implementation of `_.clone` without argument juggling or support
for `this` binding.
@private
@param {*} value The value to clone.
@param {boolean} [isDeep=false] Specify a deep clone.
@param {Function} [callback] The function to customize cloning values.
@param {Array} [stackA=[]] Tracks traversed source obj... | [
"The",
"base",
"implementation",
"of",
"_",
".",
"clone",
"without",
"argument",
"juggling",
"or",
"support",
"for",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L940-L1012 |
37,364 | atomantic/undermore | libs/lodash.js | baseEach | function baseEach(collection, callback) {
var index = -1,
iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (++index < length) {
if (callback(iterable[index], index, col... | javascript | function baseEach(collection, callback) {
var index = -1,
iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (++index < length) {
if (callback(iterable[index], index, col... | [
"function",
"baseEach",
"(",
"collection",
",",
"callback",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"iterable",
"=",
"collection",
",",
"length",
"=",
"collection",
"?",
"collection",
".",
"length",
":",
"0",
";",
"if",
"(",
"typeof",
"length",
"... | The base implementation of `_.forEach` without support for callback
shorthands or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} callback The function called per iteration.
@returns {Array|Object|string} Returns `collection`. | [
"The",
"base",
"implementation",
"of",
"_",
".",
"forEach",
"without",
"support",
"for",
"callback",
"shorthands",
"or",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1219-L1234 |
37,365 | atomantic/undermore | libs/lodash.js | baseEachRight | function baseEachRight(collection, callback) {
var iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (length--) {
if (callback(iterable[length], length, collection) === false) {
... | javascript | function baseEachRight(collection, callback) {
var iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (length--) {
if (callback(iterable[length], length, collection) === false) {
... | [
"function",
"baseEachRight",
"(",
"collection",
",",
"callback",
")",
"{",
"var",
"iterable",
"=",
"collection",
",",
"length",
"=",
"collection",
"?",
"collection",
".",
"length",
":",
"0",
";",
"if",
"(",
"typeof",
"length",
"==",
"'number'",
"&&",
"leng... | The base implementation of `_.forEachRight` without support for callback
shorthands or `this` binding.
@private
@param {Array|Object|string} collection The collection to iterate over.
@param {Function} callback The function called per iteration.
@returns {Array|Object|string} Returns `collection`. | [
"The",
"base",
"implementation",
"of",
"_",
".",
"forEachRight",
"without",
"support",
"for",
"callback",
"shorthands",
"or",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1245-L1259 |
37,366 | atomantic/undermore | libs/lodash.js | baseFor | function baseFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
... | javascript | function baseFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
... | [
"function",
"baseFor",
"(",
"object",
",",
"callback",
",",
"keysFunc",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"props",
"=",
"keysFunc",
"(",
"object",
")",
",",
"length",
"=",
"props",
".",
"length",
";",
"while",
"(",
"++",
"index",
"<",
"... | The base implementation of `baseForIn` and `baseForOwn` which iterates
over `object` properties returned by `keysFunc` executing the callback
for each property. Callbacks may exit iteration early by explicitly
returning `false`.
@private
@param {Object} object The object to iterate over.
@param {Function} callback The... | [
"The",
"base",
"implementation",
"of",
"baseForIn",
"and",
"baseForOwn",
"which",
"iterates",
"over",
"object",
"properties",
"returned",
"by",
"keysFunc",
"executing",
"the",
"callback",
"for",
"each",
"property",
".",
"Callbacks",
"may",
"exit",
"iteration",
"ea... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1338-L1350 |
37,367 | atomantic/undermore | libs/lodash.js | baseForRight | function baseForRight(object, callback, keysFunc) {
var props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[length];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
} | javascript | function baseForRight(object, callback, keysFunc) {
var props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[length];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
} | [
"function",
"baseForRight",
"(",
"object",
",",
"callback",
",",
"keysFunc",
")",
"{",
"var",
"props",
"=",
"keysFunc",
"(",
"object",
")",
",",
"length",
"=",
"props",
".",
"length",
";",
"while",
"(",
"length",
"--",
")",
"{",
"var",
"key",
"=",
"p... | This function is like `baseFor` except that it iterates over properties
in the opposite order.
@private
@param {Object} object The object to iterate over.
@param {Function} callback The function called per iteration.
@param {Function} keysFunc The function to get the keys of `object`.
@returns {Object} Returns `object... | [
"This",
"function",
"is",
"like",
"baseFor",
"except",
"that",
"it",
"iterates",
"over",
"properties",
"in",
"the",
"opposite",
"order",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1362-L1373 |
37,368 | atomantic/undermore | libs/lodash.js | baseUniq | function baseUniq(array, isSorted, callback) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
var index = -1,
indexOf = getIndexOf(),
prereq = !isSorted && indexOf === baseIndexOf,
isLarge = prereq && createCache && length >= 200,
... | javascript | function baseUniq(array, isSorted, callback) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
var index = -1,
indexOf = getIndexOf(),
prereq = !isSorted && indexOf === baseIndexOf,
isLarge = prereq && createCache && length >= 200,
... | [
"function",
"baseUniq",
"(",
"array",
",",
"isSorted",
",",
"callback",
")",
"{",
"var",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
";",
"if",
"(",
"!",
"length",
")",
"{",
"return",
"[",
"]",
";",
"}",
"var",
"index",
"=",
"-... | The base implementation of `_.uniq` without support for callback shorthands
or `this` binding.
@private
@param {Array} array The array to process.
@param {boolean} [isSorted=false] A flag to indicate that `array` is sorted.
@param {Function} [callback] The function called per iteration.
@returns {Array} Returns the ne... | [
"The",
"base",
"implementation",
"of",
"_",
".",
"uniq",
"without",
"support",
"for",
"callback",
"shorthands",
"or",
"this",
"binding",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1674-L1723 |
37,369 | atomantic/undermore | libs/lodash.js | createAggregator | function createAggregator(setter, initializer) {
return function(collection, callback, thisArg) {
var result = initializer ? initializer() : {};
callback = lodash.createCallback(callback, thisArg, 3);
var index = -1,
length = collection ? collection.length : 0;
if (ty... | javascript | function createAggregator(setter, initializer) {
return function(collection, callback, thisArg) {
var result = initializer ? initializer() : {};
callback = lodash.createCallback(callback, thisArg, 3);
var index = -1,
length = collection ? collection.length : 0;
if (ty... | [
"function",
"createAggregator",
"(",
"setter",
",",
"initializer",
")",
"{",
"return",
"function",
"(",
"collection",
",",
"callback",
",",
"thisArg",
")",
"{",
"var",
"result",
"=",
"initializer",
"?",
"initializer",
"(",
")",
":",
"{",
"}",
";",
"callbac... | Creates a function that aggregates a collection, creating an accumulator
object composed from the results of running each element in the collection
through a callback. The given setter function sets the keys and values of
the accumulator object. If `initializer` is provided will be used to
initialize the accumulator ob... | [
"Creates",
"a",
"function",
"that",
"aggregates",
"a",
"collection",
"creating",
"an",
"accumulator",
"object",
"composed",
"from",
"the",
"results",
"of",
"running",
"each",
"element",
"in",
"the",
"collection",
"through",
"a",
"callback",
".",
"The",
"given",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1821-L1841 |
37,370 | atomantic/undermore | libs/lodash.js | createPad | function createPad(string, length, chars) {
var strLength = string.length;
length = +length;
if (strLength >= length || !nativeIsFinite(length)) {
return '';
}
var padLength = length - strLength;
chars = chars == null ? ' ' : String(chars);
return repeat(chars, ceil(pa... | javascript | function createPad(string, length, chars) {
var strLength = string.length;
length = +length;
if (strLength >= length || !nativeIsFinite(length)) {
return '';
}
var padLength = length - strLength;
chars = chars == null ? ' ' : String(chars);
return repeat(chars, ceil(pa... | [
"function",
"createPad",
"(",
"string",
",",
"length",
",",
"chars",
")",
"{",
"var",
"strLength",
"=",
"string",
".",
"length",
";",
"length",
"=",
"+",
"length",
";",
"if",
"(",
"strLength",
">=",
"length",
"||",
"!",
"nativeIsFinite",
"(",
"length",
... | Creates the pad required for `string` based on the given padding length.
The `chars` string may be truncated if the number of padding characters
exceeds the padding length.
@private
@param {string} string The string to create padding for.
@param {number} [length=0] The padding length.
@param {string} [chars=' '] The s... | [
"Creates",
"the",
"pad",
"required",
"for",
"string",
"based",
"on",
"the",
"given",
"padding",
"length",
".",
"The",
"chars",
"string",
"may",
"be",
"truncated",
"if",
"the",
"number",
"of",
"padding",
"characters",
"exceeds",
"the",
"padding",
"length",
".... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1872-L1882 |
37,371 | atomantic/undermore | libs/lodash.js | createWrapper | function createWrapper(func, bitmask, arity, thisArg, partialArgs, partialRightArgs) {
var isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isPartial = bitmask & PARTIAL_FLAG,
isPartialRight = bitmask & PARTIAL_RIGHT_FLAG;
if (!isBindKey && !isFunction(func))... | javascript | function createWrapper(func, bitmask, arity, thisArg, partialArgs, partialRightArgs) {
var isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isPartial = bitmask & PARTIAL_FLAG,
isPartialRight = bitmask & PARTIAL_RIGHT_FLAG;
if (!isBindKey && !isFunction(func))... | [
"function",
"createWrapper",
"(",
"func",
",",
"bitmask",
",",
"arity",
",",
"thisArg",
",",
"partialArgs",
",",
"partialRightArgs",
")",
"{",
"var",
"isBind",
"=",
"bitmask",
"&",
"BIND_FLAG",
",",
"isBindKey",
"=",
"bitmask",
"&",
"BIND_KEY_FLAG",
",",
"is... | Creates a function that either curries or invokes `func` with an optional
`this` binding and partially applied arguments.
@private
@param {Function|string} func The function or method name to reference.
@param {number} bitmask The bitmask of flags to compose.
The bitmask may be composed of the following flags:
1 - `_... | [
"Creates",
"a",
"function",
"that",
"either",
"curries",
"or",
"invokes",
"func",
"with",
"an",
"optional",
"this",
"binding",
"and",
"partially",
"applied",
"arguments",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L1906-L1985 |
37,372 | atomantic/undermore | libs/lodash.js | shimKeys | function shimKeys(object) {
var keyIndex,
index = -1,
props = keysIn(object),
length = props.length,
objLength = length && object.length,
maxIndex = objLength - 1,
result = [];
var allowIndexes = typeof objLength == 'number' && objLength > 0 &&
... | javascript | function shimKeys(object) {
var keyIndex,
index = -1,
props = keysIn(object),
length = props.length,
objLength = length && object.length,
maxIndex = objLength - 1,
result = [];
var allowIndexes = typeof objLength == 'number' && objLength > 0 &&
... | [
"function",
"shimKeys",
"(",
"object",
")",
"{",
"var",
"keyIndex",
",",
"index",
"=",
"-",
"1",
",",
"props",
"=",
"keysIn",
"(",
"object",
")",
",",
"length",
"=",
"props",
".",
"length",
",",
"objLength",
"=",
"length",
"&&",
"object",
".",
"lengt... | A fallback implementation of `Object.keys` which creates an array of the
own enumerable property names of `object`.
@private
@param {Object} object The object to inspect.
@returns {Array} Returns the array of property names. | [
"A",
"fallback",
"implementation",
"of",
"Object",
".",
"keys",
"which",
"creates",
"an",
"array",
"of",
"the",
"own",
"enumerable",
"property",
"names",
"of",
"object",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L2059-L2079 |
37,373 | atomantic/undermore | libs/lodash.js | findIndex | function findIndex(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return... | javascript | function findIndex(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length) {
if (predicate(array[index], index, array)) {
return index;
}
}
return... | [
"function",
"findIndex",
"(",
"array",
",",
"predicate",
",",
"thisArg",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
";",
"predicate",
"=",
"lodash",
".",
"createCallback",
"(",
"predicat... | This method is like `_.find` except that it returns the index of the first
element the predicate returns truthy for, instead of the element itself.
If a property name is provided for `predicate` the created "_.pluck" style
callback will return the property value of the given element.
If an object is provided for `pre... | [
"This",
"method",
"is",
"like",
"_",
".",
"find",
"except",
"that",
"it",
"returns",
"the",
"index",
"of",
"the",
"first",
"element",
"the",
"predicate",
"returns",
"truthy",
"for",
"instead",
"of",
"the",
"element",
"itself",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L2319-L2330 |
37,374 | atomantic/undermore | libs/lodash.js | rest | function rest(array, predicate, thisArg) {
if (typeof predicate != 'number' && predicate != null) {
var index = -1,
length = array ? array.length : 0,
n = 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length && predicate(array[index]... | javascript | function rest(array, predicate, thisArg) {
if (typeof predicate != 'number' && predicate != null) {
var index = -1,
length = array ? array.length : 0,
n = 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length && predicate(array[index]... | [
"function",
"rest",
"(",
"array",
",",
"predicate",
",",
"thisArg",
")",
"{",
"if",
"(",
"typeof",
"predicate",
"!=",
"'number'",
"&&",
"predicate",
"!=",
"null",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
"."... | Gets all but the first element of `array`.
Note: The `n` and `predicate` arguments are deprecated; replace with
`_.drop` and `_.dropWhile` respectively.
@static
@memberOf _
@alias tail
@category Arrays
@param {Array} array The array to query.
@returns {Array} Returns the slice of `array`.
@example
_.rest([1, 2, 3]);... | [
"Gets",
"all",
"but",
"the",
"first",
"element",
"of",
"array",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L2794-L2810 |
37,375 | atomantic/undermore | libs/lodash.js | slice | function slice(array, start, end) {
var index = -1,
length = array ? array.length : 0;
start = typeof start == 'undefined' ? 0 : (+start || 0);
if (start < 0) {
start = nativeMax(length + start, 0);
} else if (start > length) {
start = length;
}
end = typeo... | javascript | function slice(array, start, end) {
var index = -1,
length = array ? array.length : 0;
start = typeof start == 'undefined' ? 0 : (+start || 0);
if (start < 0) {
start = nativeMax(length + start, 0);
} else if (start > length) {
start = length;
}
end = typeo... | [
"function",
"slice",
"(",
"array",
",",
"start",
",",
"end",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
";",
"start",
"=",
"typeof",
"start",
"==",
"'undefined'",
"?",
"0",
":",
"(... | Slices `array` from the `start` index up to, but not including, the `end` index.
Note: This function is used instead of `Array#slice` to support node lists
in IE < 9 and to ensure dense arrays are returned.
@static
@memberOf _
@category Arrays
@param {Array} array The array to slice.
@param {number} [start=0] The sta... | [
"Slices",
"array",
"from",
"the",
"start",
"index",
"up",
"to",
"but",
"not",
"including",
"the",
"end",
"index",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L2826-L2849 |
37,376 | atomantic/undermore | libs/lodash.js | size | function size(collection) {
var length = collection ? collection.length : 0;
return (typeof length == 'number' && length > -1 && length <= maxSafeInteger)
? length
: keys(collection).length;
} | javascript | function size(collection) {
var length = collection ? collection.length : 0;
return (typeof length == 'number' && length > -1 && length <= maxSafeInteger)
? length
: keys(collection).length;
} | [
"function",
"size",
"(",
"collection",
")",
"{",
"var",
"length",
"=",
"collection",
"?",
"collection",
".",
"length",
":",
"0",
";",
"return",
"(",
"typeof",
"length",
"==",
"'number'",
"&&",
"length",
">",
"-",
"1",
"&&",
"length",
"<=",
"maxSafeIntege... | Gets the size of the collection by returning `collection.length` for arrays
and array-like objects or the number of own enumerable properties for objects.
@static
@memberOf _
@category Collections
@param {Array|Object|string} collection The collection to inspect.
@returns {number} Returns `collection.length` or number... | [
"Gets",
"the",
"size",
"of",
"the",
"collection",
"by",
"returning",
"collection",
".",
"length",
"for",
"arrays",
"and",
"array",
"-",
"like",
"objects",
"or",
"the",
"number",
"of",
"own",
"enumerable",
"properties",
"for",
"objects",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L4410-L4415 |
37,377 | atomantic/undermore | libs/lodash.js | toArray | function toArray(collection) {
var length = collection && collection.length;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
return slice(collection);
}
return values(collection);
} | javascript | function toArray(collection) {
var length = collection && collection.length;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
return slice(collection);
}
return values(collection);
} | [
"function",
"toArray",
"(",
"collection",
")",
"{",
"var",
"length",
"=",
"collection",
"&&",
"collection",
".",
"length",
";",
"if",
"(",
"typeof",
"length",
"==",
"'number'",
"&&",
"length",
">",
"-",
"1",
"&&",
"length",
"<=",
"maxSafeInteger",
")",
"... | Converts `collection` to an array.
@static
@memberOf _
@category Collections
@param {Array|Object|string} collection The collection to convert.
@returns {Array} Returns the new converted array.
@example
(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
// => [2, 3, 4] | [
"Converts",
"collection",
"to",
"an",
"array",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L4573-L4579 |
37,378 | atomantic/undermore | libs/lodash.js | delay | function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
var args = slice(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait);
} | javascript | function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
var args = slice(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait);
} | [
"function",
"delay",
"(",
"func",
",",
"wait",
")",
"{",
"if",
"(",
"!",
"isFunction",
"(",
"func",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"funcErrorText",
")",
";",
"}",
"var",
"args",
"=",
"slice",
"(",
"arguments",
",",
"2",
")",
";",
... | Executes the `func` function after `wait` milliseconds. Additional arguments
will be provided to `func` when it is invoked.
@static
@memberOf _
@category Functions
@param {Function} func The function to delay.
@param {number} wait The number of milliseconds to delay execution.
@param {...*} [args] Arguments to invoke ... | [
"Executes",
"the",
"func",
"function",
"after",
"wait",
"milliseconds",
".",
"Additional",
"arguments",
"will",
"be",
"provided",
"to",
"func",
"when",
"it",
"is",
"invoked",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L5034-L5040 |
37,379 | atomantic/undermore | libs/lodash.js | once | function once(func) {
var ran,
result;
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
// clear the `func` variab... | javascript | function once(func) {
var ran,
result;
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
// clear the `func` variab... | [
"function",
"once",
"(",
"func",
")",
"{",
"var",
"ran",
",",
"result",
";",
"if",
"(",
"!",
"isFunction",
"(",
"func",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"funcErrorText",
")",
";",
"}",
"return",
"function",
"(",
")",
"{",
"if",
"(",... | Creates a function that is restricted to execute `func` once. Repeat calls to
the function will return the value of the first call. The `func` is executed
with the `this` binding of the created function.
@static
@memberOf _
@category Functions
@param {Function} func The function to restrict.
@returns {Function} Return... | [
"Creates",
"a",
"function",
"that",
"is",
"restricted",
"to",
"execute",
"func",
"once",
".",
"Repeat",
"calls",
"to",
"the",
"function",
"will",
"return",
"the",
"value",
"of",
"the",
"first",
"call",
".",
"The",
"func",
"is",
"executed",
"with",
"the",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L5140-L5158 |
37,380 | atomantic/undermore | libs/lodash.js | findKey | function findKey(object, predicate, thisArg) {
predicate = lodash.createCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwn, true);
} | javascript | function findKey(object, predicate, thisArg) {
predicate = lodash.createCallback(predicate, thisArg, 3);
return baseFind(object, predicate, baseForOwn, true);
} | [
"function",
"findKey",
"(",
"object",
",",
"predicate",
",",
"thisArg",
")",
"{",
"predicate",
"=",
"lodash",
".",
"createCallback",
"(",
"predicate",
",",
"thisArg",
",",
"3",
")",
";",
"return",
"baseFind",
"(",
"object",
",",
"predicate",
",",
"baseForO... | This method is like `_.findIndex` except that it returns the key of the
first element the predicate returns truthy for, instead of the element itself.
If a property name is provided for `predicate` the created "_.pluck" style
callback will return the property value of the given element.
If an object is provided for `... | [
"This",
"method",
"is",
"like",
"_",
".",
"findIndex",
"except",
"that",
"it",
"returns",
"the",
"key",
"of",
"the",
"first",
"element",
"the",
"predicate",
"returns",
"truthy",
"for",
"instead",
"of",
"the",
"element",
"itself",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L5584-L5587 |
37,381 | atomantic/undermore | libs/lodash.js | isArguments | function isArguments(value) {
return (value && typeof value == 'object' && typeof value.length == 'number' &&
toString.call(value) == argsClass) || false;
} | javascript | function isArguments(value) {
return (value && typeof value == 'object' && typeof value.length == 'number' &&
toString.call(value) == argsClass) || false;
} | [
"function",
"isArguments",
"(",
"value",
")",
"{",
"return",
"(",
"value",
"&&",
"typeof",
"value",
"==",
"'object'",
"&&",
"typeof",
"value",
".",
"length",
"==",
"'number'",
"&&",
"toString",
".",
"call",
"(",
"value",
")",
"==",
"argsClass",
")",
"||"... | Checks if `value` is an `arguments` object.
@static
@memberOf _
@category Objects
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an `arguments` object, else `false`.
@example
(function() { return _.isArguments(arguments); })();
// => true
_.isArguments([1, 2, 3]);
// => false | [
"Checks",
"if",
"value",
"is",
"an",
"arguments",
"object",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L5855-L5858 |
37,382 | atomantic/undermore | libs/lodash.js | isEmpty | function isEmpty(value) {
var result = true;
if (!value) {
return result;
}
var length = value.length;
if ((length > -1 && length <= maxSafeInteger) &&
(isArray(value) || isString(value) || isArguments(value) ||
(typeof value == 'object' && isFunction(value.sp... | javascript | function isEmpty(value) {
var result = true;
if (!value) {
return result;
}
var length = value.length;
if ((length > -1 && length <= maxSafeInteger) &&
(isArray(value) || isString(value) || isArguments(value) ||
(typeof value == 'object' && isFunction(value.sp... | [
"function",
"isEmpty",
"(",
"value",
")",
"{",
"var",
"result",
"=",
"true",
";",
"if",
"(",
"!",
"value",
")",
"{",
"return",
"result",
";",
"}",
"var",
"length",
"=",
"value",
".",
"length",
";",
"if",
"(",
"(",
"length",
">",
"-",
"1",
"&&",
... | Checks if a collection is empty. A value is considered empty unless it is
an array, array-like object, or string with a length greater than `0` or
an object with own properties.
@static
@memberOf _
@category Objects
@param {Array|Object|string} value The value to inspect.
@returns {boolean} Returns `true` if `value` i... | [
"Checks",
"if",
"a",
"collection",
"is",
"empty",
".",
"A",
"value",
"is",
"considered",
"empty",
"unless",
"it",
"is",
"an",
"array",
"array",
"-",
"like",
"object",
"or",
"string",
"with",
"a",
"length",
"greater",
"than",
"0",
"or",
"an",
"object",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L5977-L5992 |
37,383 | atomantic/undermore | libs/lodash.js | endsWith | function endsWith(string, target, position) {
string = string == null ? '' : String(string);
target = String(target);
var length = string.length;
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
return position ... | javascript | function endsWith(string, target, position) {
string = string == null ? '' : String(string);
target = String(target);
var length = string.length;
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
return position ... | [
"function",
"endsWith",
"(",
"string",
",",
"target",
",",
"position",
")",
"{",
"string",
"=",
"string",
"==",
"null",
"?",
"''",
":",
"String",
"(",
"string",
")",
";",
"target",
"=",
"String",
"(",
"target",
")",
";",
"var",
"length",
"=",
"string... | Checks if `string` ends with a given target string.
@static
@memberOf _
@category Strings
@param {string} [string=''] The string to search.
@param {string} [target] The string to search for.
@param {number} [position=string.length] The position to search from.
@returns {boolean} Returns `true` if the given string ends... | [
"Checks",
"if",
"string",
"ends",
"with",
"a",
"given",
"target",
"string",
"."
] | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L6839-L6846 |
37,384 | atomantic/undermore | libs/lodash.js | pad | function pad(string, length, chars) {
string = string == null ? '' : String(string);
length = +length;
var strLength = string.length;
if (strLength >= length || !nativeIsFinite(length)) {
return string;
}
var mid = (length - strLength) / 2,
leftLength = floor(mid),... | javascript | function pad(string, length, chars) {
string = string == null ? '' : String(string);
length = +length;
var strLength = string.length;
if (strLength >= length || !nativeIsFinite(length)) {
return string;
}
var mid = (length - strLength) / 2,
leftLength = floor(mid),... | [
"function",
"pad",
"(",
"string",
",",
"length",
",",
"chars",
")",
"{",
"string",
"=",
"string",
"==",
"null",
"?",
"''",
":",
"String",
"(",
"string",
")",
";",
"length",
"=",
"+",
"length",
";",
"var",
"strLength",
"=",
"string",
".",
"length",
... | Pads `string` on the left and right sides if it is shorter then the given
padding length. The `chars` string may be truncated if the number of padding
characters can't be evenly divided by the padding length.
@static
@memberOf _
@category Strings
@param {string} [string=''] The string to pad.
@param {number} [length=0... | [
"Pads",
"string",
"on",
"the",
"left",
"and",
"right",
"sides",
"if",
"it",
"is",
"shorter",
"then",
"the",
"given",
"padding",
"length",
".",
"The",
"chars",
"string",
"may",
"be",
"truncated",
"if",
"the",
"number",
"of",
"padding",
"characters",
"can",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L6939-L6953 |
37,385 | atomantic/undermore | libs/lodash.js | padLeft | function padLeft(string, length, chars) {
string = string == null ? '' : String(string);
return createPad(string, length, chars) + string;
} | javascript | function padLeft(string, length, chars) {
string = string == null ? '' : String(string);
return createPad(string, length, chars) + string;
} | [
"function",
"padLeft",
"(",
"string",
",",
"length",
",",
"chars",
")",
"{",
"string",
"=",
"string",
"==",
"null",
"?",
"''",
":",
"String",
"(",
"string",
")",
";",
"return",
"createPad",
"(",
"string",
",",
"length",
",",
"chars",
")",
"+",
"strin... | Pads `string` on the left side if it is shorter then the given padding
length. The `chars` string may be truncated if the number of padding
characters exceeds the padding length.
@static
@memberOf _
@category Strings
@param {string} [string=''] The string to pad.
@param {number} [length=0] The padding length.
@param {... | [
"Pads",
"string",
"on",
"the",
"left",
"side",
"if",
"it",
"is",
"shorter",
"then",
"the",
"given",
"padding",
"length",
".",
"The",
"chars",
"string",
"may",
"be",
"truncated",
"if",
"the",
"number",
"of",
"padding",
"characters",
"exceeds",
"the",
"paddi... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L6978-L6981 |
37,386 | atomantic/undermore | libs/lodash.js | padRight | function padRight(string, length, chars) {
string = string == null ? '' : String(string);
return string + createPad(string, length, chars);
} | javascript | function padRight(string, length, chars) {
string = string == null ? '' : String(string);
return string + createPad(string, length, chars);
} | [
"function",
"padRight",
"(",
"string",
",",
"length",
",",
"chars",
")",
"{",
"string",
"=",
"string",
"==",
"null",
"?",
"''",
":",
"String",
"(",
"string",
")",
";",
"return",
"string",
"+",
"createPad",
"(",
"string",
",",
"length",
",",
"chars",
... | Pads `string` on the right side if it is shorter then the given padding
length. The `chars` string may be truncated if the number of padding
characters exceeds the padding length.
@static
@memberOf _
@category Strings
@param {string} [string=''] The string to pad.
@param {number} [length=0] The padding length.
@param ... | [
"Pads",
"string",
"on",
"the",
"right",
"side",
"if",
"it",
"is",
"shorter",
"then",
"the",
"given",
"padding",
"length",
".",
"The",
"chars",
"string",
"may",
"be",
"truncated",
"if",
"the",
"number",
"of",
"padding",
"characters",
"exceeds",
"the",
"padd... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L7006-L7009 |
37,387 | atomantic/undermore | libs/lodash.js | template | function template(string, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
var settings = lodash.templateSettings;
options = defaults({}, options, sett... | javascript | function template(string, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
var settings = lodash.templateSettings;
options = defaults({}, options, sett... | [
"function",
"template",
"(",
"string",
",",
"data",
",",
"options",
")",
"{",
"// based on John Resig's `tmpl` implementation",
"// http://ejohn.org/blog/javascript-micro-templating/",
"// and Laura Doktorova's doT.js",
"// https://github.com/olado/doT",
"var",
"settings",
"=",
"lo... | Creates a compiled template function that can interpolate data properties
in "interpolate" delimiters, HTML-escaped interpolated data properties in
"escape" delimiters, and execute JavaScript in "evaluate" delimiters. If
a data object is provided the interpolated template string will be returned.
Data properties may be... | [
"Creates",
"a",
"compiled",
"template",
"function",
"that",
"can",
"interpolate",
"data",
"properties",
"in",
"interpolate",
"delimiters",
"HTML",
"-",
"escaped",
"interpolated",
"data",
"properties",
"in",
"escape",
"delimiters",
"and",
"execute",
"JavaScript",
"in... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L7190-L7292 |
37,388 | atomantic/undermore | libs/lodash.js | truncate | function truncate(string, options) {
var length = 30,
omission = '...';
if (options && isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? +options.length || 0 : length;
omission = 'omission' in option... | javascript | function truncate(string, options) {
var length = 30,
omission = '...';
if (options && isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? +options.length || 0 : length;
omission = 'omission' in option... | [
"function",
"truncate",
"(",
"string",
",",
"options",
")",
"{",
"var",
"length",
"=",
"30",
",",
"omission",
"=",
"'...'",
";",
"if",
"(",
"options",
"&&",
"isObject",
"(",
"options",
")",
")",
"{",
"var",
"separator",
"=",
"'separator'",
"in",
"optio... | Truncates `string` if it is longer than the given maximum string length.
The last characters of the truncated string will be replaced with the
omission string which defaults to "...".
@static
@memberOf _
@category Strings
@param {string} [string=''] The string to truncate.
@param {Object|number} [options] The options ... | [
"Truncates",
"string",
"if",
"it",
"is",
"longer",
"than",
"the",
"given",
"maximum",
"string",
"length",
".",
"The",
"last",
"characters",
"of",
"the",
"truncated",
"string",
"will",
"be",
"replaced",
"with",
"the",
"omission",
"string",
"which",
"defaults",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L7412-L7458 |
37,389 | atomantic/undermore | libs/lodash.js | createCallback | function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (type == 'function' || func == null) {
return (typeof thisArg == 'undefined' || !('prototype' in func)) &&
func || baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" and "_.where" styl... | javascript | function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (type == 'function' || func == null) {
return (typeof thisArg == 'undefined' || !('prototype' in func)) &&
func || baseCreateCallback(func, thisArg, argCount);
}
// handle "_.pluck" and "_.where" styl... | [
"function",
"createCallback",
"(",
"func",
",",
"thisArg",
",",
"argCount",
")",
"{",
"var",
"type",
"=",
"typeof",
"func",
";",
"if",
"(",
"type",
"==",
"'function'",
"||",
"func",
"==",
"null",
")",
"{",
"return",
"(",
"typeof",
"thisArg",
"==",
"'un... | Creates a function bound to an optional `thisArg`. If `func` is a property
name the created callback will return the property value for a given element.
If `func` is an object the created callback will return `true` for elements
that contain the equivalent object properties, otherwise it will return `false`.
@static
@... | [
"Creates",
"a",
"function",
"bound",
"to",
"an",
"optional",
"thisArg",
".",
"If",
"func",
"is",
"a",
"property",
"name",
"the",
"created",
"callback",
"will",
"return",
"the",
"property",
"value",
"for",
"a",
"given",
"element",
".",
"If",
"func",
"is",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L7541-L7549 |
37,390 | atomantic/undermore | libs/lodash.js | matches | function matches(source) {
var props = keys(source),
propsLength = props.length,
key = props[0],
value = propsLength && source[key];
// fast path the common case of providing an object with a single
// property containing a primitive value
if (propsLength == 1 && v... | javascript | function matches(source) {
var props = keys(source),
propsLength = props.length,
key = props[0],
value = propsLength && source[key];
// fast path the common case of providing an object with a single
// property containing a primitive value
if (propsLength == 1 && v... | [
"function",
"matches",
"(",
"source",
")",
"{",
"var",
"props",
"=",
"keys",
"(",
"source",
")",
",",
"propsLength",
"=",
"props",
".",
"length",
",",
"key",
"=",
"props",
"[",
"0",
"]",
",",
"value",
"=",
"propsLength",
"&&",
"source",
"[",
"key",
... | Creates a "_.where" style predicate function which performs a deep comparison
between a given object and the `source` object, returning `true` if the given
object has equivalent property values, else `false`.
@static
@memberOf _
@category Utilities
@param {Object} source The object of property values to match.
@return... | [
"Creates",
"a",
"_",
".",
"where",
"style",
"predicate",
"function",
"which",
"performs",
"a",
"deep",
"comparison",
"between",
"a",
"given",
"object",
"and",
"the",
"source",
"object",
"returning",
"true",
"if",
"the",
"given",
"object",
"has",
"equivalent",
... | 6c6d995460c25c1df087b465fdc4d21035b4c7b2 | https://github.com/atomantic/undermore/blob/6c6d995460c25c1df087b465fdc4d21035b4c7b2/libs/lodash.js#L7594-L7627 |
37,391 | naturalatlas/geonames-reader | lib/formatters.js | function(line) {
return {
'id': Number(line[0]),
'geoname_id': Number(line[1]),
'isolanguage': String(line[2]),
'alternate_name': String(line[3]),
'is_preferred': Boolean(line[4]),
'is_short': Boolean(line[5]),
'is_colloquial': Boolean(line[5]),
'is_historic': Boolean(line[6]),
};
} | javascript | function(line) {
return {
'id': Number(line[0]),
'geoname_id': Number(line[1]),
'isolanguage': String(line[2]),
'alternate_name': String(line[3]),
'is_preferred': Boolean(line[4]),
'is_short': Boolean(line[5]),
'is_colloquial': Boolean(line[5]),
'is_historic': Boolean(line[6]),
};
} | [
"function",
"(",
"line",
")",
"{",
"return",
"{",
"'id'",
":",
"Number",
"(",
"line",
"[",
"0",
"]",
")",
",",
"'geoname_id'",
":",
"Number",
"(",
"line",
"[",
"1",
"]",
")",
",",
"'isolanguage'",
":",
"String",
"(",
"line",
"[",
"2",
"]",
")",
... | "alternate names" table formatter.
[0] alternateNameId : the id of this alternate name, int
[1] geonameid : geonameId referring to id in table 'geoname', int
[2] isolanguage : iso 639 language code 2- or 3-characters; 4-characters 'post' for postal codes and 'iata','icao' and faac for airport codes, fr... | [
"alternate",
"names",
"table",
"formatter",
"."
] | 6902a5a5ee10c2552a1737c1e413cd39e3225b53 | https://github.com/naturalatlas/geonames-reader/blob/6902a5a5ee10c2552a1737c1e413cd39e3225b53/lib/formatters.js#L67-L78 | |
37,392 | naturalatlas/geonames-reader | lib/formatters.js | function(line) {
return {
'name': String(line[1]),
'country_code': String(line[0]),
'gmt_offset': Number(line[2]),
'dst_offset': Number(line[3]),
'raw_offset': Number(line[4])
};
} | javascript | function(line) {
return {
'name': String(line[1]),
'country_code': String(line[0]),
'gmt_offset': Number(line[2]),
'dst_offset': Number(line[3]),
'raw_offset': Number(line[4])
};
} | [
"function",
"(",
"line",
")",
"{",
"return",
"{",
"'name'",
":",
"String",
"(",
"line",
"[",
"1",
"]",
")",
",",
"'country_code'",
":",
"String",
"(",
"line",
"[",
"0",
"]",
")",
",",
"'gmt_offset'",
":",
"Number",
"(",
"line",
"[",
"2",
"]",
")"... | "timezones" table formatter.
[0] country_code
[1] id
[2] gmtOffset
[3] dstOffset
[4] rawOffset
@param {array} line
@return {object} | [
"timezones",
"table",
"formatter",
"."
] | 6902a5a5ee10c2552a1737c1e413cd39e3225b53 | https://github.com/naturalatlas/geonames-reader/blob/6902a5a5ee10c2552a1737c1e413cd39e3225b53/lib/formatters.js#L112-L120 | |
37,393 | naturalatlas/geonames-reader | lib/formatters.js | function(line) {
return {
'iso': String(line[0]),
'iso3': String(line[1]),
'iso_numeric': Number(line[2]),
'fips': String(line[3]),
'name': String(line[4]),
'capital': String(line[5]),
'area': Number(line[6]),
'population': Number(line[7]),
'continent': String(line[8]),
'tld': String(lin... | javascript | function(line) {
return {
'iso': String(line[0]),
'iso3': String(line[1]),
'iso_numeric': Number(line[2]),
'fips': String(line[3]),
'name': String(line[4]),
'capital': String(line[5]),
'area': Number(line[6]),
'population': Number(line[7]),
'continent': String(line[8]),
'tld': String(lin... | [
"function",
"(",
"line",
")",
"{",
"return",
"{",
"'iso'",
":",
"String",
"(",
"line",
"[",
"0",
"]",
")",
",",
"'iso3'",
":",
"String",
"(",
"line",
"[",
"1",
"]",
")",
",",
"'iso_numeric'",
":",
"Number",
"(",
"line",
"[",
"2",
"]",
")",
",",... | "countries" table formatter.
[0] ISO
[1] ISO3
[2] ISO-Numeric
[3] fips
[4] Country
[5] Capital
[6] Area(in sq km)
[7] Population
[8] Continent
[9] tld
[10] CurrencyCode
[11] CurrencyName
[12] Phone
[13] Postal Code Format
[14] Postal Code Regex
[15] Languages
[16] geonameId
@param {array} line
@return {obje... | [
"countries",
"table",
"formatter",
"."
] | 6902a5a5ee10c2552a1737c1e413cd39e3225b53 | https://github.com/naturalatlas/geonames-reader/blob/6902a5a5ee10c2552a1737c1e413cd39e3225b53/lib/formatters.js#L164-L184 | |
37,394 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/ace-extra.js | function(name) {
var cookie = document.cookie, e, p = name + "=", b;
if ( !cookie )
return;
b = cookie.indexOf("; " + p);
if ( b == -1 ) {
b = cookie.indexOf(p);
if ( b != 0 )
return null;
} else {
b += 2;
}
e = cookie.indexOf(";", b);
if ( e == -1 )
e = cookie.length;
retur... | javascript | function(name) {
var cookie = document.cookie, e, p = name + "=", b;
if ( !cookie )
return;
b = cookie.indexOf("; " + p);
if ( b == -1 ) {
b = cookie.indexOf(p);
if ( b != 0 )
return null;
} else {
b += 2;
}
e = cookie.indexOf(";", b);
if ( e == -1 )
e = cookie.length;
retur... | [
"function",
"(",
"name",
")",
"{",
"var",
"cookie",
"=",
"document",
".",
"cookie",
",",
"e",
",",
"p",
"=",
"name",
"+",
"\"=\"",
",",
"b",
";",
"if",
"(",
"!",
"cookie",
")",
"return",
";",
"b",
"=",
"cookie",
".",
"indexOf",
"(",
"\"; \"",
"... | The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
Get a cookie. | [
"The",
"following",
"functions",
"are",
"from",
"Cookie",
".",
"js",
"class",
"in",
"TinyMCE",
"Moxiecode",
"used",
"under",
"LGPL",
".",
"Get",
"a",
"cookie",
"."
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/ace-extra.js#L284-L308 | |
37,395 | peerigon/alamid-schema | lib/determineType.js | determineType | function determineType(obj) {
var type;
var typeValue;
var name;
if (value(obj).typeOf(Object)) {
type = obj.type || "Object";
} else {
type = obj;
}
typeValue = value(type);
if (typeValue.typeOf(String)) {
name = type.charAt(0).toUpperCase() + type.substring(1... | javascript | function determineType(obj) {
var type;
var typeValue;
var name;
if (value(obj).typeOf(Object)) {
type = obj.type || "Object";
} else {
type = obj;
}
typeValue = value(type);
if (typeValue.typeOf(String)) {
name = type.charAt(0).toUpperCase() + type.substring(1... | [
"function",
"determineType",
"(",
"obj",
")",
"{",
"var",
"type",
";",
"var",
"typeValue",
";",
"var",
"name",
";",
"if",
"(",
"value",
"(",
"obj",
")",
".",
"typeOf",
"(",
"Object",
")",
")",
"{",
"type",
"=",
"obj",
".",
"type",
"||",
"\"Object\"... | Determine the type of an object. Inspired by mongoose.
@param {*} obj
@returns {string} | [
"Determine",
"the",
"type",
"of",
"an",
"object",
".",
"Inspired",
"by",
"mongoose",
"."
] | 7faa6e826f485b33ccc2e41b86b5861c61184a3c | https://github.com/peerigon/alamid-schema/blob/7faa6e826f485b33ccc2e41b86b5861c61184a3c/lib/determineType.js#L21-L54 |
37,396 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/fullcalendar.js | buildSlotSegLevels | function buildSlotSegLevels(segs) {
var levels = [];
var i, seg;
var j;
for (i=0; i<segs.length; i++) {
seg = segs[i];
// go through all the levels and stop on the first level where there are no collisions
for (j=0; j<levels.length; j++) {
if (!computeSlotSegCollisions(seg, levels[j]).length) {
break... | javascript | function buildSlotSegLevels(segs) {
var levels = [];
var i, seg;
var j;
for (i=0; i<segs.length; i++) {
seg = segs[i];
// go through all the levels and stop on the first level where there are no collisions
for (j=0; j<levels.length; j++) {
if (!computeSlotSegCollisions(seg, levels[j]).length) {
break... | [
"function",
"buildSlotSegLevels",
"(",
"segs",
")",
"{",
"var",
"levels",
"=",
"[",
"]",
";",
"var",
"i",
",",
"seg",
";",
"var",
"j",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"segs",
".",
"length",
";",
"i",
"++",
")",
"{",
"seg",
"=",... | Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is left-to-right, or the rightmost if the calendar is right-to-left. | [
"Builds",
"an",
"array",
"of",
"segments",
"levels",
".",
"The",
"first",
"level",
"will",
"be",
"the",
"leftmost",
"tier",
"of",
"segments",
"if",
"the",
"calendar",
"is",
"left",
"-",
"to",
"-",
"right",
"or",
"the",
"rightmost",
"if",
"the",
"calendar... | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/fullcalendar.js#L4362-L4381 |
37,397 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/fullcalendar.js | computeForwardSlotSegs | function computeForwardSlotSegs(levels) {
var i, level;
var j, seg;
var k;
for (i=0; i<levels.length; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
seg = level[j];
seg.forwardSegs = [];
for (k=i+1; k<levels.length; k++) {
computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);
... | javascript | function computeForwardSlotSegs(levels) {
var i, level;
var j, seg;
var k;
for (i=0; i<levels.length; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
seg = level[j];
seg.forwardSegs = [];
for (k=i+1; k<levels.length; k++) {
computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);
... | [
"function",
"computeForwardSlotSegs",
"(",
"levels",
")",
"{",
"var",
"i",
",",
"level",
";",
"var",
"j",
",",
"seg",
";",
"var",
"k",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"levels",
".",
"length",
";",
"i",
"++",
")",
"{",
"level",
"=... | For every segment, figure out the other segments that are in subsequent levels that also occupy the same vertical space. Accumulate in seg.forwardSegs | [
"For",
"every",
"segment",
"figure",
"out",
"the",
"other",
"segments",
"that",
"are",
"in",
"subsequent",
"levels",
"that",
"also",
"occupy",
"the",
"same",
"vertical",
"space",
".",
"Accumulate",
"in",
"seg",
".",
"forwardSegs"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/fullcalendar.js#L4386-L4403 |
37,398 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/fullcalendar.js | flattenSlotSegLevels | function flattenSlotSegLevels(levels) {
var segs = [];
var i, level;
var j;
for (i=0; i<levels.length; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
segs.push(level[j]);
}
}
return segs;
} | javascript | function flattenSlotSegLevels(levels) {
var segs = [];
var i, level;
var j;
for (i=0; i<levels.length; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
segs.push(level[j]);
}
}
return segs;
} | [
"function",
"flattenSlotSegLevels",
"(",
"levels",
")",
"{",
"var",
"segs",
"=",
"[",
"]",
";",
"var",
"i",
",",
"level",
";",
"var",
"j",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"levels",
".",
"length",
";",
"i",
"++",
")",
"{",
"level"... | Outputs a flat array of segments, from lowest to highest level | [
"Outputs",
"a",
"flat",
"array",
"of",
"segments",
"from",
"lowest",
"to",
"highest",
"level"
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/fullcalendar.js#L4479-L4493 |
37,399 | infrabel/themes-gnap | raw/ace/assets/js/uncompressed/fullcalendar.js | computeSlotSegCollisions | function computeSlotSegCollisions(seg, otherSegs, results) {
results = results || [];
for (var i=0; i<otherSegs.length; i++) {
if (isSlotSegCollision(seg, otherSegs[i])) {
results.push(otherSegs[i]);
}
}
return results;
} | javascript | function computeSlotSegCollisions(seg, otherSegs, results) {
results = results || [];
for (var i=0; i<otherSegs.length; i++) {
if (isSlotSegCollision(seg, otherSegs[i])) {
results.push(otherSegs[i]);
}
}
return results;
} | [
"function",
"computeSlotSegCollisions",
"(",
"seg",
",",
"otherSegs",
",",
"results",
")",
"{",
"results",
"=",
"results",
"||",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"otherSegs",
".",
"length",
";",
"i",
"++",
")",
"{",
"... | Find all the segments in `otherSegs` that vertically collide with `seg`. Append into an optionally-supplied `results` array and return. | [
"Find",
"all",
"the",
"segments",
"in",
"otherSegs",
"that",
"vertically",
"collide",
"with",
"seg",
".",
"Append",
"into",
"an",
"optionally",
"-",
"supplied",
"results",
"array",
"and",
"return",
"."
] | 9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9 | https://github.com/infrabel/themes-gnap/blob/9ffd0026b3908b75b42a9fb95cd6b5c6fe1b13d9/raw/ace/assets/js/uncompressed/fullcalendar.js#L4498-L4508 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.