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
40,400
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js
inShadow
function inShadow(key) { var path = this; do { if (path.isFunction()) { var shadow = path.node.shadow; if (shadow) { // this is because sometimes we may have a `shadow` value of: // // { this: false } // // we need to catch this case if `inShadow` has been p...
javascript
function inShadow(key) { var path = this; do { if (path.isFunction()) { var shadow = path.node.shadow; if (shadow) { // this is because sometimes we may have a `shadow` value of: // // { this: false } // // we need to catch this case if `inShadow` has been p...
[ "function", "inShadow", "(", "key", ")", "{", "var", "path", "=", "this", ";", "do", "{", "if", "(", "path", ".", "isFunction", "(", ")", ")", "{", "var", "shadow", "=", "path", ".", "node", ".", "shadow", ";", "if", "(", "shadow", ")", "{", "/...
Check if we're inside a shadowed function.
[ "Check", "if", "we", "re", "inside", "a", "shadowed", "function", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js#L223-L246
40,401
Kronos-Integration/kronos-interceptor-line-header
src/line-header.js
getRealHeaderCheck
function getRealHeaderCheck(expectedHeader, caseSensitive, fieldNames) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } // the header must have all th...
javascript
function getRealHeaderCheck(expectedHeader, caseSensitive, fieldNames) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } // the header must have all th...
[ "function", "getRealHeaderCheck", "(", "expectedHeader", ",", "caseSensitive", ",", "fieldNames", ")", "{", "return", "function", "(", "content", ")", "{", "let", "actualHeader", ";", "if", "(", "caseSensitive", ")", "{", "actualHeader", "=", "content", ";", "...
Creates a check which will match the future columns names to there real position @param expectedHeader The expected header @param caseSensitive Is the header case sensitive @param fieldNames The fieldNames to use for each field. @return fieldMap This maps the fieldNames to the position in the array.
[ "Creates", "a", "check", "which", "will", "match", "the", "future", "columns", "names", "to", "there", "real", "position" ]
4baadc7782b94986abf947267a79d7328aebba18
https://github.com/Kronos-Integration/kronos-interceptor-line-header/blob/4baadc7782b94986abf947267a79d7328aebba18/src/line-header.js#L158-L172
40,402
Kronos-Integration/kronos-interceptor-line-header
src/line-header.js
getStrictCheck
function getStrictCheck(expectedHeader, caseSensitive, severity) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } if (expectedHeader.length !== actual...
javascript
function getStrictCheck(expectedHeader, caseSensitive, severity) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } if (expectedHeader.length !== actual...
[ "function", "getStrictCheck", "(", "expectedHeader", ",", "caseSensitive", ",", "severity", ")", "{", "return", "function", "(", "content", ")", "{", "let", "actualHeader", ";", "if", "(", "caseSensitive", ")", "{", "actualHeader", "=", "content", ";", "}", ...
returns the Strict header check @param expectedHeader The expected header
[ "returns", "the", "Strict", "header", "check" ]
4baadc7782b94986abf947267a79d7328aebba18
https://github.com/Kronos-Integration/kronos-interceptor-line-header/blob/4baadc7782b94986abf947267a79d7328aebba18/src/line-header.js#L277-L328
40,403
Kronos-Integration/kronos-interceptor-line-header
src/line-header.js
getMissingColumnCheck
function getMissingColumnCheck(expectedHeader, caseSensitive, severity) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } // the header must have all t...
javascript
function getMissingColumnCheck(expectedHeader, caseSensitive, severity) { return function (content) { let actualHeader; if (caseSensitive) { actualHeader = content; } else { actualHeader = arrayToUpperCase(content); expectedHeader = arrayToUpperCase(expectedHeader); } // the header must have all t...
[ "function", "getMissingColumnCheck", "(", "expectedHeader", ",", "caseSensitive", ",", "severity", ")", "{", "return", "function", "(", "content", ")", "{", "let", "actualHeader", ";", "if", "(", "caseSensitive", ")", "{", "actualHeader", "=", "content", ";", ...
Creates the missing column check @param expectedHeader The expected header @param caseSensitive Is the header case sensitive @param severity The severity if the check fails
[ "Creates", "the", "missing", "column", "check" ]
4baadc7782b94986abf947267a79d7328aebba18
https://github.com/Kronos-Integration/kronos-interceptor-line-header/blob/4baadc7782b94986abf947267a79d7328aebba18/src/line-header.js#L420-L441
40,404
Kronos-Integration/kronos-interceptor-line-header
src/line-header.js
getMandatoryColumnCheck
function getMandatoryColumnCheck(mandatoryColumns, severity) { /** * @param the coluns found and matched. */ return function (foundColumns) { // the header must have all the expected columns but may have more let err = _missingColumns(mandatoryColumns, foundColumns); if (err) { return { errorCode: ...
javascript
function getMandatoryColumnCheck(mandatoryColumns, severity) { /** * @param the coluns found and matched. */ return function (foundColumns) { // the header must have all the expected columns but may have more let err = _missingColumns(mandatoryColumns, foundColumns); if (err) { return { errorCode: ...
[ "function", "getMandatoryColumnCheck", "(", "mandatoryColumns", ",", "severity", ")", "{", "/**\n\t * @param the coluns found and matched.\n\t */", "return", "function", "(", "foundColumns", ")", "{", "// the header must have all the expected columns but may have more", "let", "err...
Creates the mandatory column check. This is every time case sensitive as we used the associated column names. @param mandatoryColumns The mandatory columns. BUT these are the associated fieldnames, not the original column names @param severity The severity if the check fails
[ "Creates", "the", "mandatory", "column", "check", ".", "This", "is", "every", "time", "case", "sensitive", "as", "we", "used", "the", "associated", "column", "names", "." ]
4baadc7782b94986abf947267a79d7328aebba18
https://github.com/Kronos-Integration/kronos-interceptor-line-header/blob/4baadc7782b94986abf947267a79d7328aebba18/src/line-header.js#L449-L466
40,405
panta82/readdir-plus
lib/vars.js
ReaddirPlusFile
function ReaddirPlusFile(source) { /** * File name. Eg. "file.txt" * @type {string} */ this.name = null; /** * Full path. Eg. "/home/myname/path/to/directory/subdir/file.txt" * @type {string} */ this.path = null; /** * Relative path, based on the directory you submitted to readdir. Eg. "subdir/file...
javascript
function ReaddirPlusFile(source) { /** * File name. Eg. "file.txt" * @type {string} */ this.name = null; /** * Full path. Eg. "/home/myname/path/to/directory/subdir/file.txt" * @type {string} */ this.path = null; /** * Relative path, based on the directory you submitted to readdir. Eg. "subdir/file...
[ "function", "ReaddirPlusFile", "(", "source", ")", "{", "/**\n\t * File name. Eg. \"file.txt\"\n\t * @type {string}\n\t */", "this", ".", "name", "=", "null", ";", "/**\n\t * Full path. Eg. \"/home/myname/path/to/directory/subdir/file.txt\"\n\t * @type {string}\n\t */", "this", ".", ...
File data returned by readdirPlus @param source
[ "File", "data", "returned", "by", "readdirPlus" ]
a3c0dc9356ebbcdfebf7565286709984b0770720
https://github.com/panta82/readdir-plus/blob/a3c0dc9356ebbcdfebf7565286709984b0770720/lib/vars.js#L225-L269
40,406
jonschlinkert/to-exports
index.js
toExports
function toExports(dir, patterns, recurse, options, fn) { if (arguments.length === 1 && !isGlob(dir)) { var key = 'toExports:' + dir; if (cache.hasOwnProperty(key)) { return cache[key]; } var result = lookup(dir, false, {}).reduce(function (res, fp) { if (filter(fp, fn)) { res[ba...
javascript
function toExports(dir, patterns, recurse, options, fn) { if (arguments.length === 1 && !isGlob(dir)) { var key = 'toExports:' + dir; if (cache.hasOwnProperty(key)) { return cache[key]; } var result = lookup(dir, false, {}).reduce(function (res, fp) { if (filter(fp, fn)) { res[ba...
[ "function", "toExports", "(", "dir", ",", "patterns", ",", "recurse", ",", "options", ",", "fn", ")", "{", "if", "(", "arguments", ".", "length", "===", "1", "&&", "!", "isGlob", "(", "dir", ")", ")", "{", "var", "key", "=", "'toExports:'", "+", "d...
Export files from the give `directory` filtering the results with @param {String} `directory` Use `__dirname` for the immediate directory. @param {String|Array} `patterns` Glob patterns to use for matching. @param {Boolean} `recurse` Pass `true` to recurse deeper than the current directory. @param {String} `option...
[ "Export", "files", "from", "the", "give", "directory", "filtering", "the", "results", "with" ]
93471d63094718ca5fd32d99a9abada8008f1d73
https://github.com/jonschlinkert/to-exports/blob/93471d63094718ca5fd32d99a9abada8008f1d73/index.js#L36-L53
40,407
jonschlinkert/to-exports
index.js
lookup
function lookup(dir, recurse) { if (typeof dir !== 'string') { throw new Error('export-files expects a string as the first argument.'); } var key = 'lookup:' + dir + ('' + recurse); if (cache.hasOwnProperty(key)) { return cache[key]; } var files = fs.readdirSync(dir); var len = files.length; v...
javascript
function lookup(dir, recurse) { if (typeof dir !== 'string') { throw new Error('export-files expects a string as the first argument.'); } var key = 'lookup:' + dir + ('' + recurse); if (cache.hasOwnProperty(key)) { return cache[key]; } var files = fs.readdirSync(dir); var len = files.length; v...
[ "function", "lookup", "(", "dir", ",", "recurse", ")", "{", "if", "(", "typeof", "dir", "!==", "'string'", ")", "{", "throw", "new", "Error", "(", "'export-files expects a string as the first argument.'", ")", ";", "}", "var", "key", "=", "'lookup:'", "+", "...
Recursively read directories, starting with the given `dir`. @param {String} `dir` @param {Boolean} `recurse` Should the function recurse? @return {Array} Returns an array of files.
[ "Recursively", "read", "directories", "starting", "with", "the", "given", "dir", "." ]
93471d63094718ca5fd32d99a9abada8008f1d73
https://github.com/jonschlinkert/to-exports/blob/93471d63094718ca5fd32d99a9abada8008f1d73/index.js#L94-L119
40,408
jonschlinkert/to-exports
index.js
renameKey
function renameKey(fp, opts) { if (opts && opts.renameKey) { return opts.renameKey(fp, opts); } return basename(fp); }
javascript
function renameKey(fp, opts) { if (opts && opts.renameKey) { return opts.renameKey(fp, opts); } return basename(fp); }
[ "function", "renameKey", "(", "fp", ",", "opts", ")", "{", "if", "(", "opts", "&&", "opts", ".", "renameKey", ")", "{", "return", "opts", ".", "renameKey", "(", "fp", ",", "opts", ")", ";", "}", "return", "basename", "(", "fp", ")", ";", "}" ]
Rename object keys with a custom function. If no function is passed, the basname is returned.
[ "Rename", "object", "keys", "with", "a", "custom", "function", ".", "If", "no", "function", "is", "passed", "the", "basname", "is", "returned", "." ]
93471d63094718ca5fd32d99a9abada8008f1d73
https://github.com/jonschlinkert/to-exports/blob/93471d63094718ca5fd32d99a9abada8008f1d73/index.js#L127-L132
40,409
jonschlinkert/to-exports
index.js
read
function read(fp, opts, fn) { opts = opts || {}; opts.encoding = opts.encoding || 'utf8'; if (opts.read) { return opts.read(fp, opts); } else if (fn) { return fn(fp, opts); } if (endsWith(fp, '.js')) { return tryRequire(fp); } else { var str = tryCatch(fs.readFileSync, fp, opts); if ...
javascript
function read(fp, opts, fn) { opts = opts || {}; opts.encoding = opts.encoding || 'utf8'; if (opts.read) { return opts.read(fp, opts); } else if (fn) { return fn(fp, opts); } if (endsWith(fp, '.js')) { return tryRequire(fp); } else { var str = tryCatch(fs.readFileSync, fp, opts); if ...
[ "function", "read", "(", "fp", ",", "opts", ",", "fn", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "opts", ".", "encoding", "=", "opts", ".", "encoding", "||", "'utf8'", ";", "if", "(", "opts", ".", "read", ")", "{", "return", "opts", "...
Read or require the given file with `opts`
[ "Read", "or", "require", "the", "given", "file", "with", "opts" ]
93471d63094718ca5fd32d99a9abada8008f1d73
https://github.com/jonschlinkert/to-exports/blob/93471d63094718ca5fd32d99a9abada8008f1d73/index.js#L146-L165
40,410
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js
isBinding
function isBinding(node, parent) { var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; var val = parent[key]; if (Array.isArray(val)) { if (val.indexOf(node) >= 0) return true; } else { if ...
javascript
function isBinding(node, parent) { var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; var val = parent[key]; if (Array.isArray(val)) { if (val.indexOf(node) >= 0) return true; } else { if ...
[ "function", "isBinding", "(", "node", ",", "parent", ")", "{", "var", "keys", "=", "_retrievers", ".", "getBindingIdentifiers", ".", "keys", "[", "parent", ".", "type", "]", ";", "if", "(", "keys", ")", "{", "for", "(", "var", "i", "=", "0", ";", "...
Check if the input `node` is a binding identifier.
[ "Check", "if", "the", "input", "node", "is", "a", "binding", "identifier", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js#L37-L52
40,411
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js
isSpecifierDefault
function isSpecifierDefault(specifier) { return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); }
javascript
function isSpecifierDefault(specifier) { return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); }
[ "function", "isSpecifierDefault", "(", "specifier", ")", "{", "return", "t", ".", "isImportDefaultSpecifier", "(", "specifier", ")", "||", "t", ".", "isIdentifier", "(", "specifier", ".", "imported", "||", "specifier", ".", "exported", ",", "{", "name", ":", ...
Check if the input `specifier` is a `default` import or export.
[ "Check", "if", "the", "input", "specifier", "is", "a", "default", "import", "or", "export", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js#L216-L218
40,412
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js
isScope
function isScope(node, parent) { if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) { return false; } return t.isScopable(node); }
javascript
function isScope(node, parent) { if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) { return false; } return t.isScopable(node); }
[ "function", "isScope", "(", "node", ",", "parent", ")", "{", "if", "(", "t", ".", "isBlockStatement", "(", "node", ")", "&&", "t", ".", "isFunction", "(", "parent", ",", "{", "body", ":", "node", "}", ")", ")", "{", "return", "false", ";", "}", "...
Check if the input `node` is a scope.
[ "Check", "if", "the", "input", "node", "is", "a", "scope", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js#L224-L230
40,413
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js
isImmutable
function isImmutable(node) { if (t.isType(node.type, "Immutable")) return true; if (t.isLiteral(node)) { if (node.regex) { // regexs are mutable return false; } else { // immutable! return true; } } else if (t.isIdentifier(node)) { if (node.name === "undefined") { //...
javascript
function isImmutable(node) { if (t.isType(node.type, "Immutable")) return true; if (t.isLiteral(node)) { if (node.regex) { // regexs are mutable return false; } else { // immutable! return true; } } else if (t.isIdentifier(node)) { if (node.name === "undefined") { //...
[ "function", "isImmutable", "(", "node", ")", "{", "if", "(", "t", ".", "isType", "(", "node", ".", "type", ",", "\"Immutable\"", ")", ")", "return", "true", ";", "if", "(", "t", ".", "isLiteral", "(", "node", ")", ")", "{", "if", "(", "node", "."...
Check if the input `node` is definitely immutable.
[ "Check", "if", "the", "input", "node", "is", "definitely", "immutable", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/validators.js#L236-L258
40,414
kevoree/kevoree-js
tools/kevoree-kevscript/lib/KevScript.js
function (data, ctxModel, ctxVars) { const options = xtend(this.options, { ctxVars, logger: this.logger }); const parser = new kevs.Parser(); const ast = parser.parse(data); if (ast.type !== 'kevScript') { const err = new Error('Unable to parse script'); err.parser = ast; err.warnings...
javascript
function (data, ctxModel, ctxVars) { const options = xtend(this.options, { ctxVars, logger: this.logger }); const parser = new kevs.Parser(); const ast = parser.parse(data); if (ast.type !== 'kevScript') { const err = new Error('Unable to parse script'); err.parser = ast; err.warnings...
[ "function", "(", "data", ",", "ctxModel", ",", "ctxVars", ")", "{", "const", "options", "=", "xtend", "(", "this", ".", "options", ",", "{", "ctxVars", ",", "logger", ":", "this", ".", "logger", "}", ")", ";", "const", "parser", "=", "new", "kevs", ...
Parses given KevScript source-code in parameter 'data' and returns a ContainerRoot. @param {String} data string @param {Object|Function} [ctxModel] a model to "start" on (in order not to create a model from scratch) @param {Object|Function} [ctxVars] context variables to be accessible from the KevScript @returns ...
[ "Parses", "given", "KevScript", "source", "-", "code", "in", "parameter", "data", "and", "returns", "a", "ContainerRoot", "." ]
7eb62201a3bdf50ab0a6eb7f85424eecb44dbfcd
https://github.com/kevoree/kevoree-js/blob/7eb62201a3bdf50ab0a6eb7f85424eecb44dbfcd/tools/kevoree-kevscript/lib/KevScript.js#L36-L57
40,415
sumeetdas/Meow
lib/utils.js
setPropertyVal
function setPropertyVal (pObj, pProp, pNewVal) { if (typeof pProp === 'string') { pProp = pProp || ''; pProp = pProp.split('.'); } if (pProp.length > 1) { var prop = pProp.shift(); pObj[prop] = (typeof pObj[prop] !== 'undefined' || typeof pObj[pr...
javascript
function setPropertyVal (pObj, pProp, pNewVal) { if (typeof pProp === 'string') { pProp = pProp || ''; pProp = pProp.split('.'); } if (pProp.length > 1) { var prop = pProp.shift(); pObj[prop] = (typeof pObj[prop] !== 'undefined' || typeof pObj[pr...
[ "function", "setPropertyVal", "(", "pObj", ",", "pProp", ",", "pNewVal", ")", "{", "if", "(", "typeof", "pProp", "===", "'string'", ")", "{", "pProp", "=", "pProp", "||", "''", ";", "pProp", "=", "pProp", ".", "split", "(", "'.'", ")", ";", "}", "i...
Utility method to set property value of an object by using the dot notation of the affected property For instance, for the following object: var someObject = { animals: { cow: true, cat: false } }; If we want to change the property val of 'cat', we can use this function to do so: setPropertyVal (someObject, 'animals...
[ "Utility", "method", "to", "set", "property", "value", "of", "an", "object", "by", "using", "the", "dot", "notation", "of", "the", "affected", "property" ]
965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9
https://github.com/sumeetdas/Meow/blob/965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9/lib/utils.js#L32-L50
40,416
sumeetdas/Meow
lib/utils.js
getMetaData
function getMetaData (data) { if (typeof data !== 'string') { throw new MeowError ('data is not a string'); } data = data || ''; data = data.split('\n'); if (('' + data[0]).trim() !== '<!--') { throw new MeowError ("Incorrect format : Missing '<!--' in the beginning of the file"); ...
javascript
function getMetaData (data) { if (typeof data !== 'string') { throw new MeowError ('data is not a string'); } data = data || ''; data = data.split('\n'); if (('' + data[0]).trim() !== '<!--') { throw new MeowError ("Incorrect format : Missing '<!--' in the beginning of the file"); ...
[ "function", "getMetaData", "(", "data", ")", "{", "if", "(", "typeof", "data", "!==", "'string'", ")", "{", "throw", "new", "MeowError", "(", "'data is not a string'", ")", ";", "}", "data", "=", "data", "||", "''", ";", "data", "=", "data", ".", "spli...
Retrieves metadata for a given meow format blog post. This metadata will further be cached into 'posts'. @param data The meow format blog post; must be a string @returns {Object} Typical format would be : { title: (title) published-date: (published-date) tags: [tagArray] }
[ "Retrieves", "metadata", "for", "a", "given", "meow", "format", "blog", "post", ".", "This", "metadata", "will", "further", "be", "cached", "into", "posts", "." ]
965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9
https://github.com/sumeetdas/Meow/blob/965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9/lib/utils.js#L63-L103
40,417
sumeetdas/Meow
lib/utils.js
generateSlug
function generateSlug (title) { if (typeof title !== 'string') { throw new MeowError ('title is not a string'); } title = title || ''; title = title.toLocaleLowerCase().replace(/[\W]/g, '-').replace(/[\-]{2,}/g, '-'); return title; }
javascript
function generateSlug (title) { if (typeof title !== 'string') { throw new MeowError ('title is not a string'); } title = title || ''; title = title.toLocaleLowerCase().replace(/[\W]/g, '-').replace(/[\-]{2,}/g, '-'); return title; }
[ "function", "generateSlug", "(", "title", ")", "{", "if", "(", "typeof", "title", "!==", "'string'", ")", "{", "throw", "new", "MeowError", "(", "'title is not a string'", ")", ";", "}", "title", "=", "title", "||", "''", ";", "title", "=", "title", ".",...
Generates slug for a given title @param title @returns {string} slug generated for @param title
[ "Generates", "slug", "for", "a", "given", "title" ]
965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9
https://github.com/sumeetdas/Meow/blob/965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9/lib/utils.js#L110-L117
40,418
sumeetdas/Meow
lib/utils.js
sortPostsByPublishedDate
function sortPostsByPublishedDate (pPosts) { if (! (pPosts instanceof Array) ) { throw new MeowError ("pPosts is not an array"); } pPosts.sort(function (pFirst, pSecond) { pFirst = pFirst || {}; pSecond = pSecond || {}; var pFirstPublishedDate = pFirst['published-date'], ...
javascript
function sortPostsByPublishedDate (pPosts) { if (! (pPosts instanceof Array) ) { throw new MeowError ("pPosts is not an array"); } pPosts.sort(function (pFirst, pSecond) { pFirst = pFirst || {}; pSecond = pSecond || {}; var pFirstPublishedDate = pFirst['published-date'], ...
[ "function", "sortPostsByPublishedDate", "(", "pPosts", ")", "{", "if", "(", "!", "(", "pPosts", "instanceof", "Array", ")", ")", "{", "throw", "new", "MeowError", "(", "\"pPosts is not an array\"", ")", ";", "}", "pPosts", ".", "sort", "(", "function", "(", ...
This function will order the posts array according to its published date in descending order @param pPosts object containing cached posts data filed under some category
[ "This", "function", "will", "order", "the", "posts", "array", "according", "to", "its", "published", "date", "in", "descending", "order" ]
965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9
https://github.com/sumeetdas/Meow/blob/965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9/lib/utils.js#L123-L145
40,419
sumeetdas/Meow
lib/utils.js
getFilePathRelativeToAppRoot
function getFilePathRelativeToAppRoot (pPath) { // go to meow-blog directory var projectBaseDirectory = path.resolve(__dirname, '..'); if (projectBaseDirectory.indexOf('node_modules') !== -1) { // from meow-blog, go up to node_modules, then go to base directory projectBaseDirectory = path.r...
javascript
function getFilePathRelativeToAppRoot (pPath) { // go to meow-blog directory var projectBaseDirectory = path.resolve(__dirname, '..'); if (projectBaseDirectory.indexOf('node_modules') !== -1) { // from meow-blog, go up to node_modules, then go to base directory projectBaseDirectory = path.r...
[ "function", "getFilePathRelativeToAppRoot", "(", "pPath", ")", "{", "// go to meow-blog directory", "var", "projectBaseDirectory", "=", "path", ".", "resolve", "(", "__dirname", ",", "'..'", ")", ";", "if", "(", "projectBaseDirectory", ".", "indexOf", "(", "'node_mo...
Get file path relative to app root @param pPath
[ "Get", "file", "path", "relative", "to", "app", "root" ]
965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9
https://github.com/sumeetdas/Meow/blob/965cd8a966aed9fe2fb271bf9a1ba9692eb2f3a9/lib/utils.js#L151-L161
40,420
generate/generate-data
generator.js
set
function set(app, prop, val) { var data = app.cache.data.project; if (typeof val !== 'undefined') { data[prop] = val; } else if (typeof app.cache.data[prop] !== 'undefined') { data[prop] = app.cache.data[prop]; } }
javascript
function set(app, prop, val) { var data = app.cache.data.project; if (typeof val !== 'undefined') { data[prop] = val; } else if (typeof app.cache.data[prop] !== 'undefined') { data[prop] = app.cache.data[prop]; } }
[ "function", "set", "(", "app", ",", "prop", ",", "val", ")", "{", "var", "data", "=", "app", ".", "cache", ".", "data", ".", "project", ";", "if", "(", "typeof", "val", "!==", "'undefined'", ")", "{", "data", "[", "prop", "]", "=", "val", ";", ...
Set data values on the `app.cache.data.project` object, which is merged onto the context at render time and is available in templats as `project`.
[ "Set", "data", "values", "on", "the", "app", ".", "cache", ".", "data", ".", "project", "object", "which", "is", "merged", "onto", "the", "context", "at", "render", "time", "and", "is", "available", "in", "templats", "as", "project", "." ]
b580b51151773aa2cda8288e489951bdf1af2d47
https://github.com/generate/generate-data/blob/b580b51151773aa2cda8288e489951bdf1af2d47/generator.js#L58-L65
40,421
joyent/node-sdc-changefeed
lib/publisher.js
assertPublisherOptions
function assertPublisherOptions(options) { mod_assert.object(options, 'options'); mod_assert.object(options.log, 'options.log'); mod_assert.object(options.moray, 'options.moray'); mod_assert.string(options.moray.bucketName, 'options.moray.bucketName'); mod_assert.optionalObject(options.backoff, 'opt...
javascript
function assertPublisherOptions(options) { mod_assert.object(options, 'options'); mod_assert.object(options.log, 'options.log'); mod_assert.object(options.moray, 'options.moray'); mod_assert.string(options.moray.bucketName, 'options.moray.bucketName'); mod_assert.optionalObject(options.backoff, 'opt...
[ "function", "assertPublisherOptions", "(", "options", ")", "{", "mod_assert", ".", "object", "(", "options", ",", "'options'", ")", ";", "mod_assert", ".", "object", "(", "options", ".", "log", ",", "'options.log'", ")", ";", "mod_assert", ".", "object", "("...
Prime number chosen to alleviate overlap with pollTime
[ "Prime", "number", "chosen", "to", "alleviate", "overlap", "with", "pollTime" ]
4ed110e7a91a5766a794e7962b66b37ae9aea92d
https://github.com/joyent/node-sdc-changefeed/blob/4ed110e7a91a5766a794e7962b66b37ae9aea92d/lib/publisher.js#L25-L40
40,422
joyent/node-sdc-changefeed
lib/publisher.js
_bucketInit
function _bucketInit() { morayClient.getBucket(self.morayBucket.name, function _gb(err) { if (isBucketNotFoundError(err)) { var name = self.morayBucket.name; var config = self.morayBucket.config; morayClient.createBucket(name, confi...
javascript
function _bucketInit() { morayClient.getBucket(self.morayBucket.name, function _gb(err) { if (isBucketNotFoundError(err)) { var name = self.morayBucket.name; var config = self.morayBucket.config; morayClient.createBucket(name, confi...
[ "function", "_bucketInit", "(", ")", "{", "morayClient", ".", "getBucket", "(", "self", ".", "morayBucket", ".", "name", ",", "function", "_gb", "(", "err", ")", "{", "if", "(", "isBucketNotFoundError", "(", "err", ")", ")", "{", "var", "name", "=", "s...
Handles bucket initilization and backoff on failure
[ "Handles", "bucket", "initilization", "and", "backoff", "on", "failure" ]
4ed110e7a91a5766a794e7962b66b37ae9aea92d
https://github.com/joyent/node-sdc-changefeed/blob/4ed110e7a91a5766a794e7962b66b37ae9aea92d/lib/publisher.js#L144-L169
40,423
leon/angular-upload
angular-upload.js
removePendingReq
function removePendingReq() { var idx = indexOf($http.pendingRequests, config); if (idx !== -1) { $http.pendingRequests.splice(idx, 1); config.$iframeTransportForm.remove(); delete config.$iframeTransportForm; } }
javascript
function removePendingReq() { var idx = indexOf($http.pendingRequests, config); if (idx !== -1) { $http.pendingRequests.splice(idx, 1); config.$iframeTransportForm.remove(); delete config.$iframeTransportForm; } }
[ "function", "removePendingReq", "(", ")", "{", "var", "idx", "=", "indexOf", "(", "$http", ".", "pendingRequests", ",", "config", ")", ";", "if", "(", "idx", "!==", "-", "1", ")", "{", "$http", ".", "pendingRequests", ".", "splice", "(", "idx", ",", ...
Remove everything when we are done
[ "Remove", "everything", "when", "we", "are", "done" ]
5b8efe6a8a95846525b8d2dc3ff269b7dbfcf663
https://github.com/leon/angular-upload/blob/5b8efe6a8a95846525b8d2dc3ff269b7dbfcf663/angular-upload.js#L264-L271
40,424
sendanor/node-joker-dmapi
src/JokerDMAPI.js
parse_domain
function parse_domain (line) { debug.assert(line).is('string'); // -S-G-J ==> "tili-lii.fi 2017-06-02" // +S-G-J ==> "tili-lii.fi 2017-06-02 lock" // +S+G-J ==> "tili-lii.fi 2017-06-02 lock @creator true 0 undef" // -S+G-J ==> "tili-lii.fi 2017-06-02 @creator true 0 undef" // -S-G+J ==> "tili-lii.fi 2017-0...
javascript
function parse_domain (line) { debug.assert(line).is('string'); // -S-G-J ==> "tili-lii.fi 2017-06-02" // +S-G-J ==> "tili-lii.fi 2017-06-02 lock" // +S+G-J ==> "tili-lii.fi 2017-06-02 lock @creator true 0 undef" // -S+G-J ==> "tili-lii.fi 2017-06-02 @creator true 0 undef" // -S-G+J ==> "tili-lii.fi 2017-0...
[ "function", "parse_domain", "(", "line", ")", "{", "debug", ".", "assert", "(", "line", ")", ".", "is", "(", "'string'", ")", ";", "// -S-G-J ==> \"tili-lii.fi 2017-06-02\"", "// +S-G-J ==> \"tili-lii.fi 2017-06-02 lock\"", "// +S+G-J ==> \"tili-lii.fi 2017-06-02 lock @creato...
Parse single line
[ "Parse", "single", "line" ]
4644bb0e5358ba40ff96968d1bf8d1dd93a49712
https://github.com/sendanor/node-joker-dmapi/blob/4644bb0e5358ba40ff96968d1bf8d1dd93a49712/src/JokerDMAPI.js#L216-L264
40,425
jldec/pub-src-fs
fs-base.js
processData
function processData(err, data) { if (enc) { file.text = data.toString(enc); } else { file.buffer = data; } if (entry.sha) { file.sha = entry.sha; } append(err, file); readDone(); }
javascript
function processData(err, data) { if (enc) { file.text = data.toString(enc); } else { file.buffer = data; } if (entry.sha) { file.sha = entry.sha; } append(err, file); readDone(); }
[ "function", "processData", "(", "err", ",", "data", ")", "{", "if", "(", "enc", ")", "{", "file", ".", "text", "=", "data", ".", "toString", "(", "enc", ")", ";", "}", "else", "{", "file", ".", "buffer", "=", "data", ";", "}", "if", "(", "entry...
populate file.text or, for binary files, file.buffer
[ "populate", "file", ".", "text", "or", "for", "binary", "files", "file", ".", "buffer" ]
25058d68839163f74fb850b896cf039a7e1e59be
https://github.com/jldec/pub-src-fs/blob/25058d68839163f74fb850b896cf039a7e1e59be/fs-base.js#L121-L126
40,426
Wlada/angular-carousel-3d
dist/carousel-3d.js
handleReject
function handleReject(carousel) { $element.css({ 'height': carousel.getOuterHeight() + 'px' }); vm.isLoading = false; vm.isSuccessful = false; }
javascript
function handleReject(carousel) { $element.css({ 'height': carousel.getOuterHeight() + 'px' }); vm.isLoading = false; vm.isSuccessful = false; }
[ "function", "handleReject", "(", "carousel", ")", "{", "$element", ".", "css", "(", "{", "'height'", ":", "carousel", ".", "getOuterHeight", "(", ")", "+", "'px'", "}", ")", ";", "vm", ".", "isLoading", "=", "false", ";", "vm", ".", "isSuccessful", "="...
== Preloaded images reject handler
[ "==", "Preloaded", "images", "reject", "handler" ]
6895284cf59f15602e451130c38aa4605ae9012b
https://github.com/Wlada/angular-carousel-3d/blob/6895284cf59f15602e451130c38aa4605ae9012b/dist/carousel-3d.js#L105-L111
40,427
airbnb/react-with-styles-interface-css
packages/interface/src/index.js
create
function create(stylesObject) { const stylesToClasses = {}; const styleNames = Object.keys(stylesObject); const sharedState = globalCache.get(GLOBAL_CACHE_KEY) || {}; const { namespace = '' } = sharedState; styleNames.forEach((styleName) => { const className = getClassName(namespace, styleName); style...
javascript
function create(stylesObject) { const stylesToClasses = {}; const styleNames = Object.keys(stylesObject); const sharedState = globalCache.get(GLOBAL_CACHE_KEY) || {}; const { namespace = '' } = sharedState; styleNames.forEach((styleName) => { const className = getClassName(namespace, styleName); style...
[ "function", "create", "(", "stylesObject", ")", "{", "const", "stylesToClasses", "=", "{", "}", ";", "const", "styleNames", "=", "Object", ".", "keys", "(", "stylesObject", ")", ";", "const", "sharedState", "=", "globalCache", ".", "get", "(", "GLOBAL_CACHE_...
Function required as part of the react-with-styles interface. Parses the styles provided by react-with-styles to produce class names based on the style name and optionally the namespace if available. stylesObject {Object} The styles object passed to withStyles. Return an object mapping style names to class names.
[ "Function", "required", "as", "part", "of", "the", "react", "-", "with", "-", "styles", "interface", ".", "Parses", "the", "styles", "provided", "by", "react", "-", "with", "-", "styles", "to", "produce", "class", "names", "based", "on", "the", "style", ...
41608ca0156deffc9c6a11a69beb78290532fddb
https://github.com/airbnb/react-with-styles-interface-css/blob/41608ca0156deffc9c6a11a69beb78290532fddb/packages/interface/src/index.js#L17-L27
40,428
airbnb/react-with-styles-interface-css
packages/interface/src/index.js
resolve
function resolve(stylesArray) { const flattenedStyles = flat(stylesArray, Infinity); const { classNames, hasInlineStyles, inlineStyles } = separateStyles(flattenedStyles); const specificClassNames = classNames.map((name, index) => `${name} ${name}_${index + 1}`); const className = specificClassNames.join(' '); ...
javascript
function resolve(stylesArray) { const flattenedStyles = flat(stylesArray, Infinity); const { classNames, hasInlineStyles, inlineStyles } = separateStyles(flattenedStyles); const specificClassNames = classNames.map((name, index) => `${name} ${name}_${index + 1}`); const className = specificClassNames.join(' '); ...
[ "function", "resolve", "(", "stylesArray", ")", "{", "const", "flattenedStyles", "=", "flat", "(", "stylesArray", ",", "Infinity", ")", ";", "const", "{", "classNames", ",", "hasInlineStyles", ",", "inlineStyles", "}", "=", "separateStyles", "(", "flattenedStyle...
Process styles to be consumed by a component. stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects representing inline styles, or arrays thereof. Return an object with optional className and style properties to be spread on a component.
[ "Process", "styles", "to", "be", "consumed", "by", "a", "component", "." ]
41608ca0156deffc9c6a11a69beb78290532fddb
https://github.com/airbnb/react-with-styles-interface-css/blob/41608ca0156deffc9c6a11a69beb78290532fddb/packages/interface/src/index.js#L37-L46
40,429
dssrv/srv-prerender
lib/index.js
function(file, done){ process.nextTick(function () { terra.render(file, function(error, body){ if(error){ done(error); }else{ if(body){ var dest = path.resolve(outputPath, ssr.helpers.outputPath(file)); fs.mkdirp(path.dirname(dest), f...
javascript
function(file, done){ process.nextTick(function () { terra.render(file, function(error, body){ if(error){ done(error); }else{ if(body){ var dest = path.resolve(outputPath, ssr.helpers.outputPath(file)); fs.mkdirp(path.dirname(dest), f...
[ "function", "(", "file", ",", "done", ")", "{", "process", ".", "nextTick", "(", "function", "(", ")", "{", "terra", ".", "render", "(", "file", ",", "function", "(", "error", ",", "body", ")", "{", "if", "(", "error", ")", "{", "done", "(", "err...
Compile and save file
[ "Compile", "and", "save", "file" ]
60a57b953442e4ffb4b13c19d61f16a808e0c42f
https://github.com/dssrv/srv-prerender/blob/60a57b953442e4ffb4b13c19d61f16a808e0c42f/lib/index.js#L204-L221
40,430
right-track/right-track-core
modules/search/search.js
search
function search(db, origin, destination, departure, options, callback) { _log("====== STARTING SEARCH ======"); _log("ORIGIN: " + origin.name); _log("DESTINATION: " + destination.name); _log("DATE/TIME: " + departure.toString()); _log("OPTIONS: " + JSON.stringify(options, null, 2)); // List of Results l...
javascript
function search(db, origin, destination, departure, options, callback) { _log("====== STARTING SEARCH ======"); _log("ORIGIN: " + origin.name); _log("DESTINATION: " + destination.name); _log("DATE/TIME: " + departure.toString()); _log("OPTIONS: " + JSON.stringify(options, null, 2)); // List of Results l...
[ "function", "search", "(", "db", ",", "origin", ",", "destination", ",", "departure", ",", "options", ",", "callback", ")", "{", "_log", "(", "\"====== STARTING SEARCH ======\"", ")", ";", "_log", "(", "\"ORIGIN: \"", "+", "origin", ".", "name", ")", ";", ...
Perform a Trip Search between the origin and destination Stops with the provided parameters and options @param {RightTrackDB} db The Right Track DB to query @param {Stop} origin Origin Stop @param {Stop} destination Destination Stop @param {DateTime} departure Requested Departure Date/Time @param {Object} options Trip ...
[ "Perform", "a", "Trip", "Search", "between", "the", "origin", "and", "destination", "Stops", "with", "the", "provided", "parameters", "and", "options" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L34-L133
40,431
right-track/right-track-core
modules/search/search.js
_cleanDepartures
function _cleanDepartures(results) { // List of Departures to Keep let departures = []; // Get unique departures let departureTimes = []; for ( let i = 0; i < results.length; i++ ) { if ( departureTimes.indexOf(results[i].origin.departure.toTimestamp()) === -1 ) { departureTimes.push(...
javascript
function _cleanDepartures(results) { // List of Departures to Keep let departures = []; // Get unique departures let departureTimes = []; for ( let i = 0; i < results.length; i++ ) { if ( departureTimes.indexOf(results[i].origin.departure.toTimestamp()) === -1 ) { departureTimes.push(...
[ "function", "_cleanDepartures", "(", "results", ")", "{", "// List of Departures to Keep", "let", "departures", "=", "[", "]", ";", "// Get unique departures", "let", "departureTimes", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "res...
Pick best Trip with equal departures @param results @returns {Array} @private
[ "Pick", "best", "Trip", "with", "equal", "departures" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L166-L205
40,432
right-track/right-track-core
modules/search/search.js
_cleanArrivals
function _cleanArrivals(results) { // List of Arrivals to Keep let arrivals = []; // Get unique arrivals let arrivalTimes = []; for ( let i = 0; i < results.length; i++ ) { if ( arrivalTimes.indexOf(results[i].destination.arrival.toTimestamp()) === -1 ) { arrivalTimes.push(results[i]....
javascript
function _cleanArrivals(results) { // List of Arrivals to Keep let arrivals = []; // Get unique arrivals let arrivalTimes = []; for ( let i = 0; i < results.length; i++ ) { if ( arrivalTimes.indexOf(results[i].destination.arrival.toTimestamp()) === -1 ) { arrivalTimes.push(results[i]....
[ "function", "_cleanArrivals", "(", "results", ")", "{", "// List of Arrivals to Keep", "let", "arrivals", "=", "[", "]", ";", "// Get unique arrivals", "let", "arrivalTimes", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "results", "...
Pick best Trip with equal arrivals @param results @returns {Array} @private
[ "Pick", "best", "Trip", "with", "equal", "arrivals" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L214-L254
40,433
right-track/right-track-core
modules/search/search.js
_processTrips
function _processTrips(db, options, origin, destination, enter, trips, segments, callback) { // Display function logs _info(); // Results to Return let RESULTS = []; // Set up counters let done = 0; let count = trips.length; // Finish when there are no trips to process if ( trips.length === 0 ) ...
javascript
function _processTrips(db, options, origin, destination, enter, trips, segments, callback) { // Display function logs _info(); // Results to Return let RESULTS = []; // Set up counters let done = 0; let count = trips.length; // Finish when there are no trips to process if ( trips.length === 0 ) ...
[ "function", "_processTrips", "(", "db", ",", "options", ",", "origin", ",", "destination", ",", "enter", ",", "trips", ",", "segments", ",", "callback", ")", "{", "// Display function logs", "_info", "(", ")", ";", "// Results to Return", "let", "RESULTS", "="...
Process a group of Trips from the reference Stop @param {RightTrackDB} db The Right Track DB to query @param {Object} options Trip Search Options @param {Stop} origin Trip Search Origin Stop @param {Stop} destination Trip Search Destination Stop @param {Stop} enter Reference/Entry Stop @param {Trip[]} trips List of Tri...
[ "Process", "a", "group", "of", "Trips", "from", "the", "reference", "Stop" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L272-L343
40,434
right-track/right-track-core
modules/search/search.js
_info
function _info() { if ( LOG ) { let p = ""; for ( let i = 0; i < segments.length * 2; i++ ) { p = p + " "; } let tripIds = []; for ( let i = 0; i < trips.length; i++ ) { tripIds.push(trips[i].id); } _log(p + "Trips From " + enter.name + ": " + trips.length ...
javascript
function _info() { if ( LOG ) { let p = ""; for ( let i = 0; i < segments.length * 2; i++ ) { p = p + " "; } let tripIds = []; for ( let i = 0; i < trips.length; i++ ) { tripIds.push(trips[i].id); } _log(p + "Trips From " + enter.name + ": " + trips.length ...
[ "function", "_info", "(", ")", "{", "if", "(", "LOG", ")", "{", "let", "p", "=", "\"\"", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "segments", ".", "length", "*", "2", ";", "i", "++", ")", "{", "p", "=", "p", "+", "\" \"", ";"...
Display function logging info @private
[ "Display", "function", "logging", "info" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L325-L341
40,435
right-track/right-track-core
modules/search/search.js
_info
function _info(stops) { if ( LOG ) { let p = ""; for ( let i = 0; i < segments.length * 2; i++ ) { p = p + " "; } _log(p + "...Trip " + trip.id); _log(p + " Stop: " + enter.name + " @ " + trip.getStopTime(enter).departure.getTimeReadable()); _log(p + " Segments: " + ...
javascript
function _info(stops) { if ( LOG ) { let p = ""; for ( let i = 0; i < segments.length * 2; i++ ) { p = p + " "; } _log(p + "...Trip " + trip.id); _log(p + " Stop: " + enter.name + " @ " + trip.getStopTime(enter).departure.getTimeReadable()); _log(p + " Segments: " + ...
[ "function", "_info", "(", "stops", ")", "{", "if", "(", "LOG", ")", "{", "let", "p", "=", "\"\"", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "segments", ".", "length", "*", "2", ";", "i", "++", ")", "{", "p", "=", "p", "+", "\"...
Display logging info @private
[ "Display", "logging", "info" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L391-L409
40,436
right-track/right-track-core
modules/search/search.js
_getTransferStops
function _getTransferStops(db, origin, destination, stop, trip, callback) { // List of Transfer Stops let rtn = []; // Get Next Stops from this Stop LineGraphTable.getNextStops(db, origin.id, destination.id, stop.id, function(err, nextStops) { // Database Query Error if ( err ) { return callbac...
javascript
function _getTransferStops(db, origin, destination, stop, trip, callback) { // List of Transfer Stops let rtn = []; // Get Next Stops from this Stop LineGraphTable.getNextStops(db, origin.id, destination.id, stop.id, function(err, nextStops) { // Database Query Error if ( err ) { return callbac...
[ "function", "_getTransferStops", "(", "db", ",", "origin", ",", "destination", ",", "stop", ",", "trip", ",", "callback", ")", "{", "// List of Transfer Stops", "let", "rtn", "=", "[", "]", ";", "// Get Next Stops from this Stop", "LineGraphTable", ".", "getNextSt...
Get a list of Stop IDs, sorted by transfer weight, that can be used as a Transfer Stop for this Trip @param {RightTrackDB} db The Right Track DB to query @param {Stop} origin Origin Stop @param {Stop} destination Destination Stop @param {Stop} stop Reference Stop @param {Trip} trip Trip to transfer from @param {functio...
[ "Get", "a", "list", "of", "Stop", "IDs", "sorted", "by", "transfer", "weight", "that", "can", "be", "used", "as", "a", "Transfer", "Stop", "for", "this", "Trip" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L617-L660
40,437
right-track/right-track-core
modules/search/search.js
_getTripsFromStop
function _getTripsFromStop(db, origin, destination, stop, tripSearchDates, excludeTrips, callback) { // Get all possible following stops LineGraphTable.getNextStops(db, origin.id, destination.id, stop.id, function(err, nextStops) { // Database Query Error if ( err ) { return callback(err); } ...
javascript
function _getTripsFromStop(db, origin, destination, stop, tripSearchDates, excludeTrips, callback) { // Get all possible following stops LineGraphTable.getNextStops(db, origin.id, destination.id, stop.id, function(err, nextStops) { // Database Query Error if ( err ) { return callback(err); } ...
[ "function", "_getTripsFromStop", "(", "db", ",", "origin", ",", "destination", ",", "stop", ",", "tripSearchDates", ",", "excludeTrips", ",", "callback", ")", "{", "// Get all possible following stops", "LineGraphTable", ".", "getNextStops", "(", "db", ",", "origin"...
Get a List of Trips from the reference Stop that operate during the TripSearchDates and along the Line Graph paths between the origin and destination Stops @param {RightTrackDB} db The Right Track DB to query @param {Stop} origin Trip Origin Stop @param {Stop} destination Trip Destination Stop @param {Stop} stop Refere...
[ "Get", "a", "List", "of", "Trips", "from", "the", "reference", "Stop", "that", "operate", "during", "the", "TripSearchDates", "and", "along", "the", "Line", "Graph", "paths", "between", "the", "origin", "and", "destination", "Stops" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L677-L718
40,438
right-track/right-track-core
modules/search/search.js
_getTripSearchDates
function _getTripSearchDates(db, datetime, preMins, postMins, callback) { // Get pre and post dates let preDateTime = datetime.clone().deltaMins(-1*preMins); let postDateTime = datetime.clone().deltaMins(postMins); // List of TripSearchDates to return let rtn = []; // Counters let done = 0; let count...
javascript
function _getTripSearchDates(db, datetime, preMins, postMins, callback) { // Get pre and post dates let preDateTime = datetime.clone().deltaMins(-1*preMins); let postDateTime = datetime.clone().deltaMins(postMins); // List of TripSearchDates to return let rtn = []; // Counters let done = 0; let count...
[ "function", "_getTripSearchDates", "(", "db", ",", "datetime", ",", "preMins", ",", "postMins", ",", "callback", ")", "{", "// Get pre and post dates", "let", "preDateTime", "=", "datetime", ".", "clone", "(", ")", ".", "deltaMins", "(", "-", "1", "*", "preM...
Get the Trip Search Dates for the specified search range @param {RightTrackDB} db The Right Track DB to query @param {DateTime} datetime The Date/Time of the search starting point @param {int} preMins The number of mins before the datetime to include @param {int} postMins The number of mins after the datetime to includ...
[ "Get", "the", "Trip", "Search", "Dates", "for", "the", "specified", "search", "range" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/search.js#L731-L840
40,439
dimsmol/npgt
lib/upsert.js
function (db, options, cb) { this.db = db; this.cb = cb; this.updateQueryMaker = options.update; this.insertQueryMaker = options.insert; this.maxUpdateAttemptsCount = options.maxUpdateAttemptsCount || 2; this.transform = options.transform; this.insertFirst = !!options.insertFirst; this.nonQuery = !!options.nonQ...
javascript
function (db, options, cb) { this.db = db; this.cb = cb; this.updateQueryMaker = options.update; this.insertQueryMaker = options.insert; this.maxUpdateAttemptsCount = options.maxUpdateAttemptsCount || 2; this.transform = options.transform; this.insertFirst = !!options.insertFirst; this.nonQuery = !!options.nonQ...
[ "function", "(", "db", ",", "options", ",", "cb", ")", "{", "this", ".", "db", "=", "db", ";", "this", ".", "cb", "=", "cb", ";", "this", ".", "updateQueryMaker", "=", "options", ".", "update", ";", "this", ".", "insertQueryMaker", "=", "options", ...
WARN doesn't support transactions for now
[ "WARN", "doesn", "t", "support", "transactions", "for", "now" ]
ff367b0b5a96c811ebbacfd45156f3bc4fa02a37
https://github.com/dimsmol/npgt/blob/ff367b0b5a96c811ebbacfd45156f3bc4fa02a37/lib/upsert.js#L6-L21
40,440
nodeGame/nodegame-generator
games/dictator/waitroom/waitroom.js
clientConnects
function clientConnects(p) { var pList; var nPlayers; var waitTime; var widgetConfig; node.remoteSetup('page', p.id, { clearBody: true, title: { title: 'Welcome!', addToBody: true } }); node.remoteSetup('widgets', p.id, { dest...
javascript
function clientConnects(p) { var pList; var nPlayers; var waitTime; var widgetConfig; node.remoteSetup('page', p.id, { clearBody: true, title: { title: 'Welcome!', addToBody: true } }); node.remoteSetup('widgets', p.id, { dest...
[ "function", "clientConnects", "(", "p", ")", "{", "var", "pList", ";", "var", "nPlayers", ";", "var", "waitTime", ";", "var", "widgetConfig", ";", "node", ".", "remoteSetup", "(", "'page'", ",", "p", ".", "id", ",", "{", "clearBody", ":", "true", ",", ...
Using self-calling function to put `firstTime` into closure.
[ "Using", "self", "-", "calling", "function", "to", "put", "firstTime", "into", "closure", "." ]
22afddec9ddc8a56128da4962c3923cd39bac37e
https://github.com/nodeGame/nodegame-generator/blob/22afddec9ddc8a56128da4962c3923cd39bac37e/games/dictator/waitroom/waitroom.js#L48-L111
40,441
right-track/right-track-core
modules/query/CalendarTable.js
getServicesEffective
function getServicesEffective(db, date, callback) { // Check Cache for Effective Services let cacheKey = db.id + "-" + date; let cache = cache_servicesEffectiveByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get the Default Services getServicesDefault(db, date, funct...
javascript
function getServicesEffective(db, date, callback) { // Check Cache for Effective Services let cacheKey = db.id + "-" + date; let cache = cache_servicesEffectiveByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get the Default Services getServicesDefault(db, date, funct...
[ "function", "getServicesEffective", "(", "db", ",", "date", ",", "callback", ")", "{", "// Check Cache for Effective Services", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", "cache_servicesEffectiveByDate", ".", "g...
Get the Services in effect on the specified date. This includes any exceptions found in the calendar_dates file. @param {RightTrackDB} db The Right Track Database to query @param {int} date The date to query (yyyymmdd) @param {function} callback Callback function @param {Error} callback.error Database Query Error @pa...
[ "Get", "the", "Services", "in", "effect", "on", "the", "specified", "date", ".", "This", "includes", "any", "exceptions", "found", "in", "the", "calendar_dates", "file", "." ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/CalendarTable.js#L186-L298
40,442
right-track/right-track-core
modules/query/CalendarTable.js
function(db, date, callback) { // Check cache for services let cacheKey = db.id + "-" + date; let cache = cache_servicesDefaultByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Array of default services to return let rtn = []; // Get day of week let dt = DateTime....
javascript
function(db, date, callback) { // Check cache for services let cacheKey = db.id + "-" + date; let cache = cache_servicesDefaultByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Array of default services to return let rtn = []; // Get day of week let dt = DateTime....
[ "function", "(", "db", ",", "date", ",", "callback", ")", "{", "// Check cache for services", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", "cache_servicesDefaultByDate", ".", "get", "(", "cacheKey", ")", ";"...
Get the default Services in effect on the specified date. These services don't include any changes due to service exceptions. @param {RightTrackDB} db The Right Track Database to query @param {int} date The date to query (yyyymmdd) @param {function} callback Callback function @param {Error} callback.error Database Qu...
[ "Get", "the", "default", "Services", "in", "effect", "on", "the", "specified", "date", ".", "These", "services", "don", "t", "include", "any", "changes", "due", "to", "service", "exceptions", "." ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/CalendarTable.js#L311-L370
40,443
right-track/right-track-core
modules/query/CalendarTable.js
function(db, date, callback) { // Check cache for service exceptions let cacheKey = db.id + "-" + date; let cache = cache_serviceExceptionsByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Array of Service Exceptions to return let rtn = []; // Get service exceptions...
javascript
function(db, date, callback) { // Check cache for service exceptions let cacheKey = db.id + "-" + date; let cache = cache_serviceExceptionsByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Array of Service Exceptions to return let rtn = []; // Get service exceptions...
[ "function", "(", "db", ",", "date", ",", "callback", ")", "{", "// Check cache for service exceptions", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", "cache_serviceExceptionsByDate", ".", "get", "(", "cacheKey", ...
Get the Service Exceptions in effect on the specified date. This includes Services that are either added or removed on the specified date. @param {RightTrackDB} db The Right Track Database to query @param {int} date The date to query (yyyymmdd) @param {function} callback Callback function @param {Error} callback.erro...
[ "Get", "the", "Service", "Exceptions", "in", "effect", "on", "the", "specified", "date", ".", "This", "includes", "Services", "that", "are", "either", "added", "or", "removed", "on", "the", "specified", "date", "." ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/CalendarTable.js#L383-L430
40,444
jstransformers/jstransformer-jstransformer
index.js
getTransform
function getTransform(options) { if (typeof options === 'string' || options instanceof String) { return options } if (typeof options === 'object' && options.engine) { return options.engine } throw new Error('options.engine not found.') }
javascript
function getTransform(options) { if (typeof options === 'string' || options instanceof String) { return options } if (typeof options === 'object' && options.engine) { return options.engine } throw new Error('options.engine not found.') }
[ "function", "getTransform", "(", "options", ")", "{", "if", "(", "typeof", "options", "===", "'string'", "||", "options", "instanceof", "String", ")", "{", "return", "options", "}", "if", "(", "typeof", "options", "===", "'object'", "&&", "options", ".", "...
Returns the name of the transformer from the given options.
[ "Returns", "the", "name", "of", "the", "transformer", "from", "the", "given", "options", "." ]
1c98419be2071f84a9ac4d5a62bd5e9c30f3a8bd
https://github.com/jstransformers/jstransformer-jstransformer/blob/1c98419be2071f84a9ac4d5a62bd5e9c30f3a8bd/index.js#L11-L21
40,445
jstransformers/jstransformer-jstransformer
index.js
constructTransformer
function constructTransformer(options) { const transform = getTransform(options) if (transform && typeof transform === 'object') { return jstransformer(transform) } return jstransformer(require('jstransformer-' + transform)) }
javascript
function constructTransformer(options) { const transform = getTransform(options) if (transform && typeof transform === 'object') { return jstransformer(transform) } return jstransformer(require('jstransformer-' + transform)) }
[ "function", "constructTransformer", "(", "options", ")", "{", "const", "transform", "=", "getTransform", "(", "options", ")", "if", "(", "transform", "&&", "typeof", "transform", "===", "'object'", ")", "{", "return", "jstransformer", "(", "transform", ")", "}...
Constructs a new JSTransformer from the given options.
[ "Constructs", "a", "new", "JSTransformer", "from", "the", "given", "options", "." ]
1c98419be2071f84a9ac4d5a62bd5e9c30f3a8bd
https://github.com/jstransformers/jstransformer-jstransformer/blob/1c98419be2071f84a9ac4d5a62bd5e9c30f3a8bd/index.js#L26-L33
40,446
canjs/can-validate-interface
index.js
makeInterfaceValidator
function makeInterfaceValidator(interfacePropArrays) { var props = flatten(interfacePropArrays); return function(base) { var missingProps = props.reduce(function(missing, prop) { return prop in base ? missing : missing.concat(prop); }, []); return missingProps.length ? {message:"missing expected propert...
javascript
function makeInterfaceValidator(interfacePropArrays) { var props = flatten(interfacePropArrays); return function(base) { var missingProps = props.reduce(function(missing, prop) { return prop in base ? missing : missing.concat(prop); }, []); return missingProps.length ? {message:"missing expected propert...
[ "function", "makeInterfaceValidator", "(", "interfacePropArrays", ")", "{", "var", "props", "=", "flatten", "(", "interfacePropArrays", ")", ";", "return", "function", "(", "base", ")", "{", "var", "missingProps", "=", "props", ".", "reduce", "(", "function", ...
return a function that validates it's argument has all the properties in the interfacePropArrays
[ "return", "a", "function", "that", "validates", "it", "s", "argument", "has", "all", "the", "properties", "in", "the", "interfacePropArrays" ]
3aa92f8dfd5f2733daa7a2d0f3da55d9d0a09e7a
https://github.com/canjs/can-validate-interface/blob/3aa92f8dfd5f2733daa7a2d0f3da55d9d0a09e7a/index.js#L10-L20
40,447
right-track/right-track-core
modules/query/LinksTable.js
getLinks
function getLinks(db, callback) { // Check cache for links let cacheKey = db.id + "-" + 'links'; let cache = cache_links.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build select statement let select = "SELECT link_category_title, link_title, link_description, link_url F...
javascript
function getLinks(db, callback) { // Check cache for links let cacheKey = db.id + "-" + 'links'; let cache = cache_links.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build select statement let select = "SELECT link_category_title, link_title, link_description, link_url F...
[ "function", "getLinks", "(", "db", ",", "callback", ")", "{", "// Check cache for links", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "'links'", ";", "let", "cache", "=", "cache_links", ".", "get", "(", "cacheKey", ")", ";", "if", "(", ...
Get all of the Agency link information from the database @param {RightTrackDB} db The Right Track Database to query @param {function} callback Callback function @param {Error} callback.error Database Query Error @param {Link[]} [callback.links] The selected Links
[ "Get", "all", "of", "the", "Agency", "link", "information", "from", "the", "database" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/LinksTable.js#L74-L121
40,448
repetere/periodicjs.core.controller
utility/aliased/aliased_protocol.js
function () { /** * Get a valid file path for a template file from a set of directories * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details) * @param {string} [opts.extname] Periodic extension that may contain view file * @param {string} opts.viewname Name of...
javascript
function () { /** * Get a valid file path for a template file from a set of directories * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details) * @param {string} [opts.extname] Periodic extension that may contain view file * @param {string} opts.viewname Name of...
[ "function", "(", ")", "{", "/**\n * Get a valid file path for a template file from a set of directories\n * @param {Object} opts Configurable options (see periodicjs.core.protocols for more details)\n * @param {string} [opts.extname] Periodic extension that may contain view file\n * @param {s...
Creates a function that will resolve a template file path from a set of directories. Alias for CoreController._utility_responder.render @return {Function} A function that will resolve a valid file path for a template
[ "Creates", "a", "function", "that", "will", "resolve", "a", "template", "file", "path", "from", "a", "set", "of", "directories", ".", "Alias", "for", "CoreController", ".", "_utility_responder", ".", "render" ]
b8e67db5958599fa71b0d5cd5d426dbe2264dfb6
https://github.com/repetere/periodicjs.core.controller/blob/b8e67db5958599fa71b0d5cd5d426dbe2264dfb6/utility/aliased/aliased_protocol.js#L14-L33
40,449
repetere/periodicjs.core.controller
utility/aliased/aliased_protocol.js
respondInKind
function respondInKind (opts = {}, callback) { let { req, res, responseData, err } = opts; opts.callback = (typeof opts.callback === 'function') ? opts.callback : callback; if ((path.extname(req.originalUrl) === '.html' || req.is('html') || req.is('text/html') || path.extname(req.originalUrl) === '.htm') ||...
javascript
function respondInKind (opts = {}, callback) { let { req, res, responseData, err } = opts; opts.callback = (typeof opts.callback === 'function') ? opts.callback : callback; if ((path.extname(req.originalUrl) === '.html' || req.is('html') || req.is('text/html') || path.extname(req.originalUrl) === '.htm') ||...
[ "function", "respondInKind", "(", "opts", "=", "{", "}", ",", "callback", ")", "{", "let", "{", "req", ",", "res", ",", "responseData", ",", "err", "}", "=", "opts", ";", "opts", ".", "callback", "=", "(", "typeof", "opts", ".", "callback", "===", ...
Sends response data to client or returns formatted response data @param {Object} opts Configurable options (see periodicjs.core.protocols for more details) @param {Function} opts.callback An optional callback. If this options is defined callback argument will be ignored @param {*} opts.responseData Data to inclu...
[ "Sends", "response", "data", "to", "client", "or", "returns", "formatted", "response", "data" ]
b8e67db5958599fa71b0d5cd5d426dbe2264dfb6
https://github.com/repetere/periodicjs.core.controller/blob/b8e67db5958599fa71b0d5cd5d426dbe2264dfb6/utility/aliased/aliased_protocol.js#L51-L75
40,450
repetere/periodicjs.core.controller
utility/aliased/aliased_protocol.js
function () { /** * Renders a view from template and sends data to client * @param {Object} opts Configurable options (see periodicjs.core.responder for more details) * @param {string} opts.extname Periodic extension which may have template in view folder * @param {string} opts.viewname Name of tem...
javascript
function () { /** * Renders a view from template and sends data to client * @param {Object} opts Configurable options (see periodicjs.core.responder for more details) * @param {string} opts.extname Periodic extension which may have template in view folder * @param {string} opts.viewname Name of tem...
[ "function", "(", ")", "{", "/**\n * Renders a view from template and sends data to client\n * @param {Object} opts Configurable options (see periodicjs.core.responder for more details)\n * @param {string} opts.extname Periodic extension which may have template in view folder\n * @param {strin...
Creates a function that will render a template and send HTTP response to client. Alias for CoreController._utility_responder.render @return {Function} A function that will render a template and send data to client
[ "Creates", "a", "function", "that", "will", "render", "a", "template", "and", "send", "HTTP", "response", "to", "client", ".", "Alias", "for", "CoreController", ".", "_utility_responder", ".", "render" ]
b8e67db5958599fa71b0d5cd5d426dbe2264dfb6
https://github.com/repetere/periodicjs.core.controller/blob/b8e67db5958599fa71b0d5cd5d426dbe2264dfb6/utility/aliased/aliased_protocol.js#L84-L117
40,451
repetere/periodicjs.core.controller
utility/aliased/aliased_protocol.js
function () { /** * Renders an error view from a template and sends data to client * @param {Object} opts Configurable options (see periodicjs.core.responder for more details) * @param {string|Object} opts.err Error details for response * @param {Object} opts.req Express request object * @param {Obj...
javascript
function () { /** * Renders an error view from a template and sends data to client * @param {Object} opts Configurable options (see periodicjs.core.responder for more details) * @param {string|Object} opts.err Error details for response * @param {Object} opts.req Express request object * @param {Obj...
[ "function", "(", ")", "{", "/**\n * Renders an error view from a template and sends data to client\n * @param {Object} opts Configurable options (see periodicjs.core.responder for more details)\n * @param {string|Object} opts.err Error details for response\n * @param {Object} opts.req Express req...
Creates a function that will render an error view from a template. Alias for CoreController._utility_responder.error @return {Function} A function that will render an error view from a template and send response
[ "Creates", "a", "function", "that", "will", "render", "an", "error", "view", "from", "a", "template", ".", "Alias", "for", "CoreController", ".", "_utility_responder", ".", "error" ]
b8e67db5958599fa71b0d5cd5d426dbe2264dfb6
https://github.com/repetere/periodicjs.core.controller/blob/b8e67db5958599fa71b0d5cd5d426dbe2264dfb6/utility/aliased/aliased_protocol.js#L123-L160
40,452
repetere/periodicjs.core.controller
utility/aliased/aliased_protocol.js
function () { /** * Returns inflected values from a string ie. application => applications, Application, etc. * @param {Object} options Configurable options * @param {string} options.model_name String that should be inflected * @return {Object} Object containing inflected values indexed by type o...
javascript
function () { /** * Returns inflected values from a string ie. application => applications, Application, etc. * @param {Object} options Configurable options * @param {string} options.model_name String that should be inflected * @return {Object} Object containing inflected values indexed by type o...
[ "function", "(", ")", "{", "/**\n * Returns inflected values from a string ie. application => applications, Application, etc.\n * @param {Object} options Configurable options\n * @param {string} options.model_name String that should be inflected\n * @return {Object} Object containing inflec...
Creates a function that will get inflected values from a given string @return {Function} A function that will get inflected values from a given string
[ "Creates", "a", "function", "that", "will", "get", "inflected", "values", "from", "a", "given", "string" ]
b8e67db5958599fa71b0d5cd5d426dbe2264dfb6
https://github.com/repetere/periodicjs.core.controller/blob/b8e67db5958599fa71b0d5cd5d426dbe2264dfb6/utility/aliased/aliased_protocol.js#L307-L329
40,453
winterstein/you-again
src/youagain.js
function(url, data, type) { assert(Login.app, "You must set Login.app = my-app-name-as-registered-with-you-again"); data.app = Login.app; data.withCredentials = true; // let the server know this is a with-credentials call data.caller = ""+document.location; // provide some extra info // add in local cookie au...
javascript
function(url, data, type) { assert(Login.app, "You must set Login.app = my-app-name-as-registered-with-you-again"); data.app = Login.app; data.withCredentials = true; // let the server know this is a with-credentials call data.caller = ""+document.location; // provide some extra info // add in local cookie au...
[ "function", "(", "url", ",", "data", ",", "type", ")", "{", "assert", "(", "Login", ".", "app", ",", "\"You must set Login.app = my-app-name-as-registered-with-you-again\"", ")", ";", "data", ".", "app", "=", "Login", ".", "app", ";", "data", ".", "withCredent...
convenience for ajax with cookies
[ "convenience", "for", "ajax", "with", "cookies" ]
0c745f6b8498798b9971773f7fb6a26e301f26a3
https://github.com/winterstein/you-again/blob/0c745f6b8498798b9971773f7fb6a26e301f26a3/src/youagain.js#L556-L578
40,454
right-track/right-track-core
modules/search/query.js
getTripsFromStop
function getTripsFromStop(db, stop, tripSearchDates, nextStops, callback) { // List of Trips to Return let rtn = []; // Counters let done = 0; let count = tripSearchDates.length; // Parse each TripSearchDate separately for ( let i = 0; i < tripSearchDates.length; i++ ) { _getTripsFromStop(db, stop,...
javascript
function getTripsFromStop(db, stop, tripSearchDates, nextStops, callback) { // List of Trips to Return let rtn = []; // Counters let done = 0; let count = tripSearchDates.length; // Parse each TripSearchDate separately for ( let i = 0; i < tripSearchDates.length; i++ ) { _getTripsFromStop(db, stop,...
[ "function", "getTripsFromStop", "(", "db", ",", "stop", ",", "tripSearchDates", ",", "nextStops", ",", "callback", ")", "{", "// List of Trips to Return", "let", "rtn", "=", "[", "]", ";", "// Counters", "let", "done", "=", "0", ";", "let", "count", "=", "...
Get a list of Trips that operate during the specified TripSearchDates and run from the specified Stop to at least one of the provided following Stops @param {RightTrackDB} db The Right Track DB to query @param {Stop} stop The reference Stop @param {TripSearchDate[]} tripSearchDates List of Trip Search Dates @param {Str...
[ "Get", "a", "list", "of", "Trips", "that", "operate", "during", "the", "specified", "TripSearchDates", "and", "run", "from", "the", "specified", "Stop", "to", "at", "least", "one", "of", "the", "provided", "following", "Stops" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/query.js#L28-L114
40,455
right-track/right-track-core
modules/search/query.js
_addTrip
function _addTrip(trip) { // Make sure trip isn't already in list let found = false; for ( let i = 0; i < rtn.length; i++ ) { if ( rtn[i].id === trip.id ) { found = true; } } // Process new trip if ( !found ) { // Make sure the trip stops at any of the next stops, af...
javascript
function _addTrip(trip) { // Make sure trip isn't already in list let found = false; for ( let i = 0; i < rtn.length; i++ ) { if ( rtn[i].id === trip.id ) { found = true; } } // Process new trip if ( !found ) { // Make sure the trip stops at any of the next stops, af...
[ "function", "_addTrip", "(", "trip", ")", "{", "// Make sure trip isn't already in list", "let", "found", "=", "false", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "rtn", ".", "length", ";", "i", "++", ")", "{", "if", "(", "rtn", "[", "i", ...
Add the specified Trip to the return list, if it is not already present and it continues to one of the next stops @param {Trip} trip Trip to add @private
[ "Add", "the", "specified", "Trip", "to", "the", "return", "list", "if", "it", "is", "not", "already", "present", "and", "it", "continues", "to", "one", "of", "the", "next", "stops" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/query.js#L64-L100
40,456
right-track/right-track-core
modules/search/query.js
_getTripsFromStop
function _getTripsFromStop(db, stop, tripSearchDate, callback) { // List of trips to return let rtn = []; // Set counters let done = 0; let count = 0; // Build Service ID String let serviceIdString = "'" + tripSearchDate.serviceIds.join("', '") + "'"; // Get Trip IDs let select = "SELECT gtfs_stop...
javascript
function _getTripsFromStop(db, stop, tripSearchDate, callback) { // List of trips to return let rtn = []; // Set counters let done = 0; let count = 0; // Build Service ID String let serviceIdString = "'" + tripSearchDate.serviceIds.join("', '") + "'"; // Get Trip IDs let select = "SELECT gtfs_stop...
[ "function", "_getTripsFromStop", "(", "db", ",", "stop", ",", "tripSearchDate", ",", "callback", ")", "{", "// List of trips to return", "let", "rtn", "=", "[", "]", ";", "// Set counters", "let", "done", "=", "0", ";", "let", "count", "=", "0", ";", "// B...
Get the Trips within the TripSearchDate range from the specified Stop @param {RightTrackDB} db The Right Track DB to query @param {Stop} stop The reference Stop @param {TripSearchDate} tripSearchDate The Trip Search Date @param {function} callback Callback function(err, trips) @private
[ "Get", "the", "Trips", "within", "the", "TripSearchDate", "range", "from", "the", "specified", "Stop" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/search/query.js#L125-L196
40,457
right-track/right-track-core
modules/query/HolidayTable.js
getHoliday
function getHoliday(db, date, callback) { // Check cache for Holiday let cacheKey = db.id + "-" + date; let cache = cache_holidayByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build the select statement let select = "SELECT date, holiday_name, peak, service_info " +...
javascript
function getHoliday(db, date, callback) { // Check cache for Holiday let cacheKey = db.id + "-" + date; let cache = cache_holidayByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build the select statement let select = "SELECT date, holiday_name, peak, service_info " +...
[ "function", "getHoliday", "(", "db", ",", "date", ",", "callback", ")", "{", "// Check cache for Holiday", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", "cache_holidayByDate", ".", "get", "(", "cacheKey", ")"...
Get the Holiday for the specified date or 'undefined' if there is no holiday on the date @param {RightTrackDB} db The Right Track DB to query @param {int} date the date (yyyymmdd) @param {function} callback Callback function @param {Error} callback.error Database Query Error @param {Holiday} [callback.holiday] The sel...
[ "Get", "the", "Holiday", "for", "the", "specified", "date", "or", "undefined", "if", "there", "is", "no", "holiday", "on", "the", "date" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/HolidayTable.js#L84-L129
40,458
right-track/right-track-core
modules/query/HolidayTable.js
isHoliday
function isHoliday(db, date, callback) { // Check cache for is holiday let cacheKey = db.id + "-" + date; let cache = cache_isHolidayByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get matching holiday let select = "SELECT date, holiday_name, peak, service_info " + ...
javascript
function isHoliday(db, date, callback) { // Check cache for is holiday let cacheKey = db.id + "-" + date; let cache = cache_isHolidayByDate.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get matching holiday let select = "SELECT date, holiday_name, peak, service_info " + ...
[ "function", "isHoliday", "(", "db", ",", "date", ",", "callback", ")", "{", "// Check cache for is holiday", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", "cache_isHolidayByDate", ".", "get", "(", "cacheKey", ...
Check if the specified date is a Holiday @param {RightTrackDB} db The Right Track DB to query @param {int} date The date to check (yyyymmdd) @param {function} callback Callback function @param {Error} callback.error Database Query Error @param {boolean} [callback.isHoliday] True if the specified date is a Holiday
[ "Check", "if", "the", "specified", "date", "is", "a", "Holiday" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/HolidayTable.js#L141-L170
40,459
bipio-server/bip-pod
index.js
function(src, noEscape) { var attrLen, newKey; if (helper.isArray(src)) { var attrLen = src.length; for (var i = 0; i < attrLen; i++) { src[i] = helper.pasteurize(src[i], noEscape); } } else if (this.isString(src)) { src = helper.scrub(src, noEscape); } else if (helper.is...
javascript
function(src, noEscape) { var attrLen, newKey; if (helper.isArray(src)) { var attrLen = src.length; for (var i = 0; i < attrLen; i++) { src[i] = helper.pasteurize(src[i], noEscape); } } else if (this.isString(src)) { src = helper.scrub(src, noEscape); } else if (helper.is...
[ "function", "(", "src", ",", "noEscape", ")", "{", "var", "attrLen", ",", "newKey", ";", "if", "(", "helper", ".", "isArray", "(", "src", ")", ")", "{", "var", "attrLen", "=", "src", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i...
Cleans an object thoroughly. Script scrubbed, html encoded.
[ "Cleans", "an", "object", "thoroughly", ".", "Script", "scrubbed", "html", "encoded", "." ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L215-L234
40,460
bipio-server/bip-pod
index.js
function(host, whitelist, next) { var blacklist = this.options.blacklist; helper.resolveHost(host, function(err, aRecords, resolvedHost) { var inBlacklist = false; if (!err) { if (whitelist) { if (_.intersection(aRecords, whitelist).length ) { next(err, [], aRecords); ...
javascript
function(host, whitelist, next) { var blacklist = this.options.blacklist; helper.resolveHost(host, function(err, aRecords, resolvedHost) { var inBlacklist = false; if (!err) { if (whitelist) { if (_.intersection(aRecords, whitelist).length ) { next(err, [], aRecords); ...
[ "function", "(", "host", ",", "whitelist", ",", "next", ")", "{", "var", "blacklist", "=", "this", ".", "options", ".", "blacklist", ";", "helper", ".", "resolveHost", "(", "host", ",", "function", "(", "err", ",", "aRecords", ",", "resolvedHost", ")", ...
tests whether host is in blacklist
[ "tests", "whether", "host", "is", "in", "blacklist" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L587-L610
40,461
bipio-server/bip-pod
index.js
function(id, period, callback) { var self = this; if (this.$resource.cron) { if (!this.crons[id]) { self._logger.call(self, 'POD:Registering Cron:' + self.getName() + ':' + id); self.crons[id] = new self.$resource.cron.CronJob( period, callback, null, ...
javascript
function(id, period, callback) { var self = this; if (this.$resource.cron) { if (!this.crons[id]) { self._logger.call(self, 'POD:Registering Cron:' + self.getName() + ':' + id); self.crons[id] = new self.$resource.cron.CronJob( period, callback, null, ...
[ "function", "(", "id", ",", "period", ",", "callback", ")", "{", "var", "self", "=", "this", ";", "if", "(", "this", ".", "$resource", ".", "cron", ")", "{", "if", "(", "!", "this", ".", "crons", "[", "id", "]", ")", "{", "self", ".", "_logger"...
provide a scheduler service
[ "provide", "a", "scheduler", "service" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L859-L874
40,462
bipio-server/bip-pod
index.js
function(message, channel, level) { if (helper.isObject(message)) { this._logger.call(this, channel.action + ':' + (channel.owner_id ? channel.owner_id : 'system'), level); if (message.message) { message = message; } this._logger.call(this, message, ...
javascript
function(message, channel, level) { if (helper.isObject(message)) { this._logger.call(this, channel.action + ':' + (channel.owner_id ? channel.owner_id : 'system'), level); if (message.message) { message = message; } this._logger.call(this, message, ...
[ "function", "(", "message", ",", "channel", ",", "level", ")", "{", "if", "(", "helper", ".", "isObject", "(", "message", ")", ")", "{", "this", ".", "_logger", ".", "call", "(", "this", ",", "channel", ".", "action", "+", "':'", "+", "(", "channel...
Logs a message
[ "Logs", "a", "message" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L909-L931
40,463
bipio-server/bip-pod
index.js
function(owner_id, next) { var self = this, podName = this.getName(), filter = { owner_id : owner_id, type : this.getAuthType(), oauth_provider : this.getName() }; this._dao.find('account_auth', filter, function(err, result) { var model, authStruct; if (result) { ...
javascript
function(owner_id, next) { var self = this, podName = this.getName(), filter = { owner_id : owner_id, type : this.getAuthType(), oauth_provider : this.getName() }; this._dao.find('account_auth', filter, function(err, result) { var model, authStruct; if (result) { ...
[ "function", "(", "owner_id", ",", "next", ")", "{", "var", "self", "=", "this", ",", "podName", "=", "this", ".", "getName", "(", ")", ",", "filter", "=", "{", "owner_id", ":", "owner_id", ",", "type", ":", "this", ".", "getAuthType", "(", ")", ","...
passes oAuth result set if one exists
[ "passes", "oAuth", "result", "set", "if", "one", "exists" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L1183-L1204
40,464
bipio-server/bip-pod
index.js
function(channel, next) { var filter = { channel_id : channel.id }, modelName = this.getDataSourceName('dup'); this._dao.removeFilter(modelName, filter, next); }
javascript
function(channel, next) { var filter = { channel_id : channel.id }, modelName = this.getDataSourceName('dup'); this._dao.removeFilter(modelName, filter, next); }
[ "function", "(", "channel", ",", "next", ")", "{", "var", "filter", "=", "{", "channel_id", ":", "channel", ".", "id", "}", ",", "modelName", "=", "this", ".", "getDataSourceName", "(", "'dup'", ")", ";", "this", ".", "_dao", ".", "removeFilter", "(", ...
tries to drop any duplicates from db
[ "tries", "to", "drop", "any", "duplicates", "from", "db" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L1707-L1714
40,465
bipio-server/bip-pod
index.js
function(action, channel, accountInfo, auth, next) { var self = this, config = this.getConfig(); if (!next && 'function' === typeof auth) { next = auth; } else { if (self.isOAuth()) { if (!auth.oauth) { auth.oauth = {}; } _.each(config.oauth, function(value, ke...
javascript
function(action, channel, accountInfo, auth, next) { var self = this, config = this.getConfig(); if (!next && 'function' === typeof auth) { next = auth; } else { if (self.isOAuth()) { if (!auth.oauth) { auth.oauth = {}; } _.each(config.oauth, function(value, ke...
[ "function", "(", "action", ",", "channel", ",", "accountInfo", ",", "auth", ",", "next", ")", "{", "var", "self", "=", "this", ",", "config", "=", "this", ".", "getConfig", "(", ")", ";", "if", "(", "!", "next", "&&", "'function'", "===", "typeof", ...
Runs the teardown for a pod action if one exists
[ "Runs", "the", "teardown", "for", "a", "pod", "action", "if", "one", "exists" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L1734-L1776
40,466
bipio-server/bip-pod
index.js
function(action, method, sysImports, options, channel, req, res) { var self = this; if (this.actions[action] && (this.actions[action].rpc || 'invoke' === method)) { if ('invoke' === method) { var imports = (req.method === 'GET' ? req.query : req.body); // @todo add files support ...
javascript
function(action, method, sysImports, options, channel, req, res) { var self = this; if (this.actions[action] && (this.actions[action].rpc || 'invoke' === method)) { if ('invoke' === method) { var imports = (req.method === 'GET' ? req.query : req.body); // @todo add files support ...
[ "function", "(", "action", ",", "method", ",", "sysImports", ",", "options", ",", "channel", ",", "req", ",", "res", ")", "{", "var", "self", "=", "this", ";", "if", "(", "this", ".", "actions", "[", "action", "]", "&&", "(", "this", ".", "actions"...
RPC's are direct calls into a pod, so its up to the pod to properly authenticate data etc.
[ "RPC", "s", "are", "direct", "calls", "into", "a", "pod", "so", "its", "up", "to", "the", "pod", "to", "properly", "authenticate", "data", "etc", "." ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L2007-L2033
40,467
bipio-server/bip-pod
index.js
function(accountInfo) { var self = this, rpcs = this.getRPCs(), schema = { 'name' : this.getName(), 'title' : this.getTitle(), 'description' : this.getDescription(), 'icon' : this.getIcon(accountInfo), 'auth' : this.getAuth(), 'rpcs' : this.getRPCs(), ...
javascript
function(accountInfo) { var self = this, rpcs = this.getRPCs(), schema = { 'name' : this.getName(), 'title' : this.getTitle(), 'description' : this.getDescription(), 'icon' : this.getIcon(accountInfo), 'auth' : this.getAuth(), 'rpcs' : this.getRPCs(), ...
[ "function", "(", "accountInfo", ")", "{", "var", "self", "=", "this", ",", "rpcs", "=", "this", ".", "getRPCs", "(", ")", ",", "schema", "=", "{", "'name'", ":", "this", ".", "getName", "(", ")", ",", "'title'", ":", "this", ".", "getTitle", "(", ...
Creates a json-schema-ish 'public' view of this Pod
[ "Creates", "a", "json", "-", "schema", "-", "ish", "public", "view", "of", "this", "Pod" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L2168-L2195
40,468
bipio-server/bip-pod
index.js
function(channel, next) { var filter = { channel_id : channel.id, owner_id : channel.owner_id }; this._dao.findFilter('channel_pod_tracking', filter, function(err, result) { next(err || !result, result && result.length > 0 ? result[0].last_poll : null); }); }
javascript
function(channel, next) { var filter = { channel_id : channel.id, owner_id : channel.owner_id }; this._dao.findFilter('channel_pod_tracking', filter, function(err, result) { next(err || !result, result && result.length > 0 ? result[0].last_poll : null); }); }
[ "function", "(", "channel", ",", "next", ")", "{", "var", "filter", "=", "{", "channel_id", ":", "channel", ".", "id", ",", "owner_id", ":", "channel", ".", "owner_id", "}", ";", "this", ".", "_dao", ".", "findFilter", "(", "'channel_pod_tracking'", ",",...
get last poll time for tracker
[ "get", "last", "poll", "time", "for", "tracker" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L2308-L2317
40,469
bipio-server/bip-pod
index.js
function(channel, next) { var filter = { channel_id : channel.id, owner_id : channel.owner_id }, self = this, props = { last_poll : helper.nowUTCSeconds() } this._dao.updateColumn( 'channel_pod_tracking', filter, props, function(err) { if (err) ...
javascript
function(channel, next) { var filter = { channel_id : channel.id, owner_id : channel.owner_id }, self = this, props = { last_poll : helper.nowUTCSeconds() } this._dao.updateColumn( 'channel_pod_tracking', filter, props, function(err) { if (err) ...
[ "function", "(", "channel", ",", "next", ")", "{", "var", "filter", "=", "{", "channel_id", ":", "channel", ".", "id", ",", "owner_id", ":", "channel", ".", "owner_id", "}", ",", "self", "=", "this", ",", "props", "=", "{", "last_poll", ":", "helper"...
set last poll time
[ "set", "last", "poll", "time" ]
360e283f2ec61b163d992fb294dd99e00f84ca46
https://github.com/bipio-server/bip-pod/blob/360e283f2ec61b163d992fb294dd99e00f84ca46/index.js#L2320-L2341
40,470
right-track/right-track-core
modules/query/StopsTable.js
getStopByName
function getStopByName(db, name, callback) { // Check cache for Stop let cacheKey = db.id + "-" + name; let cache = cache_stopByName.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Different queries to lookup stop by name let queries = [ "SELECT stop_id FROM gtfs_stops ...
javascript
function getStopByName(db, name, callback) { // Check cache for Stop let cacheKey = db.id + "-" + name; let cache = cache_stopByName.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Different queries to lookup stop by name let queries = [ "SELECT stop_id FROM gtfs_stops ...
[ "function", "getStopByName", "(", "db", ",", "name", ",", "callback", ")", "{", "// Check cache for Stop", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "name", ";", "let", "cache", "=", "cache_stopByName", ".", "get", "(", "cacheKey", ")", ...
Get the Stop specified by name from the passed database @param {RightTrackDB} db The Right Track Database to query @param {string} name Stop Name (found in either gtfs_stops, rt_alt_stop_names or rt_stops_extra tables) @param {function} callback Callback function @param {Error} callback.error Database Query Error @par...
[ "Get", "the", "Stop", "specified", "by", "name", "from", "the", "passed", "database" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopsTable.js#L142-L182
40,471
right-track/right-track-core
modules/query/StopsTable.js
_queryForStopByName
function _queryForStopByName(db, query, callback) { // Perform the search query db.get(query, function(err, result) { // No stop found, return undefined if ( result === undefined ) { return callback(undefined); } // Stop found, return the Stop from it's ID getStop(db, result.stop_id, fu...
javascript
function _queryForStopByName(db, query, callback) { // Perform the search query db.get(query, function(err, result) { // No stop found, return undefined if ( result === undefined ) { return callback(undefined); } // Stop found, return the Stop from it's ID getStop(db, result.stop_id, fu...
[ "function", "_queryForStopByName", "(", "db", ",", "query", ",", "callback", ")", "{", "// Perform the search query", "db", ".", "get", "(", "query", ",", "function", "(", "err", ",", "result", ")", "{", "// No stop found, return undefined", "if", "(", "result",...
Perform a query searching for Stop by it's name @param {RightTrackDB} db The Right Track Database to query @param {string} query The full SELECT query to perform @param {function} callback Callback function(Stop) @private
[ "Perform", "a", "query", "searching", "for", "Stop", "by", "it", "s", "name" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopsTable.js#L191-L208
40,472
right-track/right-track-core
modules/query/StopsTable.js
getStopByStatusId
function getStopByStatusId(db, statusId, callback) { // Make sure statusId is not -1 if ( statusId === "-1" ) { return callback( new Error('Stop does not have a valid Status ID') ); } // Check cache for stop let cacheKey = db.id + "-" + statusId; let cache = cache_stopByStatusId.get(cacheKey...
javascript
function getStopByStatusId(db, statusId, callback) { // Make sure statusId is not -1 if ( statusId === "-1" ) { return callback( new Error('Stop does not have a valid Status ID') ); } // Check cache for stop let cacheKey = db.id + "-" + statusId; let cache = cache_stopByStatusId.get(cacheKey...
[ "function", "getStopByStatusId", "(", "db", ",", "statusId", ",", "callback", ")", "{", "// Make sure statusId is not -1", "if", "(", "statusId", "===", "\"-1\"", ")", "{", "return", "callback", "(", "new", "Error", "(", "'Stop does not have a valid Status ID'", ")"...
Get the Stop specified by status id from the passed database @param {RightTrackDB} db The Right Track Database to query @param {string} statusId the status id of the Stop @param {function} callback Callback function @param {Error} callback.error Database Query Error @param {Stop} [callback.stop] The selected Stop
[ "Get", "the", "Stop", "specified", "by", "status", "id", "from", "the", "passed", "database" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopsTable.js#L220-L298
40,473
right-track/right-track-core
modules/query/StopsTable.js
_parseStopsByLocation
function _parseStopsByLocation(stops, lat, lon, count, distance, callback) { // Calc distance to/from each stop for ( let i = 0; i < stops.length; i++ ) { stops[i].setDistance(lat, lon); } // Sort by distance stops.sort(Stop.sortByDistance); // Filter the stops to return let rtn = []; // Retur...
javascript
function _parseStopsByLocation(stops, lat, lon, count, distance, callback) { // Calc distance to/from each stop for ( let i = 0; i < stops.length; i++ ) { stops[i].setDistance(lat, lon); } // Sort by distance stops.sort(Stop.sortByDistance); // Filter the stops to return let rtn = []; // Retur...
[ "function", "_parseStopsByLocation", "(", "stops", ",", "lat", ",", "lon", ",", "count", ",", "distance", ",", "callback", ")", "{", "// Calc distance to/from each stop", "for", "(", "let", "i", "=", "0", ";", "i", "<", "stops", ".", "length", ";", "i", ...
Parse the Stops by the Location Information @param {Stop[]} stops List of Stops to parse @param {number} lat Location Latitude @param {number} lon Location Longitude @param {int} count Max number of stops to return (-1 for unlimited) @param {number} distance Max distance from location (-1 for no limit) @param {function...
[ "Parse", "the", "Stops", "by", "the", "Location", "Information" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopsTable.js#L566-L611
40,474
right-track/right-track-core
modules/query/StopsTable.js
clearCache
function clearCache() { cache_stopById.clear(); cache_stopByName.clear(); cache_stopByStatusId.clear(); cache_stops.clear(); cache_stopsByRoute.clear(); }
javascript
function clearCache() { cache_stopById.clear(); cache_stopByName.clear(); cache_stopByStatusId.clear(); cache_stops.clear(); cache_stopsByRoute.clear(); }
[ "function", "clearCache", "(", ")", "{", "cache_stopById", ".", "clear", "(", ")", ";", "cache_stopByName", ".", "clear", "(", ")", ";", "cache_stopByStatusId", ".", "clear", "(", ")", ";", "cache_stops", ".", "clear", "(", ")", ";", "cache_stopsByRoute", ...
Clear the StopsTable caches @private
[ "Clear", "the", "StopsTable", "caches" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopsTable.js#L626-L632
40,475
right-track/right-track-core
modules/utils/calc.js
distance
function distance(lat1, lon1, lat2, lon2) { let R = 6371; // Radius of the earth in km let dLat = _deg2rad(lat2-lat1); // deg2rad below let dLon = _deg2rad(lon2-lon1); let a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(_deg2rad(lat1)) * Math.cos(_deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLo...
javascript
function distance(lat1, lon1, lat2, lon2) { let R = 6371; // Radius of the earth in km let dLat = _deg2rad(lat2-lat1); // deg2rad below let dLon = _deg2rad(lon2-lon1); let a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(_deg2rad(lat1)) * Math.cos(_deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLo...
[ "function", "distance", "(", "lat1", ",", "lon1", ",", "lat2", ",", "lon2", ")", "{", "let", "R", "=", "6371", ";", "// Radius of the earth in km", "let", "dLat", "=", "_deg2rad", "(", "lat2", "-", "lat1", ")", ";", "// deg2rad below", "let", "dLon", "="...
Right Track calculation helper functions @module utils/calc Calculate the (Great-Circle) Distance between two points @param {number} lat1 Latitude of Point 1 @param {number} lon1 Longitude of Point 1 @param {number} lat2 Latitude of Point 2 @param {number} lon2 Longitude of Point 2 @returns {number} distance between ...
[ "Right", "Track", "calculation", "helper", "functions" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/utils/calc.js#L17-L29
40,476
right-track/right-track-core
modules/query/LineGraphTable.js
getPaths
function getPaths(db, originId, destinationId, callback) { // Get Graph buildGraph(db, function(err, graph) { if ( err ) { return callback(err); } // Paths to return let rtn = []; // Search the Graph for ( let it = graph.paths(originId, destinationId), kv; !(kv = it.next()).done;) {...
javascript
function getPaths(db, originId, destinationId, callback) { // Get Graph buildGraph(db, function(err, graph) { if ( err ) { return callback(err); } // Paths to return let rtn = []; // Search the Graph for ( let it = graph.paths(originId, destinationId), kv; !(kv = it.next()).done;) {...
[ "function", "getPaths", "(", "db", ",", "originId", ",", "destinationId", ",", "callback", ")", "{", "// Get Graph", "buildGraph", "(", "db", ",", "function", "(", "err", ",", "graph", ")", "{", "if", "(", "err", ")", "{", "return", "callback", "(", "e...
Get all possible paths from the origin to the destination following the Agency Line Graph @param {RightTrackDB} db The Right Track DB to Query @param {String} originId Origin Stop ID @param {String} destinationId Destination Stop ID @param {function} callback Callback Function @param {Error} callback.err Database Query...
[ "Get", "all", "possible", "paths", "from", "the", "origin", "to", "the", "destination", "following", "the", "Agency", "Line", "Graph" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/LineGraphTable.js#L122-L151
40,477
right-track/right-track-core
modules/query/LineGraphTable.js
buildGraph
function buildGraph(db, callback) { // Check cache for graph let cacheKey = db.id + "-graph"; let cache = cache_graph.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build Graph let graph = new Graph(); // Add the Vertices _addGraphVertices(db, graph, function(err, gra...
javascript
function buildGraph(db, callback) { // Check cache for graph let cacheKey = db.id + "-graph"; let cache = cache_graph.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build Graph let graph = new Graph(); // Add the Vertices _addGraphVertices(db, graph, function(err, gra...
[ "function", "buildGraph", "(", "db", ",", "callback", ")", "{", "// Check cache for graph", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-graph\"", ";", "let", "cache", "=", "cache_graph", ".", "get", "(", "cacheKey", ")", ";", "if", "(", "cache", "!...
Build the entire Agency Line Graph @param {RightTrackDB} db The Right Track DB to query @param {function} callback Callback function @param {Error} callback.err Database Query Error @param {Graph} [callback.graph] Agency Graph @see {@link https://www.npmjs.com/package/graph.js|graph.js package}
[ "Build", "the", "entire", "Agency", "Line", "Graph" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/LineGraphTable.js#L163-L199
40,478
right-track/right-track-core
modules/query/LineGraphTable.js
_addGraphVertices
function _addGraphVertices(db, graph, callback) { // Get all Stops StopsTable.getStops(db, function(err, stops) { // Database Query Error if ( err ) { return callback(err); } // Add each Stop as a Vertex for ( let i = 0; i < stops.length; i++ ) { graph.addNewVertex(stops[i].id, st...
javascript
function _addGraphVertices(db, graph, callback) { // Get all Stops StopsTable.getStops(db, function(err, stops) { // Database Query Error if ( err ) { return callback(err); } // Add each Stop as a Vertex for ( let i = 0; i < stops.length; i++ ) { graph.addNewVertex(stops[i].id, st...
[ "function", "_addGraphVertices", "(", "db", ",", "graph", ",", "callback", ")", "{", "// Get all Stops", "StopsTable", ".", "getStops", "(", "db", ",", "function", "(", "err", ",", "stops", ")", "{", "// Database Query Error", "if", "(", "err", ")", "{", "...
Add all Stops as Vertices to the Graph @param {RightTrackDB} db The Right Track DB to query @param {Graph} graph The Graph to add vertices to @param {function} callback Callback function(err, graph) @private
[ "Add", "all", "Stops", "as", "Vertices", "to", "the", "Graph" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/LineGraphTable.js#L209-L229
40,479
right-track/right-track-core
modules/query/LineGraphTable.js
_addGraphEdges
function _addGraphEdges(db, graph, callback) { // Counters let done = 0; let count = graph.vertexCount(); // Loop through each Vertex in the Graph for ( let [stopId, stop] of graph ) { // Get the Edges for the Vertex _getStopEdges(db, stopId, function(err, edges) { // Database Query Error ...
javascript
function _addGraphEdges(db, graph, callback) { // Counters let done = 0; let count = graph.vertexCount(); // Loop through each Vertex in the Graph for ( let [stopId, stop] of graph ) { // Get the Edges for the Vertex _getStopEdges(db, stopId, function(err, edges) { // Database Query Error ...
[ "function", "_addGraphEdges", "(", "db", ",", "graph", ",", "callback", ")", "{", "// Counters", "let", "done", "=", "0", ";", "let", "count", "=", "graph", ".", "vertexCount", "(", ")", ";", "// Loop through each Vertex in the Graph", "for", "(", "let", "["...
Add edges to each Vertex in the Graph @param {RightTrackDB} db The Right Track DB to query @param {Graph} graph The Graph to add edges to @param {function} callback Callback function(err, graph) @private
[ "Add", "edges", "to", "each", "Vertex", "in", "the", "Graph" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/LineGraphTable.js#L238-L276
40,480
joyent/node-zsock
lib/zsock.js
createZoneSocket
function createZoneSocket(options, callback) { if (!options) throw new TypeError('options required'); if (!(options instanceof Object)) { throw new TypeError('options must be an Object'); } if (!options.zone) throw new TypeError('options.zone required'); if (!opti...
javascript
function createZoneSocket(options, callback) { if (!options) throw new TypeError('options required'); if (!(options instanceof Object)) { throw new TypeError('options must be an Object'); } if (!options.zone) throw new TypeError('options.zone required'); if (!opti...
[ "function", "createZoneSocket", "(", "options", ",", "callback", ")", "{", "if", "(", "!", "options", ")", "throw", "new", "TypeError", "(", "'options required'", ")", ";", "if", "(", "!", "(", "options", "instanceof", "Object", ")", ")", "{", "throw", "...
Creates a Unix Domain Socket in the specified Zone, and returns a node.js Socket object, suitable for use in a net server. Zone must _not_ be the global zone, and the zone must be running. @param {Object} options an object containg the following parameters: - zone {String} name of the zone in which to create UDS - pa...
[ "Creates", "a", "Unix", "Domain", "Socket", "in", "the", "specified", "Zone", "and", "returns", "a", "node", ".", "js", "Socket", "object", "suitable", "for", "use", "in", "a", "net", "server", "." ]
ca821b9b2af80336b663a67d9a0aa8a8cb584341
https://github.com/joyent/node-zsock/blob/ca821b9b2af80336b663a67d9a0aa8a8cb584341/lib/zsock.js#L40-L54
40,481
right-track/right-track-core
modules/query/StopTimesTable.js
getStopTimeByTripStop
function getStopTimeByTripStop(db, tripId, stopId, date, callback) { // Cache Cache for StopTimes let cacheKey = db.id + "-" + tripId + "-" + stopId + "-" + date; let cache = cache_stoptimesByTripStop.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build the select statement ...
javascript
function getStopTimeByTripStop(db, tripId, stopId, date, callback) { // Cache Cache for StopTimes let cacheKey = db.id + "-" + tripId + "-" + stopId + "-" + date; let cache = cache_stoptimesByTripStop.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Build the select statement ...
[ "function", "getStopTimeByTripStop", "(", "db", ",", "tripId", ",", "stopId", ",", "date", ",", "callback", ")", "{", "// Cache Cache for StopTimes", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "tripId", "+", "\"-\"", "+", "stopId", "+", "\...
Get the StopTime for the specified Trip and the specified Stop from the passed database @param {RightTrackDB} db The Right Track DB to query @param {string} tripId Trip ID @param {string} stopId Stop ID @param {int} date The date (yyyymmdd) the the Trip operates on @param {function} callback Callback function @param {...
[ "Get", "the", "StopTime", "for", "the", "specified", "Trip", "and", "the", "specified", "Stop", "from", "the", "passed", "database" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/StopTimesTable.js#L140-L230
40,482
right-track/right-track-core
modules/query/TripsTable.js
getTripByShortName
function getTripByShortName(db, shortName, date, callback) { // Check Cache for Trip let cacheKey = db.id + "-" + shortName + "-" + date; let cache = cache_tripsByShortName.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get effective service ids _buildEffectiveServiceIDStr...
javascript
function getTripByShortName(db, shortName, date, callback) { // Check Cache for Trip let cacheKey = db.id + "-" + shortName + "-" + date; let cache = cache_tripsByShortName.get(cacheKey); if ( cache !== null ) { return callback(null, cache); } // Get effective service ids _buildEffectiveServiceIDStr...
[ "function", "getTripByShortName", "(", "db", ",", "shortName", ",", "date", ",", "callback", ")", "{", "// Check Cache for Trip", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "shortName", "+", "\"-\"", "+", "date", ";", "let", "cache", "=", ...
Get the Trip specified by the Trip short name that operates on the specified date @param {RightTrackDB} db The Right Track DB to query @param {string} shortName Trip short name @param {int} date Date Integer (yyyymmdd) @param {function} callback Callback function @param {Error} callback.error Database Query Error @para...
[ "Get", "the", "Trip", "specified", "by", "the", "Trip", "short", "name", "that", "operates", "on", "the", "specified", "date" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L247-L292
40,483
right-track/right-track-core
modules/query/TripsTable.js
getTripByDeparture
function getTripByDeparture(db, originId, destinationId, departure, callback) { // Check cache for trip let cacheKey = db.id + "-" + originId + "-" + destinationId + "-" + departure.getTimeSeconds() + "-" + departure.getDateInt(); let cache = cache_tripsByDeparture.get(cacheKey); if ( cache !== null ) { re...
javascript
function getTripByDeparture(db, originId, destinationId, departure, callback) { // Check cache for trip let cacheKey = db.id + "-" + originId + "-" + destinationId + "-" + departure.getTimeSeconds() + "-" + departure.getDateInt(); let cache = cache_tripsByDeparture.get(cacheKey); if ( cache !== null ) { re...
[ "function", "getTripByDeparture", "(", "db", ",", "originId", ",", "destinationId", ",", "departure", ",", "callback", ")", "{", "// Check cache for trip", "let", "cacheKey", "=", "db", ".", "id", "+", "\"-\"", "+", "originId", "+", "\"-\"", "+", "destinationI...
Find the Trip that leaves the specified origin Stop for the specified destination Stop at the departure time specified by the DateTime @param {RightTrackDB} db The Right Track DB to query @param {string} originId Origin Stop ID @param {string} destinationId Destination Stop ID @param {DateTime} departure DateTime of tr...
[ "Find", "the", "Trip", "that", "leaves", "the", "specified", "origin", "Stop", "for", "the", "specified", "destination", "Stop", "at", "the", "departure", "time", "specified", "by", "the", "DateTime" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L306-L354
40,484
right-track/right-track-core
modules/query/TripsTable.js
_getTripByDeparture
function _getTripByDeparture(db, originId, destinationId, departure, callback) { // Get Effective Services for departure date _buildEffectiveServiceIDString(db, departure.getDateInt(), function(err, serviceIdString) { if ( err ) { return callback(err); } // Find a matching trip _getMatchingT...
javascript
function _getTripByDeparture(db, originId, destinationId, departure, callback) { // Get Effective Services for departure date _buildEffectiveServiceIDString(db, departure.getDateInt(), function(err, serviceIdString) { if ( err ) { return callback(err); } // Find a matching trip _getMatchingT...
[ "function", "_getTripByDeparture", "(", "db", ",", "originId", ",", "destinationId", ",", "departure", ",", "callback", ")", "{", "// Get Effective Services for departure date", "_buildEffectiveServiceIDString", "(", "db", ",", "departure", ".", "getDateInt", "(", ")", ...
Get the Trip that matches the origin, destination and departure information @param {RightTrackDB} db The Right Track DB to query @param {string} originId Origin Stop ID @param {string} destinationId Destination Stop ID @param {DateTime} departure Departure DateTime @param {function} callback getTrip callback function(e...
[ "Get", "the", "Trip", "that", "matches", "the", "origin", "destination", "and", "departure", "information" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L365-L399
40,485
right-track/right-track-core
modules/query/TripsTable.js
_buildEffectiveServiceIDString
function _buildEffectiveServiceIDString(db, date, callback) { // Query the Calendar for effective services CalendarTable.getServicesEffective(db, date, function(err, services) { // Database Query Error if ( err ) { return callback(err); } // Build Service ID String let serviceIds = []; ...
javascript
function _buildEffectiveServiceIDString(db, date, callback) { // Query the Calendar for effective services CalendarTable.getServicesEffective(db, date, function(err, services) { // Database Query Error if ( err ) { return callback(err); } // Build Service ID String let serviceIds = []; ...
[ "function", "_buildEffectiveServiceIDString", "(", "db", ",", "date", ",", "callback", ")", "{", "// Query the Calendar for effective services", "CalendarTable", ".", "getServicesEffective", "(", "db", ",", "date", ",", "function", "(", "err", ",", "services", ")", ...
Build the Effective Service ID String for SELECT query @param {RightTrackDB} db The Right Track DB to query @param {int} date Date Integer (yyyymmdd) @param {function} callback Callback function(err, serviceIdString) @private
[ "Build", "the", "Effective", "Service", "ID", "String", "for", "SELECT", "query" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L408-L430
40,486
right-track/right-track-core
modules/query/TripsTable.js
_getMatchingTripId
function _getMatchingTripId(db, originId, destinationId, departure, serviceIdString, callback) { // Find a matching trip in the gtfs_stop_times table let select = "SELECT trip_id FROM gtfs_trips " + "WHERE service_id IN " + serviceIdString + " " + "AND trip_id IN (" + "SELECT trip_id FROM gtfs_stop_tim...
javascript
function _getMatchingTripId(db, originId, destinationId, departure, serviceIdString, callback) { // Find a matching trip in the gtfs_stop_times table let select = "SELECT trip_id FROM gtfs_trips " + "WHERE service_id IN " + serviceIdString + " " + "AND trip_id IN (" + "SELECT trip_id FROM gtfs_stop_tim...
[ "function", "_getMatchingTripId", "(", "db", ",", "originId", ",", "destinationId", ",", "departure", ",", "serviceIdString", ",", "callback", ")", "{", "// Find a matching trip in the gtfs_stop_times table", "let", "select", "=", "\"SELECT trip_id FROM gtfs_trips \"", "+",...
Get the Trip ID of the trip matching the origin, destination, and departure information @param {RightTrackDB} db The Right Track DB to query @param {string} originId Origin Stop ID @param {string} destinationId Destination Stop ID @param {DateTime} departure DateTime of departure @param {string} serviceIdString Effecti...
[ "Get", "the", "Trip", "ID", "of", "the", "trip", "matching", "the", "origin", "destination", "and", "departure", "information" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L442-L503
40,487
right-track/right-track-core
modules/query/TripsTable.js
getTripsByDate
function getTripsByDate(db, date, opts, callback) { // Parse Args if ( callback === undefined && typeof opts === 'function' ) { callback = opts; opts = {} } // Check cache for trips let cacheKey = db.id + "-" + date + "-" + opts.routeId + "-" + opts.stopId; let cache = cache_tripsByDate.get(cacheK...
javascript
function getTripsByDate(db, date, opts, callback) { // Parse Args if ( callback === undefined && typeof opts === 'function' ) { callback = opts; opts = {} } // Check cache for trips let cacheKey = db.id + "-" + date + "-" + opts.routeId + "-" + opts.stopId; let cache = cache_tripsByDate.get(cacheK...
[ "function", "getTripsByDate", "(", "db", ",", "date", ",", "opts", ",", "callback", ")", "{", "// Parse Args", "if", "(", "callback", "===", "undefined", "&&", "typeof", "opts", "===", "'function'", ")", "{", "callback", "=", "opts", ";", "opts", "=", "{...
Get all Trips effectively running on the specified date @param {RightTrackDB} db The Right Track DB to query @param {int} date Date in YYYYMMDD format @param {Object} [opts] Query Options @param {string} [opts.routeId] GTFS Route ID - get Trips that run on this Route @param {string} [opts.stopId] GTFS Stop ID - get Tri...
[ "Get", "all", "Trips", "effectively", "running", "on", "the", "specified", "date" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L517-L624
40,488
right-track/right-track-core
modules/query/TripsTable.js
_finish
function _finish() { done++; if ( count === 0 || done === count ) { rtn.sort(Trip.sortByDepartureTime); return callback(null, rtn); } }
javascript
function _finish() { done++; if ( count === 0 || done === count ) { rtn.sort(Trip.sortByDepartureTime); return callback(null, rtn); } }
[ "function", "_finish", "(", ")", "{", "done", "++", ";", "if", "(", "count", "===", "0", "||", "done", "===", "count", ")", "{", "rtn", ".", "sort", "(", "Trip", ".", "sortByDepartureTime", ")", ";", "return", "callback", "(", "null", ",", "rtn", "...
Finish Parsing Trip @private
[ "Finish", "Parsing", "Trip" ]
667c7718b9895067794980280e03d8c5e63b7e41
https://github.com/right-track/right-track-core/blob/667c7718b9895067794980280e03d8c5e63b7e41/modules/query/TripsTable.js#L616-L622
40,489
svgdotjs/svg.pathmorphing.js
dist/svg.pathmorphing.js
simplyfy
function simplyfy(val){ switch(val[0]){ case 'z': // shorthand line to start case 'Z': val[0] = 'L' val[1] = this.start[0] val[2] = this.start[1] break case 'H': // shorthand horizontal line val[0] = 'L' val[2] = this.pos[1] break case 'V': // shorthand verti...
javascript
function simplyfy(val){ switch(val[0]){ case 'z': // shorthand line to start case 'Z': val[0] = 'L' val[1] = this.start[0] val[2] = this.start[1] break case 'H': // shorthand horizontal line val[0] = 'L' val[2] = this.pos[1] break case 'V': // shorthand verti...
[ "function", "simplyfy", "(", "val", ")", "{", "switch", "(", "val", "[", "0", "]", ")", "{", "case", "'z'", ":", "// shorthand line to start", "case", "'Z'", ":", "val", "[", "0", "]", "=", "'L'", "val", "[", "1", "]", "=", "this", ".", "start", ...
converts shorthand types to long form
[ "converts", "shorthand", "types", "to", "long", "form" ]
5cae2d7120fed801e47e216ab0286f44427c5f01
https://github.com/svgdotjs/svg.pathmorphing.js/blob/5cae2d7120fed801e47e216ab0286f44427c5f01/dist/svg.pathmorphing.js#L156-L194
40,490
svgdotjs/svg.pathmorphing.js
dist/svg.pathmorphing.js
setPosAndReflection
function setPosAndReflection(val){ var len = val.length this.pos = [ val[len-2], val[len-1] ] if('SCQT'.indexOf(val[0]) != -1) this.reflection = [ 2 * this.pos[0] - val[len-4], 2 * this.pos[1] - val[len-3] ] return val }
javascript
function setPosAndReflection(val){ var len = val.length this.pos = [ val[len-2], val[len-1] ] if('SCQT'.indexOf(val[0]) != -1) this.reflection = [ 2 * this.pos[0] - val[len-4], 2 * this.pos[1] - val[len-3] ] return val }
[ "function", "setPosAndReflection", "(", "val", ")", "{", "var", "len", "=", "val", ".", "length", "this", ".", "pos", "=", "[", "val", "[", "len", "-", "2", "]", ",", "val", "[", "len", "-", "1", "]", "]", "if", "(", "'SCQT'", ".", "indexOf", "...
updates reflection point and current position
[ "updates", "reflection", "point", "and", "current", "position" ]
5cae2d7120fed801e47e216ab0286f44427c5f01
https://github.com/svgdotjs/svg.pathmorphing.js/blob/5cae2d7120fed801e47e216ab0286f44427c5f01/dist/svg.pathmorphing.js#L197-L207
40,491
svgdotjs/svg.pathmorphing.js
dist/svg.pathmorphing.js
toBeziere
function toBeziere(val){ var retVal = [val] switch(val[0]){ case 'M': // special handling for M this.pos = this.start = [val[1], val[2]] return retVal case 'L': val[5] = val[3] = val[1] val[6] = val[4] = val[2] val[1] = this.pos[0] val[2] = this.pos[1] break ca...
javascript
function toBeziere(val){ var retVal = [val] switch(val[0]){ case 'M': // special handling for M this.pos = this.start = [val[1], val[2]] return retVal case 'L': val[5] = val[3] = val[1] val[6] = val[4] = val[2] val[1] = this.pos[0] val[2] = this.pos[1] break ca...
[ "function", "toBeziere", "(", "val", ")", "{", "var", "retVal", "=", "[", "val", "]", "switch", "(", "val", "[", "0", "]", ")", "{", "case", "'M'", ":", "// special handling for M", "this", ".", "pos", "=", "this", ".", "start", "=", "[", "val", "[...
converts all types to cubic beziere
[ "converts", "all", "types", "to", "cubic", "beziere" ]
5cae2d7120fed801e47e216ab0286f44427c5f01
https://github.com/svgdotjs/svg.pathmorphing.js/blob/5cae2d7120fed801e47e216ab0286f44427c5f01/dist/svg.pathmorphing.js#L210-L243
40,492
svgdotjs/svg.pathmorphing.js
dist/svg.pathmorphing.js
findNextM
function findNextM(arr, offset){ if(offset === false) return false for(var i = offset, len = arr.length;i < len;++i){ if(arr[i][0] == 'M') return i } return false }
javascript
function findNextM(arr, offset){ if(offset === false) return false for(var i = offset, len = arr.length;i < len;++i){ if(arr[i][0] == 'M') return i } return false }
[ "function", "findNextM", "(", "arr", ",", "offset", ")", "{", "if", "(", "offset", "===", "false", ")", "return", "false", "for", "(", "var", "i", "=", "offset", ",", "len", "=", "arr", ".", "length", ";", "i", "<", "len", ";", "++", "i", ")", ...
finds the next position of type M
[ "finds", "the", "next", "position", "of", "type", "M" ]
5cae2d7120fed801e47e216ab0286f44427c5f01
https://github.com/svgdotjs/svg.pathmorphing.js/blob/5cae2d7120fed801e47e216ab0286f44427c5f01/dist/svg.pathmorphing.js#L246-L257
40,493
JamesMGreene/document.currentScript
karma.conf-ci.js
getFriendlyBrowser
function getFriendlyBrowser(browserName) { browserName = browserName || ""; if (typeof browserName === "string" && browserName) { if (browserName === "MicrosoftEdge") { browserName = "edge"; } if (browserName === "internet explorer") { browserName = "ie"; } else if (browserName === "...
javascript
function getFriendlyBrowser(browserName) { browserName = browserName || ""; if (typeof browserName === "string" && browserName) { if (browserName === "MicrosoftEdge") { browserName = "edge"; } if (browserName === "internet explorer") { browserName = "ie"; } else if (browserName === "...
[ "function", "getFriendlyBrowser", "(", "browserName", ")", "{", "browserName", "=", "browserName", "||", "\"\"", ";", "if", "(", "typeof", "browserName", "===", "\"string\"", "&&", "browserName", ")", "{", "if", "(", "browserName", "===", "\"MicrosoftEdge\"", ")...
UTILITY & GENERATION CODE
[ "UTILITY", "&", "GENERATION", "CODE" ]
e4a726e58ac3d58e56770437c40f3ffc00c8a194
https://github.com/JamesMGreene/document.currentScript/blob/e4a726e58ac3d58e56770437c40f3ffc00c8a194/karma.conf-ci.js#L130-L147
40,494
micromatch/glob-fs
index.js
Glob
function Glob(options) { if (!(this instanceof Glob)) { return new Glob(options); } Emitter.call(this); this.handler = new Handler(this); this.init(options); }
javascript
function Glob(options) { if (!(this instanceof Glob)) { return new Glob(options); } Emitter.call(this); this.handler = new Handler(this); this.init(options); }
[ "function", "Glob", "(", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Glob", ")", ")", "{", "return", "new", "Glob", "(", "options", ")", ";", "}", "Emitter", ".", "call", "(", "this", ")", ";", "this", ".", "handler", "=", "n...
Optionally create an instance of `Glob` with the given `options`. ```js var Glob = require('glob-fs').Glob; var glob = new Glob(); ``` @param {Object} `options` @api public
[ "Optionally", "create", "an", "instance", "of", "Glob", "with", "the", "given", "options", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L42-L50
40,495
micromatch/glob-fs
index.js
function (opts) { this.options = opts || {}; this.pattern = null; this.middleware = {}; this.includes = {}; this.excludes = {}; this.files = []; this.fns = []; options(this); iterators(this); symlinks(this); readers(this); }
javascript
function (opts) { this.options = opts || {}; this.pattern = null; this.middleware = {}; this.includes = {}; this.excludes = {}; this.files = []; this.fns = []; options(this); iterators(this); symlinks(this); readers(this); }
[ "function", "(", "opts", ")", "{", "this", ".", "options", "=", "opts", "||", "{", "}", ";", "this", ".", "pattern", "=", "null", ";", "this", ".", "middleware", "=", "{", "}", ";", "this", ".", "includes", "=", "{", "}", ";", "this", ".", "exc...
Initialize private objects.
[ "Initialize", "private", "objects", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L62-L75
40,496
micromatch/glob-fs
index.js
function (glob, opts) { if (opts.ignore) { this.map('exclude', opts.ignore, opts); } if (opts.exclude) { this.map('exclude', opts.exclude, opts); } if (opts.include) { this.map('include', opts.include, opts); } // if not disabled by the user, run the built-ins if (!thi...
javascript
function (glob, opts) { if (opts.ignore) { this.map('exclude', opts.ignore, opts); } if (opts.exclude) { this.map('exclude', opts.exclude, opts); } if (opts.include) { this.map('include', opts.include, opts); } // if not disabled by the user, run the built-ins if (!thi...
[ "function", "(", "glob", ",", "opts", ")", "{", "if", "(", "opts", ".", "ignore", ")", "{", "this", ".", "map", "(", "'exclude'", ",", "opts", ".", "ignore", ",", "opts", ")", ";", "}", "if", "(", "opts", ".", "exclude", ")", "{", "this", ".", ...
Set configuration defaults.
[ "Set", "configuration", "defaults", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L81-L104
40,497
micromatch/glob-fs
index.js
function (pattern, options) { options = options || {}; this.pattern = new Pattern(pattern, options); this.recurse = this.shouldRecurse(this.pattern, options); // if middleware are registered, use the glob, otherwise regex var glob = this.fns.length ? this.pattern.glob : this.pattern.reg...
javascript
function (pattern, options) { options = options || {}; this.pattern = new Pattern(pattern, options); this.recurse = this.shouldRecurse(this.pattern, options); // if middleware are registered, use the glob, otherwise regex var glob = this.fns.length ? this.pattern.glob : this.pattern.reg...
[ "function", "(", "pattern", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "pattern", "=", "new", "Pattern", "(", "pattern", ",", "options", ")", ";", "this", ".", "recurse", "=", "this", ".", "shouldRecurse", ...
Create an instance of `Pattern` from the current glob pattern. @param {String} `pattern` @param {Object} `options`
[ "Create", "an", "instance", "of", "Pattern", "from", "the", "current", "glob", "pattern", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L113-L126
40,498
micromatch/glob-fs
index.js
function (file) { return new File({ pattern: this.pattern, recurse: this.recurse, dirname: file.dirname, segment: file.segment, path: file.path }); }
javascript
function (file) { return new File({ pattern: this.pattern, recurse: this.recurse, dirname: file.dirname, segment: file.segment, path: file.path }); }
[ "function", "(", "file", ")", "{", "return", "new", "File", "(", "{", "pattern", ":", "this", ".", "pattern", ",", "recurse", ":", "this", ".", "recurse", ",", "dirname", ":", "file", ".", "dirname", ",", "segment", ":", "file", ".", "segment", ",", ...
Create a file object with properties that will be used by middleware. @param {String} `file` @return {Object}
[ "Create", "a", "file", "object", "with", "properties", "that", "will", "be", "used", "by", "middleware", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L136-L144
40,499
micromatch/glob-fs
index.js
function(pattern, options) { var opts = this.setDefaults(options); if (typeof opts.recurse === 'boolean') { return opts.recurse; } return pattern.isGlobstar; }
javascript
function(pattern, options) { var opts = this.setDefaults(options); if (typeof opts.recurse === 'boolean') { return opts.recurse; } return pattern.isGlobstar; }
[ "function", "(", "pattern", ",", "options", ")", "{", "var", "opts", "=", "this", ".", "setDefaults", "(", "options", ")", ";", "if", "(", "typeof", "opts", ".", "recurse", "===", "'boolean'", ")", "{", "return", "opts", ".", "recurse", ";", "}", "re...
Return `true` if the iterator should recurse, based on the given glob pattern and options. @param {String} `pattern` @param {Object} `options`
[ "Return", "true", "if", "the", "iterator", "should", "recurse", "based", "on", "the", "given", "glob", "pattern", "and", "options", "." ]
9419fb8a112ca6554af0448cbb801c00953af8e5
https://github.com/micromatch/glob-fs/blob/9419fb8a112ca6554af0448cbb801c00953af8e5/index.js#L154-L160