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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
56,300 | ruifortes/json-deref | src/index.js | processNode | function processNode({rawNode, parsedNode, parentId = resourceId, cursor, refChain, prop}) {
logger.info(`processNode ${cursor}${prop ? '(' + prop + ')' : ''} with refChain ${refChain}`)
const currentId = options.urlBaseKey && rawNode[options.urlBaseKey]
? parseRef(rawNode[options.urlBaseKey], paren... | javascript | function processNode({rawNode, parsedNode, parentId = resourceId, cursor, refChain, prop}) {
logger.info(`processNode ${cursor}${prop ? '(' + prop + ')' : ''} with refChain ${refChain}`)
const currentId = options.urlBaseKey && rawNode[options.urlBaseKey]
? parseRef(rawNode[options.urlBaseKey], paren... | [
"function",
"processNode",
"(",
"{",
"rawNode",
",",
"parsedNode",
",",
"parentId",
"=",
"resourceId",
",",
"cursor",
",",
"refChain",
",",
"prop",
"}",
")",
"{",
"logger",
".",
"info",
"(",
"`",
"${",
"cursor",
"}",
"${",
"prop",
"?",
"'('",
"+",
"p... | Main recursive traverse function
@param {Object} rawNode - The source node to processed
@param {Object} parsedNode - Object to contain the processed properties
@param {string} cursor - Path of the current node. Adds to refChain...do I need this?
@param {string[]} [refChain=[]] - Parent pointers used to check circular ... | [
"Main",
"recursive",
"traverse",
"function"
] | 1d534d68e5067b3de4bc98080f6e989187a684ca | https://github.com/ruifortes/json-deref/blob/1d534d68e5067b3de4bc98080f6e989187a684ca/src/index.js#L129-L224 |
56,301 | camshaft/node-deploy-yml | index.js | getAll | function getAll(name, deploy, fn, single) {
getTree(name, deploy, function(err, tree) {
if (err) return fn(err);
var acc = [];
flatten(tree, acc);
if (acc.length === 0) return fn(null);
if (single && acc.length === 1) return fn(null, acc[0]);
fn(err, acc);
});
} | javascript | function getAll(name, deploy, fn, single) {
getTree(name, deploy, function(err, tree) {
if (err) return fn(err);
var acc = [];
flatten(tree, acc);
if (acc.length === 0) return fn(null);
if (single && acc.length === 1) return fn(null, acc[0]);
fn(err, acc);
});
} | [
"function",
"getAll",
"(",
"name",
",",
"deploy",
",",
"fn",
",",
"single",
")",
"{",
"getTree",
"(",
"name",
",",
"deploy",
",",
"function",
"(",
"err",
",",
"tree",
")",
"{",
"if",
"(",
"err",
")",
"return",
"fn",
"(",
"err",
")",
";",
"var",
... | concats have to go all the way down the chain overrides work backwards and stop at first definition | [
"concats",
"have",
"to",
"go",
"all",
"the",
"way",
"down",
"the",
"chain",
"overrides",
"work",
"backwards",
"and",
"stop",
"at",
"first",
"definition"
] | 1c116f406b7e3c399bffec6732ea0fa1a52deb37 | https://github.com/camshaft/node-deploy-yml/blob/1c116f406b7e3c399bffec6732ea0fa1a52deb37/index.js#L131-L140 |
56,302 | georgenorman/tessel-kit | lib/tessel-utils.js | function(portKey) {
var result = this.isValidPort(portKey) ? tessel.port[this.validLEDNames.indexOf(portKey)] : null;
return result;
} | javascript | function(portKey) {
var result = this.isValidPort(portKey) ? tessel.port[this.validLEDNames.indexOf(portKey)] : null;
return result;
} | [
"function",
"(",
"portKey",
")",
"{",
"var",
"result",
"=",
"this",
".",
"isValidPort",
"(",
"portKey",
")",
"?",
"tessel",
".",
"port",
"[",
"this",
".",
"validLEDNames",
".",
"indexOf",
"(",
"portKey",
")",
"]",
":",
"null",
";",
"return",
"result",
... | Return the Tessel port, if the given portKey is valid; otherwise, return null. | [
"Return",
"the",
"Tessel",
"port",
"if",
"the",
"given",
"portKey",
"is",
"valid",
";",
"otherwise",
"return",
"null",
"."
] | 487e91360f0ecf8500d24297228842e2c01ac762 | https://github.com/georgenorman/tessel-kit/blob/487e91360f0ecf8500d24297228842e2c01ac762/lib/tessel-utils.js#L36-L40 | |
56,303 | georgenorman/tessel-kit | lib/tessel-utils.js | function(ledName) {
var result = this.isValidLEDName(ledName) ? tessel.port[this.validLEDNames.indexOf(ledName)] : null;
return result;
} | javascript | function(ledName) {
var result = this.isValidLEDName(ledName) ? tessel.port[this.validLEDNames.indexOf(ledName)] : null;
return result;
} | [
"function",
"(",
"ledName",
")",
"{",
"var",
"result",
"=",
"this",
".",
"isValidLEDName",
"(",
"ledName",
")",
"?",
"tessel",
".",
"port",
"[",
"this",
".",
"validLEDNames",
".",
"indexOf",
"(",
"ledName",
")",
"]",
":",
"null",
";",
"return",
"result... | Return the Tessel LED, if the given LED name is valid; otherwise, return null. | [
"Return",
"the",
"Tessel",
"LED",
"if",
"the",
"given",
"LED",
"name",
"is",
"valid",
";",
"otherwise",
"return",
"null",
"."
] | 487e91360f0ecf8500d24297228842e2c01ac762 | https://github.com/georgenorman/tessel-kit/blob/487e91360f0ecf8500d24297228842e2c01ac762/lib/tessel-utils.js#L59-L63 | |
56,304 | LoveKino/cl-fsm | lib/nfa.js | function(startState) {
let dfa = new DFA();
let stateMap = {};
let epsilonNFASetCache = {}; // NFA-set -> NFA-set
let startOrigin = {
[startState]: 1
};
let start = this.epsilonClosure(startOrigin);
epsilonNFASetCache[hashNFAStates(startOrigin)] = st... | javascript | function(startState) {
let dfa = new DFA();
let stateMap = {};
let epsilonNFASetCache = {}; // NFA-set -> NFA-set
let startOrigin = {
[startState]: 1
};
let start = this.epsilonClosure(startOrigin);
epsilonNFASetCache[hashNFAStates(startOrigin)] = st... | [
"function",
"(",
"startState",
")",
"{",
"let",
"dfa",
"=",
"new",
"DFA",
"(",
")",
";",
"let",
"stateMap",
"=",
"{",
"}",
";",
"let",
"epsilonNFASetCache",
"=",
"{",
"}",
";",
"// NFA-set -> NFA-set",
"let",
"startOrigin",
"=",
"{",
"[",
"startState",
... | generate a new DFA and record which nfa states composed to a new DFA state | [
"generate",
"a",
"new",
"DFA",
"and",
"record",
"which",
"nfa",
"states",
"composed",
"to",
"a",
"new",
"DFA",
"state"
] | db7e8d5a5df6d10f285049d8f154c3f3a3f34211 | https://github.com/LoveKino/cl-fsm/blob/db7e8d5a5df6d10f285049d8f154c3f3a3f34211/lib/nfa.js#L90-L153 | |
56,305 | yoshuawuyts/virtual-form | index.js | virtualForm | function virtualForm (h, opts, arr) {
if (!arr) {
arr = opts
opts = {}
}
assert.equal(typeof h, 'function')
assert.equal(typeof opts, 'object')
assert.ok(Array.isArray(arr), 'is array')
return arr.map(function createInput (val) {
if (typeof val === 'string') {
val = { type: 'text', name: ... | javascript | function virtualForm (h, opts, arr) {
if (!arr) {
arr = opts
opts = {}
}
assert.equal(typeof h, 'function')
assert.equal(typeof opts, 'object')
assert.ok(Array.isArray(arr), 'is array')
return arr.map(function createInput (val) {
if (typeof val === 'string') {
val = { type: 'text', name: ... | [
"function",
"virtualForm",
"(",
"h",
",",
"opts",
",",
"arr",
")",
"{",
"if",
"(",
"!",
"arr",
")",
"{",
"arr",
"=",
"opts",
"opts",
"=",
"{",
"}",
"}",
"assert",
".",
"equal",
"(",
"typeof",
"h",
",",
"'function'",
")",
"assert",
".",
"equal",
... | Create a virtual-dom form null -> null | [
"Create",
"a",
"virtual",
"-",
"dom",
"form",
"null",
"-",
">",
"null"
] | acc64f437cccc8aa11681c2b8a042394b4844928 | https://github.com/yoshuawuyts/virtual-form/blob/acc64f437cccc8aa11681c2b8a042394b4844928/index.js#L7-L38 |
56,306 | Froguard/rgl-tplmin-loader | index.js | cleanRedundantCode | function cleanRedundantCode(str, opts){
opts = opts || {};
var minimize = def(opts.minimize, true);
var comments = opts.comments || {};
var htmlComments = comments.html,
rglComments = comments.rgl;
if(minimize && typeof str === 'string'){
var SINGLE_SPACE = ' ';
var EMPTY = ... | javascript | function cleanRedundantCode(str, opts){
opts = opts || {};
var minimize = def(opts.minimize, true);
var comments = opts.comments || {};
var htmlComments = comments.html,
rglComments = comments.rgl;
if(minimize && typeof str === 'string'){
var SINGLE_SPACE = ' ';
var EMPTY = ... | [
"function",
"cleanRedundantCode",
"(",
"str",
",",
"opts",
")",
"{",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"var",
"minimize",
"=",
"def",
"(",
"opts",
".",
"minimize",
",",
"true",
")",
";",
"var",
"comments",
"=",
"opts",
".",
"comments",
"||",
... | pure regEx to resolve it, not via a parser; | [
"pure",
"regEx",
"to",
"resolve",
"it",
"not",
"via",
"a",
"parser",
";"
] | 74a8af5373cffe3998606dd89975cb0737e5014d | https://github.com/Froguard/rgl-tplmin-loader/blob/74a8af5373cffe3998606dd89975cb0737e5014d/index.js#L15-L63 |
56,307 | dominictarr/npmd-unpack | index.js | getCache | function getCache (pkg, config) {
pkg = toPkg(pkg)
if(config && config.cacheHash)
return path.join(config.cache, pkg.shasum, 'package.tgz')
return path.join(
config.cache || path.join(process.env.HOME, '.npm'),
pkg.name, pkg.version, 'package.tgz'
)
} | javascript | function getCache (pkg, config) {
pkg = toPkg(pkg)
if(config && config.cacheHash)
return path.join(config.cache, pkg.shasum, 'package.tgz')
return path.join(
config.cache || path.join(process.env.HOME, '.npm'),
pkg.name, pkg.version, 'package.tgz'
)
} | [
"function",
"getCache",
"(",
"pkg",
",",
"config",
")",
"{",
"pkg",
"=",
"toPkg",
"(",
"pkg",
")",
"if",
"(",
"config",
"&&",
"config",
".",
"cacheHash",
")",
"return",
"path",
".",
"join",
"(",
"config",
".",
"cache",
",",
"pkg",
".",
"shasum",
",... | Would be better to store the tarball as it's hash, not it's version. that would allow exact shrinkwraps. Probably want to fallback to getting the other cache, for speed. But to pull down new deps... Also... hashes would allow peer to peer module hosting, and multiple repos... | [
"Would",
"be",
"better",
"to",
"store",
"the",
"tarball",
"as",
"it",
"s",
"hash",
"not",
"it",
"s",
"version",
".",
"that",
"would",
"allow",
"exact",
"shrinkwraps",
".",
"Probably",
"want",
"to",
"fallback",
"to",
"getting",
"the",
"other",
"cache",
"f... | 5d6057ebf3413d256a2b2fc7724b4d7fbc424c53 | https://github.com/dominictarr/npmd-unpack/blob/5d6057ebf3413d256a2b2fc7724b4d7fbc424c53/index.js#L44-L54 |
56,308 | dominictarr/npmd-unpack | index.js | get | function get (url, cb) {
var urls = [], end
_get(url, cb)
function _get (url) {
urls.push(url)
if(end) return
if(urls.length > 5)
cb(end = new Error('too many redirects\n'+JSON.stringify(urls)))
console.error('GET', url)
;(/^https/.test(url) ? https : http).get(url, function next (res) ... | javascript | function get (url, cb) {
var urls = [], end
_get(url, cb)
function _get (url) {
urls.push(url)
if(end) return
if(urls.length > 5)
cb(end = new Error('too many redirects\n'+JSON.stringify(urls)))
console.error('GET', url)
;(/^https/.test(url) ? https : http).get(url, function next (res) ... | [
"function",
"get",
"(",
"url",
",",
"cb",
")",
"{",
"var",
"urls",
"=",
"[",
"]",
",",
"end",
"_get",
"(",
"url",
",",
"cb",
")",
"function",
"_get",
"(",
"url",
")",
"{",
"urls",
".",
"push",
"(",
"url",
")",
"if",
"(",
"end",
")",
"return",... | pull a package from the registry | [
"pull",
"a",
"package",
"from",
"the",
"registry"
] | 5d6057ebf3413d256a2b2fc7724b4d7fbc424c53 | https://github.com/dominictarr/npmd-unpack/blob/5d6057ebf3413d256a2b2fc7724b4d7fbc424c53/index.js#L59-L83 |
56,309 | dominictarr/npmd-unpack | index.js | getTarballStream | function getTarballStream (pkg, config, cb) {
if(config.casDb && pkg.shasum) {
var db = config.casDb
db.has(pkg.shasum, function (err, stat) {
if(!err)
cb(null, db.getStream(pkg.shasum))
else //fallback to the old way...
tryCache()
})
}
else
tryCache()
function tryCa... | javascript | function getTarballStream (pkg, config, cb) {
if(config.casDb && pkg.shasum) {
var db = config.casDb
db.has(pkg.shasum, function (err, stat) {
if(!err)
cb(null, db.getStream(pkg.shasum))
else //fallback to the old way...
tryCache()
})
}
else
tryCache()
function tryCa... | [
"function",
"getTarballStream",
"(",
"pkg",
",",
"config",
",",
"cb",
")",
"{",
"if",
"(",
"config",
".",
"casDb",
"&&",
"pkg",
".",
"shasum",
")",
"{",
"var",
"db",
"=",
"config",
".",
"casDb",
"db",
".",
"has",
"(",
"pkg",
".",
"shasum",
",",
"... | stream a tarball - either from cache or registry | [
"stream",
"a",
"tarball",
"-",
"either",
"from",
"cache",
"or",
"registry"
] | 5d6057ebf3413d256a2b2fc7724b4d7fbc424c53 | https://github.com/dominictarr/npmd-unpack/blob/5d6057ebf3413d256a2b2fc7724b4d7fbc424c53/index.js#L111-L133 |
56,310 | dominictarr/npmd-unpack | index.js | getTmp | function getTmp (config) {
return path.join(config.tmpdir || '/tmp', ''+Date.now() + Math.random())
} | javascript | function getTmp (config) {
return path.join(config.tmpdir || '/tmp', ''+Date.now() + Math.random())
} | [
"function",
"getTmp",
"(",
"config",
")",
"{",
"return",
"path",
".",
"join",
"(",
"config",
".",
"tmpdir",
"||",
"'/tmp'",
",",
"''",
"+",
"Date",
".",
"now",
"(",
")",
"+",
"Math",
".",
"random",
"(",
")",
")",
"}"
] | unpack a tarball to some target directory. recommend unpacking to tmpdir and then moving a following step. ALSO, should hash the file as we unpack it, and validate that we get the correct hash. | [
"unpack",
"a",
"tarball",
"to",
"some",
"target",
"directory",
".",
"recommend",
"unpacking",
"to",
"tmpdir",
"and",
"then",
"moving",
"a",
"following",
"step",
".",
"ALSO",
"should",
"hash",
"the",
"file",
"as",
"we",
"unpack",
"it",
"and",
"validate",
"t... | 5d6057ebf3413d256a2b2fc7724b4d7fbc424c53 | https://github.com/dominictarr/npmd-unpack/blob/5d6057ebf3413d256a2b2fc7724b4d7fbc424c53/index.js#L140-L142 |
56,311 | Wiredcraft/mixable-object | lib/mixin.js | mixin | function mixin(source) {
var keys = [];
if (arguments.length > 1) {
for (var i = 1, len = arguments.length; i < len; i++) {
var key = arguments[i];
if (!source.hasOwnProperty(key)) {
throw new Error(util.format('Property not found: %s', key));
}
keys.push(key);
}
} else {
... | javascript | function mixin(source) {
var keys = [];
if (arguments.length > 1) {
for (var i = 1, len = arguments.length; i < len; i++) {
var key = arguments[i];
if (!source.hasOwnProperty(key)) {
throw new Error(util.format('Property not found: %s', key));
}
keys.push(key);
}
} else {
... | [
"function",
"mixin",
"(",
"source",
")",
"{",
"var",
"keys",
"=",
"[",
"]",
";",
"if",
"(",
"arguments",
".",
"length",
">",
"1",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"1",
",",
"len",
"=",
"arguments",
".",
"length",
";",
"i",
"<",
"len",
"... | The common mixin, simply copies properties, by redefining the same properties
from the source.
@param {Object} source
@param {Mixed} ...keys if given only the attributes with the keys are copied
@return {this} | [
"The",
"common",
"mixin",
"simply",
"copies",
"properties",
"by",
"redefining",
"the",
"same",
"properties",
"from",
"the",
"source",
"."
] | 1ddb656ab11399b8cffbbf300b51bd334a1a77e1 | https://github.com/Wiredcraft/mixable-object/blob/1ddb656ab11399b8cffbbf300b51bd334a1a77e1/lib/mixin.js#L15-L34 |
56,312 | wigy/chronicles_of_grunt | tasks/build.js | subst | function subst(str, file, dst) {
if (dst !== undefined) {
str = str.replace(/\{\{DST\}\}/g, dst);
}
var dir = path.dirname(file);
str = str.replace(/\{\{SRC\}\}/g, file);
var name = path.basename(file);
str = str.replace(/\{\{NAME\}... | javascript | function subst(str, file, dst) {
if (dst !== undefined) {
str = str.replace(/\{\{DST\}\}/g, dst);
}
var dir = path.dirname(file);
str = str.replace(/\{\{SRC\}\}/g, file);
var name = path.basename(file);
str = str.replace(/\{\{NAME\}... | [
"function",
"subst",
"(",
"str",
",",
"file",
",",
"dst",
")",
"{",
"if",
"(",
"dst",
"!==",
"undefined",
")",
"{",
"str",
"=",
"str",
".",
"replace",
"(",
"/",
"\\{\\{DST\\}\\}",
"/",
"g",
",",
"dst",
")",
";",
"}",
"var",
"dir",
"=",
"path",
... | Support function to substitute path variables. | [
"Support",
"function",
"to",
"substitute",
"path",
"variables",
"."
] | c5f089a6f391a0ca625fcb81ef51907713471bb3 | https://github.com/wigy/chronicles_of_grunt/blob/c5f089a6f391a0ca625fcb81ef51907713471bb3/tasks/build.js#L57-L74 |
56,313 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
if (utils.Misc.isEmptyObject(request.query)) {
var errApp = new Error(errors['130']);
response.end(utils.Misc.createResponse(null, errApp, 130));
}
else {
next();
}
} | javascript | function(request, response, next){
if (utils.Misc.isEmptyObject(request.query)) {
var errApp = new Error(errors['130']);
response.end(utils.Misc.createResponse(null, errApp, 130));
}
else {
next();
}
} | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"if",
"(",
"utils",
".",
"Misc",
".",
"isEmptyObject",
"(",
"request",
".",
"query",
")",
")",
"{",
"var",
"errApp",
"=",
"new",
"Error",
"(",
"errors",
"[",
"'130'",
"]",
")",
";"... | checks to be sure a criterion was specified for a bulk update operation | [
"checks",
"to",
"be",
"sure",
"a",
"criterion",
"was",
"specified",
"for",
"a",
"bulk",
"update",
"operation"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L81-L89 | |
56,314 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.user)) {
next();
}
else {
var error = new Error(errors['213']);
response.end(utils.Misc.createResponse(null, error, 213));
}
} | javascript | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.user)) {
next();
}
else {
var error = new Error(errors['213']);
response.end(utils.Misc.createResponse(null, error, 213));
}
} | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"user",
")",
")",
"{",
"next",
"(",
")",
";",
"}",
"else",
"{",
"var",
"error",
"=",
"new",
"... | checks for logged-in user | [
"checks",
"for",
"logged",
"-",
"in",
"user"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L91-L99 | |
56,315 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) {
next();
}
else {
var success = encodeURIComponent(request.protocol + '://' + request.get('host') + request.originalUrl);
response.redirec... | javascript | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.user) || request.originalUrl == '/error' || request.originalUrl.indexOf('/error?') == 0) {
next();
}
else {
var success = encodeURIComponent(request.protocol + '://' + request.get('host') + request.originalUrl);
response.redirec... | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"user",
")",
"||",
"request",
".",
"originalUrl",
"==",
"'/error'",
"||",
"request",
".",
"originalUr... | checks for logged-in UI user | [
"checks",
"for",
"logged",
"-",
"in",
"UI",
"user"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L101-L109 | |
56,316 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFromA... | javascript | function(request, response, next){
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFromA... | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"var",
"apptkn",
";",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"get",
"(",
"X_BOLT_APP_TOKEN",
")",
")",
")",
"{",
"apptkn",
"=",
"request",... | checks to be sure the app making this request is a system app | [
"checks",
"to",
"be",
"sure",
"the",
"app",
"making",
"this",
"request",
"is",
"a",
"system",
"app"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L111-L150 | |
56,317 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFromA... | javascript | function(request, response, next){
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFromA... | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"var",
"apptkn",
";",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"get",
"(",
"X_BOLT_APP_TOKEN",
")",
")",
")",
"{",
"apptkn",
"=",
"request",... | gets the app name from the request | [
"gets",
"the",
"app",
"name",
"from",
"the",
"request"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L153-L174 | |
56,318 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.body.db)) {
request.db = request.body.db;
}
else if (!utils.Misc.isNullOrUndefined(request.body.app)) {
request.db = request.body.app;
}
else {
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN)))... | javascript | function(request, response, next){
if (!utils.Misc.isNullOrUndefined(request.body.db)) {
request.db = request.body.db;
}
else if (!utils.Misc.isNullOrUndefined(request.body.app)) {
request.db = request.body.app;
}
else {
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN)))... | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"body",
".",
"db",
")",
")",
"{",
"request",
".",
"db",
"=",
"request",
".",
"body",
".",
"db",... | gets the DB name from the request, and creates the request.db field to hold the value | [
"gets",
"the",
"DB",
"name",
"from",
"the",
"request",
"and",
"creates",
"the",
"request",
".",
"db",
"field",
"to",
"hold",
"the",
"value"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L242-L278 | |
56,319 | Chieze-Franklin/bolt-internal-checks | checks.js | function(request, response, next) {
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFrom... | javascript | function(request, response, next) {
var apptkn;
if (!utils.Misc.isNullOrUndefined(request.get(X_BOLT_APP_TOKEN))) {
apptkn = request.get(X_BOLT_APP_TOKEN);
}
else {
var error = new Error(errors['110']);
response.end(utils.Misc.createResponse(null, error, 110));
return;
}
var name = __getAppFrom... | [
"function",
"(",
"request",
",",
"response",
",",
"next",
")",
"{",
"var",
"apptkn",
";",
"if",
"(",
"!",
"utils",
".",
"Misc",
".",
"isNullOrUndefined",
"(",
"request",
".",
"get",
"(",
"X_BOLT_APP_TOKEN",
")",
")",
")",
"{",
"apptkn",
"=",
"request",... | checks if this app has the right to write to the collection in the database | [
"checks",
"if",
"this",
"app",
"has",
"the",
"right",
"to",
"write",
"to",
"the",
"collection",
"in",
"the",
"database"
] | f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225 | https://github.com/Chieze-Franklin/bolt-internal-checks/blob/f1a7ccea701ec3e69f9bad0e0d6cf2efa6ee2225/checks.js#L280-L333 | |
56,320 | dignifiedquire/node-inotifyr | lib/bits.js | toBitMask | function toBitMask(event) {
if (!_.has(eventMap, event)) {
throw new Error('Unkown event: ' + event);
}
return eventMap[event];
} | javascript | function toBitMask(event) {
if (!_.has(eventMap, event)) {
throw new Error('Unkown event: ' + event);
}
return eventMap[event];
} | [
"function",
"toBitMask",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"_",
".",
"has",
"(",
"eventMap",
",",
"event",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Unkown event: '",
"+",
"event",
")",
";",
"}",
"return",
"eventMap",
"[",
"event",
"]",
... | Convert a string to the corresponding bit mask. event - String Returns a binary number. | [
"Convert",
"a",
"string",
"to",
"the",
"corresponding",
"bit",
"mask",
".",
"event",
"-",
"String",
"Returns",
"a",
"binary",
"number",
"."
] | 6d161fed38c6d30951c46055939a5a2915304a53 | https://github.com/dignifiedquire/node-inotifyr/blob/6d161fed38c6d30951c46055939a5a2915304a53/lib/bits.js#L37-L42 |
56,321 | dignifiedquire/node-inotifyr | lib/bits.js | addFlags | function addFlags(mask, flags) {
if (flags.onlydir) mask = mask | Inotify.IN_ONLYDIR;
if (flags.dont_follow) mask = mask | Inotify.IN_DONT_FOLLOW;
if (flags.oneshot) mask = mask | Inotify.IN_ONESHOT;
return mask;
} | javascript | function addFlags(mask, flags) {
if (flags.onlydir) mask = mask | Inotify.IN_ONLYDIR;
if (flags.dont_follow) mask = mask | Inotify.IN_DONT_FOLLOW;
if (flags.oneshot) mask = mask | Inotify.IN_ONESHOT;
return mask;
} | [
"function",
"addFlags",
"(",
"mask",
",",
"flags",
")",
"{",
"if",
"(",
"flags",
".",
"onlydir",
")",
"mask",
"=",
"mask",
"|",
"Inotify",
".",
"IN_ONLYDIR",
";",
"if",
"(",
"flags",
".",
"dont_follow",
")",
"mask",
"=",
"mask",
"|",
"Inotify",
".",
... | Add additional flags to a given mask. mask - Number flags - Object Returns a number. | [
"Add",
"additional",
"flags",
"to",
"a",
"given",
"mask",
".",
"mask",
"-",
"Number",
"flags",
"-",
"Object",
"Returns",
"a",
"number",
"."
] | 6d161fed38c6d30951c46055939a5a2915304a53 | https://github.com/dignifiedquire/node-inotifyr/blob/6d161fed38c6d30951c46055939a5a2915304a53/lib/bits.js#L108-L113 |
56,322 | 5long/roil | src/console/socket.io.js | FABridge__bridgeInitialized | function FABridge__bridgeInitialized(bridgeName) {
var objects = document.getElementsByTagName("object");
var ol = objects.length;
var activeObjects = [];
if (ol > 0) {
for (var i = 0; i < ol; i++) {
if (typeof objects[i].SetVariable != "undefined") {
activeObjects[activeObjects.length] ... | javascript | function FABridge__bridgeInitialized(bridgeName) {
var objects = document.getElementsByTagName("object");
var ol = objects.length;
var activeObjects = [];
if (ol > 0) {
for (var i = 0; i < ol; i++) {
if (typeof objects[i].SetVariable != "undefined") {
activeObjects[activeObjects.length] ... | [
"function",
"FABridge__bridgeInitialized",
"(",
"bridgeName",
")",
"{",
"var",
"objects",
"=",
"document",
".",
"getElementsByTagName",
"(",
"\"object\"",
")",
";",
"var",
"ol",
"=",
"objects",
".",
"length",
";",
"var",
"activeObjects",
"=",
"[",
"]",
";",
... | updated for changes to SWFObject2 | [
"updated",
"for",
"changes",
"to",
"SWFObject2"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1029-L1088 |
56,323 | 5long/roil | src/console/socket.io.js | function(objRef, propName)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | javascript | function(objRef, propName)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | [
"function",
"(",
"objRef",
",",
"propName",
")",
"{",
"if",
"(",
"FABridge",
".",
"refCount",
">",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, ... | low level access to the flash object get a named property from an AS object | [
"low",
"level",
"access",
"to",
"the",
"flash",
"object",
"get",
"a",
"named",
"property",
"from",
"an",
"AS",
"object"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1181-L1195 | |
56,324 | 5long/roil | src/console/socket.io.js | function(objRef,propName, value)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | javascript | function(objRef,propName, value)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | [
"function",
"(",
"objRef",
",",
"propName",
",",
"value",
")",
"{",
"if",
"(",
"FABridge",
".",
"refCount",
">",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript set... | set a named property on an AS object | [
"set",
"a",
"named",
"property",
"on",
"an",
"AS",
"object"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1197-L1211 | |
56,325 | 5long/roil | src/console/socket.io.js | function(funcID, args)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
FAB... | javascript | function(funcID, args)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
FAB... | [
"function",
"(",
"funcID",
",",
"args",
")",
"{",
"if",
"(",
"FABridge",
".",
"refCount",
">",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can ... | call an AS function | [
"call",
"an",
"AS",
"function"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1214-L1228 | |
56,326 | 5long/roil | src/console/socket.io.js | function(objID, funcName, args)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | javascript | function(objID, funcName, args)
{
if (FABridge.refCount > 0)
{
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
}
else
{
... | [
"function",
"(",
"objID",
",",
"funcName",
",",
"args",
")",
"{",
"if",
"(",
"FABridge",
".",
"refCount",
">",
"0",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTi... | call a method on an AS object | [
"call",
"a",
"method",
"on",
"an",
"AS",
"object"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1230-L1245 | |
56,327 | 5long/roil | src/console/socket.io.js | function(funcID, args)
{
var result;
var func = this.localFunctionCache[funcID];
if(func != undefined)
{
result = this.serialize(func.apply(null, this.deserialize(args)));
}
return result;
} | javascript | function(funcID, args)
{
var result;
var func = this.localFunctionCache[funcID];
if(func != undefined)
{
result = this.serialize(func.apply(null, this.deserialize(args)));
}
return result;
} | [
"function",
"(",
"funcID",
",",
"args",
")",
"{",
"var",
"result",
";",
"var",
"func",
"=",
"this",
".",
"localFunctionCache",
"[",
"funcID",
"]",
";",
"if",
"(",
"func",
"!=",
"undefined",
")",
"{",
"result",
"=",
"this",
".",
"serialize",
"(",
"fun... | callback from flash that executes a local JS function used mostly when setting js functions as callbacks on events | [
"callback",
"from",
"flash",
"that",
"executes",
"a",
"local",
"JS",
"function",
"used",
"mostly",
"when",
"setting",
"js",
"functions",
"as",
"callbacks",
"on",
"events"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1251-L1262 | |
56,328 | 5long/roil | src/console/socket.io.js | function(objID, typeName)
{
var objType = this.getTypeFromName(typeName);
instanceFactory.prototype = objType;
var instance = new instanceFactory(objID);
this.remoteInstanceCache[objID] = instance;
return instance;
} | javascript | function(objID, typeName)
{
var objType = this.getTypeFromName(typeName);
instanceFactory.prototype = objType;
var instance = new instanceFactory(objID);
this.remoteInstanceCache[objID] = instance;
return instance;
} | [
"function",
"(",
"objID",
",",
"typeName",
")",
"{",
"var",
"objType",
"=",
"this",
".",
"getTypeFromName",
"(",
"typeName",
")",
";",
"instanceFactory",
".",
"prototype",
"=",
"objType",
";",
"var",
"instance",
"=",
"new",
"instanceFactory",
"(",
"objID",
... | create an AS proxy for the given object ID and type | [
"create",
"an",
"AS",
"proxy",
"for",
"the",
"given",
"object",
"ID",
"and",
"type"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1272-L1279 | |
56,329 | 5long/roil | src/console/socket.io.js | function(typeData)
{
var newType = new ASProxy(this, typeData.name);
var accessors = typeData.accessors;
for (var i = 0; i < accessors.length; i++)
{
this.addPropertyToType(newType, accessors[i]);
}
var methods = typeData.methods;
for (v... | javascript | function(typeData)
{
var newType = new ASProxy(this, typeData.name);
var accessors = typeData.accessors;
for (var i = 0; i < accessors.length; i++)
{
this.addPropertyToType(newType, accessors[i]);
}
var methods = typeData.methods;
for (v... | [
"function",
"(",
"typeData",
")",
"{",
"var",
"newType",
"=",
"new",
"ASProxy",
"(",
"this",
",",
"typeData",
".",
"name",
")",
";",
"var",
"accessors",
"=",
"typeData",
".",
"accessors",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"acces... | accepts a type structure, returns a constructed type | [
"accepts",
"a",
"type",
"structure",
"returns",
"a",
"constructed",
"type"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1287-L1308 | |
56,330 | 5long/roil | src/console/socket.io.js | function(ty, propName)
{
var c = propName.charAt(0);
var setterName;
var getterName;
if(c >= "a" && c <= "z")
{
getterName = "get" + c.toUpperCase() + propName.substr(1);
setterName = "set" + c.toUpperCase() + propName.substr(1);
}
... | javascript | function(ty, propName)
{
var c = propName.charAt(0);
var setterName;
var getterName;
if(c >= "a" && c <= "z")
{
getterName = "get" + c.toUpperCase() + propName.substr(1);
setterName = "set" + c.toUpperCase() + propName.substr(1);
}
... | [
"function",
"(",
"ty",
",",
"propName",
")",
"{",
"var",
"c",
"=",
"propName",
".",
"charAt",
"(",
"0",
")",
";",
"var",
"setterName",
";",
"var",
"getterName",
";",
"if",
"(",
"c",
">=",
"\"a\"",
"&&",
"c",
"<=",
"\"z\"",
")",
"{",
"getterName",
... | add a property to a typename; used to define the properties that can be called on an AS proxied object | [
"add",
"a",
"property",
"to",
"a",
"typename",
";",
"used",
"to",
"define",
"the",
"properties",
"that",
"can",
"be",
"called",
"on",
"an",
"AS",
"proxied",
"object"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1311-L1334 | |
56,331 | 5long/roil | src/console/socket.io.js | function(ty, methodName)
{
ty[methodName] = function()
{
return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id, methodName, FABridge.argsToArray(arguments)));
}
} | javascript | function(ty, methodName)
{
ty[methodName] = function()
{
return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id, methodName, FABridge.argsToArray(arguments)));
}
} | [
"function",
"(",
"ty",
",",
"methodName",
")",
"{",
"ty",
"[",
"methodName",
"]",
"=",
"function",
"(",
")",
"{",
"return",
"this",
".",
"bridge",
".",
"deserialize",
"(",
"this",
".",
"bridge",
".",
"callASMethod",
"(",
"this",
".",
"fb_instance_id",
... | add a method to a typename; used to define the methods that can be callefd on an AS proxied object | [
"add",
"a",
"method",
"to",
"a",
"typename",
";",
"used",
"to",
"define",
"the",
"methods",
"that",
"can",
"be",
"callefd",
"on",
"an",
"AS",
"proxied",
"object"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1337-L1343 | |
56,332 | 5long/roil | src/console/socket.io.js | function(funcID)
{
var bridge = this;
if (this.remoteFunctionCache[funcID] == null)
{
this.remoteFunctionCache[funcID] = function()
{
bridge.callASFunction(funcID, FABridge.argsToArray(arguments));
}
}
return this.... | javascript | function(funcID)
{
var bridge = this;
if (this.remoteFunctionCache[funcID] == null)
{
this.remoteFunctionCache[funcID] = function()
{
bridge.callASFunction(funcID, FABridge.argsToArray(arguments));
}
}
return this.... | [
"function",
"(",
"funcID",
")",
"{",
"var",
"bridge",
"=",
"this",
";",
"if",
"(",
"this",
".",
"remoteFunctionCache",
"[",
"funcID",
"]",
"==",
"null",
")",
"{",
"this",
".",
"remoteFunctionCache",
"[",
"funcID",
"]",
"=",
"function",
"(",
")",
"{",
... | Function Proxies returns the AS proxy for the specified function ID | [
"Function",
"Proxies",
"returns",
"the",
"AS",
"proxy",
"for",
"the",
"specified",
"function",
"ID"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1348-L1359 | |
56,333 | 5long/roil | src/console/socket.io.js | function(func)
{
if (func.__bridge_id__ == undefined)
{
func.__bridge_id__ = this.makeID(this.nextLocalFuncID++);
this.localFunctionCache[func.__bridge_id__] = func;
}
return func.__bridge_id__;
} | javascript | function(func)
{
if (func.__bridge_id__ == undefined)
{
func.__bridge_id__ = this.makeID(this.nextLocalFuncID++);
this.localFunctionCache[func.__bridge_id__] = func;
}
return func.__bridge_id__;
} | [
"function",
"(",
"func",
")",
"{",
"if",
"(",
"func",
".",
"__bridge_id__",
"==",
"undefined",
")",
"{",
"func",
".",
"__bridge_id__",
"=",
"this",
".",
"makeID",
"(",
"this",
".",
"nextLocalFuncID",
"++",
")",
";",
"this",
".",
"localFunctionCache",
"["... | reutrns the ID of the given function; if it doesnt exist it is created and added to the local cache | [
"reutrns",
"the",
"ID",
"of",
"the",
"given",
"function",
";",
"if",
"it",
"doesnt",
"exist",
"it",
"is",
"created",
"and",
"added",
"to",
"the",
"local",
"cache"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/socket.io.js#L1362-L1370 | |
56,334 | tracker1/mssql-ng | src/connections/shadow-close.js | shadowClose | function shadowClose(connection) {
debug('shadowClose', 'start');
let close = connection.close;
connection.close = function() {
debug('connection.close','start');
//remove references
delete promises[connection._mssqlngKey];
delete connections[connection._mssqlngKey];
//close original connect... | javascript | function shadowClose(connection) {
debug('shadowClose', 'start');
let close = connection.close;
connection.close = function() {
debug('connection.close','start');
//remove references
delete promises[connection._mssqlngKey];
delete connections[connection._mssqlngKey];
//close original connect... | [
"function",
"shadowClose",
"(",
"connection",
")",
"{",
"debug",
"(",
"'shadowClose'",
",",
"'start'",
")",
";",
"let",
"close",
"=",
"connection",
".",
"close",
";",
"connection",
".",
"close",
"=",
"function",
"(",
")",
"{",
"debug",
"(",
"'connection.cl... | shadow the close method, so that it will clear itself from the pool | [
"shadow",
"the",
"close",
"method",
"so",
"that",
"it",
"will",
"clear",
"itself",
"from",
"the",
"pool"
] | 7f32135d33f9b8324fdd94656136cae4087464ce | https://github.com/tracker1/mssql-ng/blob/7f32135d33f9b8324fdd94656136cae4087464ce/src/connections/shadow-close.js#L7-L31 |
56,335 | jl-/gulp-docy | jsdoc.js | function (infos, name) {
name = name || 'jsdoc.json';
var firstFile = null;
var readme = null;
var wp = new Parser(infos);
var bufferFiles = function(file, enc, next){
if (file.isNull()) return; // ignore
if (file.isStream()) return this.emit('error', new PluginError('gulp-j... | javascript | function (infos, name) {
name = name || 'jsdoc.json';
var firstFile = null;
var readme = null;
var wp = new Parser(infos);
var bufferFiles = function(file, enc, next){
if (file.isNull()) return; // ignore
if (file.isStream()) return this.emit('error', new PluginError('gulp-j... | [
"function",
"(",
"infos",
",",
"name",
")",
"{",
"name",
"=",
"name",
"||",
"'jsdoc.json'",
";",
"var",
"firstFile",
"=",
"null",
";",
"var",
"readme",
"=",
"null",
";",
"var",
"wp",
"=",
"new",
"Parser",
"(",
"infos",
")",
";",
"var",
"bufferFiles",... | That's the plugin parser | [
"That",
"s",
"the",
"plugin",
"parser"
] | 40c2ba2da57c8ddb0a877340acc9a0604b1bafb4 | https://github.com/jl-/gulp-docy/blob/40c2ba2da57c8ddb0a877340acc9a0604b1bafb4/jsdoc.js#L29-L88 | |
56,336 | RnbWd/parse-browserify | lib/collection.js | function(model, options) {
if (!(model instanceof Parse.Object)) {
var attrs = model;
options.collection = this;
model = new this.model(attrs, options);
if (!model._validate(model.attributes, options)) {
model = false;
}
} else if (!model.collection) {
... | javascript | function(model, options) {
if (!(model instanceof Parse.Object)) {
var attrs = model;
options.collection = this;
model = new this.model(attrs, options);
if (!model._validate(model.attributes, options)) {
model = false;
}
} else if (!model.collection) {
... | [
"function",
"(",
"model",
",",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"model",
"instanceof",
"Parse",
".",
"Object",
")",
")",
"{",
"var",
"attrs",
"=",
"model",
";",
"options",
".",
"collection",
"=",
"this",
";",
"model",
"=",
"new",
"this",
"... | Prepare a model or hash of attributes to be added to this collection. | [
"Prepare",
"a",
"model",
"or",
"hash",
"of",
"attributes",
"to",
"be",
"added",
"to",
"this",
"collection",
"."
] | c19c1b798e4010a552e130b1a9ce3b5d084dc101 | https://github.com/RnbWd/parse-browserify/blob/c19c1b798e4010a552e130b1a9ce3b5d084dc101/lib/collection.js#L372-L384 | |
56,337 | d08ble/livecomment | livecomment.js | _configGetExtLang | function _configGetExtLang(filext) {
var fileext1 = filext.indexOf('.') == 0 ? fileext.substring(1, filext.length) : fileext;
if (!config.extlangs.hasOwnProperty(fileext1))
return null;
return config.extlangs[fileext1];
} | javascript | function _configGetExtLang(filext) {
var fileext1 = filext.indexOf('.') == 0 ? fileext.substring(1, filext.length) : fileext;
if (!config.extlangs.hasOwnProperty(fileext1))
return null;
return config.extlangs[fileext1];
} | [
"function",
"_configGetExtLang",
"(",
"filext",
")",
"{",
"var",
"fileext1",
"=",
"filext",
".",
"indexOf",
"(",
"'.'",
")",
"==",
"0",
"?",
"fileext",
".",
"substring",
"(",
"1",
",",
"filext",
".",
"length",
")",
":",
"fileext",
";",
"if",
"(",
"!"... | CHECK EXTLANG [ | [
"CHECK",
"EXTLANG",
"["
] | 9c4a00878101501411668070b4f6e7719e10d1fd | https://github.com/d08ble/livecomment/blob/9c4a00878101501411668070b4f6e7719e10d1fd/livecomment.js#L750-L756 |
56,338 | d08ble/livecomment | livecomment.js | extractCommentTagFromLine | function extractCommentTagFromLine(fileext, line) {
line = line.trim();
// CHECK FORMAT [
var b;
function chkfmt(b) {
if (line.indexOf(b) == 0 && line.indexOf('[') == line.length-1) // begin
return [line.substr(b.length, line.length-b.length-1).trim(), 0... | javascript | function extractCommentTagFromLine(fileext, line) {
line = line.trim();
// CHECK FORMAT [
var b;
function chkfmt(b) {
if (line.indexOf(b) == 0 && line.indexOf('[') == line.length-1) // begin
return [line.substr(b.length, line.length-b.length-1).trim(), 0... | [
"function",
"extractCommentTagFromLine",
"(",
"fileext",
",",
"line",
")",
"{",
"line",
"=",
"line",
".",
"trim",
"(",
")",
";",
"// CHECK FORMAT [",
"var",
"b",
";",
"function",
"chkfmt",
"(",
"b",
")",
"{",
"if",
"(",
"line",
".",
"indexOf",
"(",
"b"... | custom comment format use config.extractCommentTagFromLine [ | [
"custom",
"comment",
"format",
"use",
"config",
".",
"extractCommentTagFromLine",
"["
] | 9c4a00878101501411668070b4f6e7719e10d1fd | https://github.com/d08ble/livecomment/blob/9c4a00878101501411668070b4f6e7719e10d1fd/livecomment.js#L778-L821 |
56,339 | RnbWd/parse-browserify | lib/analytics.js | function(name, dimensions) {
name = name || '';
name = name.replace(/^\s*/, '');
name = name.replace(/\s*$/, '');
if (name.length === 0) {
throw 'A name for the custom event must be provided';
}
_.each(dimensions, function(val, key) {
if (!_.isString(key) || !_.isStr... | javascript | function(name, dimensions) {
name = name || '';
name = name.replace(/^\s*/, '');
name = name.replace(/\s*$/, '');
if (name.length === 0) {
throw 'A name for the custom event must be provided';
}
_.each(dimensions, function(val, key) {
if (!_.isString(key) || !_.isStr... | [
"function",
"(",
"name",
",",
"dimensions",
")",
"{",
"name",
"=",
"name",
"||",
"''",
";",
"name",
"=",
"name",
".",
"replace",
"(",
"/",
"^\\s*",
"/",
",",
"''",
")",
";",
"name",
"=",
"name",
".",
"replace",
"(",
"/",
"\\s*$",
"/",
",",
"''"... | Tracks the occurrence of a custom event with additional dimensions.
Parse will store a data point at the time of invocation with the given
event name.
Dimensions will allow segmentation of the occurrences of this custom
event. Keys and values should be {@code String}s, and will throw
otherwise.
To track a user signup... | [
"Tracks",
"the",
"occurrence",
"of",
"a",
"custom",
"event",
"with",
"additional",
"dimensions",
".",
"Parse",
"will",
"store",
"a",
"data",
"point",
"at",
"the",
"time",
"of",
"invocation",
"with",
"the",
"given",
"event",
"name",
"."
] | c19c1b798e4010a552e130b1a9ce3b5d084dc101 | https://github.com/RnbWd/parse-browserify/blob/c19c1b798e4010a552e130b1a9ce3b5d084dc101/lib/analytics.js#L40-L60 | |
56,340 | relief-melone/limitpromises | src/services/service.retryPromiseTimeout.js | retryPromiseTimeout | function retryPromiseTimeout(PromiseFunc, Obj, Options){
let timeoutOpts = Options.Timeout;
limitpromises = limitpromises || require('../limitpromises');
setTimeout( () => {
if(Obj.isRunning && Obj.attempt <= timeoutOpts.retryAttempts){
// Put a new promise on the same stack as... | javascript | function retryPromiseTimeout(PromiseFunc, Obj, Options){
let timeoutOpts = Options.Timeout;
limitpromises = limitpromises || require('../limitpromises');
setTimeout( () => {
if(Obj.isRunning && Obj.attempt <= timeoutOpts.retryAttempts){
// Put a new promise on the same stack as... | [
"function",
"retryPromiseTimeout",
"(",
"PromiseFunc",
",",
"Obj",
",",
"Options",
")",
"{",
"let",
"timeoutOpts",
"=",
"Options",
".",
"Timeout",
";",
"limitpromises",
"=",
"limitpromises",
"||",
"require",
"(",
"'../limitpromises'",
")",
";",
"setTimeout",
"("... | Handles Timeout of promises
@public
@param {Function} PromiseFunc Function that returns a Promise with one InputParameter that is used
@param {Object} Obj The Object holding the current Promise request
@param {Object} Options Options that have been specified by the user
@returns {void} | [
"Handles",
"Timeout",
"of",
"promises"
] | 1735b92749740204b597c1c6026257d54ade8200 | https://github.com/relief-melone/limitpromises/blob/1735b92749740204b597c1c6026257d54ade8200/src/services/service.retryPromiseTimeout.js#L17-L56 |
56,341 | Zingle/http-later-redis | index.js | queue | function queue(task, done) {
var storage = this,
key = this.keygen(task);
// store task as JSON serialized string
task = JSON.stringify(task);
// first add the key to the queue
this.redis().rpush(this.queueKey(), key, function(err) {
if (err) done(err);
// now store task d... | javascript | function queue(task, done) {
var storage = this,
key = this.keygen(task);
// store task as JSON serialized string
task = JSON.stringify(task);
// first add the key to the queue
this.redis().rpush(this.queueKey(), key, function(err) {
if (err) done(err);
// now store task d... | [
"function",
"queue",
"(",
"task",
",",
"done",
")",
"{",
"var",
"storage",
"=",
"this",
",",
"key",
"=",
"this",
".",
"keygen",
"(",
"task",
")",
";",
"// store task as JSON serialized string",
"task",
"=",
"JSON",
".",
"stringify",
"(",
"task",
")",
";"... | Queue a serialized request and pass the storage key to the callback.
@param {object} task
@param {function} done | [
"Queue",
"a",
"serialized",
"request",
"and",
"pass",
"the",
"storage",
"key",
"to",
"the",
"callback",
"."
] | 43008afabb2800400557a66857d41818e22b0623 | https://github.com/Zingle/http-later-redis/blob/43008afabb2800400557a66857d41818e22b0623/index.js#L10-L27 |
56,342 | Zingle/http-later-redis | index.js | unqueue | function unqueue(done) {
var storage = this;
this.redis().lpop(this.queueKey(), function(err, key) {
if (err) return done(err);
storage.redis().get(key, function(err, task) {
if (err) return done(err);
if (!task) return done();
storage.redis().del(key);
... | javascript | function unqueue(done) {
var storage = this;
this.redis().lpop(this.queueKey(), function(err, key) {
if (err) return done(err);
storage.redis().get(key, function(err, task) {
if (err) return done(err);
if (!task) return done();
storage.redis().del(key);
... | [
"function",
"unqueue",
"(",
"done",
")",
"{",
"var",
"storage",
"=",
"this",
";",
"this",
".",
"redis",
"(",
")",
".",
"lpop",
"(",
"this",
".",
"queueKey",
"(",
")",
",",
"function",
"(",
"err",
",",
"key",
")",
"{",
"if",
"(",
"err",
")",
"re... | Remove a task from the queue and pass it to the callback.
@param {function} done | [
"Remove",
"a",
"task",
"from",
"the",
"queue",
"and",
"pass",
"it",
"to",
"the",
"callback",
"."
] | 43008afabb2800400557a66857d41818e22b0623 | https://github.com/Zingle/http-later-redis/blob/43008afabb2800400557a66857d41818e22b0623/index.js#L33-L47 |
56,343 | Zingle/http-later-redis | index.js | log | function log(key, result, done) {
var storage = this;
// store result as JSON serialized string
result = JSON.stringify(result);
// generate result key from task key
key = key + "-result";
// first add the key to the log
this.redis().rpush(this.logKey(), key, function(err) {
... | javascript | function log(key, result, done) {
var storage = this;
// store result as JSON serialized string
result = JSON.stringify(result);
// generate result key from task key
key = key + "-result";
// first add the key to the log
this.redis().rpush(this.logKey(), key, function(err) {
... | [
"function",
"log",
"(",
"key",
",",
"result",
",",
"done",
")",
"{",
"var",
"storage",
"=",
"this",
";",
"// store result as JSON serialized string",
"result",
"=",
"JSON",
".",
"stringify",
"(",
"result",
")",
";",
"// generate result key from task key",
"key",
... | Log task result.
@param {string} key
@param {object} result
@param {function} done | [
"Log",
"task",
"result",
"."
] | 43008afabb2800400557a66857d41818e22b0623 | https://github.com/Zingle/http-later-redis/blob/43008afabb2800400557a66857d41818e22b0623/index.js#L55-L71 |
56,344 | redisjs/jsr-log | lib/logger.js | Logger | function Logger() {
this._level = LEVELS.NOTICE;
this._out = process.stdout;
this._err = process.stderr;
/* istanbul ignore next: allow server to suppress logs */
if(process.env.NODE_ENV === Constants.TEST && !process.env.TEST_DEBUG) {
this.log = function noop(){};
}
} | javascript | function Logger() {
this._level = LEVELS.NOTICE;
this._out = process.stdout;
this._err = process.stderr;
/* istanbul ignore next: allow server to suppress logs */
if(process.env.NODE_ENV === Constants.TEST && !process.env.TEST_DEBUG) {
this.log = function noop(){};
}
} | [
"function",
"Logger",
"(",
")",
"{",
"this",
".",
"_level",
"=",
"LEVELS",
".",
"NOTICE",
";",
"this",
".",
"_out",
"=",
"process",
".",
"stdout",
";",
"this",
".",
"_err",
"=",
"process",
".",
"stderr",
";",
"/* istanbul ignore next: allow server to suppres... | Create a logger. | [
"Create",
"a",
"logger",
"."
] | a67a34285449b0d731493def58d8a5212aad5526 | https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logger.js#L60-L69 |
56,345 | redisjs/jsr-log | lib/logger.js | level | function level(lvl) {
if(!lvl) return this._level;
if(!~LEVELS.indexOf(lvl)) {
throw new Error('invalid log level: ' + lvl);
}
this._level = lvl;
return this._level;
} | javascript | function level(lvl) {
if(!lvl) return this._level;
if(!~LEVELS.indexOf(lvl)) {
throw new Error('invalid log level: ' + lvl);
}
this._level = lvl;
return this._level;
} | [
"function",
"level",
"(",
"lvl",
")",
"{",
"if",
"(",
"!",
"lvl",
")",
"return",
"this",
".",
"_level",
";",
"if",
"(",
"!",
"~",
"LEVELS",
".",
"indexOf",
"(",
"lvl",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'invalid log level: '",
"+",
"lvl"... | Get or set the log level. | [
"Get",
"or",
"set",
"the",
"log",
"level",
"."
] | a67a34285449b0d731493def58d8a5212aad5526 | https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logger.js#L107-L114 |
56,346 | redisjs/jsr-log | lib/logger.js | warning | function warning() {
var args = [LEVELS.WARNING].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | javascript | function warning() {
var args = [LEVELS.WARNING].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | [
"function",
"warning",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"LEVELS",
".",
"WARNING",
"]",
".",
"concat",
"(",
"slice",
".",
"apply",
"(",
"arguments",
")",
")",
";",
"return",
"this",
".",
"log",
".",
"apply",
"(",
"this",
",",
"args",
")",
"... | Log a warning message. | [
"Log",
"a",
"warning",
"message",
"."
] | a67a34285449b0d731493def58d8a5212aad5526 | https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logger.js#L145-L148 |
56,347 | redisjs/jsr-log | lib/logger.js | notice | function notice() {
var args = [LEVELS.NOTICE].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | javascript | function notice() {
var args = [LEVELS.NOTICE].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | [
"function",
"notice",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"LEVELS",
".",
"NOTICE",
"]",
".",
"concat",
"(",
"slice",
".",
"apply",
"(",
"arguments",
")",
")",
";",
"return",
"this",
".",
"log",
".",
"apply",
"(",
"this",
",",
"args",
")",
";"... | Log a notice message. | [
"Log",
"a",
"notice",
"message",
"."
] | a67a34285449b0d731493def58d8a5212aad5526 | https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logger.js#L153-L156 |
56,348 | redisjs/jsr-log | lib/logger.js | verbose | function verbose() {
var args = [LEVELS.VERBOSE].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | javascript | function verbose() {
var args = [LEVELS.VERBOSE].concat(slice.apply(arguments));
return this.log.apply(this, args);
} | [
"function",
"verbose",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"LEVELS",
".",
"VERBOSE",
"]",
".",
"concat",
"(",
"slice",
".",
"apply",
"(",
"arguments",
")",
")",
";",
"return",
"this",
".",
"log",
".",
"apply",
"(",
"this",
",",
"args",
")",
"... | Log a verbose message. | [
"Log",
"a",
"verbose",
"message",
"."
] | a67a34285449b0d731493def58d8a5212aad5526 | https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logger.js#L161-L164 |
56,349 | ahwayakchih/serve-files | index.js | createConfiguration | function createConfiguration (options) {
const cfg = Object.assign({
followSymbolicLinks: false,
cacheTimeInSeconds : 0,
documentRoot : process.cwd(),
parsedURLName : 'urlParsed',
getFilePath : getFilePath,
getFileStats : getFileStats,
getResponseData : getResponseData,
stand... | javascript | function createConfiguration (options) {
const cfg = Object.assign({
followSymbolicLinks: false,
cacheTimeInSeconds : 0,
documentRoot : process.cwd(),
parsedURLName : 'urlParsed',
getFilePath : getFilePath,
getFileStats : getFileStats,
getResponseData : getResponseData,
stand... | [
"function",
"createConfiguration",
"(",
"options",
")",
"{",
"const",
"cfg",
"=",
"Object",
".",
"assign",
"(",
"{",
"followSymbolicLinks",
":",
"false",
",",
"cacheTimeInSeconds",
":",
"0",
",",
"documentRoot",
":",
"process",
".",
"cwd",
"(",
")",
",",
"... | Configuration object.
@typedef {Object} configuration
@property {boolean} followSymbolicLinks=false
@property {number} cacheTimeInSeconds=0
@property {string} documentRoot=process.cwd()
@property {string} parsedURLName='urlParsed'
@property {Function} getFilePath
@property {Function} getFileStats
@p... | [
"Configuration",
"object",
"."
] | cd949252a37210bec229146ab519534ef641e942 | https://github.com/ahwayakchih/serve-files/blob/cd949252a37210bec229146ab519534ef641e942/index.js#L67-L88 |
56,350 | ahwayakchih/serve-files | index.js | getFileStats | function getFileStats (cfg, filePath, callback) {
fs.realpath(filePath, function (err, realpath) {
// On Windows we can get different cases for the same disk letter :/.
let checkPath = realpath;
if (os.platform() === 'win32' && realpath) {
checkPath = realpath.toLowerCase();
}
if (err || checkPath.indexO... | javascript | function getFileStats (cfg, filePath, callback) {
fs.realpath(filePath, function (err, realpath) {
// On Windows we can get different cases for the same disk letter :/.
let checkPath = realpath;
if (os.platform() === 'win32' && realpath) {
checkPath = realpath.toLowerCase();
}
if (err || checkPath.indexO... | [
"function",
"getFileStats",
"(",
"cfg",
",",
"filePath",
",",
"callback",
")",
"{",
"fs",
".",
"realpath",
"(",
"filePath",
",",
"function",
"(",
"err",
",",
"realpath",
")",
"{",
"// On Windows we can get different cases for the same disk letter :/.",
"let",
"check... | Calls back with error or null and fs.Stats object as second parameter.
fs.Stats object is extended with `path` property.
@param {!module:serve-files~configuration} cfg
@param {!string} cfg.documentRootReal
@param {string} [cfg.followSymbolicLinks=false]
@param {!str... | [
"Calls",
"back",
"with",
"error",
"or",
"null",
"and",
"fs",
".",
"Stats",
"object",
"as",
"second",
"parameter",
".",
"fs",
".",
"Stats",
"object",
"is",
"extended",
"with",
"path",
"property",
"."
] | cd949252a37210bec229146ab519534ef641e942 | https://github.com/ahwayakchih/serve-files/blob/cd949252a37210bec229146ab519534ef641e942/index.js#L118-L140 |
56,351 | ahwayakchih/serve-files | index.js | getResponseDataWhole | function getResponseDataWhole (fileStats/* , headers*/) {
return {
body : fs.createReadStream(fileStats.path),
statusCode: HTTP_CODES.OK,
headers : {
'Content-Type' : mime(fileStats.path),
'Content-Length': fileStats.size,
'Last-Modified' : fileStats.mtime.toUTCString()
}
};
} | javascript | function getResponseDataWhole (fileStats/* , headers*/) {
return {
body : fs.createReadStream(fileStats.path),
statusCode: HTTP_CODES.OK,
headers : {
'Content-Type' : mime(fileStats.path),
'Content-Length': fileStats.size,
'Last-Modified' : fileStats.mtime.toUTCString()
}
};
} | [
"function",
"getResponseDataWhole",
"(",
"fileStats",
"/* , headers*/",
")",
"{",
"return",
"{",
"body",
":",
"fs",
".",
"createReadStream",
"(",
"fileStats",
".",
"path",
")",
",",
"statusCode",
":",
"HTTP_CODES",
".",
"OK",
",",
"headers",
":",
"{",
"'Cont... | Creates responseData object with body set to readable stream of requested file.
@param {!external:"fs.Stats"} fileStats
@param {!string} fileStats.path path to the file in local filesystem
@param {!Date} fileStats.mtime date of last modification of file content
@param {!Number} ... | [
"Creates",
"responseData",
"object",
"with",
"body",
"set",
"to",
"readable",
"stream",
"of",
"requested",
"file",
"."
] | cd949252a37210bec229146ab519534ef641e942 | https://github.com/ahwayakchih/serve-files/blob/cd949252a37210bec229146ab519534ef641e942/index.js#L286-L296 |
56,352 | ahwayakchih/serve-files | index.js | createFileResponseHandler | function createFileResponseHandler (options) {
const cfg = createConfiguration(options);
if (cfg instanceof Error) {
return cfg;
}
/**
* @private
* @param {!external:"http.IncomingMessage"} req
* @param {!external:"http.ServerResponse"} res
* @param {Function} [callback] calle... | javascript | function createFileResponseHandler (options) {
const cfg = createConfiguration(options);
if (cfg instanceof Error) {
return cfg;
}
/**
* @private
* @param {!external:"http.IncomingMessage"} req
* @param {!external:"http.ServerResponse"} res
* @param {Function} [callback] calle... | [
"function",
"createFileResponseHandler",
"(",
"options",
")",
"{",
"const",
"cfg",
"=",
"createConfiguration",
"(",
"options",
")",
";",
"if",
"(",
"cfg",
"instanceof",
"Error",
")",
"{",
"return",
"cfg",
";",
"}",
"/**\n\t * @private\n\t * @param {!external:\"http.... | Create function that will handle serving files.
@example
var fileHandler = serveFiles();
var server = http.createServer(function (req, res) {
fileHandler(req, res, err => console.error(err));
});
@param {object} [options]
@param {boolean} [options.followSymbolicLinks=false] symbolic links will not be followed by ... | [
"Create",
"function",
"that",
"will",
"handle",
"serving",
"files",
"."
] | cd949252a37210bec229146ab519534ef641e942 | https://github.com/ahwayakchih/serve-files/blob/cd949252a37210bec229146ab519534ef641e942/index.js#L389-L421 |
56,353 | mcgaryes/grunt-combine | tasks/combine.js | function(inputIndex) {
_.each(tokens, function(token, index) {
// determain whether or not this is a file reference or a string
if(token.file) {
// read the file and reset replacement to what was loaded
fs.readFile(token.file, 'utf8',... | javascript | function(inputIndex) {
_.each(tokens, function(token, index) {
// determain whether or not this is a file reference or a string
if(token.file) {
// read the file and reset replacement to what was loaded
fs.readFile(token.file, 'utf8',... | [
"function",
"(",
"inputIndex",
")",
"{",
"_",
".",
"each",
"(",
"tokens",
",",
"function",
"(",
"token",
",",
"index",
")",
"{",
"// determain whether or not this is a file reference or a string",
"if",
"(",
"token",
".",
"file",
")",
"{",
"// read the file and re... | Processes all of the passed replacements
@for grunt-combine
@method processReplacements | [
"Processes",
"all",
"of",
"the",
"passed",
"replacements"
] | 18a330b48f3eab4ec7af75f3c436294bf6f41319 | https://github.com/mcgaryes/grunt-combine/blob/18a330b48f3eab4ec7af75f3c436294bf6f41319/tasks/combine.js#L93-L117 | |
56,354 | mcgaryes/grunt-combine | tasks/combine.js | function(inputIndex) {
var inputPath = input[inputIndex].split("/");
inputPath = inputPath[inputPath.length - 1];
var path = outputIsPath ? output + inputPath : output;
// write the input string to the output file name
grunt.log.writeln('Writing Output: ' + ... | javascript | function(inputIndex) {
var inputPath = input[inputIndex].split("/");
inputPath = inputPath[inputPath.length - 1];
var path = outputIsPath ? output + inputPath : output;
// write the input string to the output file name
grunt.log.writeln('Writing Output: ' + ... | [
"function",
"(",
"inputIndex",
")",
"{",
"var",
"inputPath",
"=",
"input",
"[",
"inputIndex",
"]",
".",
"split",
"(",
"\"/\"",
")",
";",
"inputPath",
"=",
"inputPath",
"[",
"inputPath",
".",
"length",
"-",
"1",
"]",
";",
"var",
"path",
"=",
"outputIsPa... | Writes the processed input file to the specified output name.
@for grunt-combine
@method findAndReplaceTokens | [
"Writes",
"the",
"processed",
"input",
"file",
"to",
"the",
"specified",
"output",
"name",
"."
] | 18a330b48f3eab4ec7af75f3c436294bf6f41319 | https://github.com/mcgaryes/grunt-combine/blob/18a330b48f3eab4ec7af75f3c436294bf6f41319/tasks/combine.js#L164-L190 | |
56,355 | posttool/currentcms | examples/store/public/js/$$.js | string_component | function string_component(self, message, component) {
eventify(self);
valuable(self, update, '');
var $c = $$().addClass('control');
var $l = $("<label>" + message + "</label>");
var $i = $(component);
$c.append($l, $i);
self.$el = $c;
function update() {
$i.val(self._data);
}
$i.on('change', f... | javascript | function string_component(self, message, component) {
eventify(self);
valuable(self, update, '');
var $c = $$().addClass('control');
var $l = $("<label>" + message + "</label>");
var $i = $(component);
$c.append($l, $i);
self.$el = $c;
function update() {
$i.val(self._data);
}
$i.on('change', f... | [
"function",
"string_component",
"(",
"self",
",",
"message",
",",
"component",
")",
"{",
"eventify",
"(",
"self",
")",
";",
"valuable",
"(",
"self",
",",
"update",
",",
"''",
")",
";",
"var",
"$c",
"=",
"$$",
"(",
")",
".",
"addClass",
"(",
"'control... | simple component ! | [
"simple",
"component",
"!"
] | 9afc9f907bad3b018d961af66c3abb33cd82b051 | https://github.com/posttool/currentcms/blob/9afc9f907bad3b018d961af66c3abb33cd82b051/examples/store/public/js/$$.js#L168-L184 |
56,356 | posttool/currentcms | examples/store/public/js/$$.js | attributable | function attributable(form, c, name) {
if (form._vals == null)
form._vals = {};
if (form._update == null)
form._update = function () {
for (var p in form._vals)
form._vals[p].data == form._data[p];
}
form._vals[name] = c;
c.on('change', function () {
form._data[name] = c.data;
... | javascript | function attributable(form, c, name) {
if (form._vals == null)
form._vals = {};
if (form._update == null)
form._update = function () {
for (var p in form._vals)
form._vals[p].data == form._data[p];
}
form._vals[name] = c;
c.on('change', function () {
form._data[name] = c.data;
... | [
"function",
"attributable",
"(",
"form",
",",
"c",
",",
"name",
")",
"{",
"if",
"(",
"form",
".",
"_vals",
"==",
"null",
")",
"form",
".",
"_vals",
"=",
"{",
"}",
";",
"if",
"(",
"form",
".",
"_update",
"==",
"null",
")",
"form",
".",
"_update",
... | form field utility | [
"form",
"field",
"utility"
] | 9afc9f907bad3b018d961af66c3abb33cd82b051 | https://github.com/posttool/currentcms/blob/9afc9f907bad3b018d961af66c3abb33cd82b051/examples/store/public/js/$$.js#L240-L253 |
56,357 | grydstedt/uservoice-sso | lib/index.js | UserVoiceSSO | function UserVoiceSSO(subdomain, ssoKey) {
// For UserVoice, the subdomain is used as password
// and the ssoKey is used as salt
this.subdomain = subdomain;
this.ssoKey = ssoKey;
if(!this.subdomain) {
throw new Error('No UserVoice subdomain given');
}
if(!this.ssoKey) {
throw new Error('No SSO ... | javascript | function UserVoiceSSO(subdomain, ssoKey) {
// For UserVoice, the subdomain is used as password
// and the ssoKey is used as salt
this.subdomain = subdomain;
this.ssoKey = ssoKey;
if(!this.subdomain) {
throw new Error('No UserVoice subdomain given');
}
if(!this.ssoKey) {
throw new Error('No SSO ... | [
"function",
"UserVoiceSSO",
"(",
"subdomain",
",",
"ssoKey",
")",
"{",
"// For UserVoice, the subdomain is used as password",
"// and the ssoKey is used as salt",
"this",
".",
"subdomain",
"=",
"subdomain",
";",
"this",
".",
"ssoKey",
"=",
"ssoKey",
";",
"if",
"(",
"!... | UserVoice SSO Contstructor
@param {String} subdomain Subdomain name
@param {String} ssoKey SSO key | [
"UserVoice",
"SSO",
"Contstructor"
] | 89a1e4dc0d72e964840c3e3e106cfeb12fc688cc | https://github.com/grydstedt/uservoice-sso/blob/89a1e4dc0d72e964840c3e3e106cfeb12fc688cc/lib/index.js#L24-L40 |
56,358 | stormpython/jubilee | build/jubilee.js | getDomain | function getDomain(data, accessor) {
return data
.map(function (item) {
return accessor.call(this, item);
})
.filter(function (item, index, array) {
return array.indexOf(item) === index;
});
} | javascript | function getDomain(data, accessor) {
return data
.map(function (item) {
return accessor.call(this, item);
})
.filter(function (item, index, array) {
return array.indexOf(item) === index;
});
} | [
"function",
"getDomain",
"(",
"data",
",",
"accessor",
")",
"{",
"return",
"data",
".",
"map",
"(",
"function",
"(",
"item",
")",
"{",
"return",
"accessor",
".",
"call",
"(",
"this",
",",
"item",
")",
";",
"}",
")",
".",
"filter",
"(",
"function",
... | Creates a unique array of items | [
"Creates",
"a",
"unique",
"array",
"of",
"items"
] | 8263cec31ccfbef38e77229a5baaa7b337c6eefc | https://github.com/stormpython/jubilee/blob/8263cec31ccfbef38e77229a5baaa7b337c6eefc/build/jubilee.js#L11509-L11517 |
56,359 | brianshaler/kerplunk-server | assets/js/ba-routematcher.js | validateRule | function validateRule(rule, value) {
// For a given rule, get the first letter of the string name of its
// constructor function. "R" -> RegExp, "F" -> Function (these shouldn't
// conflict with any other types one might specify). Note: instead of
// getting .toString from a new object {} or Object.prot... | javascript | function validateRule(rule, value) {
// For a given rule, get the first letter of the string name of its
// constructor function. "R" -> RegExp, "F" -> Function (these shouldn't
// conflict with any other types one might specify). Note: instead of
// getting .toString from a new object {} or Object.prot... | [
"function",
"validateRule",
"(",
"rule",
",",
"value",
")",
"{",
"// For a given rule, get the first letter of the string name of its",
"// constructor function. \"R\" -> RegExp, \"F\" -> Function (these shouldn't",
"// conflict with any other types one might specify). Note: instead of",
"// g... | Test to see if a value matches the corresponding rule. | [
"Test",
"to",
"see",
"if",
"a",
"value",
"matches",
"the",
"corresponding",
"rule",
"."
] | f4ee71f2893a811b4968beace7a1ba0b8ea45182 | https://github.com/brianshaler/kerplunk-server/blob/f4ee71f2893a811b4968beace7a1ba0b8ea45182/assets/js/ba-routematcher.js#L13-L25 |
56,360 | emitdb/dotfile | index.js | Dotfile | function Dotfile(basename, options) {
this.basename = basename;
this.extname = '.json';
this.dirname = (options && typeof options.dirname === 'string') ? options.dirname : Dotfile._tilde;
this.filepath = path.join(this.dirname, '.' + this.basename + this.extname);
} | javascript | function Dotfile(basename, options) {
this.basename = basename;
this.extname = '.json';
this.dirname = (options && typeof options.dirname === 'string') ? options.dirname : Dotfile._tilde;
this.filepath = path.join(this.dirname, '.' + this.basename + this.extname);
} | [
"function",
"Dotfile",
"(",
"basename",
",",
"options",
")",
"{",
"this",
".",
"basename",
"=",
"basename",
";",
"this",
".",
"extname",
"=",
"'.json'",
";",
"this",
".",
"dirname",
"=",
"(",
"options",
"&&",
"typeof",
"options",
".",
"dirname",
"===",
... | Class to easily manage dot files
@param {String} basename What to name this dotfile
@author dscape | [
"Class",
"to",
"easily",
"manage",
"dot",
"files"
] | 1d1f226b5d64d1c10876ee7d37f55feee2b96aa4 | https://github.com/emitdb/dotfile/blob/1d1f226b5d64d1c10876ee7d37f55feee2b96aa4/index.js#L12-L17 |
56,361 | bredele/regurgitate | index.js | transform | function transform(value) {
if(typeof value === 'function') value = value()
if(value instanceof Array) {
var el = document.createDocumentFragment()
value.map(item => el.appendChild(transform(item)))
value = el
} else if(typeof value === 'object') {
if(typeof value.then === 'function') {
var tmp = ... | javascript | function transform(value) {
if(typeof value === 'function') value = value()
if(value instanceof Array) {
var el = document.createDocumentFragment()
value.map(item => el.appendChild(transform(item)))
value = el
} else if(typeof value === 'object') {
if(typeof value.then === 'function') {
var tmp = ... | [
"function",
"transform",
"(",
"value",
")",
"{",
"if",
"(",
"typeof",
"value",
"===",
"'function'",
")",
"value",
"=",
"value",
"(",
")",
"if",
"(",
"value",
"instanceof",
"Array",
")",
"{",
"var",
"el",
"=",
"document",
".",
"createDocumentFragment",
"(... | Transform value.
@param {Any|Function|Promise} value
@return {Element}
@api private | [
"Transform",
"value",
"."
] | 313711f6871b083722a907353197f1ee27ad87c1 | https://github.com/bredele/regurgitate/blob/313711f6871b083722a907353197f1ee27ad87c1/index.js#L25-L48 |
56,362 | dinvio/dinvio-js-sdk | lib/Requests.js | Requests | function Requests(apiUrl, version, publicKey) {
this.apiUrl = stripSlashes(apiUrl);
this.version = version.toString();
this.publicKey = publicKey;
} | javascript | function Requests(apiUrl, version, publicKey) {
this.apiUrl = stripSlashes(apiUrl);
this.version = version.toString();
this.publicKey = publicKey;
} | [
"function",
"Requests",
"(",
"apiUrl",
",",
"version",
",",
"publicKey",
")",
"{",
"this",
".",
"apiUrl",
"=",
"stripSlashes",
"(",
"apiUrl",
")",
";",
"this",
".",
"version",
"=",
"version",
".",
"toString",
"(",
")",
";",
"this",
".",
"publicKey",
"=... | Dinvio API Requests module
@param {string} apiUrl
@param {string|number} version
@param {string} publicKey
@constructor | [
"Dinvio",
"API",
"Requests",
"module"
] | 24e960a3670841ff924d10e2a091b23c38a05dd4 | https://github.com/dinvio/dinvio-js-sdk/blob/24e960a3670841ff924d10e2a091b23c38a05dd4/lib/Requests.js#L15-L19 |
56,363 | hl198181/neptune | misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js | function(id) {
var file;
if (typeof id === 'number') {
file = this.uploader.files[id];
} else {
file = this.uploader.getFile(id);
}
return file;
} | javascript | function(id) {
var file;
if (typeof id === 'number') {
file = this.uploader.files[id];
} else {
file = this.uploader.getFile(id);
}
return file;
} | [
"function",
"(",
"id",
")",
"{",
"var",
"file",
";",
"if",
"(",
"typeof",
"id",
"===",
"'number'",
")",
"{",
"file",
"=",
"this",
".",
"uploader",
".",
"files",
"[",
"id",
"]",
";",
"}",
"else",
"{",
"file",
"=",
"this",
".",
"uploader",
".",
"... | Retrieve file by it's unique id.
@method getFile
@param {String} id Unique id of the file
@return {plupload.File} | [
"Retrieve",
"file",
"by",
"it",
"s",
"unique",
"id",
"."
] | 88030bb4222945900e6a225469380cc43a016c13 | https://github.com/hl198181/neptune/blob/88030bb4222945900e6a225469380cc43a016c13/misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js#L700-L709 | |
56,364 | hl198181/neptune | misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js | function(file) {
if (plupload.typeOf(file) === 'string') {
file = this.getFile(file);
}
this.uploader.removeFile(file);
} | javascript | function(file) {
if (plupload.typeOf(file) === 'string') {
file = this.getFile(file);
}
this.uploader.removeFile(file);
} | [
"function",
"(",
"file",
")",
"{",
"if",
"(",
"plupload",
".",
"typeOf",
"(",
"file",
")",
"===",
"'string'",
")",
"{",
"file",
"=",
"this",
".",
"getFile",
"(",
"file",
")",
";",
"}",
"this",
".",
"uploader",
".",
"removeFile",
"(",
"file",
")",
... | Remove the file from the queue.
@method removeFile
@param {plupload.File|String} file File to remove, might be specified directly or by it's unique id | [
"Remove",
"the",
"file",
"from",
"the",
"queue",
"."
] | 88030bb4222945900e6a225469380cc43a016c13 | https://github.com/hl198181/neptune/blob/88030bb4222945900e6a225469380cc43a016c13/misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js#L728-L733 | |
56,365 | hl198181/neptune | misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js | function(type, message) {
var popup = $(
'<div class="plupload_message">' +
'<span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+_('Close')+'"></span>' +
'<p><span class="ui-icon"></span>' + message + '</p>' +
'</div>'
);
popup
.addClass('ui-state-' + (type === 'erro... | javascript | function(type, message) {
var popup = $(
'<div class="plupload_message">' +
'<span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+_('Close')+'"></span>' +
'<p><span class="ui-icon"></span>' + message + '</p>' +
'</div>'
);
popup
.addClass('ui-state-' + (type === 'erro... | [
"function",
"(",
"type",
",",
"message",
")",
"{",
"var",
"popup",
"=",
"$",
"(",
"'<div class=\"plupload_message\">'",
"+",
"'<span class=\"plupload_message_close ui-icon ui-icon-circle-close\" title=\"'",
"+",
"_",
"(",
"'Close'",
")",
"+",
"'\"></span>'",
"+",
"'<p><... | Display a message in notification area.
@method notify
@param {Enum} type Type of the message, either `error` or `info`
@param {String} message The text message to display. | [
"Display",
"a",
"message",
"in",
"notification",
"area",
"."
] | 88030bb4222945900e6a225469380cc43a016c13 | https://github.com/hl198181/neptune/blob/88030bb4222945900e6a225469380cc43a016c13/misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js#L777-L797 | |
56,366 | hl198181/neptune | misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js | function() {
// destroy uploader instance
this.uploader.destroy();
// unbind all button events
$('.plupload_button', this.element).unbind();
// destroy buttons
if ($.ui.button) {
$('.plupload_add, .plupload_start, .plupload_stop', this.container)
.button('destroy');
}
// destroy progress... | javascript | function() {
// destroy uploader instance
this.uploader.destroy();
// unbind all button events
$('.plupload_button', this.element).unbind();
// destroy buttons
if ($.ui.button) {
$('.plupload_add, .plupload_start, .plupload_stop', this.container)
.button('destroy');
}
// destroy progress... | [
"function",
"(",
")",
"{",
"// destroy uploader instance",
"this",
".",
"uploader",
".",
"destroy",
"(",
")",
";",
"// unbind all button events",
"$",
"(",
"'.plupload_button'",
",",
"this",
".",
"element",
")",
".",
"unbind",
"(",
")",
";",
"// destroy buttons"... | Destroy the widget, the uploader, free associated resources and bring back original html.
@method destroy | [
"Destroy",
"the",
"widget",
"the",
"uploader",
"free",
"associated",
"resources",
"and",
"bring",
"back",
"original",
"html",
"."
] | 88030bb4222945900e6a225469380cc43a016c13 | https://github.com/hl198181/neptune/blob/88030bb4222945900e6a225469380cc43a016c13/misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js#L805-L835 | |
56,367 | hl198181/neptune | misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js | measure | function measure() {
if (!tw || !th) {
var wrapper = $('.plupload_file:eq(0)', self.filelist);
tw = wrapper.outerWidth(true);
th = wrapper.outerHeight(true);
}
var aw = self.content.width(), ah = self.content.height();
cols = Math.floor(aw / tw);
num = cols * (Math.ceil(ah / th) + 1);
} | javascript | function measure() {
if (!tw || !th) {
var wrapper = $('.plupload_file:eq(0)', self.filelist);
tw = wrapper.outerWidth(true);
th = wrapper.outerHeight(true);
}
var aw = self.content.width(), ah = self.content.height();
cols = Math.floor(aw / tw);
num = cols * (Math.ceil(ah / th) + 1);
} | [
"function",
"measure",
"(",
")",
"{",
"if",
"(",
"!",
"tw",
"||",
"!",
"th",
")",
"{",
"var",
"wrapper",
"=",
"$",
"(",
"'.plupload_file:eq(0)'",
",",
"self",
".",
"filelist",
")",
";",
"tw",
"=",
"wrapper",
".",
"outerWidth",
"(",
"true",
")",
";"... | calculate number of simultaneously visible thumbs | [
"calculate",
"number",
"of",
"simultaneously",
"visible",
"thumbs"
] | 88030bb4222945900e6a225469380cc43a016c13 | https://github.com/hl198181/neptune/blob/88030bb4222945900e6a225469380cc43a016c13/misc/demo/public/vendor/plupload-2.1.2/js/jquery.ui.plupload/jquery.ui.plupload.js#L1003-L1013 |
56,368 | dominictarr/pull-obv | index.js | obv | function obv (fn, immediate) {
if(!fn) return state
listeners.push(fn)
if(immediate !== false && fn(state) === true) obv.more()
return function () {
var i = listeners.indexOf(fn)
listeners.splice(i, 1)
}
} | javascript | function obv (fn, immediate) {
if(!fn) return state
listeners.push(fn)
if(immediate !== false && fn(state) === true) obv.more()
return function () {
var i = listeners.indexOf(fn)
listeners.splice(i, 1)
}
} | [
"function",
"obv",
"(",
"fn",
",",
"immediate",
")",
"{",
"if",
"(",
"!",
"fn",
")",
"return",
"state",
"listeners",
".",
"push",
"(",
"fn",
")",
"if",
"(",
"immediate",
"!==",
"false",
"&&",
"fn",
"(",
"state",
")",
"===",
"true",
")",
"obv",
".... | implement an observable | [
"implement",
"an",
"observable"
] | 414d8959624f0d9207bfe27c9ac8aa60513114fb | https://github.com/dominictarr/pull-obv/blob/414d8959624f0d9207bfe27c9ac8aa60513114fb/index.js#L10-L18 |
56,369 | sergiodxa/SukimaJS | index.js | isValid | function isValid (type, value) {
switch (type) {
case 'email':
return validator.isEmail(value);
break;
case 'url':
return validator.isURL(value);
break;
case 'domain':
return validator.isFQDN(value);
break;
case 'ip':
... | javascript | function isValid (type, value) {
switch (type) {
case 'email':
return validator.isEmail(value);
break;
case 'url':
return validator.isURL(value);
break;
case 'domain':
return validator.isFQDN(value);
break;
case 'ip':
... | [
"function",
"isValid",
"(",
"type",
",",
"value",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"'email'",
":",
"return",
"validator",
".",
"isEmail",
"(",
"value",
")",
";",
"break",
";",
"case",
"'url'",
":",
"return",
"validator",
".",
"isURL",... | call a validator method depending on type | [
"call",
"a",
"validator",
"method",
"depending",
"on",
"type"
] | 9218a49ff2352a6d7ae989bf4150f70fed9e1b12 | https://github.com/sergiodxa/SukimaJS/blob/9218a49ff2352a6d7ae989bf4150f70fed9e1b12/index.js#L9-L78 |
56,370 | dylants/debug-caller | lib/debug-caller.js | _buildNamespace | function _buildNamespace(appName, depth) {
var callerFile;
// Our default depth needs to be 2, since 1 is this file. Add the user
// supplied depth to 1 (for this file) to make it 2.
callerFile = caller(depth + 1);
// if for some reason we're unable to determine the caller, use the appName only
... | javascript | function _buildNamespace(appName, depth) {
var callerFile;
// Our default depth needs to be 2, since 1 is this file. Add the user
// supplied depth to 1 (for this file) to make it 2.
callerFile = caller(depth + 1);
// if for some reason we're unable to determine the caller, use the appName only
... | [
"function",
"_buildNamespace",
"(",
"appName",
",",
"depth",
")",
"{",
"var",
"callerFile",
";",
"// Our default depth needs to be 2, since 1 is this file. Add the user",
"// supplied depth to 1 (for this file) to make it 2.",
"callerFile",
"=",
"caller",
"(",
"depth",
"+",
"1"... | Returns the descriptive text used in the debug instantiation, which at this
point is the app + calling filename. Allow the user to specify a depth for the
calling filename, in the case they have a wrapping function calling this.
@param {String} appName The application name, used in the namespace
@param {Number} dept... | [
"Returns",
"the",
"descriptive",
"text",
"used",
"in",
"the",
"debug",
"instantiation",
"which",
"at",
"this",
"point",
"is",
"the",
"app",
"+",
"calling",
"filename",
".",
"Allow",
"the",
"user",
"to",
"specify",
"a",
"depth",
"for",
"the",
"calling",
"fi... | b54c0f1d3825ef5015624f6f874ea6d955c08d92 | https://github.com/dylants/debug-caller/blob/b54c0f1d3825ef5015624f6f874ea6d955c08d92/lib/debug-caller.js#L18-L43 |
56,371 | dylants/debug-caller | lib/debug-caller.js | logger | function logger(appName, options) {
var namespace, log, error;
options = options ? options : {};
// merge our default options with the user supplied
options = xtend({
depth: 1,
randomColors: false,
logColor: 7,
errorColor: 1,
}, options);
// get the filename wh... | javascript | function logger(appName, options) {
var namespace, log, error;
options = options ? options : {};
// merge our default options with the user supplied
options = xtend({
depth: 1,
randomColors: false,
logColor: 7,
errorColor: 1,
}, options);
// get the filename wh... | [
"function",
"logger",
"(",
"appName",
",",
"options",
")",
"{",
"var",
"namespace",
",",
"log",
",",
"error",
";",
"options",
"=",
"options",
"?",
"options",
":",
"{",
"}",
";",
"// merge our default options with the user supplied",
"options",
"=",
"xtend",
"(... | Creates the `debug` object using the namespace built from the `appName`
and calling filename. Creates 2 loggers, one for log, one for error.
@param {String} appName The application name, used in the namespace
@param {Object} options Optional: The options to use for configuration
@return {Object} An object w... | [
"Creates",
"the",
"debug",
"object",
"using",
"the",
"namespace",
"built",
"from",
"the",
"appName",
"and",
"calling",
"filename",
".",
"Creates",
"2",
"loggers",
"one",
"for",
"log",
"one",
"for",
"error",
"."
] | b54c0f1d3825ef5015624f6f874ea6d955c08d92 | https://github.com/dylants/debug-caller/blob/b54c0f1d3825ef5015624f6f874ea6d955c08d92/lib/debug-caller.js#L55-L94 |
56,372 | sendanor/nor-api-session | src/session.js | init_session | function init_session(req) {
debug.assert(req.session).is('object');
if(!is.obj(req.session.client)) {
req.session.client = {};
}
if( (!is.obj(req.session.client.messages)) || is.array(req.session.client.messages) ) {
req.session.client.messages = {};
}
} | javascript | function init_session(req) {
debug.assert(req.session).is('object');
if(!is.obj(req.session.client)) {
req.session.client = {};
}
if( (!is.obj(req.session.client.messages)) || is.array(req.session.client.messages) ) {
req.session.client.messages = {};
}
} | [
"function",
"init_session",
"(",
"req",
")",
"{",
"debug",
".",
"assert",
"(",
"req",
".",
"session",
")",
".",
"is",
"(",
"'object'",
")",
";",
"if",
"(",
"!",
"is",
".",
"obj",
"(",
"req",
".",
"session",
".",
"client",
")",
")",
"{",
"req",
... | Initialize the session | [
"Initialize",
"the",
"session"
] | be1aa653a12ecad2d10b69c3698ca0e30c3099f1 | https://github.com/sendanor/nor-api-session/blob/be1aa653a12ecad2d10b69c3698ca0e30c3099f1/src/session.js#L15-L23 |
56,373 | UXFoundry/hashdo-web | index.js | function (baseUrl, firebaseUrl, port, cardsDirectory) {
// Set environment variables.
process.env.BASE_URL = baseUrl || '';
process.env.FIREBASE_URL = firebaseUrl || 'https://hashdodemo.firebaseio.com/',
process.env.CARDS_DIRECTORY = cardsDirectory || process.cwd();
process.env.PORT = port || 4000;
... | javascript | function (baseUrl, firebaseUrl, port, cardsDirectory) {
// Set environment variables.
process.env.BASE_URL = baseUrl || '';
process.env.FIREBASE_URL = firebaseUrl || 'https://hashdodemo.firebaseio.com/',
process.env.CARDS_DIRECTORY = cardsDirectory || process.cwd();
process.env.PORT = port || 4000;
... | [
"function",
"(",
"baseUrl",
",",
"firebaseUrl",
",",
"port",
",",
"cardsDirectory",
")",
"{",
"// Set environment variables.",
"process",
".",
"env",
".",
"BASE_URL",
"=",
"baseUrl",
"||",
"''",
";",
"process",
".",
"env",
".",
"FIREBASE_URL",
"=",
"firebaseUr... | Configured process events and middleware required to run the web application.
This function should always be called before starting the web server.
@method init
@param {String} baseUrl The URL that the web application will be accessible from.
@param {String} [firebaseUrl] Optional Firebase URL for r... | [
"Configured",
"process",
"events",
"and",
"middleware",
"required",
"to",
"run",
"the",
"web",
"application",
".",
"This",
"function",
"should",
"always",
"be",
"called",
"before",
"starting",
"the",
"web",
"server",
"."
] | ec69928cf4515a496f85d9af5926bfe8a4344465 | https://github.com/UXFoundry/hashdo-web/blob/ec69928cf4515a496f85d9af5926bfe8a4344465/index.js#L41-L81 | |
56,374 | UXFoundry/hashdo-web | index.js | function (callback) {
var APIController = require('./controllers/api'),
DefaultController = require('./controllers/index'),
PackController = require('./controllers/pack'),
CardController = require('./controllers/card'),
WebHookController = require('./controllers/webhook'),
ProxyControl... | javascript | function (callback) {
var APIController = require('./controllers/api'),
DefaultController = require('./controllers/index'),
PackController = require('./controllers/pack'),
CardController = require('./controllers/card'),
WebHookController = require('./controllers/webhook'),
ProxyControl... | [
"function",
"(",
"callback",
")",
"{",
"var",
"APIController",
"=",
"require",
"(",
"'./controllers/api'",
")",
",",
"DefaultController",
"=",
"require",
"(",
"'./controllers/index'",
")",
",",
"PackController",
"=",
"require",
"(",
"'./controllers/pack'",
")",
",... | Sets up internal routes and starts the web server,
Ensure you call the init function before starting the web server.
@method start
@async
@param {Function} [callback] Optional callback to be nitified when the server has started and ready for requests. | [
"Sets",
"up",
"internal",
"routes",
"and",
"starts",
"the",
"web",
"server",
"Ensure",
"you",
"call",
"the",
"init",
"function",
"before",
"starting",
"the",
"web",
"server",
"."
] | ec69928cf4515a496f85d9af5926bfe8a4344465 | https://github.com/UXFoundry/hashdo-web/blob/ec69928cf4515a496f85d9af5926bfe8a4344465/index.js#L92-L165 | |
56,375 | Tictrac/grunt-i18n-linter | tasks/lib/i18n_linter.js | run | function run(files, options) {
// If translations or templates are not supplied then error
if (options.translations.length === 0) {
grunt.fail.fatal('Please supply translations');
}
// If a missing translation regex has been supplied report the missing count
if (opti... | javascript | function run(files, options) {
// If translations or templates are not supplied then error
if (options.translations.length === 0) {
grunt.fail.fatal('Please supply translations');
}
// If a missing translation regex has been supplied report the missing count
if (opti... | [
"function",
"run",
"(",
"files",
",",
"options",
")",
"{",
"// If translations or templates are not supplied then error",
"if",
"(",
"options",
".",
"translations",
".",
"length",
"===",
"0",
")",
"{",
"grunt",
".",
"fail",
".",
"fatal",
"(",
"'Please supply trans... | Run the linter against the given files and options
@param {Array} files List of files to check
@param {Object} options List of options | [
"Run",
"the",
"linter",
"against",
"the",
"given",
"files",
"and",
"options"
] | 7a64e19ece1cf974beb29f85ec15dec17a39c45f | https://github.com/Tictrac/grunt-i18n-linter/blob/7a64e19ece1cf974beb29f85ec15dec17a39c45f/tasks/lib/i18n_linter.js#L31-L61 |
56,376 | ugate/releasebot | lib/errors.js | logError | function logError(e) {
e = e instanceof Error ? e : e ? new Error(e) : null;
if (e) {
if (options && util.isRegExp(options.hideTokenRegExp)) {
e.message = e.message.replace(options.hideTokenRegExp, function(match, prefix, token, suffix) {
return prefix + '[SECURE]' + suffix;
});
}
errors.unshi... | javascript | function logError(e) {
e = e instanceof Error ? e : e ? new Error(e) : null;
if (e) {
if (options && util.isRegExp(options.hideTokenRegExp)) {
e.message = e.message.replace(options.hideTokenRegExp, function(match, prefix, token, suffix) {
return prefix + '[SECURE]' + suffix;
});
}
errors.unshi... | [
"function",
"logError",
"(",
"e",
")",
"{",
"e",
"=",
"e",
"instanceof",
"Error",
"?",
"e",
":",
"e",
"?",
"new",
"Error",
"(",
"e",
")",
":",
"null",
";",
"if",
"(",
"e",
")",
"{",
"if",
"(",
"options",
"&&",
"util",
".",
"isRegExp",
"(",
"o... | Logs an error
@param e
the {Error} object or string | [
"Logs",
"an",
"error"
] | 1a2ff42796e77f47f9590992c014fee461aad80b | https://github.com/ugate/releasebot/blob/1a2ff42796e77f47f9590992c014fee461aad80b/lib/errors.js#L44-L55 |
56,377 | ImHype/koa-sdf | lib/loadFile.js | loadFile | function loadFile(name, dir, options) {
var pathname = path.normalize(path.join(options.prefix, name));
var obj = {};
var filename = (obj.path = path.join(dir, name));
var stats = fs.statSync(filename);
var buffer = fs.readFileSync(filename);
obj.cacheControl = options.cacheControl;
obj.maxAge = obj.maxA... | javascript | function loadFile(name, dir, options) {
var pathname = path.normalize(path.join(options.prefix, name));
var obj = {};
var filename = (obj.path = path.join(dir, name));
var stats = fs.statSync(filename);
var buffer = fs.readFileSync(filename);
obj.cacheControl = options.cacheControl;
obj.maxAge = obj.maxA... | [
"function",
"loadFile",
"(",
"name",
",",
"dir",
",",
"options",
")",
"{",
"var",
"pathname",
"=",
"path",
".",
"normalize",
"(",
"path",
".",
"join",
"(",
"options",
".",
"prefix",
",",
"name",
")",
")",
";",
"var",
"obj",
"=",
"{",
"}",
";",
"v... | load file and add file content to cache
@param {String} name
@param {String} dir
@param {Object} options
@return {Object}
@api private | [
"load",
"file",
"and",
"add",
"file",
"content",
"to",
"cache"
] | 7a88a6c4dfa99f34f6a8e4f5f9cf07a84015e53b | https://github.com/ImHype/koa-sdf/blob/7a88a6c4dfa99f34f6a8e4f5f9cf07a84015e53b/lib/loadFile.js#L16-L35 |
56,378 | duzun/onemit | dist/lightonemit.1.0.0.js | on | function on(name, hdl) {
var list = eventHandlers[name] || (eventHandlers[name] = []);
list.push(hdl);
return this;
} | javascript | function on(name, hdl) {
var list = eventHandlers[name] || (eventHandlers[name] = []);
list.push(hdl);
return this;
} | [
"function",
"on",
"(",
"name",
",",
"hdl",
")",
"{",
"var",
"list",
"=",
"eventHandlers",
"[",
"name",
"]",
"||",
"(",
"eventHandlers",
"[",
"name",
"]",
"=",
"[",
"]",
")",
";",
"list",
".",
"push",
"(",
"hdl",
")",
";",
"return",
"this",
";",
... | Bind an event listener to the model.
@param (string) name - event name
@param (function) hdl - event handler | [
"Bind",
"an",
"event",
"listener",
"to",
"the",
"model",
"."
] | 12360553cf36379e9fc91d36c40d519a822d4987 | https://github.com/duzun/onemit/blob/12360553cf36379e9fc91d36c40d519a822d4987/dist/lightonemit.1.0.0.js#L18-L22 |
56,379 | ayecue/node-klass | src/common/printf.js | function(string){
var pattern = /(^|\W)(\w)(\w*)/g,
result = [],
match;
while (pattern.exec(string)) {
result.push(RegExp.$1 + RegExp.$2.toUpperCase() + RegExp.$3);
}
return result.join('');
} | javascript | function(string){
var pattern = /(^|\W)(\w)(\w*)/g,
result = [],
match;
while (pattern.exec(string)) {
result.push(RegExp.$1 + RegExp.$2.toUpperCase() + RegExp.$3);
}
return result.join('');
} | [
"function",
"(",
"string",
")",
"{",
"var",
"pattern",
"=",
"/",
"(^|\\W)(\\w)(\\w*)",
"/",
"g",
",",
"result",
"=",
"[",
"]",
",",
"match",
";",
"while",
"(",
"pattern",
".",
"exec",
"(",
"string",
")",
")",
"{",
"result",
".",
"push",
"(",
"RegEx... | Upper first letter | [
"Upper",
"first",
"letter"
] | d0583db943bfc6186e45d205735bebd88828e117 | https://github.com/ayecue/node-klass/blob/d0583db943bfc6186e45d205735bebd88828e117/src/common/printf.js#L27-L37 | |
56,380 | zestjs/zest-server | zest-server.js | function(module) {
for (var i = 0; i < module.include.length; i++) {
var curInclude = module.include[i];
if (curInclude.substr(0, 2) == '^!') {
module.include[i] = curInclude.substr(2);
attachBuildIds.push(curInclude.substr(2));
}
}
} | javascript | function(module) {
for (var i = 0; i < module.include.length; i++) {
var curInclude = module.include[i];
if (curInclude.substr(0, 2) == '^!') {
module.include[i] = curInclude.substr(2);
attachBuildIds.push(curInclude.substr(2));
}
}
} | [
"function",
"(",
"module",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"module",
".",
"include",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"curInclude",
"=",
"module",
".",
"include",
"[",
"i",
"]",
";",
"if",
"(",
"curIncl... | remove the '^!' builds from the current module | [
"remove",
"the",
"^!",
"builds",
"from",
"the",
"current",
"module"
] | 83209d0209da3bce0e9c24034fb4b5016e7bdcc8 | https://github.com/zestjs/zest-server/blob/83209d0209da3bce0e9c24034fb4b5016e7bdcc8/zest-server.js#L234-L242 | |
56,381 | itsa/itsa-event | event-base.js | function(customEvent, callback, context, filter, prepend) {
return this._addMultiSubs(false, customEvent, callback, context, filter, prepend);
} | javascript | function(customEvent, callback, context, filter, prepend) {
return this._addMultiSubs(false, customEvent, callback, context, filter, prepend);
} | [
"function",
"(",
"customEvent",
",",
"callback",
",",
"context",
",",
"filter",
",",
"prepend",
")",
"{",
"return",
"this",
".",
"_addMultiSubs",
"(",
"false",
",",
"customEvent",
",",
"callback",
",",
"context",
",",
"filter",
",",
"prepend",
")",
";",
... | Subscribes to a customEvent. The callback will be executed `after` the defaultFn.
@static
@method after
@param customEvent {String|Array} the custom-event (or Array of events) to subscribe to. CustomEvents should
have the syntax: `emitterName:eventName`. Wildcard `*` may be used for both `emitterName` as well as `even... | [
"Subscribes",
"to",
"a",
"customEvent",
".",
"The",
"callback",
"will",
"be",
"executed",
"after",
"the",
"defaultFn",
"."
] | fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa | https://github.com/itsa/itsa-event/blob/fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa/event-base.js#L83-L85 | |
56,382 | itsa/itsa-event | event-base.js | function(customEvent, callback, context, filter, prepend) {
return this._addMultiSubs(true, customEvent, callback, context, filter, prepend);
} | javascript | function(customEvent, callback, context, filter, prepend) {
return this._addMultiSubs(true, customEvent, callback, context, filter, prepend);
} | [
"function",
"(",
"customEvent",
",",
"callback",
",",
"context",
",",
"filter",
",",
"prepend",
")",
"{",
"return",
"this",
".",
"_addMultiSubs",
"(",
"true",
",",
"customEvent",
",",
"callback",
",",
"context",
",",
"filter",
",",
"prepend",
")",
";",
"... | Subscribes to a customEvent. The callback will be executed `before` the defaultFn.
@static
@method before
@param customEvent {String|Array} the custom-event (or Array of events) to subscribe to. CustomEvents should
have the syntax: `emitterName:eventName`. Wildcard `*` may be used for both `emitterName` as well as `ev... | [
"Subscribes",
"to",
"a",
"customEvent",
".",
"The",
"callback",
"will",
"be",
"executed",
"before",
"the",
"defaultFn",
"."
] | fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa | https://github.com/itsa/itsa-event/blob/fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa/event-base.js#L109-L111 | |
56,383 | itsa/itsa-event | event-base.js | function (emitterName) {
var instance = this,
pattern;
if (emitterName) {
pattern = new RegExp('^'+emitterName+':');
instance._ce.itsa_each(
function(value, key) {
key.match(pattern) && (delete instance._... | javascript | function (emitterName) {
var instance = this,
pattern;
if (emitterName) {
pattern = new RegExp('^'+emitterName+':');
instance._ce.itsa_each(
function(value, key) {
key.match(pattern) && (delete instance._... | [
"function",
"(",
"emitterName",
")",
"{",
"var",
"instance",
"=",
"this",
",",
"pattern",
";",
"if",
"(",
"emitterName",
")",
"{",
"pattern",
"=",
"new",
"RegExp",
"(",
"'^'",
"+",
"emitterName",
"+",
"':'",
")",
";",
"instance",
".",
"_ce",
".",
"it... | Removes all event-definitions of an emitter, specified by its `emitterName`.
When `emitterName` is not set, ALL event-definitions will be removed.
@static
@method undefAllEvents
@param [emitterName] {String} name of the customEvent conform the syntax: `emitterName:eventName`
@since 0.0.1 | [
"Removes",
"all",
"event",
"-",
"definitions",
"of",
"an",
"emitter",
"specified",
"by",
"its",
"emitterName",
".",
"When",
"emitterName",
"is",
"not",
"set",
"ALL",
"event",
"-",
"definitions",
"will",
"be",
"removed",
"."
] | fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa | https://github.com/itsa/itsa-event/blob/fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa/event-base.js#L483-L501 | |
56,384 | itsa/itsa-event | event-base.js | function (e, checkFilter, before, preProcessor, subscribers) { // subscribers, plural
var subs, passesThis, passesFilter;
if (subscribers && !e.status.halted && !e.silent) {
subs = before ? subscribers.b : subscribers.a;
subs && subs.some(function(subscriber) {
... | javascript | function (e, checkFilter, before, preProcessor, subscribers) { // subscribers, plural
var subs, passesThis, passesFilter;
if (subscribers && !e.status.halted && !e.silent) {
subs = before ? subscribers.b : subscribers.a;
subs && subs.some(function(subscriber) {
... | [
"function",
"(",
"e",
",",
"checkFilter",
",",
"before",
",",
"preProcessor",
",",
"subscribers",
")",
"{",
"// subscribers, plural",
"var",
"subs",
",",
"passesThis",
",",
"passesFilter",
";",
"if",
"(",
"subscribers",
"&&",
"!",
"e",
".",
"status",
".",
... | Does the actual invocation of a subscriber.
@method _invokeSubs
@param e {Object} event-object
@param [checkFilter] {Boolean}
@param [before] {Boolean} whether it concerns before subscribers
@param [checkFilter] {Boolean}
@param subscribers {Array} contains subscribers (objects) with these members:
<ul>
<li>subscriber... | [
"Does",
"the",
"actual",
"invocation",
"of",
"a",
"subscriber",
"."
] | fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa | https://github.com/itsa/itsa-event/blob/fd7b5ede1a5e8b6a237f60bd8373f570d014f5fa/event-base.js#L916-L939 | |
56,385 | doowb/ask-for-github-auth | index.js | askForGithubAuth | function askForGithubAuth (options, cb) {
if (typeof options === 'function') {
cb = options;
options = {};
}
options = options || {};
options.store = options.store || 'default';
if (typeof options.store === 'string') {
options.store = 'for-github-auth.' + options.store;
}
loadQuestions(options... | javascript | function askForGithubAuth (options, cb) {
if (typeof options === 'function') {
cb = options;
options = {};
}
options = options || {};
options.store = options.store || 'default';
if (typeof options.store === 'string') {
options.store = 'for-github-auth.' + options.store;
}
loadQuestions(options... | [
"function",
"askForGithubAuth",
"(",
"options",
",",
"cb",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"'function'",
")",
"{",
"cb",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"option... | Prompt a user for their github authentication credentials.
Save the answer so they're only asked once.
```js
ask(function (err, creds) {
console.log(creds);
//=> {type: 'oauth', token: '123456'}
//=> or {type: 'basic', username: 'doowb', password: 'password'}
});
```
@param {Object} `options` Options to pass to [... | [
"Prompt",
"a",
"user",
"for",
"their",
"github",
"authentication",
"credentials",
".",
"Save",
"the",
"answer",
"so",
"they",
"re",
"only",
"asked",
"once",
"."
] | 1dc5763c911f44c1eb23247e698bf1142a42b111 | https://github.com/doowb/ask-for-github-auth/blob/1dc5763c911f44c1eb23247e698bf1142a42b111/index.js#L60-L89 |
56,386 | jkenlooper/stripmq | stripmq.js | StripMQ | function StripMQ(input, options, formatOptions) {
options || (options = {});
formatOptions || (formatOptions = {});
options = {
type: options.type || 'screen',
width: options.width || 1024,
'device-width': options['device-width'] || options.width || 1024,
... | javascript | function StripMQ(input, options, formatOptions) {
options || (options = {});
formatOptions || (formatOptions = {});
options = {
type: options.type || 'screen',
width: options.width || 1024,
'device-width': options['device-width'] || options.width || 1024,
... | [
"function",
"StripMQ",
"(",
"input",
",",
"options",
",",
"formatOptions",
")",
"{",
"options",
"||",
"(",
"options",
"=",
"{",
"}",
")",
";",
"formatOptions",
"||",
"(",
"formatOptions",
"=",
"{",
"}",
")",
";",
"options",
"=",
"{",
"type",
":",
"op... | strip media queries
@param {string} input
@param {object} options
@param {object} formatOptions
@returns {string} output | [
"strip",
"media",
"queries"
] | 0fc9cfdc75e23271d8962d1c8c6365a05e91d67e | https://github.com/jkenlooper/stripmq/blob/0fc9cfdc75e23271d8962d1c8c6365a05e91d67e/stripmq.js#L29-L48 |
56,387 | el2iot2/linksoup | lib/linksoup.js | parseSpans | function parseSpans(text) {
var links = parseLinks(text);
/*Represented as
[{
href: "http://yada",
start: startIndex,
end: endIndex
}]*/
var spans = [];
var lastSpan = null;
function isPrefixedLinkSpan(span)
{
return span && "href" in span && span.prefix && "proposed" in span.pr... | javascript | function parseSpans(text) {
var links = parseLinks(text);
/*Represented as
[{
href: "http://yada",
start: startIndex,
end: endIndex
}]*/
var spans = [];
var lastSpan = null;
function isPrefixedLinkSpan(span)
{
return span && "href" in span && span.prefix && "proposed" in span.pr... | [
"function",
"parseSpans",
"(",
"text",
")",
"{",
"var",
"links",
"=",
"parseLinks",
"(",
"text",
")",
";",
"/*Represented as\r\n\t\t[{\r\n\t\thref: \"http://yada\",\r\n\t\tstart: startIndex,\r\n\t\tend: endIndex\r\n\t\t}]*/",
"var",
"spans",
"=",
"[",
"]",
";",
"var",
"la... | Parses the text into an array of spans | [
"Parses",
"the",
"text",
"into",
"an",
"array",
"of",
"spans"
] | 316ca49d6d6fd91c2ec9dc27f3585d718a7f5f60 | https://github.com/el2iot2/linksoup/blob/316ca49d6d6fd91c2ec9dc27f3585d718a7f5f60/lib/linksoup.js#L15-L124 |
56,388 | el2iot2/linksoup | lib/linksoup.js | makeFuncAsciiDomainReplace | function makeFuncAsciiDomainReplace(ctx) {
return function (asciiDomain) {
var asciiStartPosition = ctx.domain.indexOf(asciiDomain, ctx.asciiEndPosition);
ctx.asciiEndPosition = asciiStartPosition + asciiDomain.length;
ctx.lastLink = {
href : asciiDomain,
start: ctx.cursor.start + asciiStartPos... | javascript | function makeFuncAsciiDomainReplace(ctx) {
return function (asciiDomain) {
var asciiStartPosition = ctx.domain.indexOf(asciiDomain, ctx.asciiEndPosition);
ctx.asciiEndPosition = asciiStartPosition + asciiDomain.length;
ctx.lastLink = {
href : asciiDomain,
start: ctx.cursor.start + asciiStartPos... | [
"function",
"makeFuncAsciiDomainReplace",
"(",
"ctx",
")",
"{",
"return",
"function",
"(",
"asciiDomain",
")",
"{",
"var",
"asciiStartPosition",
"=",
"ctx",
".",
"domain",
".",
"indexOf",
"(",
"asciiDomain",
",",
"ctx",
".",
"asciiEndPosition",
")",
";",
"ctx"... | return a closure to handle a custom ascii domain replace | [
"return",
"a",
"closure",
"to",
"handle",
"a",
"custom",
"ascii",
"domain",
"replace"
] | 316ca49d6d6fd91c2ec9dc27f3585d718a7f5f60 | https://github.com/el2iot2/linksoup/blob/316ca49d6d6fd91c2ec9dc27f3585d718a7f5f60/lib/linksoup.js#L198-L212 |
56,389 | HAKASHUN/gulp-git-staged | index.js | function(stdout, next) {
var lines = stdout.split("\n");
var filenames = _.transform(lines, function(result, line) {
var status = line.slice(0, 2);
if (regExp.test(status)) {
result.push(_.last(line.split(' ')));
}
});
next(null, filenames);
} | javascript | function(stdout, next) {
var lines = stdout.split("\n");
var filenames = _.transform(lines, function(result, line) {
var status = line.slice(0, 2);
if (regExp.test(status)) {
result.push(_.last(line.split(' ')));
}
});
next(null, filenames);
} | [
"function",
"(",
"stdout",
",",
"next",
")",
"{",
"var",
"lines",
"=",
"stdout",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"var",
"filenames",
"=",
"_",
".",
"transform",
"(",
"lines",
",",
"function",
"(",
"result",
",",
"line",
")",
"{",
"var",
"st... | collect filename by status stdout | [
"collect",
"filename",
"by",
"status",
"stdout"
] | 72862548634c27deae8c1a8a3062fcabb5bd307e | https://github.com/HAKASHUN/gulp-git-staged/blob/72862548634c27deae8c1a8a3062fcabb5bd307e/index.js#L50-L60 | |
56,390 | HAKASHUN/gulp-git-staged | index.js | function(filenames) {
var isIn = _.some(filenames, function(line) {
return file.path.indexOf(line) !== -1;
});
if (isIn) {
self.push(file);
}
callback();
} | javascript | function(filenames) {
var isIn = _.some(filenames, function(line) {
return file.path.indexOf(line) !== -1;
});
if (isIn) {
self.push(file);
}
callback();
} | [
"function",
"(",
"filenames",
")",
"{",
"var",
"isIn",
"=",
"_",
".",
"some",
"(",
"filenames",
",",
"function",
"(",
"line",
")",
"{",
"return",
"file",
".",
"path",
".",
"indexOf",
"(",
"line",
")",
"!==",
"-",
"1",
";",
"}",
")",
";",
"if",
... | filter file from stream | [
"filter",
"file",
"from",
"stream"
] | 72862548634c27deae8c1a8a3062fcabb5bd307e | https://github.com/HAKASHUN/gulp-git-staged/blob/72862548634c27deae8c1a8a3062fcabb5bd307e/index.js#L62-L70 | |
56,391 | tualo/tualo-imap | lib/message.js | Message | function Message(rawText){
this.rawText = rawText;
this._parsed = false;
this._isFetch = false;
this._isNoop = false;
this._list = [];
this._search = [];
this._fetch = {
text: ''
};
this._parse();
} | javascript | function Message(rawText){
this.rawText = rawText;
this._parsed = false;
this._isFetch = false;
this._isNoop = false;
this._list = [];
this._search = [];
this._fetch = {
text: ''
};
this._parse();
} | [
"function",
"Message",
"(",
"rawText",
")",
"{",
"this",
".",
"rawText",
"=",
"rawText",
";",
"this",
".",
"_parsed",
"=",
"false",
";",
"this",
".",
"_isFetch",
"=",
"false",
";",
"this",
".",
"_isNoop",
"=",
"false",
";",
"this",
".",
"_list",
"=",... | Create a new instance of Message.
Message parses a messages of th IMAP server.
-rawText of the message recieved from th IMAP server.
@constructor
@this {Message}
@param {string} rawText | [
"Create",
"a",
"new",
"instance",
"of",
"Message",
".",
"Message",
"parses",
"a",
"messages",
"of",
"th",
"IMAP",
"server",
"."
] | 948d9cb4693eb0d0e82530365ece36c1d8dbecf3 | https://github.com/tualo/tualo-imap/blob/948d9cb4693eb0d0e82530365ece36c1d8dbecf3/lib/message.js#L14-L26 |
56,392 | commenthol/asyncc | src/NoPromise.js | function () {
if (this._lock) return
this._lock = true
let task = this._tasks.shift()
let tstType = this.error ? ['catch', 'end'] : ['then', 'end']
while (task && !~tstType.indexOf(task.type)) {
task = this._tasks.shift()
}
if (task) {
let cb = (err, res) => {
this.error ... | javascript | function () {
if (this._lock) return
this._lock = true
let task = this._tasks.shift()
let tstType = this.error ? ['catch', 'end'] : ['then', 'end']
while (task && !~tstType.indexOf(task.type)) {
task = this._tasks.shift()
}
if (task) {
let cb = (err, res) => {
this.error ... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_lock",
")",
"return",
"this",
".",
"_lock",
"=",
"true",
"let",
"task",
"=",
"this",
".",
"_tasks",
".",
"shift",
"(",
")",
"let",
"tstType",
"=",
"this",
".",
"error",
"?",
"[",
"'catch'",
","... | runs the next function
@private | [
"runs",
"the",
"next",
"function"
] | a58e16e025d669403ad6c29e60c14f8215769bd4 | https://github.com/commenthol/asyncc/blob/a58e16e025d669403ad6c29e60c14f8215769bd4/src/NoPromise.js#L92-L124 | |
56,393 | georgenorman/tessel-kit | lib/classes/button-mgr.js | function(time) {
var self = this;
self.eventDetection.recordRelease(time);
if (self.eventDetection.isLongPress()) {
// this is a "long-press" - reset detection states and notify the "long-press" observers
self.eventDetection.reset();
self._notifyObservers(self.onLongPressCallbackRegistry... | javascript | function(time) {
var self = this;
self.eventDetection.recordRelease(time);
if (self.eventDetection.isLongPress()) {
// this is a "long-press" - reset detection states and notify the "long-press" observers
self.eventDetection.reset();
self._notifyObservers(self.onLongPressCallbackRegistry... | [
"function",
"(",
"time",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"eventDetection",
".",
"recordRelease",
"(",
"time",
")",
";",
"if",
"(",
"self",
".",
"eventDetection",
".",
"isLongPress",
"(",
")",
")",
"{",
"// this is a \"long-press\" -... | Handle the button-release event generated by the button associated with this ButtonMgr instance.
@param time the time of the button-up event. | [
"Handle",
"the",
"button",
"-",
"release",
"event",
"generated",
"by",
"the",
"button",
"associated",
"with",
"this",
"ButtonMgr",
"instance",
"."
] | 487e91360f0ecf8500d24297228842e2c01ac762 | https://github.com/georgenorman/tessel-kit/blob/487e91360f0ecf8500d24297228842e2c01ac762/lib/classes/button-mgr.js#L172-L195 | |
56,394 | crokita/functionite | examples/example4.js | longWait | function longWait (message, timer, cb) {
setTimeout(function () {
console.log(message);
cb("pang"); //always return "pang"
}, timer); //wait one second before logging
} | javascript | function longWait (message, timer, cb) {
setTimeout(function () {
console.log(message);
cb("pang"); //always return "pang"
}, timer); //wait one second before logging
} | [
"function",
"longWait",
"(",
"message",
",",
"timer",
",",
"cb",
")",
"{",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"console",
".",
"log",
"(",
"message",
")",
";",
"cb",
"(",
"\"pang\"",
")",
";",
"//always return \"pang\"",
"}",
",",
"timer",
")... | scenario 2 "skip" will call the next function as soon as the execution context leaves the function and will ignore anything passed in the callback | [
"scenario",
"2",
"skip",
"will",
"call",
"the",
"next",
"function",
"as",
"soon",
"as",
"the",
"execution",
"context",
"leaves",
"the",
"function",
"and",
"will",
"ignore",
"anything",
"passed",
"in",
"the",
"callback"
] | e5d52b3bded8eac6b42413208e1dc61e0741ae34 | https://github.com/crokita/functionite/blob/e5d52b3bded8eac6b42413208e1dc61e0741ae34/examples/example4.js#L43-L48 |
56,395 | treshugart/ubercod | index.js | resolveDeps | function resolveDeps (args) {
return deps.map(function (dep) {
if (args && args.length && typeof dep === 'number') {
return args[dep];
}
dep = that[dep];
if (dep) {
return dep;
}
});
} | javascript | function resolveDeps (args) {
return deps.map(function (dep) {
if (args && args.length && typeof dep === 'number') {
return args[dep];
}
dep = that[dep];
if (dep) {
return dep;
}
});
} | [
"function",
"resolveDeps",
"(",
"args",
")",
"{",
"return",
"deps",
".",
"map",
"(",
"function",
"(",
"dep",
")",
"{",
"if",
"(",
"args",
"&&",
"args",
".",
"length",
"&&",
"typeof",
"dep",
"===",
"'number'",
")",
"{",
"return",
"args",
"[",
"dep",
... | Returns the dependencies of the current dependency and merges in any supplied, named arguments. Arguments take precedence over dependencies in the container. | [
"Returns",
"the",
"dependencies",
"of",
"the",
"current",
"dependency",
"and",
"merges",
"in",
"any",
"supplied",
"named",
"arguments",
".",
"Arguments",
"take",
"precedence",
"over",
"dependencies",
"in",
"the",
"container",
"."
] | 772accd6957acf24b59ca56fb40253a1e1760e77 | https://github.com/treshugart/ubercod/blob/772accd6957acf24b59ca56fb40253a1e1760e77/index.js#L61-L73 |
56,396 | treshugart/ubercod | index.js | getInst | function getInst (bind, args) {
args = resolveDeps(args);
return isCtor ? applyCtor(func, args) : func.apply(bind, args);
} | javascript | function getInst (bind, args) {
args = resolveDeps(args);
return isCtor ? applyCtor(func, args) : func.apply(bind, args);
} | [
"function",
"getInst",
"(",
"bind",
",",
"args",
")",
"{",
"args",
"=",
"resolveDeps",
"(",
"args",
")",
";",
"return",
"isCtor",
"?",
"applyCtor",
"(",
"func",
",",
"args",
")",
":",
"func",
".",
"apply",
"(",
"bind",
",",
"args",
")",
";",
"}"
] | Returns a dependency. It checks to see if it's a constructor function or a regular function and calls it accordingly. | [
"Returns",
"a",
"dependency",
".",
"It",
"checks",
"to",
"see",
"if",
"it",
"s",
"a",
"constructor",
"function",
"or",
"a",
"regular",
"function",
"and",
"calls",
"it",
"accordingly",
"."
] | 772accd6957acf24b59ca56fb40253a1e1760e77 | https://github.com/treshugart/ubercod/blob/772accd6957acf24b59ca56fb40253a1e1760e77/index.js#L77-L80 |
56,397 | treshugart/ubercod | index.js | resolveInst | function resolveInst (bind, args) {
return isTransient ? getInst(bind, args) : cache || (cache = getInst(bind));
} | javascript | function resolveInst (bind, args) {
return isTransient ? getInst(bind, args) : cache || (cache = getInst(bind));
} | [
"function",
"resolveInst",
"(",
"bind",
",",
"args",
")",
"{",
"return",
"isTransient",
"?",
"getInst",
"(",
"bind",
",",
"args",
")",
":",
"cache",
"||",
"(",
"cache",
"=",
"getInst",
"(",
"bind",
")",
")",
";",
"}"
] | Resolves the dependency based on if it's a singleton or transient dependency. Both forms allow arguments. If it's a singleton, then no arguments are allowed. If it's transient, named arguments are allowed. | [
"Resolves",
"the",
"dependency",
"based",
"on",
"if",
"it",
"s",
"a",
"singleton",
"or",
"transient",
"dependency",
".",
"Both",
"forms",
"allow",
"arguments",
".",
"If",
"it",
"s",
"a",
"singleton",
"then",
"no",
"arguments",
"are",
"allowed",
".",
"If",
... | 772accd6957acf24b59ca56fb40253a1e1760e77 | https://github.com/treshugart/ubercod/blob/772accd6957acf24b59ca56fb40253a1e1760e77/index.js#L85-L87 |
56,398 | treshugart/ubercod | index.js | init | function init (func) {
func = ensureFunc(func);
cache = undefined;
deps = parseDepsFromFunc(func);
} | javascript | function init (func) {
func = ensureFunc(func);
cache = undefined;
deps = parseDepsFromFunc(func);
} | [
"function",
"init",
"(",
"func",
")",
"{",
"func",
"=",
"ensureFunc",
"(",
"func",
")",
";",
"cache",
"=",
"undefined",
";",
"deps",
"=",
"parseDepsFromFunc",
"(",
"func",
")",
";",
"}"
] | Initialises or re-initialises the state of the dependency. | [
"Initialises",
"or",
"re",
"-",
"initialises",
"the",
"state",
"of",
"the",
"dependency",
"."
] | 772accd6957acf24b59ca56fb40253a1e1760e77 | https://github.com/treshugart/ubercod/blob/772accd6957acf24b59ca56fb40253a1e1760e77/index.js#L90-L94 |
56,399 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/toolbar/plugin.js | getItemDefinedGroups | function getItemDefinedGroups() {
var groups = {},
itemName, item, itemToolbar, group, order;
for ( itemName in editor.ui.items ) {
item = editor.ui.items[ itemName ];
itemToolbar = item.toolbar || 'others';
if ( itemToolbar ) {
// Break the toolbar property into its parts: "group_na... | javascript | function getItemDefinedGroups() {
var groups = {},
itemName, item, itemToolbar, group, order;
for ( itemName in editor.ui.items ) {
item = editor.ui.items[ itemName ];
itemToolbar = item.toolbar || 'others';
if ( itemToolbar ) {
// Break the toolbar property into its parts: "group_na... | [
"function",
"getItemDefinedGroups",
"(",
")",
"{",
"var",
"groups",
"=",
"{",
"}",
",",
"itemName",
",",
"item",
",",
"itemToolbar",
",",
"group",
",",
"order",
";",
"for",
"(",
"itemName",
"in",
"editor",
".",
"ui",
".",
"items",
")",
"{",
"item",
"... | Returns an object containing all toolbar groups used by ui items. | [
"Returns",
"an",
"object",
"containing",
"all",
"toolbar",
"groups",
"used",
"by",
"ui",
"items",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/toolbar/plugin.js#L462-L495 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.