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
45,600
mchalapuk/hyper-text-slider
lib/core/phaser.js
nextPhase
function nextPhase(priv) { setPhase(priv, PHASE_VALUES[(PHASE_VALUES.indexOf(priv.phase) + 1) % PHASE_VALUES.length]); }
javascript
function nextPhase(priv) { setPhase(priv, PHASE_VALUES[(PHASE_VALUES.indexOf(priv.phase) + 1) % PHASE_VALUES.length]); }
[ "function", "nextPhase", "(", "priv", ")", "{", "setPhase", "(", "priv", ",", "PHASE_VALUES", "[", "(", "PHASE_VALUES", ".", "indexOf", "(", "priv", ".", "phase", ")", "+", "1", ")", "%", "PHASE_VALUES", ".", "length", "]", ")", ";", "}" ]
Switches phase to next one. This method is automatically invoked each time a transition ends on DOM element added as phase trigger. @fqn Phaser.prototype.nextPhase
[ "Switches", "phase", "to", "next", "one", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L133-L135
45,601
mchalapuk/hyper-text-slider
lib/core/phaser.js
setPhase
function setPhase(priv, phase) { check(phase, 'phase').is.oneOf(PHASE_VALUES)(); if (priv.phase !== null) { priv.elem.classList.remove(priv.phase); } priv.phase = phase; if (phase !== null) { priv.elem.classList.add(phase); } priv.listeners.forEach(function(listener) { listener(phase); }); ...
javascript
function setPhase(priv, phase) { check(phase, 'phase').is.oneOf(PHASE_VALUES)(); if (priv.phase !== null) { priv.elem.classList.remove(priv.phase); } priv.phase = phase; if (phase !== null) { priv.elem.classList.add(phase); } priv.listeners.forEach(function(listener) { listener(phase); }); ...
[ "function", "setPhase", "(", "priv", ",", "phase", ")", "{", "check", "(", "phase", ",", "'phase'", ")", ".", "is", ".", "oneOf", "(", "PHASE_VALUES", ")", "(", ")", ";", "if", "(", "priv", ".", "phase", "!==", "null", ")", "{", "priv", ".", "ele...
Changes current phase. Invoking this method will result in setting CSS class name of requested phase on container element. @param {String} phase desired phase @fqn Phaser.prototype.setPhase
[ "Changes", "current", "phase", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L146-L160
45,602
mchalapuk/hyper-text-slider
lib/core/phaser.js
addPhaseTrigger
function addPhaseTrigger(priv, target, propertyName) { check(target, 'target').is.anEventTarget(); var property = propertyName || 'transform'; check(property, 'property').is.aString(); if (property === 'transform') { property = feature.transformPropertyName; } priv.phaseTriggers.put(property, target); ...
javascript
function addPhaseTrigger(priv, target, propertyName) { check(target, 'target').is.anEventTarget(); var property = propertyName || 'transform'; check(property, 'property').is.aString(); if (property === 'transform') { property = feature.transformPropertyName; } priv.phaseTriggers.put(property, target); ...
[ "function", "addPhaseTrigger", "(", "priv", ",", "target", ",", "propertyName", ")", "{", "check", "(", "target", ",", "'target'", ")", ".", "is", ".", "anEventTarget", "(", ")", ";", "var", "property", "=", "propertyName", "||", "'transform'", ";", "check...
Adds passed target to phase triggers. Phase will be automatically set to next each time a `transitionend` event of matching **target** and **propertyName** bubbles up to Phaser's container element. @param {Node} target (typically DOM Element) that will trigger next phase when matched @param {String} propertyName will...
[ "Adds", "passed", "target", "to", "phase", "triggers", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L175-L185
45,603
mchalapuk/hyper-text-slider
lib/core/phaser.js
addPhaseListener
function addPhaseListener(priv, listener) { priv.listeners.push(check(listener, 'listener').is.aFunction()); }
javascript
function addPhaseListener(priv, listener) { priv.listeners.push(check(listener, 'listener').is.aFunction()); }
[ "function", "addPhaseListener", "(", "priv", ",", "listener", ")", "{", "priv", ".", "listeners", ".", "push", "(", "check", "(", "listener", ",", "'listener'", ")", ".", "is", ".", "aFunction", "(", ")", ")", ";", "}" ]
Adds a listener that will be notified on phase changes. It is used by the ${link Slider} to change styles of dots representing slides. @param {Function} listener listener to be added @fqn Phaser.prototype.addPhaseListener
[ "Adds", "a", "listener", "that", "will", "be", "notified", "on", "phase", "changes", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L196-L198
45,604
mchalapuk/hyper-text-slider
lib/core/phaser.js
removePhaseTrigger
function removePhaseTrigger(priv, target, propertyName) { var property = propertyName || 'transform'; check(property, 'property').is.aString(); var triggerElements = priv.phaseTriggers.get(property); check(target, 'target').is.instanceOf(EventTarget).and.is.oneOf(triggerElements, 'phase triggers')(); trigger...
javascript
function removePhaseTrigger(priv, target, propertyName) { var property = propertyName || 'transform'; check(property, 'property').is.aString(); var triggerElements = priv.phaseTriggers.get(property); check(target, 'target').is.instanceOf(EventTarget).and.is.oneOf(triggerElements, 'phase triggers')(); trigger...
[ "function", "removePhaseTrigger", "(", "priv", ",", "target", ",", "propertyName", ")", "{", "var", "property", "=", "propertyName", "||", "'transform'", ";", "check", "(", "property", ",", "'property'", ")", ".", "is", ".", "aString", "(", ")", ";", "var"...
Removes passed target from phase triggers. @param {Node} target that will no longer be used as a phase trigger @param {String} transitionProperty that will no longer be a trigger (optional, defaults to 'transform') @precondition given pair of **target** and **propertyName** is registered as phase trigger @fqn Phaser....
[ "Removes", "passed", "target", "from", "phase", "triggers", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L209-L216
45,605
mchalapuk/hyper-text-slider
lib/core/phaser.js
removePhaseListener
function removePhaseListener(priv, listener) { check(listener, 'listener').is.aFunction.and.is.oneOf(priv.listeners, 'registered listeners')(); priv.listeners.splice(priv.listeners.indexOf(listener), 1); }
javascript
function removePhaseListener(priv, listener) { check(listener, 'listener').is.aFunction.and.is.oneOf(priv.listeners, 'registered listeners')(); priv.listeners.splice(priv.listeners.indexOf(listener), 1); }
[ "function", "removePhaseListener", "(", "priv", ",", "listener", ")", "{", "check", "(", "listener", ",", "'listener'", ")", ".", "is", ".", "aFunction", ".", "and", ".", "is", ".", "oneOf", "(", "priv", ".", "listeners", ",", "'registered listeners'", ")"...
Removes passed listener from the phaser. @param {Function} listener listener to be removed @fqn Phaser.prototype.removePhaseListener
[ "Removes", "passed", "listener", "from", "the", "phaser", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L224-L227
45,606
mchalapuk/hyper-text-slider
lib/core/phaser.js
maybeStart
function maybeStart(priv) { if (priv.started) { return; } priv.elem.addEventListener(feature.transitionEventName, handleTransitionEnd.bind(null, priv)); priv.started = true; }
javascript
function maybeStart(priv) { if (priv.started) { return; } priv.elem.addEventListener(feature.transitionEventName, handleTransitionEnd.bind(null, priv)); priv.started = true; }
[ "function", "maybeStart", "(", "priv", ")", "{", "if", "(", "priv", ".", "started", ")", "{", "return", ";", "}", "priv", ".", "elem", ".", "addEventListener", "(", "feature", ".", "transitionEventName", ",", "handleTransitionEnd", ".", "bind", "(", "null"...
Attaches event listener to phasers DOM element, if phaser was not previously started.
[ "Attaches", "event", "listener", "to", "phasers", "DOM", "element", "if", "phaser", "was", "not", "previously", "started", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L241-L247
45,607
mchalapuk/hyper-text-slider
lib/core/phaser.js
handleTransitionEnd
function handleTransitionEnd(priv, evt) { if (evt.propertyName in priv.phaseTriggers && priv.phaseTriggers[evt.propertyName].indexOf(evt.target) !== -1) { nextPhase(priv); } }
javascript
function handleTransitionEnd(priv, evt) { if (evt.propertyName in priv.phaseTriggers && priv.phaseTriggers[evt.propertyName].indexOf(evt.target) !== -1) { nextPhase(priv); } }
[ "function", "handleTransitionEnd", "(", "priv", ",", "evt", ")", "{", "if", "(", "evt", ".", "propertyName", "in", "priv", ".", "phaseTriggers", "&&", "priv", ".", "phaseTriggers", "[", "evt", ".", "propertyName", "]", ".", "indexOf", "(", "evt", ".", "t...
Moves to next phase if transition that ended matches one of phase triggers.
[ "Moves", "to", "next", "phase", "if", "transition", "that", "ended", "matches", "one", "of", "phase", "triggers", "." ]
2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4
https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/core/phaser.js#L250-L255
45,608
haraldrudell/nodegod
lib/master/streamlabeller.js
logChild
function logChild(child, slogan, write) { if (child) { logSocket(child.stdout, slogan, write) logSocket(child.stderr, slogan, write) } }
javascript
function logChild(child, slogan, write) { if (child) { logSocket(child.stdout, slogan, write) logSocket(child.stderr, slogan, write) } }
[ "function", "logChild", "(", "child", ",", "slogan", ",", "write", ")", "{", "if", "(", "child", ")", "{", "logSocket", "(", "child", ".", "stdout", ",", "slogan", ",", "write", ")", "logSocket", "(", "child", ".", "stderr", ",", "slogan", ",", "writ...
log joint output for a child process
[ "log", "joint", "output", "for", "a", "child", "process" ]
3be4fb280fb18e0ec0a1c1a8fea3254d92f00b21
https://github.com/haraldrudell/nodegod/blob/3be4fb280fb18e0ec0a1c1a8fea3254d92f00b21/lib/master/streamlabeller.js#L10-L15
45,609
Whitebolt/require-extra
tasks/jsdoc-json.js
parseJsDoc
function parseJsDoc(filePath, jsdoc) { return jsdoc.explain({files:[filePath]}).then(items=>{ const data = {}; items.forEach(item=>{ if (!item.undocumented && !data.hasOwnProperty(item.longname)) { data[item.longname] = { name: item.name, description: item.classdesc || item....
javascript
function parseJsDoc(filePath, jsdoc) { return jsdoc.explain({files:[filePath]}).then(items=>{ const data = {}; items.forEach(item=>{ if (!item.undocumented && !data.hasOwnProperty(item.longname)) { data[item.longname] = { name: item.name, description: item.classdesc || item....
[ "function", "parseJsDoc", "(", "filePath", ",", "jsdoc", ")", "{", "return", "jsdoc", ".", "explain", "(", "{", "files", ":", "[", "filePath", "]", "}", ")", ".", "then", "(", "items", "=>", "{", "const", "data", "=", "{", "}", ";", "items", ".", ...
Parse an input file for jsDoc and put json results in give output file. @param {string} filePath File path to parse jsDoc from. @param {Object} jsdoc The jsdoc class. @returns {Promise.<Object>} Parsed jsDoc data.
[ "Parse", "an", "input", "file", "for", "jsDoc", "and", "put", "json", "results", "in", "give", "output", "file", "." ]
2a8f737aab67305c9fda3ee56aa7953e97cee859
https://github.com/Whitebolt/require-extra/blob/2a8f737aab67305c9fda3ee56aa7953e97cee859/tasks/jsdoc-json.js#L12-L26
45,610
pierrec/node-ekam
lib/js-ast.js
build
function build (data, cache, scope) { scope = scope || { var: '' } return data .map(function (item) { return typeof item === 'string' ? item : Buffer.isBuffer(item) ? item.toString() : item.run(cache, scope) }) .join('') }
javascript
function build (data, cache, scope) { scope = scope || { var: '' } return data .map(function (item) { return typeof item === 'string' ? item : Buffer.isBuffer(item) ? item.toString() : item.run(cache, scope) }) .join('') }
[ "function", "build", "(", "data", ",", "cache", ",", "scope", ")", "{", "scope", "=", "scope", "||", "{", "var", ":", "''", "}", "return", "data", ".", "map", "(", "function", "(", "item", ")", "{", "return", "typeof", "item", "===", "'string'", "?...
Walk the AST and evaluate the nodes
[ "Walk", "the", "AST", "and", "evaluate", "the", "nodes" ]
fd36038231c4f49ecae36e25352138cba0ac11aa
https://github.com/pierrec/node-ekam/blob/fd36038231c4f49ecae36e25352138cba0ac11aa/lib/js-ast.js#L16-L28
45,611
redgeoff/sporks
scripts/promise-sporks.js
function (err) { if (err) { reject(err); } else if (arguments.length === 2) { // single param? resolve(arguments[1]); } else { // multiple params? var cbArgsArray = self.toArgsArray(arguments); resolve(cbArgsArray.slice(1)); // remove err arg } ...
javascript
function (err) { if (err) { reject(err); } else if (arguments.length === 2) { // single param? resolve(arguments[1]); } else { // multiple params? var cbArgsArray = self.toArgsArray(arguments); resolve(cbArgsArray.slice(1)); // remove err arg } ...
[ "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "reject", "(", "err", ")", ";", "}", "else", "if", "(", "arguments", ".", "length", "===", "2", ")", "{", "// single param?", "resolve", "(", "arguments", "[", "1", "]", ")", ";", "}",...
Define a callback and add it to the arguments
[ "Define", "a", "callback", "and", "add", "it", "to", "the", "arguments" ]
de1f0b603f2bc82c973d76fb662da8a0d295da90
https://github.com/redgeoff/sporks/blob/de1f0b603f2bc82c973d76fb662da8a0d295da90/scripts/promise-sporks.js#L57-L66
45,612
feedhenry/fh-mbaas-client
lib/admin/stats/stats.js
history
function history(params, cb) { params.resourcePath = config.addURIParams(constants.STATS_BASE_PATH + "/history", params); params.method = 'POST'; params.data = params.data || {}; mbaasRequest.admin(params, cb); }
javascript
function history(params, cb) { params.resourcePath = config.addURIParams(constants.STATS_BASE_PATH + "/history", params); params.method = 'POST'; params.data = params.data || {}; mbaasRequest.admin(params, cb); }
[ "function", "history", "(", "params", ",", "cb", ")", "{", "params", ".", "resourcePath", "=", "config", ".", "addURIParams", "(", "constants", ".", "STATS_BASE_PATH", "+", "\"/history\"", ",", "params", ")", ";", "params", ".", "method", "=", "'POST'", ";...
Stats history post request to an MBaaS @param params @param cb
[ "Stats", "history", "post", "request", "to", "an", "MBaaS" ]
2d5a9cbb32e1b2464d71ffa18513358fea388859
https://github.com/feedhenry/fh-mbaas-client/blob/2d5a9cbb32e1b2464d71ffa18513358fea388859/lib/admin/stats/stats.js#L11-L16
45,613
baskerville/ciebase
src/matrix.js
transpose
function transpose (M) { return ( [[M[0][0], M[1][0], M[2][0]], [M[0][1], M[1][1], M[2][1]], [M[0][2], M[1][2], M[2][2]]] ); }
javascript
function transpose (M) { return ( [[M[0][0], M[1][0], M[2][0]], [M[0][1], M[1][1], M[2][1]], [M[0][2], M[1][2], M[2][2]]] ); }
[ "function", "transpose", "(", "M", ")", "{", "return", "(", "[", "[", "M", "[", "0", "]", "[", "0", "]", ",", "M", "[", "1", "]", "[", "0", "]", ",", "M", "[", "2", "]", "[", "0", "]", "]", ",", "[", "M", "[", "0", "]", "[", "1", "]...
3x3 matrices operations
[ "3x3", "matrices", "operations" ]
11508fc4857f114c91a94a12173fcdaf42db52bf
https://github.com/baskerville/ciebase/blob/11508fc4857f114c91a94a12173fcdaf42db52bf/src/matrix.js#L3-L9
45,614
nodecg/bundle-manager
index.js
handleChange
function handleChange(bundleName) { const bundle = module.exports.find(bundleName); /* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */ if (!bundle) { return; } if (backoffTimer) { log.debug('Backoff active, delaying processing of change det...
javascript
function handleChange(bundleName) { const bundle = module.exports.find(bundleName); /* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */ if (!bundle) { return; } if (backoffTimer) { log.debug('Backoff active, delaying processing of change det...
[ "function", "handleChange", "(", "bundleName", ")", "{", "const", "bundle", "=", "module", ".", "exports", ".", "find", "(", "bundleName", ")", ";", "/* istanbul ignore if: It's rare for `bundle` to be undefined here, but it can happen when using black/whitelisting. */", "if", ...
Emits a `bundleChanged` event for the given bundle. @param bundleName {String}
[ "Emits", "a", "bundleChanged", "event", "for", "the", "given", "bundle", "." ]
11eedf320480ca318da7ad455f31771fb8f44d13
https://github.com/nodecg/bundle-manager/blob/11eedf320480ca318da7ad455f31771fb8f44d13/index.js#L257-L284
45,615
nodecg/bundle-manager
index.js
extractBundleName
function extractBundleName(filePath) { const parts = filePath.replace(bundlesPath, '').split(path.sep); return parts[1]; }
javascript
function extractBundleName(filePath) { const parts = filePath.replace(bundlesPath, '').split(path.sep); return parts[1]; }
[ "function", "extractBundleName", "(", "filePath", ")", "{", "const", "parts", "=", "filePath", ".", "replace", "(", "bundlesPath", ",", "''", ")", ".", "split", "(", "path", ".", "sep", ")", ";", "return", "parts", "[", "1", "]", ";", "}" ]
Returns the name of a bundle that owns a given path. @param filePath {String} - The path of the file to extract a bundle name from. @returns {String} - The name of the bundle that owns this path. @private
[ "Returns", "the", "name", "of", "a", "bundle", "that", "owns", "a", "given", "path", "." ]
11eedf320480ca318da7ad455f31771fb8f44d13
https://github.com/nodecg/bundle-manager/blob/11eedf320480ca318da7ad455f31771fb8f44d13/index.js#L312-L315
45,616
jwhitmarsh/gulp-npm-check
lib/index.js
handleMismatch
function handleMismatch(results, config) { if (results.length) { var message = 'Out of date packages: \n' + results.map(function (p) { return moduleInfo(p); }).join('\n'); if (config.throw === undefined || config.throw !== undefined && config.throw) { throw new _gulpUtil.PluginError('gulp-npm-...
javascript
function handleMismatch(results, config) { if (results.length) { var message = 'Out of date packages: \n' + results.map(function (p) { return moduleInfo(p); }).join('\n'); if (config.throw === undefined || config.throw !== undefined && config.throw) { throw new _gulpUtil.PluginError('gulp-npm-...
[ "function", "handleMismatch", "(", "results", ",", "config", ")", "{", "if", "(", "results", ".", "length", ")", "{", "var", "message", "=", "'Out of date packages: \\n'", "+", "results", ".", "map", "(", "function", "(", "p", ")", "{", "return", "moduleIn...
do things with results @param {array} results results from npm-check @param {config} config object Default method @param {!config} config object @param {Function} cb callback
[ "do", "things", "with", "results" ]
be399d571c4b795fcd9aa0c1495aa1e34781557f
https://github.com/jwhitmarsh/gulp-npm-check/blob/be399d571c4b795fcd9aa0c1495aa1e34781557f/lib/index.js#L95-L111
45,617
vladaspasic/ember-cli-data-validation
addon/validator.js
format
function format(str, formats) { let cachedFormats = formats; if (!Ember.isArray(cachedFormats) || arguments.length > 2) { cachedFormats = new Array(arguments.length - 1); for (let i = 1, l = arguments.length; i < l; i++) { cachedFormats[i - 1] = arguments[i]; } } let idx = 0; return str.replace(/%@([0-...
javascript
function format(str, formats) { let cachedFormats = formats; if (!Ember.isArray(cachedFormats) || arguments.length > 2) { cachedFormats = new Array(arguments.length - 1); for (let i = 1, l = arguments.length; i < l; i++) { cachedFormats[i - 1] = arguments[i]; } } let idx = 0; return str.replace(/%@([0-...
[ "function", "format", "(", "str", ",", "formats", ")", "{", "let", "cachedFormats", "=", "formats", ";", "if", "(", "!", "Ember", ".", "isArray", "(", "cachedFormats", ")", "||", "arguments", ".", "length", ">", "2", ")", "{", "cachedFormats", "=", "ne...
Implement Ember.String.fmt function, to avoid depreciation warnings
[ "Implement", "Ember", ".", "String", ".", "fmt", "function", "to", "avoid", "depreciation", "warnings" ]
08ee8694b9276bf7cbb40e8bc69c52592bb512d3
https://github.com/vladaspasic/ember-cli-data-validation/blob/08ee8694b9276bf7cbb40e8bc69c52592bb512d3/addon/validator.js#L4-L21
45,618
vladaspasic/ember-cli-data-validation
addon/validator.js
function() { const message = this.get('message'); const label = this.get('attributeLabel'); Ember.assert('Message must be defined for this Validator', Ember.isPresent(message)); const args = Array.prototype.slice.call(arguments); args.unshift(label); args.unshift(message); return format.apply(null, ar...
javascript
function() { const message = this.get('message'); const label = this.get('attributeLabel'); Ember.assert('Message must be defined for this Validator', Ember.isPresent(message)); const args = Array.prototype.slice.call(arguments); args.unshift(label); args.unshift(message); return format.apply(null, ar...
[ "function", "(", ")", "{", "const", "message", "=", "this", ".", "get", "(", "'message'", ")", ";", "const", "label", "=", "this", ".", "get", "(", "'attributeLabel'", ")", ";", "Ember", ".", "assert", "(", "'Message must be defined for this Validator'", ","...
Formats the validation error message. All arguments passed to this function would be used by the `Ember.String.fmt` method to format the message. @method format @return {String}
[ "Formats", "the", "validation", "error", "message", "." ]
08ee8694b9276bf7cbb40e8bc69c52592bb512d3
https://github.com/vladaspasic/ember-cli-data-validation/blob/08ee8694b9276bf7cbb40e8bc69c52592bb512d3/addon/validator.js#L94-L106
45,619
theboyWhoCriedWoolf/transition-manager
src/utils/unique.js
unique
function unique( target, arrays ) { target = target || []; var combined = target.concat( arrays ); target = []; var len = combined.length, i = -1, ObjRef; while(++i < len) { ObjRef = combined[ i ]; if( target.indexOf( ObjRef ) === -1 && ObjRef !== '' & ObjRef !== (null || undefined) ) { target...
javascript
function unique( target, arrays ) { target = target || []; var combined = target.concat( arrays ); target = []; var len = combined.length, i = -1, ObjRef; while(++i < len) { ObjRef = combined[ i ]; if( target.indexOf( ObjRef ) === -1 && ObjRef !== '' & ObjRef !== (null || undefined) ) { target...
[ "function", "unique", "(", "target", ",", "arrays", ")", "{", "target", "=", "target", "||", "[", "]", ";", "var", "combined", "=", "target", ".", "concat", "(", "arrays", ")", ";", "target", "=", "[", "]", ";", "var", "len", "=", "combined", ".", ...
join two arrays and prevent duplication @param {array} target @param {array} arrays @return {array}
[ "join", "two", "arrays", "and", "prevent", "duplication" ]
a20fda0bb07c0098bf709ea03770b1ee2a855655
https://github.com/theboyWhoCriedWoolf/transition-manager/blob/a20fda0bb07c0098bf709ea03770b1ee2a855655/src/utils/unique.js#L10-L27
45,620
ecliptic/webpack-blocks-html
lib/index.js
html
function html(options) { return Object.assign(function (context) { var defaultOpts = { filename: 'index.html', template: 'templates/index.html', showErrors: false }; // Merge the provided html config into the context var html = context.html || defaultOpts; /* Warning: Thar be m...
javascript
function html(options) { return Object.assign(function (context) { var defaultOpts = { filename: 'index.html', template: 'templates/index.html', showErrors: false }; // Merge the provided html config into the context var html = context.html || defaultOpts; /* Warning: Thar be m...
[ "function", "html", "(", "options", ")", "{", "return", "Object", ".", "assign", "(", "function", "(", "context", ")", "{", "var", "defaultOpts", "=", "{", "filename", ":", "'index.html'", ",", "template", ":", "'templates/index.html'", ",", "showErrors", ":...
Webpack block for html-webpack-plugin @see https://github.com/ampedandwired/html-webpack-plugin
[ "Webpack", "block", "for", "html", "-", "webpack", "-", "plugin" ]
6bb540916730177c88b4cfc922eee5d446da7646
https://github.com/ecliptic/webpack-blocks-html/blob/6bb540916730177c88b4cfc922eee5d446da7646/lib/index.js#L22-L41
45,621
ZeroNetJS/zeronet-swarm
src/zero/index.js
ZNV2Swarm
function ZNV2Swarm (opt, protocol, zeronet, lp2p) { const self = this self.proto = self.protocol = new ZProtocol({ crypto: opt.crypto, id: opt.id }, zeronet) log('creating zeronet swarm') const tr = self.transport = {} self.multiaddrs = (opt.listen || []).map(m => multiaddr(m)); (opt.transports...
javascript
function ZNV2Swarm (opt, protocol, zeronet, lp2p) { const self = this self.proto = self.protocol = new ZProtocol({ crypto: opt.crypto, id: opt.id }, zeronet) log('creating zeronet swarm') const tr = self.transport = {} self.multiaddrs = (opt.listen || []).map(m => multiaddr(m)); (opt.transports...
[ "function", "ZNV2Swarm", "(", "opt", ",", "protocol", ",", "zeronet", ",", "lp2p", ")", "{", "const", "self", "=", "this", "self", ".", "proto", "=", "self", ".", "protocol", "=", "new", "ZProtocol", "(", "{", "crypto", ":", "opt", ".", "crypto", ","...
ZNv2 swarm using libp2p transports
[ "ZNv2", "swarm", "using", "libp2p", "transports" ]
015deb84d4e8a63518eda71d0e6c986f460a28b2
https://github.com/ZeroNetJS/zeronet-swarm/blob/015deb84d4e8a63518eda71d0e6c986f460a28b2/src/zero/index.js#L17-L56
45,622
OpenSmartEnvironment/ose
lib/ws/read.js
init
function init(cb) { // {{{2 if (typeof cb !== 'function') { throw O.log.error(this, 'Callback must be a function', cb); } this.stream = new Readable(); this.stream._read = O._.noop; this.stream.on('error', onError.bind(this)); cb(null, this.stream); }
javascript
function init(cb) { // {{{2 if (typeof cb !== 'function') { throw O.log.error(this, 'Callback must be a function', cb); } this.stream = new Readable(); this.stream._read = O._.noop; this.stream.on('error', onError.bind(this)); cb(null, this.stream); }
[ "function", "init", "(", "cb", ")", "{", "// {{{2", "if", "(", "typeof", "cb", "!==", "'function'", ")", "{", "throw", "O", ".", "log", ".", "error", "(", "this", ",", "'Callback must be a function'", ",", "cb", ")", ";", "}", "this", ".", "stream", ...
Public {{{1
[ "Public", "{{{", "1" ]
2ab051d9db6e77341c40abb9cbdae6ce586917e0
https://github.com/OpenSmartEnvironment/ose/blob/2ab051d9db6e77341c40abb9cbdae6ce586917e0/lib/ws/read.js#L10-L20
45,623
IonicaBizau/node-fwatcher
lib/index.js
Watcher
function Watcher(path, handler) { this._ = Fs.watch(path, handler); this.a_path = Abs(path); this.handler = handler; }
javascript
function Watcher(path, handler) { this._ = Fs.watch(path, handler); this.a_path = Abs(path); this.handler = handler; }
[ "function", "Watcher", "(", "path", ",", "handler", ")", "{", "this", ".", "_", "=", "Fs", ".", "watch", "(", "path", ",", "handler", ")", ";", "this", ".", "a_path", "=", "Abs", "(", "path", ")", ";", "this", ".", "handler", "=", "handler", ";",...
Watcher Creates a new instance of the internal `Watcher`. @name Watcher @function @param {String} path The path to the file. @param {Function} handler A function called when the file changes.
[ "Watcher", "Creates", "a", "new", "instance", "of", "the", "internal", "Watcher", "." ]
44487b1645215aae340df8dafb220d47a36c19ca
https://github.com/IonicaBizau/node-fwatcher/blob/44487b1645215aae340df8dafb220d47a36c19ca/lib/index.js#L17-L21
45,624
IonicaBizau/node-fwatcher
lib/index.js
FileWatcher
function FileWatcher(path, options, callback) { if (typeof options === "function") { callback = options; } if (typeof options === "boolean") { options = { once: options }; } options = Ul.merge(options, { once: false }); var watcher = null , newWatcher = fals...
javascript
function FileWatcher(path, options, callback) { if (typeof options === "function") { callback = options; } if (typeof options === "boolean") { options = { once: options }; } options = Ul.merge(options, { once: false }); var watcher = null , newWatcher = fals...
[ "function", "FileWatcher", "(", "path", ",", "options", ",", "callback", ")", "{", "if", "(", "typeof", "options", "===", "\"function\"", ")", "{", "callback", "=", "options", ";", "}", "if", "(", "typeof", "options", "===", "\"boolean\"", ")", "{", "opt...
FileWatcher Creates a new file watcher. @name FileWatcher @function @param {String} path The path to the file. @param {Boolean|Options} options A boolean value representing the `once` value or an object containing the following fields: - `once` (Boolean): If `true`, the handler is deleted after first event. @param {...
[ "FileWatcher", "Creates", "a", "new", "file", "watcher", "." ]
44487b1645215aae340df8dafb220d47a36c19ca
https://github.com/IonicaBizau/node-fwatcher/blob/44487b1645215aae340df8dafb220d47a36c19ca/lib/index.js#L51-L110
45,625
thirdcoder/cpu3502
instr_decode.js
disasm1
function disasm1(machine_code, offset=0) { let di = decode_instruction(machine_code[offset]); let opcode, operand; let consumed = 1; // 1-tryte opcode, incremented later if operands if (di.family === 0) { opcode = invertKv(OP)[di.operation]; // inefficient lookup, but probably doesn't matter // note:...
javascript
function disasm1(machine_code, offset=0) { let di = decode_instruction(machine_code[offset]); let opcode, operand; let consumed = 1; // 1-tryte opcode, incremented later if operands if (di.family === 0) { opcode = invertKv(OP)[di.operation]; // inefficient lookup, but probably doesn't matter // note:...
[ "function", "disasm1", "(", "machine_code", ",", "offset", "=", "0", ")", "{", "let", "di", "=", "decode_instruction", "(", "machine_code", "[", "offset", "]", ")", ";", "let", "opcode", ",", "operand", ";", "let", "consumed", "=", "1", ";", "// 1-tryte ...
Disassemble one instruction in machine_code
[ "Disassemble", "one", "instruction", "in", "machine_code" ]
af1c0c01f75d03443af572e08f14c994585a277b
https://github.com/thirdcoder/cpu3502/blob/af1c0c01f75d03443af572e08f14c994585a277b/instr_decode.js#L140-L202
45,626
DynoSRC/dynosrc
lib/sources/asset/index.js
function(files, next) { var i = files.indexOf(id); if (i < 0) { return next({ error: 'NOT_FOUND', description: 'Asset not available: ' + searchDir + id }); } next(null, files[i]); }
javascript
function(files, next) { var i = files.indexOf(id); if (i < 0) { return next({ error: 'NOT_FOUND', description: 'Asset not available: ' + searchDir + id }); } next(null, files[i]); }
[ "function", "(", "files", ",", "next", ")", "{", "var", "i", "=", "files", ".", "indexOf", "(", "id", ")", ";", "if", "(", "i", "<", "0", ")", "{", "return", "next", "(", "{", "error", ":", "'NOT_FOUND'", ",", "description", ":", "'Asset not availa...
find Asset for id
[ "find", "Asset", "for", "id" ]
1a763c9310b719a51b0df56387970ecd3f08c438
https://github.com/DynoSRC/dynosrc/blob/1a763c9310b719a51b0df56387970ecd3f08c438/lib/sources/asset/index.js#L24-L35
45,627
DynoSRC/dynosrc
lib/sources/asset/index.js
function(dirname, next) { // could be something searchDir += dirname + '/'; var revPath = version && (searchDir + version + '.js'); return next(null, revPath || ''); }
javascript
function(dirname, next) { // could be something searchDir += dirname + '/'; var revPath = version && (searchDir + version + '.js'); return next(null, revPath || ''); }
[ "function", "(", "dirname", ",", "next", ")", "{", "// could be something", "searchDir", "+=", "dirname", "+", "'/'", ";", "var", "revPath", "=", "version", "&&", "(", "searchDir", "+", "version", "+", "'.js'", ")", ";", "return", "next", "(", "null", ",...
look up requested tag
[ "look", "up", "requested", "tag" ]
1a763c9310b719a51b0df56387970ecd3f08c438
https://github.com/DynoSRC/dynosrc/blob/1a763c9310b719a51b0df56387970ecd3f08c438/lib/sources/asset/index.js#L37-L43
45,628
Rafflecopter/deetoo
lib/Q.js
function(filename, msg, $done) { var __open = _.bind(fs.open, fs, filename, 'a') , __write = util.partial.call(fs, fs.write, undefined, msg) , __close = util.partial.call(fs, fs.close) async.waterfall([__open, __write, __close], $done) }
javascript
function(filename, msg, $done) { var __open = _.bind(fs.open, fs, filename, 'a') , __write = util.partial.call(fs, fs.write, undefined, msg) , __close = util.partial.call(fs, fs.close) async.waterfall([__open, __write, __close], $done) }
[ "function", "(", "filename", ",", "msg", ",", "$done", ")", "{", "var", "__open", "=", "_", ".", "bind", "(", "fs", ".", "open", ",", "fs", ",", "filename", ",", "'a'", ")", ",", "__write", "=", "util", ".", "partial", ".", "call", "(", "fs", "...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ Optional Garbage Collection
[ "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "~~", "Optional", "Garbage", "Collection" ]
4d7932efeab35e01fa3a584b6c1253b21f0c4515
https://github.com/Rafflecopter/deetoo/blob/4d7932efeab35e01fa3a584b6c1253b21f0c4515/lib/Q.js#L44-L49
45,629
iainvdw/gulp-tasker
index.js
function (opts) { var options = extend(true, defaults, opts); requireDir(process.cwd() + options.path, {recurse: options.recurse}); }
javascript
function (opts) { var options = extend(true, defaults, opts); requireDir(process.cwd() + options.path, {recurse: options.recurse}); }
[ "function", "(", "opts", ")", "{", "var", "options", "=", "extend", "(", "true", ",", "defaults", ",", "opts", ")", ";", "requireDir", "(", "process", ".", "cwd", "(", ")", "+", "options", ".", "path", ",", "{", "recurse", ":", "options", ".", "rec...
Load all tasks from the `path` option
[ "Load", "all", "tasks", "from", "the", "path", "option" ]
42e48fa62576bd0a91e06407d11aae09053e558a
https://github.com/iainvdw/gulp-tasker/blob/42e48fa62576bd0a91e06407d11aae09053e558a/index.js#L18-L22
45,630
iainvdw/gulp-tasker
index.js
function (type, tasks, folder) { if ( !type ) { throw Error('Error registering task: Please specify a task type'); } if ( !tasks ) { throw Error('Error registering task: Please specify at least one task.'); } allTasks[type] = allTasks[type] || {tasks: [], requireFolders: !!folder}; if ( !fo...
javascript
function (type, tasks, folder) { if ( !type ) { throw Error('Error registering task: Please specify a task type'); } if ( !tasks ) { throw Error('Error registering task: Please specify at least one task.'); } allTasks[type] = allTasks[type] || {tasks: [], requireFolders: !!folder}; if ( !fo...
[ "function", "(", "type", ",", "tasks", ",", "folder", ")", "{", "if", "(", "!", "type", ")", "{", "throw", "Error", "(", "'Error registering task: Please specify a task type'", ")", ";", "}", "if", "(", "!", "tasks", ")", "{", "throw", "Error", "(", "'Er...
Register helper to let subtasks register themselves in the 'default' gulp task @param {String} type Type of task to register @param {String|Array} tasks Task name to register in 'default' task @param {String|Array} folder Folder(s) to watch when registering a watch task
[ "Register", "helper", "to", "let", "subtasks", "register", "themselves", "in", "the", "default", "gulp", "task" ]
42e48fa62576bd0a91e06407d11aae09053e558a
https://github.com/iainvdw/gulp-tasker/blob/42e48fa62576bd0a91e06407d11aae09053e558a/index.js#L31-L61
45,631
eps1lon/poe-i18n
scripts/api/util.js
mergeMessages
async function mergeMessages(locale, messages) { const data_path = path.join(LOCALE_DATA_DIR, `${locale}/api_messages.json`); let old_messages = {}; try { old_messages = require(data_path); } catch (err) { console.log(`creating new messages for locale ${locale}`); } const merged_messages = { ...old_...
javascript
async function mergeMessages(locale, messages) { const data_path = path.join(LOCALE_DATA_DIR, `${locale}/api_messages.json`); let old_messages = {}; try { old_messages = require(data_path); } catch (err) { console.log(`creating new messages for locale ${locale}`); } const merged_messages = { ...old_...
[ "async", "function", "mergeMessages", "(", "locale", ",", "messages", ")", "{", "const", "data_path", "=", "path", ".", "join", "(", "LOCALE_DATA_DIR", ",", "`", "${", "locale", "}", "`", ")", ";", "let", "old_messages", "=", "{", "}", ";", "try", "{",...
merges the messages into the api_messages.json under the specified locale while sorting the resulting json object by keys @param {*} locale @param {*} messages
[ "merges", "the", "messages", "into", "the", "api_messages", ".", "json", "under", "the", "specified", "locale", "while", "sorting", "the", "resulting", "json", "object", "by", "keys" ]
fa92cc4a2be7f321f07a5dba28135db03dc0bc38
https://github.com/eps1lon/poe-i18n/blob/fa92cc4a2be7f321f07a5dba28135db03dc0bc38/scripts/api/util.js#L22-L39
45,632
emmetio/math-expression
lib/number.js
consumeForward
function consumeForward(stream) { const start = stream.pos; if (stream.eat(DOT) && stream.eatWhile(isNumber)) { // short decimal notation: .025 return true; } if (stream.eatWhile(isNumber) && (!stream.eat(DOT) || stream.eatWhile(isNumber))) { // either integer or decimal: 10, 10.25 return true; } stream...
javascript
function consumeForward(stream) { const start = stream.pos; if (stream.eat(DOT) && stream.eatWhile(isNumber)) { // short decimal notation: .025 return true; } if (stream.eatWhile(isNumber) && (!stream.eat(DOT) || stream.eatWhile(isNumber))) { // either integer or decimal: 10, 10.25 return true; } stream...
[ "function", "consumeForward", "(", "stream", ")", "{", "const", "start", "=", "stream", ".", "pos", ";", "if", "(", "stream", ".", "eat", "(", "DOT", ")", "&&", "stream", ".", "eatWhile", "(", "isNumber", ")", ")", "{", "// short decimal notation: .025", ...
Consumes number in forward stream direction @param {StreamReader} stream @return {Boolean} Returns true if number was consumed
[ "Consumes", "number", "in", "forward", "stream", "direction" ]
31dc028f80c27b5b00be9395e35ebd07c9cd8862
https://github.com/emmetio/math-expression/blob/31dc028f80c27b5b00be9395e35ebd07c9cd8862/lib/number.js#L22-L36
45,633
emmetio/math-expression
lib/number.js
consumeBackward
function consumeBackward(stream) { const start = stream.pos; let ch, hadDot = false, hadNumber = false; // NB a StreamReader insance can be editor-specific and contain objects // as a position marker. Since we don’t know for sure how to compare editor // position markers, use consumed length instead to detect if n...
javascript
function consumeBackward(stream) { const start = stream.pos; let ch, hadDot = false, hadNumber = false; // NB a StreamReader insance can be editor-specific and contain objects // as a position marker. Since we don’t know for sure how to compare editor // position markers, use consumed length instead to detect if n...
[ "function", "consumeBackward", "(", "stream", ")", "{", "const", "start", "=", "stream", ".", "pos", ";", "let", "ch", ",", "hadDot", "=", "false", ",", "hadNumber", "=", "false", ";", "// NB a StreamReader insance can be editor-specific and contain objects", "// as...
Consumes number in backward stream direction @param {StreamReader} stream @return {Boolean} Returns true if number was consumed
[ "Consumes", "number", "in", "backward", "stream", "direction" ]
31dc028f80c27b5b00be9395e35ebd07c9cd8862
https://github.com/emmetio/math-expression/blob/31dc028f80c27b5b00be9395e35ebd07c9cd8862/lib/number.js#L43-L75
45,634
k3erg/marantz-denon-upnpdiscovery
index.js
MarantzDenonUPnPDiscovery
function MarantzDenonUPnPDiscovery(callback) { var that = this; var foundDevices = {}; // only report a device once // create socket var socket = dgram.createSocket({type: 'udp4', reuseAddr: true}); socket.unref(); const search = new Buffer([...
javascript
function MarantzDenonUPnPDiscovery(callback) { var that = this; var foundDevices = {}; // only report a device once // create socket var socket = dgram.createSocket({type: 'udp4', reuseAddr: true}); socket.unref(); const search = new Buffer([...
[ "function", "MarantzDenonUPnPDiscovery", "(", "callback", ")", "{", "var", "that", "=", "this", ";", "var", "foundDevices", "=", "{", "}", ";", "// only report a device once", "// create socket", "var", "socket", "=", "dgram", ".", "createSocket", "(", "{", "typ...
Find Denon and marantz devices advertising their services by upnp. @param {function} callback . @constructor
[ "Find", "Denon", "and", "marantz", "devices", "advertising", "their", "services", "by", "upnp", "." ]
5613b4d1c77deea0ec04512c29286b14e0b96676
https://github.com/k3erg/marantz-denon-upnpdiscovery/blob/5613b4d1c77deea0ec04512c29286b14e0b96676/index.js#L22-L87
45,635
jirwin/node-zither
lib/statsd.js
function(options) { options = options || {}; this.host = options.host || 'localhost'; this.port = options.port || 8125; if (!statsdClients[this.host + ':' + this.port]) { statsdClients[this.host + ':' + this.port] = new StatsD(options); } this.client = statsdClients[this.host + ':' + this.port]; thi...
javascript
function(options) { options = options || {}; this.host = options.host || 'localhost'; this.port = options.port || 8125; if (!statsdClients[this.host + ':' + this.port]) { statsdClients[this.host + ':' + this.port] = new StatsD(options); } this.client = statsdClients[this.host + ':' + this.port]; thi...
[ "function", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "host", "=", "options", ".", "host", "||", "'localhost'", ";", "this", ".", "port", "=", "options", ".", "port", "||", "8125", ";", "if", "(", "!", ...
A writable stream that acts as a statsd sink for the zither instrument input sources. @param {Obj} options Statsd client options. See https://github.com/sivy/node-statsd for options. Additionally you can include sampleRate to control how Statsd samples data. sampleRate defaults to 1.
[ "A", "writable", "stream", "that", "acts", "as", "a", "statsd", "sink", "for", "the", "zither", "instrument", "input", "sources", "." ]
c8ab7f1cdfd2fdf25bf31d7d6231f2f7977387aa
https://github.com/jirwin/node-zither/blob/c8ab7f1cdfd2fdf25bf31d7d6231f2f7977387aa/lib/statsd.js#L14-L27
45,636
thirdcoder/cpu3502
arithmetic.js
add
function add(a, b, carryIn=0) { let result = a + b + carryIn; let fullResult = result; let carryOut = 0; // carryOut is 6th trit, truncate result to 5 trits if (result > MAX_TRYTE) { carryOut = 1; result -= MAX_TRYTE * 2 + 1; } else if (result < MIN_TRYTE) { carryOut = -1; // underflow res...
javascript
function add(a, b, carryIn=0) { let result = a + b + carryIn; let fullResult = result; let carryOut = 0; // carryOut is 6th trit, truncate result to 5 trits if (result > MAX_TRYTE) { carryOut = 1; result -= MAX_TRYTE * 2 + 1; } else if (result < MIN_TRYTE) { carryOut = -1; // underflow res...
[ "function", "add", "(", "a", ",", "b", ",", "carryIn", "=", "0", ")", "{", "let", "result", "=", "a", "+", "b", "+", "carryIn", ";", "let", "fullResult", "=", "result", ";", "let", "carryOut", "=", "0", ";", "// carryOut is 6th trit, truncate result to 5...
Add two trytes with optional carry, returning result and overflow
[ "Add", "two", "trytes", "with", "optional", "carry", "returning", "result", "and", "overflow" ]
af1c0c01f75d03443af572e08f14c994585a277b
https://github.com/thirdcoder/cpu3502/blob/af1c0c01f75d03443af572e08f14c994585a277b/arithmetic.js#L6-L31
45,637
socialally/air
lib/air/html.js
html
function html(markup, outer) { if(!this.length) { return this; } if(typeof markup === 'boolean') { outer = markup; markup = undefined; } var prop = outer ? 'outerHTML' : 'innerHTML'; if(markup === undefined) { return this.dom[0][prop]; } markup = markup || ''; this.each(function(el) { ...
javascript
function html(markup, outer) { if(!this.length) { return this; } if(typeof markup === 'boolean') { outer = markup; markup = undefined; } var prop = outer ? 'outerHTML' : 'innerHTML'; if(markup === undefined) { return this.dom[0][prop]; } markup = markup || ''; this.each(function(el) { ...
[ "function", "html", "(", "markup", ",", "outer", ")", "{", "if", "(", "!", "this", ".", "length", ")", "{", "return", "this", ";", "}", "if", "(", "typeof", "markup", "===", "'boolean'", ")", "{", "outer", "=", "markup", ";", "markup", "=", "undefi...
Get the HTML of the first matched element or set the HTML content of all matched elements. Note that when using `outer` to set `outerHTML` you will likely invalidate the current encapsulated elements and need to re-run the selector to update the matched elements.
[ "Get", "the", "HTML", "of", "the", "first", "matched", "element", "or", "set", "the", "HTML", "content", "of", "all", "matched", "elements", "." ]
a3d94de58aaa4930a425fbcc7266764bf6ca8ca6
https://github.com/socialally/air/blob/a3d94de58aaa4930a425fbcc7266764bf6ca8ca6/lib/air/html.js#L9-L29
45,638
feedhenry/fh-mbaas-client
lib/admin/events/events.js
createEvent
function createEvent(params, cb) { params.resourcePath = config.addURIParams(constants.EVENTS_BASE_PATH, params); params.method = 'POST'; params.data = params.data || {}; mbaasRequest.admin(params, cb); }
javascript
function createEvent(params, cb) { params.resourcePath = config.addURIParams(constants.EVENTS_BASE_PATH, params); params.method = 'POST'; params.data = params.data || {}; mbaasRequest.admin(params, cb); }
[ "function", "createEvent", "(", "params", ",", "cb", ")", "{", "params", ".", "resourcePath", "=", "config", ".", "addURIParams", "(", "constants", ".", "EVENTS_BASE_PATH", ",", "params", ")", ";", "params", ".", "method", "=", "'POST'", ";", "params", "."...
Creating an Event on an MBaaS @param params @param cb
[ "Creating", "an", "Event", "on", "an", "MBaaS" ]
2d5a9cbb32e1b2464d71ffa18513358fea388859
https://github.com/feedhenry/fh-mbaas-client/blob/2d5a9cbb32e1b2464d71ffa18513358fea388859/lib/admin/events/events.js#L10-L15
45,639
vid/SenseBase
web/lib/browse-facet.js
augment
function augment(el) { // FIXME should always have a type el.type = el.type || 'category'; el.icon = (typesIcons[el.type] || typesIcons.default).icon; el.data = { value: el.text, type: el.type }; // branch if (el.children && el.children.length > 0) { el.state = { opened: el.children.length > 50 ? false ...
javascript
function augment(el) { // FIXME should always have a type el.type = el.type || 'category'; el.icon = (typesIcons[el.type] || typesIcons.default).icon; el.data = { value: el.text, type: el.type }; // branch if (el.children && el.children.length > 0) { el.state = { opened: el.children.length > 50 ? false ...
[ "function", "augment", "(", "el", ")", "{", "// FIXME should always have a type", "el", ".", "type", "=", "el", ".", "type", "||", "'category'", ";", "el", ".", "icon", "=", "(", "typesIcons", "[", "el", ".", "type", "]", "||", "typesIcons", ".", "defaul...
add facet counts &c
[ "add", "facet", "counts", "&c" ]
d60bcf28239e7dde437d8a6bdae41a6921dcd05b
https://github.com/vid/SenseBase/blob/d60bcf28239e7dde437d8a6bdae41a6921dcd05b/web/lib/browse-facet.js#L58-L79
45,640
cfpb/objectified
index.js
_tokenize
function _tokenize( prop ) { var tokens = [], patterns, src = prop.source; src = typeof src !== 'string' ? src : src.split(' '); patterns = { operator: /^[+\-\*\/\%]$/, // +-*/% // @TODO Improve this regex to cover numbers like 1,000,000 number: /^\$?\d+[\.,]?\d+$/ }; function _pus...
javascript
function _tokenize( prop ) { var tokens = [], patterns, src = prop.source; src = typeof src !== 'string' ? src : src.split(' '); patterns = { operator: /^[+\-\*\/\%]$/, // +-*/% // @TODO Improve this regex to cover numbers like 1,000,000 number: /^\$?\d+[\.,]?\d+$/ }; function _pus...
[ "function", "_tokenize", "(", "prop", ")", "{", "var", "tokens", "=", "[", "]", ",", "patterns", ",", "src", "=", "prop", ".", "source", ";", "src", "=", "typeof", "src", "!==", "'string'", "?", "src", ":", "src", ".", "split", "(", "' '", ")", "...
Split source strings and taxonimize language. @param {string|function} src String to tokenize. If it's a function, leave it. @return {array} Array of objects, each a token.
[ "Split", "source", "strings", "and", "taxonimize", "language", "." ]
252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d
https://github.com/cfpb/objectified/blob/252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d/index.js#L19-L59
45,641
cfpb/objectified
index.js
_getDOMElement
function _getDOMElement( container, str ) { var el = container.querySelector( '[name=' + str + ']' ); return el ? el : null; }
javascript
function _getDOMElement( container, str ) { var el = container.querySelector( '[name=' + str + ']' ); return el ? el : null; }
[ "function", "_getDOMElement", "(", "container", ",", "str", ")", "{", "var", "el", "=", "container", ".", "querySelector", "(", "'[name='", "+", "str", "+", "']'", ")", ";", "return", "el", "?", "el", ":", "null", ";", "}" ]
Returns the first element matching the provided string. @param {object} container DOM element node of parent container. @param {string} str Value to be provided to the selector. @return {object} Element object.
[ "Returns", "the", "first", "element", "matching", "the", "provided", "string", "." ]
252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d
https://github.com/cfpb/objectified/blob/252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d/index.js#L67-L70
45,642
cfpb/objectified
index.js
_deTokenize
function _deTokenize( container, arr ) { var val, tokens = []; function _parseFloat( str ) { return parseFloat( unFormatUSD(str) ); } for ( var i = 0, len = arr.length; i < len; i++ ) { var token = arr[i]; // @TODO DRY this up. if ( token.type === 'function' ) { tokens.push( token....
javascript
function _deTokenize( container, arr ) { var val, tokens = []; function _parseFloat( str ) { return parseFloat( unFormatUSD(str) ); } for ( var i = 0, len = arr.length; i < len; i++ ) { var token = arr[i]; // @TODO DRY this up. if ( token.type === 'function' ) { tokens.push( token....
[ "function", "_deTokenize", "(", "container", ",", "arr", ")", "{", "var", "val", ",", "tokens", "=", "[", "]", ";", "function", "_parseFloat", "(", "str", ")", "{", "return", "parseFloat", "(", "unFormatUSD", "(", "str", ")", ")", ";", "}", "for", "(...
Process an array of tokens, returning a single value. @param {object} container DOM element node of parent container. @param {array} arr Array of tokens created from _tokenize. @return {string|number} The value of the processed tokens.
[ "Process", "an", "array", "of", "tokens", "returning", "a", "single", "value", "." ]
252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d
https://github.com/cfpb/objectified/blob/252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d/index.js#L78-L111
45,643
cfpb/objectified
index.js
update
function update( container, src, dest ) { for ( var key in src ) { // @TODO Better handle safe defaults. dest[ key ] = _deTokenize( container, src[key] ); } }
javascript
function update( container, src, dest ) { for ( var key in src ) { // @TODO Better handle safe defaults. dest[ key ] = _deTokenize( container, src[key] ); } }
[ "function", "update", "(", "container", ",", "src", ",", "dest", ")", "{", "for", "(", "var", "key", "in", "src", ")", "{", "// @TODO Better handle safe defaults.", "dest", "[", "key", "]", "=", "_deTokenize", "(", "container", ",", "src", "[", "key", "]...
Update the exported object @param {object} container DOM element node of parent container. @param {object} src Tokenize source object. @param {object} dest Object to be updated. @return {undefined}
[ "Update", "the", "exported", "object" ]
252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d
https://github.com/cfpb/objectified/blob/252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d/index.js#L120-L125
45,644
cfpb/objectified
index.js
objectify
function objectify( id, props ) { // Stores references to elements that will be monitored. var objectifier = {}, // Stores final values that are sent to user. objectified = {}, container = document.querySelector( id ); for ( var i = 0, len = props.length; i < len; i++ ) { if ( props[i]...
javascript
function objectify( id, props ) { // Stores references to elements that will be monitored. var objectifier = {}, // Stores final values that are sent to user. objectified = {}, container = document.querySelector( id ); for ( var i = 0, len = props.length; i < len; i++ ) { if ( props[i]...
[ "function", "objectify", "(", "id", ",", "props", ")", "{", "// Stores references to elements that will be monitored.", "var", "objectifier", "=", "{", "}", ",", "// Stores final values that are sent to user.", "objectified", "=", "{", "}", ",", "container", "=", "docum...
Constructor that processes the provided sources. @param {array} props Array of objects @return {object} Returns a reference to the object that is periodically updated.
[ "Constructor", "that", "processes", "the", "provided", "sources", "." ]
252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d
https://github.com/cfpb/objectified/blob/252d811d2f4900ad35ad22ad7cb4d4b4e0f4e83d/index.js#L132-L157
45,645
writetome51/array-has
dist/privy/arrayHas.js
arrayHas
function arrayHas(value, array) { error_if_not_array_1.errorIfNotArray(array); return (array.length > 0 && (array_get_indexes_1.getFirstIndexOf(value, array) > -1)); }
javascript
function arrayHas(value, array) { error_if_not_array_1.errorIfNotArray(array); return (array.length > 0 && (array_get_indexes_1.getFirstIndexOf(value, array) > -1)); }
[ "function", "arrayHas", "(", "value", ",", "array", ")", "{", "error_if_not_array_1", ".", "errorIfNotArray", "(", "array", ")", ";", "return", "(", "array", ".", "length", ">", "0", "&&", "(", "array_get_indexes_1", ".", "getFirstIndexOf", "(", "value", ","...
value cannot be object.
[ "value", "cannot", "be", "object", "." ]
8ced3fda5818940b814bbcdc37e03c65f285a965
https://github.com/writetome51/array-has/blob/8ced3fda5818940b814bbcdc37e03c65f285a965/dist/privy/arrayHas.js#L6-L9
45,646
NerdDiffer/all-your-base
index.js
local_parseInt
function local_parseInt(str, from, to) { var fn = assignFn(from, to); return convert[fn](str + ''); }
javascript
function local_parseInt(str, from, to) { var fn = assignFn(from, to); return convert[fn](str + ''); }
[ "function", "local_parseInt", "(", "str", ",", "from", ",", "to", ")", "{", "var", "fn", "=", "assignFn", "(", "from", ",", "to", ")", ";", "return", "convert", "[", "fn", "]", "(", "str", "+", "''", ")", ";", "}" ]
A buffed-up version of the standard `parseInt` function @param str, the value to convert. Is coerced into a String. @param from, [Number], a base to convert from @param to, [Number] a base to convert to @return, the result of a call to a base conversion function
[ "A", "buffed", "-", "up", "version", "of", "the", "standard", "parseInt", "function" ]
ce258b2ca1430dd506b2a9e326f00219e8f8673c
https://github.com/NerdDiffer/all-your-base/blob/ce258b2ca1430dd506b2a9e326f00219e8f8673c/index.js#L26-L29
45,647
NerdDiffer/all-your-base
index.js
assignFn
function assignFn(from, to) { from = setDefault(10, from); to = setDefault(10, to); from = numToWord(from); to = capitalize(numToWord(to)); return from + 'To' + to; // return a copy of a string with its first letter capitalized function capitalize(str) { return str[0].toUpperCase() + str.slice(...
javascript
function assignFn(from, to) { from = setDefault(10, from); to = setDefault(10, to); from = numToWord(from); to = capitalize(numToWord(to)); return from + 'To' + to; // return a copy of a string with its first letter capitalized function capitalize(str) { return str[0].toUpperCase() + str.slice(...
[ "function", "assignFn", "(", "from", ",", "to", ")", "{", "from", "=", "setDefault", "(", "10", ",", "from", ")", ";", "to", "=", "setDefault", "(", "10", ",", "to", ")", ";", "from", "=", "numToWord", "(", "from", ")", ";", "to", "=", "capitaliz...
Return a property to pass to the 'convert' object @param from, [Number], a base to convert from @param to, [Number] a base to convert to @return, [String] a generated property name @throws, an error if the base is not supported by this module
[ "Return", "a", "property", "to", "pass", "to", "the", "convert", "object" ]
ce258b2ca1430dd506b2a9e326f00219e8f8673c
https://github.com/NerdDiffer/all-your-base/blob/ce258b2ca1430dd506b2a9e326f00219e8f8673c/index.js#L38-L73
45,648
vid/SenseBase
lib/site-requests.js
processXML
function processXML(name, uri, processor, resp, callback) { var parser = new xml2js.Parser(); parser.parseString(resp, function (err, xml) { if (err) { GLOBAL.error(name, err); return; } else { processor.getAnnotations(name, uri, xml, function(err, annoRows) { callback(err, {name:...
javascript
function processXML(name, uri, processor, resp, callback) { var parser = new xml2js.Parser(); parser.parseString(resp, function (err, xml) { if (err) { GLOBAL.error(name, err); return; } else { processor.getAnnotations(name, uri, xml, function(err, annoRows) { callback(err, {name:...
[ "function", "processXML", "(", "name", ",", "uri", ",", "processor", ",", "resp", ",", "callback", ")", "{", "var", "parser", "=", "new", "xml2js", ".", "Parser", "(", ")", ";", "parser", ".", "parseString", "(", "resp", ",", "function", "(", "err", ...
process retrieved content as XML
[ "process", "retrieved", "content", "as", "XML" ]
d60bcf28239e7dde437d8a6bdae41a6921dcd05b
https://github.com/vid/SenseBase/blob/d60bcf28239e7dde437d8a6bdae41a6921dcd05b/lib/site-requests.js#L64-L77
45,649
DScheglov/merest
lib/controllers/error.js
error
function error(err, req, res, next) { if (err instanceof ModelAPIError) { toSend = extend({error: true}, err); res.status(err.code); res.json(toSend); } else { toSend = { error: true, message: err.message, stack: err.stack }; res.status(500); res.json(toSend...
javascript
function error(err, req, res, next) { if (err instanceof ModelAPIError) { toSend = extend({error: true}, err); res.status(err.code); res.json(toSend); } else { toSend = { error: true, message: err.message, stack: err.stack }; res.status(500); res.json(toSend...
[ "function", "error", "(", "err", ",", "req", ",", "res", ",", "next", ")", "{", "if", "(", "err", "instanceof", "ModelAPIError", ")", "{", "toSend", "=", "extend", "(", "{", "error", ":", "true", "}", ",", "err", ")", ";", "res", ".", "status", "...
error - description @param {Error} err the error that should be processed to client side @param {express.Request} req the http(s) request @param {express.Response} res the http(s) response @param {Function} next the callback should be called if controller fails @memb...
[ "error", "-", "description" ]
d39e7ef0d56236247773467e9bfe83cb128ebc01
https://github.com/DScheglov/merest/blob/d39e7ef0d56236247773467e9bfe83cb128ebc01/lib/controllers/error.js#L14-L28
45,650
nodejitsu/contour
pagelets/carousel.js
controls
function controls(data, options) { return data.reduce(function reduce(controls, item, n) { return controls + options.fn({ panel: 'panel' + n, checked: !n ? ' checked' : '' }); }, ''); }
javascript
function controls(data, options) { return data.reduce(function reduce(controls, item, n) { return controls + options.fn({ panel: 'panel' + n, checked: !n ? ' checked' : '' }); }, ''); }
[ "function", "controls", "(", "data", ",", "options", ")", "{", "return", "data", ".", "reduce", "(", "function", "reduce", "(", "controls", ",", "item", ",", "n", ")", "{", "return", "controls", "+", "options", ".", "fn", "(", "{", "panel", ":", "'pa...
Handblebar helper to generate the panel controls, both the radio buttons as well as the arrow labels. @param {Object} data Provided to the iterator. @param {Object} options Optional. @return {String} Generated template @api private
[ "Handblebar", "helper", "to", "generate", "the", "panel", "controls", "both", "the", "radio", "buttons", "as", "well", "as", "the", "arrow", "labels", "." ]
0828e9bd25ef1eeb97ea231c447118d9867021b6
https://github.com/nodejitsu/contour/blob/0828e9bd25ef1eeb97ea231c447118d9867021b6/pagelets/carousel.js#L37-L44
45,651
mkdecisiondev/reshape-component
lib/index.js
copyAttributes
function copyAttributes (templateAst, componentNode, preserveType) { for (let attributeName in componentNode.attrs) { if (!(attributeName in skippedAttributes)) { templateAst[0].attrs = templateAst[0].attrs || {}; if (templateAst[0].attrs[attributeName] && attributeName === 'class') { templateAst[0].attrs...
javascript
function copyAttributes (templateAst, componentNode, preserveType) { for (let attributeName in componentNode.attrs) { if (!(attributeName in skippedAttributes)) { templateAst[0].attrs = templateAst[0].attrs || {}; if (templateAst[0].attrs[attributeName] && attributeName === 'class') { templateAst[0].attrs...
[ "function", "copyAttributes", "(", "templateAst", ",", "componentNode", ",", "preserveType", ")", "{", "for", "(", "let", "attributeName", "in", "componentNode", ".", "attrs", ")", "{", "if", "(", "!", "(", "attributeName", "in", "skippedAttributes", ")", ")",...
Copy attributes from 'node' to the first node in 'componentAst' @param {ReshapeAst} templateAst - AST from the component source template @param {ReshapeAstNode} componentNode - '<component>' node @param {boolean|string} preserveType - If 'true', the 'type' attributed will preserved; if a string value the 'type' attribu...
[ "Copy", "attributes", "from", "node", "to", "the", "first", "node", "in", "componentAst" ]
a2e8580d6789258b0c46989d804fe5cb3aec87f2
https://github.com/mkdecisiondev/reshape-component/blob/a2e8580d6789258b0c46989d804fe5cb3aec87f2/lib/index.js#L19-L42
45,652
mkdecisiondev/reshape-component
lib/index.js
replaceTokens
function replaceTokens (templateAst, componentNode) { let promise; if (componentNode.content) { const tokenDefinitions = {}; componentNode.content.forEach(function (tokenDefinition) { if (tokenDefinition.name) { let tokenValue = ''; if (tokenDefinition.content) { if (tokenDefinition.content.len...
javascript
function replaceTokens (templateAst, componentNode) { let promise; if (componentNode.content) { const tokenDefinitions = {}; componentNode.content.forEach(function (tokenDefinition) { if (tokenDefinition.name) { let tokenValue = ''; if (tokenDefinition.content) { if (tokenDefinition.content.len...
[ "function", "replaceTokens", "(", "templateAst", ",", "componentNode", ")", "{", "let", "promise", ";", "if", "(", "componentNode", ".", "content", ")", "{", "const", "tokenDefinitions", "=", "{", "}", ";", "componentNode", ".", "content", ".", "forEach", "(...
Replace tokens in 'componentAst' with content defined in child elements of 'node' @param {ReshapeAst} templateAst - AST from the component source template @param {ReshapeAstNode} componentNode - '<component>' node @returns {Thenable|undefined} If no substitution was performed then returns undefined
[ "Replace", "tokens", "in", "componentAst", "with", "content", "defined", "in", "child", "elements", "of", "node" ]
a2e8580d6789258b0c46989d804fe5cb3aec87f2
https://github.com/mkdecisiondev/reshape-component/blob/a2e8580d6789258b0c46989d804fe5cb3aec87f2/lib/index.js#L79-L165
45,653
Whitebolt/require-extra
src/versionLoader.js
getMyVersion
function getMyVersion(buildDir) { var builds = getBuildFiles(buildDir); var chosen = builds[0]; for (var n=0; n<builds.length; n++) { if (semvar.satisfies(getVersion(builds[n]), '<=' + process.versions.node)) chosen = builds[n]; } return require(buildDir + '/' + chosen); }
javascript
function getMyVersion(buildDir) { var builds = getBuildFiles(buildDir); var chosen = builds[0]; for (var n=0; n<builds.length; n++) { if (semvar.satisfies(getVersion(builds[n]), '<=' + process.versions.node)) chosen = builds[n]; } return require(buildDir + '/' + chosen); }
[ "function", "getMyVersion", "(", "buildDir", ")", "{", "var", "builds", "=", "getBuildFiles", "(", "buildDir", ")", ";", "var", "chosen", "=", "builds", "[", "0", "]", ";", "for", "(", "var", "n", "=", "0", ";", "n", "<", "builds", ".", "length", "...
Get current node version a retrieve built file for that version. @param {string} buildDir Where build files are located. @returns {string} The build file to use.
[ "Get", "current", "node", "version", "a", "retrieve", "built", "file", "for", "that", "version", "." ]
2a8f737aab67305c9fda3ee56aa7953e97cee859
https://github.com/Whitebolt/require-extra/blob/2a8f737aab67305c9fda3ee56aa7953e97cee859/src/versionLoader.js#L48-L57
45,654
nodejitsu/contour
pagelets/nodejitsu/pills/base.js
swap
function swap(e, to) { if ('preventDefault' in e) e.preventDefault(); var item = $(e.element || '[data-id="' + to + '"]'); if (!!~item.get('className').indexOf('active')) return; var parent = item.parent() , effect = item.get('effect').split(',') , change = item.get('swap').split('@') ...
javascript
function swap(e, to) { if ('preventDefault' in e) e.preventDefault(); var item = $(e.element || '[data-id="' + to + '"]'); if (!!~item.get('className').indexOf('active')) return; var parent = item.parent() , effect = item.get('effect').split(',') , change = item.get('swap').split('@') ...
[ "function", "swap", "(", "e", ",", "to", ")", "{", "if", "(", "'preventDefault'", "in", "e", ")", "e", ".", "preventDefault", "(", ")", ";", "var", "item", "=", "$", "(", "e", ".", "element", "||", "'[data-id=\"'", "+", "to", "+", "'\"]'", ")", "...
Swap the different views @param {Event} e @param {String} to force tab by hash @api private
[ "Swap", "the", "different", "views" ]
0828e9bd25ef1eeb97ea231c447118d9867021b6
https://github.com/nodejitsu/contour/blob/0828e9bd25ef1eeb97ea231c447118d9867021b6/pagelets/nodejitsu/pills/base.js#L55-L91
45,655
synder/xpress
demo/body-parser/lib/types/urlencoded.js
urlencoded
function urlencoded (options) { var opts = options || {} // notice because option default will flip in next major if (opts.extended === undefined) { deprecate('undefined extended: provide extended option') } var extended = opts.extended !== false var inflate = opts.inflate !== false var limit = type...
javascript
function urlencoded (options) { var opts = options || {} // notice because option default will flip in next major if (opts.extended === undefined) { deprecate('undefined extended: provide extended option') } var extended = opts.extended !== false var inflate = opts.inflate !== false var limit = type...
[ "function", "urlencoded", "(", "options", ")", "{", "var", "opts", "=", "options", "||", "{", "}", "// notice because option default will flip in next major", "if", "(", "opts", ".", "extended", "===", "undefined", ")", "{", "deprecate", "(", "'undefined extended: p...
Create a middleware to parse urlencoded bodies. @param {object} [options] @return {function} @public
[ "Create", "a", "middleware", "to", "parse", "urlencoded", "bodies", "." ]
4b1e89208b6f34cd78ce90b8a858592115b6ccb5
https://github.com/synder/xpress/blob/4b1e89208b6f34cd78ce90b8a858592115b6ccb5/demo/body-parser/lib/types/urlencoded.js#L43-L123
45,656
synder/xpress
demo/body-parser/lib/types/urlencoded.js
extendedparser
function extendedparser (options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000 var parse = parser('qs') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') } if (isFinite(paramete...
javascript
function extendedparser (options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000 var parse = parser('qs') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') } if (isFinite(paramete...
[ "function", "extendedparser", "(", "options", ")", "{", "var", "parameterLimit", "=", "options", ".", "parameterLimit", "!==", "undefined", "?", "options", ".", "parameterLimit", ":", "1000", "var", "parse", "=", "parser", "(", "'qs'", ")", "if", "(", "isNaN...
Get the extended query parser. @param {object} options
[ "Get", "the", "extended", "query", "parser", "." ]
4b1e89208b6f34cd78ce90b8a858592115b6ccb5
https://github.com/synder/xpress/blob/4b1e89208b6f34cd78ce90b8a858592115b6ccb5/demo/body-parser/lib/types/urlencoded.js#L131-L163
45,657
synder/xpress
demo/body-parser/lib/types/urlencoded.js
parameterCount
function parameterCount (body, limit) { var count = 0 var index = 0 while ((index = body.indexOf('&', index)) !== -1) { count++ index++ if (count === limit) { return undefined } } return count }
javascript
function parameterCount (body, limit) { var count = 0 var index = 0 while ((index = body.indexOf('&', index)) !== -1) { count++ index++ if (count === limit) { return undefined } } return count }
[ "function", "parameterCount", "(", "body", ",", "limit", ")", "{", "var", "count", "=", "0", "var", "index", "=", "0", "while", "(", "(", "index", "=", "body", ".", "indexOf", "(", "'&'", ",", "index", ")", ")", "!==", "-", "1", ")", "{", "count"...
Count the number of parameters, stopping once limit reached @param {string} body @param {number} limit @api private
[ "Count", "the", "number", "of", "parameters", "stopping", "once", "limit", "reached" ]
4b1e89208b6f34cd78ce90b8a858592115b6ccb5
https://github.com/synder/xpress/blob/4b1e89208b6f34cd78ce90b8a858592115b6ccb5/demo/body-parser/lib/types/urlencoded.js#L188-L202
45,658
synder/xpress
demo/body-parser/lib/types/urlencoded.js
parser
function parser (name) { var mod = parsers[name] if (mod !== undefined) { return mod.parse } // this uses a switch for static require analysis switch (name) { case 'qs': mod = require('qs') break case 'querystring': mod = require('querystring') break } // store to pr...
javascript
function parser (name) { var mod = parsers[name] if (mod !== undefined) { return mod.parse } // this uses a switch for static require analysis switch (name) { case 'qs': mod = require('qs') break case 'querystring': mod = require('querystring') break } // store to pr...
[ "function", "parser", "(", "name", ")", "{", "var", "mod", "=", "parsers", "[", "name", "]", "if", "(", "mod", "!==", "undefined", ")", "{", "return", "mod", ".", "parse", "}", "// this uses a switch for static require analysis", "switch", "(", "name", ")", ...
Get parser for module name dynamically. @param {string} name @return {function} @api private
[ "Get", "parser", "for", "module", "name", "dynamically", "." ]
4b1e89208b6f34cd78ce90b8a858592115b6ccb5
https://github.com/synder/xpress/blob/4b1e89208b6f34cd78ce90b8a858592115b6ccb5/demo/body-parser/lib/types/urlencoded.js#L212-L233
45,659
synder/xpress
demo/body-parser/lib/types/urlencoded.js
simpleparser
function simpleparser (options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000 var parse = parser('querystring') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') } if (isFinite(p...
javascript
function simpleparser (options) { var parameterLimit = options.parameterLimit !== undefined ? options.parameterLimit : 1000 var parse = parser('querystring') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') } if (isFinite(p...
[ "function", "simpleparser", "(", "options", ")", "{", "var", "parameterLimit", "=", "options", ".", "parameterLimit", "!==", "undefined", "?", "options", ".", "parameterLimit", ":", "1000", "var", "parse", "=", "parser", "(", "'querystring'", ")", "if", "(", ...
Get the simple query parser. @param {object} options
[ "Get", "the", "simple", "query", "parser", "." ]
4b1e89208b6f34cd78ce90b8a858592115b6ccb5
https://github.com/synder/xpress/blob/4b1e89208b6f34cd78ce90b8a858592115b6ccb5/demo/body-parser/lib/types/urlencoded.js#L241-L266
45,660
OpenSmartEnvironment/ose
lib/shard/index.js
init
function init() { // {{{2 /** * Class constructor * * @method constructor */ O.inherited(this)(); this.setMaxListeners(Consts.coreListeners); this.subjectState = this.SUBJECT_STATE.INIT; this.homeTimeOffset = 0; this.lastTid = 0; // {{{3 /** * Autoincemental part of last transaction id created...
javascript
function init() { // {{{2 /** * Class constructor * * @method constructor */ O.inherited(this)(); this.setMaxListeners(Consts.coreListeners); this.subjectState = this.SUBJECT_STATE.INIT; this.homeTimeOffset = 0; this.lastTid = 0; // {{{3 /** * Autoincemental part of last transaction id created...
[ "function", "init", "(", ")", "{", "// {{{2", "/**\n * Class constructor\n *\n * @method constructor\n */", "O", ".", "inherited", "(", "this", ")", "(", ")", ";", "this", ".", "setMaxListeners", "(", "Consts", ".", "coreListeners", ")", ";", "this", ".", "subje...
master {{{2 Client socket linked to the master shard @property master @type Object Public {{{1
[ "master", "{{{", "2", "Client", "socket", "linked", "to", "the", "master", "shard" ]
2ab051d9db6e77341c40abb9cbdae6ce586917e0
https://github.com/OpenSmartEnvironment/ose/blob/2ab051d9db6e77341c40abb9cbdae6ce586917e0/lib/shard/index.js#L94-L136
45,661
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
arrayIncludesWith
function arrayIncludesWith(array, value, comparator) { var index = -1, length = array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; }
javascript
function arrayIncludesWith(array, value, comparator) { var index = -1, length = array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; }
[ "function", "arrayIncludesWith", "(", "array", ",", "value", ",", "comparator", ")", "{", "var", "index", "=", "-", "1", ",", "length", "=", "array", ".", "length", ";", "while", "(", "++", "index", "<", "length", ")", "{", "if", "(", "comparator", "...
This function is like `arrayIncludes` except that it accepts a comparator. @private @param {Array} array The array to search. @param {*} target The value to search for. @param {Function} comparator The comparator invoked per element. @returns {boolean} Returns `true` if `target` is found, else `false`.
[ "This", "function", "is", "like", "arrayIncludes", "except", "that", "it", "accepts", "a", "comparator", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L12059-L12067
45,662
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
arrayReduceRight
function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; ...
javascript
function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; ...
[ "function", "arrayReduceRight", "(", "array", ",", "iteratee", ",", "accumulator", ",", "initAccum", ")", "{", "var", "length", "=", "array", ".", "length", ";", "if", "(", "initAccum", "&&", "length", ")", "{", "accumulator", "=", "array", "[", "--", "l...
A specialized version of `_.reduceRight` for arrays without support for iteratee shorthands. @private @param {Array} array The array to iterate over. @param {Function} iteratee The function invoked per iteration. @param {*} [accumulator] The initial value. @param {boolean} [initAccum] Specify using the last element of...
[ "A", "specialized", "version", "of", "_", ".", "reduceRight", "for", "arrays", "without", "support", "for", "iteratee", "shorthands", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L12131-L12140
45,663
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
baseExtremum
function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? current === current : comparator(current, computed))) { var c...
javascript
function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? current === current : comparator(current, computed))) { var c...
[ "function", "baseExtremum", "(", "array", ",", "iteratee", ",", "comparator", ")", "{", "var", "index", "=", "-", "1", ",", "length", "=", "array", ".", "length", ";", "while", "(", "++", "index", "<", "length", ")", "{", "var", "value", "=", "array"...
The base implementation of methods like `_.max` and `_.min` which accepts a `comparator` to determine the extremum value. @private @param {Array} array The array to iterate over. @param {Function} iteratee The iteratee invoked per iteration. @param {Function} comparator The comparator used to compare values. @returns ...
[ "The", "base", "implementation", "of", "methods", "like", "_", ".", "max", "and", "_", ".", "min", "which", "accepts", "a", "comparator", "to", "determine", "the", "extremum", "value", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L12169-L12178
45,664
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
stringSize
function stringSize(string) { if (!(string && reHasComplexSymbol.test(string))) { return string.length; } var result = reComplexSymbol.lastIndex = 0; while (reComplexSymbol.test(string)) { result++; } return result; }
javascript
function stringSize(string) { if (!(string && reHasComplexSymbol.test(string))) { return string.length; } var result = reComplexSymbol.lastIndex = 0; while (reComplexSymbol.test(string)) { result++; } return result; }
[ "function", "stringSize", "(", "string", ")", "{", "if", "(", "!", "(", "string", "&&", "reHasComplexSymbol", ".", "test", "(", "string", ")", ")", ")", "{", "return", "string", ".", "length", ";", "}", "var", "result", "=", "reComplexSymbol", ".", "la...
Gets the number of symbols in `string`. @private @param {string} string The string to inspect. @returns {number} Returns the string size.
[ "Gets", "the", "number", "of", "symbols", "in", "string", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L12640-L12649
45,665
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
cacheHas
function cacheHas(cache, value) { var map = cache.__data__; if (isKeyable(value)) { var data = map.__data__, hash = typeof value == 'string' ? data.string : data.hash; return hash[value] === HASH_UNDEFINED; } return map.has(value); }
javascript
function cacheHas(cache, value) { var map = cache.__data__; if (isKeyable(value)) { var data = map.__data__, hash = typeof value == 'string' ? data.string : data.hash; return hash[value] === HASH_UNDEFINED; } return map.has(value); }
[ "function", "cacheHas", "(", "cache", ",", "value", ")", "{", "var", "map", "=", "cache", ".", "__data__", ";", "if", "(", "isKeyable", "(", "value", ")", ")", "{", "var", "data", "=", "map", ".", "__data__", ",", "hash", "=", "typeof", "value", "=...
Checks if `value` is in `cache`. @private @param {Object} cache The set cache to search. @param {*} value The value to search for. @returns {number} Returns `true` if `value` is found, else `false`.
[ "Checks", "if", "value", "is", "in", "cache", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L13177-L13184
45,666
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
baseHas
function baseHas(object, key) { // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, // that are composed entirely of index properties, return `false` for // `hasOwnProperty` checks of them. return hasOwnProperty.call(object, key) || typeof object == 'object' && key i...
javascript
function baseHas(object, key) { // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, // that are composed entirely of index properties, return `false` for // `hasOwnProperty` checks of them. return hasOwnProperty.call(object, key) || typeof object == 'object' && key i...
[ "function", "baseHas", "(", "object", ",", "key", ")", "{", "// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,", "// that are composed entirely of index properties, return `false` for", "// `hasOwnProperty` checks of them.", "return", "hasOwnProperty", ".", "call",...
The base implementation of `_.has` without support for deep paths. @private @param {Object} object The object to query. @param {Array|string} key The key to check. @returns {boolean} Returns `true` if `key` exists, else `false`.
[ "The", "base", "implementation", "of", "_", ".", "has", "without", "support", "for", "deep", "paths", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L13880-L13885
45,667
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
basePick
function basePick(object, props) { object = Object(object); return arrayReduce(props, function (result, key) { if (key in object) { result[key] = object[key]; } return result; }, {}); }
javascript
function basePick(object, props) { object = Object(object); return arrayReduce(props, function (result, key) { if (key in object) { result[key] = object[key]; } return result; }, {}); }
[ "function", "basePick", "(", "object", ",", "props", ")", "{", "object", "=", "Object", "(", "object", ")", ";", "return", "arrayReduce", "(", "props", ",", "function", "(", "result", ",", "key", ")", "{", "if", "(", "key", "in", "object", ")", "{", ...
The base implementation of `_.pick` without support for individual property names. @private @param {Object} object The source object. @param {string[]} props The property names to pick. @returns {Object} Returns the new object.
[ "The", "base", "implementation", "of", "_", ".", "pick", "without", "support", "for", "individual", "property", "names", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L14315-L14323
45,668
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
basePullAll
function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIn...
javascript
function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIn...
[ "function", "basePullAll", "(", "array", ",", "values", ",", "iteratee", ",", "comparator", ")", "{", "var", "indexOf", "=", "comparator", "?", "baseIndexOfWith", ":", "baseIndexOf", ",", "index", "=", "-", "1", ",", "length", "=", "values", ".", "length",...
The base implementation of `_.pullAllBy` without support for iteratee shorthands. @private @param {Array} array The array to modify. @param {Array} values The values to remove. @param {Function} [iteratee] The iteratee invoked per element. @param {Function} [comparator] The comparator invoked per element. @returns {Ar...
[ "The", "base", "implementation", "of", "_", ".", "pullAllBy", "without", "support", "for", "iteratee", "shorthands", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L14376-L14391
45,669
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
indexKeys
function indexKeys(object) { var length = object ? object.length : undefined; if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { return baseTimes(length, String); } return null; }
javascript
function indexKeys(object) { var length = object ? object.length : undefined; if (isLength(length) && (isArray(object) || isString(object) || isArguments(object))) { return baseTimes(length, String); } return null; }
[ "function", "indexKeys", "(", "object", ")", "{", "var", "length", "=", "object", "?", "object", ".", "length", ":", "undefined", ";", "if", "(", "isLength", "(", "length", ")", "&&", "(", "isArray", "(", "object", ")", "||", "isString", "(", "object",...
Creates an array of index keys for `object` values of arrays, `arguments` objects, and strings, otherwise `null` is returned. @private @param {Object} object The object to query. @returns {Array|null} Returns index keys, else `null`.
[ "Creates", "an", "array", "of", "index", "keys", "for", "object", "values", "of", "arrays", "arguments", "objects", "and", "strings", "otherwise", "null", "is", "returned", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L15955-L15961
45,670
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
mergeDefaults
function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); } return objValue; }
javascript
function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); } return objValue; }
[ "function", "mergeDefaults", "(", "objValue", ",", "srcValue", ",", "key", ",", "object", ",", "source", ",", "stack", ")", "{", "if", "(", "isObject", "(", "objValue", ")", "&&", "isObject", "(", "srcValue", ")", ")", "{", "baseMerge", "(", "objValue", ...
Used by `_.defaultsDeep` to customize its `_.merge` use. @private @param {*} objValue The destination value. @param {*} srcValue The source value. @param {string} key The key of the property to merge. @param {Object} object The parent object of `objValue`. @param {Object} source The parent object of `srcValue`. @param...
[ "Used", "by", "_", ".", "defaultsDeep", "to", "customize", "its", "_", ".", "merge", "use", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L16118-L16123
45,671
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
sample
function sample(collection) { var array = isArrayLike(collection) ? collection : values(collection), length = array.length; return length > 0 ? array[baseRandom(0, length - 1)] : undefined; }
javascript
function sample(collection) { var array = isArrayLike(collection) ? collection : values(collection), length = array.length; return length > 0 ? array[baseRandom(0, length - 1)] : undefined; }
[ "function", "sample", "(", "collection", ")", "{", "var", "array", "=", "isArrayLike", "(", "collection", ")", "?", "collection", ":", "values", "(", "collection", ")", ",", "length", "=", "array", ".", "length", ";", "return", "length", ">", "0", "?", ...
Gets a random element from `collection`. @static @memberOf _ @category Collection @param {Array|Object} collection The collection to sample. @returns {*} Returns the random element. @example _.sample([1, 2, 3, 4]); // => 2
[ "Gets", "a", "random", "element", "from", "collection", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L18792-L18795
45,672
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
size
function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { var result = collection.length; return result && isString(collection) ? stringSize(collection) : result; } return keys(collection).length; }
javascript
function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { var result = collection.length; return result && isString(collection) ? stringSize(collection) : result; } return keys(collection).length; }
[ "function", "size", "(", "collection", ")", "{", "if", "(", "collection", "==", "null", ")", "{", "return", "0", ";", "}", "if", "(", "isArrayLike", "(", "collection", ")", ")", "{", "var", "result", "=", "collection", ".", "length", ";", "return", "...
Gets the size of `collection` by returning its length for array-like values or the number of own enumerable properties for objects. @static @memberOf _ @category Collection @param {Array|Object} collection The collection to inspect. @returns {number} Returns the collection size. @example _.size([1, 2, 3]); // => 3 _...
[ "Gets", "the", "size", "of", "collection", "by", "returning", "its", "length", "for", "array", "-", "like", "values", "or", "the", "number", "of", "own", "enumerable", "properties", "for", "objects", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L18862-L18871
45,673
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
isTypedArray
function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; }
javascript
function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; }
[ "function", "isTypedArray", "(", "value", ")", "{", "return", "isObjectLike", "(", "value", ")", "&&", "isLength", "(", "value", ".", "length", ")", "&&", "!", "!", "typedArrayTags", "[", "objectToString", ".", "call", "(", "value", ")", "]", ";", "}" ]
Checks if `value` is classified as a typed array. @static @memberOf _ @category Lang @param {*} value The value to check. @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. @example _.isTypedArray(new Uint8Array); // => true _.isTypedArray([]); // => false
[ "Checks", "if", "value", "is", "classified", "as", "a", "typed", "array", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L20948-L20950
45,674
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
keys
function keys(object) { var isProto = isPrototype(object); if (!(isProto || isArrayLike(object))) { return baseKeys(object); } var indexes = indexKeys(object), skipIndexes = !!indexes, result = indexes || [], length = result.length; for (var key in object) { i...
javascript
function keys(object) { var isProto = isPrototype(object); if (!(isProto || isArrayLike(object))) { return baseKeys(object); } var indexes = indexKeys(object), skipIndexes = !!indexes, result = indexes || [], length = result.length; for (var key in object) { i...
[ "function", "keys", "(", "object", ")", "{", "var", "isProto", "=", "isPrototype", "(", "object", ")", ";", "if", "(", "!", "(", "isProto", "||", "isArrayLike", "(", "object", ")", ")", ")", "{", "return", "baseKeys", "(", "object", ")", ";", "}", ...
Creates an array of the own enumerable property names of `object`. **Note:** Non-object values are coerced to objects. See the [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more details. @static @memberOf _ @category Object @param {Object} object The object to query. @returns {Array} Retu...
[ "Creates", "an", "array", "of", "the", "own", "enumerable", "property", "names", "of", "object", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L21930-L21942
45,675
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
parseInt
function parseInt(string, radix, guard) { // Chrome fails to trim leading <BOM> whitespace characters. // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } ...
javascript
function parseInt(string, radix, guard) { // Chrome fails to trim leading <BOM> whitespace characters. // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } ...
[ "function", "parseInt", "(", "string", ",", "radix", ",", "guard", ")", "{", "// Chrome fails to trim leading <BOM> whitespace characters.", "// See https://code.google.com/p/v8/issues/detail?id=3109 for more details.", "if", "(", "guard", "||", "radix", "==", "null", ")", "{...
Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, in which case a `radix` of `16` is used. **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. @static @memberOf _ ...
[ "Converts", "string", "to", "an", "integer", "of", "the", "specified", "radix", ".", "If", "radix", "is", "undefined", "or", "0", "a", "radix", "of", "10", "is", "used", "unless", "value", "is", "a", "hexadecimal", "in", "which", "case", "a", "radix", ...
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L23004-L23014
45,676
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
words
function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord; } return string.match(pattern) || []; }
javascript
function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord; } return string.match(pattern) || []; }
[ "function", "words", "(", "string", ",", "pattern", ",", "guard", ")", "{", "string", "=", "toString", "(", "string", ")", ";", "pattern", "=", "guard", "?", "undefined", ":", "pattern", ";", "if", "(", "pattern", "===", "undefined", ")", "{", "pattern...
Splits `string` into an array of its words. @static @memberOf _ @category String @param {string} [string=''] The string to inspect. @param {RegExp|string} [pattern] The pattern to match words. @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. @returns {Array} Returns the words of `string`...
[ "Splits", "string", "into", "an", "array", "of", "its", "words", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L23611-L23618
45,677
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
mixin
function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = b...
javascript
function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = b...
[ "function", "mixin", "(", "object", ",", "source", ",", "options", ")", "{", "var", "props", "=", "keys", "(", "source", ")", ",", "methodNames", "=", "baseFunctions", "(", "source", ",", "props", ")", ";", "if", "(", "options", "==", "null", "&&", "...
Adds all own enumerable function properties of a source object to the destination object. If `object` is a function then methods are added to its prototype as well. **Note:** Use `_.runInContext` to create a pristine `lodash` function to avoid conflicts caused by modifying the original. @static @memberOf _ @category ...
[ "Adds", "all", "own", "enumerable", "function", "properties", "of", "a", "source", "object", "to", "the", "destination", "object", ".", "If", "object", "is", "a", "function", "then", "methods", "are", "added", "to", "its", "prototype", "as", "well", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L24007-L24037
45,678
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
subtract
function subtract(minuend, subtrahend) { var result; if (minuend === undefined && subtrahend === undefined) { return 0; } if (minuend !== undefined) { result = minuend; } if (subtrahend !== undefined) { result = result === undefined ? subtrah...
javascript
function subtract(minuend, subtrahend) { var result; if (minuend === undefined && subtrahend === undefined) { return 0; } if (minuend !== undefined) { result = minuend; } if (subtrahend !== undefined) { result = result === undefined ? subtrah...
[ "function", "subtract", "(", "minuend", ",", "subtrahend", ")", "{", "var", "result", ";", "if", "(", "minuend", "===", "undefined", "&&", "subtrahend", "===", "undefined", ")", "{", "return", "0", ";", "}", "if", "(", "minuend", "!==", "undefined", ")",...
Subtract two numbers. @static @memberOf _ @category Math @param {number} minuend The first number in a subtraction. @param {number} subtrahend The second number in a subtraction. @returns {number} Returns the difference. @example _.subtract(6, 4); // => 2
[ "Subtract", "two", "numbers", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L24571-L24583
45,679
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
onWindowLoad
function onWindowLoad() { self.isLoaded = true; onPluginStart(); if (windowLoadListenderAttached) { window.removeEventListener('load', onWindowLoad, false); } }
javascript
function onWindowLoad() { self.isLoaded = true; onPluginStart(); if (windowLoadListenderAttached) { window.removeEventListener('load', onWindowLoad, false); } }
[ "function", "onWindowLoad", "(", ")", "{", "self", ".", "isLoaded", "=", "true", ";", "onPluginStart", "(", ")", ";", "if", "(", "windowLoadListenderAttached", ")", "{", "window", ".", "removeEventListener", "(", "'load'", ",", "onWindowLoad", ",", "false", ...
Setup listeners to know when we're ready to go.
[ "Setup", "listeners", "to", "know", "when", "we", "re", "ready", "to", "go", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L25415-L25423
45,680
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
isCordova
function isCordova() { var isCordova = null; var idxIsCordova = window.location.search.indexOf('isCordova='); if (idxIsCordova >= 0) { var isCordova = window.location.search.substring(idxIsCordova + 10); if (isCordova.indexOf('&') >= 0) { isCordova = isCordova.substring(0, i...
javascript
function isCordova() { var isCordova = null; var idxIsCordova = window.location.search.indexOf('isCordova='); if (idxIsCordova >= 0) { var isCordova = window.location.search.substring(idxIsCordova + 10); if (isCordova.indexOf('&') >= 0) { isCordova = isCordova.substring(0, i...
[ "function", "isCordova", "(", ")", "{", "var", "isCordova", "=", "null", ";", "var", "idxIsCordova", "=", "window", ".", "location", ".", "search", ".", "indexOf", "(", "'isCordova='", ")", ";", "if", "(", "idxIsCordova", ">=", "0", ")", "{", "var", "i...
Get the isCordova boolean from the URL.
[ "Get", "the", "isCordova", "boolean", "from", "the", "URL", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L25573-L25584
45,681
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
createAccessors
function createAccessors(keys) { var fname; lodash.forEach(keys, function(key) { key.replace(/[^\w\d-]/g, ''); // get<key> fname = createFnName('get', key); self[fname] = function() { return getKey(ns + key); }; // set<key> fname = createF...
javascript
function createAccessors(keys) { var fname; lodash.forEach(keys, function(key) { key.replace(/[^\w\d-]/g, ''); // get<key> fname = createFnName('get', key); self[fname] = function() { return getKey(ns + key); }; // set<key> fname = createF...
[ "function", "createAccessors", "(", "keys", ")", "{", "var", "fname", ";", "lodash", ".", "forEach", "(", "keys", ",", "function", "(", "key", ")", "{", "key", ".", "replace", "(", "/", "[^\\w\\d-]", "/", "g", ",", "''", ")", ";", "// get<key>", "fna...
Private functions Create accessor functions for each key.
[ "Private", "functions", "Create", "accessor", "functions", "for", "each", "key", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L26987-L27012
45,682
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
timeout
function timeout(message) { $log.warn('Plugin client request timeout: ' + serialize(message)); var promiseIndex = lodash.findIndex(promises, function(promise) { return promise.id == message.header.id; }); if (promiseIndex >= 0) { var promise = lodash.pullAt(promises, promiseIndex); ...
javascript
function timeout(message) { $log.warn('Plugin client request timeout: ' + serialize(message)); var promiseIndex = lodash.findIndex(promises, function(promise) { return promise.id == message.header.id; }); if (promiseIndex >= 0) { var promise = lodash.pullAt(promises, promiseIndex); ...
[ "function", "timeout", "(", "message", ")", "{", "$log", ".", "warn", "(", "'Plugin client request timeout: '", "+", "serialize", "(", "message", ")", ")", ";", "var", "promiseIndex", "=", "lodash", ".", "findIndex", "(", "promises", ",", "function", "(", "p...
Timeout a message waiting for a response. Enables the client app to process a message delivery failure.
[ "Timeout", "a", "message", "waiting", "for", "a", "response", ".", "Enables", "the", "client", "app", "to", "process", "a", "message", "delivery", "failure", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L28037-L28058
45,683
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
transport
function transport(message) { return { header: message.header, request: message.request, response: message.response } }
javascript
function transport(message) { return { header: message.header, request: message.request, response: message.response } }
[ "function", "transport", "(", "message", ")", "{", "return", "{", "header", ":", "message", ".", "header", ",", "request", ":", "message", ".", "request", ",", "response", ":", "message", ".", "response", "}", "}" ]
Only these properties of a message are sent and received.
[ "Only", "these", "properties", "of", "a", "message", "are", "sent", "and", "received", "." ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L28069-L28075
45,684
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
match
function match(mapEntry, request, route) { var keys = []; var m = pathToRegexpService.pathToRegexp(mapEntry.path, keys).exec(request.url); if (!m) { return false; } if (mapEntry.method != request.method) { return false; } route.params = {}; route.path = m[0]; route.ha...
javascript
function match(mapEntry, request, route) { var keys = []; var m = pathToRegexpService.pathToRegexp(mapEntry.path, keys).exec(request.url); if (!m) { return false; } if (mapEntry.method != request.method) { return false; } route.params = {}; route.path = m[0]; route.ha...
[ "function", "match", "(", "mapEntry", ",", "request", ",", "route", ")", "{", "var", "keys", "=", "[", "]", ";", "var", "m", "=", "pathToRegexpService", ".", "pathToRegexp", "(", "mapEntry", ".", "path", ",", "keys", ")", ".", "exec", "(", "request", ...
Private static methods
[ "Private", "static", "methods" ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L28220-L28250
45,685
owstack/ows-wallet-plugin-client
release/ows-wallet-client.js
setConfig
function setConfig(configs) { configProperties = platformConfigs; provider.platform[platformName] = {}; addConfig(configProperties, configProperties.platform[platformName]); createConfig(configProperties.platform[platformName], provider.platform[platformName], ''); }
javascript
function setConfig(configs) { configProperties = platformConfigs; provider.platform[platformName] = {}; addConfig(configProperties, configProperties.platform[platformName]); createConfig(configProperties.platform[platformName], provider.platform[platformName], ''); }
[ "function", "setConfig", "(", "configs", ")", "{", "configProperties", "=", "platformConfigs", ";", "provider", ".", "platform", "[", "platformName", "]", "=", "{", "}", ";", "addConfig", "(", "configProperties", ",", "configProperties", ".", "platform", "[", ...
Used to set configs
[ "Used", "to", "set", "configs" ]
431b510a0f10670a831e937a3f8a1f7e09dfca35
https://github.com/owstack/ows-wallet-plugin-client/blob/431b510a0f10670a831e937a3f8a1f7e09dfca35/release/ows-wallet-client.js#L28644-L28651
45,686
tomasbasham/ember-cli-pubnub
index.js
function(app) { this._super(app); const vendorTree = this.treePaths.vendor; // Import the PubNub package and shim. app.import(`${vendorTree}/pubnub.js`); app.import(`${vendorTree}/shims/pubnub.js`, { exports: { PubNub: ['default'] } }); }
javascript
function(app) { this._super(app); const vendorTree = this.treePaths.vendor; // Import the PubNub package and shim. app.import(`${vendorTree}/pubnub.js`); app.import(`${vendorTree}/shims/pubnub.js`, { exports: { PubNub: ['default'] } }); }
[ "function", "(", "app", ")", "{", "this", ".", "_super", "(", "app", ")", ";", "const", "vendorTree", "=", "this", ".", "treePaths", ".", "vendor", ";", "// Import the PubNub package and shim.", "app", ".", "import", "(", "`", "${", "vendorTree", "}", "`",...
Add the PubNub JavaScript package to the consuming application and expose the vendor shim enabling it to be imported as an es6 module. @method included @param {Object} app An EmberApp instance.
[ "Add", "the", "PubNub", "JavaScript", "package", "to", "the", "consuming", "application", "and", "expose", "the", "vendor", "shim", "enabling", "it", "to", "be", "imported", "as", "an", "es6", "module", "." ]
b758063df6989b0ce5ceee4f832ff4aeff08d036
https://github.com/tomasbasham/ember-cli-pubnub/blob/b758063df6989b0ce5ceee4f832ff4aeff08d036/index.js#L21-L33
45,687
tomasbasham/ember-cli-pubnub
index.js
function(vendorTree) { const pubnubPath = path.dirname(require.resolve('pubnub/dist/web/pubnub.js')); const pubnubTree = new Funnel(pubnubPath, { src: 'pubnub.js', dest: './', annotation: 'Funnel (PubNub)' }); return mergeTrees([vendorTree, pubnubTree]); }
javascript
function(vendorTree) { const pubnubPath = path.dirname(require.resolve('pubnub/dist/web/pubnub.js')); const pubnubTree = new Funnel(pubnubPath, { src: 'pubnub.js', dest: './', annotation: 'Funnel (PubNub)' }); return mergeTrees([vendorTree, pubnubTree]); }
[ "function", "(", "vendorTree", ")", "{", "const", "pubnubPath", "=", "path", ".", "dirname", "(", "require", ".", "resolve", "(", "'pubnub/dist/web/pubnub.js'", ")", ")", ";", "const", "pubnubTree", "=", "new", "Funnel", "(", "pubnubPath", ",", "{", "src", ...
Resolve the path to the PubNub web bundle and transpose the files in that path into the project's vendor folder during build time. @method treeForVendor @params {Object} vendorTree The broccoli tree representing vendor files.
[ "Resolve", "the", "path", "to", "the", "PubNub", "web", "bundle", "and", "transpose", "the", "files", "in", "that", "path", "into", "the", "project", "s", "vendor", "folder", "during", "build", "time", "." ]
b758063df6989b0ce5ceee4f832ff4aeff08d036
https://github.com/tomasbasham/ember-cli-pubnub/blob/b758063df6989b0ce5ceee4f832ff4aeff08d036/index.js#L46-L55
45,688
theboyWhoCriedWoolf/transition-manager
src/utils/default.js
defaultProps
function defaultProps( target, overwrite ) { overwrite = overwrite || {}; for( var prop in overwrite ) { if( target.hasOwnProperty(prop) && _isValid( overwrite[ prop ] ) ) { target[ prop ] = overwrite[ prop ]; } } return target; }
javascript
function defaultProps( target, overwrite ) { overwrite = overwrite || {}; for( var prop in overwrite ) { if( target.hasOwnProperty(prop) && _isValid( overwrite[ prop ] ) ) { target[ prop ] = overwrite[ prop ]; } } return target; }
[ "function", "defaultProps", "(", "target", ",", "overwrite", ")", "{", "overwrite", "=", "overwrite", "||", "{", "}", ";", "for", "(", "var", "prop", "in", "overwrite", ")", "{", "if", "(", "target", ".", "hasOwnProperty", "(", "prop", ")", "&&", "_isV...
replace target object properties with the overwrite object properties if they have been set @param {object} target - object to overwrite @param {object} overwrite - object with new properies and values @return {object}
[ "replace", "target", "object", "properties", "with", "the", "overwrite", "object", "properties", "if", "they", "have", "been", "set" ]
a20fda0bb07c0098bf709ea03770b1ee2a855655
https://github.com/theboyWhoCriedWoolf/transition-manager/blob/a20fda0bb07c0098bf709ea03770b1ee2a855655/src/utils/default.js#L11-L20
45,689
AlmogBaku/grunt-hook
tasks/hook.js
function(action, weight) { if(weight===undefined) { weight=0; } this.tasks.push({ name: action, weight: weight}); }
javascript
function(action, weight) { if(weight===undefined) { weight=0; } this.tasks.push({ name: action, weight: weight}); }
[ "function", "(", "action", ",", "weight", ")", "{", "if", "(", "weight", "===", "undefined", ")", "{", "weight", "=", "0", ";", "}", "this", ".", "tasks", ".", "push", "(", "{", "name", ":", "action", ",", "weight", ":", "weight", "}", ")", ";", ...
Push new task @param action @param weight
[ "Push", "new", "task" ]
dae10b5d12b49f2de94567545d40b6dea9830804
https://github.com/AlmogBaku/grunt-hook/blob/dae10b5d12b49f2de94567545d40b6dea9830804/tasks/hook.js#L21-L26
45,690
AlmogBaku/grunt-hook
tasks/hook.js
function () { var tasks = this.tasks.sort(function(a,b) { if (a.weight < b.weight) { return -1; } if (a.weight > b.weight) { return 1; } return 0; }); var queue = []; for(var i=0;i<tasks.length; i+=1) { queue.push(tasks[i].name); ...
javascript
function () { var tasks = this.tasks.sort(function(a,b) { if (a.weight < b.weight) { return -1; } if (a.weight > b.weight) { return 1; } return 0; }); var queue = []; for(var i=0;i<tasks.length; i+=1) { queue.push(tasks[i].name); ...
[ "function", "(", ")", "{", "var", "tasks", "=", "this", ".", "tasks", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "if", "(", "a", ".", "weight", "<", "b", ".", "weight", ")", "{", "return", "-", "1", ";", "}", "if", "(", "a"...
Get all tasks ordered by weight @returns {Array}
[ "Get", "all", "tasks", "ordered", "by", "weight" ]
dae10b5d12b49f2de94567545d40b6dea9830804
https://github.com/AlmogBaku/grunt-hook/blob/dae10b5d12b49f2de94567545d40b6dea9830804/tasks/hook.js#L32-L47
45,691
jokemmy/promisynch
src/index.js
throwWapper
function throwWapper( callback ) { return function( resultSet ) { callback( resultSet.err || null, resultSet.err ? null : resultSet.result, ...resultSet.argument ); if ( resultSet.err ) { throw resultSet.err; } return resultSet; }; }
javascript
function throwWapper( callback ) { return function( resultSet ) { callback( resultSet.err || null, resultSet.err ? null : resultSet.result, ...resultSet.argument ); if ( resultSet.err ) { throw resultSet.err; } return resultSet; }; }
[ "function", "throwWapper", "(", "callback", ")", "{", "return", "function", "(", "resultSet", ")", "{", "callback", "(", "resultSet", ".", "err", "||", "null", ",", "resultSet", ".", "err", "?", "null", ":", "resultSet", ".", "result", ",", "...", "resul...
use in finally method, catch a error and throw this error or throw the last error
[ "use", "in", "finally", "method", "catch", "a", "error", "and", "throw", "this", "error", "or", "throw", "the", "last", "error" ]
80a239d169dfb5c74eea356da031c756d6237115
https://github.com/jokemmy/promisynch/blob/80a239d169dfb5c74eea356da031c756d6237115/src/index.js#L72-L84
45,692
OpenSmartEnvironment/ose
lib/kind.js
init
function init(schema, name) { // {{{2 /** * Kind constructor * * @param schema {Object|String} Schema containing the kind * @param name {String} Unique kind name within the schema * * @method constructor */ this.name = name; // {{{3 /** * Kind name unique within a schema * * @property name * @...
javascript
function init(schema, name) { // {{{2 /** * Kind constructor * * @param schema {Object|String} Schema containing the kind * @param name {String} Unique kind name within the schema * * @method constructor */ this.name = name; // {{{3 /** * Kind name unique within a schema * * @property name * @...
[ "function", "init", "(", "schema", ",", "name", ")", "{", "// {{{2", "/**\n * Kind constructor\n *\n * @param schema {Object|String} Schema containing the kind\n * @param name {String} Unique kind name within the schema\n *\n * @method constructor\n */", "this", ".", "name", "=", "name",...
`entry.dval` structure description Contains an [ose/lib/field/object] instance @property ddef @type Object Public {{{1
[ "entry", ".", "dval", "structure", "description" ]
2ab051d9db6e77341c40abb9cbdae6ce586917e0
https://github.com/OpenSmartEnvironment/ose/blob/2ab051d9db6e77341c40abb9cbdae6ce586917e0/lib/kind.js#L47-L92
45,693
DriveTimeInc/gangplank
lib/validator.js
isException
function isException(url, exceptions) { if (exceptions && Array.isArray(exceptions)) { for (let i = 0; i < exceptions.length; i++) { if ((new RegExp(exceptions[i])).test(expressUtility.getBaseRoute(url))) { // Found exception return true; } } } return false; }
javascript
function isException(url, exceptions) { if (exceptions && Array.isArray(exceptions)) { for (let i = 0; i < exceptions.length; i++) { if ((new RegExp(exceptions[i])).test(expressUtility.getBaseRoute(url))) { // Found exception return true; } } } return false; }
[ "function", "isException", "(", "url", ",", "exceptions", ")", "{", "if", "(", "exceptions", "&&", "Array", ".", "isArray", "(", "exceptions", ")", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "exceptions", ".", "length", ";", "i", "+...
Determines if the current route is an exception and thus will not be considered missing. @param {string} url @param {Array<string>} exceptions
[ "Determines", "if", "the", "current", "route", "is", "an", "exception", "and", "thus", "will", "not", "be", "considered", "missing", "." ]
d7eed36d4ea9d18c537884548b59460ec8bd9b5e
https://github.com/DriveTimeInc/gangplank/blob/d7eed36d4ea9d18c537884548b59460ec8bd9b5e/lib/validator.js#L33-L43
45,694
DriveTimeInc/gangplank
lib/validator.js
preCast
function preCast(value, parameterDefinition) { switch (parameterDefinition.type) { case 'array': { let values; switch (parameterDefinition.collectionFormat) { case 'ssv': values = value.split(' '); break; case 'tsv': values = value.split('\t'); break; case 'pipes': values ...
javascript
function preCast(value, parameterDefinition) { switch (parameterDefinition.type) { case 'array': { let values; switch (parameterDefinition.collectionFormat) { case 'ssv': values = value.split(' '); break; case 'tsv': values = value.split('\t'); break; case 'pipes': values ...
[ "function", "preCast", "(", "value", ",", "parameterDefinition", ")", "{", "switch", "(", "parameterDefinition", ".", "type", ")", "{", "case", "'array'", ":", "{", "let", "values", ";", "switch", "(", "parameterDefinition", ".", "collectionFormat", ")", "{", ...
Casts raw values from the request before they are validated
[ "Casts", "raw", "values", "from", "the", "request", "before", "they", "are", "validated" ]
d7eed36d4ea9d18c537884548b59460ec8bd9b5e
https://github.com/DriveTimeInc/gangplank/blob/d7eed36d4ea9d18c537884548b59460ec8bd9b5e/lib/validator.js#L120-L175
45,695
DriveTimeInc/gangplank
lib/validator.js
postCast
function postCast(value, parameterDefinition) { const type = parameterDefinition.type; const format = parameterDefinition.format; if (type === 'string' && (format === 'date' || format === 'date-time')) { return new Date(value); } else { return value; } }
javascript
function postCast(value, parameterDefinition) { const type = parameterDefinition.type; const format = parameterDefinition.format; if (type === 'string' && (format === 'date' || format === 'date-time')) { return new Date(value); } else { return value; } }
[ "function", "postCast", "(", "value", ",", "parameterDefinition", ")", "{", "const", "type", "=", "parameterDefinition", ".", "type", ";", "const", "format", "=", "parameterDefinition", ".", "format", ";", "if", "(", "type", "===", "'string'", "&&", "(", "fo...
Casts values AFTER validated to support string formats
[ "Casts", "values", "AFTER", "validated", "to", "support", "string", "formats" ]
d7eed36d4ea9d18c537884548b59460ec8bd9b5e
https://github.com/DriveTimeInc/gangplank/blob/d7eed36d4ea9d18c537884548b59460ec8bd9b5e/lib/validator.js#L178-L186
45,696
mikolalysenko/grid-mesh
grid.js
gridMesh
function gridMesh(nx, ny, origin, dx, dy) { //Unpack default arguments origin = origin || [0,0] if(!dx || dx.length < origin.length) { dx = dup(origin.length) if(origin.length > 0) { dx[0] = 1 } } if(!dy || dy.length < origin.length) { dy = dup(origin.length) if(origin.length > 1) { ...
javascript
function gridMesh(nx, ny, origin, dx, dy) { //Unpack default arguments origin = origin || [0,0] if(!dx || dx.length < origin.length) { dx = dup(origin.length) if(origin.length > 0) { dx[0] = 1 } } if(!dy || dy.length < origin.length) { dy = dup(origin.length) if(origin.length > 1) { ...
[ "function", "gridMesh", "(", "nx", ",", "ny", ",", "origin", ",", "dx", ",", "dy", ")", "{", "//Unpack default arguments", "origin", "=", "origin", "||", "[", "0", ",", "0", "]", "if", "(", "!", "dx", "||", "dx", ".", "length", "<", "origin", ".", ...
Creates a grid mesh
[ "Creates", "a", "grid", "mesh" ]
885fa9fd9ef08b6db6ac94c2bbc6ea967ed2e750
https://github.com/mikolalysenko/grid-mesh/blob/885fa9fd9ef08b6db6ac94c2bbc6ea967ed2e750/grid.js#L8-L46
45,697
thorn0/tinymce.html
tinymce.html.js
buildEntitiesLookup
function buildEntitiesLookup(items, radix) { var i, chr, entity, lookup = {}; if (items) { items = items.split(','); radix = radix || 10; // Build entities lookup table for (i = 0; i < items.length; i += 2) { chr...
javascript
function buildEntitiesLookup(items, radix) { var i, chr, entity, lookup = {}; if (items) { items = items.split(','); radix = radix || 10; // Build entities lookup table for (i = 0; i < items.length; i += 2) { chr...
[ "function", "buildEntitiesLookup", "(", "items", ",", "radix", ")", "{", "var", "i", ",", "chr", ",", "entity", ",", "lookup", "=", "{", "}", ";", "if", "(", "items", ")", "{", "items", "=", "items", ".", "split", "(", "','", ")", ";", "radix", "...
Build a two way lookup table for the entities
[ "Build", "a", "two", "way", "lookup", "table", "for", "the", "entities" ]
0bf3faa50368b68b5a4f5a436169295535778ead
https://github.com/thorn0/tinymce.html/blob/0bf3faa50368b68b5a4f5a436169295535778ead/tinymce.html.js#L340-L357
45,698
thorn0/tinymce.html
tinymce.html.js
function(text, attr) { return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { return baseEntities[chr] || chr; }); }
javascript
function(text, attr) { return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { return baseEntities[chr] || chr; }); }
[ "function", "(", "text", ",", "attr", ")", "{", "return", "text", ".", "replace", "(", "attr", "?", "attrsCharsRegExp", ":", "textCharsRegExp", ",", "function", "(", "chr", ")", "{", "return", "baseEntities", "[", "chr", "]", "||", "chr", ";", "}", ")"...
Encodes the specified string using raw entities. This means only the required XML base entities will be encoded. @method encodeRaw @param {String} text Text to encode. @param {Boolean} attr Optional flag to specify if the text is attribute contents. @return {String} Entity encoded text.
[ "Encodes", "the", "specified", "string", "using", "raw", "entities", ".", "This", "means", "only", "the", "required", "XML", "base", "entities", "will", "be", "encoded", "." ]
0bf3faa50368b68b5a4f5a436169295535778ead
https://github.com/thorn0/tinymce.html/blob/0bf3faa50368b68b5a4f5a436169295535778ead/tinymce.html.js#L369-L373
45,699
thorn0/tinymce.html
tinymce.html.js
function(text, attr, entities) { entities = entities || namedEntities; return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { return baseEntities[chr] || entities[chr] || chr; }); }
javascript
function(text, attr, entities) { entities = entities || namedEntities; return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { return baseEntities[chr] || entities[chr] || chr; }); }
[ "function", "(", "text", ",", "attr", ",", "entities", ")", "{", "entities", "=", "entities", "||", "namedEntities", ";", "return", "text", ".", "replace", "(", "attr", "?", "attrsCharsRegExp", ":", "textCharsRegExp", ",", "function", "(", "chr", ")", "{",...
Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into named entities. @method encodeNamed @param {String} text Text to encode. @param {Boolean} attr Optional flag to specify if the text is attribute contents. @param {O...
[ "Encodes", "the", "specified", "string", "using", "named", "entities", ".", "The", "core", "entities", "will", "be", "encoded", "as", "named", "ones", "but", "all", "non", "lower", "ascii", "characters", "will", "be", "encoded", "into", "named", "entities", ...
0bf3faa50368b68b5a4f5a436169295535778ead
https://github.com/thorn0/tinymce.html/blob/0bf3faa50368b68b5a4f5a436169295535778ead/tinymce.html.js#L416-L421