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
30,200
Jam3/ae-to-json
src/util/getNonObjectValues.js
getTypeOf
function getTypeOf(item) { var type = null; if(item) { var strValue = item.toString(); var isObject = /\[object/.test(strValue); var isFunction = /function/.test(strValue); var isArray = Array.isArray(item); if(isArray) { type = Array; } else if(isFunction) { type = Function; ...
javascript
function getTypeOf(item) { var type = null; if(item) { var strValue = item.toString(); var isObject = /\[object/.test(strValue); var isFunction = /function/.test(strValue); var isArray = Array.isArray(item); if(isArray) { type = Array; } else if(isFunction) { type = Function; ...
[ "function", "getTypeOf", "(", "item", ")", "{", "var", "type", "=", "null", ";", "if", "(", "item", ")", "{", "var", "strValue", "=", "item", ".", "toString", "(", ")", ";", "var", "isObject", "=", "/", "\\[object", "/", ".", "test", "(", "strValue...
for some reason typeof is breaking in AE
[ "for", "some", "reason", "typeof", "is", "breaking", "in", "AE" ]
9c7cf53287c90b9d3d7c72c302a076badf589758
https://github.com/Jam3/ae-to-json/blob/9c7cf53287c90b9d3d7c72c302a076badf589758/src/util/getNonObjectValues.js#L40-L63
30,201
timbeadle/tv4-reporter
lib/reporter.js
extractSchemaLabel
function extractSchemaLabel(schema, limit) { limit = typeof limit === 'undefined' ? strimLimit : limit; var label = ''; if (schema.id) { label = style.accent(schema.id); } if (schema.title) { label += style.accent(label ? ' (' + schema.title + ')' : style.accent(schema.title)); } if (!label) { i...
javascript
function extractSchemaLabel(schema, limit) { limit = typeof limit === 'undefined' ? strimLimit : limit; var label = ''; if (schema.id) { label = style.accent(schema.id); } if (schema.title) { label += style.accent(label ? ' (' + schema.title + ')' : style.accent(schema.title)); } if (!label) { i...
[ "function", "extractSchemaLabel", "(", "schema", ",", "limit", ")", "{", "limit", "=", "typeof", "limit", "===", "'undefined'", "?", "strimLimit", ":", "limit", ";", "var", "label", "=", "''", ";", "if", "(", "schema", ".", "id", ")", "{", "label", "="...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - best-effort
[ "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "...
d489eaa4d4f16d2ac6256785eca2c40031980c1e
https://github.com/timbeadle/tv4-reporter/blob/d489eaa4d4f16d2ac6256785eca2c40031980c1e/lib/reporter.js#L118-L137
30,202
timbeadle/tv4-reporter
lib/reporter.js
extractCTXLabel
function extractCTXLabel(test, limit) { limit = typeof limit === 'undefined' ? strimLimit : limit; var label; if (test.label) { label = style.accent(test.label); } if (!label) { label = style.accent('<no label>') + ' ' + valueStrim(test.value, limit); } return label; }
javascript
function extractCTXLabel(test, limit) { limit = typeof limit === 'undefined' ? strimLimit : limit; var label; if (test.label) { label = style.accent(test.label); } if (!label) { label = style.accent('<no label>') + ' ' + valueStrim(test.value, limit); } return label; }
[ "function", "extractCTXLabel", "(", "test", ",", "limit", ")", "{", "limit", "=", "typeof", "limit", "===", "'undefined'", "?", "strimLimit", ":", "limit", ";", "var", "label", ";", "if", "(", "test", ".", "label", ")", "{", "label", "=", "style", ".",...
best-effort
[ "best", "-", "effort" ]
d489eaa4d4f16d2ac6256785eca2c40031980c1e
https://github.com/timbeadle/tv4-reporter/blob/d489eaa4d4f16d2ac6256785eca2c40031980c1e/lib/reporter.js#L140-L150
30,203
YR/time
index.js
init
function init() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; dayStartsAt = options.dayStartsAt || DEFAULT_DAY_STARTS_AT; nightStartsAt = options.nightStartsAt || DEFAULT_NIGHT_STARTS_AT; }
javascript
function init() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; dayStartsAt = options.dayStartsAt || DEFAULT_DAY_STARTS_AT; nightStartsAt = options.nightStartsAt || DEFAULT_NIGHT_STARTS_AT; }
[ "function", "init", "(", ")", "{", "var", "options", "=", "arguments", ".", "length", ">", "0", "&&", "arguments", "[", "0", "]", "!==", "undefined", "?", "arguments", "[", "0", "]", ":", "{", "}", ";", "dayStartsAt", "=", "options", ".", "dayStartsA...
Initialize with defaults @param {Object} [options] - {Number} dayStartsAt - {Number} nightStartsAt - {Array} parseKeys
[ "Initialize", "with", "defaults" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L50-L55
30,204
YR/time
index.js
clientNow
function clientNow() { var d = new Date(); var offset = -1 * d.getTimezoneOffset(); d.setUTCMinutes(d.getUTCMinutes() + offset); return d.toISOString().replace('Z', minutesToOffsetString(offset)); }
javascript
function clientNow() { var d = new Date(); var offset = -1 * d.getTimezoneOffset(); d.setUTCMinutes(d.getUTCMinutes() + offset); return d.toISOString().replace('Z', minutesToOffsetString(offset)); }
[ "function", "clientNow", "(", ")", "{", "var", "d", "=", "new", "Date", "(", ")", ";", "var", "offset", "=", "-", "1", "*", "d", ".", "getTimezoneOffset", "(", ")", ";", "d", ".", "setUTCMinutes", "(", "d", ".", "getUTCMinutes", "(", ")", "+", "o...
Retrieve timestring for client "now" @returns {String}
[ "Retrieve", "timestring", "for", "client", "now" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L798-L804
30,205
YR/time
index.js
update
function update(instance) { instance.isValid = isValid(instance._date); instance.timeString = instance.toString(); return instance; }
javascript
function update(instance) { instance.isValid = isValid(instance._date); instance.timeString = instance.toString(); return instance; }
[ "function", "update", "(", "instance", ")", "{", "instance", ".", "isValid", "=", "isValid", "(", "instance", ".", "_date", ")", ";", "instance", ".", "timeString", "=", "instance", ".", "toString", "(", ")", ";", "return", "instance", ";", "}" ]
Update 'instance' state @param {Time} instance @returns {Time}
[ "Update", "instance", "state" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L811-L815
30,206
YR/time
index.js
isValid
function isValid(date) { return Object.prototype.toString.call(date) == '[object Date]' && !isNaN(date.getTime()); }
javascript
function isValid(date) { return Object.prototype.toString.call(date) == '[object Date]' && !isNaN(date.getTime()); }
[ "function", "isValid", "(", "date", ")", "{", "return", "Object", ".", "prototype", ".", "toString", ".", "call", "(", "date", ")", "==", "'[object Date]'", "&&", "!", "isNaN", "(", "date", ".", "getTime", "(", ")", ")", ";", "}" ]
Validate 'date' object @param {Date} date @returns {Boolean}
[ "Validate", "date", "object" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L867-L869
30,207
YR/time
index.js
isTime
function isTime(time) { return time != null && time._manipulate != null && time._date != null; }
javascript
function isTime(time) { return time != null && time._manipulate != null && time._date != null; }
[ "function", "isTime", "(", "time", ")", "{", "return", "time", "!=", "null", "&&", "time", ".", "_manipulate", "!=", "null", "&&", "time", ".", "_date", "!=", "null", ";", "}" ]
Determine if 'time' is a Time instance @param {Time} time @returns {Boolean}
[ "Determine", "if", "time", "is", "a", "Time", "instance" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L876-L878
30,208
YR/time
index.js
pad
function pad(value, length) { value = String(value); length = length || 2; while (value.length < length) { value = '0' + value; } return value; }
javascript
function pad(value, length) { value = String(value); length = length || 2; while (value.length < length) { value = '0' + value; } return value; }
[ "function", "pad", "(", "value", ",", "length", ")", "{", "value", "=", "String", "(", "value", ")", ";", "length", "=", "length", "||", "2", ";", "while", "(", "value", ".", "length", "<", "length", ")", "{", "value", "=", "'0'", "+", "value", "...
Pad 'value' with zeros up to desired 'length' @param {String|Number} value @param {Number} [length] @returns {String}
[ "Pad", "value", "with", "zeros", "up", "to", "desired", "length" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L896-L905
30,209
YR/time
index.js
minutesToOffsetString
function minutesToOffsetString(minutes) { var t = String(Math.abs(minutes / 60)).split('.'); var H = pad(t[0]); var m = t[1] ? parseInt(t[1], 10) * 0.6 : 0; var sign = minutes < 0 ? '-' : '+'; return '' + sign + H + ':' + pad(m); }
javascript
function minutesToOffsetString(minutes) { var t = String(Math.abs(minutes / 60)).split('.'); var H = pad(t[0]); var m = t[1] ? parseInt(t[1], 10) * 0.6 : 0; var sign = minutes < 0 ? '-' : '+'; return '' + sign + H + ':' + pad(m); }
[ "function", "minutesToOffsetString", "(", "minutes", ")", "{", "var", "t", "=", "String", "(", "Math", ".", "abs", "(", "minutes", "/", "60", ")", ")", ".", "split", "(", "'.'", ")", ";", "var", "H", "=", "pad", "(", "t", "[", "0", "]", ")", ";...
Convert 'minutes' to offset string @param {Number} minutes @returns {String}
[ "Convert", "minutes", "to", "offset", "string" ]
d5507b8edc0ba1c828256c0d732b8e51033ad82d
https://github.com/YR/time/blob/d5507b8edc0ba1c828256c0d732b8e51033ad82d/index.js#L912-L919
30,210
ryanwalters/sticky-events
sticky-events.js
addSentinels
function addSentinels(container, className, stickySelector = STICKY_SELECTOR) { return Array.from(container.querySelectorAll(stickySelector)).map((stickyElement) => { const sentinel = document.createElement('div'); const stickyParent = stickyElement.parentElement; // Apply styles to the sticky element ...
javascript
function addSentinels(container, className, stickySelector = STICKY_SELECTOR) { return Array.from(container.querySelectorAll(stickySelector)).map((stickyElement) => { const sentinel = document.createElement('div'); const stickyParent = stickyElement.parentElement; // Apply styles to the sticky element ...
[ "function", "addSentinels", "(", "container", ",", "className", ",", "stickySelector", "=", "STICKY_SELECTOR", ")", "{", "return", "Array", ".", "from", "(", "container", ".", "querySelectorAll", "(", "stickySelector", ")", ")", ".", "map", "(", "(", "stickyEl...
Add sticky sentinels @param {Element|HTMLDocument} container @param {String} className @param {string} stickySelector The CSS selector applied to the sticky DOM elements @returns {Array<Element>}
[ "Add", "sticky", "sentinels" ]
39a7a2be10ccc7c51f98231377a57ccafa23f35d
https://github.com/ryanwalters/sticky-events/blob/39a7a2be10ccc7c51f98231377a57ccafa23f35d/sticky-events.js#L230-L281
30,211
ryanwalters/sticky-events
sticky-events.js
getSentinelPosition
function getSentinelPosition(stickyElement, sentinel, className) { const stickyStyle = window.getComputedStyle(stickyElement); const parentStyle = window.getComputedStyle(stickyElement.parentElement); switch (className) { case ClassName.SENTINEL_TOP: return { top: `calc(${stickyStyle.getPropert...
javascript
function getSentinelPosition(stickyElement, sentinel, className) { const stickyStyle = window.getComputedStyle(stickyElement); const parentStyle = window.getComputedStyle(stickyElement.parentElement); switch (className) { case ClassName.SENTINEL_TOP: return { top: `calc(${stickyStyle.getPropert...
[ "function", "getSentinelPosition", "(", "stickyElement", ",", "sentinel", ",", "className", ")", "{", "const", "stickyStyle", "=", "window", ".", "getComputedStyle", "(", "stickyElement", ")", ";", "const", "parentStyle", "=", "window", ".", "getComputedStyle", "(...
Determine the position of the sentinel @param {Element|Node} stickyElement @param {Element|Node} sentinel @param {String} className @returns {Object}
[ "Determine", "the", "position", "of", "the", "sentinel" ]
39a7a2be10ccc7c51f98231377a57ccafa23f35d
https://github.com/ryanwalters/sticky-events/blob/39a7a2be10ccc7c51f98231377a57ccafa23f35d/sticky-events.js#L293-L312
30,212
ryanwalters/sticky-events
sticky-events.js
isSticking
function isSticking(stickyElement) { const topSentinel = stickyElement.previousElementSibling; const stickyOffset = stickyElement.getBoundingClientRect().top; const topSentinelOffset = topSentinel.getBoundingClientRect().top; const difference = Math.round(Math.abs(stickyOffset - topSentinelOffset)); const t...
javascript
function isSticking(stickyElement) { const topSentinel = stickyElement.previousElementSibling; const stickyOffset = stickyElement.getBoundingClientRect().top; const topSentinelOffset = topSentinel.getBoundingClientRect().top; const difference = Math.round(Math.abs(stickyOffset - topSentinelOffset)); const t...
[ "function", "isSticking", "(", "stickyElement", ")", "{", "const", "topSentinel", "=", "stickyElement", ".", "previousElementSibling", ";", "const", "stickyOffset", "=", "stickyElement", ".", "getBoundingClientRect", "(", ")", ".", "top", ";", "const", "topSentinelO...
Determine if the sticky element is currently sticking in the browser @param {Element} stickyElement @returns {boolean}
[ "Determine", "if", "the", "sticky", "element", "is", "currently", "sticking", "in", "the", "browser" ]
39a7a2be10ccc7c51f98231377a57ccafa23f35d
https://github.com/ryanwalters/sticky-events/blob/39a7a2be10ccc7c51f98231377a57ccafa23f35d/sticky-events.js#L322-L332
30,213
intelie/immutable-js-diff
src/lcs.js
computeLcsMatrix
function computeLcsMatrix(xs, ys) { var n = xs.size||0; var m = ys.size||0; var a = makeMatrix(n + 1, m + 1, 0); for (var i = 0; i < n; i++) { for (var j = 0; j < m; j++) { if (Immutable.is(xs.get(i), ys.get(j))) { a[i + 1][j + 1] = a[i][j] + 1; } else { a[i + 1][j + 1] = ...
javascript
function computeLcsMatrix(xs, ys) { var n = xs.size||0; var m = ys.size||0; var a = makeMatrix(n + 1, m + 1, 0); for (var i = 0; i < n; i++) { for (var j = 0; j < m; j++) { if (Immutable.is(xs.get(i), ys.get(j))) { a[i + 1][j + 1] = a[i][j] + 1; } else { a[i + 1][j + 1] = ...
[ "function", "computeLcsMatrix", "(", "xs", ",", "ys", ")", "{", "var", "n", "=", "xs", ".", "size", "||", "0", ";", "var", "m", "=", "ys", ".", "size", "||", "0", ";", "var", "a", "=", "makeMatrix", "(", "n", "+", "1", ",", "m", "+", "1", "...
Computes the Longest Common Subsequence table @param xs Indexed Sequence 1 @param ys Indexed Sequence 2
[ "Computes", "the", "Longest", "Common", "Subsequence", "table" ]
0c1b48516368c6c955a36cba10d74dcffa361ec8
https://github.com/intelie/immutable-js-diff/blob/0c1b48516368c6c955a36cba10d74dcffa361ec8/src/lcs.js#L100-L117
30,214
intelie/immutable-js-diff
src/lcs.js
function(xs, ys, matrix){ var lcs = []; for(var i = xs.size, j = ys.size; i !== 0 && j !== 0;){ if (matrix[i][j] === matrix[i-1][j]){ i--; } else if (matrix[i][j] === matrix[i][j-1]){ j--; } else{ if(Immutable.is(xs.get(i-1), ys.get(j-1))){ lcs.push(xs.get(i-1)); i--; j--; ...
javascript
function(xs, ys, matrix){ var lcs = []; for(var i = xs.size, j = ys.size; i !== 0 && j !== 0;){ if (matrix[i][j] === matrix[i-1][j]){ i--; } else if (matrix[i][j] === matrix[i][j-1]){ j--; } else{ if(Immutable.is(xs.get(i-1), ys.get(j-1))){ lcs.push(xs.get(i-1)); i--; j--; ...
[ "function", "(", "xs", ",", "ys", ",", "matrix", ")", "{", "var", "lcs", "=", "[", "]", ";", "for", "(", "var", "i", "=", "xs", ".", "size", ",", "j", "=", "ys", ".", "size", ";", "i", "!==", "0", "&&", "j", "!==", "0", ";", ")", "{", "...
Extracts a LCS from matrix M @param xs Indexed Sequence 1 @param ys Indexed Sequence 2 @param matrix LCS Matrix @returns {Array.<T>} Longest Common Subsequence
[ "Extracts", "a", "LCS", "from", "matrix", "M" ]
0c1b48516368c6c955a36cba10d74dcffa361ec8
https://github.com/intelie/immutable-js-diff/blob/0c1b48516368c6c955a36cba10d74dcffa361ec8/src/lcs.js#L126-L140
30,215
nolanlawson/vdom-serialized-patch
lib/serialize/index.js
serializeCurrentNode
function serializeCurrentNode(currentNode) { var children = currentNode.children; if (!children) { return null; } var len = children.length; var arr = new Array(len); var i = -1; while (++i < len) { arr[i] = serializeCurrentNode(children[i]); } if (currentNode.count) { return [arr, current...
javascript
function serializeCurrentNode(currentNode) { var children = currentNode.children; if (!children) { return null; } var len = children.length; var arr = new Array(len); var i = -1; while (++i < len) { arr[i] = serializeCurrentNode(children[i]); } if (currentNode.count) { return [arr, current...
[ "function", "serializeCurrentNode", "(", "currentNode", ")", "{", "var", "children", "=", "currentNode", ".", "children", ";", "if", "(", "!", "children", ")", "{", "return", "null", ";", "}", "var", "len", "=", "children", ".", "length", ";", "var", "ar...
traverse the thing that the original patch structure called "a', i.e. the virtual tree representing the current node structure. this thing only really needs two properties - "children" and "count", so trim out everything else
[ "traverse", "the", "thing", "that", "the", "original", "patch", "structure", "called", "a", "i", ".", "e", ".", "the", "virtual", "tree", "representing", "the", "current", "node", "structure", ".", "this", "thing", "only", "really", "needs", "two", "properti...
158af827e062dac63a626b938f7fa32e55b70b46
https://github.com/nolanlawson/vdom-serialized-patch/blob/158af827e062dac63a626b938f7fa32e55b70b46/lib/serialize/index.js#L8-L24
30,216
SPANDigital/presidium-core
src/config.js
resolveConfig
function resolveConfig(conf, version = '') { conf['siteroot'] = conf.baseurl || '/'; if (version) { conf['baseurl'] = path.join(conf.siteroot, version); } for (let key in conf) { if (CONFIG_VAR_REGEX.test(conf[key])) { conf[key] = resolve(conf[key], conf, [key]); } } return conf; }
javascript
function resolveConfig(conf, version = '') { conf['siteroot'] = conf.baseurl || '/'; if (version) { conf['baseurl'] = path.join(conf.siteroot, version); } for (let key in conf) { if (CONFIG_VAR_REGEX.test(conf[key])) { conf[key] = resolve(conf[key], conf, [key]); } } return conf; }
[ "function", "resolveConfig", "(", "conf", ",", "version", "=", "''", ")", "{", "conf", "[", "'siteroot'", "]", "=", "conf", ".", "baseurl", "||", "'/'", ";", "if", "(", "version", ")", "{", "conf", "[", "'baseurl'", "]", "=", "path", ".", "join", "...
Helper function that resolves any variable depenencies in the config. @param {String} version - The version number supplied. @param {Object} conf - The parsed config file.
[ "Helper", "function", "that", "resolves", "any", "variable", "depenencies", "in", "the", "config", "." ]
8d3034d97ef85f95391a14bd895898a0ab2e92ed
https://github.com/SPANDigital/presidium-core/blob/8d3034d97ef85f95391a14bd895898a0ab2e92ed/src/config.js#L79-L91
30,217
SPANDigital/presidium-core
src/config.js
resolve
function resolve(value, conf, ring = []) { value.match(CONFIG_VAR_REGEX).forEach((variable) => { const key = variable.substring(variable.lastIndexOf('${') + 2, variable.lastIndexOf('}')); if (ring.includes(key)) { throw `Circular dependency error: cannot resolve variable(s) ${ring}.`; } ring.push(key); ...
javascript
function resolve(value, conf, ring = []) { value.match(CONFIG_VAR_REGEX).forEach((variable) => { const key = variable.substring(variable.lastIndexOf('${') + 2, variable.lastIndexOf('}')); if (ring.includes(key)) { throw `Circular dependency error: cannot resolve variable(s) ${ring}.`; } ring.push(key); ...
[ "function", "resolve", "(", "value", ",", "conf", ",", "ring", "=", "[", "]", ")", "{", "value", ".", "match", "(", "CONFIG_VAR_REGEX", ")", ".", "forEach", "(", "(", "variable", ")", "=>", "{", "const", "key", "=", "variable", ".", "substring", "(",...
Recursively resolve variable depedencies. @param {String} value - String to resolve of dependencies. @param {Dictionary} conf - The parsed config file. @param {Array} ring - An array of previously seen keys.
[ "Recursively", "resolve", "variable", "depedencies", "." ]
8d3034d97ef85f95391a14bd895898a0ab2e92ed
https://github.com/SPANDigital/presidium-core/blob/8d3034d97ef85f95391a14bd895898a0ab2e92ed/src/config.js#L99-L119
30,218
holidayextras/hxTracer
index.js
timeAndLog
function timeAndLog(text) { if (active) { var spaces = space.substring(0, currentIndentation); console.error('TRACER TXT', meaningfulTime(), spaces, text); } }
javascript
function timeAndLog(text) { if (active) { var spaces = space.substring(0, currentIndentation); console.error('TRACER TXT', meaningfulTime(), spaces, text); } }
[ "function", "timeAndLog", "(", "text", ")", "{", "if", "(", "active", ")", "{", "var", "spaces", "=", "space", ".", "substring", "(", "0", ",", "currentIndentation", ")", ";", "console", ".", "error", "(", "'TRACER TXT'", ",", "meaningfulTime", "(", ")",...
Grab a timestamp and add it to the tracers output
[ "Grab", "a", "timestamp", "and", "add", "it", "to", "the", "tracers", "output" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L58-L63
30,219
holidayextras/hxTracer
index.js
processModules
function processModules(item) { if (item.exports && !item._traced) { bootstrap(item, 'exports', item.filename); item._traced = true; } if (item.children) { item.children.map(processModules); } }
javascript
function processModules(item) { if (item.exports && !item._traced) { bootstrap(item, 'exports', item.filename); item._traced = true; } if (item.children) { item.children.map(processModules); } }
[ "function", "processModules", "(", "item", ")", "{", "if", "(", "item", ".", "exports", "&&", "!", "item", ".", "_traced", ")", "{", "bootstrap", "(", "item", ",", "'exports'", ",", "item", ".", "filename", ")", ";", "item", ".", "_traced", "=", "tru...
This iterates over every module in the project and attempts to bootstrap each one in turn
[ "This", "iterates", "over", "every", "module", "in", "the", "project", "and", "attempts", "to", "bootstrap", "each", "one", "in", "turn" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L67-L75
30,220
holidayextras/hxTracer
index.js
bootstrap
function bootstrap(item, prop, path) { if ( (path.split('node_modules').length > 2) || (path.slice(-4) == 'emit') || (item == require('util') && (prop=='format')) ) return; if (!item.hasOwnProperty(prop) || Object.getOwnPropertyDescriptor(item, prop).get) return; var original = item[prop]; if (allFuncs.indexOf(...
javascript
function bootstrap(item, prop, path) { if ( (path.split('node_modules').length > 2) || (path.slice(-4) == 'emit') || (item == require('util') && (prop=='format')) ) return; if (!item.hasOwnProperty(prop) || Object.getOwnPropertyDescriptor(item, prop).get) return; var original = item[prop]; if (allFuncs.indexOf(...
[ "function", "bootstrap", "(", "item", ",", "prop", ",", "path", ")", "{", "if", "(", "(", "path", ".", "split", "(", "'node_modules'", ")", ".", "length", ">", "2", ")", "||", "(", "path", ".", "slice", "(", "-", "4", ")", "==", "'emit'", ")", ...
Bootstrap recursively iterates through an item, infecting every Function
[ "Bootstrap", "recursively", "iterates", "through", "an", "item", "infecting", "every", "Function" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L79-L101
30,221
holidayextras/hxTracer
index.js
timeDiff
function timeDiff(newest, oldest) { var diff = (parseFloat(newest) - parseFloat(oldest)); if (diff < 0) { diff = ((10000 + parseFloat(newest)) - parseFloat(oldest)); } return diff; }
javascript
function timeDiff(newest, oldest) { var diff = (parseFloat(newest) - parseFloat(oldest)); if (diff < 0) { diff = ((10000 + parseFloat(newest)) - parseFloat(oldest)); } return diff; }
[ "function", "timeDiff", "(", "newest", ",", "oldest", ")", "{", "var", "diff", "=", "(", "parseFloat", "(", "newest", ")", "-", "parseFloat", "(", "oldest", ")", ")", ";", "if", "(", "diff", "<", "0", ")", "{", "diff", "=", "(", "(", "10000", "+"...
The timestamps we get are artificilly limited to 10 seconds. They might wrap around, so take that in to account
[ "The", "timestamps", "we", "get", "are", "artificilly", "limited", "to", "10", "seconds", ".", "They", "might", "wrap", "around", "so", "take", "that", "in", "to", "account" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L219-L225
30,222
holidayextras/hxTracer
index.js
meaningfulTime
function meaningfulTime() { if (moduleRef) { var parts = processRef.hrtime(); return (((parts[0]*1000)+(parts[1]/1000000))%10000).toFixed(2) + 'ms'; } else { return performance.now().toFixed(2)+'ms'; } }
javascript
function meaningfulTime() { if (moduleRef) { var parts = processRef.hrtime(); return (((parts[0]*1000)+(parts[1]/1000000))%10000).toFixed(2) + 'ms'; } else { return performance.now().toFixed(2)+'ms'; } }
[ "function", "meaningfulTime", "(", ")", "{", "if", "(", "moduleRef", ")", "{", "var", "parts", "=", "processRef", ".", "hrtime", "(", ")", ";", "return", "(", "(", "(", "parts", "[", "0", "]", "*", "1000", ")", "+", "(", "parts", "[", "1", "]", ...
Get a sub-millisecond timing thats actually readable
[ "Get", "a", "sub", "-", "millisecond", "timing", "thats", "actually", "readable" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L228-L235
30,223
holidayextras/hxTracer
index.js
measureTracerOverhead
function measureTracerOverhead() { var time1 = meaningfulTime(); var time2 = meaningfulTime(); console.error("TRACER OVERHEAD", timeDiff(time2, time1).toFixed(2)+'ms', 'per timing'); }
javascript
function measureTracerOverhead() { var time1 = meaningfulTime(); var time2 = meaningfulTime(); console.error("TRACER OVERHEAD", timeDiff(time2, time1).toFixed(2)+'ms', 'per timing'); }
[ "function", "measureTracerOverhead", "(", ")", "{", "var", "time1", "=", "meaningfulTime", "(", ")", ";", "var", "time2", "=", "meaningfulTime", "(", ")", ";", "console", ".", "error", "(", "\"TRACER OVERHEAD\"", ",", "timeDiff", "(", "time2", ",", "time1", ...
How much time does it take to measure time?
[ "How", "much", "time", "does", "it", "take", "to", "measure", "time?" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L238-L242
30,224
holidayextras/hxTracer
index.js
processLogs
function processLogs() { var calcs = 0; for (var i in stats) { stats[i].average = stats[i].totalTime / stats[i].count; calcs += stats[i].calcs; } var time1 = meaningfulTime(); var time2 = meaningfulTime(); console.error("TRACER TOTAL OVERHEAD", (calcs*timeDiff(time2, time1)).toFixed(2)+'ms'); whi...
javascript
function processLogs() { var calcs = 0; for (var i in stats) { stats[i].average = stats[i].totalTime / stats[i].count; calcs += stats[i].calcs; } var time1 = meaningfulTime(); var time2 = meaningfulTime(); console.error("TRACER TOTAL OVERHEAD", (calcs*timeDiff(time2, time1)).toFixed(2)+'ms'); whi...
[ "function", "processLogs", "(", ")", "{", "var", "calcs", "=", "0", ";", "for", "(", "var", "i", "in", "stats", ")", "{", "stats", "[", "i", "]", ".", "average", "=", "stats", "[", "i", "]", ".", "totalTime", "/", "stats", "[", "i", "]", ".", ...
Process our logs after tracing to work out how much time is spent where
[ "Process", "our", "logs", "after", "tracing", "to", "work", "out", "how", "much", "time", "is", "spent", "where" ]
cff4321e10d816239a025363dec73f093f52963f
https://github.com/holidayextras/hxTracer/blob/cff4321e10d816239a025363dec73f093f52963f/index.js#L245-L272
30,225
Enplug/dashboard-sdk
dist/sdk.js
debug
function debug(message) { if (enplug.debug) { arguments[0] = TAG + arguments[0]; console.log.apply(console, arguments); } }
javascript
function debug(message) { if (enplug.debug) { arguments[0] = TAG + arguments[0]; console.log.apply(console, arguments); } }
[ "function", "debug", "(", "message", ")", "{", "if", "(", "enplug", ".", "debug", ")", "{", "arguments", "[", "0", "]", "=", "TAG", "+", "arguments", "[", "0", "]", ";", "console", ".", "log", ".", "apply", "(", "console", ",", "arguments", ")", ...
Logs messages to console when enplug.debug is enabled. Adds tag to messages. @param message
[ "Logs", "messages", "to", "console", "when", "enplug", ".", "debug", "is", "enabled", ".", "Adds", "tag", "to", "messages", "." ]
f5f5c69437e56072032effad6daa4088314b66b4
https://github.com/Enplug/dashboard-sdk/blob/f5f5c69437e56072032effad6daa4088314b66b4/dist/sdk.js#L71-L76
30,226
Enplug/dashboard-sdk
dist/sdk.js
validateCallbacks
function validateCallbacks(options) { if (options.successCallback && typeof options.successCallback !== 'function') { throw new Error(TAG + 'Success callback must be a function.'); } else { options.successCallback = options.successCallback || enplug.noop; ...
javascript
function validateCallbacks(options) { if (options.successCallback && typeof options.successCallback !== 'function') { throw new Error(TAG + 'Success callback must be a function.'); } else { options.successCallback = options.successCallback || enplug.noop; ...
[ "function", "validateCallbacks", "(", "options", ")", "{", "if", "(", "options", ".", "successCallback", "&&", "typeof", "options", ".", "successCallback", "!==", "'function'", ")", "{", "throw", "new", "Error", "(", "TAG", "+", "'Success callback must be a functi...
Validate and assign defaults for callback methods. @param {MethodCall} options
[ "Validate", "and", "assign", "defaults", "for", "callback", "methods", "." ]
f5f5c69437e56072032effad6daa4088314b66b4
https://github.com/Enplug/dashboard-sdk/blob/f5f5c69437e56072032effad6daa4088314b66b4/dist/sdk.js#L82-L94
30,227
Enplug/dashboard-sdk
dist/sdk.js
parseResponse
function parseResponse(event) { try { var response = JSON.parse(event.data); // Check for success key to ignore messages being sent if (response.namespace === namespace && typeof response.success === 'boolean') { return response; ...
javascript
function parseResponse(event) { try { var response = JSON.parse(event.data); // Check for success key to ignore messages being sent if (response.namespace === namespace && typeof response.success === 'boolean') { return response; ...
[ "function", "parseResponse", "(", "event", ")", "{", "try", "{", "var", "response", "=", "JSON", ".", "parse", "(", "event", ".", "data", ")", ";", "// Check for success key to ignore messages being sent", "if", "(", "response", ".", "namespace", "===", "namespa...
Verifies that a message is intended for the transport. @param {MessageEvent} event @returns {boolean} - Whether the message was successfully parsed.
[ "Verifies", "that", "a", "message", "is", "intended", "for", "the", "transport", "." ]
f5f5c69437e56072032effad6daa4088314b66b4
https://github.com/Enplug/dashboard-sdk/blob/f5f5c69437e56072032effad6daa4088314b66b4/dist/sdk.js#L101-L114
30,228
Enplug/dashboard-sdk
dist/sdk.js
function (options) { if (typeof options === 'object') { // Add implementation-specific method prefix (dashboard or app) options.name = this.prefix + '.' + options.name; return this.transport.send(options); } else { throw new Erro...
javascript
function (options) { if (typeof options === 'object') { // Add implementation-specific method prefix (dashboard or app) options.name = this.prefix + '.' + options.name; return this.transport.send(options); } else { throw new Erro...
[ "function", "(", "options", ")", "{", "if", "(", "typeof", "options", "===", "'object'", ")", "{", "// Add implementation-specific method prefix (dashboard or app)", "options", ".", "name", "=", "this", ".", "prefix", "+", "'.'", "+", "options", ".", "name", ";"...
Factory for all SDK method calls. @param {MethodCall|*} options @returns {number} callId
[ "Factory", "for", "all", "SDK", "method", "calls", "." ]
f5f5c69437e56072032effad6daa4088314b66b4
https://github.com/Enplug/dashboard-sdk/blob/f5f5c69437e56072032effad6daa4088314b66b4/dist/sdk.js#L263-L273
30,229
Enplug/dashboard-sdk
dist/sdk.js
decorateSend
function decorateSend(q, scope, transport) { var original = transport.send; transport.send = function (options) { // Store originals var defer = q.defer(), onSuccess = options.successCallback || angular.noop, onError = options.errorCallback || ang...
javascript
function decorateSend(q, scope, transport) { var original = transport.send; transport.send = function (options) { // Store originals var defer = q.defer(), onSuccess = options.successCallback || angular.noop, onError = options.errorCallback || ang...
[ "function", "decorateSend", "(", "q", ",", "scope", ",", "transport", ")", "{", "var", "original", "=", "transport", ".", "send", ";", "transport", ".", "send", "=", "function", "(", "options", ")", "{", "// Store originals", "var", "defer", "=", "q", "....
Modifies transport.send to return promises. @param {Object} q @param {Object} scope @param {Object} transport
[ "Modifies", "transport", ".", "send", "to", "return", "promises", "." ]
f5f5c69437e56072032effad6daa4088314b66b4
https://github.com/Enplug/dashboard-sdk/blob/f5f5c69437e56072032effad6daa4088314b66b4/dist/sdk.js#L1558-L1586
30,230
evannetwork/dbcp
scripts/deploy.js
function (hash) { return new Promise((resolve, reject) => { request(`${ ipfsProtocol }://${ ipfsHost }/ipfs/${hash}`, function (err, response, body) { if (err) { reject(err); } else { resolve(response); } }); }); }
javascript
function (hash) { return new Promise((resolve, reject) => { request(`${ ipfsProtocol }://${ ipfsHost }/ipfs/${hash}`, function (err, response, body) { if (err) { reject(err); } else { resolve(response); } }); }); }
[ "function", "(", "hash", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "request", "(", "`", "${", "ipfsProtocol", "}", "${", "ipfsHost", "}", "${", "hash", "}", "`", ",", "function", "(", "err", ",", "res...
Loads an ipfs hash to be sure, that its added and pinned. @param {string} hash ipfs hash to load
[ "Loads", "an", "ipfs", "hash", "to", "be", "sure", "that", "its", "added", "and", "pinned", "." ]
c1f29577e0cc829a1259d683914673da7d54b58c
https://github.com/evannetwork/dbcp/blob/c1f29577e0cc829a1259d683914673da7d54b58c/scripts/deploy.js#L172-L182
30,231
evannetwork/dbcp
scripts/deploy.js
deleteDeploymentFolder
async function deleteDeploymentFolder() { del.sync(deploymentTmpFolder, { force: true }); del.sync(deploymentFolder, { force: true }); }
javascript
async function deleteDeploymentFolder() { del.sync(deploymentTmpFolder, { force: true }); del.sync(deploymentFolder, { force: true }); }
[ "async", "function", "deleteDeploymentFolder", "(", ")", "{", "del", ".", "sync", "(", "deploymentTmpFolder", ",", "{", "force", ":", "true", "}", ")", ";", "del", ".", "sync", "(", "deploymentFolder", ",", "{", "force", ":", "true", "}", ")", ";", "}"...
Delete the deployment folder when everything is ready.
[ "Delete", "the", "deployment", "folder", "when", "everything", "is", "ready", "." ]
c1f29577e0cc829a1259d683914673da7d54b58c
https://github.com/evannetwork/dbcp/blob/c1f29577e0cc829a1259d683914673da7d54b58c/scripts/deploy.js#L253-L256
30,232
evannetwork/dbcp
scripts/deploy.js
deploy
async function deploy() { try { await browserifyDBCP(); await uglify(); const ipfsHash = await deployToIPFS(`${ deploymentFolder}/${ browserifyName}`); await pinToIPFS(ipfsHash); const ipnsHash = await deployToIpns(ipfsHash); deleteDeploymentFolder(); console.log(`\nFinished deployment`);...
javascript
async function deploy() { try { await browserifyDBCP(); await uglify(); const ipfsHash = await deployToIPFS(`${ deploymentFolder}/${ browserifyName}`); await pinToIPFS(ipfsHash); const ipnsHash = await deployToIpns(ipfsHash); deleteDeploymentFolder(); console.log(`\nFinished deployment`);...
[ "async", "function", "deploy", "(", ")", "{", "try", "{", "await", "browserifyDBCP", "(", ")", ";", "await", "uglify", "(", ")", ";", "const", "ipfsHash", "=", "await", "deployToIPFS", "(", "`", "${", "deploymentFolder", "}", "${", "browserifyName", "}", ...
Build the js files into one file using browserify, deploys the file to ipfs and binds the new hash to ipns
[ "Build", "the", "js", "files", "into", "one", "file", "using", "browserify", "deploys", "the", "file", "to", "ipfs", "and", "binds", "the", "new", "hash", "to", "ipns" ]
c1f29577e0cc829a1259d683914673da7d54b58c
https://github.com/evannetwork/dbcp/blob/c1f29577e0cc829a1259d683914673da7d54b58c/scripts/deploy.js#L261-L276
30,233
nickschot/ember-mobile-core
addon/utils/parse-touch-data.js
getPointDistance
function getPointDistance(x0, x1, y0, y1) { return (Math.sqrt(((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0)))); }
javascript
function getPointDistance(x0, x1, y0, y1) { return (Math.sqrt(((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0)))); }
[ "function", "getPointDistance", "(", "x0", ",", "x1", ",", "y0", ",", "y1", ")", "{", "return", "(", "Math", ".", "sqrt", "(", "(", "(", "x1", "-", "x0", ")", "*", "(", "x1", "-", "x0", ")", ")", "+", "(", "(", "y1", "-", "y0", ")", "*", ...
Calculates the distance between two points @function getPointDistance @param {number} x0 X coordinate of the origin @param {number} x1 X coordinate of the current position @param {number} y0 Y coordinate of the origin @param {number} y1 Y coordinate of the current position @return {number} Distance between the two poi...
[ "Calculates", "the", "distance", "between", "two", "points" ]
b9baebf8c62cdc38e3ee5dd6063c46c95cfcbc92
https://github.com/nickschot/ember-mobile-core/blob/b9baebf8c62cdc38e3ee5dd6063c46c95cfcbc92/addon/utils/parse-touch-data.js#L155-L157
30,234
nickschot/ember-mobile-core
addon/utils/parse-touch-data.js
getAngle
function getAngle(originX, originY, projectionX, projectionY) { const angle = Math.atan2(projectionY - originY, projectionX - originX) * ((180) / Math.PI); return 360 - ((angle < 0) ? (360 + angle) : angle); }
javascript
function getAngle(originX, originY, projectionX, projectionY) { const angle = Math.atan2(projectionY - originY, projectionX - originX) * ((180) / Math.PI); return 360 - ((angle < 0) ? (360 + angle) : angle); }
[ "function", "getAngle", "(", "originX", ",", "originY", ",", "projectionX", ",", "projectionY", ")", "{", "const", "angle", "=", "Math", ".", "atan2", "(", "projectionY", "-", "originY", ",", "projectionX", "-", "originX", ")", "*", "(", "(", "180", ")",...
Calculates the angle between two points. @function getAngle @param {number} originX @param {number} originY @param {number} projectionX @param {number} projectionY @return {number} Angle between the two points @private
[ "Calculates", "the", "angle", "between", "two", "points", "." ]
b9baebf8c62cdc38e3ee5dd6063c46c95cfcbc92
https://github.com/nickschot/ember-mobile-core/blob/b9baebf8c62cdc38e3ee5dd6063c46c95cfcbc92/addon/utils/parse-touch-data.js#L170-L173
30,235
nyteshade/graphql-lattice
dist/decorators/ModelProperties.js
add
function add(className) { if (typeof className === 'function') { className = className.name; } extractBits.DIRECT_TYPES.push(className); }
javascript
function add(className) { if (typeof className === 'function') { className = className.name; } extractBits.DIRECT_TYPES.push(className); }
[ "function", "add", "(", "className", ")", "{", "if", "(", "typeof", "className", "===", "'function'", ")", "{", "className", "=", "className", ".", "name", ";", "}", "extractBits", ".", "DIRECT_TYPES", ".", "push", "(", "className", ")", ";", "}" ]
Appends the supplied class name to the list of registered direct types. If a class or function is passed, rather than a String, @method DirectTypeManager#types @param {Function|string|RegExp} className the name of the class to append. Typically it is best to pass the name property of the class in question such as `Re...
[ "Appends", "the", "supplied", "class", "name", "to", "the", "list", "of", "registered", "direct", "types", ".", "If", "a", "class", "or", "function", "is", "passed", "rather", "than", "a", "String" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/decorators/ModelProperties.js#L254-L260
30,236
nyteshade/graphql-lattice
dist/decorators/ModelProperties.js
applyTags
function applyTags(Class, addTags, fieldName, descriptor) { var tags = (Array.isArray(addTags) && addTags || []).map(function (tag) { return typeof tag === 'string' && Symbol.for(tag) || tag; }).filter(function (tag) { return (0, _typeof2.default)(tag) === 'symbol'; }); tags.forEach(function (tag) { ...
javascript
function applyTags(Class, addTags, fieldName, descriptor) { var tags = (Array.isArray(addTags) && addTags || []).map(function (tag) { return typeof tag === 'string' && Symbol.for(tag) || tag; }).filter(function (tag) { return (0, _typeof2.default)(tag) === 'symbol'; }); tags.forEach(function (tag) { ...
[ "function", "applyTags", "(", "Class", ",", "addTags", ",", "fieldName", ",", "descriptor", ")", "{", "var", "tags", "=", "(", "Array", ".", "isArray", "(", "addTags", ")", "&&", "addTags", "||", "[", "]", ")", ".", "map", "(", "function", "(", "tag"...
When applying multiple property getters and setters, knowing some info about what was applied elsewhere can be important. "Tags" can be applied that store the fieldName and descriptor applied via one of these decorators. Multiple "tags" are supported to allow for detecting the difference between decorators applied by ...
[ "When", "applying", "multiple", "property", "getters", "and", "setters", "knowing", "some", "info", "about", "what", "was", "applied", "elsewhere", "can", "be", "important", ".", "Tags", "can", "be", "applied", "that", "store", "the", "fieldName", "and", "desc...
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/decorators/ModelProperties.js#L323-L333
30,237
SimpliField/oh-csv
src/index.js
csvWrapForExcel
function csvWrapForExcel(encoder) { // Pipe the CSV encoder to the ucs2 converter var converter = new Stream.Transform(); var csvStream = new Stream.PassThrough(); converter._transform = function(chunk, encoding, cb) { this.push(new Buffer(chunk.toString(), 'ucs2')); cb(); }; // Write the UCS2 BOM h...
javascript
function csvWrapForExcel(encoder) { // Pipe the CSV encoder to the ucs2 converter var converter = new Stream.Transform(); var csvStream = new Stream.PassThrough(); converter._transform = function(chunk, encoding, cb) { this.push(new Buffer(chunk.toString(), 'ucs2')); cb(); }; // Write the UCS2 BOM h...
[ "function", "csvWrapForExcel", "(", "encoder", ")", "{", "// Pipe the CSV encoder to the ucs2 converter", "var", "converter", "=", "new", "Stream", ".", "Transform", "(", ")", ";", "var", "csvStream", "=", "new", "Stream", ".", "PassThrough", "(", ")", ";", "con...
X-Platform Excel encoder
[ "X", "-", "Platform", "Excel", "encoder" ]
c6c921783fb257cbc4d4e806210b1eccaf1d0f74
https://github.com/SimpliField/oh-csv/blob/c6c921783fb257cbc4d4e806210b1eccaf1d0f74/src/index.js#L465-L476
30,238
mjeanroy/karma-json-preprocessor
src/karma-json-preprocessor.js
createJsonPreprocessor
function createJsonPreprocessor(logger, basePath, config) { const log = logger.create('preprocessor.json'); const conf = config || {}; const stripPrefix = new RegExp(`^${(conf.stripPrefix || '')}`); return function(content, file, done) { log.debug('Processing "%s".', file.originalPath); // Build json ...
javascript
function createJsonPreprocessor(logger, basePath, config) { const log = logger.create('preprocessor.json'); const conf = config || {}; const stripPrefix = new RegExp(`^${(conf.stripPrefix || '')}`); return function(content, file, done) { log.debug('Processing "%s".', file.originalPath); // Build json ...
[ "function", "createJsonPreprocessor", "(", "logger", ",", "basePath", ",", "config", ")", "{", "const", "log", "=", "logger", ".", "create", "(", "'preprocessor.json'", ")", ";", "const", "conf", "=", "config", "||", "{", "}", ";", "const", "stripPrefix", ...
Create the JSON preprocessor. @param {Object} logger Karma logger. @param {string} basePath The base path initialized by karma. @param {Object} config The configuration object. @return {function} The preprocessor function.
[ "Create", "the", "JSON", "preprocessor", "." ]
732be0355edfb40b4116a3fd0ed41ca3c218cf73
https://github.com/mjeanroy/karma-json-preprocessor/blob/732be0355edfb40b4116a3fd0ed41ca3c218cf73/src/karma-json-preprocessor.js#L59-L85
30,239
rocjs/extensions
packages/roc-package-webpack-dev/src/webpack/utils/rocExportWebpackPlugin.js
createGetAlias
function createGetAlias(aliases) { if (isPlainObject(aliases) && !Array.isArray(aliases)) { aliases = Object.keys(aliases).map((key) => { // eslint-disable-line let onlyModule = false; let obj = aliases[key]; if (/\$$/.test(key)) { onlyModule = true; ...
javascript
function createGetAlias(aliases) { if (isPlainObject(aliases) && !Array.isArray(aliases)) { aliases = Object.keys(aliases).map((key) => { // eslint-disable-line let onlyModule = false; let obj = aliases[key]; if (/\$$/.test(key)) { onlyModule = true; ...
[ "function", "createGetAlias", "(", "aliases", ")", "{", "if", "(", "isPlainObject", "(", "aliases", ")", "&&", "!", "Array", ".", "isArray", "(", "aliases", ")", ")", "{", "aliases", "=", "Object", ".", "keys", "(", "aliases", ")", ".", "map", "(", "...
Based on code from enhanced-resolve
[ "Based", "on", "code", "from", "enhanced", "-", "resolve" ]
e9c364768c4edd30b789b94c51d20778d903d063
https://github.com/rocjs/extensions/blob/e9c364768c4edd30b789b94c51d20778d903d063/packages/roc-package-webpack-dev/src/webpack/utils/rocExportWebpackPlugin.js#L91-L123
30,240
nyteshade/graphql-lattice
dist/LatticeFactory.js
setChecklist
function setChecklist(Class, item) { var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var checklist = getChecklist(Class); if (checklist) { // $FlowFixMe checklist[item] = value; } }
javascript
function setChecklist(Class, item) { var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var checklist = getChecklist(Class); if (checklist) { // $FlowFixMe checklist[item] = value; } }
[ "function", "setChecklist", "(", "Class", ",", "item", ")", "{", "var", "value", "=", "arguments", ".", "length", ">", "2", "&&", "arguments", "[", "2", "]", "!==", "undefined", "?", "arguments", "[", "2", "]", ":", "true", ";", "var", "checklist", "...
Obtains the checklist from the supplied GQLBase extended class. If the class has a checklist, its checklist item is set to true or the boolean value specified. @param {Function} Class a reference to the GQLBase class to set @param {Symbol} item one of CHECK_SCHEMA, CHECK_RESOLVERS, or CHECK_API_DOCS @param {Boolean} v...
[ "Obtains", "the", "checklist", "from", "the", "supplied", "GQLBase", "extended", "class", ".", "If", "the", "class", "has", "a", "checklist", "its", "checklist", "item", "is", "set", "to", "true", "or", "the", "boolean", "value", "specified", "." ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/LatticeFactory.js#L280-L288
30,241
nyteshade/graphql-lattice
dist/LatticeFactory.js
hasChecklist
function hasChecklist(Class) { var checklist = getChecklist(Class); for (var _len2 = arguments.length, items = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { items[_key2 - 1] = arguments[_key2]; } if (checklist && items.length) { for (var _i2 = 0; _i2 < items.length; _i2++)...
javascript
function hasChecklist(Class) { var checklist = getChecklist(Class); for (var _len2 = arguments.length, items = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { items[_key2 - 1] = arguments[_key2]; } if (checklist && items.length) { for (var _i2 = 0; _i2 < items.length; _i2++)...
[ "function", "hasChecklist", "(", "Class", ")", "{", "var", "checklist", "=", "getChecklist", "(", "Class", ")", ";", "for", "(", "var", "_len2", "=", "arguments", ".", "length", ",", "items", "=", "new", "Array", "(", "_len2", ">", "1", "?", "_len2", ...
This function, when invoked with only a class will return true if the Class has a defined checklist. If one ore more CHECKLIST symbols are passed, the function will only return true if all the supplied symbols are set to truthy values. @param {Function} Class a reference to the GQLBase class to set @param {Array<Symbo...
[ "This", "function", "when", "invoked", "with", "only", "a", "class", "will", "return", "true", "if", "the", "Class", "has", "a", "defined", "checklist", ".", "If", "one", "ore", "more", "CHECKLIST", "symbols", "are", "passed", "the", "function", "will", "o...
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/LatticeFactory.js#L303-L323
30,242
nyteshade/graphql-lattice
dist/LatticeFactory.js
newChecklist
function newChecklist(Class) { if (Class) { var _keys, _complete, _Class$META_KEY$CHECK, _mutatorMap; // $FlowFixMe Class[_GQLBase.META_KEY][CHECKLIST] = (_Class$META_KEY$CHECK = {}, (0, _defineProperty2.default)(_Class$META_KEY$CHECK, CHECK_SCHEMA, false), (0, _defineProperty2.default)(_Class$META_KEY$C...
javascript
function newChecklist(Class) { if (Class) { var _keys, _complete, _Class$META_KEY$CHECK, _mutatorMap; // $FlowFixMe Class[_GQLBase.META_KEY][CHECKLIST] = (_Class$META_KEY$CHECK = {}, (0, _defineProperty2.default)(_Class$META_KEY$CHECK, CHECK_SCHEMA, false), (0, _defineProperty2.default)(_Class$META_KEY$C...
[ "function", "newChecklist", "(", "Class", ")", "{", "if", "(", "Class", ")", "{", "var", "_keys", ",", "_complete", ",", "_Class$META_KEY$CHECK", ",", "_mutatorMap", ";", "// $FlowFixMe", "Class", "[", "_GQLBase", ".", "META_KEY", "]", "[", "CHECKLIST", "]",...
Injects and creates a new CHECKLIST object on the supplied GQLBase extended class. All items are installed and set to false. @param {Function} Class a reference to the GQLBase class to set
[ "Injects", "and", "creates", "a", "new", "CHECKLIST", "object", "on", "the", "supplied", "GQLBase", "extended", "class", ".", "All", "items", "are", "installed", "and", "set", "to", "false", "." ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/LatticeFactory.js#L332-L353
30,243
nyteshade/graphql-lattice
dist/LatticeFactory.js
validateTemplate
function validateTemplate(template) { var hide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var results = new ValidationResults(); var indent = function indent(string) { var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; ...
javascript
function validateTemplate(template) { var hide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var results = new ValidationResults(); var indent = function indent(string) { var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; ...
[ "function", "validateTemplate", "(", "template", ")", "{", "var", "hide", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "false", ";", "var", "results", "=", "new",...
Walks through a supplied template object and collects errors with its format before bubbling up an exception if any part of it fails to pass muster. The exception can be prevented from throwing if hide is set to true @param {Object} template an object to be parsed for construction via the Lattice Factory @param {boole...
[ "Walks", "through", "a", "supplied", "template", "object", "and", "collects", "errors", "with", "its", "format", "before", "bubbling", "up", "an", "exception", "if", "any", "part", "of", "it", "fails", "to", "pass", "muster", ".", "The", "exception", "can", ...
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/LatticeFactory.js#L409-L518
30,244
fourplusone/etherpad-plugins
ep_headings/static/js/index.js
function(hook, context){ var hs = $('#heading-selection'); hs.on('change', function(){ var value = $(this).val(); var intValue = parseInt(value,10); if(!_.isNaN(intValue)){ context.ace.callWithAce(function(ace){ ace.ace_doInsertHeading(intValue); },'insertheading' , true); hs.v...
javascript
function(hook, context){ var hs = $('#heading-selection'); hs.on('change', function(){ var value = $(this).val(); var intValue = parseInt(value,10); if(!_.isNaN(intValue)){ context.ace.callWithAce(function(ace){ ace.ace_doInsertHeading(intValue); },'insertheading' , true); hs.v...
[ "function", "(", "hook", ",", "context", ")", "{", "var", "hs", "=", "$", "(", "'#heading-selection'", ")", ";", "hs", ".", "on", "(", "'change'", ",", "function", "(", ")", "{", "var", "value", "=", "$", "(", "this", ")", ".", "val", "(", ")", ...
Bind the event handler to the toolbar buttons
[ "Bind", "the", "event", "handler", "to", "the", "toolbar", "buttons" ]
f6561a2b2323f8df2d3ef79154527f1ec5adfa56
https://github.com/fourplusone/etherpad-plugins/blob/f6561a2b2323f8df2d3ef79154527f1ec5adfa56/ep_headings/static/js/index.js#L15-L27
30,245
fourplusone/etherpad-plugins
ep_headings/static/js/index.js
aceInitialized
function aceInitialized(hook, context){ var editorInfo = context.editorInfo; editorInfo.ace_doInsertHeading = _(doInsertHeading).bind(context); }
javascript
function aceInitialized(hook, context){ var editorInfo = context.editorInfo; editorInfo.ace_doInsertHeading = _(doInsertHeading).bind(context); }
[ "function", "aceInitialized", "(", "hook", ",", "context", ")", "{", "var", "editorInfo", "=", "context", ".", "editorInfo", ";", "editorInfo", ".", "ace_doInsertHeading", "=", "_", "(", "doInsertHeading", ")", ".", "bind", "(", "context", ")", ";", "}" ]
Once ace is initialized, we set ace_doInsertHeading and bind it to the context
[ "Once", "ace", "is", "initialized", "we", "set", "ace_doInsertHeading", "and", "bind", "it", "to", "the", "context" ]
f6561a2b2323f8df2d3ef79154527f1ec5adfa56
https://github.com/fourplusone/etherpad-plugins/blob/f6561a2b2323f8df2d3ef79154527f1ec5adfa56/ep_headings/static/js/index.js#L86-L89
30,246
nyteshade/graphql-lattice
dist/utils.js
argMapper
function argMapper(arg, index, array) { var isError = (0, _neTypes.typeOf)(arg) === Error.name; var showStack = /\bSTACK\b/i.test(process.env.LATTICE_ERRORS || ''); // $FlowFixMe return !isError ? arg : showStack ? arg : arg.message; }
javascript
function argMapper(arg, index, array) { var isError = (0, _neTypes.typeOf)(arg) === Error.name; var showStack = /\bSTACK\b/i.test(process.env.LATTICE_ERRORS || ''); // $FlowFixMe return !isError ? arg : showStack ? arg : arg.message; }
[ "function", "argMapper", "(", "arg", ",", "index", ",", "array", ")", "{", "var", "isError", "=", "(", "0", ",", "_neTypes", ".", "typeOf", ")", "(", "arg", ")", "===", "Error", ".", "name", ";", "var", "showStack", "=", "/", "\\bSTACK\\b", "/", "i...
All arguments of any logging function in `LatticeLogs` get passed through this function first to modify or alter the type of value being logged. @param {mixed} arg the argument being passed to the `map()` function @param {number} index the index in the array of arguments @param {Array<mixed>} array the array containin...
[ "All", "arguments", "of", "any", "logging", "function", "in", "LatticeLogs", "get", "passed", "through", "this", "function", "first", "to", "modify", "or", "alter", "the", "type", "of", "value", "being", "logged", "." ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L351-L356
30,247
nyteshade/graphql-lattice
dist/utils.js
failFast
function failFast(logLevel, lessThan) { var ll = LatticeLogs; if (logLevel) { var compareTo = lessThan || process.env.LATTICE_LOGLEVEL || ll.ERROR; if (!ll.equalOrBelow(logLevel, compareTo)) return true; } return /\b(NONE|OFF|NO|0)\b/i.test(process.env.LATTICE_ERRORS || ''); }
javascript
function failFast(logLevel, lessThan) { var ll = LatticeLogs; if (logLevel) { var compareTo = lessThan || process.env.LATTICE_LOGLEVEL || ll.ERROR; if (!ll.equalOrBelow(logLevel, compareTo)) return true; } return /\b(NONE|OFF|NO|0)\b/i.test(process.env.LATTICE_ERRORS || ''); }
[ "function", "failFast", "(", "logLevel", ",", "lessThan", ")", "{", "var", "ll", "=", "LatticeLogs", ";", "if", "(", "logLevel", ")", "{", "var", "compareTo", "=", "lessThan", "||", "process", ".", "env", ".", "LATTICE_LOGLEVEL", "||", "ll", ".", "ERROR"...
A function that, when it returns true, will cause logging to be skipped
[ "A", "function", "that", "when", "it", "returns", "true", "will", "cause", "logging", "to", "be", "skipped" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L359-L368
30,248
nyteshade/graphql-lattice
dist/utils.js
log
function log() { var _console; if (LatticeLogs.failFast(LatticeLogs.LOG)) return; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } (_console = console).log.apply(_console, (0, _toConsumableArray2.default)(args...
javascript
function log() { var _console; if (LatticeLogs.failFast(LatticeLogs.LOG)) return; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } (_console = console).log.apply(_console, (0, _toConsumableArray2.default)(args...
[ "function", "log", "(", ")", "{", "var", "_console", ";", "if", "(", "LatticeLogs", ".", "failFast", "(", "LatticeLogs", ".", "LOG", ")", ")", "return", ";", "for", "(", "var", "_len3", "=", "arguments", ".", "length", ",", "args", "=", "new", "Array...
Pass-thru to console.log; arguments parsed via `argMapper`
[ "Pass", "-", "thru", "to", "console", ".", "log", ";", "arguments", "parsed", "via", "argMapper" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L371-L381
30,249
nyteshade/graphql-lattice
dist/utils.js
warn
function warn() { var _console2; if (LatticeLogs.failFast(LatticeLogs.WARN)) return; for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } (_console2 = console).warn.apply(_console2, (0, _toConsumableArray2.default...
javascript
function warn() { var _console2; if (LatticeLogs.failFast(LatticeLogs.WARN)) return; for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } (_console2 = console).warn.apply(_console2, (0, _toConsumableArray2.default...
[ "function", "warn", "(", ")", "{", "var", "_console2", ";", "if", "(", "LatticeLogs", ".", "failFast", "(", "LatticeLogs", ".", "WARN", ")", ")", "return", ";", "for", "(", "var", "_len4", "=", "arguments", ".", "length", ",", "args", "=", "new", "Ar...
Pass-thru to console.warn; arguments parsed via `argMapper`
[ "Pass", "-", "thru", "to", "console", ".", "warn", ";", "arguments", "parsed", "via", "argMapper" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L384-L394
30,250
nyteshade/graphql-lattice
dist/utils.js
error
function error() { var _console3; if (LatticeLogs.failFast(LatticeLogs.ERROR)) return; for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } (_console3 = console).error.apply(_console3, (0, _toConsumableArray2.defa...
javascript
function error() { var _console3; if (LatticeLogs.failFast(LatticeLogs.ERROR)) return; for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { args[_key5] = arguments[_key5]; } (_console3 = console).error.apply(_console3, (0, _toConsumableArray2.defa...
[ "function", "error", "(", ")", "{", "var", "_console3", ";", "if", "(", "LatticeLogs", ".", "failFast", "(", "LatticeLogs", ".", "ERROR", ")", ")", "return", ";", "for", "(", "var", "_len5", "=", "arguments", ".", "length", ",", "args", "=", "new", "...
Pass-thru to console.error; arguments parsed via `argMapper`
[ "Pass", "-", "thru", "to", "console", ".", "error", ";", "arguments", "parsed", "via", "argMapper" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L397-L407
30,251
nyteshade/graphql-lattice
dist/utils.js
info
function info() { var _console4; if (LatticeLogs.failFast(LatticeLogs.INFO)) return; for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } (_console4 = console).info.apply(_console4, (0, _toConsumableArray2.default...
javascript
function info() { var _console4; if (LatticeLogs.failFast(LatticeLogs.INFO)) return; for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } (_console4 = console).info.apply(_console4, (0, _toConsumableArray2.default...
[ "function", "info", "(", ")", "{", "var", "_console4", ";", "if", "(", "LatticeLogs", ".", "failFast", "(", "LatticeLogs", ".", "INFO", ")", ")", "return", ";", "for", "(", "var", "_len6", "=", "arguments", ".", "length", ",", "args", "=", "new", "Ar...
Pass-thru to console.info; arguments parsed via `argMapper`
[ "Pass", "-", "thru", "to", "console", ".", "info", ";", "arguments", "parsed", "via", "argMapper" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L410-L420
30,252
nyteshade/graphql-lattice
dist/utils.js
trace
function trace() { var _console5; if (LatticeLogs.failFast(LatticeLogs.TRACE)) return; for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { args[_key7] = arguments[_key7]; } (_console5 = console).trace.apply(_console5, (0, _toConsumableArray2.defa...
javascript
function trace() { var _console5; if (LatticeLogs.failFast(LatticeLogs.TRACE)) return; for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { args[_key7] = arguments[_key7]; } (_console5 = console).trace.apply(_console5, (0, _toConsumableArray2.defa...
[ "function", "trace", "(", ")", "{", "var", "_console5", ";", "if", "(", "LatticeLogs", ".", "failFast", "(", "LatticeLogs", ".", "TRACE", ")", ")", "return", ";", "for", "(", "var", "_len7", "=", "arguments", ".", "length", ",", "args", "=", "new", "...
Pass-thru to console.trace; arguments parsed via `argMapper`
[ "Pass", "-", "thru", "to", "console", ".", "trace", ";", "arguments", "parsed", "via", "argMapper" ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/utils.js#L423-L433
30,253
nyteshade/graphql-lattice
dist/GQLBase.js
notDefined
function notDefined(keyToTest, keySupplied, instance) { return new RegExp("^" + keyToTest + "$").test(keySupplied.toString()) && !instance.hasOwnProperty(keyToTest); }
javascript
function notDefined(keyToTest, keySupplied, instance) { return new RegExp("^" + keyToTest + "$").test(keySupplied.toString()) && !instance.hasOwnProperty(keyToTest); }
[ "function", "notDefined", "(", "keyToTest", ",", "keySupplied", ",", "instance", ")", "{", "return", "new", "RegExp", "(", "\"^\"", "+", "keyToTest", "+", "\"$\"", ")", ".", "test", "(", "keySupplied", ".", "toString", "(", ")", ")", "&&", "!", "instance...
Simple function to check if a supplied key matches a string of your choosing and that string is not a defined property on the instance passed to the check. @method GQLBaseEnv~notDefined @memberof GQLBaseEnv @since 2.5.0 @param {string} keyToTest a String denoting the property you wish to test @param {mixed} keySuppli...
[ "Simple", "function", "to", "check", "if", "a", "supplied", "key", "matches", "a", "string", "of", "your", "choosing", "and", "that", "string", "is", "not", "a", "defined", "property", "on", "the", "instance", "passed", "to", "the", "check", "." ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/GQLBase.js#L158-L160
30,254
nyteshade/graphql-lattice
dist/GQLBase.js
getProp
function getProp(propName) { var bindGetters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var bindTo = arguments.length > 2 ? arguments[2] : undefined; // $FlowFixMe var proto = Object.getPrototypeOf(this); var descriptor = Object.getOwnPropertyDescriptor(pro...
javascript
function getProp(propName) { var bindGetters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var bindTo = arguments.length > 2 ? arguments[2] : undefined; // $FlowFixMe var proto = Object.getPrototypeOf(this); var descriptor = Object.getOwnPropertyDescriptor(pro...
[ "function", "getProp", "(", "propName", ")", "{", "var", "bindGetters", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "true", ";", "var", "bindTo", "=", "arguments...
Properties defined for GraphQL types in Lattice can be defined as a getter, a function or an async function. In the case of standard functions, if they return a promise they will be handled as though they were async Given the variety of things a GraphQL type can actually be, obtaining its value can annoying. This meth...
[ "Properties", "defined", "for", "GraphQL", "types", "in", "Lattice", "can", "be", "defined", "as", "a", "getter", "a", "function", "or", "an", "async", "function", ".", "In", "the", "case", "of", "standard", "functions", "if", "they", "return", "a", "promi...
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/GQLBase.js#L495-L522
30,255
nyteshade/graphql-lattice
dist/GQLBase.js
IDLFilePath
function IDLFilePath(path) { var extension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.graphql'; return Symbol.for("Path ".concat(path, " Extension ").concat(extension)); }
javascript
function IDLFilePath(path) { var extension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.graphql'; return Symbol.for("Path ".concat(path, " Extension ").concat(extension)); }
[ "function", "IDLFilePath", "(", "path", ")", "{", "var", "extension", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "'.graphql'", ";", "return", "Symbol", ".", "fo...
Creates an appropriate Symbol crafted with the right data for use by the IDLFileHandler class below. @static @memberof GQLBase @method ⌾⠀IDLFilePath @param {string} path a path to the IDL containing file @param {string} [extension='.graphql'] an extension, including the prefixed period, that will be added to the supp...
[ "Creates", "an", "appropriate", "Symbol", "crafted", "with", "the", "right", "data", "for", "use", "by", "the", "IDLFileHandler", "class", "below", "." ]
c95aba71e769eac2c900a4a578109a42e385342a
https://github.com/nyteshade/graphql-lattice/blob/c95aba71e769eac2c900a4a578109a42e385342a/dist/GQLBase.js#L1042-L1045
30,256
jacobrask/eslint-plugin-sorting
lib/rules/sort-object-props.js
nodeToString
function nodeToString(node) { switch (node.type) { case ("BinaryExpression"): { return nodeToString(node.left) + node.operator.toString() + nodeToString(node.right); } case ("CallExpression"): { var args = node.arguments.map(function(arg) { return node...
javascript
function nodeToString(node) { switch (node.type) { case ("BinaryExpression"): { return nodeToString(node.left) + node.operator.toString() + nodeToString(node.right); } case ("CallExpression"): { var args = node.arguments.map(function(arg) { return node...
[ "function", "nodeToString", "(", "node", ")", "{", "switch", "(", "node", ".", "type", ")", "{", "case", "(", "\"BinaryExpression\"", ")", ":", "{", "return", "nodeToString", "(", "node", ".", "left", ")", "+", "node", ".", "operator", ".", "toString", ...
Recursively converts Nodes to strings so they can be sorted @param {Node} node: Babel AST Node @returns {String} Node value as a string
[ "Recursively", "converts", "Nodes", "to", "strings", "so", "they", "can", "be", "sorted" ]
ea30e0011bad0768b16f70e3526db93e119b5eaa
https://github.com/jacobrask/eslint-plugin-sorting/blob/ea30e0011bad0768b16f70e3526db93e119b5eaa/lib/rules/sort-object-props.js#L10-L55
30,257
gl-vis/gl-streamtube3d
streamtube.js
function(positions) { var xs = [], ys = [], zs = []; var xi = {}, yi = {}, zi = {}; for (var i=0; i<positions.length; i++) { var p = positions[i]; var x = p[0], y = p[1], z = p[2]; // Split the positions array into arrays of unique component values. // // Why go through the trouble of using a uniqueness h...
javascript
function(positions) { var xs = [], ys = [], zs = []; var xi = {}, yi = {}, zi = {}; for (var i=0; i<positions.length; i++) { var p = positions[i]; var x = p[0], y = p[1], z = p[2]; // Split the positions array into arrays of unique component values. // // Why go through the trouble of using a uniqueness h...
[ "function", "(", "positions", ")", "{", "var", "xs", "=", "[", "]", ",", "ys", "=", "[", "]", ",", "zs", "=", "[", "]", ";", "var", "xi", "=", "{", "}", ",", "yi", "=", "{", "}", ",", "zi", "=", "{", "}", ";", "for", "(", "var", "i", ...
Finds the minimum per-component distance in positions.
[ "Finds", "the", "minimum", "per", "-", "component", "distance", "in", "positions", "." ]
e07fe532d22e6c9c45f60e318f6f38e116a60952
https://github.com/gl-vis/gl-streamtube3d/blob/e07fe532d22e6c9c45f60e318f6f38e116a60952/streamtube.js#L301-L359
30,258
emilbayes/noise-protocol
symmetric-state.js
encryptAndHash
function encryptAndHash (state, ciphertext, plaintext) { assert(state.byteLength === STATELEN) assert(ciphertext.byteLength != null) assert(plaintext.byteLength != null) var cstate = state.subarray(CIPHER_BEGIN, CIPHER_END) var h = state.subarray(HASH_BEGIN, HASH_END) cipherState.encryptWithAd(cstate, cip...
javascript
function encryptAndHash (state, ciphertext, plaintext) { assert(state.byteLength === STATELEN) assert(ciphertext.byteLength != null) assert(plaintext.byteLength != null) var cstate = state.subarray(CIPHER_BEGIN, CIPHER_END) var h = state.subarray(HASH_BEGIN, HASH_END) cipherState.encryptWithAd(cstate, cip...
[ "function", "encryptAndHash", "(", "state", ",", "ciphertext", ",", "plaintext", ")", "{", "assert", "(", "state", ".", "byteLength", "===", "STATELEN", ")", "assert", "(", "ciphertext", ".", "byteLength", "!=", "null", ")", "assert", "(", "plaintext", ".", ...
ciphertext is the output here
[ "ciphertext", "is", "the", "output", "here" ]
ad2f08fd09af1eb55433b9d34f71a85979cbbe9d
https://github.com/emilbayes/noise-protocol/blob/ad2f08fd09af1eb55433b9d34f71a85979cbbe9d/symmetric-state.js#L97-L109
30,259
rocjs/extensions
examples/web-app-react/complex/src/components/main/index.js
mapStateToProps
function mapStateToProps(state) { return { clicker: state.clicker, repoUser: state.repoUser, repositories: state.repositories, errors: state.errors }; }
javascript
function mapStateToProps(state) { return { clicker: state.clicker, repoUser: state.repoUser, repositories: state.repositories, errors: state.errors }; }
[ "function", "mapStateToProps", "(", "state", ")", "{", "return", "{", "clicker", ":", "state", ".", "clicker", ",", "repoUser", ":", "state", ".", "repoUser", ",", "repositories", ":", "state", ".", "repositories", ",", "errors", ":", "state", ".", "errors...
this maps values from redux store to props of this component
[ "this", "maps", "values", "from", "redux", "store", "to", "props", "of", "this", "component" ]
e9c364768c4edd30b789b94c51d20778d903d063
https://github.com/rocjs/extensions/blob/e9c364768c4edd30b789b94c51d20778d903d063/examples/web-app-react/complex/src/components/main/index.js#L29-L36
30,260
CoinifySoftware/node-currency
src/index.js
computeRateBetweenSubunitAmounts
function computeRateBetweenSubunitAmounts(fromCurrency, fromAmount, toCurrency, toAmount) { /* * If currencies are equal, rate is 1 */ if (fromCurrency === toCurrency) { return 1; } /* * If toAmount is 0, we don't want to divide by zero. * In this case, return NaN */ if (toAmount === 0) { ...
javascript
function computeRateBetweenSubunitAmounts(fromCurrency, fromAmount, toCurrency, toAmount) { /* * If currencies are equal, rate is 1 */ if (fromCurrency === toCurrency) { return 1; } /* * If toAmount is 0, we don't want to divide by zero. * In this case, return NaN */ if (toAmount === 0) { ...
[ "function", "computeRateBetweenSubunitAmounts", "(", "fromCurrency", ",", "fromAmount", ",", "toCurrency", ",", "toAmount", ")", "{", "/*\n * If currencies are equal, rate is 1\n */", "if", "(", "fromCurrency", "===", "toCurrency", ")", "{", "return", "1", ";", "}",...
Computes a rate between two amounts in two different currencies. The result is fromAmount / toAmount (in the main units of their respective currencies) @param {string} fromCurrency @param {int} fromAmount Amount denominated in smallest sub-unit of fromCurrency @param {string} toCurrency @param {int} toAmount Amount d...
[ "Computes", "a", "rate", "between", "two", "amounts", "in", "two", "different", "currencies", "." ]
d4e84e34da0bcdc922a2696387bf6cc30b6791c9
https://github.com/CoinifySoftware/node-currency/blob/d4e84e34da0bcdc922a2696387bf6cc30b6791c9/src/index.js#L86-L112
30,261
canjs/can-view-scope
can-view-scope.js
function(context, keys){ // If nothing can be found with the keys we are looking for, save the // first possible match. This is where we will write to. if(firstSearchedContext === undefined && !(context instanceof LetContext)) { firstSearchedContext = context; } // If we have multiple keys .....
javascript
function(context, keys){ // If nothing can be found with the keys we are looking for, save the // first possible match. This is where we will write to. if(firstSearchedContext === undefined && !(context instanceof LetContext)) { firstSearchedContext = context; } // If we have multiple keys .....
[ "function", "(", "context", ",", "keys", ")", "{", "// If nothing can be found with the keys we are looking for, save the", "// first possible match. This is where we will write to.", "if", "(", "firstSearchedContext", "===", "undefined", "&&", "!", "(", "context", "instanceof",...
This read is used by `._walk` to read from the scope. This will use `hasKey` on the last property instead of reading it.
[ "This", "read", "is", "used", "by", ".", "_walk", "to", "read", "from", "the", "scope", ".", "This", "will", "use", "hasKey", "on", "the", "last", "property", "instead", "of", "reading", "it", "." ]
5f6f517bc7de8726331872480c369fe6d27392c9
https://github.com/canjs/can-view-scope/blob/5f6f517bc7de8726331872480c369fe6d27392c9/can-view-scope.js#L528-L570
30,262
canjs/can-view-scope
can-view-scope.js
function() { var top; this.getScope(function(scope) { if (scope._meta.viewModel) { top = scope; } // walk entire scope tree return false; }); return top && top._context; }
javascript
function() { var top; this.getScope(function(scope) { if (scope._meta.viewModel) { top = scope; } // walk entire scope tree return false; }); return top && top._context; }
[ "function", "(", ")", "{", "var", "top", ";", "this", ".", "getScope", "(", "function", "(", "scope", ")", "{", "if", "(", "scope", ".", "_meta", ".", "viewModel", ")", "{", "top", "=", "scope", ";", "}", "// walk entire scope tree", "return", "false",...
_top_ viewModel scope
[ "_top_", "viewModel", "scope" ]
5f6f517bc7de8726331872480c369fe6d27392c9
https://github.com/canjs/can-view-scope/blob/5f6f517bc7de8726331872480c369fe6d27392c9/can-view-scope.js#L749-L762
30,263
Rekord/rekord
build/rekord.js
toArray
function toArray(x, delimiter) { if ( x instanceof Array ) { return x; } if ( isString( x ) ) { return x.split( delimiter ); } if ( isValue( x ) ) { return [ x ]; } return []; }
javascript
function toArray(x, delimiter) { if ( x instanceof Array ) { return x; } if ( isString( x ) ) { return x.split( delimiter ); } if ( isValue( x ) ) { return [ x ]; } return []; }
[ "function", "toArray", "(", "x", ",", "delimiter", ")", "{", "if", "(", "x", "instanceof", "Array", ")", "{", "return", "x", ";", "}", "if", "(", "isString", "(", "x", ")", ")", "{", "return", "x", ".", "split", "(", "delimiter", ")", ";", "}", ...
Converts the given variable to an array of strings. If the variable is a string it is split based on the delimiter given. If the variable is an array then it is returned. If the variable is any other type it may result in an error. ```javascript Rekord.toArray([1, 2, 3]); // [1, 2, 3] Rekord.toArray('1,2,3', ','); // ...
[ "Converts", "the", "given", "variable", "to", "an", "array", "of", "strings", ".", "If", "the", "variable", "is", "a", "string", "it", "is", "split", "based", "on", "the", "delimiter", "given", ".", "If", "the", "variable", "is", "an", "array", "then", ...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L53-L69
30,264
Rekord/rekord
build/rekord.js
indexOf
function indexOf(arr, x, comparator) { var cmp = comparator || equalsStrict; for (var i = 0, n = arr.length; i < n; i++) { if ( cmp( arr[i], x ) ) { return i; } } return false; }
javascript
function indexOf(arr, x, comparator) { var cmp = comparator || equalsStrict; for (var i = 0, n = arr.length; i < n; i++) { if ( cmp( arr[i], x ) ) { return i; } } return false; }
[ "function", "indexOf", "(", "arr", ",", "x", ",", "comparator", ")", "{", "var", "cmp", "=", "comparator", "||", "equalsStrict", ";", "for", "(", "var", "i", "=", "0", ",", "n", "=", "arr", ".", "length", ";", "i", "<", "n", ";", "i", "++", ")"...
Finds the index of a variable in an array optionally using a custom comparison function. If the variable is not found in the array then `false` is returned. ```javascript Rekord.indexOf([1, 2, 3], 1); // 0 Rekord.indexOf([1, 2, 3], 4); // false Rekord.indexOf([1, 2, 2], 2); // 1 ``` @memberof Rekord @param {Array} a...
[ "Finds", "the", "index", "of", "a", "variable", "in", "an", "array", "optionally", "using", "a", "custom", "comparison", "function", ".", "If", "the", "variable", "is", "not", "found", "in", "the", "array", "then", "false", "is", "returned", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L96-L109
30,265
Rekord/rekord
build/rekord.js
isRekord
function isRekord(x) { return !!(x && x.Database && isFunction( x ) && x.prototype instanceof Model); }
javascript
function isRekord(x) { return !!(x && x.Database && isFunction( x ) && x.prototype instanceof Model); }
[ "function", "isRekord", "(", "x", ")", "{", "return", "!", "!", "(", "x", "&&", "x", ".", "Database", "&&", "isFunction", "(", "x", ")", "&&", "x", ".", "prototype", "instanceof", "Model", ")", ";", "}" ]
Determines whether the given variable is a Rekord object. A Rekord object is a constructor for a model and also has a Database variable. A Rekord object is strictly created by the Rekord function. ```javascript var Task = Rekord({ name: 'task', fields: ['name', 'done', 'finished_at', 'created_at', 'assigned_to'] }); R...
[ "Determines", "whether", "the", "given", "variable", "is", "a", "Rekord", "object", ".", "A", "Rekord", "object", "is", "a", "constructor", "for", "a", "model", "and", "also", "has", "a", "Database", "variable", ".", "A", "Rekord", "object", "is", "strictl...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L460-L463
30,266
Rekord/rekord
build/rekord.js
createComparator
function createComparator(comparator, nullsFirst) { if ( isFunction( comparator ) ) { return comparator; } else if ( isString( comparator ) ) { if ( comparator in Comparators ) { return Comparators[ comparator ]; } if ( comparator.charAt(0) === '-' ) { var parsed = createC...
javascript
function createComparator(comparator, nullsFirst) { if ( isFunction( comparator ) ) { return comparator; } else if ( isString( comparator ) ) { if ( comparator in Comparators ) { return Comparators[ comparator ]; } if ( comparator.charAt(0) === '-' ) { var parsed = createC...
[ "function", "createComparator", "(", "comparator", ",", "nullsFirst", ")", "{", "if", "(", "isFunction", "(", "comparator", ")", ")", "{", "return", "comparator", ";", "}", "else", "if", "(", "isString", "(", "comparator", ")", ")", "{", "if", "(", "comp...
Creates a function which compares two values. @memberof Rekord @param {comparatorInput} comparator The input which creates a comparison function. @param {Boolean} [nullsFirst=false] - True if null values should be sorted first. @return {comparisonCallback}
[ "Creates", "a", "function", "which", "compares", "two", "values", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L844-L924
30,267
Rekord/rekord
build/rekord.js
on
function on(events, callback, context) { return onListeners( this, events, callback, context, EventNode.Types.Persistent ); }
javascript
function on(events, callback, context) { return onListeners( this, events, callback, context, EventNode.Types.Persistent ); }
[ "function", "on", "(", "events", ",", "callback", ",", "context", ")", "{", "return", "onListeners", "(", "this", ",", "events", ",", "callback", ",", "context", ",", "EventNode", ".", "Types", ".", "Persistent", ")", ";", "}" ]
Listens for every occurrence of the given events and invokes the callback each time any of them are triggered. @method on @memberof Rekord.Eventful# @param {String|Array} events - The event or events to listen to. @param {Function} callback - The function to invoke when any of the events are invoked. @param {Object} [...
[ "Listens", "for", "every", "occurrence", "of", "the", "given", "events", "and", "invokes", "the", "callback", "each", "time", "any", "of", "them", "are", "triggered", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1361-L1364
30,268
Rekord/rekord
build/rekord.js
once
function once(events, callback, context) { return onListeners( this, events, callback, context, EventNode.Types.Once ); }
javascript
function once(events, callback, context) { return onListeners( this, events, callback, context, EventNode.Types.Once ); }
[ "function", "once", "(", "events", ",", "callback", ",", "context", ")", "{", "return", "onListeners", "(", "this", ",", "events", ",", "callback", ",", "context", ",", "EventNode", ".", "Types", ".", "Once", ")", ";", "}" ]
Listens for the first of the given events to be triggered and invokes the callback once. @method once @memberof Rekord.Eventful# @param {String|Array} events - The event or events to listen to. @param {Function} callback - The function to invoke when any of the events are invoked. @param {Object} [context] - The value...
[ "Listens", "for", "the", "first", "of", "the", "given", "events", "to", "be", "triggered", "and", "invokes", "the", "callback", "once", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1400-L1403
30,269
Rekord/rekord
build/rekord.js
offListeners
function offListeners(listeners, event, callback) { if (listeners && event in listeners) { var eventListeners = listeners[ event ]; var next, node = eventListeners.next; while (node !== eventListeners) { next = node.next; if (node.callback === callback) { ...
javascript
function offListeners(listeners, event, callback) { if (listeners && event in listeners) { var eventListeners = listeners[ event ]; var next, node = eventListeners.next; while (node !== eventListeners) { next = node.next; if (node.callback === callback) { ...
[ "function", "offListeners", "(", "listeners", ",", "event", ",", "callback", ")", "{", "if", "(", "listeners", "&&", "event", "in", "listeners", ")", "{", "var", "eventListeners", "=", "listeners", "[", "event", "]", ";", "var", "next", ",", "node", "=",...
Removes a listener from an array of listeners.
[ "Removes", "a", "listener", "from", "an", "array", "of", "listeners", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1411-L1430
30,270
Rekord/rekord
build/rekord.js
off
function off(eventsInput, callback) { // Remove ALL listeners if ( !isDefined( eventsInput ) ) { deleteProperty( this, '$$on' ); } else { var events = toArray( eventsInput, ' ' ); // Remove listeners for given events if ( !isFunction( callback ) ) { for (...
javascript
function off(eventsInput, callback) { // Remove ALL listeners if ( !isDefined( eventsInput ) ) { deleteProperty( this, '$$on' ); } else { var events = toArray( eventsInput, ' ' ); // Remove listeners for given events if ( !isFunction( callback ) ) { for (...
[ "function", "off", "(", "eventsInput", ",", "callback", ")", "{", "// Remove ALL listeners", "if", "(", "!", "isDefined", "(", "eventsInput", ")", ")", "{", "deleteProperty", "(", "this", ",", "'$$on'", ")", ";", "}", "else", "{", "var", "events", "=", "...
Stops listening for a given callback for a given set of events. **Examples:** target.off(); // remove all listeners target.off('a b'); // remove all listeners on events a & b target.off(['a', 'b']); // remove all listeners on events a & b target.off('a', x); // remove listener x from event a @meth...
[ "Stops", "listening", "for", "a", "given", "callback", "for", "a", "given", "set", "of", "events", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1457-L1487
30,271
Rekord/rekord
build/rekord.js
triggerListeners
function triggerListeners(listeners, event, args) { if (listeners && event in listeners) { var eventListeners = listeners[ event ]; var triggerGroup = ++triggerId; var next, node = eventListeners.next; while (node !== eventListeners) { next = node.next; node.trig...
javascript
function triggerListeners(listeners, event, args) { if (listeners && event in listeners) { var eventListeners = listeners[ event ]; var triggerGroup = ++triggerId; var next, node = eventListeners.next; while (node !== eventListeners) { next = node.next; node.trig...
[ "function", "triggerListeners", "(", "listeners", ",", "event", ",", "args", ")", "{", "if", "(", "listeners", "&&", "event", "in", "listeners", ")", "{", "var", "eventListeners", "=", "listeners", "[", "event", "]", ";", "var", "triggerGroup", "=", "++", ...
Triggers listeneers for the given event
[ "Triggers", "listeneers", "for", "the", "given", "event" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1490-L1514
30,272
Rekord/rekord
build/rekord.js
trigger
function trigger(eventsInput, args) { try { var events = toArray( eventsInput, ' ' ); for (var i = 0; i < events.length; i++) { triggerListeners( this.$$on, events[ i ], args ); } } catch (ex) { Rekord.trigger( Rekord.Events.Error, [ex] ); } return t...
javascript
function trigger(eventsInput, args) { try { var events = toArray( eventsInput, ' ' ); for (var i = 0; i < events.length; i++) { triggerListeners( this.$$on, events[ i ], args ); } } catch (ex) { Rekord.trigger( Rekord.Events.Error, [ex] ); } return t...
[ "function", "trigger", "(", "eventsInput", ",", "args", ")", "{", "try", "{", "var", "events", "=", "toArray", "(", "eventsInput", ",", "' '", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "events", ".", "length", ";", "i", "++", ")"...
Triggers a single event optionally passing an argument to any listeners. @method trigger @for addEventful @param {String} eventsInput @param {Array} args @chainable
[ "Triggers", "a", "single", "event", "optionally", "passing", "an", "argument", "to", "any", "listeners", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1525-L1542
30,273
Rekord/rekord
build/rekord.js
merge
function merge(dst, src, ignoreMap) { if (isObject( dst ) && isObject( src )) { for (var prop in src) { if (!ignoreMap || !ignoreMap[ prop ]) { var adding = src[ prop ]; if (prop in dst) { var existing = dst[ prop ]; if (isArray( existing )) ...
javascript
function merge(dst, src, ignoreMap) { if (isObject( dst ) && isObject( src )) { for (var prop in src) { if (!ignoreMap || !ignoreMap[ prop ]) { var adding = src[ prop ]; if (prop in dst) { var existing = dst[ prop ]; if (isArray( existing )) ...
[ "function", "merge", "(", "dst", ",", "src", ",", "ignoreMap", ")", "{", "if", "(", "isObject", "(", "dst", ")", "&&", "isObject", "(", "src", ")", ")", "{", "for", "(", "var", "prop", "in", "src", ")", "{", "if", "(", "!", "ignoreMap", "||", "...
Given two objects, merge src into dst. - If a property in src has a truthy value in ignoreMap then skip merging it. - If a property exists in src and not in dst, the property is added to dst. - If an array property exists in src and in dst, the src elements are added to dst. - If an array property exists in dst and a n...
[ "Given", "two", "objects", "merge", "src", "into", "dst", ".", "-", "If", "a", "property", "in", "src", "has", "a", "truthy", "value", "in", "ignoreMap", "then", "skip", "merging", "it", ".", "-", "If", "a", "property", "exists", "in", "src", "and", ...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1585-L1628
30,274
Rekord/rekord
build/rekord.js
propsMatch
function propsMatch(test, testFields, expected, expectedFields, equals) { var equality = equals || Rekord.equals; if ( isString( testFields ) ) // && isString( expectedFields ) { return equality( test[ testFields ], expected[ expectedFields ] ); } else // if ( isArray( testFields ) && isArray( expectedFi...
javascript
function propsMatch(test, testFields, expected, expectedFields, equals) { var equality = equals || Rekord.equals; if ( isString( testFields ) ) // && isString( expectedFields ) { return equality( test[ testFields ], expected[ expectedFields ] ); } else // if ( isArray( testFields ) && isArray( expectedFi...
[ "function", "propsMatch", "(", "test", ",", "testFields", ",", "expected", ",", "expectedFields", ",", "equals", ")", "{", "var", "equality", "=", "equals", "||", "Rekord", ".", "equals", ";", "if", "(", "isString", "(", "testFields", ")", ")", "// && isSt...
Determines whether the properties on one object equals the properties on another object. @memberof Rekord @param {Object} test - The object to test for matching. @param {String|String[]} testFields - The property name or array of properties to test for equality on `test`. @param {Object} expected - The object with the...
[ "Determines", "whether", "the", "properties", "on", "one", "object", "equals", "the", "properties", "on", "another", "object", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1694-L1719
30,275
Rekord/rekord
build/rekord.js
hasFields
function hasFields(model, fields, exists) { if ( isArray( fields ) ) { for (var i = 0; i < fields.length; i++) { if ( !exists( model[ fields[ i ] ] ) ) { return false; } } return true; } else // isString( fields ) { return exists( model[ fields ] ); } }
javascript
function hasFields(model, fields, exists) { if ( isArray( fields ) ) { for (var i = 0; i < fields.length; i++) { if ( !exists( model[ fields[ i ] ] ) ) { return false; } } return true; } else // isString( fields ) { return exists( model[ fields ] ); } }
[ "function", "hasFields", "(", "model", ",", "fields", ",", "exists", ")", "{", "if", "(", "isArray", "(", "fields", ")", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "fields", ".", "length", ";", "i", "++", ")", "{", "if", "(", ...
Determines whether the given model has the given fields
[ "Determines", "whether", "the", "given", "model", "has", "the", "given", "fields" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L1722-L1740
30,276
Rekord/rekord
build/rekord.js
createPropertyResolver
function createPropertyResolver(properties) { if ( isFunction( properties ) ) { return properties; } else if ( isString( properties ) ) { if ( properties in PropertyResolvers ) { return PropertyResolvers[ properties ]; } if ( isFormatInput( properties ) ) { return createFo...
javascript
function createPropertyResolver(properties) { if ( isFunction( properties ) ) { return properties; } else if ( isString( properties ) ) { if ( properties in PropertyResolvers ) { return PropertyResolvers[ properties ]; } if ( isFormatInput( properties ) ) { return createFo...
[ "function", "createPropertyResolver", "(", "properties", ")", "{", "if", "(", "isFunction", "(", "properties", ")", ")", "{", "return", "properties", ";", "}", "else", "if", "(", "isString", "(", "properties", ")", ")", "{", "if", "(", "properties", "in", ...
Creates a function which resolves a value from another value given an expression. This is often used to get a property value of an object. ```javascript // x = {age: 6, name: 'tom', user: {first: 'jack'}} createPropertyResolver()( x ) // x createPropertyResolver( 'age' )( x ) ...
[ "Creates", "a", "function", "which", "resolves", "a", "value", "from", "another", "value", "given", "an", "expression", ".", "This", "is", "often", "used", "to", "get", "a", "property", "value", "of", "an", "object", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L2166-L2234
30,277
Rekord/rekord
build/rekord.js
createWhere
function createWhere(properties, value, equals) { var equality = equals || equalsStrict; if ( isFunction( properties ) ) { return properties; } else if ( isArray( properties ) ) { var parsed = []; for (var i = 0; i < properties.length; i++) { var where = properties[ i ]; parse...
javascript
function createWhere(properties, value, equals) { var equality = equals || equalsStrict; if ( isFunction( properties ) ) { return properties; } else if ( isArray( properties ) ) { var parsed = []; for (var i = 0; i < properties.length; i++) { var where = properties[ i ]; parse...
[ "function", "createWhere", "(", "properties", ",", "value", ",", "equals", ")", "{", "var", "equality", "=", "equals", "||", "equalsStrict", ";", "if", "(", "isFunction", "(", "properties", ")", ")", "{", "return", "properties", ";", "}", "else", "if", "...
Creates a function which returns a true or false value given a test value. This is also known as a filter function. ```javascript Rekord.createWhere('field', true); // when an object has property where field=true Rekord.createWhere('field'); // when an object has the property named field Rekord.createWhere(function()...
[ "Creates", "a", "function", "which", "returns", "a", "true", "or", "false", "value", "given", "a", "test", "value", ".", "This", "is", "also", "known", "as", "a", "filter", "function", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L2400-L2492
30,278
Rekord/rekord
build/rekord.js
Rekord
function Rekord(options) { var promise = Rekord.get( options.name ); if ( promise.isComplete() ) { return promise.results[0]; } Rekord.trigger( Rekord.Events.Options, [options] ); var database = new Database( options ); var model = Class.dynamic( Model, new Model( database ), database....
javascript
function Rekord(options) { var promise = Rekord.get( options.name ); if ( promise.isComplete() ) { return promise.results[0]; } Rekord.trigger( Rekord.Events.Options, [options] ); var database = new Database( options ); var model = Class.dynamic( Model, new Model( database ), database....
[ "function", "Rekord", "(", "options", ")", "{", "var", "promise", "=", "Rekord", ".", "get", "(", "options", ".", "name", ")", ";", "if", "(", "promise", ".", "isComplete", "(", ")", ")", "{", "return", "promise", ".", "results", "[", "0", "]", ";"...
Creates a Rekord object given a set of options. A Rekord object is also the constructor for creating instances of the Rekord object defined. @namespace @param {Object} options The options of
[ "Creates", "a", "Rekord", "object", "given", "a", "set", "of", "options", ".", "A", "Rekord", "object", "is", "also", "the", "constructor", "for", "creating", "instances", "of", "the", "Rekord", "object", "defined", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L2578-L2626
30,279
Rekord/rekord
build/rekord.js
function(saving) { if ( !isObject( saving ) ) { return false; } for (var prop in saving) { if ( !this.ignoredFields[ prop ] ) { return true; } } return false; }
javascript
function(saving) { if ( !isObject( saving ) ) { return false; } for (var prop in saving) { if ( !this.ignoredFields[ prop ] ) { return true; } } return false; }
[ "function", "(", "saving", ")", "{", "if", "(", "!", "isObject", "(", "saving", ")", ")", "{", "return", "false", ";", "}", "for", "(", "var", "prop", "in", "saving", ")", "{", "if", "(", "!", "this", ".", "ignoredFields", "[", "prop", "]", ")", ...
Determines whether the given object has data to save
[ "Determines", "whether", "the", "given", "object", "has", "data", "to", "save" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L4051-L4067
30,280
Rekord/rekord
build/rekord.js
function(input, callback, context, remoteData) { var db = this; var promise = new Promise(); promise.success( callback, context || db ); function checkModel() { var result = db.parseModel( input, remoteData ); if ( result !== false && !promise.isComplete() && db.initialized ) ...
javascript
function(input, callback, context, remoteData) { var db = this; var promise = new Promise(); promise.success( callback, context || db ); function checkModel() { var result = db.parseModel( input, remoteData ); if ( result !== false && !promise.isComplete() && db.initialized ) ...
[ "function", "(", "input", ",", "callback", ",", "context", ",", "remoteData", ")", "{", "var", "db", "=", "this", ";", "var", "promise", "=", "new", "Promise", "(", ")", ";", "promise", ".", "success", "(", "callback", ",", "context", "||", "db", ")"...
Grab a model with the given input and notify the callback
[ "Grab", "a", "model", "with", "the", "given", "input", "and", "notify", "the", "callback" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L4070-L4124
30,281
Rekord/rekord
build/rekord.js
function(revision) { if ( isFunction( revision ) ) { this.revisionFunction = revision; } else if ( isString( revision ) ) { this.revisionFunction = function(a, b) { var ar = isObject( a ) && revision in a ? a[ revision ] : undefined; var br = isObject( b ) && revi...
javascript
function(revision) { if ( isFunction( revision ) ) { this.revisionFunction = revision; } else if ( isString( revision ) ) { this.revisionFunction = function(a, b) { var ar = isObject( a ) && revision in a ? a[ revision ] : undefined; var br = isObject( b ) && revi...
[ "function", "(", "revision", ")", "{", "if", "(", "isFunction", "(", "revision", ")", ")", "{", "this", ".", "revisionFunction", "=", "revision", ";", "}", "else", "if", "(", "isString", "(", "revision", ")", ")", "{", "this", ".", "revisionFunction", ...
Sets a revision comparision function for this database. It can be a field name or a function. This is used to avoid updating model data that is older than the model's current data.
[ "Sets", "a", "revision", "comparision", "function", "for", "this", "database", ".", "It", "can", "be", "a", "field", "name", "or", "a", "function", ".", "This", "is", "used", "to", "avoid", "updating", "model", "data", "that", "is", "older", "than", "the...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L4216-L4239
30,282
Rekord/rekord
build/rekord.js
function(key) { var db = this; var model = db.all[ key ]; if ( db.cache === Cache.All ) { return db.destroyLocalCachedModel( model, key ); } else { return db.destroyLocalUncachedModel( model, key ); } }
javascript
function(key) { var db = this; var model = db.all[ key ]; if ( db.cache === Cache.All ) { return db.destroyLocalCachedModel( model, key ); } else { return db.destroyLocalUncachedModel( model, key ); } }
[ "function", "(", "key", ")", "{", "var", "db", "=", "this", ";", "var", "model", "=", "db", ".", "all", "[", "key", "]", ";", "if", "(", "db", ".", "cache", "===", "Cache", ".", "All", ")", "{", "return", "db", ".", "destroyLocalCachedModel", "("...
Destroys a model locally because it doesn't exist remotely
[ "Destroys", "a", "model", "locally", "because", "it", "doesn", "t", "exist", "remotely" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L4626-L4639
30,283
Rekord/rekord
build/rekord.js
function(callback, context) { var db = this; var promise = new Promise(); var success = this.handleRefreshSuccess( promise ); var failure = this.handleRefreshFailure( promise ); promise.complete( callback, context || db ); batchExecute(function() { db.executeRefresh( success, failu...
javascript
function(callback, context) { var db = this; var promise = new Promise(); var success = this.handleRefreshSuccess( promise ); var failure = this.handleRefreshFailure( promise ); promise.complete( callback, context || db ); batchExecute(function() { db.executeRefresh( success, failu...
[ "function", "(", "callback", ",", "context", ")", "{", "var", "db", "=", "this", ";", "var", "promise", "=", "new", "Promise", "(", ")", ";", "var", "success", "=", "this", ".", "handleRefreshSuccess", "(", "promise", ")", ";", "var", "failure", "=", ...
Loads all data remotely
[ "Loads", "all", "data", "remotely" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L4904-L4919
30,284
Rekord/rekord
build/rekord.js
function(model, cascade, options) { var db = this; if ( model.$isDeleted() ) { Rekord.debug( Rekord.Debugs.SAVE_DELETED, db, model ); return; } var key = model.$key(); var existing = db.models.has( key ); if ( existing ) { db.trigger( Database.Events.ModelUpdated,...
javascript
function(model, cascade, options) { var db = this; if ( model.$isDeleted() ) { Rekord.debug( Rekord.Debugs.SAVE_DELETED, db, model ); return; } var key = model.$key(); var existing = db.models.has( key ); if ( existing ) { db.trigger( Database.Events.ModelUpdated,...
[ "function", "(", "model", ",", "cascade", ",", "options", ")", "{", "var", "db", "=", "this", ";", "if", "(", "model", ".", "$isDeleted", "(", ")", ")", "{", "Rekord", ".", "debug", "(", "Rekord", ".", "Debugs", ".", "SAVE_DELETED", ",", "db", ",",...
Save the model
[ "Save", "the", "model" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L5020-L5050
30,285
Rekord/rekord
build/rekord.js
function(model, cascade, options) { var db = this; // If we have it in the models, remove it! this.removeFromModels( model ); // If we're offline and we have a pending save - cancel the pending save. if ( model.$status === Model.Status.SavePending ) { Rekord.debug( Rekord.Debugs.REMOVE...
javascript
function(model, cascade, options) { var db = this; // If we have it in the models, remove it! this.removeFromModels( model ); // If we're offline and we have a pending save - cancel the pending save. if ( model.$status === Model.Status.SavePending ) { Rekord.debug( Rekord.Debugs.REMOVE...
[ "function", "(", "model", ",", "cascade", ",", "options", ")", "{", "var", "db", "=", "this", ";", "// If we have it in the models, remove it!", "this", ".", "removeFromModels", "(", "model", ")", ";", "// If we're offline and we have a pending save - cancel the pending s...
Remove the model
[ "Remove", "the", "model" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L5053-L5069
30,286
Rekord/rekord
build/rekord.js
function(key, value) { if ( key in this.indices ) { this.values[ this.indices[ key ] ] = value; } else { this.indices[ key ] = this.values.length; AP.push.call( this.values, value ); AP.push.call( this.keys, key ); } return this; }
javascript
function(key, value) { if ( key in this.indices ) { this.values[ this.indices[ key ] ] = value; } else { this.indices[ key ] = this.values.length; AP.push.call( this.values, value ); AP.push.call( this.keys, key ); } return this; }
[ "function", "(", "key", ",", "value", ")", "{", "if", "(", "key", "in", "this", ".", "indices", ")", "{", "this", ".", "values", "[", "this", ".", "indices", "[", "key", "]", "]", "=", "value", ";", "}", "else", "{", "this", ".", "indices", "["...
Puts the value in the map by the given key. @param {String} key @param {V} value @return {Rekord.Map} - The reference to this map.
[ "Puts", "the", "value", "in", "the", "map", "by", "the", "given", "key", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6087-L6101
30,287
Rekord/rekord
build/rekord.js
function(index) { var key = this.keys[ index ]; var lastValue = AP.pop.apply( this.values ); var lastKey = AP.pop.apply( this.keys ); if ( index < this.values.length ) { this.values[ index ] = lastValue; this.keys[ index ] = lastKey; this.indices[ lastKey ] = index; } d...
javascript
function(index) { var key = this.keys[ index ]; var lastValue = AP.pop.apply( this.values ); var lastKey = AP.pop.apply( this.keys ); if ( index < this.values.length ) { this.values[ index ] = lastValue; this.keys[ index ] = lastKey; this.indices[ lastKey ] = index; } d...
[ "function", "(", "index", ")", "{", "var", "key", "=", "this", ".", "keys", "[", "index", "]", ";", "var", "lastValue", "=", "AP", ".", "pop", ".", "apply", "(", "this", ".", "values", ")", ";", "var", "lastKey", "=", "AP", ".", "pop", ".", "ap...
Removes the value & key at the given index. @param {Number} index @return {Rekord.Map} - The reference to this map.
[ "Removes", "the", "value", "&", "key", "at", "the", "given", "index", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6140-L6156
30,288
Rekord/rekord
build/rekord.js
function(callback, dest) { var out = dest || new Map(); var n = this.size(); var values = this.values; var keys = this.keys; for (var i = 0; i < n; i++) { var v = values[ i ]; var k = keys[ i ]; if ( callback( v, k ) ) { out.put( k, v ); } } ret...
javascript
function(callback, dest) { var out = dest || new Map(); var n = this.size(); var values = this.values; var keys = this.keys; for (var i = 0; i < n; i++) { var v = values[ i ]; var k = keys[ i ]; if ( callback( v, k ) ) { out.put( k, v ); } } ret...
[ "function", "(", "callback", ",", "dest", ")", "{", "var", "out", "=", "dest", "||", "new", "Map", "(", ")", ";", "var", "n", "=", "this", ".", "size", "(", ")", ";", "var", "values", "=", "this", ".", "values", ";", "var", "keys", "=", "this",...
Passes all values & keys in this map to a callback and if it returns a truthy value then the key and value are placed in the destination map. @param {Function} callback [description] @param {Rekord.Map} [dest] [description] @return {Rekord.Map} [description]
[ "Passes", "all", "values", "&", "keys", "in", "this", "map", "to", "a", "callback", "and", "if", "it", "returns", "a", "truthy", "value", "then", "the", "key", "and", "value", "are", "placed", "in", "the", "destination", "map", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6208-L6227
30,289
Rekord/rekord
build/rekord.js
function(comparator) { var map = this; // Sort this partition! function partition(left, right) { var pivot = map.values[ Math.floor((right + left) / 2) ]; var i = left; var j = right; while (i <= j) { while (comparator( map.values[i], pivot ) < 0) { ...
javascript
function(comparator) { var map = this; // Sort this partition! function partition(left, right) { var pivot = map.values[ Math.floor((right + left) / 2) ]; var i = left; var j = right; while (i <= j) { while (comparator( map.values[i], pivot ) < 0) { ...
[ "function", "(", "comparator", ")", "{", "var", "map", "=", "this", ";", "// Sort this partition!", "function", "partition", "(", "left", ",", "right", ")", "{", "var", "pivot", "=", "map", ".", "values", "[", "Math", ".", "floor", "(", "(", "right", "...
Sorts the underlying values & keys given a value compare function. @param {function} comparator A function which accepts two values and returns a number used for sorting. If the first argument is less than the second argument, a negative number should be returned. If the arguments are equivalent then 0 should be retu...
[ "Sorts", "the", "underlying", "values", "&", "keys", "given", "a", "value", "compare", "function", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6267-L6328
30,290
Rekord/rekord
build/rekord.js
partition
function partition(left, right) { var pivot = map.values[ Math.floor((right + left) / 2) ]; var i = left; var j = right; while (i <= j) { while (comparator( map.values[i], pivot ) < 0) { i++; } while (comparator( map.values[j], pivot ) > 0) ...
javascript
function partition(left, right) { var pivot = map.values[ Math.floor((right + left) / 2) ]; var i = left; var j = right; while (i <= j) { while (comparator( map.values[i], pivot ) < 0) { i++; } while (comparator( map.values[j], pivot ) > 0) ...
[ "function", "partition", "(", "left", ",", "right", ")", "{", "var", "pivot", "=", "map", ".", "values", "[", "Math", ".", "floor", "(", "(", "right", "+", "left", ")", "/", "2", ")", "]", ";", "var", "i", "=", "left", ";", "var", "j", "=", "...
Sort this partition!
[ "Sort", "this", "partition!" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6272-L6299
30,291
Rekord/rekord
build/rekord.js
function() { this.indices = {}; for (var i = 0, l = this.keys.length; i < l; i++) { this.indices[ this.keys[ i ] ] = i; } return this; }
javascript
function() { this.indices = {}; for (var i = 0, l = this.keys.length; i < l; i++) { this.indices[ this.keys[ i ] ] = i; } return this; }
[ "function", "(", ")", "{", "this", ".", "indices", "=", "{", "}", ";", "for", "(", "var", "i", "=", "0", ",", "l", "=", "this", ".", "keys", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "this", ".", "indices", "[", "this", ...
Rebuilds the index based on the keys. @return {Rekord.Map} - The reference to this map.
[ "Rebuilds", "the", "index", "based", "on", "the", "keys", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6336-L6346
30,292
Rekord/rekord
build/rekord.js
function(out) { var target = out || {}; var keys = this.keys; var values = this.values; for (var i = 0; i < keys.length; i++) { target[ keys[ i ] ] = values[ i ]; } return target; }
javascript
function(out) { var target = out || {}; var keys = this.keys; var values = this.values; for (var i = 0; i < keys.length; i++) { target[ keys[ i ] ] = values[ i ]; } return target; }
[ "function", "(", "out", ")", "{", "var", "target", "=", "out", "||", "{", "}", ";", "var", "keys", "=", "this", ".", "keys", ";", "var", "values", "=", "this", ".", "values", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "keys", ".", ...
Builds an object contain the keys and values in this map. @return {Object} - The built object.
[ "Builds", "an", "object", "contain", "the", "keys", "and", "values", "in", "this", "map", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L6354-L6366
30,293
Rekord/rekord
build/rekord.js
function(comparator, nullsFirst) { var cmp = comparator ? createComparator( comparator, nullsFirst ) : this.comparator; return isSorted( cmp, this ); }
javascript
function(comparator, nullsFirst) { var cmp = comparator ? createComparator( comparator, nullsFirst ) : this.comparator; return isSorted( cmp, this ); }
[ "function", "(", "comparator", ",", "nullsFirst", ")", "{", "var", "cmp", "=", "comparator", "?", "createComparator", "(", "comparator", ",", "nullsFirst", ")", ":", "this", ".", "comparator", ";", "return", "isSorted", "(", "cmp", ",", "this", ")", ";", ...
Determines if the collection is currently sorted based on the current comparator of the collection unless a comparator is given @method @memberof Rekord.Collection# @param {ComparatorInput} [comparator] - The comparator input to convert to a comparison function. @param {Boolean} [nullsFirst=false] - When a comparison ...
[ "Determines", "if", "the", "collection", "is", "currently", "sorted", "based", "on", "the", "current", "comparator", "of", "the", "collection", "unless", "a", "comparator", "is", "given" ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L7610-L7615
30,294
Rekord/rekord
build/rekord.js
function(comparator, nullsFirst, ignorePrimitive) { var cmp = comparator ? createComparator( comparator, nullsFirst ) : this.comparator; if ( !isSorted( cmp, this ) || ( !ignorePrimitive && !cmp && isPrimitiveArray( this ) ) ) { AP.sort.call( this, cmp ); this.trigger( Collection.Events.Sort...
javascript
function(comparator, nullsFirst, ignorePrimitive) { var cmp = comparator ? createComparator( comparator, nullsFirst ) : this.comparator; if ( !isSorted( cmp, this ) || ( !ignorePrimitive && !cmp && isPrimitiveArray( this ) ) ) { AP.sort.call( this, cmp ); this.trigger( Collection.Events.Sort...
[ "function", "(", "comparator", ",", "nullsFirst", ",", "ignorePrimitive", ")", "{", "var", "cmp", "=", "comparator", "?", "createComparator", "(", "comparator", ",", "nullsFirst", ")", ":", "this", ".", "comparator", ";", "if", "(", "!", "isSorted", "(", "...
Sorts the elements in this collection based on the current comparator unless a comparator is given. If a comparator is given it will not override the current comparator, subsequent operations to the collection may trigger a sort if the collection has a comparator. @method @memberof Rekord.Collection# @param {Comparato...
[ "Sorts", "the", "elements", "in", "this", "collection", "based", "on", "the", "current", "comparator", "unless", "a", "comparator", "is", "given", ".", "If", "a", "comparator", "is", "given", "it", "will", "not", "override", "the", "current", "comparator", "...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L7639-L7651
30,295
Rekord/rekord
build/rekord.js
function(values) { this.length = 0; if ( isArray( values ) ) { AP.push.apply( this, values ); } else if ( isValue( values ) ) { AP.push.call( this, values ); } this.trigger( Collection.Events.Reset, [this] ); this.sort( undefined, undefined, true ); return this; ...
javascript
function(values) { this.length = 0; if ( isArray( values ) ) { AP.push.apply( this, values ); } else if ( isValue( values ) ) { AP.push.call( this, values ); } this.trigger( Collection.Events.Reset, [this] ); this.sort( undefined, undefined, true ); return this; ...
[ "function", "(", "values", ")", "{", "this", ".", "length", "=", "0", ";", "if", "(", "isArray", "(", "values", ")", ")", "{", "AP", ".", "push", ".", "apply", "(", "this", ",", "values", ")", ";", "}", "else", "if", "(", "isValue", "(", "value...
Resets the values in this collection with a new collection of values. @method @memberof Rekord.Collection# @param {Any[]} [values] - The new array of values in this collection. @return {Rekord.Collection} - The reference to this collection. @emits Rekord.Collection#reset
[ "Resets", "the", "values", "in", "this", "collection", "with", "a", "new", "collection", "of", "values", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L7664-L7681
30,296
Rekord/rekord
build/rekord.js
function(collection, out, equals) { var target = out || this.cloneEmpty(); var equality = equals || equalsStrict; for (var i = 0; i < this.length; i++) { var a = this[ i ]; var exists = false; for (var j = 0; j < collection.length && !exists; j++) { exists = equality(...
javascript
function(collection, out, equals) { var target = out || this.cloneEmpty(); var equality = equals || equalsStrict; for (var i = 0; i < this.length; i++) { var a = this[ i ]; var exists = false; for (var j = 0; j < collection.length && !exists; j++) { exists = equality(...
[ "function", "(", "collection", ",", "out", ",", "equals", ")", "{", "var", "target", "=", "out", "||", "this", ".", "cloneEmpty", "(", ")", ";", "var", "equality", "=", "equals", "||", "equalsStrict", ";", "for", "(", "var", "i", "=", "0", ";", "i"...
Returns a collection with elements that exist in this collection but does not exist in the given collection. ```javascript var a = Rekord.collect(1, 2, 3, 4); var b = Rekord.collect(1, 3, 5); var c = a.subtract( b ); // [2, 4] ``` @method @memberof Rekord.Collection# @param {Array} collection - The array of elements ...
[ "Returns", "a", "collection", "with", "elements", "that", "exist", "in", "this", "collection", "but", "does", "not", "exist", "in", "the", "given", "collection", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L7800-L7822
30,297
Rekord/rekord
build/rekord.js
function() { var values = arguments; AP.unshift.apply( this, values ); this.trigger( Collection.Events.Adds, [this, AP.slice.apply(values), 0] ); this.sort( undefined, undefined, true ); return this.length; }
javascript
function() { var values = arguments; AP.unshift.apply( this, values ); this.trigger( Collection.Events.Adds, [this, AP.slice.apply(values), 0] ); this.sort( undefined, undefined, true ); return this.length; }
[ "function", "(", ")", "{", "var", "values", "=", "arguments", ";", "AP", ".", "unshift", ".", "apply", "(", "this", ",", "values", ")", ";", "this", ".", "trigger", "(", "Collection", ".", "Events", ".", "Adds", ",", "[", "this", ",", "AP", ".", ...
Adds one or more elements to the beginning of this collection - sorting the collection if a comparator is set on this collection. ```javascript var a = Rekord.collect(1, 2, 3, 4); a.unshift( 5, 6, 7 ); // 7 a // [5, 6, 7, 1, 2, 3, 4] ``` @method @memberof Rekord.Collection# @param {...Any} value - The values to add t...
[ "Adds", "one", "or", "more", "elements", "to", "the", "beginning", "of", "this", "collection", "-", "sorting", "the", "collection", "if", "a", "comparator", "is", "set", "on", "this", "collection", "." ]
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L8036-L8047
30,298
Rekord/rekord
build/rekord.js
function(values, delaySort) { if ( isArray( values ) && values.length ) { var i = this.length; AP.push.apply( this, values ); this.trigger( Collection.Events.Adds, [this, values, i] ); if ( !delaySort ) { this.sort( undefined, undefined, true ); } } retu...
javascript
function(values, delaySort) { if ( isArray( values ) && values.length ) { var i = this.length; AP.push.apply( this, values ); this.trigger( Collection.Events.Adds, [this, values, i] ); if ( !delaySort ) { this.sort( undefined, undefined, true ); } } retu...
[ "function", "(", "values", ",", "delaySort", ")", "{", "if", "(", "isArray", "(", "values", ")", "&&", "values", ".", "length", ")", "{", "var", "i", "=", "this", ".", "length", ";", "AP", ".", "push", ".", "apply", "(", "this", ",", "values", ")...
Adds all elements in the given array to this collection - sorting the collection if a comparator is set on this collection and `delaySort` is not specified or a true value. ```javascript var a = Rekord.collect(1, 2, 3, 4); a.addAll( [5, 6] ); // [1, 2, 3, 4, 5, 6] ``` @method @memberof Rekord.Collection# @param {Any[...
[ "Adds", "all", "elements", "in", "the", "given", "array", "to", "this", "collection", "-", "sorting", "the", "collection", "if", "a", "comparator", "is", "set", "on", "this", "collection", "and", "delaySort", "is", "not", "specified", "or", "a", "true", "v...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L8071-L8088
30,299
Rekord/rekord
build/rekord.js
function(i, value, delaySort) { AP.splice.call( this, i, 0, value ); this.trigger( Collection.Events.Add, [this, value, i] ); if ( !delaySort ) { this.sort( undefined, undefined, true ); } return this; }
javascript
function(i, value, delaySort) { AP.splice.call( this, i, 0, value ); this.trigger( Collection.Events.Add, [this, value, i] ); if ( !delaySort ) { this.sort( undefined, undefined, true ); } return this; }
[ "function", "(", "i", ",", "value", ",", "delaySort", ")", "{", "AP", ".", "splice", ".", "call", "(", "this", ",", "i", ",", "0", ",", "value", ")", ";", "this", ".", "trigger", "(", "Collection", ".", "Events", ".", "Add", ",", "[", "this", "...
Inserts an element into this collection at the given index - sorting the collection if a comparator is set on this collection and `delaySort` is not specified or a true value. ```javascript var c = Rekord.collect(1, 2, 3, 4); c.insertAt( 0, 0 ); // [0, 1, 2, 3, 4] c.insertAt( 2, 1.5 ); // [0, 1, 1.5, 2, 3, 4] ``` @me...
[ "Inserts", "an", "element", "into", "this", "collection", "at", "the", "given", "index", "-", "sorting", "the", "collection", "if", "a", "comparator", "is", "set", "on", "this", "collection", "and", "delaySort", "is", "not", "specified", "or", "a", "true", ...
6663dbedad865549a6b9bccaa9a993b2074483e6
https://github.com/Rekord/rekord/blob/6663dbedad865549a6b9bccaa9a993b2074483e6/build/rekord.js#L8115-L8127