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
53,600
aledbf/deis-api
lib/domains.js
add
function add(appName, domain, callback) { commons.post(format('/%s/apps/%s/domains/', deis.version, appName), { domain: domain.toString() }, callback); }
javascript
function add(appName, domain, callback) { commons.post(format('/%s/apps/%s/domains/', deis.version, appName), { domain: domain.toString() }, callback); }
[ "function", "add", "(", "appName", ",", "domain", ",", "callback", ")", "{", "commons", ".", "post", "(", "format", "(", "'/%s/apps/%s/domains/'", ",", "deis", ".", "version", ",", "appName", ")", ",", "{", "domain", ":", "domain", ".", "toString", "(", ...
Add a domain to an app registered with the Deis controller.
[ "Add", "a", "domain", "to", "an", "app", "registered", "with", "the", "Deis", "controller", "." ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/domains.js#L10-L14
53,601
aledbf/deis-api
lib/domains.js
remove
function remove(appName, domain, callback) { var url = format('/%s/apps/%s/domains/%s', deis.version, appName, domain); commons.del(url, callback); }
javascript
function remove(appName, domain, callback) { var url = format('/%s/apps/%s/domains/%s', deis.version, appName, domain); commons.del(url, callback); }
[ "function", "remove", "(", "appName", ",", "domain", ",", "callback", ")", "{", "var", "url", "=", "format", "(", "'/%s/apps/%s/domains/%s'", ",", "deis", ".", "version", ",", "appName", ",", "domain", ")", ";", "commons", ".", "del", "(", "url", ",", ...
Remove a domain registered on an application.
[ "Remove", "a", "domain", "registered", "on", "an", "application", "." ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/domains.js#L19-L22
53,602
aledbf/deis-api
lib/domains.js
getAll
function getAll(appName, callback) { var url = format('/%s/apps/%s/domains/', deis.version, appName); commons.get(endpoint, callback); }
javascript
function getAll(appName, callback) { var url = format('/%s/apps/%s/domains/', deis.version, appName); commons.get(endpoint, callback); }
[ "function", "getAll", "(", "appName", ",", "callback", ")", "{", "var", "url", "=", "format", "(", "'/%s/apps/%s/domains/'", ",", "deis", ".", "version", ",", "appName", ")", ";", "commons", ".", "get", "(", "endpoint", ",", "callback", ")", ";", "}" ]
Get all the domains for an application.
[ "Get", "all", "the", "domains", "for", "an", "application", "." ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/domains.js#L27-L30
53,603
aledbf/deis-api
lib/domains.js
getDomain
function getDomain(domain, callback) { getAll(function onGetAll(err, domains) { if (err) { return callback(err); } callback(null, domains.results.filter(function onGetDomain(domain_obj) { return domain_obj.domain == domain; })[0]); }); }
javascript
function getDomain(domain, callback) { getAll(function onGetAll(err, domains) { if (err) { return callback(err); } callback(null, domains.results.filter(function onGetDomain(domain_obj) { return domain_obj.domain == domain; })[0]); }); }
[ "function", "getDomain", "(", "domain", ",", "callback", ")", "{", "getAll", "(", "function", "onGetAll", "(", "err", ",", "domains", ")", "{", "if", "(", "err", ")", "{", "return", "callback", "(", "err", ")", ";", "}", "callback", "(", "null", ",",...
Get a domain by it's name.
[ "Get", "a", "domain", "by", "it", "s", "name", "." ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/domains.js#L35-L45
53,604
robgietema/twist
public/libs/jquery.selectbox.js
function (target) { var inst = this._getInst(target); if (!inst) { return FALSE; } $("#sbHolder_" + inst.uid).remove(); $.data(target, PROP_NAME, null); $(target).show(); }
javascript
function (target) { var inst = this._getInst(target); if (!inst) { return FALSE; } $("#sbHolder_" + inst.uid).remove(); $.data(target, PROP_NAME, null); $(target).show(); }
[ "function", "(", "target", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "if", "(", "!", "inst", ")", "{", "return", "FALSE", ";", "}", "$", "(", "\"#sbHolder_\"", "+", "inst", ".", "uid", ")", ".", "remove", "("...
Remove the selectbox functionality completely. This will return the element back to its pre-init state. @param {HTMLElement} target
[ "Remove", "the", "selectbox", "functionality", "completely", ".", "This", "will", "return", "the", "element", "back", "to", "its", "pre", "-", "init", "state", "." ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L231-L239
53,605
robgietema/twist
public/libs/jquery.selectbox.js
function (target, value, text) { var inst = this._getInst(target), onChange = this._get(inst, 'onChange'); $("#sbSelector_" + inst.uid).text(text); $(target).find("option[value='" + value + "']").attr("selected", TRUE); if (onChange) { onChange.apply((inst.input ? inst.input[0] : null), [value...
javascript
function (target, value, text) { var inst = this._getInst(target), onChange = this._get(inst, 'onChange'); $("#sbSelector_" + inst.uid).text(text); $(target).find("option[value='" + value + "']").attr("selected", TRUE); if (onChange) { onChange.apply((inst.input ? inst.input[0] : null), [value...
[ "function", "(", "target", ",", "value", ",", "text", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ",", "onChange", "=", "this", ".", "_get", "(", "inst", ",", "'onChange'", ")", ";", "$", "(", "\"#sbSelector_\"", "+", ...
Change selected attribute of the selectbox. @param {HTMLElement} target @param {String} value @param {String} text
[ "Change", "selected", "attribute", "of", "the", "selectbox", "." ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L247-L257
53,606
robgietema/twist
public/libs/jquery.selectbox.js
function (target) { var inst = this._getInst(target); if (!inst || !inst.isDisabled) { return FALSE; } $("#sbHolder_" + inst.uid).removeClass(inst.settings.classHolderDisabled); inst.isDisabled = FALSE; $.data(target, PROP_NAME, inst); }
javascript
function (target) { var inst = this._getInst(target); if (!inst || !inst.isDisabled) { return FALSE; } $("#sbHolder_" + inst.uid).removeClass(inst.settings.classHolderDisabled); inst.isDisabled = FALSE; $.data(target, PROP_NAME, inst); }
[ "function", "(", "target", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "if", "(", "!", "inst", "||", "!", "inst", ".", "isDisabled", ")", "{", "return", "FALSE", ";", "}", "$", "(", "\"#sbHolder_\"", "+", "inst",...
Enable the selectbox. @param {HTMLElement} target
[ "Enable", "the", "selectbox", "." ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L263-L271
53,607
robgietema/twist
public/libs/jquery.selectbox.js
function (target) { var inst = this._getInst(target); if (!inst || inst.isDisabled) { return FALSE; } $("#sbHolder_" + inst.uid).addClass(inst.settings.classHolderDisabled); inst.isDisabled = TRUE; $.data(target, PROP_NAME, inst); }
javascript
function (target) { var inst = this._getInst(target); if (!inst || inst.isDisabled) { return FALSE; } $("#sbHolder_" + inst.uid).addClass(inst.settings.classHolderDisabled); inst.isDisabled = TRUE; $.data(target, PROP_NAME, inst); }
[ "function", "(", "target", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "if", "(", "!", "inst", "||", "inst", ".", "isDisabled", ")", "{", "return", "FALSE", ";", "}", "$", "(", "\"#sbHolder_\"", "+", "inst", ".",...
Disable the selectbox. @param {HTMLElement} target
[ "Disable", "the", "selectbox", "." ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L277-L285
53,608
robgietema/twist
public/libs/jquery.selectbox.js
function (target, name, value) { var inst = this._getInst(target); if (!inst) { return FALSE; } //TODO check name inst[name] = value; $.data(target, PROP_NAME, inst); }
javascript
function (target, name, value) { var inst = this._getInst(target); if (!inst) { return FALSE; } //TODO check name inst[name] = value; $.data(target, PROP_NAME, inst); }
[ "function", "(", "target", ",", "name", ",", "value", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "if", "(", "!", "inst", ")", "{", "return", "FALSE", ";", "}", "//TODO check name\r", "inst", "[", "name", "]", "=...
Get or set any selectbox option. If no value is specified, will act as a getter. @param {HTMLElement} target @param {String} name @param {Object} value
[ "Get", "or", "set", "any", "selectbox", "option", ".", "If", "no", "value", "is", "specified", "will", "act", "as", "a", "getter", "." ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L293-L301
53,609
robgietema/twist
public/libs/jquery.selectbox.js
function (target) { var inst = this._getInst(target); //if (!inst || this._state[inst.uid] || inst.isDisabled) { if (!inst || inst.isOpen || inst.isDisabled) { return; } var el = $("#sbHolder_" + inst.uid), viewportHeight = parseInt($(window).height(), 10), offset = $("#sbHolder_" + i...
javascript
function (target) { var inst = this._getInst(target); //if (!inst || this._state[inst.uid] || inst.isDisabled) { if (!inst || inst.isOpen || inst.isDisabled) { return; } var el = $("#sbHolder_" + inst.uid), viewportHeight = parseInt($(window).height(), 10), offset = $("#sbHolder_" + i...
[ "function", "(", "target", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "//if (!inst || this._state[inst.uid] || inst.isDisabled) {\r", "if", "(", "!", "inst", "||", "inst", ".", "isOpen", "||", "inst", ".", "isDisabled", ")"...
Call up attached selectbox @param {HTMLElement} target
[ "Call", "up", "attached", "selectbox" ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L307-L335
53,610
robgietema/twist
public/libs/jquery.selectbox.js
function (target) { var inst = this._getInst(target); //if (!inst || !this._state[inst.uid]) { if (!inst || !inst.isOpen) { return; } var onClose = this._get(inst, 'onClose'); inst.settings.effect === "fade" ? $("#sbOptions_" + inst.uid).fadeOut(inst.settings.speed) : $("#sbOptions_" + inst...
javascript
function (target) { var inst = this._getInst(target); //if (!inst || !this._state[inst.uid]) { if (!inst || !inst.isOpen) { return; } var onClose = this._get(inst, 'onClose'); inst.settings.effect === "fade" ? $("#sbOptions_" + inst.uid).fadeOut(inst.settings.speed) : $("#sbOptions_" + inst...
[ "function", "(", "target", ")", "{", "var", "inst", "=", "this", ".", "_getInst", "(", "target", ")", ";", "//if (!inst || !this._state[inst.uid]) {\r", "if", "(", "!", "inst", "||", "!", "inst", ".", "isOpen", ")", "{", "return", ";", "}", "var", "onClo...
Close opened selectbox @param {HTMLElement} target
[ "Close", "opened", "selectbox" ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L341-L359
53,611
robgietema/twist
public/libs/jquery.selectbox.js
function(target) { var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); return { id: id, input: target, uid: Math.floor(Math.random() * 99999999), isOpen: FALSE, isDisabled: FALSE, settings: {} }; }
javascript
function(target) { var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); return { id: id, input: target, uid: Math.floor(Math.random() * 99999999), isOpen: FALSE, isDisabled: FALSE, settings: {} }; }
[ "function", "(", "target", ")", "{", "var", "id", "=", "target", "[", "0", "]", ".", "id", ".", "replace", "(", "/", "([^A-Za-z0-9_-])", "/", "g", ",", "'\\\\\\\\$1'", ")", ";", "return", "{", "id", ":", "id", ",", "input", ":", "target", ",", "u...
Create a new instance object @param {HTMLElement} target @return {Object}
[ "Create", "a", "new", "instance", "object" ]
7dc81080c6c28f34ad8e2334118ff416d2a004a0
https://github.com/robgietema/twist/blob/7dc81080c6c28f34ad8e2334118ff416d2a004a0/public/libs/jquery.selectbox.js#L366-L376
53,612
aledbf/deis-api
lib/commons.js
checkHttpCode
function checkHttpCode(expected, res, body, callback) { if (res.statusCode !== expected) { if (!body) { return callback(new Error(format('Unexpected deis response (expected %s but %s was returned)', expected, res.statusCode))); } var error = body.hasOwnProperty('detail') ? body.detail : JSO...
javascript
function checkHttpCode(expected, res, body, callback) { if (res.statusCode !== expected) { if (!body) { return callback(new Error(format('Unexpected deis response (expected %s but %s was returned)', expected, res.statusCode))); } var error = body.hasOwnProperty('detail') ? body.detail : JSO...
[ "function", "checkHttpCode", "(", "expected", ",", "res", ",", "body", ",", "callback", ")", "{", "if", "(", "res", ".", "statusCode", "!==", "expected", ")", "{", "if", "(", "!", "body", ")", "{", "return", "callback", "(", "new", "Error", "(", "for...
Check if the http response returns the expected http code and return an error with the detail if the check fails @param {Number} expected http @param {Response} res @param {Object} body @param {Function} callback
[ "Check", "if", "the", "http", "response", "returns", "the", "expected", "http", "code", "and", "return", "an", "error", "with", "the", "detail", "if", "the", "check", "fails" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/commons.js#L14-L27
53,613
m59peacemaker/browser-disable-chrome-ptr
docs/docs.js
compareVersions
function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); var chunks = map(versions, function (version) { var delta = precision - getVers...
javascript
function compareVersions(versions) { // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); var chunks = map(versions, function (version) { var delta = precision - getVers...
[ "function", "compareVersions", "(", "versions", ")", "{", "// 1) get common precision for both versions, for example for \"10.0\" and \"9\" it should be 2", "var", "precision", "=", "Math", ".", "max", "(", "getVersionPrecision", "(", "versions", "[", "0", "]", ")", ",", ...
Calculate browser version weight @example compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 compareVersions(['1.10.2.1', '1.10.2.1']); // 0 compareVersions(['1.10.2.1', '1.0800.2']); // -1 @param {Array<String>} versions versions to compare @return {N...
[ "Calculate", "browser", "version", "weight" ]
8170384999f0f4da5817c07b4d44347455b6de15
https://github.com/m59peacemaker/browser-disable-chrome-ptr/blob/8170384999f0f4da5817c07b4d44347455b6de15/docs/docs.js#L507-L538
53,614
m59peacemaker/browser-disable-chrome-ptr
docs/docs.js
isUnsupportedBrowser
function isUnsupportedBrowser(minVersions, strictMode, ua) { var _bowser = bowser; // make strictMode param optional with ua param usage if (typeof strictMode === 'string') { ua = strictMode; strictMode = void(0); } if (strictMode === void(0)) { strictMode = false; } if (...
javascript
function isUnsupportedBrowser(minVersions, strictMode, ua) { var _bowser = bowser; // make strictMode param optional with ua param usage if (typeof strictMode === 'string') { ua = strictMode; strictMode = void(0); } if (strictMode === void(0)) { strictMode = false; } if (...
[ "function", "isUnsupportedBrowser", "(", "minVersions", ",", "strictMode", ",", "ua", ")", "{", "var", "_bowser", "=", "bowser", ";", "// make strictMode param optional with ua param usage", "if", "(", "typeof", "strictMode", "===", "'string'", ")", "{", "ua", "=", ...
Check if browser is unsupported @example bowser.isUnsupportedBrowser({ msie: "10", firefox: "23", chrome: "29", safari: "5.1", opera: "16", phantom: "534" }); @param {Object} minVersions map of minimal version to browser @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map @par...
[ "Check", "if", "browser", "is", "unsupported" ]
8170384999f0f4da5817c07b4d44347455b6de15
https://github.com/m59peacemaker/browser-disable-chrome-ptr/blob/8170384999f0f4da5817c07b4d44347455b6de15/docs/docs.js#L558-L589
53,615
spacemaus/postvox
vox-common/connection-manager.js
sendCommand
function sendCommand(method, url, payload, skipQueue) { if (!self.connected) { debug('Queueing %s %s', method, url); return new P(function(resolve, reject) { var p = P.method(function() { debug('Dequeueing %s %s', method, url); return _sendCommand(method, url, payload) ...
javascript
function sendCommand(method, url, payload, skipQueue) { if (!self.connected) { debug('Queueing %s %s', method, url); return new P(function(resolve, reject) { var p = P.method(function() { debug('Dequeueing %s %s', method, url); return _sendCommand(method, url, payload) ...
[ "function", "sendCommand", "(", "method", ",", "url", ",", "payload", ",", "skipQueue", ")", "{", "if", "(", "!", "self", ".", "connected", ")", "{", "debug", "(", "'Queueing %s %s'", ",", "method", ",", "url", ")", ";", "return", "new", "P", "(", "f...
Helper function to send a command to the server. Returns a Promise for the server's response. Rejects the Promise if the reply's status is not 200. If this connection is not ready to receive commands, the command is queued for later execution.
[ "Helper", "function", "to", "send", "a", "command", "to", "the", "server", "." ]
de98e5ed37edaee1b1edadf93e15eb8f8d21f457
https://github.com/spacemaus/postvox/blob/de98e5ed37edaee1b1edadf93e15eb8f8d21f457/vox-common/connection-manager.js#L288-L306
53,616
danigb/step-seq
index.js
sequencer
function sequencer (ctx, callback) { var timer, iterable, iterator, nextTick, tempo, tickInterval, lookahead function emit (event, data, time, duration) { setTimeout(function () { callback(event, data, time, duration) }, 0) } function sequence (data) { if (!data) iterator = rangeIterator(0, Infinity) ...
javascript
function sequencer (ctx, callback) { var timer, iterable, iterator, nextTick, tempo, tickInterval, lookahead function emit (event, data, time, duration) { setTimeout(function () { callback(event, data, time, duration) }, 0) } function sequence (data) { if (!data) iterator = rangeIterator(0, Infinity) ...
[ "function", "sequencer", "(", "ctx", ",", "callback", ")", "{", "var", "timer", ",", "iterable", ",", "iterator", ",", "nextTick", ",", "tempo", ",", "tickInterval", ",", "lookahead", "function", "emit", "(", "event", ",", "data", ",", "time", ",", "dura...
Create a sequence A sequence is an object with two methods: start and stop @param {AudioContext} ctx - the audio context @param {Function} player - the function that plays the song @param {Integer} tempo - the tempo @param {Array|Integer} data - the data source
[ "Create", "a", "sequence" ]
4014eecff5728fe07adc36071276d94e277bf437
https://github.com/danigb/step-seq/blob/4014eecff5728fe07adc36071276d94e277bf437/index.js#L13-L72
53,617
cliffano/cmdt
lib/checker.js
_checkExitCode
function _checkExitCode(result, test) { var actual = result.exitcode; var expect = test.exitcode; var error; if (typeof expect === 'string') { expect = parseInt(expect, 10); } if (expect !== undefined && expect !== actual) { error = util.format('Exit code %d does not match expected %d', actual, e...
javascript
function _checkExitCode(result, test) { var actual = result.exitcode; var expect = test.exitcode; var error; if (typeof expect === 'string') { expect = parseInt(expect, 10); } if (expect !== undefined && expect !== actual) { error = util.format('Exit code %d does not match expected %d', actual, e...
[ "function", "_checkExitCode", "(", "result", ",", "test", ")", "{", "var", "actual", "=", "result", ".", "exitcode", ";", "var", "expect", "=", "test", ".", "exitcode", ";", "var", "error", ";", "if", "(", "typeof", "expect", "===", "'string'", ")", "{...
Check result exit code against expectated exit code. @param {Object} result: command execution result @param {Object} test: test expectation @return {Object} error if actual exit code doesn't equal expected exit code
[ "Check", "result", "exit", "code", "against", "expectated", "exit", "code", "." ]
8b8de56a23994a02117069c9c6da5fa1a3176fe5
https://github.com/cliffano/cmdt/blob/8b8de56a23994a02117069c9c6da5fa1a3176fe5/lib/checker.js#L10-L25
53,618
cliffano/cmdt
lib/checker.js
check
function check(result, test) { const CHECKERS = [ _checkExitCode, _checkOutput, _checkStdout, _checkStderr ]; var errors = []; CHECKERS.forEach(function (checker) { var error = checker(result, test); if (error) { errors.push(error); } }); return errors; }
javascript
function check(result, test) { const CHECKERS = [ _checkExitCode, _checkOutput, _checkStdout, _checkStderr ]; var errors = []; CHECKERS.forEach(function (checker) { var error = checker(result, test); if (error) { errors.push(error); } }); return errors; }
[ "function", "check", "(", "result", ",", "test", ")", "{", "const", "CHECKERS", "=", "[", "_checkExitCode", ",", "_checkOutput", ",", "_checkStdout", ",", "_checkStderr", "]", ";", "var", "errors", "=", "[", "]", ";", "CHECKERS", ".", "forEach", "(", "fu...
Check command execution result with test expectation against a set of check functions. @param {Object} result: command execution result @param {Object} test: test expectation @return {Array} check errors
[ "Check", "command", "execution", "result", "with", "test", "expectation", "against", "a", "set", "of", "check", "functions", "." ]
8b8de56a23994a02117069c9c6da5fa1a3176fe5
https://github.com/cliffano/cmdt/blob/8b8de56a23994a02117069c9c6da5fa1a3176fe5/lib/checker.js#L80-L93
53,619
yeptlabs/wns
src/core/base/wnComponent.js
function (obj) { if (typeof obj === 'undefined') { obj = this.getConfig(); delete obj.class; } if (typeof obj == 'object') { delete obj.autoInit; delete obj.id; delete obj.serverID; delete obj.modulePath; for (o in obj) { this.exportConfig(obj[o]); } } ...
javascript
function (obj) { if (typeof obj === 'undefined') { obj = this.getConfig(); delete obj.class; } if (typeof obj == 'object') { delete obj.autoInit; delete obj.id; delete obj.serverID; delete obj.modulePath; for (o in obj) { this.exportConfig(obj[o]); } } ...
[ "function", "(", "obj", ")", "{", "if", "(", "typeof", "obj", "===", "'undefined'", ")", "{", "obj", "=", "this", ".", "getConfig", "(", ")", ";", "delete", "obj", ".", "class", ";", "}", "if", "(", "typeof", "obj", "==", "'object'", ")", "{", "d...
Export to JSON the components's config. @param object $obj @return object
[ "Export", "to", "JSON", "the", "components", "s", "config", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L195-L218
53,620
yeptlabs/wns
src/core/base/wnComponent.js
function (filePath) { if (typeof arguments[1]=='function') var cb = arguments[1]; if (typeof arguments[2]=='function') var cb = arguments[2]; var binary = typeof arguments[1]=='boolean' ? arguments[1] : false, realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath, cmd = !...
javascript
function (filePath) { if (typeof arguments[1]=='function') var cb = arguments[1]; if (typeof arguments[2]=='function') var cb = arguments[2]; var binary = typeof arguments[1]=='boolean' ? arguments[1] : false, realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath, cmd = !...
[ "function", "(", "filePath", ")", "{", "if", "(", "typeof", "arguments", "[", "1", "]", "==", "'function'", ")", "var", "cb", "=", "arguments", "[", "1", "]", ";", "if", "(", "typeof", "arguments", "[", "2", "]", "==", "'function'", ")", "var", "cb...
Get a file. The file's path is relative to the module's path. @param string $filePath file's path @param boolean $binary is it binary? @param function $cb async callback function @return boolean|string
[ "Get", "a", "file", ".", "The", "file", "s", "path", "is", "relative", "to", "the", "module", "s", "path", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L228-L253
53,621
yeptlabs/wns
src/core/base/wnComponent.js
function (filePath,cb) { var realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath, cmd = !cb ? 'statSync' : 'stat'; if (!fs.existsSync(realPath)) return (cb&&cb(false) == true); var _cb = cb ? function (err,stat) { cb&&cb(!err ? stat : false); } : null, stat = fs[cmd]...
javascript
function (filePath,cb) { var realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath, cmd = !cb ? 'statSync' : 'stat'; if (!fs.existsSync(realPath)) return (cb&&cb(false) == true); var _cb = cb ? function (err,stat) { cb&&cb(!err ? stat : false); } : null, stat = fs[cmd]...
[ "function", "(", "filePath", ",", "cb", ")", "{", "var", "realPath", "=", "this", ".", "instanceOf", "(", "'wnModule'", ")", "?", "this", ".", "modulePath", "+", "filePath", ":", "filePath", ",", "cmd", "=", "!", "cb", "?", "'statSync'", ":", "'stat'",...
Get a file statistic. The file's path is relative to the module's path. @param string $filePath file's path @param function $cb callback
[ "Get", "a", "file", "statistic", ".", "The", "file", "s", "path", "is", "relative", "to", "the", "module", "s", "path", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L291-L302
53,622
yeptlabs/wns
src/core/base/wnComponent.js
function () { this.e.log&&this.e.log('Preloading events...','system'); var preload = {}; _.merge(preload,this.defaultEvents); _.merge(preload,this.getConfig().events); if (preload != undefined) this.setEvents(preload); for (e in preload) { this.getEvent(e); } this.attachEventsHandle...
javascript
function () { this.e.log&&this.e.log('Preloading events...','system'); var preload = {}; _.merge(preload,this.defaultEvents); _.merge(preload,this.getConfig().events); if (preload != undefined) this.setEvents(preload); for (e in preload) { this.getEvent(e); } this.attachEventsHandle...
[ "function", "(", ")", "{", "this", ".", "e", ".", "log", "&&", "this", ".", "e", ".", "log", "(", "'Preloading events...'", ",", "'system'", ")", ";", "var", "preload", "=", "{", "}", ";", "_", ".", "merge", "(", "preload", ",", "this", ".", "def...
Preload all required events @return this
[ "Preload", "all", "required", "events" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L308-L322
53,623
yeptlabs/wns
src/core/base/wnComponent.js
function (className,config,path,npmPath) { var source = this.c || process.wns; var instance; var builder = this.getComponent&&this.getComponent('classBuilder'); if (!source || !source[className]) { return false; } if (config.id) source[className].build.id = config.id; if (source[className...
javascript
function (className,config,path,npmPath) { var source = this.c || process.wns; var instance; var builder = this.getComponent&&this.getComponent('classBuilder'); if (!source || !source[className]) { return false; } if (config.id) source[className].build.id = config.id; if (source[className...
[ "function", "(", "className", ",", "config", ",", "path", ",", "npmPath", ")", "{", "var", "source", "=", "this", ".", "c", "||", "process", ".", "wns", ";", "var", "instance", ";", "var", "builder", "=", "this", ".", "getComponent", "&&", "this", "....
Create an class from the classSources. @param string $className name of the class @param object $config class configuration @param component $boolean is it component format? @return boolean|object
[ "Create", "an", "class", "from", "the", "classSources", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L331-L361
53,624
yeptlabs/wns
src/core/base/wnComponent.js
function () { this.e.log&&this.e.log("Attaching default event's handlers...",'system'); var events = this.getEvents(); for (e in events) { var eventName = e.split('-').pop(), event = this.getEvent(eventName), evtConfig = event.getConfig(); if (evtConfig.handler != null && this[evtConfig.h...
javascript
function () { this.e.log&&this.e.log("Attaching default event's handlers...",'system'); var events = this.getEvents(); for (e in events) { var eventName = e.split('-').pop(), event = this.getEvent(eventName), evtConfig = event.getConfig(); if (evtConfig.handler != null && this[evtConfig.h...
[ "function", "(", ")", "{", "this", ".", "e", ".", "log", "&&", "this", ".", "e", ".", "log", "(", "\"Attaching default event's handlers...\"", ",", "'system'", ")", ";", "var", "events", "=", "this", ".", "getEvents", "(", ")", ";", "for", "(", "e", ...
Search for handlers and eventlisteners of all events of this component.
[ "Search", "for", "handlers", "and", "eventlisteners", "of", "all", "events", "of", "this", "component", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L367-L395
53,625
yeptlabs/wns
src/core/base/wnComponent.js
function (events) { var event = {}; for (e in events) { var ref=events[e], e = 'event-'+e.replace('-','.'); event[e]=ref; event[e].class=ref.class || 'wnEvent'; event[e].eventName = e.split('-').pop(); if (this.hasEvent(e)) { _.merge(event[e],this.getEvent(e)); } _ev...
javascript
function (events) { var event = {}; for (e in events) { var ref=events[e], e = 'event-'+e.replace('-','.'); event[e]=ref; event[e].class=ref.class || 'wnEvent'; event[e].eventName = e.split('-').pop(); if (this.hasEvent(e)) { _.merge(event[e],this.getEvent(e)); } _ev...
[ "function", "(", "events", ")", "{", "var", "event", "=", "{", "}", ";", "for", "(", "e", "in", "events", ")", "{", "var", "ref", "=", "events", "[", "e", "]", ",", "e", "=", "'event-'", "+", "e", ".", "replace", "(", "'-'", ",", "'.'", ")", ...
Set new properties to the respective events @param object $events events configurations @return this
[ "Set", "new", "properties", "to", "the", "respective", "events" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L402-L420
53,626
yeptlabs/wns
src/core/base/wnComponent.js
function (name,hidden) { var eventName = 'event-'+name; if (_events[eventName] != undefined) return _events[eventName]; else { if (!_eventsConfig[eventName] || !this.c) return false; var config = _eventsConfig[eventName] || {}, _class = config.class; config.id = eventName; c...
javascript
function (name,hidden) { var eventName = 'event-'+name; if (_events[eventName] != undefined) return _events[eventName]; else { if (!_eventsConfig[eventName] || !this.c) return false; var config = _eventsConfig[eventName] || {}, _class = config.class; config.id = eventName; c...
[ "function", "(", "name", ",", "hidden", ")", "{", "var", "eventName", "=", "'event-'", "+", "name", ";", "if", "(", "_events", "[", "eventName", "]", "!=", "undefined", ")", "return", "_events", "[", "eventName", "]", ";", "else", "{", "if", "(", "!"...
Get an event and create an alias to the push function. @param string $name eventName @param boolean $hidden ? @return wnEvent
[ "Get", "an", "event", "and", "create", "an", "alias", "to", "the", "push", "function", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L428-L458
53,627
yeptlabs/wns
src/core/base/wnComponent.js
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.addListener(handler)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id'...
javascript
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.addListener(handler)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id'...
[ "function", "(", "eventName", ",", "handler", ")", "{", "var", "event", ";", "if", "(", "event", "=", "this", ".", "getEvent", "(", "eventName", ")", ")", "{", "if", "(", "!", "event", ".", "addListener", "(", "handler", ")", ")", "this", ".", "e",...
Add a new listener to the event, if it exists @param string $eventName event name @param function $handler event handler @return this
[ "Add", "a", "new", "listener", "to", "the", "event", "if", "it", "exists" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L510-L519
53,628
yeptlabs/wns
src/core/base/wnComponent.js
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.prependListener(handler)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig(...
javascript
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.prependListener(handler)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig(...
[ "function", "(", "eventName", ",", "handler", ")", "{", "var", "event", ";", "if", "(", "event", "=", "this", ".", "getEvent", "(", "eventName", ")", ")", "{", "if", "(", "!", "event", ".", "prependListener", "(", "handler", ")", ")", "this", ".", ...
Prepend a new listener to the event, if it exists @param string $eventName event name @param function $handler event handler @return this
[ "Prepend", "a", "new", "listener", "to", "the", "event", "if", "it", "exists" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L527-L536
53,629
yeptlabs/wns
src/core/base/wnComponent.js
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.once(handler,true)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+...
javascript
function (eventName,handler) { var event; if (event = this.getEvent(eventName)) { if (!event.once(handler,true)) this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning'); } else this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+...
[ "function", "(", "eventName", ",", "handler", ")", "{", "var", "event", ";", "if", "(", "event", "=", "this", ".", "getEvent", "(", "eventName", ")", ")", "{", "if", "(", "!", "event", ".", "once", "(", "handler", ",", "true", ")", ")", "this", "...
Prepend a new one-time-listener to the event, if it exists @param string $eventName event name @param function $handler event handler @return this
[ "Prepend", "a", "new", "one", "-", "time", "-", "listener", "to", "the", "event", "if", "it", "exists" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L544-L553
53,630
yeptlabs/wns
src/core/base/wnComponent.js
function () { var _export = {}, merge = {}; _.merge(merge,this.getConfig()); _.merge(merge,this); var proto = this._proto.public; for (p in proto) if (!((typeof proto[p] == 'object' || typeof proto[p] == 'function') && proto[p] != null && proto[p].instanceOf!=undefined)) _export[p] = proto...
javascript
function () { var _export = {}, merge = {}; _.merge(merge,this.getConfig()); _.merge(merge,this); var proto = this._proto.public; for (p in proto) if (!((typeof proto[p] == 'object' || typeof proto[p] == 'function') && proto[p] != null && proto[p].instanceOf!=undefined)) _export[p] = proto...
[ "function", "(", ")", "{", "var", "_export", "=", "{", "}", ",", "merge", "=", "{", "}", ";", "_", ".", "merge", "(", "merge", ",", "this", ".", "getConfig", "(", ")", ")", ";", "_", ".", "merge", "(", "merge", ",", "this", ")", ";", "var", ...
Return an object with all attributes and configuration of this component @return object
[ "Return", "an", "object", "with", "all", "attributes", "and", "configuration", "of", "this", "component" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L559-L575
53,631
yeptlabs/wns
src/core/base/wnComponent.js
function (msg,verbosity) { if (!_debug || verbosity>_verbosity) return false; this.e.log.apply(this,[msg||'','debug',verbosity||0]); return self; }
javascript
function (msg,verbosity) { if (!_debug || verbosity>_verbosity) return false; this.e.log.apply(this,[msg||'','debug',verbosity||0]); return self; }
[ "function", "(", "msg", ",", "verbosity", ")", "{", "if", "(", "!", "_debug", "||", "verbosity", ">", "_verbosity", ")", "return", "false", ";", "this", ".", "e", ".", "log", ".", "apply", "(", "this", ",", "[", "msg", "||", "''", ",", "'debug'", ...
Component's debug log function @return self
[ "Component", "s", "debug", "log", "function" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L590-L596
53,632
yeptlabs/wns
src/core/base/wnComponent.js
function () { arguments[arguments.length+'']='info'; arguments.length++; this.e.log.apply(this,arguments); return self; }
javascript
function () { arguments[arguments.length+'']='info'; arguments.length++; this.e.log.apply(this,arguments); return self; }
[ "function", "(", ")", "{", "arguments", "[", "arguments", ".", "length", "+", "''", "]", "=", "'info'", ";", "arguments", ".", "length", "++", ";", "this", ".", "e", ".", "log", ".", "apply", "(", "this", ",", "arguments", ")", ";", "return", "self...
Component's info log function @return self
[ "Component", "s", "info", "log", "function" ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L602-L608
53,633
yeptlabs/wns
src/core/base/wnComponent.js
function (cmd,context,silent) { var ctx = (context!=undefined?context:this); try { return (function () { var result = eval(cmd); if (!silent) self.e.log&&self.e.log(util.inspect(result),'result'); return result; }.bind(ctx))(); } catch (e) { this.e.exception&&this.e.exc...
javascript
function (cmd,context,silent) { var ctx = (context!=undefined?context:this); try { return (function () { var result = eval(cmd); if (!silent) self.e.log&&self.e.log(util.inspect(result),'result'); return result; }.bind(ctx))(); } catch (e) { this.e.exception&&this.e.exc...
[ "function", "(", "cmd", ",", "context", ",", "silent", ")", "{", "var", "ctx", "=", "(", "context", "!=", "undefined", "?", "context", ":", "this", ")", ";", "try", "{", "return", "(", "function", "(", ")", "{", "var", "result", "=", "eval", "(", ...
Execute an expression in this component's context. @param string $cmd expression @param object $context forced context @param boolean $silent do not print result? @return this
[ "Execute", "an", "expression", "in", "this", "component", "s", "context", "." ]
c42602b062dcf6bbffc22e4365bba2cbf363fe2f
https://github.com/yeptlabs/wns/blob/c42602b062dcf6bbffc22e4365bba2cbf363fe2f/src/core/base/wnComponent.js#L673-L689
53,634
rkaw92/esdf
utils/loadAggregate.js
rehydrateAggregate
function rehydrateAggregate(ARObject){ return when.try(eventSink.rehydrate.bind(eventSink), ARObject, ARID, ARObject.getNextSequenceNumber()); }
javascript
function rehydrateAggregate(ARObject){ return when.try(eventSink.rehydrate.bind(eventSink), ARObject, ARID, ARObject.getNextSequenceNumber()); }
[ "function", "rehydrateAggregate", "(", "ARObject", ")", "{", "return", "when", ".", "try", "(", "eventSink", ".", "rehydrate", ".", "bind", "(", "eventSink", ")", ",", "ARObject", ",", "ARID", ",", "ARObject", ".", "getNextSequenceNumber", "(", ")", ")", "...
Rehydration. It will resolve the top-level promise for us, so that there is no need to call anything else to finish the loading.
[ "Rehydration", ".", "It", "will", "resolve", "the", "top", "-", "level", "promise", "for", "us", "so", "that", "there", "is", "no", "need", "to", "call", "anything", "else", "to", "finish", "the", "loading", "." ]
9c6bd2c278428096cb8c1ceeca62a5493d19613e
https://github.com/rkaw92/esdf/blob/9c6bd2c278428096cb8c1ceeca62a5493d19613e/utils/loadAggregate.js#L76-L78
53,635
karfcz/kff
src/CollectionBinder.js
function() { this.anchor = this.view.env.document.createTextNode(''); var el = this.view.element; if(el.parentNode) { el.parentNode.insertBefore(this.anchor, el.nextSibling); el.parentNode.removeChild(el); } this.boundViews = []; // Boundview options: this.boundViewName = this.view.element.get...
javascript
function() { this.anchor = this.view.env.document.createTextNode(''); var el = this.view.element; if(el.parentNode) { el.parentNode.insertBefore(this.anchor, el.nextSibling); el.parentNode.removeChild(el); } this.boundViews = []; // Boundview options: this.boundViewName = this.view.element.get...
[ "function", "(", ")", "{", "this", ".", "anchor", "=", "this", ".", "view", ".", "env", ".", "document", ".", "createTextNode", "(", "''", ")", ";", "var", "el", "=", "this", ".", "view", ".", "element", ";", "if", "(", "el", ".", "parentNode", "...
Renders "bound" views. This method generates DOM elements corresponding to each item in the bound collection and creates the bindingView for each element. If the collection changes, it reflects those changes automatically in real time. @private
[ "Renders", "bound", "views", ".", "This", "method", "generates", "DOM", "elements", "corresponding", "to", "each", "item", "in", "the", "bound", "collection", "and", "creates", "the", "bindingView", "for", "each", "element", ".", "If", "the", "collection", "ch...
533b69e8bc9e9b7f60b403d776678bf1c06ac502
https://github.com/karfcz/kff/blob/533b69e8bc9e9b7f60b403d776678bf1c06ac502/src/CollectionBinder.js#L37-L60
53,636
karfcz/kff
src/CollectionBinder.js
function() { var boundView, i, l; // Destroy boundviews if(this.boundViews !== null) { for(i = 0, l = this.boundViews.length; i < l; i++) { boundView = this.boundViews[i]; boundView.destroyAll(); if(boundView.element && boundView.element.parentNode) boundView.element.parentNode.removeChild(b...
javascript
function() { var boundView, i, l; // Destroy boundviews if(this.boundViews !== null) { for(i = 0, l = this.boundViews.length; i < l; i++) { boundView = this.boundViews[i]; boundView.destroyAll(); if(boundView.element && boundView.element.parentNode) boundView.element.parentNode.removeChild(b...
[ "function", "(", ")", "{", "var", "boundView", ",", "i", ",", "l", ";", "// Destroy boundviews", "if", "(", "this", ".", "boundViews", "!==", "null", ")", "{", "for", "(", "i", "=", "0", ",", "l", "=", "this", ".", "boundViews", ".", "length", ";",...
Destroys previously bound views. @private
[ "Destroys", "previously", "bound", "views", "." ]
533b69e8bc9e9b7f60b403d776678bf1c06ac502
https://github.com/karfcz/kff/blob/533b69e8bc9e9b7f60b403d776678bf1c06ac502/src/CollectionBinder.js#L67-L102
53,637
karfcz/kff
src/CollectionBinder.js
function(from, to) { if(!from) from = 0; if(!to || to > this.boundViews.length) to = this.boundViews.length; // Reindex subsequent boundviews: for(var i = from; i < to; i++) { this.boundViews[i].setBindingIndex(i); this.boundViews[i].refreshBinders(true); } }
javascript
function(from, to) { if(!from) from = 0; if(!to || to > this.boundViews.length) to = this.boundViews.length; // Reindex subsequent boundviews: for(var i = from; i < to; i++) { this.boundViews[i].setBindingIndex(i); this.boundViews[i].refreshBinders(true); } }
[ "function", "(", "from", ",", "to", ")", "{", "if", "(", "!", "from", ")", "from", "=", "0", ";", "if", "(", "!", "to", "||", "to", ">", "this", ".", "boundViews", ".", "length", ")", "to", "=", "this", ".", "boundViews", ".", "length", ";", ...
Refreshes view indices when the collection changes @private @param {nubmer} from Render index at which reindexing starts @param {number} to Render index at which reindexing ends
[ "Refreshes", "view", "indices", "when", "the", "collection", "changes" ]
533b69e8bc9e9b7f60b403d776678bf1c06ac502
https://github.com/karfcz/kff/blob/533b69e8bc9e9b7f60b403d776678bf1c06ac502/src/CollectionBinder.js#L330-L341
53,638
karfcz/kff
src/CollectionBinder.js
function(item) { var boundView, element, i; if(!this.viewTemplate) { element = this.view.element.cloneNode(true); this.boundViewOptions.element = element; boundView = new this.view.constructor(this.boundViewOptions); boundView._collectionBinder = null; boundView._modelBindersMap = this.view._m...
javascript
function(item) { var boundView, element, i; if(!this.viewTemplate) { element = this.view.element.cloneNode(true); this.boundViewOptions.element = element; boundView = new this.view.constructor(this.boundViewOptions); boundView._collectionBinder = null; boundView._modelBindersMap = this.view._m...
[ "function", "(", "item", ")", "{", "var", "boundView", ",", "element", ",", "i", ";", "if", "(", "!", "this", ".", "viewTemplate", ")", "{", "element", "=", "this", ".", "view", ".", "element", ".", "cloneNode", "(", "true", ")", ";", "this", ".", ...
Creates a new bound view for item in collection @private @param {Object} item Item for data-binding @param {number} i Binding index @return {View} created view
[ "Creates", "a", "new", "bound", "view", "for", "item", "in", "collection" ]
533b69e8bc9e9b7f60b403d776678bf1c06ac502
https://github.com/karfcz/kff/blob/533b69e8bc9e9b7f60b403d776678bf1c06ac502/src/CollectionBinder.js#L351-L401
53,639
zerkalica/hyper-config
lib/hyper-config.js
normalize
function normalize(acc, val) { if (typeof val === 'string') { var value = val.trim().replace(acc.refIgnoreRegExp, REF_MAGIC); if (value.indexOf(acc.refLabel) === 0 && value.indexOf(acc.refLabel + acc.macroBegin) === -1) { value = value.substring(acc.refLabel.length); this.update(acc.get(value)); } else if ...
javascript
function normalize(acc, val) { if (typeof val === 'string') { var value = val.trim().replace(acc.refIgnoreRegExp, REF_MAGIC); if (value.indexOf(acc.refLabel) === 0 && value.indexOf(acc.refLabel + acc.macroBegin) === -1) { value = value.substring(acc.refLabel.length); this.update(acc.get(value)); } else if ...
[ "function", "normalize", "(", "acc", ",", "val", ")", "{", "if", "(", "typeof", "val", "===", "'string'", ")", "{", "var", "value", "=", "val", ".", "trim", "(", ")", ".", "replace", "(", "acc", ".", "refIgnoreRegExp", ",", "REF_MAGIC", ")", ";", "...
Normalize config value @param {object} acc reduce acc @param {any} val config value @return {object} reduce acc
[ "Normalize", "config", "value" ]
ae21220ece60b644b720c3469c63ab144576f1f6
https://github.com/zerkalica/hyper-config/blob/ae21220ece60b644b720c3469c63ab144576f1f6/lib/hyper-config.js#L47-L71
53,640
zerkalica/hyper-config
lib/hyper-config.js
HyperConfig
function HyperConfig(options) { this.name = 'HyperConfig'; if (!(this instanceof HyperConfig)) { return new HyperConfig(options); } options = options || {}; this._refLabel = options.refLabel || '~'; this._annotationLabel = options.annotationLabel || '@'; this._macroBegin = options.macroBegin || '{'; this._mac...
javascript
function HyperConfig(options) { this.name = 'HyperConfig'; if (!(this instanceof HyperConfig)) { return new HyperConfig(options); } options = options || {}; this._refLabel = options.refLabel || '~'; this._annotationLabel = options.annotationLabel || '@'; this._macroBegin = options.macroBegin || '{'; this._mac...
[ "function", "HyperConfig", "(", "options", ")", "{", "this", ".", "name", "=", "'HyperConfig'", ";", "if", "(", "!", "(", "this", "instanceof", "HyperConfig", ")", ")", "{", "return", "new", "HyperConfig", "(", "options", ")", ";", "}", "options", "=", ...
Hyper config builder @param {object} options Options @param {string} options.refLabel '~' @param {string} options.annotationLabel & @param {string} options.macroBegin { @param {string} options.macroEnd }
[ "Hyper", "config", "builder" ]
ae21220ece60b644b720c3469c63ab144576f1f6
https://github.com/zerkalica/hyper-config/blob/ae21220ece60b644b720c3469c63ab144576f1f6/lib/hyper-config.js#L106-L121
53,641
boylesoftware/x2node-validators
lib/standard.js
isEmpty
function isEmpty(ptr, propDesc, value) { if ((value === undefined) || (value === null)) return true; if (propDesc.isArray() && !ptr.collectionElement && Array.isArray(value)) { if (value.length === 0) return true; } else if (propDesc.isMap() && !ptr.collectionElement && ((typeof value) === 'object')) { ...
javascript
function isEmpty(ptr, propDesc, value) { if ((value === undefined) || (value === null)) return true; if (propDesc.isArray() && !ptr.collectionElement && Array.isArray(value)) { if (value.length === 0) return true; } else if (propDesc.isMap() && !ptr.collectionElement && ((typeof value) === 'object')) { ...
[ "function", "isEmpty", "(", "ptr", ",", "propDesc", ",", "value", ")", "{", "if", "(", "(", "value", "===", "undefined", ")", "||", "(", "value", "===", "null", ")", ")", "return", "true", ";", "if", "(", "propDesc", ".", "isArray", "(", ")", "&&",...
Tell if the specified property value can be considered empty. @private @param {module:x2node-pointers~RecordElementPointer} ptr Property pointer. @param {module:x2node-records~PropertyDescriptor} propDesc Property descriptor. @param {*} value Property value to test. @returns {boolean} <code>true</code> if empty.
[ "Tell", "if", "the", "specified", "property", "value", "can", "be", "considered", "empty", "." ]
e98a65c13a4092f80e96517c8e8c9523f8e84c63
https://github.com/boylesoftware/x2node-validators/blob/e98a65c13a4092f80e96517c8e8c9523f8e84c63/lib/standard.js#L156-L176
53,642
boylesoftware/x2node-validators
lib/standard.js
hasMatchingSibling
function hasMatchingSibling(ctx, propName, testValue, whenErrors) { const containerDesc = ctx.currentPropDesc.container; const propDesc = containerDesc.getPropertyDesc(propName); let propPtr; if (containerDesc.parentContainer && containerDesc.parentContainer.isPolymorphObject()) { const pathParts = containerD...
javascript
function hasMatchingSibling(ctx, propName, testValue, whenErrors) { const containerDesc = ctx.currentPropDesc.container; const propDesc = containerDesc.getPropertyDesc(propName); let propPtr; if (containerDesc.parentContainer && containerDesc.parentContainer.isPolymorphObject()) { const pathParts = containerD...
[ "function", "hasMatchingSibling", "(", "ctx", ",", "propName", ",", "testValue", ",", "whenErrors", ")", "{", "const", "containerDesc", "=", "ctx", ".", "currentPropDesc", ".", "container", ";", "const", "propDesc", "=", "containerDesc", ".", "getPropertyDesc", ...
Tell if the specified context container has specified property and it optionally matches the specified test value. @private @param {module:x2node-validators~ValidationContext} ctx Current validation context. @param {string} propName Sibling property name. @param {(*|RegExp)} [testValue] Test value. @param {boolean} wh...
[ "Tell", "if", "the", "specified", "context", "container", "has", "specified", "property", "and", "it", "optionally", "matches", "the", "specified", "test", "value", "." ]
e98a65c13a4092f80e96517c8e8c9523f8e84c63
https://github.com/boylesoftware/x2node-validators/blob/e98a65c13a4092f80e96517c8e8c9523f8e84c63/lib/standard.js#L191-L221
53,643
boylesoftware/x2node-validators
lib/standard.js
addDepsError
function addDepsError(ctx, type, propName, testValue) { let depsErrors = ctx[DEPS_ERRORS]; if (!depsErrors) depsErrors = ctx[DEPS_ERRORS] = {}; const curPtrStr = ctx.currentPointer.toString(); if (depsErrors[curPtrStr]) return; depsErrors[curPtrStr] = true; const hasTestValue = (testValue !== undefined); ...
javascript
function addDepsError(ctx, type, propName, testValue) { let depsErrors = ctx[DEPS_ERRORS]; if (!depsErrors) depsErrors = ctx[DEPS_ERRORS] = {}; const curPtrStr = ctx.currentPointer.toString(); if (depsErrors[curPtrStr]) return; depsErrors[curPtrStr] = true; const hasTestValue = (testValue !== undefined); ...
[ "function", "addDepsError", "(", "ctx", ",", "type", ",", "propName", ",", "testValue", ")", "{", "let", "depsErrors", "=", "ctx", "[", "DEPS_ERRORS", "]", ";", "if", "(", "!", "depsErrors", ")", "depsErrors", "=", "ctx", "[", "DEPS_ERRORS", "]", "=", ...
Add dependecy validator error to the context if no dependency validator errors already added for the current property. @private @param {module:x2node-validators~ValidationContext} ctx Current validation context. @param {string} type Validator type. @param {string} propName Dependency property name. @param {(*|RegExp)}...
[ "Add", "dependecy", "validator", "error", "to", "the", "context", "if", "no", "dependency", "validator", "errors", "already", "added", "for", "the", "current", "property", "." ]
e98a65c13a4092f80e96517c8e8c9523f8e84c63
https://github.com/boylesoftware/x2node-validators/blob/e98a65c13a4092f80e96517c8e8c9523f8e84c63/lib/standard.js#L242-L267
53,644
glennschler/spotspec
lib/credentials.js
Credentials
function Credentials (options) { EventEmitter.call(this) options.keys.apiVersion = 'latest' options.keys.sslEnabled = true if (options.hasOwnProperty('upgrade')) { // Update with the MFA token passed in with the credentials this.upgrade(options) return } let awsConfig = Object.assign({}, opti...
javascript
function Credentials (options) { EventEmitter.call(this) options.keys.apiVersion = 'latest' options.keys.sslEnabled = true if (options.hasOwnProperty('upgrade')) { // Update with the MFA token passed in with the credentials this.upgrade(options) return } let awsConfig = Object.assign({}, opti...
[ "function", "Credentials", "(", "options", ")", "{", "EventEmitter", ".", "call", "(", "this", ")", "options", ".", "keys", ".", "apiVersion", "=", "'latest'", "options", ".", "keys", ".", "sslEnabled", "=", "true", "if", "(", "options", ".", "hasOwnProper...
Credentials - Create MFA short term credentials @constructor @arg {object} options - The AWS service IAM credentials @arg {object} options.keys - Credentials for the service API authentication. See [aws docs]{@link http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html} @arg {string} options.keys.acces...
[ "Credentials", "-", "Create", "MFA", "short", "term", "credentials" ]
ca6f5b17b84b3536b6b2ce9a472d5ae91c8cd727
https://github.com/glennschler/spotspec/blob/ca6f5b17b84b3536b6b2ce9a472d5ae91c8cd727/lib/credentials.js#L53-L72
53,645
dpjanes/iotdb-upnp
upnp/upnp-device.js
function (controlPoint, uuid, location, desc, localAddress) { EventEmitter.call(this); if (TRACE) { logger.info({ method: "UpnpDevice", uuid: uuid, }, "new device object"); } this.controlPoint = controlPoint; this.uuid = uuid; this.udn = desc.UDN[0]; ...
javascript
function (controlPoint, uuid, location, desc, localAddress) { EventEmitter.call(this); if (TRACE) { logger.info({ method: "UpnpDevice", uuid: uuid, }, "new device object"); } this.controlPoint = controlPoint; this.uuid = uuid; this.udn = desc.UDN[0]; ...
[ "function", "(", "controlPoint", ",", "uuid", ",", "location", ",", "desc", ",", "localAddress", ")", "{", "EventEmitter", ".", "call", "(", "this", ")", ";", "if", "(", "TRACE", ")", "{", "logger", ".", "info", "(", "{", "method", ":", "\"UpnpDevice\"...
A UPnP WeMo Controllee. Includes socket switch.
[ "A", "UPnP", "WeMo", "Controllee", ".", "Includes", "socket", "switch", "." ]
514d6253eca4c6440105e48aa940a07778187e43
https://github.com/dpjanes/iotdb-upnp/blob/514d6253eca4c6440105e48aa940a07778187e43/upnp/upnp-device.js#L25-L91
53,646
iolo/express-toybox
utils.js
extendHttpRequest
function extendHttpRequest(req) { req = req || express.request; /** * get param value from path-variable or query or body or headers. * @param {string} paramName * @param {*} [fallback] * @returns {*} */ req.anyParam = function (paramName, fallback) { return (this.params &&...
javascript
function extendHttpRequest(req) { req = req || express.request; /** * get param value from path-variable or query or body or headers. * @param {string} paramName * @param {*} [fallback] * @returns {*} */ req.anyParam = function (paramName, fallback) { return (this.params &&...
[ "function", "extendHttpRequest", "(", "req", ")", "{", "req", "=", "req", "||", "express", ".", "request", ";", "/**\n * get param value from path-variable or query or body or headers.\n * @param {string} paramName\n * @param {*} [fallback]\n * @returns {*}\n */", "...
add some utility methods to http request. @param {*} [req]
[ "add", "some", "utility", "methods", "to", "http", "request", "." ]
c375a1388cfc167017e8dcd2325e71ca86ccb994
https://github.com/iolo/express-toybox/blob/c375a1388cfc167017e8dcd2325e71ca86ccb994/utils.js#L151-L284
53,647
iolo/express-toybox
utils.js
extendHttpResponse
function extendHttpResponse(res) { res = res || express.response; function callbackFnFn(verbFunc) { return function (next, status) { var res = this; return function (err, result) { if (err) { return next(err); } ...
javascript
function extendHttpResponse(res) { res = res || express.response; function callbackFnFn(verbFunc) { return function (next, status) { var res = this; return function (err, result) { if (err) { return next(err); } ...
[ "function", "extendHttpResponse", "(", "res", ")", "{", "res", "=", "res", "||", "express", ".", "response", ";", "function", "callbackFnFn", "(", "verbFunc", ")", "{", "return", "function", "(", "next", ",", "status", ")", "{", "var", "res", "=", "this"...
add some utility methods to http response. @param {*} [res]
[ "add", "some", "utility", "methods", "to", "http", "response", "." ]
c375a1388cfc167017e8dcd2325e71ca86ccb994
https://github.com/iolo/express-toybox/blob/c375a1388cfc167017e8dcd2325e71ca86ccb994/utils.js#L291-L502
53,648
karfcz/kff
src/functions/delegatedEventHandler.js
matches
function matches(el, target, selector) { var elements = el.querySelectorAll(selector); return arrayIndexOf(elements, target) !== -1; }
javascript
function matches(el, target, selector) { var elements = el.querySelectorAll(selector); return arrayIndexOf(elements, target) !== -1; }
[ "function", "matches", "(", "el", ",", "target", ",", "selector", ")", "{", "var", "elements", "=", "el", ".", "querySelectorAll", "(", "selector", ")", ";", "return", "arrayIndexOf", "(", "elements", ",", "target", ")", "!==", "-", "1", ";", "}" ]
Matches target element against CSS selector starting from element el @param {DOMElement} el Root DOM element @param {DOMElement} target Target DOM element @param {string} selector CSS selector @return {boolean} True if target element matches CSS selector, false otherwise
[ "Matches", "target", "element", "against", "CSS", "selector", "starting", "from", "element", "el" ]
533b69e8bc9e9b7f60b403d776678bf1c06ac502
https://github.com/karfcz/kff/blob/533b69e8bc9e9b7f60b403d776678bf1c06ac502/src/functions/delegatedEventHandler.js#L21-L25
53,649
mvrilo/tumblrrr
lib/tumblrrr.js
tumblr
function tumblr(hostname, key, secret, access_key, access_secret) { if (!(this instanceof tumblr)) return new tumblr(hostname, key, secret, access_key, access_secret); var obj = (typeof hostname !== 'object') ? { hostname : hostname, secret : secret, key : key, access_secret : access_secret, ac...
javascript
function tumblr(hostname, key, secret, access_key, access_secret) { if (!(this instanceof tumblr)) return new tumblr(hostname, key, secret, access_key, access_secret); var obj = (typeof hostname !== 'object') ? { hostname : hostname, secret : secret, key : key, access_secret : access_secret, ac...
[ "function", "tumblr", "(", "hostname", ",", "key", ",", "secret", ",", "access_key", ",", "access_secret", ")", "{", "if", "(", "!", "(", "this", "instanceof", "tumblr", ")", ")", "return", "new", "tumblr", "(", "hostname", ",", "key", ",", "secret", "...
first argument can be string or object
[ "first", "argument", "can", "be", "string", "or", "object" ]
509690be73555cd232861e82506cd8bf6f9e9a91
https://github.com/mvrilo/tumblrrr/blob/509690be73555cd232861e82506cd8bf6f9e9a91/lib/tumblrrr.js#L25-L80
53,650
azendal/argon
argon/storage/local.js
create
function create(requestObj, callback) { var storage = this; callback = callback || function defaultPostCallback() { //setup Error Notification here }; if ((typeof requestObj) === 'undefined' || requestObj === null) { ...
javascript
function create(requestObj, callback) { var storage = this; callback = callback || function defaultPostCallback() { //setup Error Notification here }; if ((typeof requestObj) === 'undefined' || requestObj === null) { ...
[ "function", "create", "(", "requestObj", ",", "callback", ")", "{", "var", "storage", "=", "this", ";", "callback", "=", "callback", "||", "function", "defaultPostCallback", "(", ")", "{", "//setup Error Notification here", "}", ";", "if", "(", "(", "typeof", ...
Creates new data on the storage instance @method post <public> @argument data <required> [Object] the data to create on the storage instance @argument callback [Function] The function that will be executed when the process ends @return [Array]
[ "Creates", "new", "data", "on", "the", "storage", "instance" ]
0cfd3a3b3731b69abca55c956c757476779ec1bd
https://github.com/azendal/argon/blob/0cfd3a3b3731b69abca55c956c757476779ec1bd/argon/storage/local.js#L127-L155
53,651
azendal/argon
argon/storage/local.js
find
function find(requestObj, callback) { var found, storedData, property; var storage = this; callback = callback || function defaultGetCallback() { //nothing here maybe put error notification }; for (i = 0; i < storage.preproces...
javascript
function find(requestObj, callback) { var found, storedData, property; var storage = this; callback = callback || function defaultGetCallback() { //nothing here maybe put error notification }; for (i = 0; i < storage.preproces...
[ "function", "find", "(", "requestObj", ",", "callback", ")", "{", "var", "found", ",", "storedData", ",", "property", ";", "var", "storage", "=", "this", ";", "callback", "=", "callback", "||", "function", "defaultGetCallback", "(", ")", "{", "//nothing here...
Retrieves a set of data on the storage instance @method get <public> @argument query <required> [Object] the query to the elements that must be updated @argument callback [Function] The function that will be executed when the process ends @return [Array]
[ "Retrieves", "a", "set", "of", "data", "on", "the", "storage", "instance" ]
0cfd3a3b3731b69abca55c956c757476779ec1bd
https://github.com/azendal/argon/blob/0cfd3a3b3731b69abca55c956c757476779ec1bd/argon/storage/local.js#L164-L197
53,652
azendal/argon
argon/storage/local.js
update
function update(requestObj, callback) { var storage = this; callback = callback || function defaultPutCallBack() { //setup Error notification }; if ((typeof requestObj) === 'undefined' || requestObj === null) { callb...
javascript
function update(requestObj, callback) { var storage = this; callback = callback || function defaultPutCallBack() { //setup Error notification }; if ((typeof requestObj) === 'undefined' || requestObj === null) { callb...
[ "function", "update", "(", "requestObj", ",", "callback", ")", "{", "var", "storage", "=", "this", ";", "callback", "=", "callback", "||", "function", "defaultPutCallBack", "(", ")", "{", "//setup Error notification", "}", ";", "if", "(", "(", "typeof", "req...
Updates a set of data on the storage instance @method put <public> @argument query <required> [Object] the query to the elements that must be updated @argument callback [Function] The function that will be executed when the process ends @return [Object] this
[ "Updates", "a", "set", "of", "data", "on", "the", "storage", "instance" ]
0cfd3a3b3731b69abca55c956c757476779ec1bd
https://github.com/azendal/argon/blob/0cfd3a3b3731b69abca55c956c757476779ec1bd/argon/storage/local.js#L234-L259
53,653
azendal/argon
argon/storage/local.js
remove
function remove(requestObj, callback) { var storageInstance = this; var storage = this; callback = callback || function defaultRemoveCallBack() { //setup Error Notification }; if ((typeof requestObj) === 'undefined' ||...
javascript
function remove(requestObj, callback) { var storageInstance = this; var storage = this; callback = callback || function defaultRemoveCallBack() { //setup Error Notification }; if ((typeof requestObj) === 'undefined' ||...
[ "function", "remove", "(", "requestObj", ",", "callback", ")", "{", "var", "storageInstance", "=", "this", ";", "var", "storage", "=", "this", ";", "callback", "=", "callback", "||", "function", "defaultRemoveCallBack", "(", ")", "{", "//setup Error Notification...
Removes a set of elements from the storage @method remove <public> @argument query <required> [Object] the query to the elements that must be removed @argument callback [Function] The function that will be executed when the process ends @return [Object] this
[ "Removes", "a", "set", "of", "elements", "from", "the", "storage" ]
0cfd3a3b3731b69abca55c956c757476779ec1bd
https://github.com/azendal/argon/blob/0cfd3a3b3731b69abca55c956c757476779ec1bd/argon/storage/local.js#L268-L294
53,654
jetiny/rollup-standalone
lib/rollup-cli.js
log
function log ( object, symbol ) { var message = (object.plugin ? ("(" + (object.plugin) + " plugin) " + (object.message)) : object.message) || object; stderr( ("" + symbol + (index$3.bold( message ))) ); if ( object.url ) { stderr( index$3.cyan( object.url ) ); } if ( object.loc ) { stderr( ((relativeId( ob...
javascript
function log ( object, symbol ) { var message = (object.plugin ? ("(" + (object.plugin) + " plugin) " + (object.message)) : object.message) || object; stderr( ("" + symbol + (index$3.bold( message ))) ); if ( object.url ) { stderr( index$3.cyan( object.url ) ); } if ( object.loc ) { stderr( ((relativeId( ob...
[ "function", "log", "(", "object", ",", "symbol", ")", "{", "var", "message", "=", "(", "object", ".", "plugin", "?", "(", "\"(\"", "+", "(", "object", ".", "plugin", ")", "+", "\" plugin) \"", "+", "(", "object", ".", "message", ")", ")", ":", "obj...
eslint-disable-line no-console
[ "eslint", "-", "disable", "-", "line", "no", "-", "console" ]
949d30c702b666a1a6b92e353b3a70c2e8290a66
https://github.com/jetiny/rollup-standalone/blob/949d30c702b666a1a6b92e353b3a70c2e8290a66/lib/rollup-cli.js#L568-L588
53,655
carrascoMDD/protractor-relaunchable
lib/configParser.js
function(into, from) { for (var key in from) { if (into[key] instanceof Object && !(into[key] instanceof Array) && !(into[key] instanceof Function)) { merge_(into[key], from[key]); } else { into[key] = from[key]; } } return into; }
javascript
function(into, from) { for (var key in from) { if (into[key] instanceof Object && !(into[key] instanceof Array) && !(into[key] instanceof Function)) { merge_(into[key], from[key]); } else { into[key] = from[key]; } } return into; }
[ "function", "(", "into", ",", "from", ")", "{", "for", "(", "var", "key", "in", "from", ")", "{", "if", "(", "into", "[", "key", "]", "instanceof", "Object", "&&", "!", "(", "into", "[", "key", "]", "instanceof", "Array", ")", "&&", "!", "(", "...
Merge config objects together. @private @param {Object} into @param {Object} from @return {Object} The 'into' config.
[ "Merge", "config", "objects", "together", "." ]
c18e17ecd8b5b036217f87680800c6e14b47361f
https://github.com/carrascoMDD/protractor-relaunchable/blob/c18e17ecd8b5b036217f87680800c6e14b47361f/lib/configParser.js#L58-L69
53,656
thiagodp/split-cmd
index.js
split
function split( command ) { if ( typeof command !== 'string' ) { throw new Error( 'Command must be a string' ); } var r = command.match( /[^"\s]+|"(?:\\"|[^"])*"/g ); if ( ! r ) { return []; } return r.map( function ( expr ) { var isQuoted = expr.charAt( 0 ) === '"' && ...
javascript
function split( command ) { if ( typeof command !== 'string' ) { throw new Error( 'Command must be a string' ); } var r = command.match( /[^"\s]+|"(?:\\"|[^"])*"/g ); if ( ! r ) { return []; } return r.map( function ( expr ) { var isQuoted = expr.charAt( 0 ) === '"' && ...
[ "function", "split", "(", "command", ")", "{", "if", "(", "typeof", "command", "!==", "'string'", ")", "{", "throw", "new", "Error", "(", "'Command must be a string'", ")", ";", "}", "var", "r", "=", "command", ".", "match", "(", "/", "[^\"\\s]+|\"(?:\\\\\...
Split a command into an array. @example ```js var arr = split( 'git commit -m "some message with spaces"' ); console.log( arr ); // [ "git", "commit", "-m", "some message with spaces" ] ``` @param {string} command Command to split. @returns {Array}
[ "Split", "a", "command", "into", "an", "array", "." ]
6574da1c7d0f4d216d9d5897794fc14397ae41be
https://github.com/thiagodp/split-cmd/blob/6574da1c7d0f4d216d9d5897794fc14397ae41be/index.js#L13-L27
53,657
thiagodp/split-cmd
index.js
splitToObject
function splitToObject( command ) { var cmds = split( command ); switch( cmds.length ) { case 0: return {}; case 1: return { command: cmds[ 0 ] }; default: { var first = cmds[ 0 ]; cmds.shift(); return { command: first, args: cmds }; } } }
javascript
function splitToObject( command ) { var cmds = split( command ); switch( cmds.length ) { case 0: return {}; case 1: return { command: cmds[ 0 ] }; default: { var first = cmds[ 0 ]; cmds.shift(); return { command: first, args: cmds }; } } }
[ "function", "splitToObject", "(", "command", ")", "{", "var", "cmds", "=", "split", "(", "command", ")", ";", "switch", "(", "cmds", ".", "length", ")", "{", "case", "0", ":", "return", "{", "}", ";", "case", "1", ":", "return", "{", "command", ":"...
Split a command into an object with the attributes `command` and `args`. @example ```js var obj = splitToObject( 'git commit -m "some message with spaces"' ); console.log( obj.command ); // git console.log( obj.args ); // [ "commit", "-m", "some message with spaces" ] ``` @param {string} command Command to split. @re...
[ "Split", "a", "command", "into", "an", "object", "with", "the", "attributes", "command", "and", "args", "." ]
6574da1c7d0f4d216d9d5897794fc14397ae41be
https://github.com/thiagodp/split-cmd/blob/6574da1c7d0f4d216d9d5897794fc14397ae41be/index.js#L42-L53
53,658
layerhq/node-layer-webhooks
lib/webhooks.js
function(params, callback) { if (!params.url) return (callback || function() {})(new Error(utils.i18n.webhooks.url)); if (!params.events || !params.events.length) return (callback || function() {})(new Error(utils.i18n.webhooks.events)); if (!params.secret) return (callback || function() {})(new Err...
javascript
function(params, callback) { if (!params.url) return (callback || function() {})(new Error(utils.i18n.webhooks.url)); if (!params.events || !params.events.length) return (callback || function() {})(new Error(utils.i18n.webhooks.events)); if (!params.secret) return (callback || function() {})(new Err...
[ "function", "(", "params", ",", "callback", ")", "{", "if", "(", "!", "params", ".", "url", ")", "return", "(", "callback", "||", "function", "(", ")", "{", "}", ")", "(", "new", "Error", "(", "utils", ".", "i18n", ".", "webhooks", ".", "url", ")...
Register a Webhook @param {Object} params @param {String[]} params.events Array of event names to subscribe to @param {String} params.url URL for webhook events to go to @param {String} params.secret Unique string known only to your server for validating webhook events @param {Obje...
[ "Register", "a", "Webhook" ]
9bfbee048c03d3ba4474a3490085626cd8a7a0df
https://github.com/layerhq/node-layer-webhooks/blob/9bfbee048c03d3ba4474a3490085626cd8a7a0df/lib/webhooks.js#L22-L41
53,659
layerhq/node-layer-webhooks
lib/webhooks.js
function(webhookId, callback) { utils.debug('Webhooks disable: ' + webhookId); request.post({ path: '/webhooks/' + utils.toUUID(webhookId) + '/deactivate', }, callback || utils.nop); }
javascript
function(webhookId, callback) { utils.debug('Webhooks disable: ' + webhookId); request.post({ path: '/webhooks/' + utils.toUUID(webhookId) + '/deactivate', }, callback || utils.nop); }
[ "function", "(", "webhookId", ",", "callback", ")", "{", "utils", ".", "debug", "(", "'Webhooks disable: '", "+", "webhookId", ")", ";", "request", ".", "post", "(", "{", "path", ":", "'/webhooks/'", "+", "utils", ".", "toUUID", "(", "webhookId", ")", "+...
Disable a webhook @param {String} webhookId @param {Function} callback Callback function
[ "Disable", "a", "webhook" ]
9bfbee048c03d3ba4474a3490085626cd8a7a0df
https://github.com/layerhq/node-layer-webhooks/blob/9bfbee048c03d3ba4474a3490085626cd8a7a0df/lib/webhooks.js#L49-L54
53,660
layerhq/node-layer-webhooks
lib/webhooks.js
function(webhookId, callback) { utils.debug('Webhooks get: ' + webhookId); request.get({ path: '/webhooks/' + utils.toUUID(webhookId), }, callback); }
javascript
function(webhookId, callback) { utils.debug('Webhooks get: ' + webhookId); request.get({ path: '/webhooks/' + utils.toUUID(webhookId), }, callback); }
[ "function", "(", "webhookId", ",", "callback", ")", "{", "utils", ".", "debug", "(", "'Webhooks get: '", "+", "webhookId", ")", ";", "request", ".", "get", "(", "{", "path", ":", "'/webhooks/'", "+", "utils", ".", "toUUID", "(", "webhookId", ")", ",", ...
Get a webhook @param {String} webhookId @param {Function} callback Callback function
[ "Get", "a", "webhook" ]
9bfbee048c03d3ba4474a3490085626cd8a7a0df
https://github.com/layerhq/node-layer-webhooks/blob/9bfbee048c03d3ba4474a3490085626cd8a7a0df/lib/webhooks.js#L101-L106
53,661
SolarNetwork/solarnetwork-d3
src/chart/baseGroupedStackTimeBarChart.js
xBarPadding
function xBarPadding() { var domain = xBar.domain(); var barSpacing = (domain.length > 1 ? (xBar(domain[1]) - xBar(domain[0])) : xBar.rangeBand()); var barPadding = (barSpacing - xBar.rangeBand()); return barPadding; }
javascript
function xBarPadding() { var domain = xBar.domain(); var barSpacing = (domain.length > 1 ? (xBar(domain[1]) - xBar(domain[0])) : xBar.rangeBand()); var barPadding = (barSpacing - xBar.rangeBand()); return barPadding; }
[ "function", "xBarPadding", "(", ")", "{", "var", "domain", "=", "xBar", ".", "domain", "(", ")", ";", "var", "barSpacing", "=", "(", "domain", ".", "length", ">", "1", "?", "(", "xBar", "(", "domain", "[", "1", "]", ")", "-", "xBar", "(", "domain...
Get the number of pixels used for padding between bars. @returns {Number} the number of pixels padding between each bar
[ "Get", "the", "number", "of", "pixels", "used", "for", "padding", "between", "bars", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/chart/baseGroupedStackTimeBarChart.js#L146-L153
53,662
SolarNetwork/solarnetwork-d3
src/chart/baseGroupedStackTimeBarChart.js
trimToXDomain
function trimToXDomain(array) { var start = 0, len = array.length, xDomainStart = parent.x.domain()[0]; // remove any data earlier than first full range while ( start < len ) { if ( array[start].date.getTime() >= xDomainStart.getTime() ) { break; } start += 1; } return (start === 0 ? arr...
javascript
function trimToXDomain(array) { var start = 0, len = array.length, xDomainStart = parent.x.domain()[0]; // remove any data earlier than first full range while ( start < len ) { if ( array[start].date.getTime() >= xDomainStart.getTime() ) { break; } start += 1; } return (start === 0 ? arr...
[ "function", "trimToXDomain", "(", "array", ")", "{", "var", "start", "=", "0", ",", "len", "=", "array", ".", "length", ",", "xDomainStart", "=", "parent", ".", "x", ".", "domain", "(", ")", "[", "0", "]", ";", "// remove any data earlier than first full r...
Remove data self falls outside the X domain. @param {Array} array The array to inspect. @returns {Array} Either a copy of the array with some elements removed, or the original array if nothing needed to be removed.
[ "Remove", "data", "self", "falls", "outside", "the", "X", "domain", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/chart/baseGroupedStackTimeBarChart.js#L162-L175
53,663
SolarNetwork/solarnetwork-d3
src/chart/baseGroupedStackTimeBarChart.js
drawHoverHighlightBars
function drawHoverHighlightBars(dataArray) { var hoverBar = parent.svgHoverRoot.selectAll('rect.highlightbar').data(dataArray); hoverBar.attr('x', valueX) .attr('width', xBar.rangeBand()); hoverBar.enter().append('rect') .attr('x', valueX) .attr('y', 0) .attr('height', parent.height) .attr('wi...
javascript
function drawHoverHighlightBars(dataArray) { var hoverBar = parent.svgHoverRoot.selectAll('rect.highlightbar').data(dataArray); hoverBar.attr('x', valueX) .attr('width', xBar.rangeBand()); hoverBar.enter().append('rect') .attr('x', valueX) .attr('y', 0) .attr('height', parent.height) .attr('wi...
[ "function", "drawHoverHighlightBars", "(", "dataArray", ")", "{", "var", "hoverBar", "=", "parent", ".", "svgHoverRoot", ".", "selectAll", "(", "'rect.highlightbar'", ")", ".", "data", "(", "dataArray", ")", ";", "hoverBar", ".", "attr", "(", "'x'", ",", "va...
Render a "highlight bar" over a set of bars. @param {array} dataArray An array of data elements for which to render highlight bars over. Pass an empty array to remove all bars.
[ "Render", "a", "highlight", "bar", "over", "a", "set", "of", "bars", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/chart/baseGroupedStackTimeBarChart.js#L291-L302
53,664
SolarNetwork/solarnetwork-d3
src/chart/baseGroupedStackTimeBarChart.js
drawSelection
function drawSelection(dataArray) { var firstItem = (dataArray && dataArray.length > 0 ? dataArray.slice(0, 1) : []), firstItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[0]) : 0), lastItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[dataArray.length - 1]) : 0), width = (lastItemX ...
javascript
function drawSelection(dataArray) { var firstItem = (dataArray && dataArray.length > 0 ? dataArray.slice(0, 1) : []), firstItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[0]) : 0), lastItemX = (dataArray && dataArray.length > 0 ? valueX(dataArray[dataArray.length - 1]) : 0), width = (lastItemX ...
[ "function", "drawSelection", "(", "dataArray", ")", "{", "var", "firstItem", "=", "(", "dataArray", "&&", "dataArray", ".", "length", ">", "0", "?", "dataArray", ".", "slice", "(", "0", ",", "1", ")", ":", "[", "]", ")", ",", "firstItemX", "=", "(", ...
Render a "selection" rect over a set of bars. @param {array} dataArray An array of data elements for which to render a selection over. Pass an empty array to remove the selection.
[ "Render", "a", "selection", "rect", "over", "a", "set", "of", "bars", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/chart/baseGroupedStackTimeBarChart.js#L310-L325
53,665
pagespace/pagespace
spec/unit/helpers/spies.js
mongooseify
function mongooseify(obj, returnValues) { applyMethods(obj); traverse(obj, (key, value) => { applyMethods(value); }); function applyMethods(value) { if(value && value.hasOwnProperty('_id')) { value.toObject = jasmine.createSpy('toObject'); ...
javascript
function mongooseify(obj, returnValues) { applyMethods(obj); traverse(obj, (key, value) => { applyMethods(value); }); function applyMethods(value) { if(value && value.hasOwnProperty('_id')) { value.toObject = jasmine.createSpy('toObject'); ...
[ "function", "mongooseify", "(", "obj", ",", "returnValues", ")", "{", "applyMethods", "(", "obj", ")", ";", "traverse", "(", "obj", ",", "(", "key", ",", "value", ")", "=>", "{", "applyMethods", "(", "value", ")", ";", "}", ")", ";", "function", "app...
called with every property and it's value
[ "called", "with", "every", "property", "and", "it", "s", "value" ]
943c45ddd9aaa4f3136e1ba4c2593aa0289daf43
https://github.com/pagespace/pagespace/blob/943c45ddd9aaa4f3136e1ba4c2593aa0289daf43/spec/unit/helpers/spies.js#L48-L64
53,666
BoogeeDoo/jockeyjs-bower
jockey.js
function(type, envelope, complete) { // We send the message by navigating the browser to a special URL. // The iOS library will catch the navigation, prevent the UIWebView // from continuing, and use the data in the URL to execute code // within the iOS app. ...
javascript
function(type, envelope, complete) { // We send the message by navigating the browser to a special URL. // The iOS library will catch the navigation, prevent the UIWebView // from continuing, and use the data in the URL to execute code // within the iOS app. ...
[ "function", "(", "type", ",", "envelope", ",", "complete", ")", "{", "// We send the message by navigating the browser to a special URL.", "// The iOS library will catch the navigation, prevent the UIWebView", "// from continuing, and use the data in the URL to execute code", "// within the ...
`type` can either be "event" or "callback"
[ "type", "can", "either", "be", "event", "or", "callback" ]
614788cb2eb843d56009fe0c8e5940b02170d74c
https://github.com/BoogeeDoo/jockeyjs-bower/blob/614788cb2eb843d56009fe0c8e5940b02170d74c/jockey.js#L55-L75
53,667
BoogeeDoo/jockeyjs-bower
jockey.js
function(type, messageId, json) { var self = this; var listenerList = this.listeners[type] || []; var executedCount = 0; var complete = function() { executedCount += 1; if (executedCount >= listenerList.length) { sel...
javascript
function(type, messageId, json) { var self = this; var listenerList = this.listeners[type] || []; var executedCount = 0; var complete = function() { executedCount += 1; if (executedCount >= listenerList.length) { sel...
[ "function", "(", "type", ",", "messageId", ",", "json", ")", "{", "var", "self", "=", "this", ";", "var", "listenerList", "=", "this", ".", "listeners", "[", "type", "]", "||", "[", "]", ";", "var", "executedCount", "=", "0", ";", "var", "complete", ...
Called by the native application when events are sent to JS from the app. Will execute every function, FIFO order, that was attached to this event type.
[ "Called", "by", "the", "native", "application", "when", "events", "are", "sent", "to", "JS", "from", "the", "app", ".", "Will", "execute", "every", "function", "FIFO", "order", "that", "was", "attached", "to", "this", "event", "type", "." ]
614788cb2eb843d56009fe0c8e5940b02170d74c
https://github.com/BoogeeDoo/jockeyjs-bower/blob/614788cb2eb843d56009fe0c8e5940b02170d74c/jockey.js#L119-L147
53,668
flegall/haste-map-webpack-resolver
packages/haste-map-provider/index.js
buildHasteMap
function buildHasteMap(rootPath, prefix) { var prefix = prefix || 'haste-map-provider'; return new HasteMapBuilder({ "extensions": [ "snap", "js", "json", "jsx", "node" ], "ignorePattern": /SOME_COMPLEX_IGNORE_PATTERN_UNLIKELY_TO_HAPPEN/,...
javascript
function buildHasteMap(rootPath, prefix) { var prefix = prefix || 'haste-map-provider'; return new HasteMapBuilder({ "extensions": [ "snap", "js", "json", "jsx", "node" ], "ignorePattern": /SOME_COMPLEX_IGNORE_PATTERN_UNLIKELY_TO_HAPPEN/,...
[ "function", "buildHasteMap", "(", "rootPath", ",", "prefix", ")", "{", "var", "prefix", "=", "prefix", "||", "'haste-map-provider'", ";", "return", "new", "HasteMapBuilder", "(", "{", "\"extensions\"", ":", "[", "\"snap\"", ",", "\"js\"", ",", "\"json\"", ",",...
Builds a Haste Map @param {string} rootPath - The rootPath to search sources for @param {string} prefix - The prefix for the haste map file (optional) @returns {Promise} A promise of the Haste Map
[ "Builds", "a", "Haste", "Map" ]
4ba928291c518b24596c3384b61b75fb14f433b7
https://github.com/flegall/haste-map-webpack-resolver/blob/4ba928291c518b24596c3384b61b75fb14f433b7/packages/haste-map-provider/index.js#L10-L35
53,669
pulsecat/cexio
cexio.js
function(to_clean) { _.map(to_clean, function(value, key, to_clean) { if (value === undefined) { delete to_clean[key]; } }); return to_clean; }
javascript
function(to_clean) { _.map(to_clean, function(value, key, to_clean) { if (value === undefined) { delete to_clean[key]; } }); return to_clean; }
[ "function", "(", "to_clean", ")", "{", "_", ".", "map", "(", "to_clean", ",", "function", "(", "value", ",", "key", ",", "to_clean", ")", "{", "if", "(", "value", "===", "undefined", ")", "{", "delete", "to_clean", "[", "key", "]", ";", "}", "}", ...
compact for objects
[ "compact", "for", "objects" ]
24207a71779775574405dfd332b9a09f2d9d2bc8
https://github.com/pulsecat/cexio/blob/24207a71779775574405dfd332b9a09f2d9d2bc8/cexio.js#L8-L15
53,670
aledbf/deis-api
lib/apps.js
create
function create(appName, callback) { commons.post(format('/%s/apps/', deis.version), { id: appName }, callback); }
javascript
function create(appName, callback) { commons.post(format('/%s/apps/', deis.version), { id: appName }, callback); }
[ "function", "create", "(", "appName", ",", "callback", ")", "{", "commons", ".", "post", "(", "format", "(", "'/%s/apps/'", ",", "deis", ".", "version", ")", ",", "{", "id", ":", "appName", "}", ",", "callback", ")", ";", "}" ]
Create a new application
[ "Create", "a", "new", "application" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L11-L15
53,671
aledbf/deis-api
lib/apps.js
list
function list(pageSize, callback) { var limit = 100; if (!isFunction(pageSize)) { limit = pageSize; }else { callback = pageSize; } commons.get(format('/%s/apps?limit=%s', deis.version, limit), callback); }
javascript
function list(pageSize, callback) { var limit = 100; if (!isFunction(pageSize)) { limit = pageSize; }else { callback = pageSize; } commons.get(format('/%s/apps?limit=%s', deis.version, limit), callback); }
[ "function", "list", "(", "pageSize", ",", "callback", ")", "{", "var", "limit", "=", "100", ";", "if", "(", "!", "isFunction", "(", "pageSize", ")", ")", "{", "limit", "=", "pageSize", ";", "}", "else", "{", "callback", "=", "pageSize", ";", "}", "...
List accessible applications
[ "List", "accessible", "applications" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L20-L28
53,672
aledbf/deis-api
lib/apps.js
info
function info(appName, callback) { commons.get(format('/%s/apps/%s/', deis.version, appName), callback); }
javascript
function info(appName, callback) { commons.get(format('/%s/apps/%s/', deis.version, appName), callback); }
[ "function", "info", "(", "appName", ",", "callback", ")", "{", "commons", ".", "get", "(", "format", "(", "'/%s/apps/%s/'", ",", "deis", ".", "version", ",", "appName", ")", ",", "callback", ")", ";", "}" ]
View info about an application
[ "View", "info", "about", "an", "application" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L33-L35
53,673
aledbf/deis-api
lib/apps.js
logs
function logs(appName, callback) { commons.get(format('/%s/apps/%s/logs/', deis.version, appName), callback); }
javascript
function logs(appName, callback) { commons.get(format('/%s/apps/%s/logs/', deis.version, appName), callback); }
[ "function", "logs", "(", "appName", ",", "callback", ")", "{", "commons", ".", "get", "(", "format", "(", "'/%s/apps/%s/logs/'", ",", "deis", ".", "version", ",", "appName", ")", ",", "callback", ")", ";", "}" ]
View aggregated application logs
[ "View", "aggregated", "application", "logs" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L40-L42
53,674
aledbf/deis-api
lib/apps.js
run
function run(appName, command, callback) { commons.get(format('/%s/apps/%s/run/', deis.version, appName), callback); }
javascript
function run(appName, command, callback) { commons.get(format('/%s/apps/%s/run/', deis.version, appName), callback); }
[ "function", "run", "(", "appName", ",", "command", ",", "callback", ")", "{", "commons", ".", "get", "(", "format", "(", "'/%s/apps/%s/run/'", ",", "deis", ".", "version", ",", "appName", ")", ",", "callback", ")", ";", "}" ]
Run a command in an ephemeral app container
[ "Run", "a", "command", "in", "an", "ephemeral", "app", "container" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L47-L49
53,675
aledbf/deis-api
lib/apps.js
destroy
function destroy(appName, callback) { commons.del(format('/%s/apps/%s/', deis.version, appName), callback); }
javascript
function destroy(appName, callback) { commons.del(format('/%s/apps/%s/', deis.version, appName), callback); }
[ "function", "destroy", "(", "appName", ",", "callback", ")", "{", "commons", ".", "del", "(", "format", "(", "'/%s/apps/%s/'", ",", "deis", ".", "version", ",", "appName", ")", ",", "callback", ")", ";", "}" ]
Destroy an application
[ "Destroy", "an", "application" ]
f0833789998032b11221a3a617bb566ade1fcc13
https://github.com/aledbf/deis-api/blob/f0833789998032b11221a3a617bb566ade1fcc13/lib/apps.js#L54-L56
53,676
chrishayesmu/DubBotBase
main.js
start
function start(basedir, connectionCompleteCallback) { var defaultConfig = require("./config/defaults.json"); var config = Config.create(basedir, defaultConfig); var globalObject = { config: config }; var loginCompleteCallback = function(bot) { globalObject.bot = bot; bot.connect(config...
javascript
function start(basedir, connectionCompleteCallback) { var defaultConfig = require("./config/defaults.json"); var config = Config.create(basedir, defaultConfig); var globalObject = { config: config }; var loginCompleteCallback = function(bot) { globalObject.bot = bot; bot.connect(config...
[ "function", "start", "(", "basedir", ",", "connectionCompleteCallback", ")", "{", "var", "defaultConfig", "=", "require", "(", "\"./config/defaults.json\"", ")", ";", "var", "config", "=", "Config", ".", "create", "(", "basedir", ",", "defaultConfig", ")", ";", ...
Starts up the bot, registering all commands and event listeners. @param {string} basedir - The base directory containing the commands/ and event_listeners/ subdirectories @param {function} connectionCompleteCallback - A function to be called once the bot has connected to the room and is ready to use @returns {object} ...
[ "Starts", "up", "the", "bot", "registering", "all", "commands", "and", "event", "listeners", "." ]
0e4b5e65531c23293d22ac766850c802b1266e48
https://github.com/chrishayesmu/DubBotBase/blob/0e4b5e65531c23293d22ac766850c802b1266e48/main.js#L24-L59
53,677
chrishayesmu/DubBotBase
main.js
_createCommandHandler
function _createCommandHandler(commands) { return function(chatEvent, globalObject) { if (!chatEvent.command) { return; } var commandName = chatEvent.command; if (!globalObject.config.DubBotBase.areCommandsCaseSensitive) { commandName = commandName.toLowerC...
javascript
function _createCommandHandler(commands) { return function(chatEvent, globalObject) { if (!chatEvent.command) { return; } var commandName = chatEvent.command; if (!globalObject.config.DubBotBase.areCommandsCaseSensitive) { commandName = commandName.toLowerC...
[ "function", "_createCommandHandler", "(", "commands", ")", "{", "return", "function", "(", "chatEvent", ",", "globalObject", ")", "{", "if", "(", "!", "chatEvent", ".", "command", ")", "{", "return", ";", "}", "var", "commandName", "=", "chatEvent", ".", "...
Creates a handler for the CHAT_COMMAND event which will distribute chat commands to the appropriate registered handlers. @param {array} commands - All of the registered command handlers @returns {function} An event handler
[ "Creates", "a", "handler", "for", "the", "CHAT_COMMAND", "event", "which", "will", "distribute", "chat", "commands", "to", "the", "appropriate", "registered", "handlers", "." ]
0e4b5e65531c23293d22ac766850c802b1266e48
https://github.com/chrishayesmu/DubBotBase/blob/0e4b5e65531c23293d22ac766850c802b1266e48/main.js#L68-L98
53,678
chrishayesmu/DubBotBase
main.js
_registerCommands
function _registerCommands(basedir, globalObject) { var commandsDir = path.resolve(basedir, "commands"); var files; try { files = Utils.getAllFilePathsUnderDirectory(commandsDir); LOG.info("Found the following potential command files: {}", files); } catch (e) { LOG.error("Un...
javascript
function _registerCommands(basedir, globalObject) { var commandsDir = path.resolve(basedir, "commands"); var files; try { files = Utils.getAllFilePathsUnderDirectory(commandsDir); LOG.info("Found the following potential command files: {}", files); } catch (e) { LOG.error("Un...
[ "function", "_registerCommands", "(", "basedir", ",", "globalObject", ")", "{", "var", "commandsDir", "=", "path", ".", "resolve", "(", "basedir", ",", "\"commands\"", ")", ";", "var", "files", ";", "try", "{", "files", "=", "Utils", ".", "getAllFilePathsUnd...
Registers all of the eligible files from the commands directory as commands with the bot. @param {string} basedir - The base directory which holds the commands directory @param {object} bot - An instance of DubBotBase.Bot
[ "Registers", "all", "of", "the", "eligible", "files", "from", "the", "commands", "directory", "as", "commands", "with", "the", "bot", "." ]
0e4b5e65531c23293d22ac766850c802b1266e48
https://github.com/chrishayesmu/DubBotBase/blob/0e4b5e65531c23293d22ac766850c802b1266e48/main.js#L107-L144
53,679
chrishayesmu/DubBotBase
main.js
_registerEventListeners
function _registerEventListeners(basedir, globalObject) { var bot = globalObject.bot; var eventListenerDir = path.resolve(basedir, "event_listeners"); var files; try { files = Utils.getAllFilePathsUnderDirectory(eventListenerDir); LOG.info("Found the following potential event listener f...
javascript
function _registerEventListeners(basedir, globalObject) { var bot = globalObject.bot; var eventListenerDir = path.resolve(basedir, "event_listeners"); var files; try { files = Utils.getAllFilePathsUnderDirectory(eventListenerDir); LOG.info("Found the following potential event listener f...
[ "function", "_registerEventListeners", "(", "basedir", ",", "globalObject", ")", "{", "var", "bot", "=", "globalObject", ".", "bot", ";", "var", "eventListenerDir", "=", "path", ".", "resolve", "(", "basedir", ",", "\"event_listeners\"", ")", ";", "var", "file...
Registers all of the eligible files from the event_listeners directory as event listeners with the bot. @param {string} basedir - The base directory which holds the event_listeners directory @param {object} bot - An instance of DubBotBase.Bot
[ "Registers", "all", "of", "the", "eligible", "files", "from", "the", "event_listeners", "directory", "as", "event", "listeners", "with", "the", "bot", "." ]
0e4b5e65531c23293d22ac766850c802b1266e48
https://github.com/chrishayesmu/DubBotBase/blob/0e4b5e65531c23293d22ac766850c802b1266e48/main.js#L153-L232
53,680
jfseb/mgnlq_model
js/model/model.js
getMongoHandle
function getMongoHandle(mongoose) { var res = { mongoose: mongoose, modelDocs: {}, modelESchemas: {}, mongoMaps: {} }; var modelES = Schemaload.getExtendedSchemaModel(mongoose); return modelES.distinct('modelname').then((modelnames) => { debuglog(() => 'here disti...
javascript
function getMongoHandle(mongoose) { var res = { mongoose: mongoose, modelDocs: {}, modelESchemas: {}, mongoMaps: {} }; var modelES = Schemaload.getExtendedSchemaModel(mongoose); return modelES.distinct('modelname').then((modelnames) => { debuglog(() => 'here disti...
[ "function", "getMongoHandle", "(", "mongoose", ")", "{", "var", "res", "=", "{", "mongoose", ":", "mongoose", ",", "modelDocs", ":", "{", "}", ",", "modelESchemas", ":", "{", "}", ",", "mongoMaps", ":", "{", "}", "}", ";", "var", "modelES", "=", "Sch...
returns when all models are loaded and all modeldocs are made @param mongoose
[ "returns", "when", "all", "models", "are", "loaded", "and", "all", "modeldocs", "are", "made" ]
be1be4406b05718d666d6d0f712c9cadb5169f2c
https://github.com/jfseb/mgnlq_model/blob/be1be4406b05718d666d6d0f712c9cadb5169f2c/js/model/model.js#L40-L69
53,681
jfseb/mgnlq_model
js/model/model.js
getDomainsForBitField
function getDomainsForBitField(oModel, bitfield) { return oModel.domains.filter(domain => (getDomainBitIndex(domain, oModel) & bitfield)); }
javascript
function getDomainsForBitField(oModel, bitfield) { return oModel.domains.filter(domain => (getDomainBitIndex(domain, oModel) & bitfield)); }
[ "function", "getDomainsForBitField", "(", "oModel", ",", "bitfield", ")", "{", "return", "oModel", ".", "domains", ".", "filter", "(", "domain", "=>", "(", "getDomainBitIndex", "(", "domain", ",", "oModel", ")", "&", "bitfield", ")", ")", ";", "}" ]
Given a bitfield, return an unsorted set of domains matching present bits @param oModel @param bitfield
[ "Given", "a", "bitfield", "return", "an", "unsorted", "set", "of", "domains", "matching", "present", "bits" ]
be1be4406b05718d666d6d0f712c9cadb5169f2c
https://github.com/jfseb/mgnlq_model/blob/be1be4406b05718d666d6d0f712c9cadb5169f2c/js/model/model.js#L525-L527
53,682
jfseb/mgnlq_model
js/model/model.js
loadModels
function loadModels(mongoose, modelPath) { if (mongoose === undefined) { throw new Error('expect a mongoose handle to be passed'); } return getMongoHandle(mongoose).then((modelHandle) => { debuglog(`got a mongo handle for ${modelPath}`); return _loadModelsFull(modelHandle, modelPath)...
javascript
function loadModels(mongoose, modelPath) { if (mongoose === undefined) { throw new Error('expect a mongoose handle to be passed'); } return getMongoHandle(mongoose).then((modelHandle) => { debuglog(`got a mongo handle for ${modelPath}`); return _loadModelsFull(modelHandle, modelPath)...
[ "function", "loadModels", "(", "mongoose", ",", "modelPath", ")", "{", "if", "(", "mongoose", "===", "undefined", ")", "{", "throw", "new", "Error", "(", "'expect a mongoose handle to be passed'", ")", ";", "}", "return", "getMongoHandle", "(", "mongoose", ")", ...
expects an open connection! @param mongoose @param modelPath
[ "expects", "an", "open", "connection!" ]
be1be4406b05718d666d6d0f712c9cadb5169f2c
https://github.com/jfseb/mgnlq_model/blob/be1be4406b05718d666d6d0f712c9cadb5169f2c/js/model/model.js#L1202-L1210
53,683
jmorrell/backbone-paginated-collection
index.js
difference
function difference(arrayA, arrayB) { var maxLength = _.max([ arrayA.length, arrayB.length ]); for (var i = 0, j = 0; i < maxLength; i += 1, j += 1) { if (arrayA[i] !== arrayB[j]) { if (arrayB[i-1] === arrayA[i]) { j -= 1; } else if (arrayB[i+1] === arrayA[i]) { j += 1; } else...
javascript
function difference(arrayA, arrayB) { var maxLength = _.max([ arrayA.length, arrayB.length ]); for (var i = 0, j = 0; i < maxLength; i += 1, j += 1) { if (arrayA[i] !== arrayB[j]) { if (arrayB[i-1] === arrayA[i]) { j -= 1; } else if (arrayB[i+1] === arrayA[i]) { j += 1; } else...
[ "function", "difference", "(", "arrayA", ",", "arrayB", ")", "{", "var", "maxLength", "=", "_", ".", "max", "(", "[", "arrayA", ".", "length", ",", "arrayB", ".", "length", "]", ")", ";", "for", "(", "var", "i", "=", "0", ",", "j", "=", "0", ";...
Given two arrays of backbone models, with at most one model added and one model removed from each, return the model in arrayA that is not in arrayB or undefined.
[ "Given", "two", "arrays", "of", "backbone", "models", "with", "at", "most", "one", "model", "added", "and", "one", "model", "removed", "from", "each", "return", "the", "model", "in", "arrayA", "that", "is", "not", "in", "arrayB", "or", "undefined", "." ]
46b8de1c8b24d741852294048f21d43225838364
https://github.com/jmorrell/backbone-paginated-collection/blob/46b8de1c8b24d741852294048f21d43225838364/index.js#L52-L66
53,684
MauroJr/amp
src/decode.js
decode
function decode(buf) { let off = 0; var i; // unpack meta const meta = buf[(off += 1)]; // const VERSION = meta >> 4; const argv = meta & 0xf; const args = new Array(argv); // unpack args for (i = 0; i < argv; i += 1) { const len = buf.readUInt32BE(off); off += 4; args[i] = buf.slice(of...
javascript
function decode(buf) { let off = 0; var i; // unpack meta const meta = buf[(off += 1)]; // const VERSION = meta >> 4; const argv = meta & 0xf; const args = new Array(argv); // unpack args for (i = 0; i < argv; i += 1) { const len = buf.readUInt32BE(off); off += 4; args[i] = buf.slice(of...
[ "function", "decode", "(", "buf", ")", "{", "let", "off", "=", "0", ";", "var", "i", ";", "// unpack meta", "const", "meta", "=", "buf", "[", "(", "off", "+=", "1", ")", "]", ";", "// const VERSION = meta >> 4;", "const", "argv", "=", "meta", "&", "0...
Decode the given `buf`. @param {Buffer} buf @return {Object} @api public
[ "Decode", "the", "given", "buf", "." ]
2b7df0bcf91228d02bdd6d6f1e1238743dbbb086
https://github.com/MauroJr/amp/blob/2b7df0bcf91228d02bdd6d6f1e1238743dbbb086/src/decode.js#L12-L31
53,685
kevinconway/Event.js
event/event.js
appendListener
function appendListener(event, listener, once) { this.events[event] = this.events[event] || []; this.events[event].push({ "listener": listener, "once": !!once }); this.emit('newListener', event, listener); if (this.events[event].length > this.maxListeners) { console.warn('warni...
javascript
function appendListener(event, listener, once) { this.events[event] = this.events[event] || []; this.events[event].push({ "listener": listener, "once": !!once }); this.emit('newListener', event, listener); if (this.events[event].length > this.maxListeners) { console.warn('warni...
[ "function", "appendListener", "(", "event", ",", "listener", ",", "once", ")", "{", "this", ".", "events", "[", "event", "]", "=", "this", ".", "events", "[", "event", "]", "||", "[", "]", ";", "this", ".", "events", "[", "event", "]", ".", "push",...
Adds a listener to the list. Private method hidden from api.
[ "Adds", "a", "listener", "to", "the", "list", ".", "Private", "method", "hidden", "from", "api", "." ]
65b4a0b4e19defaa9a863c107633b1835929a660
https://github.com/kevinconway/Event.js/blob/65b4a0b4e19defaa9a863c107633b1835929a660/event/event.js#L35-L54
53,686
joemccann/photopipe
utils/validation.js
function(u){ var urlObj = url.parse(u) return u.replace( urlObj.search, '').replace('#', '') }
javascript
function(u){ var urlObj = url.parse(u) return u.replace( urlObj.search, '').replace('#', '') }
[ "function", "(", "u", ")", "{", "var", "urlObj", "=", "url", ".", "parse", "(", "u", ")", "return", "u", ".", "replace", "(", "urlObj", ".", "search", ",", "''", ")", ".", "replace", "(", "'#'", ",", "''", ")", "}" ]
Brute force way of removing querystring and hash
[ "Brute", "force", "way", "of", "removing", "querystring", "and", "hash" ]
20318fde11163a8b732b077a141a8d8530372333
https://github.com/joemccann/photopipe/blob/20318fde11163a8b732b077a141a8d8530372333/utils/validation.js#L10-L13
53,687
joemccann/photopipe
utils/validation.js
function(u){ var urlObj = url.parse(u) return urlObj.protocol + "//" + urlObj.hostname + urlObj.pathname }
javascript
function(u){ var urlObj = url.parse(u) return urlObj.protocol + "//" + urlObj.hostname + urlObj.pathname }
[ "function", "(", "u", ")", "{", "var", "urlObj", "=", "url", ".", "parse", "(", "u", ")", "return", "urlObj", ".", "protocol", "+", "\"//\"", "+", "urlObj", ".", "hostname", "+", "urlObj", ".", "pathname", "}" ]
Build path from urlObj after parsing
[ "Build", "path", "from", "urlObj", "after", "parsing" ]
20318fde11163a8b732b077a141a8d8530372333
https://github.com/joemccann/photopipe/blob/20318fde11163a8b732b077a141a8d8530372333/utils/validation.js#L15-L18
53,688
bredele/post
post.js
PostEmitter
function PostEmitter() { var _this = this; //might be global this._listener = function(ev) { //check origin //then var data = ev.data; _this.emit.apply(_this, data instanceof Array ? data : [data]); }; window[attach](prefix + 'message', this._listener); }
javascript
function PostEmitter() { var _this = this; //might be global this._listener = function(ev) { //check origin //then var data = ev.data; _this.emit.apply(_this, data instanceof Array ? data : [data]); }; window[attach](prefix + 'message', this._listener); }
[ "function", "PostEmitter", "(", ")", "{", "var", "_this", "=", "this", ";", "//might be global", "this", ".", "_listener", "=", "function", "(", "ev", ")", "{", "//check origin", "//then", "var", "data", "=", "ev", ".", "data", ";", "_this", ".", "emit",...
PostEmitter constructor. Listen local and remote messages. @api public
[ "PostEmitter", "constructor", ".", "Listen", "local", "and", "remote", "messages", "." ]
a0a7365e432c4d10e660e872825c094c08f32ba8
https://github.com/bredele/post/blob/a0a7365e432c4d10e660e872825c094c08f32ba8/post.js#L397-L407
53,689
SolarNetwork/solarnetwork-d3
src/color/util.js
sn_color_map
function sn_color_map(fillColors, keys) { var colorRange = d3.scale.ordinal().range(fillColors); var colorData = keys.map(function(el, i) { return {source:el, color:colorRange(i)}; }); // also provide a mapping of sources to corresponding colors var i, len, sourceName; for ( i = 0, len = colorData.length; i < le...
javascript
function sn_color_map(fillColors, keys) { var colorRange = d3.scale.ordinal().range(fillColors); var colorData = keys.map(function(el, i) { return {source:el, color:colorRange(i)}; }); // also provide a mapping of sources to corresponding colors var i, len, sourceName; for ( i = 0, len = colorData.length; i < le...
[ "function", "sn_color_map", "(", "fillColors", ",", "keys", ")", "{", "var", "colorRange", "=", "d3", ".", "scale", ".", "ordinal", "(", ")", ".", "range", "(", "fillColors", ")", ";", "var", "colorData", "=", "keys", ".", "map", "(", "function", "(", ...
Return an array of colors for a set of unique keys, where the returned array also contains associative properties for all key values to thier corresponding color value. <p>This is designed so the set of keys always map to the same color, even across charts where not all sources may be present.</p> @preserve
[ "Return", "an", "array", "of", "colors", "for", "a", "set", "of", "unique", "keys", "where", "the", "returned", "array", "also", "contains", "associative", "properties", "for", "all", "key", "values", "to", "thier", "corresponding", "color", "value", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/color/util.js#L17-L37
53,690
SolarNetwork/solarnetwork-d3
src/color/util.js
sn_color_color
function sn_color_color(d) { var s = Number(d.source); if ( isNaN(s) ) { return sn.runtime.colorData[d.source]; } return sn.runtime.colorData.reduce(function(c, obj) { return (obj.source === d.source ? obj.color : c); }, sn.runtime.colorData[0].color); }
javascript
function sn_color_color(d) { var s = Number(d.source); if ( isNaN(s) ) { return sn.runtime.colorData[d.source]; } return sn.runtime.colorData.reduce(function(c, obj) { return (obj.source === d.source ? obj.color : c); }, sn.runtime.colorData[0].color); }
[ "function", "sn_color_color", "(", "d", ")", "{", "var", "s", "=", "Number", "(", "d", ".", "source", ")", ";", "if", "(", "isNaN", "(", "s", ")", ")", "{", "return", "sn", ".", "runtime", ".", "colorData", "[", "d", ".", "source", "]", ";", "}...
Use the configured runtime color map to turn a source into a color. The {@code sn.runtime.colorData} property must be set to a color map object as returned by {@link sn.colorMap}. @param {object} d the data element, expected to contain a {@code source} property @returns {string} color value @preserve
[ "Use", "the", "configured", "runtime", "color", "map", "to", "turn", "a", "source", "into", "a", "color", "." ]
26848b1c303b98b7c0ddeefb8c68c5f5bf78927e
https://github.com/SolarNetwork/solarnetwork-d3/blob/26848b1c303b98b7c0ddeefb8c68c5f5bf78927e/src/color/util.js#L49-L57
53,691
frankandrobot/js-go-channels
packages/js-go-channels/src/index.js
_createConsumerMessage
function _createConsumerMessage(consumer, message, {chanId}) { const { iterator: consumerIterator, type: requestType, payload } = consumer if (requestType === cSelectRequest) { const {selectedChanIds} = payload const i = selectedChanIds.indexOf(chanId) const response = new Array(selectedCh...
javascript
function _createConsumerMessage(consumer, message, {chanId}) { const { iterator: consumerIterator, type: requestType, payload } = consumer if (requestType === cSelectRequest) { const {selectedChanIds} = payload const i = selectedChanIds.indexOf(chanId) const response = new Array(selectedCh...
[ "function", "_createConsumerMessage", "(", "consumer", ",", "message", ",", "{", "chanId", "}", ")", "{", "const", "{", "iterator", ":", "consumerIterator", ",", "type", ":", "requestType", ",", "payload", "}", "=", "consumer", "if", "(", "requestType", "===...
Does what it says. Need to take into account the case when the consumer is a pending select, pending take. `select`s have a different signature. @param {Object} consumer - the consumer and message that was queued @param {Iterator} consumer.iterator @param {string} consumer.type - the consumer's message type @param {Obj...
[ "Does", "what", "it", "says", ".", "Need", "to", "take", "into", "account", "the", "case", "when", "the", "consumer", "is", "a", "pending", "select", "pending", "take", ".", "select", "s", "have", "a", "different", "signature", "." ]
cf1f7329e5e424a9e4123816f2b27adf73022eff
https://github.com/frankandrobot/js-go-channels/blob/cf1f7329e5e424a9e4123816f2b27adf73022eff/packages/js-go-channels/src/index.js#L65-L81
53,692
leipert/gulp-stack
tasks/app.js
function () { var stream = new $.streamqueue({ objectMode: true }); //Optionally injected additional javascript sourcecode injectIntoStream(stream, options.injectInto.js.pre); // App files without vendor files ...
javascript
function () { var stream = new $.streamqueue({ objectMode: true }); //Optionally injected additional javascript sourcecode injectIntoStream(stream, options.injectInto.js.pre); // App files without vendor files ...
[ "function", "(", ")", "{", "var", "stream", "=", "new", "$", ".", "streamqueue", "(", "{", "objectMode", ":", "true", "}", ")", ";", "//Optionally injected additional javascript sourcecode", "injectIntoStream", "(", "stream", ",", "options", ".", "injectInto", "...
Takes all app javascript files, angular templates and concats and minifies them
[ "Takes", "all", "app", "javascript", "files", "angular", "templates", "and", "concats", "and", "minifies", "them" ]
717bd0524f835393d2d3870c3e8f4d9af39c52c7
https://github.com/leipert/gulp-stack/blob/717bd0524f835393d2d3870c3e8f4d9af39c52c7/tasks/app.js#L28-L54
53,693
leipert/gulp-stack
tasks/app.js
function () { var stream = new $.streamqueue({ objectMode: true }); //Optionally injected additional css sourcecode injectIntoStream(stream, options.injectInto.css.pre); // App files without vendor files ...
javascript
function () { var stream = new $.streamqueue({ objectMode: true }); //Optionally injected additional css sourcecode injectIntoStream(stream, options.injectInto.css.pre); // App files without vendor files ...
[ "function", "(", ")", "{", "var", "stream", "=", "new", "$", ".", "streamqueue", "(", "{", "objectMode", ":", "true", "}", ")", ";", "//Optionally injected additional css sourcecode", "injectIntoStream", "(", "stream", ",", "options", ".", "injectInto", ".", "...
Takes all app css files and concats and minfies them
[ "Takes", "all", "app", "css", "files", "and", "concats", "and", "minfies", "them" ]
717bd0524f835393d2d3870c3e8f4d9af39c52c7
https://github.com/leipert/gulp-stack/blob/717bd0524f835393d2d3870c3e8f4d9af39c52c7/tasks/app.js#L60-L79
53,694
hammy2899/circle-assign
src/merge.js
merge
function merge(target, ...sources) { let targetObject = target; if (!isObj(target)) { targetObject = {}; } // for all the sources provided merge them with // the target object sources.forEach((s) => { // before merging check the source is an object if (isObj(s)) { targetObject = mergeObj...
javascript
function merge(target, ...sources) { let targetObject = target; if (!isObj(target)) { targetObject = {}; } // for all the sources provided merge them with // the target object sources.forEach((s) => { // before merging check the source is an object if (isObj(s)) { targetObject = mergeObj...
[ "function", "merge", "(", "target", ",", "...", "sources", ")", "{", "let", "targetObject", "=", "target", ";", "if", "(", "!", "isObj", "(", "target", ")", ")", "{", "targetObject", "=", "{", "}", ";", "}", "// for all the sources provided merge them with",...
Merge specified objects into one object with the most right object having the most priority @param {Object} target The base object @param {...Object} sources The object(s) to merge @returns {Object} The merged object(s) result
[ "Merge", "specified", "objects", "into", "one", "object", "with", "the", "most", "right", "object", "having", "the", "most", "priority" ]
4eb202021279b789ce758b3feae2417eb7f2ded5
https://github.com/hammy2899/circle-assign/blob/4eb202021279b789ce758b3feae2417eb7f2ded5/src/merge.js#L13-L30
53,695
benquarmby/gulp-byo-jslint
index.js
lintStream
function lintStream(spec) { if (!spec || !spec.jslint) { throw new gulpUtil.PluginError(pluginName, 'The file path to jslint is required.'); } var errors = 0; function lint(source, callback) { var contents = source.contents.toString('utf8'); var result = context.jslint(contents...
javascript
function lintStream(spec) { if (!spec || !spec.jslint) { throw new gulpUtil.PluginError(pluginName, 'The file path to jslint is required.'); } var errors = 0; function lint(source, callback) { var contents = source.contents.toString('utf8'); var result = context.jslint(contents...
[ "function", "lintStream", "(", "spec", ")", "{", "if", "(", "!", "spec", "||", "!", "spec", ".", "jslint", ")", "{", "throw", "new", "gulpUtil", ".", "PluginError", "(", "pluginName", ",", "'The file path to jslint is required.'", ")", ";", "}", "var", "er...
Runs JSLint over each item in the stream. @param {Object} spec The specification. @param {String} spec.jslint The file path to jslint.js. @param {Object} [spec.options] The options to pass to JSLint. @param {Array} [spec.globals] The list of known global variables to pass to JSLint. @param {Boolean} [spec.noFail] True ...
[ "Runs", "JSLint", "over", "each", "item", "in", "the", "stream", "." ]
aeae37424e325ae390a25bc4cf93d333da1de559
https://github.com/benquarmby/gulp-byo-jslint/blob/aeae37424e325ae390a25bc4cf93d333da1de559/index.js#L50-L105
53,696
veo-labs/openveo-rest-nodejs-client
lib/RestClient.js
rejectAll
function rejectAll(requests, error) { for (const request of requests) { request.abort(); request.reject(error); } }
javascript
function rejectAll(requests, error) { for (const request of requests) { request.abort(); request.reject(error); } }
[ "function", "rejectAll", "(", "requests", ",", "error", ")", "{", "for", "(", "const", "request", "of", "requests", ")", "{", "request", ".", "abort", "(", ")", ";", "request", ".", "reject", "(", "error", ")", ";", "}", "}" ]
Rejects all requests with the given error. If the request is running, it will be aborted. @private @param {Set} requests The list of requests to reject @param {Error} error The reject's error
[ "Rejects", "all", "requests", "with", "the", "given", "error", "." ]
c88f8daca56ca38d649bd76633a55440e5dc47c2
https://github.com/veo-labs/openveo-rest-nodejs-client/blob/c88f8daca56ca38d649bd76633a55440e5dc47c2/lib/RestClient.js#L27-L32
53,697
deanlandolt/endo
util/index.js
UnauthorizedError
function UnauthorizedError(message) { Error.call(this); Error.captureStackTrace(this, this.constructor); this.status = 401; this.message = 'Unauthorized: ' + message; this.name = this.constructor.name; }
javascript
function UnauthorizedError(message) { Error.call(this); Error.captureStackTrace(this, this.constructor); this.status = 401; this.message = 'Unauthorized: ' + message; this.name = this.constructor.name; }
[ "function", "UnauthorizedError", "(", "message", ")", "{", "Error", ".", "call", "(", "this", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ",", "this", ".", "constructor", ")", ";", "this", ".", "status", "=", "401", ";", "this", ".", "mes...
thrown when endpoint authorization fails
[ "thrown", "when", "endpoint", "authorization", "fails" ]
e96234226e3a56e5c71b7f68690b5cc98123ed03
https://github.com/deanlandolt/endo/blob/e96234226e3a56e5c71b7f68690b5cc98123ed03/util/index.js#L181-L188
53,698
deanlandolt/endo
util/index.js
NotFoundError
function NotFoundError(message) { Error.call(this); Error.captureStackTrace(this, this.constructor); this.status = 404; this.message = 'Not Found: ' + message; this.name = this.constructor.name; }
javascript
function NotFoundError(message) { Error.call(this); Error.captureStackTrace(this, this.constructor); this.status = 404; this.message = 'Not Found: ' + message; this.name = this.constructor.name; }
[ "function", "NotFoundError", "(", "message", ")", "{", "Error", ".", "call", "(", "this", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ",", "this", ".", "constructor", ")", ";", "this", ".", "status", "=", "404", ";", "this", ".", "message...
thrown when endpoint resolution fails
[ "thrown", "when", "endpoint", "resolution", "fails" ]
e96234226e3a56e5c71b7f68690b5cc98123ed03
https://github.com/deanlandolt/endo/blob/e96234226e3a56e5c71b7f68690b5cc98123ed03/util/index.js#L196-L203
53,699
SwirlNetworks/discus
src/view.js
function(el) { var self = this, $el = $(el); if ($el.length > 1) { $el.each(function() { self.addElement(this); }); } else if ($el.length === 0) { throw new Error("Invalid element!"); } if (this.$el.closest($el).length) { throw new Error("Element is a child of this view. This is only for ...
javascript
function(el) { var self = this, $el = $(el); if ($el.length > 1) { $el.each(function() { self.addElement(this); }); } else if ($el.length === 0) { throw new Error("Invalid element!"); } if (this.$el.closest($el).length) { throw new Error("Element is a child of this view. This is only for ...
[ "function", "(", "el", ")", "{", "var", "self", "=", "this", ",", "$el", "=", "$", "(", "el", ")", ";", "if", "(", "$el", ".", "length", ">", "1", ")", "{", "$el", ".", "each", "(", "function", "(", ")", "{", "self", ".", "addElement", "(", ...
track el as part of this view even though it's not a child..
[ "track", "el", "as", "part", "of", "this", "view", "even", "though", "it", "s", "not", "a", "child", ".." ]
79df8de5ec268879e50ec1e12e78b62a13b4a427
https://github.com/SwirlNetworks/discus/blob/79df8de5ec268879e50ec1e12e78b62a13b4a427/src/view.js#L186-L222