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,300
skerit/protoblast
lib/informer.js
wait
function wait(type) { var that = this, config = this.asyncConfig; if (type !== 'series') { type = 'parallel'; } // Indicate we're going to have to wait config.async = type; function next(err) { config.err = err; config.ListenerIsDone = true; if (config.ListenerCallback) { config.L...
javascript
function wait(type) { var that = this, config = this.asyncConfig; if (type !== 'series') { type = 'parallel'; } // Indicate we're going to have to wait config.async = type; function next(err) { config.err = err; config.ListenerIsDone = true; if (config.ListenerCallback) { config.L...
[ "function", "wait", "(", "type", ")", "{", "var", "that", "=", "this", ",", "config", "=", "this", ".", "asyncConfig", ";", "if", "(", "type", "!==", "'series'", ")", "{", "type", "=", "'parallel'", ";", "}", "// Indicate we're going to have to wait", "con...
A method to indicate we have to wait for it to finish, because it is asynchronous. @author Jelle De Loecker <jelle@develry.be> @since 0.1.3 @version 0.1.4 @return {Function} The function to call when done
[ "A", "method", "to", "indicate", "we", "have", "to", "wait", "for", "it", "to", "finish", "because", "it", "is", "asynchronous", "." ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/informer.js#L1194-L1216
40,301
preceptorjs/taxi
lib/json.js
parse
function parse (str) { if (Buffer.isBuffer(str)) str = str.toString(); type('str', str, 'String'); try { return JSON.parse(str); } catch (ex) { ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str; throw ex; } }
javascript
function parse (str) { if (Buffer.isBuffer(str)) str = str.toString(); type('str', str, 'String'); try { return JSON.parse(str); } catch (ex) { ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str; throw ex; } }
[ "function", "parse", "(", "str", ")", "{", "if", "(", "Buffer", ".", "isBuffer", "(", "str", ")", ")", "str", "=", "str", ".", "toString", "(", ")", ";", "type", "(", "'str'", ",", "str", ",", "'String'", ")", ";", "try", "{", "return", "JSON", ...
Parse a JSON string to a js-value Note: Small wrapper around standard JSON parser @param {String} str @return {*}
[ "Parse", "a", "JSON", "string", "to", "a", "js", "-", "value" ]
96ab5a5c5fa9dc50f325ba4de52dd90009073ca3
https://github.com/preceptorjs/taxi/blob/96ab5a5c5fa9dc50f325ba4de52dd90009073ca3/lib/json.js#L26-L35
40,302
romelperez/prhone-log
lib/index.js
function (obj) { obj = obj || {}; var exts = Array.prototype.slice.call(arguments, 1); for (var k=0; k<exts.length; k++) { if (exts[k]) { for (var i in exts[k]) { if (exts[k].hasOwnProperty(i)) { obj[i] = exts[k][i]; } } } } return obj; }
javascript
function (obj) { obj = obj || {}; var exts = Array.prototype.slice.call(arguments, 1); for (var k=0; k<exts.length; k++) { if (exts[k]) { for (var i in exts[k]) { if (exts[k].hasOwnProperty(i)) { obj[i] = exts[k][i]; } } } } return obj; }
[ "function", "(", "obj", ")", "{", "obj", "=", "obj", "||", "{", "}", ";", "var", "exts", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "for", "(", "var", "k", "=", "0", ";", "k", "<", "exts",...
Simple extend object. Receives many objects. It will not copy deep objects. @private @param {Object} obj - The object to extend. @return {Object} - `obj` extended.
[ "Simple", "extend", "object", ".", "Receives", "many", "objects", ".", "It", "will", "not", "copy", "deep", "objects", "." ]
52cb8290d1a42240fcea49280e652d0265bd0c92
https://github.com/romelperez/prhone-log/blob/52cb8290d1a42240fcea49280e652d0265bd0c92/lib/index.js#L23-L36
40,303
romelperez/prhone-log
lib/index.js
function (time, n) { time = Number(time) || 0; n = n || 2; if (n === 2) { time = time < 10 ? time + '0' : time; } else if (n === 3) { time = time < 10 ? time + '00' : time < 100 ? time + '0' : time; } return String(time); }
javascript
function (time, n) { time = Number(time) || 0; n = n || 2; if (n === 2) { time = time < 10 ? time + '0' : time; } else if (n === 3) { time = time < 10 ? time + '00' : time < 100 ? time + '0' : time; } return String(time); }
[ "function", "(", "time", ",", "n", ")", "{", "time", "=", "Number", "(", "time", ")", "||", "0", ";", "n", "=", "n", "||", "2", ";", "if", "(", "n", "===", "2", ")", "{", "time", "=", "time", "<", "10", "?", "time", "+", "'0'", ":", "time...
Format a time number. @private @param {Number} time @param {Number} n - Number of digits to show. Default 2. @return {String}
[ "Format", "a", "time", "number", "." ]
52cb8290d1a42240fcea49280e652d0265bd0c92
https://github.com/romelperez/prhone-log/blob/52cb8290d1a42240fcea49280e652d0265bd0c92/lib/index.js#L58-L73
40,304
romelperez/prhone-log
lib/index.js
function (level) { if (!level || typeof level !== 'object') { throw new Error('The first parameter must be an object describing the level.'); } if (typeof level.name !== 'string' || !level.name.length) { throw new Error('The level object must have a name property.'); } return extend({ ...
javascript
function (level) { if (!level || typeof level !== 'object') { throw new Error('The first parameter must be an object describing the level.'); } if (typeof level.name !== 'string' || !level.name.length) { throw new Error('The level object must have a name property.'); } return extend({ ...
[ "function", "(", "level", ")", "{", "if", "(", "!", "level", "||", "typeof", "level", "!==", "'object'", ")", "{", "throw", "new", "Error", "(", "'The first parameter must be an object describing the level.'", ")", ";", "}", "if", "(", "typeof", "level", ".", ...
Parse new level. @private @param {Object} level
[ "Parse", "new", "level", "." ]
52cb8290d1a42240fcea49280e652d0265bd0c92
https://github.com/romelperez/prhone-log/blob/52cb8290d1a42240fcea49280e652d0265bd0c92/lib/index.js#L80-L94
40,305
strongloop/strong-github-api
lib/issue-finder.js
IssueFinder
function IssueFinder(options) { this.octo = options.octo; this.repo = options.repo; this.owner = options.owner; assert(this.octo, 'No octokat instance provided!'); }
javascript
function IssueFinder(options) { this.octo = options.octo; this.repo = options.repo; this.owner = options.owner; assert(this.octo, 'No octokat instance provided!'); }
[ "function", "IssueFinder", "(", "options", ")", "{", "this", ".", "octo", "=", "options", ".", "octo", ";", "this", ".", "repo", "=", "options", ".", "repo", ";", "this", ".", "owner", "=", "options", ".", "owner", ";", "assert", "(", "this", ".", ...
A class library for retrieving and filtering GitHub issues. @constructor @param {object} options - The options object. @param {object} options.octo - The instance of octokat that will be used for search operations. @param {string} options.repo - The name of the repository on GitHub. @param {string} options.owner - The ...
[ "A", "class", "library", "for", "retrieving", "and", "filtering", "GitHub", "issues", "." ]
4eb72be7146c830b74e1a43f6e91e8085ce4ed89
https://github.com/strongloop/strong-github-api/blob/4eb72be7146c830b74e1a43f6e91e8085ce4ed89/lib/issue-finder.js#L23-L28
40,306
ruudboon/node-davis-vantage
main.js
_setupSerialConnection
function _setupSerialConnection() { var port = availablePorts[0]; debug.log('Trying to connect to Davis VUE via port: ' + port); // Open serial port connection var sp = new serialPort(port, config.serialPort); var received = ''; sp.on('open', function () { debug.log('Serial connection established, w...
javascript
function _setupSerialConnection() { var port = availablePorts[0]; debug.log('Trying to connect to Davis VUE via port: ' + port); // Open serial port connection var sp = new serialPort(port, config.serialPort); var received = ''; sp.on('open', function () { debug.log('Serial connection established, w...
[ "function", "_setupSerialConnection", "(", ")", "{", "var", "port", "=", "availablePorts", "[", "0", "]", ";", "debug", ".", "log", "(", "'Trying to connect to Davis VUE via port: '", "+", "port", ")", ";", "// Open serial port connection", "var", "sp", "=", "new"...
Setup serial port connection
[ "Setup", "serial", "port", "connection" ]
6ead4d350d19af5dcd9bd22e5882aeca985caf4d
https://github.com/ruudboon/node-davis-vantage/blob/6ead4d350d19af5dcd9bd22e5882aeca985caf4d/main.js#L62-L118
40,307
skazska/nanoDSA
index.js
doSign
function doSign(params, xKey, message, generateHash) { // Let H be the hashing function and m the message: // Generate a random per-message value k where 1<k<q // Calculate r = (g^k mod p) mod q // In the unlikely case that r=0, start again with a different random k // Calculate s = k^(-1) * ( H (m)...
javascript
function doSign(params, xKey, message, generateHash) { // Let H be the hashing function and m the message: // Generate a random per-message value k where 1<k<q // Calculate r = (g^k mod p) mod q // In the unlikely case that r=0, start again with a different random k // Calculate s = k^(-1) * ( H (m)...
[ "function", "doSign", "(", "params", ",", "xKey", ",", "message", ",", "generateHash", ")", "{", "// Let H be the hashing function and m the message:", "// Generate a random per-message value k where 1<k<q", "// Calculate r = (g^k mod p) mod q", "// In the unlikely case that r=0, start...
generates digital signature for data and hash function using private key and shared DSA params @param {{q: number, p: number, g: number}} params shared DSA params @param {{number}} xKey - private key @param {string} message - data to sign @param {function} generateHash - hash function (should accept {string} and return...
[ "generates", "digital", "signature", "for", "data", "and", "hash", "function", "using", "private", "key", "and", "shared", "DSA", "params" ]
0fa053b4b09d7a18d0fcceee150652af6c5bc50c
https://github.com/skazska/nanoDSA/blob/0fa053b4b09d7a18d0fcceee150652af6c5bc50c/index.js#L43-L86
40,308
skazska/nanoDSA
index.js
verify
function verify(params, yKey, sign, message, generateHash) { // Reject the signature if 0<r<q or 0<s<q is not satisfied. // Calculate w = s ^ (-1) mod q // Calculate u_1 = H(m) * w mod q // Calculate u_2 = r * w mod q // Calculate v = ( (g^u_1 * y^u_2) mod p) mod q // The signature is valid if a...
javascript
function verify(params, yKey, sign, message, generateHash) { // Reject the signature if 0<r<q or 0<s<q is not satisfied. // Calculate w = s ^ (-1) mod q // Calculate u_1 = H(m) * w mod q // Calculate u_2 = r * w mod q // Calculate v = ( (g^u_1 * y^u_2) mod p) mod q // The signature is valid if a...
[ "function", "verify", "(", "params", ",", "yKey", ",", "sign", ",", "message", ",", "generateHash", ")", "{", "// Reject the signature if 0<r<q or 0<s<q is not satisfied.", "// Calculate w = s ^ (-1) mod q", "// Calculate u_1 = H(m) * w mod q", "// Calculate u_2 = r * w mod q", "...
verifies digital signature for data and hash function using public key and shared DSA params @param {{q: number, p: number, g: number}} params shared DSA params @param {{number}} yKey - public key @param {[{r: number, s: number}]} sign - digital signature @param {string} message - data to sign @param {function} generat...
[ "verifies", "digital", "signature", "for", "data", "and", "hash", "function", "using", "public", "key", "and", "shared", "DSA", "params" ]
0fa053b4b09d7a18d0fcceee150652af6c5bc50c
https://github.com/skazska/nanoDSA/blob/0fa053b4b09d7a18d0fcceee150652af6c5bc50c/index.js#L97-L123
40,309
datagovsg/datagovsg-plottable-charts
lib/pivot-table.js
createAggregator
function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, _baseIteratee(iteratee, 2), accumulator); }; }
javascript
function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, _baseIteratee(iteratee, 2), accumulator); }; }
[ "function", "createAggregator", "(", "setter", ",", "initializer", ")", "{", "return", "function", "(", "collection", ",", "iteratee", ")", "{", "var", "func", "=", "isArray_1", "(", "collection", ")", "?", "_arrayAggregator", ":", "_baseAggregator", ",", "acc...
Creates a function like `_.groupBy`. @private @param {Function} setter The function to set accumulator values. @param {Function} [initializer] The accumulator object initializer. @returns {Function} Returns the new aggregator function.
[ "Creates", "a", "function", "like", "_", ".", "groupBy", "." ]
f08c65c50f4be32dacb984ba5fd916e23d11e9d2
https://github.com/datagovsg/datagovsg-plottable-charts/blob/f08c65c50f4be32dacb984ba5fd916e23d11e9d2/lib/pivot-table.js#L3045-L3052
40,310
WindomZ/fmtconv
lib/transcode.js
stringJSON2YAML
function stringJSON2YAML (doc, compact = false) { if (!doc || (typeof doc !== 'string' && typeof doc !== 'object')) { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = doc if (typeof doc === 'string') { obj = JSON.parse(doc) } return yaml.safeDump(obj, c...
javascript
function stringJSON2YAML (doc, compact = false) { if (!doc || (typeof doc !== 'string' && typeof doc !== 'object')) { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = doc if (typeof doc === 'string') { obj = JSON.parse(doc) } return yaml.safeDump(obj, c...
[ "function", "stringJSON2YAML", "(", "doc", ",", "compact", "=", "false", ")", "{", "if", "(", "!", "doc", "||", "(", "typeof", "doc", "!==", "'string'", "&&", "typeof", "doc", "!==", "'object'", ")", ")", "{", "throw", "new", "TypeError", "(", "'Argume...
Transcode JSON to YAML string. @param {string|Object} doc @param {boolean} [compact] @return {string} @api public
[ "Transcode", "JSON", "to", "YAML", "string", "." ]
80923dc9d63714a92bac2f7d4f412a2b46c063a1
https://github.com/WindomZ/fmtconv/blob/80923dc9d63714a92bac2f7d4f412a2b46c063a1/lib/transcode.js#L16-L27
40,311
WindomZ/fmtconv
lib/transcode.js
stringYAML2JSON
function stringYAML2JSON (doc, compact = false) { if (!doc || typeof doc !== 'string') { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = yaml.safeLoad(doc) if (!obj || typeof obj !== 'object') { throw new TypeError('Argument must be in yaml format: ' + doc...
javascript
function stringYAML2JSON (doc, compact = false) { if (!doc || typeof doc !== 'string') { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = yaml.safeLoad(doc) if (!obj || typeof obj !== 'object') { throw new TypeError('Argument must be in yaml format: ' + doc...
[ "function", "stringYAML2JSON", "(", "doc", ",", "compact", "=", "false", ")", "{", "if", "(", "!", "doc", "||", "typeof", "doc", "!==", "'string'", ")", "{", "throw", "new", "TypeError", "(", "'Argument must be a string or object, and not empty: '", "+", "doc", ...
Transcode YAML to JSON string. @param {string} doc @param {boolean} [compact] @return {string} @api public
[ "Transcode", "YAML", "to", "JSON", "string", "." ]
80923dc9d63714a92bac2f7d4f412a2b46c063a1
https://github.com/WindomZ/fmtconv/blob/80923dc9d63714a92bac2f7d4f412a2b46c063a1/lib/transcode.js#L37-L49
40,312
WindomZ/fmtconv
lib/transcode.js
stringJSON2JSON
function stringJSON2JSON (doc, compact = false) { if (!doc || (typeof doc !== 'string' && typeof doc !== 'object')) { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = doc if (typeof doc === 'string') { obj = JSON.parse(doc) } return JSON.stringify(obj, ...
javascript
function stringJSON2JSON (doc, compact = false) { if (!doc || (typeof doc !== 'string' && typeof doc !== 'object')) { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = doc if (typeof doc === 'string') { obj = JSON.parse(doc) } return JSON.stringify(obj, ...
[ "function", "stringJSON2JSON", "(", "doc", ",", "compact", "=", "false", ")", "{", "if", "(", "!", "doc", "||", "(", "typeof", "doc", "!==", "'string'", "&&", "typeof", "doc", "!==", "'object'", ")", ")", "{", "throw", "new", "TypeError", "(", "'Argume...
Transcode JSON to JSON string. @param {string|Object} doc @param {boolean} [compact] @return {string} @api public
[ "Transcode", "JSON", "to", "JSON", "string", "." ]
80923dc9d63714a92bac2f7d4f412a2b46c063a1
https://github.com/WindomZ/fmtconv/blob/80923dc9d63714a92bac2f7d4f412a2b46c063a1/lib/transcode.js#L59-L70
40,313
WindomZ/fmtconv
lib/transcode.js
stringYAML2YAML
function stringYAML2YAML (doc, compact = false) { if (!doc || typeof doc !== 'string') { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = yaml.safeLoad(doc) if (!obj || typeof obj !== 'object') { throw new TypeError('Argument must be in yaml format: ' + doc...
javascript
function stringYAML2YAML (doc, compact = false) { if (!doc || typeof doc !== 'string') { throw new TypeError('Argument must be a string or object, and not empty: ' + doc) } let obj = yaml.safeLoad(doc) if (!obj || typeof obj !== 'object') { throw new TypeError('Argument must be in yaml format: ' + doc...
[ "function", "stringYAML2YAML", "(", "doc", ",", "compact", "=", "false", ")", "{", "if", "(", "!", "doc", "||", "typeof", "doc", "!==", "'string'", ")", "{", "throw", "new", "TypeError", "(", "'Argument must be a string or object, and not empty: '", "+", "doc", ...
Transcode YAML to YAML string. @param {string} doc @param {boolean} [compact] @return {string} @api public
[ "Transcode", "YAML", "to", "YAML", "string", "." ]
80923dc9d63714a92bac2f7d4f412a2b46c063a1
https://github.com/WindomZ/fmtconv/blob/80923dc9d63714a92bac2f7d4f412a2b46c063a1/lib/transcode.js#L80-L92
40,314
hash-bang/compare-names
index.js
fuzzyStringCompare
function fuzzyStringCompare(a, b, tolerence) { if (a == b) return true; var as = stripNoise(a); as = as.toLowerCase(); if (as.length > 255) as = as.substr(0, 255); var bs = stripNoise(b); bs = bs.toLowerCase(); if (bs.length > 255) bs = bs.substr(0, 255); if (tolerence == undefined && levenshtein(as, bs) < 1...
javascript
function fuzzyStringCompare(a, b, tolerence) { if (a == b) return true; var as = stripNoise(a); as = as.toLowerCase(); if (as.length > 255) as = as.substr(0, 255); var bs = stripNoise(b); bs = bs.toLowerCase(); if (bs.length > 255) bs = bs.substr(0, 255); if (tolerence == undefined && levenshtein(as, bs) < 1...
[ "function", "fuzzyStringCompare", "(", "a", ",", "b", ",", "tolerence", ")", "{", "if", "(", "a", "==", "b", ")", "return", "true", ";", "var", "as", "=", "stripNoise", "(", "a", ")", ";", "as", "=", "as", ".", "toLowerCase", "(", ")", ";", "if",...
Fuzzily compare strings a and b @param string a The first string to compare @param string b The second string to compare @param number tolerence The tolerence when comparing using levenshtein, defaults to 10 @return boolean True if a ≈ b
[ "Fuzzily", "compare", "strings", "a", "and", "b" ]
19a15a8410f05b94b7fd191874c1f5af3ef5cd51
https://github.com/hash-bang/compare-names/blob/19a15a8410f05b94b7fd191874c1f5af3ef5cd51/index.js#L22-L35
40,315
hash-bang/compare-names
index.js
splitAuthor
function splitAuthor(author) { return author .split(/\s*[,\.\s]\s*/) .filter(function(i) { return !!i }) // Strip out blanks .filter(function(i) { return !/^[0-9]+(st|nd|rd|th)$/.test(i) }); // Strip out decendent numerics (e.g. '1st', '23rd') }
javascript
function splitAuthor(author) { return author .split(/\s*[,\.\s]\s*/) .filter(function(i) { return !!i }) // Strip out blanks .filter(function(i) { return !/^[0-9]+(st|nd|rd|th)$/.test(i) }); // Strip out decendent numerics (e.g. '1st', '23rd') }
[ "function", "splitAuthor", "(", "author", ")", "{", "return", "author", ".", "split", "(", "/", "\\s*[,\\.\\s]\\s*", "/", ")", ".", "filter", "(", "function", "(", "i", ")", "{", "return", "!", "!", "i", "}", ")", "// Strip out blanks", ".", "filter", ...
Splits an author string into its component parts @param string author The raw author string to split @return array An array composed of lastname, initial/name
[ "Splits", "an", "author", "string", "into", "its", "component", "parts" ]
19a15a8410f05b94b7fd191874c1f5af3ef5cd51
https://github.com/hash-bang/compare-names/blob/19a15a8410f05b94b7fd191874c1f5af3ef5cd51/index.js#L43-L48
40,316
hash-bang/compare-names
index.js
compareNames
function compareNames(a, b) { if (!isArray(a)) a = splitAuthorString(a); if (!isArray(b)) b = splitAuthorString(b); var aPos = 0, bPos = 0; var authorLimit = Math.min(a.length, b.length); var failed = false; while (aPos < authorLimit && bPos < authorLimit) { if (fuzzyStringCompare(a[aPos], b[bPos])) { // Dire...
javascript
function compareNames(a, b) { if (!isArray(a)) a = splitAuthorString(a); if (!isArray(b)) b = splitAuthorString(b); var aPos = 0, bPos = 0; var authorLimit = Math.min(a.length, b.length); var failed = false; while (aPos < authorLimit && bPos < authorLimit) { if (fuzzyStringCompare(a[aPos], b[bPos])) { // Dire...
[ "function", "compareNames", "(", "a", ",", "b", ")", "{", "if", "(", "!", "isArray", "(", "a", ")", ")", "a", "=", "splitAuthorString", "(", "a", ")", ";", "if", "(", "!", "isArray", "(", "b", ")", ")", "b", "=", "splitAuthorString", "(", "b", ...
Compare an array of authors against a second array @param array a The first array of authors @param array b The second array of authors @return bolean True if a ≈ b
[ "Compare", "an", "array", "of", "authors", "against", "a", "second", "array" ]
19a15a8410f05b94b7fd191874c1f5af3ef5cd51
https://github.com/hash-bang/compare-names/blob/19a15a8410f05b94b7fd191874c1f5af3ef5cd51/index.js#L67-L105
40,317
mjaczynski/docloud-api
index.js
function(call, error, response, body, codes, reject) { if (error) { if (typeof error == 'string') { var message = util.format("Unexpected error on %s %s, reason : %s", call.method, call.uri, error); util.log(message); var exception = new Error(message); exception.call = call; rej...
javascript
function(call, error, response, body, codes, reject) { if (error) { if (typeof error == 'string') { var message = util.format("Unexpected error on %s %s, reason : %s", call.method, call.uri, error); util.log(message); var exception = new Error(message); exception.call = call; rej...
[ "function", "(", "call", ",", "error", ",", "response", ",", "body", ",", "codes", ",", "reject", ")", "{", "if", "(", "error", ")", "{", "if", "(", "typeof", "error", "==", "'string'", ")", "{", "var", "message", "=", "util", ".", "format", "(", ...
Check for an error after calling an HTTP request. @param call the call data @param error the error info passed to the callback @param response the HTTP response @param body the HTTP body @param codes the array of accepted response code @param reject the promise reject call back to call in case of error
[ "Check", "for", "an", "error", "after", "calling", "an", "HTTP", "request", "." ]
10e2afb7cab0f66f5a02dc943e79d45b86817b9c
https://github.com/mjaczynski/docloud-api/blob/10e2afb7cab0f66f5a02dc943e79d45b86817b9c/index.js#L20-L51
40,318
preceptorjs/taxi
lib/element.js
Element
function Element (driver, parent, selector, id) { this._driver = driver; this._parent = parent; this._selector = selector; this._id = id; }
javascript
function Element (driver, parent, selector, id) { this._driver = driver; this._parent = parent; this._selector = selector; this._id = id; }
[ "function", "Element", "(", "driver", ",", "parent", ",", "selector", ",", "id", ")", "{", "this", ".", "_driver", "=", "driver", ";", "this", ".", "_parent", "=", "parent", ";", "this", ".", "_selector", "=", "selector", ";", "this", ".", "_id", "="...
Object representing a DOM-Element @constructor @class Element @module WebDriver @submodule Core @param {Driver} driver @param {Browser|Element} parent @param {String} selector @param {String} id
[ "Object", "representing", "a", "DOM", "-", "Element" ]
96ab5a5c5fa9dc50f325ba4de52dd90009073ca3
https://github.com/preceptorjs/taxi/blob/96ab5a5c5fa9dc50f325ba4de52dd90009073ca3/lib/element.js#L26-L31
40,319
penartur/node-benchmark-pages
lib/benchmark-context.js
function (benchmark, simultaneousRequests, done) { var pageName, engineName; this.benchmark = benchmark; this.simultaneousRequests = simultaneousRequests; this.done = done; if (typeof simultaneousRequests !== "number") { throw new Error("simultaneousRequests must be an integer; " + (typeof simultaneousReques...
javascript
function (benchmark, simultaneousRequests, done) { var pageName, engineName; this.benchmark = benchmark; this.simultaneousRequests = simultaneousRequests; this.done = done; if (typeof simultaneousRequests !== "number") { throw new Error("simultaneousRequests must be an integer; " + (typeof simultaneousReques...
[ "function", "(", "benchmark", ",", "simultaneousRequests", ",", "done", ")", "{", "var", "pageName", ",", "engineName", ";", "this", ".", "benchmark", "=", "benchmark", ";", "this", ".", "simultaneousRequests", "=", "simultaneousRequests", ";", "this", ".", "d...
Instances of BenchmarkContext are one-time only
[ "Instances", "of", "BenchmarkContext", "are", "one", "-", "time", "only" ]
c8ad235b14427d9d4762c67b125b5ea258b32e91
https://github.com/penartur/node-benchmark-pages/blob/c8ad235b14427d9d4762c67b125b5ea258b32e91/lib/benchmark-context.js#L11-L35
40,320
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/context.js
visit
function visit() { if (this.isBlacklisted()) return false; if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false; this.call("enter"); if (this.shouldSkip) { return this.shouldStop; } var node = this.node; var opts = this.opts; if (node) { if (Array.isArray(node)) { // tr...
javascript
function visit() { if (this.isBlacklisted()) return false; if (this.opts.shouldSkip && this.opts.shouldSkip(this)) return false; this.call("enter"); if (this.shouldSkip) { return this.shouldStop; } var node = this.node; var opts = this.opts; if (node) { if (Array.isArray(node)) { // tr...
[ "function", "visit", "(", ")", "{", "if", "(", "this", ".", "isBlacklisted", "(", ")", ")", "return", "false", ";", "if", "(", "this", ".", "opts", ".", "shouldSkip", "&&", "this", ".", "opts", ".", "shouldSkip", "(", "this", ")", ")", "return", "f...
Visits a node and calls appropriate enter and exit callbacks as required.
[ "Visits", "a", "node", "and", "calls", "appropriate", "enter", "and", "exit", "callbacks", "as", "required", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/context.js#L88-L115
40,321
skerit/protoblast
lib/jsonpath.js
JSONPath
function JSONPath(expression, options) { if (!options || typeof options != 'object') { options = {}; } if (!options.resultType) { options.resultType = 'value'; } if (typeof options.flatten == 'undefined') { options.flatten = false; } if (typeof options.wrap == 'undefined') { options.wrap =...
javascript
function JSONPath(expression, options) { if (!options || typeof options != 'object') { options = {}; } if (!options.resultType) { options.resultType = 'value'; } if (typeof options.flatten == 'undefined') { options.flatten = false; } if (typeof options.wrap == 'undefined') { options.wrap =...
[ "function", "JSONPath", "(", "expression", ",", "options", ")", "{", "if", "(", "!", "options", "||", "typeof", "options", "!=", "'object'", ")", "{", "options", "=", "{", "}", ";", "}", "if", "(", "!", "options", ".", "resultType", ")", "{", "option...
Extract data from objects using JSONPath @author Stefan Goessner <goessner.net> @author Jelle De Loecker <jelle@develry.be> @since 0.1.0 @version 0.1.0 @param {String} expr The string expression
[ "Extract", "data", "from", "objects", "using", "JSONPath" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/jsonpath.js#L27-L52
40,322
stdarg/property-path
index.js
getParentPath
function getParentPath(path, sep) { if (!is.nonEmptyStr(path)) return false; if (!is.nonEmptyStr(sep)) sep = defaultSepChar; // create new path and remove leading and trailing sep chars var properties = filter(path.split(sep), function(elem) { return is.str(elem) && elem.length; }); ...
javascript
function getParentPath(path, sep) { if (!is.nonEmptyStr(path)) return false; if (!is.nonEmptyStr(sep)) sep = defaultSepChar; // create new path and remove leading and trailing sep chars var properties = filter(path.split(sep), function(elem) { return is.str(elem) && elem.length; }); ...
[ "function", "getParentPath", "(", "path", ",", "sep", ")", "{", "if", "(", "!", "is", ".", "nonEmptyStr", "(", "path", ")", ")", "return", "false", ";", "if", "(", "!", "is", ".", "nonEmptyStr", "(", "sep", ")", ")", "sep", "=", "defaultSepChar", "...
Given a char separated object path, return the parent part of the path. Given a path, return the parent path, for '1.2.3.4', the parent path would be '1.2.3'. @param {String} path The path for which which we want the parent. @param {String} sep The separator character to separate path elements. @return {String|Boolean}...
[ "Given", "a", "char", "separated", "object", "path", "return", "the", "parent", "part", "of", "the", "path", ".", "Given", "a", "path", "return", "the", "parent", "path", "for", "1", ".", "2", ".", "3", ".", "4", "the", "parent", "path", "would", "be...
9b48457673c97bd3133c3fec57ff69c15b621251
https://github.com/stdarg/property-path/blob/9b48457673c97bd3133c3fec57ff69c15b621251/index.js#L62-L79
40,323
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js
createUnionTypeAnnotation
function createUnionTypeAnnotation(types) { var flattened = removeTypeDuplicates(types); if (flattened.length === 1) { return flattened[0]; } else { return t.unionTypeAnnotation(flattened); } }
javascript
function createUnionTypeAnnotation(types) { var flattened = removeTypeDuplicates(types); if (flattened.length === 1) { return flattened[0]; } else { return t.unionTypeAnnotation(flattened); } }
[ "function", "createUnionTypeAnnotation", "(", "types", ")", "{", "var", "flattened", "=", "removeTypeDuplicates", "(", "types", ")", ";", "if", "(", "flattened", ".", "length", "===", "1", ")", "{", "return", "flattened", "[", "0", "]", ";", "}", "else", ...
Takes an array of `types` and flattens them, removing duplicates and returns a `UnionTypeAnnotation` node containg them.
[ "Takes", "an", "array", "of", "types", "and", "flattens", "them", "removing", "duplicates", "and", "returns", "a", "UnionTypeAnnotation", "node", "containg", "them", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js#L22-L30
40,324
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js
removeTypeDuplicates
function removeTypeDuplicates(nodes) { var generics = {}; var bases = {}; // store union type groups to circular references var typeGroups = []; var types = []; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (!node) continue; // detect duplicates if (types.indexOf(node)...
javascript
function removeTypeDuplicates(nodes) { var generics = {}; var bases = {}; // store union type groups to circular references var typeGroups = []; var types = []; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (!node) continue; // detect duplicates if (types.indexOf(node)...
[ "function", "removeTypeDuplicates", "(", "nodes", ")", "{", "var", "generics", "=", "{", "}", ";", "var", "bases", "=", "{", "}", ";", "// store union type groups to circular references", "var", "typeGroups", "=", "[", "]", ";", "var", "types", "=", "[", "]"...
Dedupe type annotations.
[ "Dedupe", "type", "annotations", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js#L36-L108
40,325
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js
createTypeAnnotationBasedOnTypeof
function createTypeAnnotationBasedOnTypeof(type) { if (type === "string") { return t.stringTypeAnnotation(); } else if (type === "number") { return t.numberTypeAnnotation(); } else if (type === "undefined") { return t.voidTypeAnnotation(); } else if (type === "boolean") { return t.booleanTypeAnn...
javascript
function createTypeAnnotationBasedOnTypeof(type) { if (type === "string") { return t.stringTypeAnnotation(); } else if (type === "number") { return t.numberTypeAnnotation(); } else if (type === "undefined") { return t.voidTypeAnnotation(); } else if (type === "boolean") { return t.booleanTypeAnn...
[ "function", "createTypeAnnotationBasedOnTypeof", "(", "type", ")", "{", "if", "(", "type", "===", "\"string\"", ")", "{", "return", "t", ".", "stringTypeAnnotation", "(", ")", ";", "}", "else", "if", "(", "type", "===", "\"number\"", ")", "{", "return", "t...
Create a type anotation based on typeof expression.
[ "Create", "a", "type", "anotation", "based", "on", "typeof", "expression", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/types/flow.js#L114-L132
40,326
zipscene/objtools
lib/index.js
deepEquals
function deepEquals(a, b) { var i, key; if (isScalar(a) && isScalar(b)) { return scalarEquals(a, b); } if (a === null || b === null || a === undefined || b === undefined) return a === b; if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; for (i = 0; i < a.length; i++) { i...
javascript
function deepEquals(a, b) { var i, key; if (isScalar(a) && isScalar(b)) { return scalarEquals(a, b); } if (a === null || b === null || a === undefined || b === undefined) return a === b; if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; for (i = 0; i < a.length; i++) { i...
[ "function", "deepEquals", "(", "a", ",", "b", ")", "{", "var", "i", ",", "key", ";", "if", "(", "isScalar", "(", "a", ")", "&&", "isScalar", "(", "b", ")", ")", "{", "return", "scalarEquals", "(", "a", ",", "b", ")", ";", "}", "if", "(", "a",...
Checks for deep equality between two object or values. @method deepEquals @static @param {Mixed} a @param {Mixed} b @return {Boolean}
[ "Checks", "for", "deep", "equality", "between", "two", "object", "or", "values", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L59-L82
40,327
zipscene/objtools
lib/index.js
deepCopy
function deepCopy(obj) { var res; var i; var key; if (isTerminal(obj)) { res = obj; } else if (Array.isArray(obj)) { res = Array(obj.length); for (i = 0; i < obj.length; i++) { res[i] = deepCopy(obj[i]); } } else { res = {}; for (key in obj) { res[key] = deepCopy(obj[key]); } } return res; }
javascript
function deepCopy(obj) { var res; var i; var key; if (isTerminal(obj)) { res = obj; } else if (Array.isArray(obj)) { res = Array(obj.length); for (i = 0; i < obj.length; i++) { res[i] = deepCopy(obj[i]); } } else { res = {}; for (key in obj) { res[key] = deepCopy(obj[key]); } } return res; }
[ "function", "deepCopy", "(", "obj", ")", "{", "var", "res", ";", "var", "i", ";", "var", "key", ";", "if", "(", "isTerminal", "(", "obj", ")", ")", "{", "res", "=", "obj", ";", "}", "else", "if", "(", "Array", ".", "isArray", "(", "obj", ")", ...
Returns a deep copy of the given value such that entities are not passed by reference. @method deepCopy @static @param {Mixed} obj - The object or value to copy @return {Mixed}
[ "Returns", "a", "deep", "copy", "of", "the", "given", "value", "such", "that", "entities", "are", "not", "passed", "by", "reference", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L109-L127
40,328
zipscene/objtools
lib/index.js
setPath
function setPath(obj, path, value) { var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (i === parts.length - 1) { cur[parts[i]] = value; } else { if (isScalar(cur[parts[i]])) cur[parts[i]] = {}; cur = cur[parts[i]]; } } return obj; }
javascript
function setPath(obj, path, value) { var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (i === parts.length - 1) { cur[parts[i]] = value; } else { if (isScalar(cur[parts[i]])) cur[parts[i]] = {}; cur = cur[parts[i]]; } } return obj; }
[ "function", "setPath", "(", "obj", ",", "path", ",", "value", ")", "{", "var", "cur", "=", "obj", ";", "var", "parts", "=", "path", ".", "split", "(", "'.'", ")", ";", "var", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "parts", ".", ...
Sets the value at a given path in an object. @method setPath @static @param {Object} obj - The object @param {String} path - The path, dot-separated @param {Mixed} value - Value to set @return {Object} - The same object
[ "Sets", "the", "value", "at", "a", "given", "path", "in", "an", "object", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L343-L356
40,329
zipscene/objtools
lib/index.js
deletePath
function deletePath(obj, path) { var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (i === parts.length - 1) { delete cur[parts[i]]; } else { if (isScalar(cur[parts[i]])) { return obj; } cur = cur[parts[i]]; } } return obj; }
javascript
function deletePath(obj, path) { var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (i === parts.length - 1) { delete cur[parts[i]]; } else { if (isScalar(cur[parts[i]])) { return obj; } cur = cur[parts[i]]; } } return obj; }
[ "function", "deletePath", "(", "obj", ",", "path", ")", "{", "var", "cur", "=", "obj", ";", "var", "parts", "=", "path", ".", "split", "(", "'.'", ")", ";", "var", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "parts", ".", "length", ";...
Deletes the value at a given path in an object. @method deletePath @static @param {Object} obj @param {String} path @return {Object} - The object that was passed in
[ "Deletes", "the", "value", "at", "a", "given", "path", "in", "an", "object", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L368-L383
40,330
zipscene/objtools
lib/index.js
getPath
function getPath(obj, path, allowSkipArrays) { if (path === null || path === undefined) return obj; var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (isScalar(cur)) return undefined; if (Array.isArray(cur) && allowSkipArrays && !(/^[0-9]+$/.test(parts[i])) && cur.lengt...
javascript
function getPath(obj, path, allowSkipArrays) { if (path === null || path === undefined) return obj; var cur = obj; var parts = path.split('.'); var i; for (i = 0; i < parts.length; i++) { if (isScalar(cur)) return undefined; if (Array.isArray(cur) && allowSkipArrays && !(/^[0-9]+$/.test(parts[i])) && cur.lengt...
[ "function", "getPath", "(", "obj", ",", "path", ",", "allowSkipArrays", ")", "{", "if", "(", "path", "===", "null", "||", "path", "===", "undefined", ")", "return", "obj", ";", "var", "cur", "=", "obj", ";", "var", "parts", "=", "path", ".", "split",...
Gets the value at a given path in an object. @method getPath @static @param {Object} obj - The object @param {String} path - The path, dot-separated @param {Boolean} allowSkipArrays - If true: If a field in an object is an array and the path key is non-numeric, and the array has exactly 1 element, then the first eleme...
[ "Gets", "the", "value", "at", "a", "given", "path", "in", "an", "object", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L398-L413
40,331
zipscene/objtools
lib/index.js
merge
function merge(/* object, sources */) { var lastSource = arguments[arguments.length - 1]; if ( typeof lastSource === 'function' || ( arguments.length > 2 && Array.isArray(lastSource) && lastSource.indexOf(arguments[1]) >= 0 ) ) { return mergeHeavy.apply(null, arguments); } else { return mergeLigh...
javascript
function merge(/* object, sources */) { var lastSource = arguments[arguments.length - 1]; if ( typeof lastSource === 'function' || ( arguments.length > 2 && Array.isArray(lastSource) && lastSource.indexOf(arguments[1]) >= 0 ) ) { return mergeHeavy.apply(null, arguments); } else { return mergeLigh...
[ "function", "merge", "(", "/* object, sources */", ")", "{", "var", "lastSource", "=", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ";", "if", "(", "typeof", "lastSource", "===", "'function'", "||", "(", "arguments", ".", "length", ">", "2"...
Merges n objects together. @method merge @static @param {Object} object - the destination object @param {Object} sources - the source object @param {Function} customizer - the function to customize merging properties If provided, customizer is invoked to produce the merged values of the destination and source properti...
[ "Merges", "n", "objects", "together", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L465-L479
40,332
zipscene/objtools
lib/index.js
dottedDiff
function dottedDiff(val1, val2) { if (isScalar(val1) && isScalar(val2)) { return val1 === val2 ? [] : ''; } else { return Object.keys(addDottedDiffFieldsToSet({}, '', val1, val2)); } }
javascript
function dottedDiff(val1, val2) { if (isScalar(val1) && isScalar(val2)) { return val1 === val2 ? [] : ''; } else { return Object.keys(addDottedDiffFieldsToSet({}, '', val1, val2)); } }
[ "function", "dottedDiff", "(", "val1", ",", "val2", ")", "{", "if", "(", "isScalar", "(", "val1", ")", "&&", "isScalar", "(", "val2", ")", ")", "{", "return", "val1", "===", "val2", "?", "[", "]", ":", "''", ";", "}", "else", "{", "return", "Obje...
Diffs two objects @method dottedDiff @static @param {Mixed} val1 - the first value to diff @param {Mixed} val2 - the second value to diff @return {String[]} - an array of dot-separated paths to the shallowest branches present in both objects from which there are no identical scalar values.
[ "Diffs", "two", "objects" ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L660-L666
40,333
zipscene/objtools
lib/index.js
objectHash
function objectHash(obj) { var hash = crypto.createHash('md5'); hash.update(makeHashKey(obj)); return hash.digest('hex'); }
javascript
function objectHash(obj) { var hash = crypto.createHash('md5'); hash.update(makeHashKey(obj)); return hash.digest('hex'); }
[ "function", "objectHash", "(", "obj", ")", "{", "var", "hash", "=", "crypto", ".", "createHash", "(", "'md5'", ")", ";", "hash", ".", "update", "(", "makeHashKey", "(", "obj", ")", ")", ";", "return", "hash", ".", "digest", "(", "'hex'", ")", ";", ...
Construct a consistent hash of an object, array, or other Javascript entity. @method objectHash @static @param {Mixed} obj - The object to hash. @return {String} - The hash string. Long enough so collisions are extremely unlikely.
[ "Construct", "a", "consistent", "hash", "of", "an", "object", "array", "or", "other", "Javascript", "entity", "." ]
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L700-L704
40,334
zipscene/objtools
lib/index.js
sanitizeDate
function sanitizeDate(val) { if (!val) return null; if (_.isDate(val)) return val; if (_.isString(val)) return new Date(Date.parse(val)); if (_.isNumber(val)) return new Date(val); if (_.isObject(val) && val.date) return sanitizeDate(val.date); return null; }
javascript
function sanitizeDate(val) { if (!val) return null; if (_.isDate(val)) return val; if (_.isString(val)) return new Date(Date.parse(val)); if (_.isNumber(val)) return new Date(val); if (_.isObject(val) && val.date) return sanitizeDate(val.date); return null; }
[ "function", "sanitizeDate", "(", "val", ")", "{", "if", "(", "!", "val", ")", "return", "null", ";", "if", "(", "_", ".", "isDate", "(", "val", ")", ")", "return", "val", ";", "if", "(", "_", ".", "isString", "(", "val", ")", ")", "return", "ne...
Converts a date string, number of miliseconds or object with a date field into an instance of Date. It will return the same instance if a Date instance is passed in. @method sanitizeDate @parse {String|Number|Object} - the value to convert @return {Date} - returns the converted Date instance
[ "Converts", "a", "date", "string", "number", "of", "miliseconds", "or", "object", "with", "a", "date", "field", "into", "an", "instance", "of", "Date", ".", "It", "will", "return", "the", "same", "instance", "if", "a", "Date", "instance", "is", "passed", ...
24b5ddf1a079561b978e9e131e14fa8bec19f9ae
https://github.com/zipscene/objtools/blob/24b5ddf1a079561b978e9e131e14fa8bec19f9ae/lib/index.js#L745-L752
40,335
zyw327/okgoes
lib/view/render.js
render
async function render(view, options) { view += settings.viewExt; const viewPath = path.join(settings.root, view); debug(`render: ${viewPath}`); // get from cache if (settings.cache && cache[viewPath]) { return cache[viewPath].call(options.scope, options); } const tpl = await fs.readFi...
javascript
async function render(view, options) { view += settings.viewExt; const viewPath = path.join(settings.root, view); debug(`render: ${viewPath}`); // get from cache if (settings.cache && cache[viewPath]) { return cache[viewPath].call(options.scope, options); } const tpl = await fs.readFi...
[ "async", "function", "render", "(", "view", ",", "options", ")", "{", "view", "+=", "settings", ".", "viewExt", ";", "const", "viewPath", "=", "path", ".", "join", "(", "settings", ".", "root", ",", "view", ")", ";", "debug", "(", "`", "${", "viewPat...
generate html with view name and options @param {String} view @param {Object} options @return {String} html
[ "generate", "html", "with", "view", "name", "and", "options" ]
d3cc0e1a426aae0c39dbed834e9c15a25c43628e
https://github.com/zyw327/okgoes/blob/d3cc0e1a426aae0c39dbed834e9c15a25c43628e/lib/view/render.js#L76-L107
40,336
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/api/node.js
parse
function parse(code) { var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; opts.allowHashBang = true; opts.sourceType = "module"; opts.ecmaVersion = Infinity; opts.plugins = { jsx: true, flow: true }; opts.features = {}; for (var key in _transformation2["default...
javascript
function parse(code) { var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; opts.allowHashBang = true; opts.sourceType = "module"; opts.ecmaVersion = Infinity; opts.plugins = { jsx: true, flow: true }; opts.features = {}; for (var key in _transformation2["default...
[ "function", "parse", "(", "code", ")", "{", "var", "opts", "=", "arguments", ".", "length", "<=", "1", "||", "arguments", "[", "1", "]", "===", "undefined", "?", "{", "}", ":", "arguments", "[", "1", "]", ";", "opts", ".", "allowHashBang", "=", "tr...
Parse script with Babel's parser.
[ "Parse", "script", "with", "Babel", "s", "parser", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/node.js#L146-L181
40,337
epii-io/epii-node-html5
lib/renderer.js
renderToString
function renderToString(meta) { if (meta.html) return meta.html.source var output = [ '<!DOCTYPE html>', '<html>', '<head>', '<meta charset="utf8" />' ] var { head, body } = meta head.metas.forEach(e => output.push(renderMeta(e.name, e.http, e.content))) head.styles.forEach(e => output.push(renderStyle(...
javascript
function renderToString(meta) { if (meta.html) return meta.html.source var output = [ '<!DOCTYPE html>', '<html>', '<head>', '<meta charset="utf8" />' ] var { head, body } = meta head.metas.forEach(e => output.push(renderMeta(e.name, e.http, e.content))) head.styles.forEach(e => output.push(renderStyle(...
[ "function", "renderToString", "(", "meta", ")", "{", "if", "(", "meta", ".", "html", ")", "return", "meta", ".", "html", ".", "source", "var", "output", "=", "[", "'<!DOCTYPE html>'", ",", "'<html>'", ",", "'<head>'", ",", "'<meta charset=\"utf8\" />'", "]",...
render view to HTML5 @return {ViewMeta}
[ "render", "view", "to", "HTML5" ]
69ea36c2be19ac95536925fde4eab9f0e1b16151
https://github.com/epii-io/epii-node-html5/blob/69ea36c2be19ac95536925fde4eab9f0e1b16151/lib/renderer.js#L76-L94
40,338
jetebusiness/jetRoute
dist/jquery.jetroute.js
getRoute
function getRoute(route) { for (var key in settings.routes) { if (key === route) { return settings.routes[key]; } } }
javascript
function getRoute(route) { for (var key in settings.routes) { if (key === route) { return settings.routes[key]; } } }
[ "function", "getRoute", "(", "route", ")", "{", "for", "(", "var", "key", "in", "settings", ".", "routes", ")", "{", "if", "(", "key", "===", "route", ")", "{", "return", "settings", ".", "routes", "[", "key", "]", ";", "}", "}", "}" ]
Return the URI of the called initial route. @param route @returns {*}
[ "Return", "the", "URI", "of", "the", "called", "initial", "route", "." ]
02a8a926b68e250e3a8328f175555204ed39f143
https://github.com/jetebusiness/jetRoute/blob/02a8a926b68e250e3a8328f175555204ed39f143/dist/jquery.jetroute.js#L53-L59
40,339
jetebusiness/jetRoute
dist/jquery.jetroute.js
compareUrlRoute
function compareUrlRoute(currentURL, currentRoute) { var regex = /\{(.*)\}/i; var arraySize = currentRoute.length, testValue = false; for (var i = 0; i < arraySize; i++) { var dynamic = regex.exec(currentRoute[i]); ...
javascript
function compareUrlRoute(currentURL, currentRoute) { var regex = /\{(.*)\}/i; var arraySize = currentRoute.length, testValue = false; for (var i = 0; i < arraySize; i++) { var dynamic = regex.exec(currentRoute[i]); ...
[ "function", "compareUrlRoute", "(", "currentURL", ",", "currentRoute", ")", "{", "var", "regex", "=", "/", "\\{(.*)\\}", "/", "i", ";", "var", "arraySize", "=", "currentRoute", ".", "length", ",", "testValue", "=", "false", ";", "for", "(", "var", "i", "...
Route Compare and Dynamic Route Atributes @param currentURL @param currentRoute @returns {boolean}
[ "Route", "Compare", "and", "Dynamic", "Route", "Atributes" ]
02a8a926b68e250e3a8328f175555204ed39f143
https://github.com/jetebusiness/jetRoute/blob/02a8a926b68e250e3a8328f175555204ed39f143/dist/jquery.jetroute.js#L70-L86
40,340
VividCortex/grunt-circleci
tasks/lib/status.js
function (commit, until) { var checker = this; until = !isNaN(until) ? until : (new Date()).getTime() + (this.getOption('timeout')); if ((new Date()).getTime() > until) { return this.handleError('Timeout'); } return this.getBuilds() ...
javascript
function (commit, until) { var checker = this; until = !isNaN(until) ? until : (new Date()).getTime() + (this.getOption('timeout')); if ((new Date()).getTime() > until) { return this.handleError('Timeout'); } return this.getBuilds() ...
[ "function", "(", "commit", ",", "until", ")", "{", "var", "checker", "=", "this", ";", "until", "=", "!", "isNaN", "(", "until", ")", "?", "until", ":", "(", "new", "Date", "(", ")", ")", ".", "getTime", "(", ")", "+", "(", "this", ".", "getOpt...
Checks the build status of a commit @param {String} commit The commit hash @param {Number} [until] For how long should be check if the build is still running @returns {*|!Promise}
[ "Checks", "the", "build", "status", "of", "a", "commit" ]
a6049fdaffe628f8350c0edcb7528522a4e1e9cc
https://github.com/VividCortex/grunt-circleci/blob/a6049fdaffe628f8350c0edcb7528522a4e1e9cc/tasks/lib/status.js#L84-L131
40,341
Wandalen/wConsequence
sample/SleepingBarber/Problem.js
clientsGenerator
function clientsGenerator() { var i = 0, len = clientsList.length; for( ; i < len; i++ ) { var client = { name : clientsList[ i ].name }; var time = _.timeNow(); setTimeout(( function( client, time ) { /* sending clients to shop */ this.barberShopArrive( client, time ); }).bin...
javascript
function clientsGenerator() { var i = 0, len = clientsList.length; for( ; i < len; i++ ) { var client = { name : clientsList[ i ].name }; var time = _.timeNow(); setTimeout(( function( client, time ) { /* sending clients to shop */ this.barberShopArrive( client, time ); }).bin...
[ "function", "clientsGenerator", "(", ")", "{", "var", "i", "=", "0", ",", "len", "=", "clientsList", ".", "length", ";", "for", "(", ";", "i", "<", "len", ";", "i", "++", ")", "{", "var", "client", "=", "{", "name", ":", "clientsList", "[", "i", ...
Used to simulate clients visiting hairdresser @param {wConsequence} con - this parameter represent sequence of clients that go to barber shop @returns {wConsequence}
[ "Used", "to", "simulate", "clients", "visiting", "hairdresser" ]
c26863e010ad6f8fdf267f94702f36ad2f05917d
https://github.com/Wandalen/wConsequence/blob/c26863e010ad6f8fdf267f94702f36ad2f05917d/sample/SleepingBarber/Problem.js#L32-L47
40,342
skerit/protoblast
lib/string_entities.js
loadEntities
function loadEntities() { // Uncompress the base charmap charMap = require('./string_entities_map.js'); HTMLEntities = {}; for (key in charMap) { for (i = 0; i < charMap[key].length; i++) { HTMLEntities[charMap[key][i]] = key; } } }
javascript
function loadEntities() { // Uncompress the base charmap charMap = require('./string_entities_map.js'); HTMLEntities = {}; for (key in charMap) { for (i = 0; i < charMap[key].length; i++) { HTMLEntities[charMap[key][i]] = key; } } }
[ "function", "loadEntities", "(", ")", "{", "// Uncompress the base charmap", "charMap", "=", "require", "(", "'./string_entities_map.js'", ")", ";", "HTMLEntities", "=", "{", "}", ";", "for", "(", "key", "in", "charMap", ")", "{", "for", "(", "i", "=", "0", ...
Populate HTMLEntities variable with entities @author Jelle De Loecker <jelle@develry.be> @since 0.3.2 @version 0.4.1 @param {String} character The single character to encode @return {String} The encoded char
[ "Populate", "HTMLEntities", "variable", "with", "entities" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/string_entities.js#L114-L125
40,343
Kaniwani/KanaWana
src/packages/kanawana/utils/isCharVowel.js
isCharVowel
function isCharVowel(char = '', includeY = true) { if (isEmpty(char)) return false; const regexp = includeY ? /[aeiouy]/ : /[aeiou]/; return char.toLowerCase().charAt(0).search(regexp) !== -1; }
javascript
function isCharVowel(char = '', includeY = true) { if (isEmpty(char)) return false; const regexp = includeY ? /[aeiouy]/ : /[aeiou]/; return char.toLowerCase().charAt(0).search(regexp) !== -1; }
[ "function", "isCharVowel", "(", "char", "=", "''", ",", "includeY", "=", "true", ")", "{", "if", "(", "isEmpty", "(", "char", ")", ")", "return", "false", ";", "const", "regexp", "=", "includeY", "?", "/", "[aeiouy]", "/", ":", "/", "[aeiou]", "/", ...
Tests a character and an english vowel. Returns true if the char is a vowel. @param {String} char @param {Boolean} [includeY=true] Optional parameter to include y as a vowel in test @return {Boolean}
[ "Tests", "a", "character", "and", "an", "english", "vowel", ".", "Returns", "true", "if", "the", "char", "is", "a", "vowel", "." ]
7084d6c50e68023c225f663f994544f693ff8d3a
https://github.com/Kaniwani/KanaWana/blob/7084d6c50e68023c225f663f994544f693ff8d3a/src/packages/kanawana/utils/isCharVowel.js#L9-L13
40,344
Kaniwani/KanaWana
src/packages/kanawana/utils/convertFullwidthCharsToASCII.js
convertFullwidthCharsToASCII
function convertFullwidthCharsToASCII(text = '') { const asciiChars = [...text].map((char, index) => { const code = char.charCodeAt(0); const lower = isCharInRange(char, LOWERCASE_FULLWIDTH_START, LOWERCASE_FULLWIDTH_END); const upper = isCharInRange(char, UPPERCASE_FULLWIDTH_START, UPPERCASE_FULLWIDTH_EN...
javascript
function convertFullwidthCharsToASCII(text = '') { const asciiChars = [...text].map((char, index) => { const code = char.charCodeAt(0); const lower = isCharInRange(char, LOWERCASE_FULLWIDTH_START, LOWERCASE_FULLWIDTH_END); const upper = isCharInRange(char, UPPERCASE_FULLWIDTH_START, UPPERCASE_FULLWIDTH_EN...
[ "function", "convertFullwidthCharsToASCII", "(", "text", "=", "''", ")", "{", "const", "asciiChars", "=", "[", "...", "text", "]", ".", "map", "(", "(", "char", ",", "index", ")", "=>", "{", "const", "code", "=", "char", ".", "charCodeAt", "(", "0", ...
Converts all fullwidth roman letters in string to proper ASCII @param {String} text Full Width roman letters @return {String} ASCII
[ "Converts", "all", "fullwidth", "roman", "letters", "in", "string", "to", "proper", "ASCII" ]
7084d6c50e68023c225f663f994544f693ff8d3a
https://github.com/Kaniwani/KanaWana/blob/7084d6c50e68023c225f663f994544f693ff8d3a/src/packages/kanawana/utils/convertFullwidthCharsToASCII.js#L17-L30
40,345
juanprietob/clusterpost
src/clusterpost-provider/cronprovider.js
function(){ var view = "_design/searchJob/_view/jobstatus?key=" + JSON.stringify('UPLOADING'); return server.methods.clusterprovider.getView(view) .then(function(docs){ return Promise.map(_.pluck(docs, "value"), server.methods.cronprovider.addJobToUpdateQueue); }) .catch(console.error); ...
javascript
function(){ var view = "_design/searchJob/_view/jobstatus?key=" + JSON.stringify('UPLOADING'); return server.methods.clusterprovider.getView(view) .then(function(docs){ return Promise.map(_.pluck(docs, "value"), server.methods.cronprovider.addJobToUpdateQueue); }) .catch(console.error); ...
[ "function", "(", ")", "{", "var", "view", "=", "\"_design/searchJob/_view/jobstatus?key=\"", "+", "JSON", ".", "stringify", "(", "'UPLOADING'", ")", ";", "return", "server", ".", "methods", ".", "clusterprovider", ".", "getView", "(", "view", ")", ".", "then",...
Checks for stalled uploading tasks.
[ "Checks", "for", "stalled", "uploading", "tasks", "." ]
5893d83d4f03f35e475b36cdcc975fb5154d12f5
https://github.com/juanprietob/clusterpost/blob/5893d83d4f03f35e475b36cdcc975fb5154d12f5/src/clusterpost-provider/cronprovider.js#L302-L311
40,346
oortcloud/ddp-srp
srp.js
function (options) { if (!options) // fast path return _defaults; var ret = _.extend({}, _defaults); _.each(['N', 'g', 'k'], function (p) { if (options[p]) { if (typeof options[p] === "string") ret[p] = new BigInteger(options[p], 16); else if (options[p] instanceof BigInteger) ...
javascript
function (options) { if (!options) // fast path return _defaults; var ret = _.extend({}, _defaults); _.each(['N', 'g', 'k'], function (p) { if (options[p]) { if (typeof options[p] === "string") ret[p] = new BigInteger(options[p], 16); else if (options[p] instanceof BigInteger) ...
[ "function", "(", "options", ")", "{", "if", "(", "!", "options", ")", "// fast path", "return", "_defaults", ";", "var", "ret", "=", "_", ".", "extend", "(", "{", "}", ",", "_defaults", ")", ";", "_", ".", "each", "(", "[", "'N'", ",", "'g'", ","...
Process an options hash to create SRP parameters. Options can include: - hash: Function. Defaults to SHA256. - N: String or BigInteger. Defaults to 1024 bit value from RFC 5054 - g: String or BigInteger. Defaults to 2. - k: String or BigInteger. Defaults to hash(N, g)
[ "Process", "an", "options", "hash", "to", "create", "SRP", "parameters", "." ]
3cb103387cae75abfc2e9a2fb0a66da21efb1244
https://github.com/oortcloud/ddp-srp/blob/3cb103387cae75abfc2e9a2fb0a66da21efb1244/srp.js#L313-L338
40,347
skerit/protoblast
lib/function_inheritance.js
doMultipleInheritance
function doMultipleInheritance(new_constructor, parent_constructor, proto) { var more; if (proto == null) { proto = Object.create(new_constructor.prototype); } // See if this goes even deeper FIRST // (older properties could get overwritten) more = Object.getPrototypeOf(parent_constructor.prototype); ...
javascript
function doMultipleInheritance(new_constructor, parent_constructor, proto) { var more; if (proto == null) { proto = Object.create(new_constructor.prototype); } // See if this goes even deeper FIRST // (older properties could get overwritten) more = Object.getPrototypeOf(parent_constructor.prototype); ...
[ "function", "doMultipleInheritance", "(", "new_constructor", ",", "parent_constructor", ",", "proto", ")", "{", "var", "more", ";", "if", "(", "proto", "==", "null", ")", "{", "proto", "=", "Object", ".", "create", "(", "new_constructor", ".", "prototype", "...
Do multiple inheritance @author Jelle De Loecker <jelle@develry.be> @since 0.3.6 @version 0.3.6 @param {Function} new_constructor @param {Function} parent_constructor @param {Object} proto
[ "Do", "multiple", "inheritance" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L99-L120
40,348
skerit/protoblast
lib/function_inheritance.js
getNamespace
function getNamespace(namespace) { var result, name, data; // Try getting the namespace if (!namespace) { result = Blast.Classes; } else { result = Obj.path(Blast.Classes, namespace); } if (result == null) { name = namespace.split('.'); name = name[name.length - 1]; result = C...
javascript
function getNamespace(namespace) { var result, name, data; // Try getting the namespace if (!namespace) { result = Blast.Classes; } else { result = Obj.path(Blast.Classes, namespace); } if (result == null) { name = namespace.split('.'); name = name[name.length - 1]; result = C...
[ "function", "getNamespace", "(", "namespace", ")", "{", "var", "result", ",", "name", ",", "data", ";", "// Try getting the namespace", "if", "(", "!", "namespace", ")", "{", "result", "=", "Blast", ".", "Classes", ";", "}", "else", "{", "result", "=", "...
Get a namespace object, or create it if it doesn't exist @author Jelle De Loecker <jelle@develry.be> @since 0.2.1 @version 0.6.5 @param {String} namespace @return {Object}
[ "Get", "a", "namespace", "object", "or", "create", "it", "if", "it", "doesn", "t", "exist" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L133-L189
40,349
skerit/protoblast
lib/function_inheritance.js
getClass
function getClass(path) { var pieces = path.split('.'), result; result = Obj.path(Blast.Classes, path); if (typeof result == 'function') { if (result.is_namespace) { result = result[result.name]; } return result; } result = Obj.path(Blast.Globals, path); if (typeof result == 'functi...
javascript
function getClass(path) { var pieces = path.split('.'), result; result = Obj.path(Blast.Classes, path); if (typeof result == 'function') { if (result.is_namespace) { result = result[result.name]; } return result; } result = Obj.path(Blast.Globals, path); if (typeof result == 'functi...
[ "function", "getClass", "(", "path", ")", "{", "var", "pieces", "=", "path", ".", "split", "(", "'.'", ")", ",", "result", ";", "result", "=", "Obj", ".", "path", "(", "Blast", ".", "Classes", ",", "path", ")", ";", "if", "(", "typeof", "result", ...
Get a class @author Jelle De Loecker <jelle@develry.be> @since 0.5.0 @version 0.5.0 @param {String} path @return {Function}
[ "Get", "a", "class" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L204-L228
40,350
skerit/protoblast
lib/function_inheritance.js
getClassPathInfo
function getClassPathInfo(path) { var result = {}, namespace, name, temp; // See what's there temp = Obj.path(Blast.Classes, path); // Is there nothing at the current path? if (!temp) { if (path.indexOf('.') > -1) { // Split the path temp = path.split('.'); // The last pa...
javascript
function getClassPathInfo(path) { var result = {}, namespace, name, temp; // See what's there temp = Obj.path(Blast.Classes, path); // Is there nothing at the current path? if (!temp) { if (path.indexOf('.') > -1) { // Split the path temp = path.split('.'); // The last pa...
[ "function", "getClassPathInfo", "(", "path", ")", "{", "var", "result", "=", "{", "}", ",", "namespace", ",", "name", ",", "temp", ";", "// See what's there", "temp", "=", "Obj", ".", "path", "(", "Blast", ".", "Classes", ",", "path", ")", ";", "// Is ...
Get path information @author Jelle De Loecker <jelle@develry.be> @since 0.5.0 @version 0.5.0 @param {String} path @return {Object}
[ "Get", "path", "information" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L241-L311
40,351
skerit/protoblast
lib/function_inheritance.js
doConstitutors
function doConstitutors(constructor) { var waiting, tasks, i; if (has_constituted.get(constructor)) { return; } has_constituted.set(constructor, true); tasks = constructor.constitutors; if (tasks) { for (i = 0; i < tasks.length; i++) { doConstructorTask(constructor, tasks[i]); ...
javascript
function doConstitutors(constructor) { var waiting, tasks, i; if (has_constituted.get(constructor)) { return; } has_constituted.set(constructor, true); tasks = constructor.constitutors; if (tasks) { for (i = 0; i < tasks.length; i++) { doConstructorTask(constructor, tasks[i]); ...
[ "function", "doConstitutors", "(", "constructor", ")", "{", "var", "waiting", ",", "tasks", ",", "i", ";", "if", "(", "has_constituted", ".", "get", "(", "constructor", ")", ")", "{", "return", ";", "}", "has_constituted", ".", "set", "(", "constructor", ...
Do the constitutors for the given constructor @author Jelle De Loecker <jelle@develry.be> @since 0.3.6 @version 0.3.6 @param {Function} constructor
[ "Do", "the", "constitutors", "for", "the", "given", "constructor" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L667-L696
40,352
skerit/protoblast
lib/function_inheritance.js
doConstructorTask
function doConstructorTask(constructor, task) { var finished; finished = finished_constitutors.get(constructor); if (!finished) { finished = []; finished_constitutors.set(constructor, finished); } if (finished.indexOf(task) == -1) { task.call(constructor); finished.push(task); } }
javascript
function doConstructorTask(constructor, task) { var finished; finished = finished_constitutors.get(constructor); if (!finished) { finished = []; finished_constitutors.set(constructor, finished); } if (finished.indexOf(task) == -1) { task.call(constructor); finished.push(task); } }
[ "function", "doConstructorTask", "(", "constructor", ",", "task", ")", "{", "var", "finished", ";", "finished", "=", "finished_constitutors", ".", "get", "(", "constructor", ")", ";", "if", "(", "!", "finished", ")", "{", "finished", "=", "[", "]", ";", ...
Do the given task for a given constructor @author Jelle De Loecker <jelle@develry.be> @since 0.3.6 @version 0.3.6 @param {Function} constructor @param {Function} task
[ "Do", "the", "given", "task", "for", "a", "given", "constructor" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L719-L734
40,353
skerit/protoblast
lib/function_inheritance.js
applyDecoration
function applyDecoration(constructor, key, options) { if (options.kind == 'method') { return Fn.setMethod(constructor, key, options.descriptor); } throw new Error('Decorating ' + options.kind + ' is not yet implemented'); }
javascript
function applyDecoration(constructor, key, options) { if (options.kind == 'method') { return Fn.setMethod(constructor, key, options.descriptor); } throw new Error('Decorating ' + options.kind + ' is not yet implemented'); }
[ "function", "applyDecoration", "(", "constructor", ",", "key", ",", "options", ")", "{", "if", "(", "options", ".", "kind", "==", "'method'", ")", "{", "return", "Fn", ".", "setMethod", "(", "constructor", ",", "key", ",", "options", ".", "descriptor", "...
Apply a decoration object @author Jelle De Loecker <jelle@develry.be> @since 0.6.0 @version 0.6.0 @param {Function} constructor @param {String|Symbol} key @param {Object} options
[ "Apply", "a", "decoration", "object" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L1170-L1177
40,354
skerit/protoblast
lib/function_inheritance.js
setStaticProperty
function setStaticProperty(key, getter, setter, inherit) { return Fn.setStaticProperty(this, key, getter, setter, inherit); }
javascript
function setStaticProperty(key, getter, setter, inherit) { return Fn.setStaticProperty(this, key, getter, setter, inherit); }
[ "function", "setStaticProperty", "(", "key", ",", "getter", ",", "setter", ",", "inherit", ")", "{", "return", "Fn", ".", "setStaticProperty", "(", "this", ",", "key", ",", "getter", ",", "setter", ",", "inherit", ")", ";", "}" ]
Set a static getter property @author Jelle De Loecker <jelle@develry.be> @since 0.1.4 @version 0.1.4 @param {String} key Name to use (defaults to method name) @param {Function} getter Function that returns a value OR value @param {Function} setter Function that sets the valu...
[ "Set", "a", "static", "getter", "property" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L1501-L1503
40,355
skerit/protoblast
lib/function_inheritance.js
compose
function compose(key, compositor, traits) { return Fn.compose(this.prototype, key, compositor, traits); }
javascript
function compose(key, compositor, traits) { return Fn.compose(this.prototype, key, compositor, traits); }
[ "function", "compose", "(", "key", ",", "compositor", ",", "traits", ")", "{", "return", "Fn", ".", "compose", "(", "this", ".", "prototype", ",", "key", ",", "compositor", ",", "traits", ")", ";", "}" ]
Compose a class as a property @author Jelle De Loecker <jelle@develry.be> @since 0.1.4 @version 0.1.4 @param {String} key Name to use @param {Function} compositor @param {Object} traits
[ "Compose", "a", "class", "as", "a", "property" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L1605-L1607
40,356
skerit/protoblast
lib/function_inheritance.js
ensureConstructorStaticMethods
function ensureConstructorStaticMethods(newConstructor) { if (typeof newConstructor.setMethod !== 'function') { Blast.defineValue(newConstructor, protoPrepareStaticProperty); Blast.defineValue(newConstructor, protoSetStaticProperty); Blast.defineValue(newConstructor, protoPrepareProperty); Blast.defineVa...
javascript
function ensureConstructorStaticMethods(newConstructor) { if (typeof newConstructor.setMethod !== 'function') { Blast.defineValue(newConstructor, protoPrepareStaticProperty); Blast.defineValue(newConstructor, protoSetStaticProperty); Blast.defineValue(newConstructor, protoPrepareProperty); Blast.defineVa...
[ "function", "ensureConstructorStaticMethods", "(", "newConstructor", ")", "{", "if", "(", "typeof", "newConstructor", ".", "setMethod", "!==", "'function'", ")", "{", "Blast", ".", "defineValue", "(", "newConstructor", ",", "protoPrepareStaticProperty", ")", ";", "B...
Ensure a constructor has the required static methods @author Jelle De Loecker <jelle@kipdola.be> @since 0.3.4 @version 0.3.4 @param {Function} newConstructor
[ "Ensure", "a", "constructor", "has", "the", "required", "static", "methods" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/function_inheritance.js#L1661-L1681
40,357
stezu/node-stream
lib/modifiers/map.js
map
function map(transform) { var cb = makeAsync(transform, 2); return through.obj(function (value, enc, next) { cb(value, next); }); }
javascript
function map(transform) { var cb = makeAsync(transform, 2); return through.obj(function (value, enc, next) { cb(value, next); }); }
[ "function", "map", "(", "transform", ")", "{", "var", "cb", "=", "makeAsync", "(", "transform", ",", "2", ")", ";", "return", "through", ".", "obj", "(", "function", "(", "value", ",", "enc", ",", "next", ")", "{", "cb", "(", "value", ",", "next", ...
Creates a new stream with the results of calling the provided function on every item in the stream. Similar to Array.map... but on a stream. @static @since 1.0.0 @category Modifiers @param {Function} transform - Function that returns a new element on the stream. Takes one argument, the value of the item at this...
[ "Creates", "a", "new", "stream", "with", "the", "results", "of", "calling", "the", "provided", "function", "on", "every", "item", "in", "the", "stream", ".", "Similar", "to", "Array", ".", "map", "...", "but", "on", "a", "stream", "." ]
f70c03351746c958865a854f614932f1df441b9b
https://github.com/stezu/node-stream/blob/f70c03351746c958865a854f614932f1df441b9b/lib/modifiers/map.js#L46-L52
40,358
stezu/node-stream
lib/modifiers/reduce.js
reduce
function reduce(reducer, initialValue) { var accumulator = initialValue; var cb = makeAsync(reducer, 3); return through.obj( function transform(chunk, enc, next) { cb(accumulator, chunk, function (err, result) { accumulator = result; next(err); }); }, function Flush(next)...
javascript
function reduce(reducer, initialValue) { var accumulator = initialValue; var cb = makeAsync(reducer, 3); return through.obj( function transform(chunk, enc, next) { cb(accumulator, chunk, function (err, result) { accumulator = result; next(err); }); }, function Flush(next)...
[ "function", "reduce", "(", "reducer", ",", "initialValue", ")", "{", "var", "accumulator", "=", "initialValue", ";", "var", "cb", "=", "makeAsync", "(", "reducer", ",", "3", ")", ";", "return", "through", ".", "obj", "(", "function", "transform", "(", "c...
Creates a new stream with a single item that's produced by calling a reducer with each item of the original stream. Similar to Array.reduce... but on a stream. @static @since 1.0.0 @category Modifiers @param {Function} reducer - Function that reduces items in the stream. Takes two arguments: the current ...
[ "Creates", "a", "new", "stream", "with", "a", "single", "item", "that", "s", "produced", "by", "calling", "a", "reducer", "with", "each", "item", "of", "the", "original", "stream", ".", "Similar", "to", "Array", ".", "reduce", "...", "but", "on", "a", ...
f70c03351746c958865a854f614932f1df441b9b
https://github.com/stezu/node-stream/blob/f70c03351746c958865a854f614932f1df441b9b/lib/modifiers/reduce.js#L68-L85
40,359
nodesource/ah-deep-clone
ah-deep-clone.js
copy
function copy(acc, k) { const val = x[k] let cpy if (Array.isArray(val)) { cpy = val.slice(0) } else { cpy = val } acc[k] = cpy return acc }
javascript
function copy(acc, k) { const val = x[k] let cpy if (Array.isArray(val)) { cpy = val.slice(0) } else { cpy = val } acc[k] = cpy return acc }
[ "function", "copy", "(", "acc", ",", "k", ")", "{", "const", "val", "=", "x", "[", "k", "]", "let", "cpy", "if", "(", "Array", ".", "isArray", "(", "val", ")", ")", "{", "cpy", "=", "val", ".", "slice", "(", "0", ")", "}", "else", "{", "cpy...
so far we only expect to deal with the following property types shallow Array, String, Number
[ "so", "far", "we", "only", "expect", "to", "deal", "with", "the", "following", "property", "types", "shallow", "Array", "String", "Number" ]
c532d41b9076582e6f91b415e629c90a6acce531
https://github.com/nodesource/ah-deep-clone/blob/c532d41b9076582e6f91b415e629c90a6acce531/ah-deep-clone.js#L4-L14
40,360
NogsMPLS/react-component-styleguide
lib/rcs.js
RCS
function RCS (input, opts) { opts = opts || {} this.log = require('./logger')('rcs-lib', {debug: opts.verbose || false}) var config // If feeding in a direct config object if (opts.config !== null && typeof opts.config === 'object') { config = opts.config } else { config = this.readConfig(opts.co...
javascript
function RCS (input, opts) { opts = opts || {} this.log = require('./logger')('rcs-lib', {debug: opts.verbose || false}) var config // If feeding in a direct config object if (opts.config !== null && typeof opts.config === 'object') { config = opts.config } else { config = this.readConfig(opts.co...
[ "function", "RCS", "(", "input", ",", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", "this", ".", "log", "=", "require", "(", "'./logger'", ")", "(", "'rcs-lib'", ",", "{", "debug", ":", "opts", ".", "verbose", "||", "false", "}", ")", "v...
React Styleguide Generator @class @param {string} input @param {Object} opts @param {string} opts.output @param {string} opts.title @param {string|Object} opts.config @param {string} opts.root @param {boolean} opts.pushstate @param {string[]} opts.files @param {Object} opts.babelConfig @param {Object} opts.webpackConf...
[ "React", "Styleguide", "Generator" ]
2974304ea50abc66a0238ca10c5e219c947d6cfa
https://github.com/NogsMPLS/react-component-styleguide/blob/2974304ea50abc66a0238ca10c5e219c947d6cfa/lib/rcs.js#L54-L118
40,361
bBlocks/component
component.js
function (obj, eventType, eventHandler) { if (!obj.eventHandlers) { obj.eventHandlers = {}; } if (!obj.eventHandlers[eventType]) { obj.eventHandlers[eventType] = []; } if (eventHandler) { obj.eventHandlers[eventType].push(eventHandler); } return obj.eventHandlers[eventType]; }
javascript
function (obj, eventType, eventHandler) { if (!obj.eventHandlers) { obj.eventHandlers = {}; } if (!obj.eventHandlers[eventType]) { obj.eventHandlers[eventType] = []; } if (eventHandler) { obj.eventHandlers[eventType].push(eventHandler); } return obj.eventHandlers[eventType]; }
[ "function", "(", "obj", ",", "eventType", ",", "eventHandler", ")", "{", "if", "(", "!", "obj", ".", "eventHandlers", ")", "{", "obj", ".", "eventHandlers", "=", "{", "}", ";", "}", "if", "(", "!", "obj", ".", "eventHandlers", "[", "eventType", "]", ...
Adds an event handler to a componet @param {object} obj - Target object @param {string} eventType - Name of the event @param {function} eventHandler - Event handler @return {object} - Object with a list of defined event handlers
[ "Adds", "an", "event", "handler", "to", "a", "componet" ]
7dcccf1861d66f2c915c97900630b0b4a9d072e2
https://github.com/bBlocks/component/blob/7dcccf1861d66f2c915c97900630b0b4a9d072e2/component.js#L29-L38
40,362
bBlocks/component
component.js
function(parentClass, isWhat, tag, features) { // v0 spec implementation using https://github.com/WebReflection/document-register-element var elementClass = Object.create(parentClass.prototype); // Clone event handlers if (elementClass.eventHandlers) { var clonedHandlers = {}; for (var i in elem...
javascript
function(parentClass, isWhat, tag, features) { // v0 spec implementation using https://github.com/WebReflection/document-register-element var elementClass = Object.create(parentClass.prototype); // Clone event handlers if (elementClass.eventHandlers) { var clonedHandlers = {}; for (var i in elem...
[ "function", "(", "parentClass", ",", "isWhat", ",", "tag", ",", "features", ")", "{", "// v0 spec implementation using https://github.com/WebReflection/document-register-element \t", "var", "elementClass", "=", "Object", ".", "create", "(", "parentClass", ".", "prototype", ...
Register custom element in the DOM using spec v0 @param {function} [HTMLElement] prarentClass - Constructor or class of the element @param {string} isWhat - Name for the component. Could be used as tag name or "is" attribute @param {string=} tag - Tag name of the element. Required when extending native elements @param ...
[ "Register", "custom", "element", "in", "the", "DOM", "using", "spec", "v0" ]
7dcccf1861d66f2c915c97900630b0b4a9d072e2
https://github.com/bBlocks/component/blob/7dcccf1861d66f2c915c97900630b0b4a9d072e2/component.js#L48-L109
40,363
bBlocks/component
component.js
function (obj, properties) { var events, propertyDescriptors, i; if (!properties) { return; } // Clone events if (properties.on) { events = Object.assign({}, properties.on); } Object.assign(obj, properties); // IE11 need a polyfill // Handle events if (events) { for (i in events) { ...
javascript
function (obj, properties) { var events, propertyDescriptors, i; if (!properties) { return; } // Clone events if (properties.on) { events = Object.assign({}, properties.on); } Object.assign(obj, properties); // IE11 need a polyfill // Handle events if (events) { for (i in events) { ...
[ "function", "(", "obj", ",", "properties", ")", "{", "var", "events", ",", "propertyDescriptors", ",", "i", ";", "if", "(", "!", "properties", ")", "{", "return", ";", "}", "// Clone events", "if", "(", "properties", ".", "on", ")", "{", "events", "=",...
Adds a feature to the component @param {object} obj - Target object. Usually a prototype of a component. Properties "on", "define", "observedAttribute" will be stacked.
[ "Adds", "a", "feature", "to", "the", "component" ]
7dcccf1861d66f2c915c97900630b0b4a9d072e2
https://github.com/bBlocks/component/blob/7dcccf1861d66f2c915c97900630b0b4a9d072e2/component.js#L220-L252
40,364
bBlocks/component
component.js
function() { 'use strict'; var features = arguments; if (!features.length) { return; } // Detect isWhat, tag and parent class var props = feature.apply(null, arguments); var isWhat = props.is; var tag = props.tag; var parentClass = props.extends; if (!parentClass) {parentClass = HTMLElemen...
javascript
function() { 'use strict'; var features = arguments; if (!features.length) { return; } // Detect isWhat, tag and parent class var props = feature.apply(null, arguments); var isWhat = props.is; var tag = props.tag; var parentClass = props.extends; if (!parentClass) {parentClass = HTMLElemen...
[ "function", "(", ")", "{", "'use strict'", ";", "var", "features", "=", "arguments", ";", "if", "(", "!", "features", ".", "length", ")", "{", "return", ";", "}", "// Detect isWhat, tag and parent class", "var", "props", "=", "feature", ".", "apply", "(", ...
Define a component and register in the DOM @memberof bb @param {object} [...] One or more features to have in the component. Features will be mixed. At least one of the features needs to have "is" proeprty defined. @return {function} Constructor for elements
[ "Define", "a", "component", "and", "register", "in", "the", "DOM" ]
7dcccf1861d66f2c915c97900630b0b4a9d072e2
https://github.com/bBlocks/component/blob/7dcccf1861d66f2c915c97900630b0b4a9d072e2/component.js#L271-L294
40,365
bBlocks/component
component.js
function() { 'use strict'; var self = this || {}; if (arguments.length) { for (var i = 0; i<arguments.length; i++) { if (typeof arguments[i] != 'object') {utils.warn('Expected object in argument #' + i); continue;} Object.assign(self, arguments[i]); } } return self; }
javascript
function() { 'use strict'; var self = this || {}; if (arguments.length) { for (var i = 0; i<arguments.length; i++) { if (typeof arguments[i] != 'object') {utils.warn('Expected object in argument #' + i); continue;} Object.assign(self, arguments[i]); } } return self; }
[ "function", "(", ")", "{", "'use strict'", ";", "var", "self", "=", "this", "||", "{", "}", ";", "if", "(", "arguments", ".", "length", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "arguments", ".", "length", ";", "i", "++", ")", ...
Created a feature from one or more objects @constructor @memberof bb @param {object} [...] @return {object} Created feature. Each feature could have special properties like "is", "tag", "extends", "observedAttributes", "on", "define" used to define components
[ "Created", "a", "feature", "from", "one", "or", "more", "objects" ]
7dcccf1861d66f2c915c97900630b0b4a9d072e2
https://github.com/bBlocks/component/blob/7dcccf1861d66f2c915c97900630b0b4a9d072e2/component.js#L304-L314
40,366
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/types.js
Property
function Property(node, print) { print.list(node.decorators, { separator: "" }); if (node.method || node.kind === "get" || node.kind === "set") { this._method(node, print); } else { if (node.computed) { this.push("["); print.plain(node.key); this.push("]"); } else { // print `...
javascript
function Property(node, print) { print.list(node.decorators, { separator: "" }); if (node.method || node.kind === "get" || node.kind === "set") { this._method(node, print); } else { if (node.computed) { this.push("["); print.plain(node.key); this.push("]"); } else { // print `...
[ "function", "Property", "(", "node", ",", "print", ")", "{", "print", ".", "list", "(", "node", ".", "decorators", ",", "{", "separator", ":", "\"\"", "}", ")", ";", "if", "(", "node", ".", "method", "||", "node", ".", "kind", "===", "\"get\"", "||...
Prints Property, prints decorators, key, and value, handles kind, computed, and shorthand.
[ "Prints", "Property", "prints", "decorators", "key", "and", "value", "handles", "kind", "computed", "and", "shorthand", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/types.js#L78-L107
40,367
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/types.js
ArrayExpression
function ArrayExpression(node, print) { var elems = node.elements; var len = elems.length; this.push("["); print.printInnerComments(); for (var i = 0; i < elems.length; i++) { var elem = elems[i]; if (elem) { if (i > 0) this.space(); print.plain(elem); if (i < len - 1) this.push(",...
javascript
function ArrayExpression(node, print) { var elems = node.elements; var len = elems.length; this.push("["); print.printInnerComments(); for (var i = 0; i < elems.length; i++) { var elem = elems[i]; if (elem) { if (i > 0) this.space(); print.plain(elem); if (i < len - 1) this.push(",...
[ "function", "ArrayExpression", "(", "node", ",", "print", ")", "{", "var", "elems", "=", "node", ".", "elements", ";", "var", "len", "=", "elems", ".", "length", ";", "this", ".", "push", "(", "\"[\"", ")", ";", "print", ".", "printInnerComments", "(",...
Prints ArrayExpression, prints elements.
[ "Prints", "ArrayExpression", "prints", "elements", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/types.js#L113-L137
40,368
zipscene/human-readable-id-gen
Brocfile.js
getSourceTrees
function getSourceTrees(pathsToSearch) { return { read: function(readTree) { var promises = _.map(pathsToSearch, function(path) { return new Promise(function(resolve) { fs.exists(path, function(exists) { resolve((exists) ? path : null); }); }); }); return Promise.all(promises) ....
javascript
function getSourceTrees(pathsToSearch) { return { read: function(readTree) { var promises = _.map(pathsToSearch, function(path) { return new Promise(function(resolve) { fs.exists(path, function(exists) { resolve((exists) ? path : null); }); }); }); return Promise.all(promises) ....
[ "function", "getSourceTrees", "(", "pathsToSearch", ")", "{", "return", "{", "read", ":", "function", "(", "readTree", ")", "{", "var", "promises", "=", "_", ".", "map", "(", "pathsToSearch", ",", "function", "(", "path", ")", "{", "return", "new", "Prom...
Returns a broc tree corresponding to the original source files
[ "Returns", "a", "broc", "tree", "corresponding", "to", "the", "original", "source", "files" ]
5e7128c3baa86266b5110a4e93a650bc9a08aaa5
https://github.com/zipscene/human-readable-id-gen/blob/5e7128c3baa86266b5110a4e93a650bc9a08aaa5/Brocfile.js#L14-L44
40,369
MaximeMaillet/dtorrent
src/manager.js
checkTorrentIntegrity
async function checkTorrentIntegrity(torrentFile, dataFile) { const _ntRead = promisify(nt.read); return _ntRead(torrentFile) .then((torrent) => { return new Promise((resolve, reject) => { torrent.metadata.info.name = path.basename(dataFile); const hasher = torrent.hashCheck(path.dirname(dat...
javascript
async function checkTorrentIntegrity(torrentFile, dataFile) { const _ntRead = promisify(nt.read); return _ntRead(torrentFile) .then((torrent) => { return new Promise((resolve, reject) => { torrent.metadata.info.name = path.basename(dataFile); const hasher = torrent.hashCheck(path.dirname(dat...
[ "async", "function", "checkTorrentIntegrity", "(", "torrentFile", ",", "dataFile", ")", "{", "const", "_ntRead", "=", "promisify", "(", "nt", ".", "read", ")", ";", "return", "_ntRead", "(", "torrentFile", ")", ".", "then", "(", "(", "torrent", ")", "=>", ...
Check integrity between torrent and data @param torrentFile @param dataFile @return {Promise.<TResult>|*}
[ "Check", "integrity", "between", "torrent", "and", "data" ]
ed7fdd8e8959a4f30f9a2f1afa3ec17c64bc5535
https://github.com/MaximeMaillet/dtorrent/blob/ed7fdd8e8959a4f30f9a2f1afa3ec17c64bc5535/src/manager.js#L304-L335
40,370
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/util.js
canCompile
function canCompile(filename, altExts) { var exts = altExts || canCompile.EXTENSIONS; var ext = _path2["default"].extname(filename); return _lodashCollectionContains2["default"](exts, ext); }
javascript
function canCompile(filename, altExts) { var exts = altExts || canCompile.EXTENSIONS; var ext = _path2["default"].extname(filename); return _lodashCollectionContains2["default"](exts, ext); }
[ "function", "canCompile", "(", "filename", ",", "altExts", ")", "{", "var", "exts", "=", "altExts", "||", "canCompile", ".", "EXTENSIONS", ";", "var", "ext", "=", "_path2", "[", "\"default\"", "]", ".", "extname", "(", "filename", ")", ";", "return", "_l...
Test if a filename ends with a compilable extension.
[ "Test", "if", "a", "filename", "ends", "with", "a", "compilable", "extension", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/util.js#L103-L107
40,371
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/util.js
list
function list(val) { if (!val) { return []; } else if (Array.isArray(val)) { return val; } else if (typeof val === "string") { return val.split(","); } else { return [val]; } }
javascript
function list(val) { if (!val) { return []; } else if (Array.isArray(val)) { return val; } else if (typeof val === "string") { return val.split(","); } else { return [val]; } }
[ "function", "list", "(", "val", ")", "{", "if", "(", "!", "val", ")", "{", "return", "[", "]", ";", "}", "else", "if", "(", "Array", ".", "isArray", "(", "val", ")", ")", "{", "return", "val", ";", "}", "else", "if", "(", "typeof", "val", "==...
Create an array from any value, splitting strings by ",".
[ "Create", "an", "array", "from", "any", "value", "splitting", "strings", "by", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/util.js#L119-L129
40,372
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/util.js
regexify
function regexify(val) { if (!val) return new RegExp(/.^/); if (Array.isArray(val)) val = new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"), "i"); if (_lodashLangIsString2["default"](val)) { // normalise path separators val = _slash2["default"](val); // remove starting wildcards o...
javascript
function regexify(val) { if (!val) return new RegExp(/.^/); if (Array.isArray(val)) val = new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"), "i"); if (_lodashLangIsString2["default"](val)) { // normalise path separators val = _slash2["default"](val); // remove starting wildcards o...
[ "function", "regexify", "(", "val", ")", "{", "if", "(", "!", "val", ")", "return", "new", "RegExp", "(", "/", ".^", "/", ")", ";", "if", "(", "Array", ".", "isArray", "(", "val", ")", ")", "val", "=", "new", "RegExp", "(", "val", ".", "map", ...
Create a RegExp from a string, array, or regexp.
[ "Create", "a", "RegExp", "from", "a", "string", "array", "or", "regexp", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/util.js#L135-L155
40,373
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/util.js
shouldIgnore
function shouldIgnore(filename, ignore, only) { filename = _slash2["default"](filename); if (only) { var _arr = only; for (var _i = 0; _i < _arr.length; _i++) { var pattern = _arr[_i]; if (_shouldIgnore(pattern, filename)) return false; } return true; } else if (ignore.length) { ...
javascript
function shouldIgnore(filename, ignore, only) { filename = _slash2["default"](filename); if (only) { var _arr = only; for (var _i = 0; _i < _arr.length; _i++) { var pattern = _arr[_i]; if (_shouldIgnore(pattern, filename)) return false; } return true; } else if (ignore.length) { ...
[ "function", "shouldIgnore", "(", "filename", ",", "ignore", ",", "only", ")", "{", "filename", "=", "_slash2", "[", "\"default\"", "]", "(", "filename", ")", ";", "if", "(", "only", ")", "{", "var", "_arr", "=", "only", ";", "for", "(", "var", "_i", ...
Tests if a filename should be ignored based on "ignore" and "only" options.
[ "Tests", "if", "a", "filename", "should", "be", "ignored", "based", "on", "ignore", "and", "only", "options", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/util.js#L188-L209
40,374
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/util.js
parseTemplate
function parseTemplate(loc, code) { var ast = _helpersParse2["default"](code, { filename: loc, looseModules: true }).program; ast = _traversal2["default"].removeProperties(ast); return ast; }
javascript
function parseTemplate(loc, code) { var ast = _helpersParse2["default"](code, { filename: loc, looseModules: true }).program; ast = _traversal2["default"].removeProperties(ast); return ast; }
[ "function", "parseTemplate", "(", "loc", ",", "code", ")", "{", "var", "ast", "=", "_helpersParse2", "[", "\"default\"", "]", "(", "code", ",", "{", "filename", ":", "loc", ",", "looseModules", ":", "true", "}", ")", ".", "program", ";", "ast", "=", ...
Parse a template.
[ "Parse", "a", "template", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/util.js#L285-L289
40,375
kubosho/kotori
src/build.js
activatePostCSSPlugins
function activatePostCSSPlugins(config) { const plugins = []; if (config.lintRules || config.lintRules !== "") { // TODO: Throw easy-to-understand error message // incorrect path? (ex. "lintRules": "aaa") // typo? (ex. "lintRules": "stylelint-config-suitcs") const lintRules = require(config.lintRul...
javascript
function activatePostCSSPlugins(config) { const plugins = []; if (config.lintRules || config.lintRules !== "") { // TODO: Throw easy-to-understand error message // incorrect path? (ex. "lintRules": "aaa") // typo? (ex. "lintRules": "stylelint-config-suitcs") const lintRules = require(config.lintRul...
[ "function", "activatePostCSSPlugins", "(", "config", ")", "{", "const", "plugins", "=", "[", "]", ";", "if", "(", "config", ".", "lintRules", "||", "config", ".", "lintRules", "!==", "\"\"", ")", "{", "// TODO: Throw easy-to-understand error message", "// incorrec...
Activating PostCSS plugins @param {Object} config - Kotori config object @returns {Function[]} PostCSS plugins list @private
[ "Activating", "PostCSS", "plugins" ]
4a869d470408db17733caf9dabe67ecaa20cf4b7
https://github.com/kubosho/kotori/blob/4a869d470408db17733caf9dabe67ecaa20cf4b7/src/build.js#L103-L127
40,376
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/modules.js
ImportSpecifier
function ImportSpecifier(node, print) { print.plain(node.imported); if (node.local && node.local.name !== node.imported.name) { this.push(" as "); print.plain(node.local); } }
javascript
function ImportSpecifier(node, print) { print.plain(node.imported); if (node.local && node.local.name !== node.imported.name) { this.push(" as "); print.plain(node.local); } }
[ "function", "ImportSpecifier", "(", "node", ",", "print", ")", "{", "print", ".", "plain", "(", "node", ".", "imported", ")", ";", "if", "(", "node", ".", "local", "&&", "node", ".", "local", ".", "name", "!==", "node", ".", "imported", ".", "name", ...
Prints ImportSpecifier, prints imported and local.
[ "Prints", "ImportSpecifier", "prints", "imported", "and", "local", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/modules.js#L28-L34
40,377
manvalls/wapp
utils/buildScripts.js
es5Plugins
function es5Plugins(){ return [ require('babel-plugin-check-es2015-constants'), require('babel-plugin-transform-es2015-arrow-functions'), require('babel-plugin-transform-es2015-block-scoped-functions'), require('babel-plugin-transform-es2015-block-scoping'), require('babel-plugin-trans...
javascript
function es5Plugins(){ return [ require('babel-plugin-check-es2015-constants'), require('babel-plugin-transform-es2015-arrow-functions'), require('babel-plugin-transform-es2015-block-scoped-functions'), require('babel-plugin-transform-es2015-block-scoping'), require('babel-plugin-trans...
[ "function", "es5Plugins", "(", ")", "{", "return", "[", "require", "(", "'babel-plugin-check-es2015-constants'", ")", ",", "require", "(", "'babel-plugin-transform-es2015-arrow-functions'", ")", ",", "require", "(", "'babel-plugin-transform-es2015-block-scoped-functions'", ")...
Add default transformations
[ "Add", "default", "transformations" ]
fe3a2b9abcdb390805581f6db05f52ae322523b5
https://github.com/manvalls/wapp/blob/fe3a2b9abcdb390805581f6db05f52ae322523b5/utils/buildScripts.js#L95-L120
40,378
jmjuanes/get-args
index.js
function(obj, key, value) { if(typeof obj[key] === "undefined") { obj[key] = value; } else { //Check if the current option is not an array if(Array.isArray(obj[key]) === false) { obj[key] = [obj[key]]; } obj[key].push(value); } }
javascript
function(obj, key, value) { if(typeof obj[key] === "undefined") { obj[key] = value; } else { //Check if the current option is not an array if(Array.isArray(obj[key]) === false) { obj[key] = [obj[key]]; } obj[key].push(value); } }
[ "function", "(", "obj", ",", "key", ",", "value", ")", "{", "if", "(", "typeof", "obj", "[", "key", "]", "===", "\"undefined\"", ")", "{", "obj", "[", "key", "]", "=", "value", ";", "}", "else", "{", "//Check if the current option is not an array", "if",...
Save an option
[ "Save", "an", "option" ]
571850e9d71f02989beba3be778c23ecd495a93f
https://github.com/jmjuanes/get-args/blob/571850e9d71f02989beba3be778c23ecd495a93f/index.js#L2-L13
40,379
dreampiggy/functional.js
Retroactive/lib/data_structures/priority_queue.js
PriorityQueue
function PriorityQueue(initialItems) { var self = this; MinHeap.call(this, function (a, b) { return self.priority(a) < self.priority(b) ? -1 : 1; }); this._priority = {}; initialItems = initialItems || {}; Object.keys(initialItems).forEach(function (item) { self.insert(item, initialItems[item]); ...
javascript
function PriorityQueue(initialItems) { var self = this; MinHeap.call(this, function (a, b) { return self.priority(a) < self.priority(b) ? -1 : 1; }); this._priority = {}; initialItems = initialItems || {}; Object.keys(initialItems).forEach(function (item) { self.insert(item, initialItems[item]); ...
[ "function", "PriorityQueue", "(", "initialItems", ")", "{", "var", "self", "=", "this", ";", "MinHeap", ".", "call", "(", "this", ",", "function", "(", "a", ",", "b", ")", "{", "return", "self", ".", "priority", "(", "a", ")", "<", "self", ".", "pr...
Extends the MinHeap with the only difference that the heap operations are performed based on the priority of the element and not on the element itself
[ "Extends", "the", "MinHeap", "with", "the", "only", "difference", "that", "the", "heap", "operations", "are", "performed", "based", "on", "the", "priority", "of", "the", "element", "and", "not", "on", "the", "element", "itself" ]
ec7b7213de7965659a8a1e8fa61438e3ae564260
https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/priority_queue.js#L10-L23
40,380
KenanY/create-event
index.js
clean
function clean(type, options) { options = assign({}, defaults, options); if (type === 'dblclick') { options.detail = 2; } if (isString(options.key)) { options.key = keycode(options.key); } return options; }
javascript
function clean(type, options) { options = assign({}, defaults, options); if (type === 'dblclick') { options.detail = 2; } if (isString(options.key)) { options.key = keycode(options.key); } return options; }
[ "function", "clean", "(", "type", ",", "options", ")", "{", "options", "=", "assign", "(", "{", "}", ",", "defaults", ",", "options", ")", ";", "if", "(", "type", "===", "'dblclick'", ")", "{", "options", ".", "detail", "=", "2", ";", "}", "if", ...
Back an `options` object by defaults, and convert some convenience features. @param {String} type @param {Object} options @return {Object} [description]
[ "Back", "an", "options", "object", "by", "defaults", "and", "convert", "some", "convenience", "features", "." ]
82ceed57831f661261764612c9487d1d7386e1a0
https://github.com/KenanY/create-event/blob/82ceed57831f661261764612c9487d1d7386e1a0/index.js#L32-L41
40,381
KenanY/create-event
index.js
createMouseEvent
function createMouseEvent(type, options) { options = clean(type, options); var e = document.createEvent('MouseEvent'); e.initMouseEvent( type, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, ...
javascript
function createMouseEvent(type, options) { options = clean(type, options); var e = document.createEvent('MouseEvent'); e.initMouseEvent( type, options.bubbles, options.cancelable, options.view, options.detail, options.screenX, options.screenY, options.clientX, options.clientY, ...
[ "function", "createMouseEvent", "(", "type", ",", "options", ")", "{", "options", "=", "clean", "(", "type", ",", "options", ")", ";", "var", "e", "=", "document", ".", "createEvent", "(", "'MouseEvent'", ")", ";", "e", ".", "initMouseEvent", "(", "type"...
Create a non-IE mouse event. @param {String} type @param {Object} options
[ "Create", "a", "non", "-", "IE", "mouse", "event", "." ]
82ceed57831f661261764612c9487d1d7386e1a0
https://github.com/KenanY/create-event/blob/82ceed57831f661261764612c9487d1d7386e1a0/index.js#L49-L70
40,382
KenanY/create-event
index.js
createKeyboardEvent
function createKeyboardEvent(type, options) { options = clean(type, options); var e = document.createEvent('KeyboardEvent'); (e.initKeyEvent || e.initKeyboardEvent).call( e, type, options.bubbles, options.cancelable, options.view, options.ctrl, options.alt, options.shift, optio...
javascript
function createKeyboardEvent(type, options) { options = clean(type, options); var e = document.createEvent('KeyboardEvent'); (e.initKeyEvent || e.initKeyboardEvent).call( e, type, options.bubbles, options.cancelable, options.view, options.ctrl, options.alt, options.shift, optio...
[ "function", "createKeyboardEvent", "(", "type", ",", "options", ")", "{", "options", "=", "clean", "(", "type", ",", "options", ")", ";", "var", "e", "=", "document", ".", "createEvent", "(", "'KeyboardEvent'", ")", ";", "(", "e", ".", "initKeyEvent", "|...
Create a non-IE keyboard event. @param {String} type @param {Object} options
[ "Create", "a", "non", "-", "IE", "keyboard", "event", "." ]
82ceed57831f661261764612c9487d1d7386e1a0
https://github.com/KenanY/create-event/blob/82ceed57831f661261764612c9487d1d7386e1a0/index.js#L78-L112
40,383
KenanY/create-event
index.js
createEvent
function createEvent(type, options) { switch (type) { case 'dblclick': case 'click': return createMouseEvent(type, options); case 'keydown': case 'keyup': return createKeyboardEvent(type, options); } }
javascript
function createEvent(type, options) { switch (type) { case 'dblclick': case 'click': return createMouseEvent(type, options); case 'keydown': case 'keyup': return createKeyboardEvent(type, options); } }
[ "function", "createEvent", "(", "type", ",", "options", ")", "{", "switch", "(", "type", ")", "{", "case", "'dblclick'", ":", "case", "'click'", ":", "return", "createMouseEvent", "(", "type", ",", "options", ")", ";", "case", "'keydown'", ":", "case", "...
Create a non-IE event object. @param {String} type @param {Object} options
[ "Create", "a", "non", "-", "IE", "event", "object", "." ]
82ceed57831f661261764612c9487d1d7386e1a0
https://github.com/KenanY/create-event/blob/82ceed57831f661261764612c9487d1d7386e1a0/index.js#L120-L129
40,384
KenanY/create-event
index.js
createIeEvent
function createIeEvent(type, options) { options = clean(type, options); var e = document.createEventObject(); e.altKey = options.alt; e.bubbles = options.bubbles; e.button = options.button; e.cancelable = options.cancelable; e.clientX = options.clientX; e.clientY = options.clientY; e.ctrlKey = options...
javascript
function createIeEvent(type, options) { options = clean(type, options); var e = document.createEventObject(); e.altKey = options.alt; e.bubbles = options.bubbles; e.button = options.button; e.cancelable = options.cancelable; e.clientX = options.clientX; e.clientY = options.clientY; e.ctrlKey = options...
[ "function", "createIeEvent", "(", "type", ",", "options", ")", "{", "options", "=", "clean", "(", "type", ",", "options", ")", ";", "var", "e", "=", "document", ".", "createEventObject", "(", ")", ";", "e", ".", "altKey", "=", "options", ".", "alt", ...
Create an IE event. @param {String} type @param {Object} options
[ "Create", "an", "IE", "event", "." ]
82ceed57831f661261764612c9487d1d7386e1a0
https://github.com/KenanY/create-event/blob/82ceed57831f661261764612c9487d1d7386e1a0/index.js#L137-L156
40,385
kltm/pup-tent
npm/pup-tent/pup-tent.js
_check_and_save
function _check_and_save(path){ //console.log('l@: ' + path); if( afs.exists_p(path) ){ if( afs.file_p(path) ){ //console.log('found file: ' + path); // Break into parts for saving if it is a full file. var filename = path; var slash_loc = path.lastIndexOf('/') + 1; if( slash_loc != 0 ){ filen...
javascript
function _check_and_save(path){ //console.log('l@: ' + path); if( afs.exists_p(path) ){ if( afs.file_p(path) ){ //console.log('found file: ' + path); // Break into parts for saving if it is a full file. var filename = path; var slash_loc = path.lastIndexOf('/') + 1; if( slash_loc != 0 ){ filen...
[ "function", "_check_and_save", "(", "path", ")", "{", "//console.log('l@: ' + path);", "if", "(", "afs", ".", "exists_p", "(", "path", ")", ")", "{", "if", "(", "afs", ".", "file_p", "(", "path", ")", ")", "{", "//console.log('found file: ' + path);", "// Brea...
Make sure the file is there, then save it to the appropriate caches.
[ "Make", "sure", "the", "file", "is", "there", "then", "save", "it", "to", "the", "appropriate", "caches", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L225-L251
40,386
kltm/pup-tent
npm/pup-tent/pup-tent.js
_add_permanently_to
function _add_permanently_to(stack, item_or_list){ if( item_or_list && tcache[stack] ){ if( ! us.isArray(item_or_list) ){ // atom tcache[stack].push(item_or_list); }else{ // list tcache[stack] = tcache[stack].concat(item_or_list); } } return tcache[stack]; }
javascript
function _add_permanently_to(stack, item_or_list){ if( item_or_list && tcache[stack] ){ if( ! us.isArray(item_or_list) ){ // atom tcache[stack].push(item_or_list); }else{ // list tcache[stack] = tcache[stack].concat(item_or_list); } } return tcache[stack]; }
[ "function", "_add_permanently_to", "(", "stack", ",", "item_or_list", ")", "{", "if", "(", "item_or_list", "&&", "tcache", "[", "stack", "]", ")", "{", "if", "(", "!", "us", ".", "isArray", "(", "item_or_list", ")", ")", "{", "// atom", "tcache", "[", ...
Permanently push an item or a list onto the internal list structure. Changes structure.
[ "Permanently", "push", "an", "item", "or", "a", "list", "onto", "the", "internal", "list", "structure", ".", "Changes", "structure", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L307-L316
40,387
kltm/pup-tent
npm/pup-tent/pup-tent.js
_set_common
function _set_common(stack_name, thing){ var ret = null; if( stack_name == 'css_libs' || stack_name == 'js_libs' || stack_name == 'js_vars' ){ _add_permanently_to(stack_name, thing); ret = thing; } //console.log('added ' + thing.length + ' to ' + stack_name); return ret; }
javascript
function _set_common(stack_name, thing){ var ret = null; if( stack_name == 'css_libs' || stack_name == 'js_libs' || stack_name == 'js_vars' ){ _add_permanently_to(stack_name, thing); ret = thing; } //console.log('added ' + thing.length + ' to ' + stack_name); return ret; }
[ "function", "_set_common", "(", "stack_name", ",", "thing", ")", "{", "var", "ret", "=", "null", ";", "if", "(", "stack_name", "==", "'css_libs'", "||", "stack_name", "==", "'js_libs'", "||", "stack_name", "==", "'js_vars'", ")", "{", "_add_permanently_to", ...
Permanently push an item or a list onto an internal list. Meant for all common variables across pup tent renderings.
[ "Permanently", "push", "an", "item", "or", "a", "list", "onto", "an", "internal", "list", ".", "Meant", "for", "all", "common", "variables", "across", "pup", "tent", "renderings", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L320-L331
40,388
kltm/pup-tent
npm/pup-tent/pup-tent.js
_use_zcache_p
function _use_zcache_p(yes_no){ if( yes_no == true ){ use_zcache_p = true; }else if( yes_no == false ){ use_zcache_p = false; } return use_zcache_p; }
javascript
function _use_zcache_p(yes_no){ if( yes_no == true ){ use_zcache_p = true; }else if( yes_no == false ){ use_zcache_p = false; } return use_zcache_p; }
[ "function", "_use_zcache_p", "(", "yes_no", ")", "{", "if", "(", "yes_no", "==", "true", ")", "{", "use_zcache_p", "=", "true", ";", "}", "else", "if", "(", "yes_no", "==", "false", ")", "{", "use_zcache_p", "=", "false", ";", "}", "return", "use_zcach...
Play with whether to use the cache or not.
[ "Play", "with", "whether", "to", "use", "the", "cache", "or", "not", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L334-L341
40,389
kltm/pup-tent
npm/pup-tent/pup-tent.js
_get
function _get(key){ var ret = null; // Pull from cache or re-read from fs. //console.log('key: ' + key) //console.log('use_zcache_p: ' + use_zcache_p) if( use_zcache_p ){ ret = zcache[key]; }else{ ret = afs.read_file(path_cache[key]); } return ret; }
javascript
function _get(key){ var ret = null; // Pull from cache or re-read from fs. //console.log('key: ' + key) //console.log('use_zcache_p: ' + use_zcache_p) if( use_zcache_p ){ ret = zcache[key]; }else{ ret = afs.read_file(path_cache[key]); } return ret; }
[ "function", "_get", "(", "key", ")", "{", "var", "ret", "=", "null", ";", "// Pull from cache or re-read from fs.", "//console.log('key: ' + key)", "//console.log('use_zcache_p: ' + use_zcache_p)", "if", "(", "use_zcache_p", ")", "{", "ret", "=", "zcache", "[", "key", ...
Get a file, as string, from the cache by key; null otherwise.
[ "Get", "a", "file", "as", "string", "from", "the", "cache", "by", "key", ";", "null", "otherwise", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L344-L357
40,390
kltm/pup-tent
npm/pup-tent/pup-tent.js
_apply
function _apply (tmpl_name, tmpl_args){ var ret = null; var tmpl = _get(tmpl_name); if( tmpl ){ ret = mustache.render(tmpl, tmpl_args); } // if( tmpl ){ console.log('rendered string length: ' + ret.length); } return ret; }
javascript
function _apply (tmpl_name, tmpl_args){ var ret = null; var tmpl = _get(tmpl_name); if( tmpl ){ ret = mustache.render(tmpl, tmpl_args); } // if( tmpl ){ console.log('rendered string length: ' + ret.length); } return ret; }
[ "function", "_apply", "(", "tmpl_name", ",", "tmpl_args", ")", "{", "var", "ret", "=", "null", ";", "var", "tmpl", "=", "_get", "(", "tmpl_name", ")", ";", "if", "(", "tmpl", ")", "{", "ret", "=", "mustache", ".", "render", "(", "tmpl", ",", "tmpl_...
Get a string from a named mustache template, with optional args.
[ "Get", "a", "string", "from", "a", "named", "mustache", "template", "with", "optional", "args", "." ]
05e6b7761f2255fa6c8756c50c408514ec670b83
https://github.com/kltm/pup-tent/blob/05e6b7761f2255fa6c8756c50c408514ec670b83/npm/pup-tent/pup-tent.js#L361-L372
40,391
skerit/protoblast
lib/diacritics.js
replaceSensitive
function replaceSensitive(chr, dbl) { var result, dbl_result; if (typeof baseDiacriticsMap[chr] === 'undefined') { return chr; } result = '[' + chr result += baseDiacriticsMap[chr]; result += ']'; if (dbl && baseDiacriticsMap[dbl]) { dbl_result = baseDiacriticsMap[dbl]; // Make the pre...
javascript
function replaceSensitive(chr, dbl) { var result, dbl_result; if (typeof baseDiacriticsMap[chr] === 'undefined') { return chr; } result = '[' + chr result += baseDiacriticsMap[chr]; result += ']'; if (dbl && baseDiacriticsMap[dbl]) { dbl_result = baseDiacriticsMap[dbl]; // Make the pre...
[ "function", "replaceSensitive", "(", "chr", ",", "dbl", ")", "{", "var", "result", ",", "dbl_result", ";", "if", "(", "typeof", "baseDiacriticsMap", "[", "chr", "]", "===", "'undefined'", ")", "{", "return", "chr", ";", "}", "result", "=", "'['", "+", ...
Replace the given character, but remain case sensitive @author Jelle De Loecker <jelle@develry.be> @since 0.0.1 @version 0.6.4
[ "Replace", "the", "given", "character", "but", "remain", "case", "sensitive" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/diacritics.js#L169-L191
40,392
skerit/protoblast
lib/diacritics.js
replaceInsensitive
function replaceInsensitive(chr, dbl) { var lower = chr.toLowerCase(), upper = chr.toUpperCase(), result, dbl_result; if (lower == upper) { return chr; } result = '[' + lower + upper; result += (baseDiacriticsMap[lower]||''); result += (baseDiacriticsMap[upper]||''); result += ']...
javascript
function replaceInsensitive(chr, dbl) { var lower = chr.toLowerCase(), upper = chr.toUpperCase(), result, dbl_result; if (lower == upper) { return chr; } result = '[' + lower + upper; result += (baseDiacriticsMap[lower]||''); result += (baseDiacriticsMap[upper]||''); result += ']...
[ "function", "replaceInsensitive", "(", "chr", ",", "dbl", ")", "{", "var", "lower", "=", "chr", ".", "toLowerCase", "(", ")", ",", "upper", "=", "chr", ".", "toUpperCase", "(", ")", ",", "result", ",", "dbl_result", ";", "if", "(", "lower", "==", "up...
Replace the given character without caring about the case @author Jelle De Loecker <jelle@develry.be> @since 0.0.1 @version 0.6.4
[ "Replace", "the", "given", "character", "without", "caring", "about", "the", "case" ]
22f35b05611bd507d380782023179a3f6ec383ae
https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/diacritics.js#L200-L233
40,393
ericwooley/thewooleyway
packages/config/config.js
resolveConfig
function resolveConfig (fileName, options) { options = options || {} var schema = options.schema var resolvePackageJson = options.resolvePackageJson || false var fileNames = [fileName, resolvePackageJson ? 'package.json' : null].filter( item => !!item ) const results = upResolve(fileNames) return Prom...
javascript
function resolveConfig (fileName, options) { options = options || {} var schema = options.schema var resolvePackageJson = options.resolvePackageJson || false var fileNames = [fileName, resolvePackageJson ? 'package.json' : null].filter( item => !!item ) const results = upResolve(fileNames) return Prom...
[ "function", "resolveConfig", "(", "fileName", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", "var", "schema", "=", "options", ".", "schema", "var", "resolvePackageJson", "=", "options", ".", "resolvePackageJson", "||", "false", "var", "...
Resolves config files, parses and combines them with priority to the nearest file @param {String} fileName @param {Object} options @param {Object} options.schema - validation options, see https://www.npmjs.com/package/jsonschema @param {boolean} options.resolvePackageJson - also include config from package.json @param ...
[ "Resolves", "config", "files", "parses", "and", "combines", "them", "with", "priority", "to", "the", "nearest", "file" ]
2b4c13957fa2dd7f07d38b728b25ae0e26f7f68f
https://github.com/ericwooley/thewooleyway/blob/2b4c13957fa2dd7f07d38b728b25ae0e26f7f68f/packages/config/config.js#L14-L26
40,394
MaximeMaillet/dtorrent
src/workers/list.js
list
async function list(torrentHandler, config) { try { const list = await clientTorrent.list(config.pid); for(const i in list) { torrentHandler.handle(list[i], config.pid); } torrentHandler.checkState(list, config.pid); } catch (error) { lError(`Exception ${error}`); } }
javascript
async function list(torrentHandler, config) { try { const list = await clientTorrent.list(config.pid); for(const i in list) { torrentHandler.handle(list[i], config.pid); } torrentHandler.checkState(list, config.pid); } catch (error) { lError(`Exception ${error}`); } }
[ "async", "function", "list", "(", "torrentHandler", ",", "config", ")", "{", "try", "{", "const", "list", "=", "await", "clientTorrent", ".", "list", "(", "config", ".", "pid", ")", ";", "for", "(", "const", "i", "in", "list", ")", "{", "torrentHandler...
List all torrents @return {Promise.<void>}
[ "List", "all", "torrents" ]
ed7fdd8e8959a4f30f9a2f1afa3ec17c64bc5535
https://github.com/MaximeMaillet/dtorrent/blob/ed7fdd8e8959a4f30f9a2f1afa3ec17c64bc5535/src/workers/list.js#L27-L37
40,395
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/api/register/cache.js
load
function load() { if (process.env.BABEL_DISABLE_CACHE) return; process.on("exit", save); process.nextTick(save); if (!_pathExists2["default"].sync(FILENAME)) return; try { data = JSON.parse(_fs2["default"].readFileSync(FILENAME)); } catch (err) { return; } }
javascript
function load() { if (process.env.BABEL_DISABLE_CACHE) return; process.on("exit", save); process.nextTick(save); if (!_pathExists2["default"].sync(FILENAME)) return; try { data = JSON.parse(_fs2["default"].readFileSync(FILENAME)); } catch (err) { return; } }
[ "function", "load", "(", ")", "{", "if", "(", "process", ".", "env", ".", "BABEL_DISABLE_CACHE", ")", "return", ";", "process", ".", "on", "(", "\"exit\"", ",", "save", ")", ";", "process", ".", "nextTick", "(", "save", ")", ";", "if", "(", "!", "_...
Load cache from disk and parse.
[ "Load", "cache", "from", "disk", "and", "parse", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/api/register/cache.js#L44-L57
40,396
soup-js/omnistream
src/reactiveComponent.js
makeReactive
function makeReactive(componentDefinition, renderFn, ...stateStreamNames) { class ReactiveComponent extends PureComponent { constructor(props, context) { super(props, context); this.state = { childProps: {} } this.omnistream = this.context.omnistream; // Make the dispatch function accessi...
javascript
function makeReactive(componentDefinition, renderFn, ...stateStreamNames) { class ReactiveComponent extends PureComponent { constructor(props, context) { super(props, context); this.state = { childProps: {} } this.omnistream = this.context.omnistream; // Make the dispatch function accessi...
[ "function", "makeReactive", "(", "componentDefinition", ",", "renderFn", ",", "...", "stateStreamNames", ")", "{", "class", "ReactiveComponent", "extends", "PureComponent", "{", "constructor", "(", "props", ",", "context", ")", "{", "super", "(", "props", ",", "...
ReactiveComponent subscribes to a stream and re-renders when it receives new data.
[ "ReactiveComponent", "subscribes", "to", "a", "stream", "and", "re", "-", "renders", "when", "it", "receives", "new", "data", "." ]
8bec75ce4c6968e18e0736f6e4ce988312c130fc
https://github.com/soup-js/omnistream/blob/8bec75ce4c6968e18e0736f6e4ce988312c130fc/src/reactiveComponent.js#L15-L48
40,397
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js
getStatementParent
function getStatementParent() { var path = this; do { if (Array.isArray(path.container)) { return path; } } while (path = path.parentPath); }
javascript
function getStatementParent() { var path = this; do { if (Array.isArray(path.container)) { return path; } } while (path = path.parentPath); }
[ "function", "getStatementParent", "(", ")", "{", "var", "path", "=", "this", ";", "do", "{", "if", "(", "Array", ".", "isArray", "(", "path", ".", "container", ")", ")", "{", "return", "path", ";", "}", "}", "while", "(", "path", "=", "path", ".", ...
Walk up the tree until we hit a parent node path in a list.
[ "Walk", "up", "the", "tree", "until", "we", "hit", "a", "parent", "node", "path", "in", "a", "list", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js#L57-L64
40,398
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js
getDeepestCommonAncestorFrom
function getDeepestCommonAncestorFrom(paths, filter) { // istanbul ignore next var _this = this; if (!paths.length) { return this; } if (paths.length === 1) { return paths[0]; } // minimum depth of the tree so we know the highest node var minDepth = Infinity; // last common ancestor var...
javascript
function getDeepestCommonAncestorFrom(paths, filter) { // istanbul ignore next var _this = this; if (!paths.length) { return this; } if (paths.length === 1) { return paths[0]; } // minimum depth of the tree so we know the highest node var minDepth = Infinity; // last common ancestor var...
[ "function", "getDeepestCommonAncestorFrom", "(", "paths", ",", "filter", ")", "{", "// istanbul ignore next", "var", "_this", "=", "this", ";", "if", "(", "!", "paths", ".", "length", ")", "{", "return", "this", ";", "}", "if", "(", "paths", ".", "length",...
Get the earliest path in the tree where the provided `paths` intersect. TODO: Possible optimisation target.
[ "Get", "the", "earliest", "path", "in", "the", "tree", "where", "the", "provided", "paths", "intersect", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js#L118-L183
40,399
noderaider/repackage
jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js
getAncestry
function getAncestry() { var path = this; var paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; }
javascript
function getAncestry() { var path = this; var paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; }
[ "function", "getAncestry", "(", ")", "{", "var", "path", "=", "this", ";", "var", "paths", "=", "[", "]", ";", "do", "{", "paths", ".", "push", "(", "path", ")", ";", "}", "while", "(", "path", "=", "path", ".", "parentPath", ")", ";", "return", ...
Build an array of node paths containing the entire ancestry of the current node path. NOTE: The current node path is included in this.
[ "Build", "an", "array", "of", "node", "paths", "containing", "the", "entire", "ancestry", "of", "the", "current", "node", "path", "." ]
9f14246db3327abb0c4a5d7a3d55bd7816ebbd40
https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/traversal/path/ancestry.js#L191-L198