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
51,600
quantumpayments/media
bin/view.js
copyMedia
function copyMedia (path, to, cert, callback) { var hookPath = __dirname + '/../data/buffer/hook.sh' debug('copyMedia', path, to, cert) if (/^http/.test(to)) { debug('using http') var parsed = url.parse(to) debug('parsed', parsed) var domain = url.parse(to).domain var file = url.parse(to).pa...
javascript
function copyMedia (path, to, cert, callback) { var hookPath = __dirname + '/../data/buffer/hook.sh' debug('copyMedia', path, to, cert) if (/^http/.test(to)) { debug('using http') var parsed = url.parse(to) debug('parsed', parsed) var domain = url.parse(to).domain var file = url.parse(to).pa...
[ "function", "copyMedia", "(", "path", ",", "to", ",", "cert", ",", "callback", ")", "{", "var", "hookPath", "=", "__dirname", "+", "'/../data/buffer/hook.sh'", "debug", "(", "'copyMedia'", ",", "path", ",", "to", ",", "cert", ")", "if", "(", "/", "^http"...
copy media from one place to another @param {string} path from where to copy @param {string} to where to copy to @param {string} cert path to certificate @param {Function} callback callback
[ "copy", "media", "from", "one", "place", "to", "another" ]
b53034e6dd2a94dca950e60a49e403aceaa1cdf1
https://github.com/quantumpayments/media/blob/b53034e6dd2a94dca950e60a49e403aceaa1cdf1/bin/view.js#L208-L266
51,601
quantumpayments/media
bin/view.js
getMediaByAPI
function getMediaByAPI (uri, cert, mode, user, safe, bufferURI) { return new Promise(function (resolve, reject) { balance(user).then((ret) => { return ret }).then(function (ret) { if (ret >= algos.getRandomUnseenImage.cost) { qpm_media.getRandomUnseenImage().then(function (row) { ...
javascript
function getMediaByAPI (uri, cert, mode, user, safe, bufferURI) { return new Promise(function (resolve, reject) { balance(user).then((ret) => { return ret }).then(function (ret) { if (ret >= algos.getRandomUnseenImage.cost) { qpm_media.getRandomUnseenImage().then(function (row) { ...
[ "function", "getMediaByAPI", "(", "uri", ",", "cert", ",", "mode", ",", "user", ",", "safe", ",", "bufferURI", ")", "{", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "balance", "(", "user", ")", ".", "then", "...
Get Media item from API @param {string} uri The uri to get it from. @param {string} cert Location of an X.509 cert. @param {string} mode Mode api | http | buffer. @param {string} user The WebID of the user. @param {number} safe Whether safe search is on. @param {string} bufferURI The URI...
[ "Get", "Media", "item", "from", "API" ]
b53034e6dd2a94dca950e60a49e403aceaa1cdf1
https://github.com/quantumpayments/media/blob/b53034e6dd2a94dca950e60a49e403aceaa1cdf1/bin/view.js#L278-L304
51,602
quantumpayments/media
bin/view.js
getMediaByHTTP
function getMediaByHTTP (uri, cert, mode, user, safe, bufferURI) { return new Promise(function (resolve, reject) { var cookiePath = __dirname + '/../data/cookie.json' var cookies = readCookie(cookiePath) if (cookies) { options.headers['Set-Cookie'] = 'connect.sid=' + sid + '; Path=/; HttpOnly; Sec...
javascript
function getMediaByHTTP (uri, cert, mode, user, safe, bufferURI) { return new Promise(function (resolve, reject) { var cookiePath = __dirname + '/../data/cookie.json' var cookies = readCookie(cookiePath) if (cookies) { options.headers['Set-Cookie'] = 'connect.sid=' + sid + '; Path=/; HttpOnly; Sec...
[ "function", "getMediaByHTTP", "(", "uri", ",", "cert", ",", "mode", ",", "user", ",", "safe", ",", "bufferURI", ")", "{", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "var", "cookiePath", "=", "__dirname", "+", ...
Get Media item from HTTP @param {string} uri The uri to get it from. @param {string} cert Location of an X.509 cert. @param {string} mode Mode api | http | buffer. @param {string} user The WebID of the user. @param {number} safe Whether safe search is on. @param {string} bufferURI The UR...
[ "Get", "Media", "item", "from", "HTTP" ]
b53034e6dd2a94dca950e60a49e403aceaa1cdf1
https://github.com/quantumpayments/media/blob/b53034e6dd2a94dca950e60a49e403aceaa1cdf1/bin/view.js#L316-L346
51,603
quantumpayments/media
bin/view.js
getNextFile
function getNextFile (files, type) { for (var i = 0; i < files.length; i++) { var file = files[i] if (/.ttl$/.test(file)) { continue } return file } }
javascript
function getNextFile (files, type) { for (var i = 0; i < files.length; i++) { var file = files[i] if (/.ttl$/.test(file)) { continue } return file } }
[ "function", "getNextFile", "(", "files", ",", "type", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "files", ".", "length", ";", "i", "++", ")", "{", "var", "file", "=", "files", "[", "i", "]", "if", "(", "/", ".ttl$", "/", ".", ...
Gets the next file in a buffer @param {array} files Array of files @param {number} type Type of file to get @return {string} Path to file
[ "Gets", "the", "next", "file", "in", "a", "buffer" ]
b53034e6dd2a94dca950e60a49e403aceaa1cdf1
https://github.com/quantumpayments/media/blob/b53034e6dd2a94dca950e60a49e403aceaa1cdf1/bin/view.js#L470-L478
51,604
cemtopkaya/kuark-db
src/db_uyariServisi.js
f_todo_secildi
function f_todo_secildi(_uyari) { l.info("f_todo_secildi"); //bu uyarı için atanmış kullanıcı id lerini çek var kullanici_idleri = f_uye_id_array(_uyari); return _uyari.RENDER.Sonuc.Data.map(function (_elm) { var detay = f_detay_olustur(schema.SABIT.UYARI.TODO,...
javascript
function f_todo_secildi(_uyari) { l.info("f_todo_secildi"); //bu uyarı için atanmış kullanıcı id lerini çek var kullanici_idleri = f_uye_id_array(_uyari); return _uyari.RENDER.Sonuc.Data.map(function (_elm) { var detay = f_detay_olustur(schema.SABIT.UYARI.TODO,...
[ "function", "f_todo_secildi", "(", "_uyari", ")", "{", "l", ".", "info", "(", "\"f_todo_secildi\"", ")", ";", "//bu uyarı için atanmış kullanıcı id lerini çek\r", "var", "kullanici_idleri", "=", "f_uye_id_array", "(", "_uyari", ")", ";", "return", "_uyari", ".", "RE...
endregion region TO-DO
[ "endregion", "region", "TO", "-", "DO" ]
d584aaf51f65a013bec79220a05007bd70767ac2
https://github.com/cemtopkaya/kuark-db/blob/d584aaf51f65a013bec79220a05007bd70767ac2/src/db_uyariServisi.js#L409-L430
51,605
squirkle/dig-it
lib/dig.js
getProp
function getProp (obj, path, isArray) { var next; path = _.isString(path) ? path.split('.') : path; // We have more traversing to do if (path.length > 1) { next = path.shift(); if (_.isArray(obj[next])) { isArray = true; var arr = _.compact(_.flatten(obj[next].map(function (el, i) { ...
javascript
function getProp (obj, path, isArray) { var next; path = _.isString(path) ? path.split('.') : path; // We have more traversing to do if (path.length > 1) { next = path.shift(); if (_.isArray(obj[next])) { isArray = true; var arr = _.compact(_.flatten(obj[next].map(function (el, i) { ...
[ "function", "getProp", "(", "obj", ",", "path", ",", "isArray", ")", "{", "var", "next", ";", "path", "=", "_", ".", "isString", "(", "path", ")", "?", "path", ".", "split", "(", "'.'", ")", ":", "path", ";", "// We have more traversing to do", "if", ...
returns value of property at path, or array of properties if there is an array in the path
[ "returns", "value", "of", "property", "at", "path", "or", "array", "of", "properties", "if", "there", "is", "an", "array", "in", "the", "path" ]
471a44ba7d3bd7f12b3977522234c740a9b76ada
https://github.com/squirkle/dig-it/blob/471a44ba7d3bd7f12b3977522234c740a9b76ada/lib/dig.js#L8-L37
51,606
moov2/grunt-orchard-development
tasks/build-themes.js
function () { var dest = path.join(options.dest, themes[count]); // deletes theme is already exists. if (fs.exists(dest)) { fs.rmdir(dest); } mv(path.join(options.themes, themes[count], 'dist'), dest, {mkdirp: true}, function() { ...
javascript
function () { var dest = path.join(options.dest, themes[count]); // deletes theme is already exists. if (fs.exists(dest)) { fs.rmdir(dest); } mv(path.join(options.themes, themes[count], 'dist'), dest, {mkdirp: true}, function() { ...
[ "function", "(", ")", "{", "var", "dest", "=", "path", ".", "join", "(", "options", ".", "dest", ",", "themes", "[", "count", "]", ")", ";", "// deletes theme is already exists.", "if", "(", "fs", ".", "exists", "(", "dest", ")", ")", "{", "fs", ".",...
Deletes the existing theme and copies the distributable ready theme into position.
[ "Deletes", "the", "existing", "theme", "and", "copies", "the", "distributable", "ready", "theme", "into", "position", "." ]
658c5bae73f894469d099a7c2d735f9cda08d0cc
https://github.com/moov2/grunt-orchard-development/blob/658c5bae73f894469d099a7c2d735f9cda08d0cc/tasks/build-themes.js#L111-L122
51,607
vmarkdown/vremark-parse
packages/vremark-toc/mdast-util-toc/lib/search.js
search
function search(root, expression, maxDepth) { var length = root.children.length; var depth = null; var lookingForToc = expression !== null; var map = []; var headingIndex; var closingIndex; if (!lookingForToc) { headingIndex = -1; } slugs.reset(); /* * Visit all h...
javascript
function search(root, expression, maxDepth) { var length = root.children.length; var depth = null; var lookingForToc = expression !== null; var map = []; var headingIndex; var closingIndex; if (!lookingForToc) { headingIndex = -1; } slugs.reset(); /* * Visit all h...
[ "function", "search", "(", "root", ",", "expression", ",", "maxDepth", ")", "{", "var", "length", "=", "root", ".", "children", ".", "length", ";", "var", "depth", "=", "null", ";", "var", "lookingForToc", "=", "expression", "!==", "null", ";", "var", ...
Search a node for a location. @param {Node} root - Parent to search in. @param {RegExp} expression - Heading-content to search for. @param {number} maxDepth - Maximum-depth to include. @return {Object} - Results.
[ "Search", "a", "node", "for", "a", "location", "." ]
d7b353dcb5d021eeceb40f3c505ece893202db7a
https://github.com/vmarkdown/vremark-parse/blob/d7b353dcb5d021eeceb40f3c505ece893202db7a/packages/vremark-toc/mdast-util-toc/lib/search.js#L31-L98
51,608
tcrowe/opti-node-watch
src/index.js
colorErrors
function colorErrors(stdLine) { // lazy load chalk if (chalk === undefined) { chalk = require("chalk"); } return colorErrorPatterns.reduce((op, pattern) => { const matches = pattern.exec(op); if (matches !== null && matches.length > 0) { op = op.replace(pattern, chalk.red(matches[0])); }...
javascript
function colorErrors(stdLine) { // lazy load chalk if (chalk === undefined) { chalk = require("chalk"); } return colorErrorPatterns.reduce((op, pattern) => { const matches = pattern.exec(op); if (matches !== null && matches.length > 0) { op = op.replace(pattern, chalk.red(matches[0])); }...
[ "function", "colorErrors", "(", "stdLine", ")", "{", "// lazy load chalk", "if", "(", "chalk", "===", "undefined", ")", "{", "chalk", "=", "require", "(", "\"chalk\"", ")", ";", "}", "return", "colorErrorPatterns", ".", "reduce", "(", "(", "op", ",", "patt...
Take a string from stderr and color error types @private @method colorErrors @param {string} stdLine @returns {string}
[ "Take", "a", "string", "from", "stderr", "and", "color", "error", "types" ]
70fc10ebcf7bf307b3424127b01ad41480eb7501
https://github.com/tcrowe/opti-node-watch/blob/70fc10ebcf7bf307b3424127b01ad41480eb7501/src/index.js#L101-L116
51,609
tcrowe/opti-node-watch
src/index.js
writeError
function writeError(chunk) { // in production give the output as-is if (NODE_ENV === "production") { return this.queue(chunk); } clearTimeout(errorTimer); errorChunks.push(chunk.toString()); errorTimer = setTimeout(() => { this.queue(formatErrors(errorChunks.join(""))); }, 10); ...
javascript
function writeError(chunk) { // in production give the output as-is if (NODE_ENV === "production") { return this.queue(chunk); } clearTimeout(errorTimer); errorChunks.push(chunk.toString()); errorTimer = setTimeout(() => { this.queue(formatErrors(errorChunks.join(""))); }, 10); ...
[ "function", "writeError", "(", "chunk", ")", "{", "// in production give the output as-is", "if", "(", "NODE_ENV", "===", "\"production\"", ")", "{", "return", "this", ".", "queue", "(", "chunk", ")", ";", "}", "clearTimeout", "(", "errorTimer", ")", ";", "err...
Used with through module to help us format errors and proxy stderr output @private @method writeError @param {string|buffer} chunk
[ "Used", "with", "through", "module", "to", "help", "us", "format", "errors", "and", "proxy", "stderr", "output" ]
70fc10ebcf7bf307b3424127b01ad41480eb7501
https://github.com/tcrowe/opti-node-watch/blob/70fc10ebcf7bf307b3424127b01ad41480eb7501/src/index.js#L233-L244
51,610
tcrowe/opti-node-watch
src/index.js
respawn
function respawn() { if (isNil(proc) === false) { proc.stderr.removeAllListeners(); proc.stderr.end(); proc.stderr.unpipe(); proc.stdout.removeAllListeners(); proc.stdout.end(); proc.stdout.unpipe(); proc.removeAllListeners(); proc.kill(); } const { env } = p...
javascript
function respawn() { if (isNil(proc) === false) { proc.stderr.removeAllListeners(); proc.stderr.end(); proc.stderr.unpipe(); proc.stdout.removeAllListeners(); proc.stdout.end(); proc.stdout.unpipe(); proc.removeAllListeners(); proc.kill(); } const { env } = p...
[ "function", "respawn", "(", ")", "{", "if", "(", "isNil", "(", "proc", ")", "===", "false", ")", "{", "proc", ".", "stderr", ".", "removeAllListeners", "(", ")", ";", "proc", ".", "stderr", ".", "end", "(", ")", ";", "proc", ".", "stderr", ".", "...
Restart the child process @private @method respawn
[ "Restart", "the", "child", "process" ]
70fc10ebcf7bf307b3424127b01ad41480eb7501
https://github.com/tcrowe/opti-node-watch/blob/70fc10ebcf7bf307b3424127b01ad41480eb7501/src/index.js#L278-L328
51,611
jeandesravines/promisify
lib/helper/promisify.js
promisify
function promisify(data, prevent = false) { let promisified; if (typeof data === 'function') { promisified = (...args) => new Promise((resolve, reject) => { data.call(data, ...args.concat((error, ...args) => { error ? reject(error) : resolve.call(data, ...args); })); }); } else if (ty...
javascript
function promisify(data, prevent = false) { let promisified; if (typeof data === 'function') { promisified = (...args) => new Promise((resolve, reject) => { data.call(data, ...args.concat((error, ...args) => { error ? reject(error) : resolve.call(data, ...args); })); }); } else if (ty...
[ "function", "promisify", "(", "data", ",", "prevent", "=", "false", ")", "{", "let", "promisified", ";", "if", "(", "typeof", "data", "===", "'function'", ")", "{", "promisified", "=", "(", "...", "args", ")", "=>", "new", "Promise", "(", "(", "resolve...
Promisify a function @param {function|Object|string} data @param {boolean} [prevent] @return {function(...[*]): Promise} a function wich returns a Promise
[ "Promisify", "a", "function" ]
62d09982d25d879c7d0aad57b13ebaa0a7b11723
https://github.com/jeandesravines/promisify/blob/62d09982d25d879c7d0aad57b13ebaa0a7b11723/lib/helper/promisify.js#L13-L33
51,612
redisjs/jsr-conf
lib/decoder.js
Decoder
function Decoder(conf, options, file) { Transform.call(this); this._writableState.objectMode = true; this._readableState.objectMode = true; this.eol = options.eol; this.conf = conf; this.file = file; this.lineNumber = 0; }
javascript
function Decoder(conf, options, file) { Transform.call(this); this._writableState.objectMode = true; this._readableState.objectMode = true; this.eol = options.eol; this.conf = conf; this.file = file; this.lineNumber = 0; }
[ "function", "Decoder", "(", "conf", ",", "options", ",", "file", ")", "{", "Transform", ".", "call", "(", "this", ")", ";", "this", ".", "_writableState", ".", "objectMode", "=", "true", ";", "this", ".", "_readableState", ".", "objectMode", "=", "true",...
Configuration file decoder.
[ "Configuration", "file", "decoder", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/decoder.js#L10-L20
51,613
redisjs/jsr-conf
lib/decoder.js
_transform
function _transform(chunk, encoding, cb) { this.emit('lines', chunk); try { this.parse(chunk); }catch(e) { this.emit('error', e); } cb(); }
javascript
function _transform(chunk, encoding, cb) { this.emit('lines', chunk); try { this.parse(chunk); }catch(e) { this.emit('error', e); } cb(); }
[ "function", "_transform", "(", "chunk", ",", "encoding", ",", "cb", ")", "{", "this", ".", "emit", "(", "'lines'", ",", "chunk", ")", ";", "try", "{", "this", ".", "parse", "(", "chunk", ")", ";", "}", "catch", "(", "e", ")", "{", "this", ".", ...
Transform function.
[ "Transform", "function", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/decoder.js#L27-L38
51,614
redisjs/jsr-conf
lib/decoder.js
parse
function parse(lines) { var i, line, key, parts, values; for(i = 0;i < lines.length;i++) { line = lines[i]; this.lineNumber++; // ignore comments and whitespace lines if(COMMENT.test(line) || WHITESPACE.test(line)) { continue; // got something to parse }else{ // strip empty en...
javascript
function parse(lines) { var i, line, key, parts, values; for(i = 0;i < lines.length;i++) { line = lines[i]; this.lineNumber++; // ignore comments and whitespace lines if(COMMENT.test(line) || WHITESPACE.test(line)) { continue; // got something to parse }else{ // strip empty en...
[ "function", "parse", "(", "lines", ")", "{", "var", "i", ",", "line", ",", "key", ",", "parts", ",", "values", ";", "for", "(", "i", "=", "0", ";", "i", "<", "lines", ".", "length", ";", "i", "++", ")", "{", "line", "=", "lines", "[", "i", ...
Synchronous line parser.
[ "Synchronous", "line", "parser", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/decoder.js#L43-L73
51,615
tjmehta/mongooseware
lib/base-middleware.js
BaseMiddleware
function BaseMiddleware (Model, key) { // constructor var instance = function (req, res, next) { return instance.exec()(req, res, next); }; instance.Model = Model; instance.methodChain = []; instance.__proto__ = this.__proto__; instance.setKey = function (key) { key = key || Model.modelName.toLo...
javascript
function BaseMiddleware (Model, key) { // constructor var instance = function (req, res, next) { return instance.exec()(req, res, next); }; instance.Model = Model; instance.methodChain = []; instance.__proto__ = this.__proto__; instance.setKey = function (key) { key = key || Model.modelName.toLo...
[ "function", "BaseMiddleware", "(", "Model", ",", "key", ")", "{", "// constructor", "var", "instance", "=", "function", "(", "req", ",", "res", ",", "next", ")", "{", "return", "instance", ".", "exec", "(", ")", "(", "req", ",", "res", ",", "next", "...
uses Model and key from closure @param {Object} Model @param {String} key @return {Object}
[ "uses", "Model", "and", "key", "from", "closure" ]
c62ce0bac82880826b3528231e08f5e5b3efdb83
https://github.com/tjmehta/mongooseware/blob/c62ce0bac82880826b3528231e08f5e5b3efdb83/lib/base-middleware.js#L18-L35
51,616
xsolon/spexplorerjs
webapi/src/components/sp/api/sp.web.js
function (url, site, ctx, loadFunc) { return $.Deferred(function (dfd) { ctx = ctx || SP.ClientContext.get_current(); site = site || ctx.get_site(); var web = (url) ? (typeof url == "string") ? site.openWeb(url) : url : ctx.get_web(); var res = loadFunc && loadFunc(web) || ctx.load(web); ctx.executeQ...
javascript
function (url, site, ctx, loadFunc) { return $.Deferred(function (dfd) { ctx = ctx || SP.ClientContext.get_current(); site = site || ctx.get_site(); var web = (url) ? (typeof url == "string") ? site.openWeb(url) : url : ctx.get_web(); var res = loadFunc && loadFunc(web) || ctx.load(web); ctx.executeQ...
[ "function", "(", "url", ",", "site", ",", "ctx", ",", "loadFunc", ")", "{", "return", "$", ".", "Deferred", "(", "function", "(", "dfd", ")", "{", "ctx", "=", "ctx", "||", "SP", ".", "ClientContext", ".", "get_current", "(", ")", ";", "site", "=", ...
Load an existing site fails if site doesn't exist @param {string} url - site relative url of web @param {spsite} site- site reference, if null will load from current context @param {ClientContext} ctx - SharePoint client context, if null the current context will be used @param {function} loadFunc - function run before ...
[ "Load", "an", "existing", "site", "fails", "if", "site", "doesn", "t", "exist" ]
4e9b410864afb731f88e84414984fa18ac5705f1
https://github.com/xsolon/spexplorerjs/blob/4e9b410864afb731f88e84414984fa18ac5705f1/webapi/src/components/sp/api/sp.web.js#L40-L57
51,617
redisjs/jsr-server
lib/command/transaction/watch.js
execute
function execute(req, res) { req.conn.watch(req.args, req.db); res.send(null, Constants.OK); }
javascript
function execute(req, res) { req.conn.watch(req.args, req.db); res.send(null, Constants.OK); }
[ "function", "execute", "(", "req", ",", "res", ")", "{", "req", ".", "conn", ".", "watch", "(", "req", ".", "args", ",", "req", ".", "db", ")", ";", "res", ".", "send", "(", "null", ",", "Constants", ".", "OK", ")", ";", "}" ]
Respond to the WATCH command.
[ "Respond", "to", "the", "WATCH", "command", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/transaction/watch.js#L19-L22
51,618
vkiding/judpack-lib
src/cordova/platform.js
getPlatformDetailsFromDir
function getPlatformDetailsFromDir(dir, platformIfKnown){ var libDir = path.resolve(dir); var platform; var version; try { var pkg = require(path.join(libDir, 'package')); platform = platformFromName(pkg.name); version = pkg.version; } catch(e) { // Older platforms d...
javascript
function getPlatformDetailsFromDir(dir, platformIfKnown){ var libDir = path.resolve(dir); var platform; var version; try { var pkg = require(path.join(libDir, 'package')); platform = platformFromName(pkg.name); version = pkg.version; } catch(e) { // Older platforms d...
[ "function", "getPlatformDetailsFromDir", "(", "dir", ",", "platformIfKnown", ")", "{", "var", "libDir", "=", "path", ".", "resolve", "(", "dir", ")", ";", "var", "platform", ";", "var", "version", ";", "try", "{", "var", "pkg", "=", "require", "(", "path...
Returns a Promise Gets platform details from a directory
[ "Returns", "a", "Promise", "Gets", "platform", "details", "from", "a", "directory" ]
8657cecfec68221109279106adca8dbc81f430f4
https://github.com/vkiding/judpack-lib/blob/8657cecfec68221109279106adca8dbc81f430f4/src/cordova/platform.js#L333-L362
51,619
vkiding/judpack-lib
src/cordova/platform.js
hostSupports
function hostSupports(platform) { var p = platforms[platform] || {}, hostos = p.hostos || null; if (!hostos) return true; if (hostos.indexOf('*') >= 0) return true; if (hostos.indexOf(process.platform) >= 0) return true; return false; }
javascript
function hostSupports(platform) { var p = platforms[platform] || {}, hostos = p.hostos || null; if (!hostos) return true; if (hostos.indexOf('*') >= 0) return true; if (hostos.indexOf(process.platform) >= 0) return true; return false; }
[ "function", "hostSupports", "(", "platform", ")", "{", "var", "p", "=", "platforms", "[", "platform", "]", "||", "{", "}", ",", "hostos", "=", "p", ".", "hostos", "||", "null", ";", "if", "(", "!", "hostos", ")", "return", "true", ";", "if", "(", ...
Used to prevent attempts of installing platforms that are not supported on the host OS. E.g. ios on linux.
[ "Used", "to", "prevent", "attempts", "of", "installing", "platforms", "that", "are", "not", "supported", "on", "the", "host", "OS", ".", "E", ".", "g", ".", "ios", "on", "linux", "." ]
8657cecfec68221109279106adca8dbc81f430f4
https://github.com/vkiding/judpack-lib/blob/8657cecfec68221109279106adca8dbc81f430f4/src/cordova/platform.js#L660-L670
51,620
vivaxy/react-pianist
docs/js/common.js
mixSpecIntoComponent
function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (false) { var typeofSpec = typeof spec; var isMixinValid = typeofSpec === 'object' && spec !== null; process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either n...
javascript
function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (false) { var typeofSpec = typeof spec; var isMixinValid = typeofSpec === 'object' && spec !== null; process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either n...
[ "function", "mixSpecIntoComponent", "(", "Constructor", ",", "spec", ")", "{", "if", "(", "!", "spec", ")", "{", "if", "(", "false", ")", "{", "var", "typeofSpec", "=", "typeof", "spec", ";", "var", "isMixinValid", "=", "typeofSpec", "===", "'object'", "...
Mixin helper which handles policy validation and reserved specification keys when building React classes.
[ "Mixin", "helper", "which", "handles", "policy", "validation", "and", "reserved", "specification", "keys", "when", "building", "React", "classes", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L2214-L2294
51,621
vivaxy/react-pianist
docs/js/common.js
function (event) { var dispatchConfig = event.dispatchConfig; if (dispatchConfig.registrationName) { return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; } if (dispatchConfig.phasedRegistrationNames !== undefined) { // pulling phasedRegistrationN...
javascript
function (event) { var dispatchConfig = event.dispatchConfig; if (dispatchConfig.registrationName) { return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; } if (dispatchConfig.phasedRegistrationNames !== undefined) { // pulling phasedRegistrationN...
[ "function", "(", "event", ")", "{", "var", "dispatchConfig", "=", "event", ".", "dispatchConfig", ";", "if", "(", "dispatchConfig", ".", "registrationName", ")", "{", "return", "EventPluginRegistry", ".", "registrationNameModules", "[", "dispatchConfig", ".", "reg...
Looks up the plugin for the supplied event. @param {object} event A synthetic event. @return {?object} The plugin that created the supplied event. @internal
[ "Looks", "up", "the", "plugin", "for", "the", "supplied", "event", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L5020-L5041
51,622
vivaxy/react-pianist
docs/js/common.js
function () { eventPluginOrder = null; for (var pluginName in namesToPlugins) { if (namesToPlugins.hasOwnProperty(pluginName)) { delete namesToPlugins[pluginName]; } } EventPluginRegistry.plugins.length = 0; var eventNameDispatchConfigs = EventPluginRegistry.eventNameDi...
javascript
function () { eventPluginOrder = null; for (var pluginName in namesToPlugins) { if (namesToPlugins.hasOwnProperty(pluginName)) { delete namesToPlugins[pluginName]; } } EventPluginRegistry.plugins.length = 0; var eventNameDispatchConfigs = EventPluginRegistry.eventNameDi...
[ "function", "(", ")", "{", "eventPluginOrder", "=", "null", ";", "for", "(", "var", "pluginName", "in", "namesToPlugins", ")", "{", "if", "(", "namesToPlugins", ".", "hasOwnProperty", "(", "pluginName", ")", ")", "{", "delete", "namesToPlugins", "[", "plugin...
Exposed for unit testing. @private
[ "Exposed", "for", "unit", "testing", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L5047-L5078
51,623
vivaxy/react-pianist
docs/js/common.js
asap
function asap(callback, context) { !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; asapCallbackQueue.enqueue(callback, context); asapEnqueued = true; }
javascript
function asap(callback, context) { !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0; asapCallbackQueue.enqueue(callback, context); asapEnqueued = true; }
[ "function", "asap", "(", "callback", ",", "context", ")", "{", "!", "batchingStrategy", ".", "isBatchingUpdates", "?", "false", "?", "invariant", "(", "false", ",", "'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.'", ")", ...
Enqueue a callback to be run at the end of the current batching cycle. Throws if no updates are currently being performed.
[ "Enqueue", "a", "callback", "to", "be", "run", "at", "the", "end", "of", "the", "current", "batching", "cycle", ".", "Throws", "if", "no", "updates", "are", "currently", "being", "performed", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L6565-L6569
51,624
vivaxy/react-pianist
docs/js/common.js
unmountComponentFromNode
function unmountComponentFromNode(instance, container, safely) { if (false) { ReactInstrumentation.debugTool.onBeginFlush(); } ReactReconciler.unmountComponent(instance, safely); if (false) { ReactInstrumentation.debugTool.onEndFlush(); } if (container.nodeType === DOC_NODE_TYPE) { co...
javascript
function unmountComponentFromNode(instance, container, safely) { if (false) { ReactInstrumentation.debugTool.onBeginFlush(); } ReactReconciler.unmountComponent(instance, safely); if (false) { ReactInstrumentation.debugTool.onEndFlush(); } if (container.nodeType === DOC_NODE_TYPE) { co...
[ "function", "unmountComponentFromNode", "(", "instance", ",", "container", ",", "safely", ")", "{", "if", "(", "false", ")", "{", "ReactInstrumentation", ".", "debugTool", ".", "onBeginFlush", "(", ")", ";", "}", "ReactReconciler", ".", "unmountComponent", "(", ...
Unmounts a component and removes it from the DOM. @param {ReactComponent} instance React component instance. @param {DOMElement} container DOM element to unmount from. @final @internal @see {ReactMount.unmountComponentAtNode}
[ "Unmounts", "a", "component", "and", "removes", "it", "from", "the", "DOM", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L19247-L19264
51,625
vivaxy/react-pianist
docs/js/common.js
function (nextElement, container, shouldReuseMarkup, context) { // Various parts of our code (such as ReactCompositeComponent's // _renderValidatedComponent) assume that calls to render aren't nested; // verify that that's the case. false ? warning(ReactCurrentOwner.current == null, '_renderNewRoot...
javascript
function (nextElement, container, shouldReuseMarkup, context) { // Various parts of our code (such as ReactCompositeComponent's // _renderValidatedComponent) assume that calls to render aren't nested; // verify that that's the case. false ? warning(ReactCurrentOwner.current == null, '_renderNewRoot...
[ "function", "(", "nextElement", ",", "container", ",", "shouldReuseMarkup", ",", "context", ")", "{", "// Various parts of our code (such as ReactCompositeComponent's", "// _renderValidatedComponent) assume that calls to render aren't nested;", "// verify that that's the case.", "false",...
Render a new component into the DOM. Hooked by hooks! @param {ReactElement} nextElement element to render @param {DOMElement} container container to render into @param {boolean} shouldReuseMarkup if we should skip the markup insertion @return {ReactComponent} nextComponent
[ "Render", "a", "new", "component", "into", "the", "DOM", ".", "Hooked", "by", "hooks!" ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L19413-L19434
51,626
vivaxy/react-pianist
docs/js/common.js
dispatch
function dispatch(action) { if (!(0, _isPlainObject2['default'])(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + ...
javascript
function dispatch(action) { if (!(0, _isPlainObject2['default'])(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + ...
[ "function", "dispatch", "(", "action", ")", "{", "if", "(", "!", "(", "0", ",", "_isPlainObject2", "[", "'default'", "]", ")", "(", "action", ")", ")", "{", "throw", "new", "Error", "(", "'Actions must be plain objects. '", "+", "'Use custom middleware for asy...
Dispatches an action. It is the only way to trigger a state change. The `reducer` function, used to create the store, will be called with the current state tree and the given `action`. Its return value will be considered the **next** state of the tree, and the change listeners will be notified. The base implementatio...
[ "Dispatches", "an", "action", ".", "It", "is", "the", "only", "way", "to", "trigger", "a", "state", "change", "." ]
5923bf5e67dfd011e6b034024b0b11ff8ef19300
https://github.com/vivaxy/react-pianist/blob/5923bf5e67dfd011e6b034024b0b11ff8ef19300/docs/js/common.js#L20746-L20772
51,627
redisjs/jsr-conf
lib/configuration.js
Configuration
function Configuration(options, parent) { options = options || {}; this.options = options; // delimiter used to split and join lines this.options.eol = options.eol || EOL; // parent reference - used by includes this._parent = parent; // file path to primary configuration file loaded this._file = null...
javascript
function Configuration(options, parent) { options = options || {}; this.options = options; // delimiter used to split and join lines this.options.eol = options.eol || EOL; // parent reference - used by includes this._parent = parent; // file path to primary configuration file loaded this._file = null...
[ "function", "Configuration", "(", "options", ",", "parent", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "options", "=", "options", ";", "// delimiter used to split and join lines", "this", ".", "options", ".", "eol", "=", "options", ...
Encapsulates a configuration file. Fields are exposed on this instance as public properties for easy read access, however writing should be performed using the set() method to ensure the document knows which config parameters have been changed. @param options Configuration options. @param parent A parent configuratio...
[ "Encapsulates", "a", "configuration", "file", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L32-L69
51,628
redisjs/jsr-conf
lib/configuration.js
get
function get(key, stringify) { var val = this._data[key] ? this._data[key].value : (DEFAULTS[key] !== undefined ? DEFAULTS[key] : undefined); if(val === undefined) return null; if(stringify) { val = this.encode(key, val, true); } return val; }
javascript
function get(key, stringify) { var val = this._data[key] ? this._data[key].value : (DEFAULTS[key] !== undefined ? DEFAULTS[key] : undefined); if(val === undefined) return null; if(stringify) { val = this.encode(key, val, true); } return val; }
[ "function", "get", "(", "key", ",", "stringify", ")", "{", "var", "val", "=", "this", ".", "_data", "[", "key", "]", "?", "this", ".", "_data", "[", "key", "]", ".", "value", ":", "(", "DEFAULTS", "[", "key", "]", "!==", "undefined", "?", "DEFAUL...
Get a configuration property. @param key The configuration key. @param stringify Whether to coerce the value to a string.
[ "Get", "a", "configuration", "property", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L115-L124
51,629
redisjs/jsr-conf
lib/configuration.js
validate
function validate(key, values) { var typedef, value; if(!~Keys.indexOf(key)) { throw new Error('unknown configuration key: ' + key); } // retrieve the type definition typedef = Types[key]; // validate on the typedef try { value = typedef.validate(key, values); }catch(e) { // got a more sp...
javascript
function validate(key, values) { var typedef, value; if(!~Keys.indexOf(key)) { throw new Error('unknown configuration key: ' + key); } // retrieve the type definition typedef = Types[key]; // validate on the typedef try { value = typedef.validate(key, values); }catch(e) { // got a more sp...
[ "function", "validate", "(", "key", ",", "values", ")", "{", "var", "typedef", ",", "value", ";", "if", "(", "!", "~", "Keys", ".", "indexOf", "(", "key", ")", ")", "{", "throw", "new", "Error", "(", "'unknown configuration key: '", "+", "key", ")", ...
Validate a key and array of values. @param key The configuration key. @param values The array of string values.
[ "Validate", "a", "key", "and", "array", "of", "values", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L132-L155
51,630
redisjs/jsr-conf
lib/configuration.js
onLoad
function onLoad() { var k, o, v; for(k in this._data) { o = this._data[k]; v = o.value; try { this.verify(k, v); if(k === Types.SLAVEOF) { if(this.get(Types.CLUSTER_ENABLED) && v) { throw new Error('slaveof directive not allowed in cluster mode'); } } }ca...
javascript
function onLoad() { var k, o, v; for(k in this._data) { o = this._data[k]; v = o.value; try { this.verify(k, v); if(k === Types.SLAVEOF) { if(this.get(Types.CLUSTER_ENABLED) && v) { throw new Error('slaveof directive not allowed in cluster mode'); } } }ca...
[ "function", "onLoad", "(", ")", "{", "var", "k", ",", "o", ",", "v", ";", "for", "(", "k", "in", "this", ".", "_data", ")", "{", "o", "=", "this", ".", "_data", "[", "k", "]", ";", "v", "=", "o", ".", "value", ";", "try", "{", "this", "."...
Post load validation.
[ "Post", "load", "validation", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L180-L200
51,631
redisjs/jsr-conf
lib/configuration.js
set
function set(key, value, lineno, child) { // keys can be passed as buffers // we need a string key = '' + key; //console.error('%s=%s', key, value); var typedef = Types[key] , exists = this._data[key] , val = exists || {value: null, lineno: !child ? lineno : undefined} , changed = false; if(!l...
javascript
function set(key, value, lineno, child) { // keys can be passed as buffers // we need a string key = '' + key; //console.error('%s=%s', key, value); var typedef = Types[key] , exists = this._data[key] , val = exists || {value: null, lineno: !child ? lineno : undefined} , changed = false; if(!l...
[ "function", "set", "(", "key", ",", "value", ",", "lineno", ",", "child", ")", "{", "// keys can be passed as buffers", "// we need a string", "key", "=", "''", "+", "key", ";", "//console.error('%s=%s', key, value);", "var", "typedef", "=", "Types", "[", "key", ...
Update the in-memory configuration. Designed to be used by CONFIG SET the key should already have been validated. Internally when adding keys first time around a lineno specifies where in the file the declaration is, otherwise when modifying via CONFIG SET a lineno should not be specified and the key is tracked as ha...
[ "Update", "the", "in", "-", "memory", "configuration", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L221-L287
51,632
redisjs/jsr-conf
lib/configuration.js
directives
function directives(def) { // mock line number for error messages var lineno = 1 , k , v // inline directive, not from a file , file = 'directive override (argv)'; function addDirective(k, v) { // must be strings split into an array // they are parsed and validated v = ('' + v).split(...
javascript
function directives(def) { // mock line number for error messages var lineno = 1 , k , v // inline directive, not from a file , file = 'directive override (argv)'; function addDirective(k, v) { // must be strings split into an array // they are parsed and validated v = ('' + v).split(...
[ "function", "directives", "(", "def", ")", "{", "// mock line number for error messages", "var", "lineno", "=", "1", ",", "k", ",", "v", "// inline directive, not from a file", ",", "file", "=", "'directive override (argv)'", ";", "function", "addDirective", "(", "k",...
Merge configuration directive overrides into this instance. Should be invoked after the file and all includes have been loaded and parsed. @param def An object containing key value configuration pairs.
[ "Merge", "configuration", "directive", "overrides", "into", "this", "instance", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L297-L331
51,633
redisjs/jsr-conf
lib/configuration.js
load
function load(opts, cb) { if(typeof opts === 'function') { cb = opts; opts = undefined; } if(typeof opts === 'string') { file = opts; }else if(typeof opts === 'object') { file = opts.file; } if(file === undefined) file = DEFAULT_FILE; var sync = typeof cb !== 'function' , stream ...
javascript
function load(opts, cb) { if(typeof opts === 'function') { cb = opts; opts = undefined; } if(typeof opts === 'string') { file = opts; }else if(typeof opts === 'object') { file = opts.file; } if(file === undefined) file = DEFAULT_FILE; var sync = typeof cb !== 'function' , stream ...
[ "function", "load", "(", "opts", ",", "cb", ")", "{", "if", "(", "typeof", "opts", "===", "'function'", ")", "{", "cb", "=", "opts", ";", "opts", "=", "undefined", ";", "}", "if", "(", "typeof", "opts", "===", "'string'", ")", "{", "file", "=", "...
Read a file and pipe it to a decoder.
[ "Read", "a", "file", "and", "pipe", "it", "to", "a", "decoder", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L336-L425
51,634
redisjs/jsr-conf
lib/configuration.js
write
function write(file, cb) { if(file === undefined) file = this._file; if(file === DEFAULT_FILE) { return this.emit( 'error', new Error('cannot write to default configuration')); } var sync = typeof cb !== 'function' , stream , save , encoder = new Encoder(this.options) , lines = this....
javascript
function write(file, cb) { if(file === undefined) file = this._file; if(file === DEFAULT_FILE) { return this.emit( 'error', new Error('cannot write to default configuration')); } var sync = typeof cb !== 'function' , stream , save , encoder = new Encoder(this.options) , lines = this....
[ "function", "write", "(", "file", ",", "cb", ")", "{", "if", "(", "file", "===", "undefined", ")", "file", "=", "this", ".", "_file", ";", "if", "(", "file", "===", "DEFAULT_FILE", ")", "{", "return", "this", ".", "emit", "(", "'error'", ",", "new"...
Write the in-memory configuration to a file or stream.
[ "Write", "the", "in", "-", "memory", "configuration", "to", "a", "file", "or", "stream", "." ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L430-L537
51,635
redisjs/jsr-conf
lib/configuration.js
writeLines
function writeLines() { var chunk = lines.slice(i * size, (i * size) + size); // all done if(!chunk.length) { return encoder.end(); } // ensure we get correct line break between // line chunks, the encoder joins lines on EOL // this means that the last line in the chunk array // ...
javascript
function writeLines() { var chunk = lines.slice(i * size, (i * size) + size); // all done if(!chunk.length) { return encoder.end(); } // ensure we get correct line break between // line chunks, the encoder joins lines on EOL // this means that the last line in the chunk array // ...
[ "function", "writeLines", "(", ")", "{", "var", "chunk", "=", "lines", ".", "slice", "(", "i", "*", "size", ",", "(", "i", "*", "size", ")", "+", "size", ")", ";", "// all done", "if", "(", "!", "chunk", ".", "length", ")", "{", "return", "encode...
split the work for larger config files
[ "split", "the", "work", "for", "larger", "config", "files" ]
97c5e2e77e1601c879a62dfc2d500df537eaaddd
https://github.com/redisjs/jsr-conf/blob/97c5e2e77e1601c879a62dfc2d500df537eaaddd/lib/configuration.js#L513-L533
51,636
meltmedia/node-usher
lib/decider/version.js
handleFailure
function handleFailure(err) { // Respond back to SWF failing the workflow winston.log('error', 'An problem occured in the execution of workflow: %s, failing due to: ', self.name, err.stack); decisionTask.response.fail('Workflow failed', err, function (err) { if (err) { winston.log('error', 'Un...
javascript
function handleFailure(err) { // Respond back to SWF failing the workflow winston.log('error', 'An problem occured in the execution of workflow: %s, failing due to: ', self.name, err.stack); decisionTask.response.fail('Workflow failed', err, function (err) { if (err) { winston.log('error', 'Un...
[ "function", "handleFailure", "(", "err", ")", "{", "// Respond back to SWF failing the workflow", "winston", ".", "log", "(", "'error'", ",", "'An problem occured in the execution of workflow: %s, failing due to: '", ",", "self", ".", "name", ",", "err", ".", "stack", ")"...
When something goes wrong and we can't make a decision
[ "When", "something", "goes", "wrong", "and", "we", "can", "t", "make", "a", "decision" ]
fe6183bf7097f84bef935e8d9c19463accc08ad6
https://github.com/meltmedia/node-usher/blob/fe6183bf7097f84bef935e8d9c19463accc08ad6/lib/decider/version.js#L106-L115
51,637
meltmedia/node-usher
lib/decider/version.js
handleSuccess
function handleSuccess() { // If any activities failed, we need to fail the workflow if (context.failed()) { winston.log('warn', 'One of more activities failed in workflow: %s, marking workflow as failed', self.name); // Respond back to SWF failing the workflow decisionTask.response.fail('Ac...
javascript
function handleSuccess() { // If any activities failed, we need to fail the workflow if (context.failed()) { winston.log('warn', 'One of more activities failed in workflow: %s, marking workflow as failed', self.name); // Respond back to SWF failing the workflow decisionTask.response.fail('Ac...
[ "function", "handleSuccess", "(", ")", "{", "// If any activities failed, we need to fail the workflow", "if", "(", "context", ".", "failed", "(", ")", ")", "{", "winston", ".", "log", "(", "'warn'", ",", "'One of more activities failed in workflow: %s, marking workflow as ...
When we have made a decision
[ "When", "we", "have", "made", "a", "decision" ]
fe6183bf7097f84bef935e8d9c19463accc08ad6
https://github.com/meltmedia/node-usher/blob/fe6183bf7097f84bef935e8d9c19463accc08ad6/lib/decider/version.js#L118-L160
51,638
cdaringe/mock-package-install
src/index.js
function (opts) { opts = opts || {} opts = defaults(opts, { nodeModulesDir: path.resolve(process.cwd(), 'node_modules'), package: rpkg.gen(opts.package) }) fs.mkdirpSync(path.resolve(opts.nodeModulesDir, opts.package.name)) fs.writeFileSync( path.resolve(opts.nodeModulesDir, opts.p...
javascript
function (opts) { opts = opts || {} opts = defaults(opts, { nodeModulesDir: path.resolve(process.cwd(), 'node_modules'), package: rpkg.gen(opts.package) }) fs.mkdirpSync(path.resolve(opts.nodeModulesDir, opts.package.name)) fs.writeFileSync( path.resolve(opts.nodeModulesDir, opts.p...
[ "function", "(", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", "opts", "=", "defaults", "(", "opts", ",", "{", "nodeModulesDir", ":", "path", ".", "resolve", "(", "process", ".", "cwd", "(", ")", ",", "'node_modules'", ")", ",", "package", ...
Installs mock package into node_modules & updates the corresponding package.json file @param {object} opts @param {object} [opts.package] JS object package.json. random package used if none provided @param {string} [opts.nodeModulesDir] path to node_modules dir to install mock package into. looks for cwd/node_modules b...
[ "Installs", "mock", "package", "into", "node_modules", "&", "updates", "the", "corresponding", "package", ".", "json", "file" ]
a4c6561a6b2c538dd727447b11fdc3d18cdb3feb
https://github.com/cdaringe/mock-package-install/blob/a4c6561a6b2c538dd727447b11fdc3d18cdb3feb/src/index.js#L29-L48
51,639
cdaringe/mock-package-install
src/index.js
function (opts) { var name if (opts && opts.name) name = opts.name if (opts && opts.package && opts.package.name) name = opts.package.name if (!name) throw new TypeError('package name missing') opts = defaults(opts, { nodeModulesDir: path.resolve(process.cwd(), 'node_modules') }) fs.re...
javascript
function (opts) { var name if (opts && opts.name) name = opts.name if (opts && opts.package && opts.package.name) name = opts.package.name if (!name) throw new TypeError('package name missing') opts = defaults(opts, { nodeModulesDir: path.resolve(process.cwd(), 'node_modules') }) fs.re...
[ "function", "(", "opts", ")", "{", "var", "name", "if", "(", "opts", "&&", "opts", ".", "name", ")", "name", "=", "opts", ".", "name", "if", "(", "opts", "&&", "opts", ".", "package", "&&", "opts", ".", "package", ".", "name", ")", "name", "=", ...
remove mock package @param {object} opts @param {string} opts.name package name to remove @param {string} [opts.package.name] may be used instead of opts.name for consistency w/ install API @param {string} [opts.nodeModulesDir] path to node_modules dir @param {string} [opts.targetPackage] path to package.json file to u...
[ "remove", "mock", "package" ]
a4c6561a6b2c538dd727447b11fdc3d18cdb3feb
https://github.com/cdaringe/mock-package-install/blob/a4c6561a6b2c538dd727447b11fdc3d18cdb3feb/src/index.js#L59-L74
51,640
redisjs/jsr-store
lib/type/zset.js
SortedSet
function SortedSet(source) { HashMap.call(this); this._rtype = TYPE_NAMES.ZSET; if(source) { for(var k in source) { this.setKey(k, source[k]); } } }
javascript
function SortedSet(source) { HashMap.call(this); this._rtype = TYPE_NAMES.ZSET; if(source) { for(var k in source) { this.setKey(k, source[k]); } } }
[ "function", "SortedSet", "(", "source", ")", "{", "HashMap", ".", "call", "(", "this", ")", ";", "this", ".", "_rtype", "=", "TYPE_NAMES", ".", "ZSET", ";", "if", "(", "source", ")", "{", "for", "(", "var", "k", "in", "source", ")", "{", "this", ...
Represents the sorted set type.
[ "Represents", "the", "sorted", "set", "type", "." ]
b2b5c5b0347819f8a388b5d67e121ee8d73f328c
https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/type/zset.js#L11-L19
51,641
redisjs/jsr-store
lib/type/zset.js
zadd
function zadd(members) { var i , c = 0 , score , member; for(i = 0;i < members.length;i+=2) { score = members[i]; if(INFINITY[score] !== undefined) { score = INFINITY[score]; } member = members[i + 1]; if(this.zrank(member) === null) { c++; } // this will add or u...
javascript
function zadd(members) { var i , c = 0 , score , member; for(i = 0;i < members.length;i+=2) { score = members[i]; if(INFINITY[score] !== undefined) { score = INFINITY[score]; } member = members[i + 1]; if(this.zrank(member) === null) { c++; } // this will add or u...
[ "function", "zadd", "(", "members", ")", "{", "var", "i", ",", "c", "=", "0", ",", "score", ",", "member", ";", "for", "(", "i", "=", "0", ";", "i", "<", "members", ".", "length", ";", "i", "+=", "2", ")", "{", "score", "=", "members", "[", ...
Adds all the specified members with the specified scores to the sorted set.
[ "Adds", "all", "the", "specified", "members", "with", "the", "specified", "scores", "to", "the", "sorted", "set", "." ]
b2b5c5b0347819f8a388b5d67e121ee8d73f328c
https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/type/zset.js#L27-L45
51,642
redisjs/jsr-store
lib/type/zset.js
zrem
function zrem(members) { var i , c = 0; for(i = 0;i < members.length;i++) { c += this.delKey(members[i]); } return c; }
javascript
function zrem(members) { var i , c = 0; for(i = 0;i < members.length;i++) { c += this.delKey(members[i]); } return c; }
[ "function", "zrem", "(", "members", ")", "{", "var", "i", ",", "c", "=", "0", ";", "for", "(", "i", "=", "0", ";", "i", "<", "members", ".", "length", ";", "i", "++", ")", "{", "c", "+=", "this", ".", "delKey", "(", "members", "[", "i", "]"...
Removes the specified members from the sorted set.
[ "Removes", "the", "specified", "members", "from", "the", "sorted", "set", "." ]
b2b5c5b0347819f8a388b5d67e121ee8d73f328c
https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/type/zset.js#L50-L57
51,643
redisjs/jsr-store
lib/type/zset.js
zrank
function zrank(member) { if(this._data[member] === undefined) return null; for(var i = 0;i < this._keys.length;i++) { if(this.memberEqual(member, this._keys[i].m)) { return i; } } return null; }
javascript
function zrank(member) { if(this._data[member] === undefined) return null; for(var i = 0;i < this._keys.length;i++) { if(this.memberEqual(member, this._keys[i].m)) { return i; } } return null; }
[ "function", "zrank", "(", "member", ")", "{", "if", "(", "this", ".", "_data", "[", "member", "]", "===", "undefined", ")", "return", "null", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "_keys", ".", "length", ";", "i", "...
Returns the rank of member in the sorted set.
[ "Returns", "the", "rank", "of", "member", "in", "the", "sorted", "set", "." ]
b2b5c5b0347819f8a388b5d67e121ee8d73f328c
https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/type/zset.js#L69-L77
51,644
redisjs/jsr-store
lib/type/zset.js
zincrby
function zincrby(increment, member) { var score = parseFloat(this._data[member]) || 0; score += parseFloat(increment); this.setKey(member, score); return score; }
javascript
function zincrby(increment, member) { var score = parseFloat(this._data[member]) || 0; score += parseFloat(increment); this.setKey(member, score); return score; }
[ "function", "zincrby", "(", "increment", ",", "member", ")", "{", "var", "score", "=", "parseFloat", "(", "this", ".", "_data", "[", "member", "]", ")", "||", "0", ";", "score", "+=", "parseFloat", "(", "increment", ")", ";", "this", ".", "setKey", "...
Increments the score of member by increment.
[ "Increments", "the", "score", "of", "member", "by", "increment", "." ]
b2b5c5b0347819f8a388b5d67e121ee8d73f328c
https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/type/zset.js#L105-L110
51,645
redisjs/jsr-server
lib/command/server/config.js
set
function set(req, res) { var key = '' + req.args[0] , value = req.args[1]; // already validated the config key/value so should be ok // to update the in-memory config, some config verification // methods perform side-effects, eg: dir this.conf.set(key, value); res.send(null, Constants.OK); if(key ===...
javascript
function set(req, res) { var key = '' + req.args[0] , value = req.args[1]; // already validated the config key/value so should be ok // to update the in-memory config, some config verification // methods perform side-effects, eg: dir this.conf.set(key, value); res.send(null, Constants.OK); if(key ===...
[ "function", "set", "(", "req", ",", "res", ")", "{", "var", "key", "=", "''", "+", "req", ".", "args", "[", "0", "]", ",", "value", "=", "req", ".", "args", "[", "1", "]", ";", "// already validated the config key/value so should be ok", "// to update the ...
Respond to the SET subcommand.
[ "Respond", "to", "the", "SET", "subcommand", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/config.js#L41-L53
51,646
redisjs/jsr-server
lib/command/server/config.js
rewrite
function rewrite(req, res) { /* istanbul ignore next: tough to mock fs write error */ function onError(err) { this.conf.removeAllListeners('error'); this.conf.removeAllListeners('write'); res.send(err); } function onWrite() { this.conf.removeAllListeners('error'); this.conf.removeAllListen...
javascript
function rewrite(req, res) { /* istanbul ignore next: tough to mock fs write error */ function onError(err) { this.conf.removeAllListeners('error'); this.conf.removeAllListeners('write'); res.send(err); } function onWrite() { this.conf.removeAllListeners('error'); this.conf.removeAllListen...
[ "function", "rewrite", "(", "req", ",", "res", ")", "{", "/* istanbul ignore next: tough to mock fs write error */", "function", "onError", "(", "err", ")", "{", "this", ".", "conf", ".", "removeAllListeners", "(", "'error'", ")", ";", "this", ".", "conf", ".", ...
Respond to the REWRITE subcommand.
[ "Respond", "to", "the", "REWRITE", "subcommand", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/config.js#L58-L75
51,647
redisjs/jsr-server
lib/command/server/config.js
resetstat
function resetstat(req, res) { this.stats.reset(); res.send(null, Constants.OK); }
javascript
function resetstat(req, res) { this.stats.reset(); res.send(null, Constants.OK); }
[ "function", "resetstat", "(", "req", ",", "res", ")", "{", "this", ".", "stats", ".", "reset", "(", ")", ";", "res", ".", "send", "(", "null", ",", "Constants", ".", "OK", ")", ";", "}" ]
Respond to the RESETSTAT subcommand.
[ "Respond", "to", "the", "RESETSTAT", "subcommand", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/config.js#L80-L83
51,648
redisjs/jsr-server
lib/command/server/config.js
validate
function validate(cmd, args, info) { AbstractCommand.prototype.validate.apply(this, arguments); var sub = info.command.sub , cmd = '' + sub.cmd , args = sub.args , key , val , verified; if(cmd === Constants.SUBCOMMAND.config.set.name) { key = '' + args[0]; val = '' + args[1]; // ...
javascript
function validate(cmd, args, info) { AbstractCommand.prototype.validate.apply(this, arguments); var sub = info.command.sub , cmd = '' + sub.cmd , args = sub.args , key , val , verified; if(cmd === Constants.SUBCOMMAND.config.set.name) { key = '' + args[0]; val = '' + args[1]; // ...
[ "function", "validate", "(", "cmd", ",", "args", ",", "info", ")", "{", "AbstractCommand", ".", "prototype", ".", "validate", ".", "apply", "(", "this", ",", "arguments", ")", ";", "var", "sub", "=", "info", ".", "command", ".", "sub", ",", "cmd", "=...
Validate the CONFIG subcommands.
[ "Validate", "the", "CONFIG", "subcommands", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/config.js#L88-L126
51,649
psnider/tv4-via-typenames
amd/tv4-via-typenames.js
registerSchema
function registerSchema(schema) { var typename = getTypenameFromSchemaID(schema.id); var registered_schema = tv4.getSchema(schema.id); if (registered_schema == null) { var is_draft_schema = (schema.id === exports.DRAFT_SCHEMA_ID); if (!is_draft_schema) { i...
javascript
function registerSchema(schema) { var typename = getTypenameFromSchemaID(schema.id); var registered_schema = tv4.getSchema(schema.id); if (registered_schema == null) { var is_draft_schema = (schema.id === exports.DRAFT_SCHEMA_ID); if (!is_draft_schema) { i...
[ "function", "registerSchema", "(", "schema", ")", "{", "var", "typename", "=", "getTypenameFromSchemaID", "(", "schema", ".", "id", ")", ";", "var", "registered_schema", "=", "tv4", ".", "getSchema", "(", "schema", ".", "id", ")", ";", "if", "(", "register...
Regisiter the schema with the schema validation system. The schema is validated by this function, and registered only if it is valid. If a schema with this schema's typename has already been registered, then this returns true with no other action. @return true if successful, or if the schema had already been registered...
[ "Regisiter", "the", "schema", "with", "the", "schema", "validation", "system", ".", "The", "schema", "is", "validated", "by", "this", "function", "and", "registered", "only", "if", "it", "is", "valid", ".", "If", "a", "schema", "with", "this", "schema", "s...
15a19de0a0fd2adf9f8a31d15103fbe28efa83c9
https://github.com/psnider/tv4-via-typenames/blob/15a19de0a0fd2adf9f8a31d15103fbe28efa83c9/amd/tv4-via-typenames.js#L60-L89
51,650
psnider/tv4-via-typenames
amd/tv4-via-typenames.js
tv4_validate
function tv4_validate(typename, query) { var id = getSchemaIDFromTypename(typename); var schema = tv4.getSchema(id); if (schema == null) { var error = { code: 0, message: 'Schema not found', dataPath: '', schemaPath: id }; return { valid: false, missing: [], errors: [erro...
javascript
function tv4_validate(typename, query) { var id = getSchemaIDFromTypename(typename); var schema = tv4.getSchema(id); if (schema == null) { var error = { code: 0, message: 'Schema not found', dataPath: '', schemaPath: id }; return { valid: false, missing: [], errors: [erro...
[ "function", "tv4_validate", "(", "typename", ",", "query", ")", "{", "var", "id", "=", "getSchemaIDFromTypename", "(", "typename", ")", ";", "var", "schema", "=", "tv4", ".", "getSchema", "(", "id", ")", ";", "if", "(", "schema", "==", "null", ")", "{"...
Validate the given JSON against the schema for typename.
[ "Validate", "the", "given", "JSON", "against", "the", "schema", "for", "typename", "." ]
15a19de0a0fd2adf9f8a31d15103fbe28efa83c9
https://github.com/psnider/tv4-via-typenames/blob/15a19de0a0fd2adf9f8a31d15103fbe28efa83c9/amd/tv4-via-typenames.js#L91-L100
51,651
psnider/tv4-via-typenames
amd/tv4-via-typenames.js
tv4_validateSchema
function tv4_validateSchema(schema) { var is_draft_schema = (schema.id === exports.DRAFT_SCHEMA_ID); var draft_schema = (is_draft_schema) ? schema : tv4.getSchema(exports.DRAFT_SCHEMA_ID); var report = tv4.validateMultiple(schema, draft_schema); return report; }
javascript
function tv4_validateSchema(schema) { var is_draft_schema = (schema.id === exports.DRAFT_SCHEMA_ID); var draft_schema = (is_draft_schema) ? schema : tv4.getSchema(exports.DRAFT_SCHEMA_ID); var report = tv4.validateMultiple(schema, draft_schema); return report; }
[ "function", "tv4_validateSchema", "(", "schema", ")", "{", "var", "is_draft_schema", "=", "(", "schema", ".", "id", "===", "exports", ".", "DRAFT_SCHEMA_ID", ")", ";", "var", "draft_schema", "=", "(", "is_draft_schema", ")", "?", "schema", ":", "tv4", ".", ...
Validate the given schema.
[ "Validate", "the", "given", "schema", "." ]
15a19de0a0fd2adf9f8a31d15103fbe28efa83c9
https://github.com/psnider/tv4-via-typenames/blob/15a19de0a0fd2adf9f8a31d15103fbe28efa83c9/amd/tv4-via-typenames.js#L102-L107
51,652
kristianmandrup/ai-core
lib/utils/io.js
mutateJsonFile
function mutateJsonFile(targetPath, source, mutator) { if (!mutator) { mutator = source; source = null; } let sourceConfig = source; try { // console.log('targetPath', targetPath); let targetConfig = readJson(targetPath); // console.log('source', source); if (typeof source === 'string'...
javascript
function mutateJsonFile(targetPath, source, mutator) { if (!mutator) { mutator = source; source = null; } let sourceConfig = source; try { // console.log('targetPath', targetPath); let targetConfig = readJson(targetPath); // console.log('source', source); if (typeof source === 'string'...
[ "function", "mutateJsonFile", "(", "targetPath", ",", "source", ",", "mutator", ")", "{", "if", "(", "!", "mutator", ")", "{", "mutator", "=", "source", ";", "source", "=", "null", ";", "}", "let", "sourceConfig", "=", "source", ";", "try", "{", "// co...
source must be a filePath to a json file or an Object
[ "source", "must", "be", "a", "filePath", "to", "a", "json", "file", "or", "an", "Object" ]
c8968c44b4149a157f2e47c7051805ffc7bd99ed
https://github.com/kristianmandrup/ai-core/blob/c8968c44b4149a157f2e47c7051805ffc7bd99ed/lib/utils/io.js#L101-L127
51,653
skerit/alchemy-menu
assets/scripts/menu/menu_manager.js
detree
function detree(items, children, parent_id) { var item, i; for (i = 0; i < children.length; i++) { item = children[i]; if (parent_id) { item.parent = parent_id; } items.push(item); if (item.children) { detree(items, item.children, item.id); } delete item.children; } }
javascript
function detree(items, children, parent_id) { var item, i; for (i = 0; i < children.length; i++) { item = children[i]; if (parent_id) { item.parent = parent_id; } items.push(item); if (item.children) { detree(items, item.children, item.id); } delete item.children; } }
[ "function", "detree", "(", "items", ",", "children", ",", "parent_id", ")", "{", "var", "item", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "item", "=", "children", "[", "i", "]"...
Convert a nestable source data tree into a simple list @author Jelle De Loecker <jelle@develry.be> @since 0.0.1 @version 0.0.1 @param {Array} items @param {Object} children @param {String} parent_id
[ "Convert", "a", "nestable", "source", "data", "tree", "into", "a", "simple", "list" ]
9614241a63f40fdbf81b6bd1dc96e9bed8334c33
https://github.com/skerit/alchemy-menu/blob/9614241a63f40fdbf81b6bd1dc96e9bed8334c33/assets/scripts/menu/menu_manager.js#L282-L303
51,654
vkiding/judpack-common
src/PluginInfo/PluginInfo.js
_getTags
function _getTags(pelem, tag, platform, transform) { var platformTag = pelem.find('./platform[@name="' + platform + '"]'); var tagsInRoot = pelem.findall(tag); tagsInRoot = tagsInRoot || []; var tagsInPlatform = platformTag ? platformTag.findall(tag) : []; var tags = tagsInRoot.concat(tagsInPlatform...
javascript
function _getTags(pelem, tag, platform, transform) { var platformTag = pelem.find('./platform[@name="' + platform + '"]'); var tagsInRoot = pelem.findall(tag); tagsInRoot = tagsInRoot || []; var tagsInPlatform = platformTag ? platformTag.findall(tag) : []; var tags = tagsInRoot.concat(tagsInPlatform...
[ "function", "_getTags", "(", "pelem", ",", "tag", ",", "platform", ",", "transform", ")", "{", "var", "platformTag", "=", "pelem", ".", "find", "(", "'./platform[@name=\"'", "+", "platform", "+", "'\"]'", ")", ";", "var", "tagsInRoot", "=", "pelem", ".", ...
Helper function used by most of the getSomething methods of PluginInfo. Get all elements of a given name. Both in root and in platform sections for the given platform. If transform is given and is a function, it is applied to each element.
[ "Helper", "function", "used", "by", "most", "of", "the", "getSomething", "methods", "of", "PluginInfo", ".", "Get", "all", "elements", "of", "a", "given", "name", ".", "Both", "in", "root", "and", "in", "platform", "sections", "for", "the", "given", "platf...
5b87d3f1cb10c2c867243e3a692d39b4bb189dd4
https://github.com/vkiding/judpack-common/blob/5b87d3f1cb10c2c867243e3a692d39b4bb189dd4/src/PluginInfo/PluginInfo.js#L390-L400
51,655
andrewscwei/requiem
src/helpers/hasOwnValue.js
hasOwnValue
function hasOwnValue(object, value) { assertType(object, 'object', false, 'Invalid object specified'); for (let k in object) { if (object.hasOwnProperty(k) && (object[k] === value)) return true; } return false; }
javascript
function hasOwnValue(object, value) { assertType(object, 'object', false, 'Invalid object specified'); for (let k in object) { if (object.hasOwnProperty(k) && (object[k] === value)) return true; } return false; }
[ "function", "hasOwnValue", "(", "object", ",", "value", ")", "{", "assertType", "(", "object", ",", "'object'", ",", "false", ",", "'Invalid object specified'", ")", ";", "for", "(", "let", "k", "in", "object", ")", "{", "if", "(", "object", ".", "hasOwn...
Checks if an object literal has the specified value in one of its keys. @param {Object} object - Target object literal. @param {*} value - Value to check. @return {boolean} True if value is found, false otherwise. @alias module:requiem~helpers.hasOwnValue
[ "Checks", "if", "an", "object", "literal", "has", "the", "specified", "value", "in", "one", "of", "its", "keys", "." ]
c4182bfffc9841c6de5718f689ad3c2060511777
https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/helpers/hasOwnValue.js#L17-L25
51,656
bigpipe/bootstrap-pagelet
index.js
render
function render() { var framework = this._bigpipe._framework , bootstrap = this , data; data = this.keys.reduce(function reduce(memo, key) { memo[key] = bootstrap[key]; return memo; }, {}); // // Adds initial HTML headers to the queue. The first flush will // push out t...
javascript
function render() { var framework = this._bigpipe._framework , bootstrap = this , data; data = this.keys.reduce(function reduce(memo, key) { memo[key] = bootstrap[key]; return memo; }, {}); // // Adds initial HTML headers to the queue. The first flush will // push out t...
[ "function", "render", "(", ")", "{", "var", "framework", "=", "this", ".", "_bigpipe", ".", "_framework", ",", "bootstrap", "=", "this", ",", "data", ";", "data", "=", "this", ".", "keys", ".", "reduce", "(", "function", "reduce", "(", "memo", ",", "...
Render the HTML template with the data provided. Temper provides a minimal templater to handle data in HTML templates. Data has to be specifically provided, properties of `this` are not enumerable and would not be included. @returns {Pagelet} this @api public
[ "Render", "the", "HTML", "template", "with", "the", "data", "provided", ".", "Temper", "provides", "a", "minimal", "templater", "to", "handle", "data", "in", "HTML", "templates", ".", "Data", "has", "to", "be", "specifically", "provided", "properties", "of", ...
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L109-L139
51,657
bigpipe/bootstrap-pagelet
index.js
contentTypeHeader
function contentTypeHeader(type) { if (this._res.headersSent) return this.debug( 'Headers already sent, ignoring content type change: %s', contentTypes[type] ); this.contentType = contentTypes[type]; this._res.setHeader('Content-Type', this.contentType); }
javascript
function contentTypeHeader(type) { if (this._res.headersSent) return this.debug( 'Headers already sent, ignoring content type change: %s', contentTypes[type] ); this.contentType = contentTypes[type]; this._res.setHeader('Content-Type', this.contentType); }
[ "function", "contentTypeHeader", "(", "type", ")", "{", "if", "(", "this", ".", "_res", ".", "headersSent", ")", "return", "this", ".", "debug", "(", "'Headers already sent, ignoring content type change: %s'", ",", "contentTypes", "[", "type", "]", ")", ";", "th...
Change the contentType header if possible. @param {String} type html|json @api private
[ "Change", "the", "contentType", "header", "if", "possible", "." ]
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L147-L154
51,658
bigpipe/bootstrap-pagelet
index.js
queue
function queue(name, parent, data) { this.length--; // // Object was queued, transform the response type to application/json. // if ('object' === typeof data && this._contentType !== contentTypes.json) { this.emit('contentType', 'json'); } this._queue.push({ parent: parent, ...
javascript
function queue(name, parent, data) { this.length--; // // Object was queued, transform the response type to application/json. // if ('object' === typeof data && this._contentType !== contentTypes.json) { this.emit('contentType', 'json'); } this._queue.push({ parent: parent, ...
[ "function", "queue", "(", "name", ",", "parent", ",", "data", ")", "{", "this", ".", "length", "--", ";", "//", "// Object was queued, transform the response type to application/json.", "//", "if", "(", "'object'", "===", "typeof", "data", "&&", "this", ".", "_c...
Add fragment of data to the queue. @param {String} name Pagelet name that queued the content. @param {String} parent Pagelet parent that queued the content. @param {Mixed} data Output to be send to the response @returns {Pagelet} this @api public
[ "Add", "fragment", "of", "data", "to", "the", "queue", "." ]
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L165-L182
51,659
bigpipe/bootstrap-pagelet
index.js
join
function join() { var pagelet = this , result = this._queue.map(function flatten(fragment) { if (!fragment.name || !fragment.view) return ''; return fragment.view; }); try { result = this._contentType === contentTypes.json ? JSON.stringify(result.shift()) ...
javascript
function join() { var pagelet = this , result = this._queue.map(function flatten(fragment) { if (!fragment.name || !fragment.view) return ''; return fragment.view; }); try { result = this._contentType === contentTypes.json ? JSON.stringify(result.shift()) ...
[ "function", "join", "(", ")", "{", "var", "pagelet", "=", "this", ",", "result", "=", "this", ".", "_queue", ".", "map", "(", "function", "flatten", "(", "fragment", ")", "{", "if", "(", "!", "fragment", ".", "name", "||", "!", "fragment", ".", "vi...
Joins all the data fragments in the queue. @return {Mixed} Object by pagelet name or HTML string @api private
[ "Joins", "all", "the", "data", "fragments", "in", "the", "queue", "." ]
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L190-L208
51,660
bigpipe/bootstrap-pagelet
index.js
flush
function flush(done) { this.once('done', done); if (this._res.finished) { this.emit('done', new Error('Response was closed, unable to flush content')); } if (!this._queue.length) this.emit('done'); var data = new Buffer(this.join(), this.charset); if (data.length) { this.debug('Wr...
javascript
function flush(done) { this.once('done', done); if (this._res.finished) { this.emit('done', new Error('Response was closed, unable to flush content')); } if (!this._queue.length) this.emit('done'); var data = new Buffer(this.join(), this.charset); if (data.length) { this.debug('Wr...
[ "function", "flush", "(", "done", ")", "{", "this", ".", "once", "(", "'done'", ",", "done", ")", ";", "if", "(", "this", ".", "_res", ".", "finished", ")", "{", "this", ".", "emit", "(", "'done'", ",", "new", "Error", "(", "'Response was closed, una...
Flush all queued rendered pagelets to the request object. @returns {Pagelet} this @api private
[ "Flush", "all", "queued", "rendered", "pagelets", "to", "the", "request", "object", "." ]
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L216-L237
51,661
bigpipe/bootstrap-pagelet
index.js
constructor
function constructor(options) { Pagelet.prototype.constructor.call(this, options = options || {}); // // Store the provided global dependencies. // this.dependencies = this._bigpipe._compiler.page(this).concat( options.dependencies ); var req = options.req || {} , uri = req.uri...
javascript
function constructor(options) { Pagelet.prototype.constructor.call(this, options = options || {}); // // Store the provided global dependencies. // this.dependencies = this._bigpipe._compiler.page(this).concat( options.dependencies ); var req = options.req || {} , uri = req.uri...
[ "function", "constructor", "(", "options", ")", "{", "Pagelet", ".", "prototype", ".", "constructor", ".", "call", "(", "this", ",", "options", "=", "options", "||", "{", "}", ")", ";", "//", "// Store the provided global dependencies.", "//", "this", ".", "...
Extend the default constructor of the pagelet to set additional defaults based on the provided options. @param {Object} options Optional options. @api public
[ "Extend", "the", "default", "constructor", "of", "the", "pagelet", "to", "set", "additional", "defaults", "based", "on", "the", "provided", "options", "." ]
cf03e008aca36e413edd067ff8d83e2f1f59ed9f
https://github.com/bigpipe/bootstrap-pagelet/blob/cf03e008aca36e413edd067ff8d83e2f1f59ed9f/index.js#L315-L354
51,662
vkiding/jud-vue-render
src/render/browser/bridge/sender.js
function (callbackId, data, keepAlive) { const args = [callbackId] data && args.push(data) keepAlive && args.push(keepAlive) _send(this.instanceId, { method: 'callback', args: args }) }
javascript
function (callbackId, data, keepAlive) { const args = [callbackId] data && args.push(data) keepAlive && args.push(keepAlive) _send(this.instanceId, { method: 'callback', args: args }) }
[ "function", "(", "callbackId", ",", "data", ",", "keepAlive", ")", "{", "const", "args", "=", "[", "callbackId", "]", "data", "&&", "args", ".", "push", "(", "data", ")", "keepAlive", "&&", "args", ".", "push", "(", "keepAlive", ")", "_send", "(", "t...
perform a callback to jsframework.
[ "perform", "a", "callback", "to", "jsframework", "." ]
07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47
https://github.com/vkiding/jud-vue-render/blob/07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47/src/render/browser/bridge/sender.js#L27-L35
51,663
benderjs/benderjs-jasmine
lib/adapter.js
BenderReporter
function BenderReporter() { var timer = new jasmine.Timer(), current = new Suite(), passed = 0, failed = 0, errors = 0, ignored = 0, total = 0; function buildError( result ) { var pattern = /\n.*jasmine.js.*/gi, error = [], exp, i; for ( i = 0; i < result.failedExpectations.len...
javascript
function BenderReporter() { var timer = new jasmine.Timer(), current = new Suite(), passed = 0, failed = 0, errors = 0, ignored = 0, total = 0; function buildError( result ) { var pattern = /\n.*jasmine.js.*/gi, error = [], exp, i; for ( i = 0; i < result.failedExpectations.len...
[ "function", "BenderReporter", "(", ")", "{", "var", "timer", "=", "new", "jasmine", ".", "Timer", "(", ")", ",", "current", "=", "new", "Suite", "(", ")", ",", "passed", "=", "0", ",", "failed", "=", "0", ",", "errors", "=", "0", ",", "ignored", ...
custom reporter that will pass the results to bender
[ "custom", "reporter", "that", "will", "pass", "the", "results", "to", "bender" ]
d02ffb927e1e3be3f7ec57c7cd37546fcbb6d162
https://github.com/benderjs/benderjs-jasmine/blob/d02ffb927e1e3be3f7ec57c7cd37546fcbb6d162/lib/adapter.js#L66-L162
51,664
intesso/hidden-server
lib/hidden.js
HiddenServer
function HiddenServer(opts) { if (!(this instanceof HiddenServer)) return new HiddenServer(opts); this.set(require('../settings.json')); this.set(opts); this.uri = this.get('publicServer') + this.get('pingUri').replace(':hiddenServerName', this.get('hiddenServerName')); debug('uri', this.uri); this.init();...
javascript
function HiddenServer(opts) { if (!(this instanceof HiddenServer)) return new HiddenServer(opts); this.set(require('../settings.json')); this.set(opts); this.uri = this.get('publicServer') + this.get('pingUri').replace(':hiddenServerName', this.get('hiddenServerName')); debug('uri', this.uri); this.init();...
[ "function", "HiddenServer", "(", "opts", ")", "{", "if", "(", "!", "(", "this", "instanceof", "HiddenServer", ")", ")", "return", "new", "HiddenServer", "(", "opts", ")", ";", "this", ".", "set", "(", "require", "(", "'../settings.json'", ")", ")", ";", ...
`HiddenServer` Constructor function.
[ "HiddenServer", "Constructor", "function", "." ]
827336a77f43555b14bc204aa542e91e7296e0cf
https://github.com/intesso/hidden-server/blob/827336a77f43555b14bc204aa542e91e7296e0cf/lib/hidden.js#L16-L24
51,665
NicolaOrritos/progenic
lib/utils.js
function(options) { return new Promise( (resolve, reject) => { if (options) { options.logger.info('[PROGENIC] Starting "%s" daemon with %s workers...', options.name, options.workers); options.logger.info('[PROGENIC] [from "%s"]', options.main);...
javascript
function(options) { return new Promise( (resolve, reject) => { if (options) { options.logger.info('[PROGENIC] Starting "%s" daemon with %s workers...', options.name, options.workers); options.logger.info('[PROGENIC] [from "%s"]', options.main);...
[ "function", "(", "options", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "if", "(", "options", ")", "{", "options", ".", "logger", ".", "info", "(", "'[PROGENIC] Starting \"%s\" daemon with %s workers...'", ",", "...
Creates the children workers when running as cluster master. Runs the HTTP server otherwise. @param {Number} count Number of workers to create.
[ "Creates", "the", "children", "workers", "when", "running", "as", "cluster", "master", ".", "Runs", "the", "HTTP", "server", "otherwise", "." ]
eee85a2d9375a2930216ccbb7f03d254fb35a2e7
https://github.com/NicolaOrritos/progenic/blob/eee85a2d9375a2930216ccbb7f03d254fb35a2e7/lib/utils.js#L404-L443
51,666
NicolaOrritos/progenic
lib/utils.js
function(signal) { return new Promise( resolve => { for (let uniqueID in cluster.workers) { if (cluster.workers.hasOwnProperty(uniqueID)) { const worker = cluster.workers[uniqueID]; worker.kill(signal); ...
javascript
function(signal) { return new Promise( resolve => { for (let uniqueID in cluster.workers) { if (cluster.workers.hasOwnProperty(uniqueID)) { const worker = cluster.workers[uniqueID]; worker.kill(signal); ...
[ "function", "(", "signal", ")", "{", "return", "new", "Promise", "(", "resolve", "=>", "{", "for", "(", "let", "uniqueID", "in", "cluster", ".", "workers", ")", "{", "if", "(", "cluster", ".", "workers", ".", "hasOwnProperty", "(", "uniqueID", ")", ")"...
Kills all workers with the given signal. @param {Number} signal
[ "Kills", "all", "workers", "with", "the", "given", "signal", "." ]
eee85a2d9375a2930216ccbb7f03d254fb35a2e7
https://github.com/NicolaOrritos/progenic/blob/eee85a2d9375a2930216ccbb7f03d254fb35a2e7/lib/utils.js#L449-L465
51,667
aureooms/js-grammar
lib/ast/map.js
map
function map(callable, children) { var iterator = (0, _cmap.default)(callable, children)[Symbol.asyncIterator](); return new _Children.default(iterator, undefined); }
javascript
function map(callable, children) { var iterator = (0, _cmap.default)(callable, children)[Symbol.asyncIterator](); return new _Children.default(iterator, undefined); }
[ "function", "map", "(", "callable", ",", "children", ")", "{", "var", "iterator", "=", "(", "0", ",", "_cmap", ".", "default", ")", "(", "callable", ",", "children", ")", "[", "Symbol", ".", "asyncIterator", "]", "(", ")", ";", "return", "new", "_Chi...
Applies a given callable to each of the child of a given children async iterable. @param {Function} callable - The callable to use. @param {AsyncIterable} children - The input children. @returns {AsyncIterator}
[ "Applies", "a", "given", "callable", "to", "each", "of", "the", "child", "of", "a", "given", "children", "async", "iterable", "." ]
28c4d1a3175327b33766c34539eab317303e26c5
https://github.com/aureooms/js-grammar/blob/28c4d1a3175327b33766c34539eab317303e26c5/lib/ast/map.js#L21-L24
51,668
gethuman/pancakes-recipe
batch/reactor.cleanup/reactor.cleanup.batch.js
cleanupPrep
function cleanupPrep(options) { var sourceResource = options.source; var targetResource = options.target; var targetReactor = options.reactor; var reactor; // if there is a target reactor, just use that cleanupPrep if (targetReactor) { reactor = reactors[targ...
javascript
function cleanupPrep(options) { var sourceResource = options.source; var targetResource = options.target; var targetReactor = options.reactor; var reactor; // if there is a target reactor, just use that cleanupPrep if (targetReactor) { reactor = reactors[targ...
[ "function", "cleanupPrep", "(", "options", ")", "{", "var", "sourceResource", "=", "options", ".", "source", ";", "var", "targetResource", "=", "options", ".", "target", ";", "var", "targetReactor", "=", "options", ".", "reactor", ";", "var", "reactor", ";",...
Loop through reactors and clean them up @param options @returns {*}
[ "Loop", "through", "reactors", "and", "clean", "them", "up" ]
ea3feb8839e2edaf1b4577c052b8958953db4498
https://github.com/gethuman/pancakes-recipe/blob/ea3feb8839e2edaf1b4577c052b8958953db4498/batch/reactor.cleanup/reactor.cleanup.batch.js#L54-L78
51,669
gethuman/pancakes-recipe
batch/reactor.cleanup/reactor.cleanup.batch.js
getCleanupData
function getCleanupData(options) { var sourceResource = options.source; var targetResource = options.target === 'all' ? null : options.target; var targetReactor = options.reactor; var targetField = options.field; var cleanupData = []; // if source resource an option, we ...
javascript
function getCleanupData(options) { var sourceResource = options.source; var targetResource = options.target === 'all' ? null : options.target; var targetReactor = options.reactor; var targetField = options.field; var cleanupData = []; // if source resource an option, we ...
[ "function", "getCleanupData", "(", "options", ")", "{", "var", "sourceResource", "=", "options", ".", "source", ";", "var", "targetResource", "=", "options", ".", "target", "===", "'all'", "?", "null", ":", "options", ".", "target", ";", "var", "targetReacto...
Get the cleanup data based on the batch options @param options
[ "Get", "the", "cleanup", "data", "based", "on", "the", "batch", "options" ]
ea3feb8839e2edaf1b4577c052b8958953db4498
https://github.com/gethuman/pancakes-recipe/blob/ea3feb8839e2edaf1b4577c052b8958953db4498/batch/reactor.cleanup/reactor.cleanup.batch.js#L84-L112
51,670
alexpods/ClazzJS
src/components/meta/Property/Default.js
function(object, defaultValue, property) { if (!_.isUndefined(defaultValue)) { object.__setPropertyParam(property, 'default', defaultValue); } }
javascript
function(object, defaultValue, property) { if (!_.isUndefined(defaultValue)) { object.__setPropertyParam(property, 'default', defaultValue); } }
[ "function", "(", "object", ",", "defaultValue", ",", "property", ")", "{", "if", "(", "!", "_", ".", "isUndefined", "(", "defaultValue", ")", ")", "{", "object", ".", "__setPropertyParam", "(", "property", ",", "'default'", ",", "defaultValue", ")", ";", ...
Set default value for object property @param {object} object Some object @param {*} defaultValue Default value @param {string} property Property name @this {metaProcessor}
[ "Set", "default", "value", "for", "object", "property" ]
2f94496019669813c8246d48fcceb12a3e68a870
https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Property/Default.js#L16-L20
51,671
JavaScriptDude/ps-sync
lib/main.js
function(psRec,sProcId){ if(!sProcId){throw new Error("No Proc Id found in data");} var iFind,sArgs iFind=psRec.CommandLine.indexOf(psRec.Name); sArgs = psRec.CommandLine.substring(iFind+psRec.Name.length+1); psRecs[sProcId]={ pid: psRec.Proces...
javascript
function(psRec,sProcId){ if(!sProcId){throw new Error("No Proc Id found in data");} var iFind,sArgs iFind=psRec.CommandLine.indexOf(psRec.Name); sArgs = psRec.CommandLine.substring(iFind+psRec.Name.length+1); psRecs[sProcId]={ pid: psRec.Proces...
[ "function", "(", "psRec", ",", "sProcId", ")", "{", "if", "(", "!", "sProcId", ")", "{", "throw", "new", "Error", "(", "\"No Proc Id found in data\"", ")", ";", "}", "var", "iFind", ",", "sArgs", "iFind", "=", "psRec", ".", "CommandLine", ".", "indexOf",...
Now parse the WMIC return
[ "Now", "parse", "the", "WMIC", "return" ]
0e909e50d1555bdaa567cccd27ced6b69aec7c4c
https://github.com/JavaScriptDude/ps-sync/blob/0e909e50d1555bdaa567cccd27ced6b69aec7c4c/lib/main.js#L50-L62
51,672
inviqa/deck-task-registry
src/other/watch.js
watch
function watch(conf, undertaker) { const root = conf.themeConfig.root; /** * STYLE WATCHING. */ undertaker.watch( path.join(root, conf.themeConfig.sass.src, '**', '*.scss'), undertaker.series( require('../styles/lintStyles').bind(null, conf, undertaker), require('../styles/buildStyles'...
javascript
function watch(conf, undertaker) { const root = conf.themeConfig.root; /** * STYLE WATCHING. */ undertaker.watch( path.join(root, conf.themeConfig.sass.src, '**', '*.scss'), undertaker.series( require('../styles/lintStyles').bind(null, conf, undertaker), require('../styles/buildStyles'...
[ "function", "watch", "(", "conf", ",", "undertaker", ")", "{", "const", "root", "=", "conf", ".", "themeConfig", ".", "root", ";", "/**\n * STYLE WATCHING.\n */", "undertaker", ".", "watch", "(", "path", ".", "join", "(", "root", ",", "conf", ".", "the...
Watch project files. @param {ConfigParser} conf A configuration parser object. @param {Undertaker} undertaker An Undertaker instance.
[ "Watch", "project", "files", "." ]
4c31787b978e9d99a47052e090d4589a50cd3015
https://github.com/inviqa/deck-task-registry/blob/4c31787b978e9d99a47052e090d4589a50cd3015/src/other/watch.js#L11-L58
51,673
fullstackers/bus.io-common
lib/builder.js
Builder
function Builder (data) { if (!(this instanceof Builder)) return new Builder(data); debug('new builder', data); events.EventEmitter.call(this); this.message = Message(data); }
javascript
function Builder (data) { if (!(this instanceof Builder)) return new Builder(data); debug('new builder', data); events.EventEmitter.call(this); this.message = Message(data); }
[ "function", "Builder", "(", "data", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Builder", ")", ")", "return", "new", "Builder", "(", "data", ")", ";", "debug", "(", "'new builder'", ",", "data", ")", ";", "events", ".", "EventEmitter", ".", ...
Builds a Message instance and provides a way to deliver the built message @param {object} data
[ "Builds", "a", "Message", "instance", "and", "provides", "a", "way", "to", "deliver", "the", "built", "message" ]
9e081a15ba40c4233a936d4105465277da8578fd
https://github.com/fullstackers/bus.io-common/blob/9e081a15ba40c4233a936d4105465277da8578fd/lib/builder.js#L16-L26
51,674
TheOrbitals/angle-functions
dist/index.js
rounddeg
function rounddeg(angle) { var result = 360.0 * (angle / 360.0 - Math.floor(angle / 360.0)); if (result < 0.0) { result += 360.0; } if (result >= 360.0) { result -= 360.0; } return result; }
javascript
function rounddeg(angle) { var result = 360.0 * (angle / 360.0 - Math.floor(angle / 360.0)); if (result < 0.0) { result += 360.0; } if (result >= 360.0) { result -= 360.0; } return result; }
[ "function", "rounddeg", "(", "angle", ")", "{", "var", "result", "=", "360.0", "*", "(", "angle", "/", "360.0", "-", "Math", ".", "floor", "(", "angle", "/", "360.0", ")", ")", ";", "if", "(", "result", "<", "0.0", ")", "{", "result", "+=", "360....
Rounds the degree angle between 0 and 360 @param {number} angle @return {number}
[ "Rounds", "the", "degree", "angle", "between", "0", "and", "360" ]
dee45ac051a1c245639718cb8936cccfd94d325f
https://github.com/TheOrbitals/angle-functions/blob/dee45ac051a1c245639718cb8936cccfd94d325f/dist/index.js#L54-L63
51,675
ionut-botizan/external-jsx-loader
index.js
getViewRoot
function getViewRoot(source) { const tokens = parse(source); let position = tokens.length; let tagDepth = 0; let tagName; let token; /** * Loop backwards through the view's source and find the last closing tag * and its matching opening tag to determine the view's root node position. */ while (token = to...
javascript
function getViewRoot(source) { const tokens = parse(source); let position = tokens.length; let tagDepth = 0; let tagName; let token; /** * Loop backwards through the view's source and find the last closing tag * and its matching opening tag to determine the view's root node position. */ while (token = to...
[ "function", "getViewRoot", "(", "source", ")", "{", "const", "tokens", "=", "parse", "(", "source", ")", ";", "let", "position", "=", "tokens", ".", "length", ";", "let", "tagDepth", "=", "0", ";", "let", "tagName", ";", "let", "token", ";", "/**\n\t *...
Finds the position of the opening JSX tag in the source code.
[ "Finds", "the", "position", "of", "the", "opening", "JSX", "tag", "in", "the", "source", "code", "." ]
6d9a9044c7a38fa1bb98710b8a381083ab7ece8f
https://github.com/ionut-botizan/external-jsx-loader/blob/6d9a9044c7a38fa1bb98710b8a381083ab7ece8f/index.js#L93-L148
51,676
seelang2/imapper-storage-s3ses
lib/storage.js
function(next) { S3.getObject({ Bucket: S3Handler.options.S3BucketName, Key: S3Handler.options.mboxName + S3Handler.options.S3MessageListKeySuffix }, next ); }
javascript
function(next) { S3.getObject({ Bucket: S3Handler.options.S3BucketName, Key: S3Handler.options.mboxName + S3Handler.options.S3MessageListKeySuffix }, next ); }
[ "function", "(", "next", ")", "{", "S3", ".", "getObject", "(", "{", "Bucket", ":", "S3Handler", ".", "options", ".", "S3BucketName", ",", "Key", ":", "S3Handler", ".", "options", ".", "mboxName", "+", "S3Handler", ".", "options", ".", "S3MessageListKeySuf...
get the messagelist data
[ "get", "the", "messagelist", "data" ]
1755b12f84744b8d45aff123ac17ead5fbc3f09c
https://github.com/seelang2/imapper-storage-s3ses/blob/1755b12f84744b8d45aff123ac17ead5fbc3f09c/lib/storage.js#L60-L67
51,677
seelang2/imapper-storage-s3ses
lib/storage.js
function(messagelist, next) { var keyList = JSON.parse(messagelist.Body); if (CONSOLE_MESSAGES) console.log(new Date().toISOString(),'Raw messageList object:',keyList); // update last modified timestamp // also reset message list count // not using yet so don't modify a...
javascript
function(messagelist, next) { var keyList = JSON.parse(messagelist.Body); if (CONSOLE_MESSAGES) console.log(new Date().toISOString(),'Raw messageList object:',keyList); // update last modified timestamp // also reset message list count // not using yet so don't modify a...
[ "function", "(", "messagelist", ",", "next", ")", "{", "var", "keyList", "=", "JSON", ".", "parse", "(", "messagelist", ".", "Body", ")", ";", "if", "(", "CONSOLE_MESSAGES", ")", "console", ".", "log", "(", "new", "Date", "(", ")", ".", "toISOString", ...
process messagelist data
[ "process", "messagelist", "data" ]
1755b12f84744b8d45aff123ac17ead5fbc3f09c
https://github.com/seelang2/imapper-storage-s3ses/blob/1755b12f84744b8d45aff123ac17ead5fbc3f09c/lib/storage.js#L69-L95
51,678
seelang2/imapper-storage-s3ses
lib/storage.js
function(callback) { var params = { Bucket: S3Handler.options.S3BucketName, Key: S3Handler.options.mboxName + S3Handler.options.S3MboxKeySuffix, Body: JSON.stringify(data) }; s3.upload(params, function(err, response) { if (err) { if (CONSOLE_MESSAGES) console.log(new D...
javascript
function(callback) { var params = { Bucket: S3Handler.options.S3BucketName, Key: S3Handler.options.mboxName + S3Handler.options.S3MboxKeySuffix, Body: JSON.stringify(data) }; s3.upload(params, function(err, response) { if (err) { if (CONSOLE_MESSAGES) console.log(new D...
[ "function", "(", "callback", ")", "{", "var", "params", "=", "{", "Bucket", ":", "S3Handler", ".", "options", ".", "S3BucketName", ",", "Key", ":", "S3Handler", ".", "options", ".", "mboxName", "+", "S3Handler", ".", "options", ".", "S3MboxKeySuffix", ",",...
listObjects Saves the data file to the user mailbox
[ "listObjects", "Saves", "the", "data", "file", "to", "the", "user", "mailbox" ]
1755b12f84744b8d45aff123ac17ead5fbc3f09c
https://github.com/seelang2/imapper-storage-s3ses/blob/1755b12f84744b8d45aff123ac17ead5fbc3f09c/lib/storage.js#L163-L176
51,679
cconstantine/NoDevent
assets/js/eventemitter.js
Event
function Event(type, listener, scope, once, instance) { // Store arguments this.type = type; this.listener = listener; this.scope = scope; this.once = once; this.instance = instance; }
javascript
function Event(type, listener, scope, once, instance) { // Store arguments this.type = type; this.listener = listener; this.scope = scope; this.once = once; this.instance = instance; }
[ "function", "Event", "(", "type", ",", "listener", ",", "scope", ",", "once", ",", "instance", ")", "{", "// Store arguments", "this", ".", "type", "=", "type", ";", "this", ".", "listener", "=", "listener", ";", "this", ".", "scope", "=", "scope", ";"...
Event class Contains Event methods and property storage @param {String} type Event type name @param {Function} listener Function to be called when the event is fired @param {Object} scope Object that this should be set to when the listener is called @param {Boolean} once If true then the listener will be removed after...
[ "Event", "class", "Contains", "Event", "methods", "and", "property", "storage" ]
d17e5bdad2a6bf7006dc4291b44a705ce5b08c47
https://github.com/cconstantine/NoDevent/blob/d17e5bdad2a6bf7006dc4291b44a705ce5b08c47/assets/js/eventemitter.js#L36-L43
51,680
iteam-consulting/graphql-form-handler
src/index.js
render
function render(form, template) { const compiledRowTemplate = handlebars.compile( '<tr class="form-element">' + '<td class="key">{{key}}</td>' + '<td class="value">{{value}}</td>' + '</tr>'); const compiledTable = handlebars.compile( '<table><tbody>{{{rows}}}</tbody></table>'); const compi...
javascript
function render(form, template) { const compiledRowTemplate = handlebars.compile( '<tr class="form-element">' + '<td class="key">{{key}}</td>' + '<td class="value">{{value}}</td>' + '</tr>'); const compiledTable = handlebars.compile( '<table><tbody>{{{rows}}}</tbody></table>'); const compi...
[ "function", "render", "(", "form", ",", "template", ")", "{", "const", "compiledRowTemplate", "=", "handlebars", ".", "compile", "(", "'<tr class=\"form-element\">'", "+", "'<td class=\"key\">{{key}}</td>'", "+", "'<td class=\"value\">{{value}}</td>'", "+", "'</tr>'", ")"...
Function that returns the html to be rendered in the email @param {array} form an array of key value pairs @param {string} template The template to compile. @return {string} The rendered template.
[ "Function", "that", "returns", "the", "html", "to", "be", "rendered", "in", "the", "email" ]
56e11599b1872ae9d6c95b2d8ea1125f858c06f6
https://github.com/iteam-consulting/graphql-form-handler/blob/56e11599b1872ae9d6c95b2d8ea1125f858c06f6/src/index.js#L50-L71
51,681
hypergroup/hyper-uri-format
index.js
encode
function encode(cache, API_URL, obj) { if (!obj) return null; if (!obj.href) return obj; var href = API_URL ? pack(obj.href, API_URL) : obj.href; var cached = cache.get(href); if (cached) return cached; var encoded = base64.encode(new Buffer(href)).toString(); cache.set(href, encoded); return...
javascript
function encode(cache, API_URL, obj) { if (!obj) return null; if (!obj.href) return obj; var href = API_URL ? pack(obj.href, API_URL) : obj.href; var cached = cache.get(href); if (cached) return cached; var encoded = base64.encode(new Buffer(href)).toString(); cache.set(href, encoded); return...
[ "function", "encode", "(", "cache", ",", "API_URL", ",", "obj", ")", "{", "if", "(", "!", "obj", ")", "return", "null", ";", "if", "(", "!", "obj", ".", "href", ")", "return", "obj", ";", "var", "href", "=", "API_URL", "?", "pack", "(", "obj", ...
Encode an href object
[ "Encode", "an", "href", "object" ]
e2d56f205604684bd5805ae6c460fe50f41c0dfe
https://github.com/hypergroup/hyper-uri-format/blob/e2d56f205604684bd5805ae6c460fe50f41c0dfe/index.js#L63-L77
51,682
hypergroup/hyper-uri-format
index.js
encodeParams
function encodeParams(cache, API_URL, params) { var obj = {}, v; for (var k in params) { if (!params.hasOwnProperty(k)) continue; v = obj[k] = encode(cache, API_URL, params[k]); if (!v) return; } return obj; }
javascript
function encodeParams(cache, API_URL, params) { var obj = {}, v; for (var k in params) { if (!params.hasOwnProperty(k)) continue; v = obj[k] = encode(cache, API_URL, params[k]); if (!v) return; } return obj; }
[ "function", "encodeParams", "(", "cache", ",", "API_URL", ",", "params", ")", "{", "var", "obj", "=", "{", "}", ",", "v", ";", "for", "(", "var", "k", "in", "params", ")", "{", "if", "(", "!", "params", ".", "hasOwnProperty", "(", "k", ")", ")", ...
Encode a set of params
[ "Encode", "a", "set", "of", "params" ]
e2d56f205604684bd5805ae6c460fe50f41c0dfe
https://github.com/hypergroup/hyper-uri-format/blob/e2d56f205604684bd5805ae6c460fe50f41c0dfe/index.js#L83-L91
51,683
hypergroup/hyper-uri-format
index.js
decode
function decode(cache, API_URL, str) { var cached = cache.get(str); if (typeof cached !== 'undefined') return cached; if (typeof str !== 'string') return null; var decoded = base64.decode(str).toString().replace(/\0/g, ''); var out = validate(decoded) ? {href: unpack(decoded, API_URL)} : str; // ...
javascript
function decode(cache, API_URL, str) { var cached = cache.get(str); if (typeof cached !== 'undefined') return cached; if (typeof str !== 'string') return null; var decoded = base64.decode(str).toString().replace(/\0/g, ''); var out = validate(decoded) ? {href: unpack(decoded, API_URL)} : str; // ...
[ "function", "decode", "(", "cache", ",", "API_URL", ",", "str", ")", "{", "var", "cached", "=", "cache", ".", "get", "(", "str", ")", ";", "if", "(", "typeof", "cached", "!==", "'undefined'", ")", "return", "cached", ";", "if", "(", "typeof", "str", ...
Decode an encoded uri component
[ "Decode", "an", "encoded", "uri", "component" ]
e2d56f205604684bd5805ae6c460fe50f41c0dfe
https://github.com/hypergroup/hyper-uri-format/blob/e2d56f205604684bd5805ae6c460fe50f41c0dfe/index.js#L97-L112
51,684
hypergroup/hyper-uri-format
index.js
decodeParams
function decodeParams(cache, API_URL, params) { var obj = {}, v; for (var k in params) { if (!params.hasOwnProperty(k)) continue; obj[k] = decode(cache, API_URL, params[k]); } return obj; }
javascript
function decodeParams(cache, API_URL, params) { var obj = {}, v; for (var k in params) { if (!params.hasOwnProperty(k)) continue; obj[k] = decode(cache, API_URL, params[k]); } return obj; }
[ "function", "decodeParams", "(", "cache", ",", "API_URL", ",", "params", ")", "{", "var", "obj", "=", "{", "}", ",", "v", ";", "for", "(", "var", "k", "in", "params", ")", "{", "if", "(", "!", "params", ".", "hasOwnProperty", "(", "k", ")", ")", ...
Decode a set of params
[ "Decode", "a", "set", "of", "params" ]
e2d56f205604684bd5805ae6c460fe50f41c0dfe
https://github.com/hypergroup/hyper-uri-format/blob/e2d56f205604684bd5805ae6c460fe50f41c0dfe/index.js#L118-L125
51,685
hypergroup/hyper-uri-format
index.js
pack
function pack(href, API_URL) { var parts = url.parse(href); var pn = API_URL.pathname || '/'; if (parts.host !== API_URL.host || parts.pathname.indexOf(pn) !== 0) return href; if (pn === '/') pn = ''; return parts.pathname.replace(pn, '~') + (parts.search || ''); }
javascript
function pack(href, API_URL) { var parts = url.parse(href); var pn = API_URL.pathname || '/'; if (parts.host !== API_URL.host || parts.pathname.indexOf(pn) !== 0) return href; if (pn === '/') pn = ''; return parts.pathname.replace(pn, '~') + (parts.search || ''); }
[ "function", "pack", "(", "href", ",", "API_URL", ")", "{", "var", "parts", "=", "url", ".", "parse", "(", "href", ")", ";", "var", "pn", "=", "API_URL", ".", "pathname", "||", "'/'", ";", "if", "(", "parts", ".", "host", "!==", "API_URL", ".", "h...
replace the API_URL with ~
[ "replace", "the", "API_URL", "with", "~" ]
e2d56f205604684bd5805ae6c460fe50f41c0dfe
https://github.com/hypergroup/hyper-uri-format/blob/e2d56f205604684bd5805ae6c460fe50f41c0dfe/index.js#L142-L148
51,686
vkiding/jud-vue-render
src/render/browser/bridge/receiver.js
callNativeComponent
function callNativeComponent (instanceId, ref, method, args, options) { return processCall(instanceId, { component: options.component, ref, method, args }) }
javascript
function callNativeComponent (instanceId, ref, method, args, options) { return processCall(instanceId, { component: options.component, ref, method, args }) }
[ "function", "callNativeComponent", "(", "instanceId", ",", "ref", ",", "method", ",", "args", ",", "options", ")", "{", "return", "processCall", "(", "instanceId", ",", "{", "component", ":", "options", ".", "component", ",", "ref", ",", "method", ",", "ar...
sync call native component method.
[ "sync", "call", "native", "component", "method", "." ]
07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47
https://github.com/vkiding/jud-vue-render/blob/07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47/src/render/browser/bridge/receiver.js#L9-L16
51,687
vkiding/jud-vue-render
src/render/browser/bridge/receiver.js
callNativeModule
function callNativeModule (instanceId, module, method, args, options) { return processCall(instanceId, { module, method, args }) }
javascript
function callNativeModule (instanceId, module, method, args, options) { return processCall(instanceId, { module, method, args }) }
[ "function", "callNativeModule", "(", "instanceId", ",", "module", ",", "method", ",", "args", ",", "options", ")", "{", "return", "processCall", "(", "instanceId", ",", "{", "module", ",", "method", ",", "args", "}", ")", "}" ]
sync call native module api.
[ "sync", "call", "native", "module", "api", "." ]
07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47
https://github.com/vkiding/jud-vue-render/blob/07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47/src/render/browser/bridge/receiver.js#L19-L21
51,688
nanowizard/vec23
src/Vec2.js
function(v) { if(v instanceof Vec3){ return this.toVec3()._cross(v); } return new Vec3(0,0, this.x * v.y - this.y * v.x); }
javascript
function(v) { if(v instanceof Vec3){ return this.toVec3()._cross(v); } return new Vec3(0,0, this.x * v.y - this.y * v.x); }
[ "function", "(", "v", ")", "{", "if", "(", "v", "instanceof", "Vec3", ")", "{", "return", "this", ".", "toVec3", "(", ")", ".", "_cross", "(", "v", ")", ";", "}", "return", "new", "Vec3", "(", "0", ",", "0", ",", "this", ".", "x", "*", "v", ...
Computes the cross product with a Vec2 or Vec3. Note that by definition the cross product of two 2D vectors is a 3D vector with x = y = 0 @memberof Vec2# @param {Vec2|Vec3} v @returns {Vec3}
[ "Computes", "the", "cross", "product", "with", "a", "Vec2", "or", "Vec3", ".", "Note", "that", "by", "definition", "the", "cross", "product", "of", "two", "2D", "vectors", "is", "a", "3D", "vector", "with", "x", "=", "y", "=", "0" ]
e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364
https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec2.js#L239-L244
51,689
nanowizard/vec23
src/Vec2.js
function(m){ return new Vec2( this.x*m[0][0]+this.y*m[0][1], this.x*m[1][0]+this.y*m[1][1] ); }
javascript
function(m){ return new Vec2( this.x*m[0][0]+this.y*m[0][1], this.x*m[1][0]+this.y*m[1][1] ); }
[ "function", "(", "m", ")", "{", "return", "new", "Vec2", "(", "this", ".", "x", "*", "m", "[", "0", "]", "[", "0", "]", "+", "this", ".", "y", "*", "m", "[", "0", "]", "[", "1", "]", ",", "this", ".", "x", "*", "m", "[", "1", "]", "["...
Creates a new vector converting the vector to a new coordinate frame at the same origin. @memberof Vec2# @param {Array} m - Coordinate system matrix of the form [[Xx,Xy],[Yx,Yy]] @returns {Vec2}
[ "Creates", "a", "new", "vector", "converting", "the", "vector", "to", "a", "new", "coordinate", "frame", "at", "the", "same", "origin", "." ]
e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364
https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec2.js#L391-L396
51,690
nanowizard/vec23
src/Vec2.js
function(theta){ return new Vec2( this.x*Math.cos(theta)-this.y*Math.sin(theta), this.x*Math.sin(theta)+this.y*Math.cos(theta) ); }
javascript
function(theta){ return new Vec2( this.x*Math.cos(theta)-this.y*Math.sin(theta), this.x*Math.sin(theta)+this.y*Math.cos(theta) ); }
[ "function", "(", "theta", ")", "{", "return", "new", "Vec2", "(", "this", ".", "x", "*", "Math", ".", "cos", "(", "theta", ")", "-", "this", ".", "y", "*", "Math", ".", "sin", "(", "theta", ")", ",", "this", ".", "x", "*", "Math", ".", "sin",...
Rotates the vector in radians counterclockwise and returns a new vector. @memberof Vec2# @param {Number} theta - rotation angle (in radians) @returns {Vec2}
[ "Rotates", "the", "vector", "in", "radians", "counterclockwise", "and", "returns", "a", "new", "vector", "." ]
e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364
https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec2.js#L416-L421
51,691
nanowizard/vec23
src/Vec2.js
function(p){ this.x = Math.pow(this.x, p); this.y = Math.pow(this.y, p); return this; }
javascript
function(p){ this.x = Math.pow(this.x, p); this.y = Math.pow(this.y, p); return this; }
[ "function", "(", "p", ")", "{", "this", ".", "x", "=", "Math", ".", "pow", "(", "this", ".", "x", ",", "p", ")", ";", "this", ".", "y", "=", "Math", ".", "pow", "(", "this", ".", "y", ",", "p", ")", ";", "return", "this", ";", "}" ]
Raises each component of the vector to the power p. @memberof Vec2# @returns {Vec2}
[ "Raises", "each", "component", "of", "the", "vector", "to", "the", "power", "p", "." ]
e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364
https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec2.js#L448-L452
51,692
scijs/ndarray-select
select.js
permuteOrder
function permuteOrder(order) { var norder = order.slice() norder.splice(order.indexOf(0), 1) norder.unshift(0) return norder }
javascript
function permuteOrder(order) { var norder = order.slice() norder.splice(order.indexOf(0), 1) norder.unshift(0) return norder }
[ "function", "permuteOrder", "(", "order", ")", "{", "var", "norder", "=", "order", ".", "slice", "(", ")", "norder", ".", "splice", "(", "order", ".", "indexOf", "(", "0", ")", ",", "1", ")", "norder", ".", "unshift", "(", "0", ")", "return", "nord...
Create new order where index 0 is slowest index
[ "Create", "new", "order", "where", "index", "0", "is", "slowest", "index" ]
1e6eacb5d8ef8f40e11638f9d494f20e5856c526
https://github.com/scijs/ndarray-select/blob/1e6eacb5d8ef8f40e11638f9d494f20e5856c526/select.js#L40-L45
51,693
perfectapi/node-paas-machine-proxy
bin/proxy.js
function() { var config = {} registry.listServices(config, function(err, result) { if (err) return console.log(err); main.poll(registry, result, function(err) { if (err) return console.log(err); }); }) }
javascript
function() { var config = {} registry.listServices(config, function(err, result) { if (err) return console.log(err); main.poll(registry, result, function(err) { if (err) return console.log(err); }); }) }
[ "function", "(", ")", "{", "var", "config", "=", "{", "}", "registry", ".", "listServices", "(", "config", ",", "function", "(", "err", ",", "result", ")", "{", "if", "(", "err", ")", "return", "console", ".", "log", "(", "err", ")", ";", "main", ...
now we have a reference to the registry running on the same machine
[ "now", "we", "have", "a", "reference", "to", "the", "registry", "running", "on", "the", "same", "machine" ]
ad286fe05ef11ac060a4303ce07b664fad8155bf
https://github.com/perfectapi/node-paas-machine-proxy/blob/ad286fe05ef11ac060a4303ce07b664fad8155bf/bin/proxy.js#L32-L41
51,694
jeswin-unmaintained/isotropy-koa-context-in-browser
lib/context.js
function(){ return { request: this.request.toJSON(), response: this.response.toJSON(), app: this.app.toJSON(), originalUrl: this.originalUrl, req: '<original node req>', res: '<original node res>', ...
javascript
function(){ return { request: this.request.toJSON(), response: this.response.toJSON(), app: this.app.toJSON(), originalUrl: this.originalUrl, req: '<original node req>', res: '<original node res>', ...
[ "function", "(", ")", "{", "return", "{", "request", ":", "this", ".", "request", ".", "toJSON", "(", ")", ",", "response", ":", "this", ".", "response", ".", "toJSON", "(", ")", ",", "app", ":", "this", ".", "app", ".", "toJSON", "(", ")", ",", ...
Return JSON representation. Here we explicitly invoke .toJSON() on each object, as iteration will otherwise fail due to the getters and cause utilities such as clone() to fail. @return {Object} @api public
[ "Return", "JSON", "representation", "." ]
033a3ac0fd65ba6ac2b4ce715b3da54f873eed6f
https://github.com/jeswin-unmaintained/isotropy-koa-context-in-browser/blob/033a3ac0fd65ba6ac2b4ce715b3da54f873eed6f/lib/context.js#L40-L50
51,695
K15t/webpack-build
webpack-build.js
mergeDefaultConfig
function mergeDefaultConfig(opts) { let devModeEnabled = isDevelopMode(); let debugModeEnabled = isDebugMode(); console.log('------------------------------------------------------------------------------------'); console.log(`Executing build for ` + (devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD)); ...
javascript
function mergeDefaultConfig(opts) { let devModeEnabled = isDevelopMode(); let debugModeEnabled = isDebugMode(); console.log('------------------------------------------------------------------------------------'); console.log(`Executing build for ` + (devModeEnabled ? ENV_DEVELOPMENT : ENV_PROD)); ...
[ "function", "mergeDefaultConfig", "(", "opts", ")", "{", "let", "devModeEnabled", "=", "isDevelopMode", "(", ")", ";", "let", "debugModeEnabled", "=", "isDebugMode", "(", ")", ";", "console", ".", "log", "(", "'---------------------------------------------------------...
Module defining the common build configuration for webpack-based projects. @param opts Customized options which allows to override the defaults configuration.
[ "Module", "defining", "the", "common", "build", "configuration", "for", "webpack", "-", "based", "projects", "." ]
d5921b8c5abbc92159aabd6379c7c2b1a9d7fe27
https://github.com/K15t/webpack-build/blob/d5921b8c5abbc92159aabd6379c7c2b1a9d7fe27/webpack-build.js#L23-L77
51,696
Lindurion/closure-pro-build
lib/file-matcher.js
resolveAnyGlobPatternsAsync
function resolveAnyGlobPatternsAsync(filesAndPatterns, rootSrcDir) { return resolveGlobsAsync(filesAndPatterns, rootSrcDir) .then(function(resolvedFiles) { var allFiles = insertResolvedFiles(filesAndPatterns, resolvedFiles); return allFiles.map(convertBackslashes); }); }
javascript
function resolveAnyGlobPatternsAsync(filesAndPatterns, rootSrcDir) { return resolveGlobsAsync(filesAndPatterns, rootSrcDir) .then(function(resolvedFiles) { var allFiles = insertResolvedFiles(filesAndPatterns, resolvedFiles); return allFiles.map(convertBackslashes); }); }
[ "function", "resolveAnyGlobPatternsAsync", "(", "filesAndPatterns", ",", "rootSrcDir", ")", "{", "return", "resolveGlobsAsync", "(", "filesAndPatterns", ",", "rootSrcDir", ")", ".", "then", "(", "function", "(", "resolvedFiles", ")", "{", "var", "allFiles", "=", "...
Uses glob library to resolve any file patterns in input list. Removes any duplicate file paths and converts any path backslashes into forward slashes. @param {!Array.<string>} filesAndPatterns List of files and file patterns, e.g. ['my/single/file.js', 'dir/of/*.js']. @param {string} rootSrcDir Root source directory th...
[ "Uses", "glob", "library", "to", "resolve", "any", "file", "patterns", "in", "input", "list", ".", "Removes", "any", "duplicate", "file", "paths", "and", "converts", "any", "path", "backslashes", "into", "forward", "slashes", "." ]
c279d0fcc3a65969d2fe965f55e627b074792f1a
https://github.com/Lindurion/closure-pro-build/blob/c279d0fcc3a65969d2fe965f55e627b074792f1a/lib/file-matcher.js#L36-L42
51,697
Lindurion/closure-pro-build
lib/file-matcher.js
resolveGlobsAsync
function resolveGlobsAsync(filesAndPatterns, rootSrcDir) { var options = {cwd: rootSrcDir}; var tasks = {}; filesAndPatterns.forEach(function(fileOrPattern) { if (isGlobPattern(fileOrPattern)) { tasks[fileOrPattern] = underscore.partial(resolveGlobAsync, fileOrPattern, options); } }); ...
javascript
function resolveGlobsAsync(filesAndPatterns, rootSrcDir) { var options = {cwd: rootSrcDir}; var tasks = {}; filesAndPatterns.forEach(function(fileOrPattern) { if (isGlobPattern(fileOrPattern)) { tasks[fileOrPattern] = underscore.partial(resolveGlobAsync, fileOrPattern, options); } }); ...
[ "function", "resolveGlobsAsync", "(", "filesAndPatterns", ",", "rootSrcDir", ")", "{", "var", "options", "=", "{", "cwd", ":", "rootSrcDir", "}", ";", "var", "tasks", "=", "{", "}", ";", "filesAndPatterns", ".", "forEach", "(", "function", "(", "fileOrPatter...
Does the glob resolution for all glob file patterns in input. @param {!Array.<string>} filesAndPatterns @param {string} rootSrcDir @return {!Promise.<!Object.<string, !Array.<string>>>} A future map from file pattern to list of resolved files (on success).
[ "Does", "the", "glob", "resolution", "for", "all", "glob", "file", "patterns", "in", "input", "." ]
c279d0fcc3a65969d2fe965f55e627b074792f1a
https://github.com/Lindurion/closure-pro-build/blob/c279d0fcc3a65969d2fe965f55e627b074792f1a/lib/file-matcher.js#L52-L68
51,698
JosePedroDias/level1
libClient/level1_http.js
function() { if (xhr.readyState === 4 && xhr.status === 200) { return cb(null, JSON.parse(xhr.response)); } cb('error requesting ' + uri); }
javascript
function() { if (xhr.readyState === 4 && xhr.status === 200) { return cb(null, JSON.parse(xhr.response)); } cb('error requesting ' + uri); }
[ "function", "(", ")", "{", "if", "(", "xhr", ".", "readyState", "===", "4", "&&", "xhr", ".", "status", "===", "200", ")", "{", "return", "cb", "(", "null", ",", "JSON", ".", "parse", "(", "xhr", ".", "response", ")", ")", ";", "}", "cb", "(", ...
setup callback to handle result
[ "setup", "callback", "to", "handle", "result" ]
cabd26c85e4c4e3131863c1bb1eaac8e17d1ec22
https://github.com/JosePedroDias/level1/blob/cabd26c85e4c4e3131863c1bb1eaac8e17d1ec22/libClient/level1_http.js#L68-L73
51,699
espadrine/travel-scrapper
uk.js
extractTravelPlan
function extractTravelPlan(data) { let tickets = data.fullJourneys[0].cheapestTickets if (!tickets || tickets.length === 0) { return [] } let secondClass = tickets[0].tickets let firstClass = tickets[1].tickets let journeys = data.fullJourneys[0].journeys let date = data.fullJourneys[0].date // "25 Sep 201...
javascript
function extractTravelPlan(data) { let tickets = data.fullJourneys[0].cheapestTickets if (!tickets || tickets.length === 0) { return [] } let secondClass = tickets[0].tickets let firstClass = tickets[1].tickets let journeys = data.fullJourneys[0].journeys let date = data.fullJourneys[0].date // "25 Sep 201...
[ "function", "extractTravelPlan", "(", "data", ")", "{", "let", "tickets", "=", "data", ".", "fullJourneys", "[", "0", "]", ".", "cheapestTickets", "if", "(", "!", "tickets", "||", "tickets", ".", "length", "===", "0", ")", "{", "return", "[", "]", "}",...
Get raw scrapping data Return data conforming to the common travel plan format.
[ "Get", "raw", "scrapping", "data", "Return", "data", "conforming", "to", "the", "common", "travel", "plan", "format", "." ]
5ed137e967a8a2de67f988922ec66222f464ea96
https://github.com/espadrine/travel-scrapper/blob/5ed137e967a8a2de67f988922ec66222f464ea96/uk.js#L81-L128