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
49,100
westtrade/waterlock-vkontakte-auth
lib/vkoauth2.js
VKOAuth2
function VKOAuth2(appId, appSecret, redirectURL, fullSettings) { this._appId = appId; this._appSecret = appSecret; this._redirectURL = redirectURL; fullSettings = fullSettings || {}; this._vkOpts = fullSettings.settings || {}; this._apiVersion = this._vkOpts.version || '5.41'; this._dialo...
javascript
function VKOAuth2(appId, appSecret, redirectURL, fullSettings) { this._appId = appId; this._appSecret = appSecret; this._redirectURL = redirectURL; fullSettings = fullSettings || {}; this._vkOpts = fullSettings.settings || {}; this._apiVersion = this._vkOpts.version || '5.41'; this._dialo...
[ "function", "VKOAuth2", "(", "appId", ",", "appSecret", ",", "redirectURL", ",", "fullSettings", ")", "{", "this", ".", "_appId", "=", "appId", ";", "this", ".", "_appSecret", "=", "appSecret", ";", "this", ".", "_redirectURL", "=", "redirectURL", ";", "fu...
vkontakte OAuth2 object, make various requests the graphAPI @param {string} appId the vkontakte app id @param {string} appSecret the vkontakte app secret @param {string} redirectURL the url vkontakte should use as a callback
[ "vkontakte", "OAuth2", "object", "make", "various", "requests", "the", "graphAPI" ]
7723740bf9d6df369918d9a9a17953b10e17fd01
https://github.com/westtrade/waterlock-vkontakte-auth/blob/7723740bf9d6df369918d9a9a17953b10e17fd01/lib/vkoauth2.js#L17-L37
49,101
amida-tech/blue-button-pim
lib/scorer.js
score
function score(data, candidate) { var result = 0; /* Scoring calculations here */ //Last Name if (!data.name.last || !candidate.name.last) { result = result + 0; } else if (data.name.last.toUpperCase() === candidate.name.last.toUpperCase()) { result = result + 9.58; ...
javascript
function score(data, candidate) { var result = 0; /* Scoring calculations here */ //Last Name if (!data.name.last || !candidate.name.last) { result = result + 0; } else if (data.name.last.toUpperCase() === candidate.name.last.toUpperCase()) { result = result + 9.58; ...
[ "function", "score", "(", "data", ",", "candidate", ")", "{", "var", "result", "=", "0", ";", "/*\n Scoring calculations here\n */", "//Last Name", "if", "(", "!", "data", ".", "name", ".", "last", "||", "!", "candidate", ".", "name", ".", "last", ...
scores match between candidate vs patient data
[ "scores", "match", "between", "candidate", "vs", "patient", "data" ]
329dcc5fa5f3d877c2b675e8e0d689a8ef25a895
https://github.com/amida-tech/blue-button-pim/blob/329dcc5fa5f3d877c2b675e8e0d689a8ef25a895/lib/scorer.js#L4-L50
49,102
davidtucker/node-shutdown-manager
examples/example.js
function() { var deferred = q.defer(); setTimeout(function() { console.log("Async Action 1 Completed"); deferred.resolve(); }, 1000); return deferred.promise; }
javascript
function() { var deferred = q.defer(); setTimeout(function() { console.log("Async Action 1 Completed"); deferred.resolve(); }, 1000); return deferred.promise; }
[ "function", "(", ")", "{", "var", "deferred", "=", "q", ".", "defer", "(", ")", ";", "setTimeout", "(", "function", "(", ")", "{", "console", ".", "log", "(", "\"Async Action 1 Completed\"", ")", ";", "deferred", ".", "resolve", "(", ")", ";", "}", "...
Adding Async Named Function
[ "Adding", "Async", "Named", "Function" ]
5106ba004f7351c4281d9f736de176126077e75a
https://github.com/davidtucker/node-shutdown-manager/blob/5106ba004f7351c4281d9f736de176126077e75a/examples/example.js#L22-L29
49,103
Fullstop000/redux-sirius
src/index.js
createRootReducer
function createRootReducer (model, name) { const handlers = {} const initialState = model.state // auto-generated reducers if (isNotNullObject(initialState)) { for (const key of Object.keys(initialState)) { handlers[addSetPrefix(name)(key)] = (state, action) => includeKey(action, 'payload') ? { ...sta...
javascript
function createRootReducer (model, name) { const handlers = {} const initialState = model.state // auto-generated reducers if (isNotNullObject(initialState)) { for (const key of Object.keys(initialState)) { handlers[addSetPrefix(name)(key)] = (state, action) => includeKey(action, 'payload') ? { ...sta...
[ "function", "createRootReducer", "(", "model", ",", "name", ")", "{", "const", "handlers", "=", "{", "}", "const", "initialState", "=", "model", ".", "state", "// auto-generated reducers", "if", "(", "isNotNullObject", "(", "initialState", ")", ")", "{", "for"...
Create a root reducer based on model state and model reducers If you have a model like the below { namespace: 'form', state: { loading: false, password: '' } } then sirius will generate a reducer for each state field following a preset rule: for state loading : form/setLoading for state password : form/setPassword ...
[ "Create", "a", "root", "reducer", "based", "on", "model", "state", "and", "model", "reducers" ]
1337e7d3414879d5d5364db89d0e08f18f9ef984
https://github.com/Fullstop000/redux-sirius/blob/1337e7d3414879d5d5364db89d0e08f18f9ef984/src/index.js#L241-L281
49,104
Fullstop000/redux-sirius
src/index.js
getNamespace
function getNamespace (path, relative) { // ignore parent path let final = '' if (relative) { const s = path.split('/') final = s[s.length - 1] } else { final = path.startsWith('./') ? path.slice(2) : path } // remove '.js' return final.slice(0, final.length - 3) }
javascript
function getNamespace (path, relative) { // ignore parent path let final = '' if (relative) { const s = path.split('/') final = s[s.length - 1] } else { final = path.startsWith('./') ? path.slice(2) : path } // remove '.js' return final.slice(0, final.length - 3) }
[ "function", "getNamespace", "(", "path", ",", "relative", ")", "{", "// ignore parent path", "let", "final", "=", "''", "if", "(", "relative", ")", "{", "const", "s", "=", "path", ".", "split", "(", "'/'", ")", "final", "=", "s", "[", "s", ".", "leng...
Get namespace from file path @param {String} path model file path such as 'test/sub/model.js' @param {Boolean} relative use relative namespace or not
[ "Get", "namespace", "from", "file", "path" ]
1337e7d3414879d5d5364db89d0e08f18f9ef984
https://github.com/Fullstop000/redux-sirius/blob/1337e7d3414879d5d5364db89d0e08f18f9ef984/src/index.js#L293-L304
49,105
Fullstop000/redux-sirius
src/index.js
readModels
function readModels (dir, relative) { const fs = require('fs') const path = require('path') // eslint-disable-next-line no-eval const evalRequire = eval('require') const list = [] function readRecursively (dir, root, list) { fs.readdirSync(dir).forEach(file => { const filePath = path.join(dir, fil...
javascript
function readModels (dir, relative) { const fs = require('fs') const path = require('path') // eslint-disable-next-line no-eval const evalRequire = eval('require') const list = [] function readRecursively (dir, root, list) { fs.readdirSync(dir).forEach(file => { const filePath = path.join(dir, fil...
[ "function", "readModels", "(", "dir", ",", "relative", ")", "{", "const", "fs", "=", "require", "(", "'fs'", ")", "const", "path", "=", "require", "(", "'path'", ")", "// eslint-disable-next-line no-eval", "const", "evalRequire", "=", "eval", "(", "'require'",...
Read all models recursively in a path. This just works in Node project @param {String} dir @param {String} root @param {Array} list
[ "Read", "all", "models", "recursively", "in", "a", "path", ".", "This", "just", "works", "in", "Node", "project" ]
1337e7d3414879d5d5364db89d0e08f18f9ef984
https://github.com/Fullstop000/redux-sirius/blob/1337e7d3414879d5d5364db89d0e08f18f9ef984/src/index.js#L313-L346
49,106
francois2metz/node-intervals
intervals.js
transformHtmlEntities
function transformHtmlEntities() { return function(method, request, next) { next(function(response, next) { response.body = utils.deHtmlEntities(response.body); next(); }) }; }
javascript
function transformHtmlEntities() { return function(method, request, next) { next(function(response, next) { response.body = utils.deHtmlEntities(response.body); next(); }) }; }
[ "function", "transformHtmlEntities", "(", ")", "{", "return", "function", "(", "method", ",", "request", ",", "next", ")", "{", "next", "(", "function", "(", "response", ",", "next", ")", "{", "response", ".", "body", "=", "utils", ".", "deHtmlEntities", ...
Replace all html entities from api response to real utf8 characters
[ "Replace", "all", "html", "entities", "from", "api", "response", "to", "real", "utf8", "characters" ]
0633747156f02938ce4d8063e1fed8a33beab365
https://github.com/francois2metz/node-intervals/blob/0633747156f02938ce4d8063e1fed8a33beab365/intervals.js#L56-L63
49,107
olaurendeau/grunt-contrib-mongo-migrate
tasks/mongo-migrate.js
run
function run(cmd){ var proc = require('child_process'), done = grunt.task.current.async(); // Tells Grunt that an async task is complete proc.exec(cmd, function(error, stdout, stderr){ if(stderr){ grunt.log.writeln('ERROR: ' + stderr).error()...
javascript
function run(cmd){ var proc = require('child_process'), done = grunt.task.current.async(); // Tells Grunt that an async task is complete proc.exec(cmd, function(error, stdout, stderr){ if(stderr){ grunt.log.writeln('ERROR: ' + stderr).error()...
[ "function", "run", "(", "cmd", ")", "{", "var", "proc", "=", "require", "(", "'child_process'", ")", ",", "done", "=", "grunt", ".", "task", ".", "current", ".", "async", "(", ")", ";", "// Tells Grunt that an async task is complete", "proc", ".", "exec", ...
Helper method to interface with the migrate bin file. @param cmd Command that is going to be executed.
[ "Helper", "method", "to", "interface", "with", "the", "migrate", "bin", "file", "." ]
2b9f20d60df877c6e850887f6f69a5e9769b0854
https://github.com/olaurendeau/grunt-contrib-mongo-migrate/blob/2b9f20d60df877c6e850887f6f69a5e9769b0854/tasks/mongo-migrate.js#L22-L36
49,108
olaurendeau/grunt-contrib-mongo-migrate
tasks/mongo-migrate.js
up
function up(){ console.log(grunt.target); var key = (grunt.option('name') || ""), label = ( key || "EMPTY"), cmd = (migrateBinPath + " up " + key).trim(); grunt.log.write('Running migration "UP" [' + label + ']...').ok(); run(cmd); }
javascript
function up(){ console.log(grunt.target); var key = (grunt.option('name') || ""), label = ( key || "EMPTY"), cmd = (migrateBinPath + " up " + key).trim(); grunt.log.write('Running migration "UP" [' + label + ']...').ok(); run(cmd); }
[ "function", "up", "(", ")", "{", "console", ".", "log", "(", "grunt", ".", "target", ")", ";", "var", "key", "=", "(", "grunt", ".", "option", "(", "'name'", ")", "||", "\"\"", ")", ",", "label", "=", "(", "key", "||", "\"EMPTY\"", ")", ",", "c...
Migrate UP to either the latest migration file or to a migration name passed in as an argument.
[ "Migrate", "UP", "to", "either", "the", "latest", "migration", "file", "or", "to", "a", "migration", "name", "passed", "in", "as", "an", "argument", "." ]
2b9f20d60df877c6e850887f6f69a5e9769b0854
https://github.com/olaurendeau/grunt-contrib-mongo-migrate/blob/2b9f20d60df877c6e850887f6f69a5e9769b0854/tasks/mongo-migrate.js#L41-L49
49,109
olaurendeau/grunt-contrib-mongo-migrate
tasks/mongo-migrate.js
down
function down(){ var key = (grunt.option('name') || ""), label = ( key || "EMPTY"), cmd = (migrateBinPath + " down " + key).trim(); grunt.log.write('Running migration "DOWN" [' + label + ']...').ok(); run(cmd); }
javascript
function down(){ var key = (grunt.option('name') || ""), label = ( key || "EMPTY"), cmd = (migrateBinPath + " down " + key).trim(); grunt.log.write('Running migration "DOWN" [' + label + ']...').ok(); run(cmd); }
[ "function", "down", "(", ")", "{", "var", "key", "=", "(", "grunt", ".", "option", "(", "'name'", ")", "||", "\"\"", ")", ",", "label", "=", "(", "key", "||", "\"EMPTY\"", ")", ",", "cmd", "=", "(", "migrateBinPath", "+", "\" down \"", "+", "key", ...
Migrate DOWN to either the latest migration file or to a migration name passed in as an argument.
[ "Migrate", "DOWN", "to", "either", "the", "latest", "migration", "file", "or", "to", "a", "migration", "name", "passed", "in", "as", "an", "argument", "." ]
2b9f20d60df877c6e850887f6f69a5e9769b0854
https://github.com/olaurendeau/grunt-contrib-mongo-migrate/blob/2b9f20d60df877c6e850887f6f69a5e9769b0854/tasks/mongo-migrate.js#L54-L61
49,110
olaurendeau/grunt-contrib-mongo-migrate
tasks/mongo-migrate.js
create
function create(){ var cmd = (migrateBinPath + " create " + grunt.option('name')).trim(); grunt.log.write('Creating a new migration named "' + grunt.option('name') + '"...').ok(); run(cmd); }
javascript
function create(){ var cmd = (migrateBinPath + " create " + grunt.option('name')).trim(); grunt.log.write('Creating a new migration named "' + grunt.option('name') + '"...').ok(); run(cmd); }
[ "function", "create", "(", ")", "{", "var", "cmd", "=", "(", "migrateBinPath", "+", "\" create \"", "+", "grunt", ".", "option", "(", "'name'", ")", ")", ".", "trim", "(", ")", ";", "grunt", ".", "log", ".", "write", "(", "'Creating a new migration named...
Migrate CREATE will create a new migration file.
[ "Migrate", "CREATE", "will", "create", "a", "new", "migration", "file", "." ]
2b9f20d60df877c6e850887f6f69a5e9769b0854
https://github.com/olaurendeau/grunt-contrib-mongo-migrate/blob/2b9f20d60df877c6e850887f6f69a5e9769b0854/tasks/mongo-migrate.js#L66-L71
49,111
lokijs/loki-core
lib/game.js
function(entity) { // Bind to start event right away. var boundStart = entity.start.bind(entity); this.on('start', boundStart); // Bind to preloadComplete, but only once. var boundPreloadComplete = entity.preloadComplete.bind(entity); this.once('preloadComplete', boundPreloadComplete); // Only bind to upd...
javascript
function(entity) { // Bind to start event right away. var boundStart = entity.start.bind(entity); this.on('start', boundStart); // Bind to preloadComplete, but only once. var boundPreloadComplete = entity.preloadComplete.bind(entity); this.once('preloadComplete', boundPreloadComplete); // Only bind to upd...
[ "function", "(", "entity", ")", "{", "// Bind to start event right away.", "var", "boundStart", "=", "entity", ".", "start", ".", "bind", "(", "entity", ")", ";", "this", ".", "on", "(", "'start'", ",", "boundStart", ")", ";", "// Bind to preloadComplete, but on...
Bound to a game instance, will add a single entity.
[ "Bound", "to", "a", "game", "instance", "will", "add", "a", "single", "entity", "." ]
ee17222ca8ce52faefd8d0874feda80364b8dd13
https://github.com/lokijs/loki-core/blob/ee17222ca8ce52faefd8d0874feda80364b8dd13/lib/game.js#L73-L91
49,112
gethuman/pancakes-angular
lib/ngapp/ajax.js
saveOpts
function saveOpts(apiOpts) { if (apiOpts.url && apiOpts.url.toLowerCase().indexOf('password') >= 0) { var idx = apiOpts.url.indexOf('?'); apiOpts.url = apiOpts.url.substring(0, idx); } storage.set('lastApiCall', (JSON.stringify(apiOpts) || '').substri...
javascript
function saveOpts(apiOpts) { if (apiOpts.url && apiOpts.url.toLowerCase().indexOf('password') >= 0) { var idx = apiOpts.url.indexOf('?'); apiOpts.url = apiOpts.url.substring(0, idx); } storage.set('lastApiCall', (JSON.stringify(apiOpts) || '').substri...
[ "function", "saveOpts", "(", "apiOpts", ")", "{", "if", "(", "apiOpts", ".", "url", "&&", "apiOpts", ".", "url", ".", "toLowerCase", "(", ")", ".", "indexOf", "(", "'password'", ")", ">=", "0", ")", "{", "var", "idx", "=", "apiOpts", ".", "url", "....
Save the options to storage for later debugging
[ "Save", "the", "options", "to", "storage", "for", "later", "debugging" ]
9589b7ba09619843e271293088005c62ed23f355
https://github.com/gethuman/pancakes-angular/blob/9589b7ba09619843e271293088005c62ed23f355/lib/ngapp/ajax.js#L68-L75
49,113
gethuman/pancakes-angular
lib/ngapp/ajax.js
send
function send(url, method, options, resourceName) { var deferred = $q.defer(); var key, val, paramArray = []; url = config.apiBase + url; options = options || {}; // separate out data if it exists var data = options.data; delete optio...
javascript
function send(url, method, options, resourceName) { var deferred = $q.defer(); var key, val, paramArray = []; url = config.apiBase + url; options = options || {}; // separate out data if it exists var data = options.data; delete optio...
[ "function", "send", "(", "url", ",", "method", ",", "options", ",", "resourceName", ")", "{", "var", "deferred", "=", "$q", ".", "defer", "(", ")", ";", "var", "key", ",", "val", ",", "paramArray", "=", "[", "]", ";", "url", "=", "config", ".", "...
Send call to the server and get a response @param url @param method @param options @param resourceName
[ "Send", "call", "to", "the", "server", "and", "get", "a", "response" ]
9589b7ba09619843e271293088005c62ed23f355
https://github.com/gethuman/pancakes-angular/blob/9589b7ba09619843e271293088005c62ed23f355/lib/ngapp/ajax.js#L85-L195
49,114
nyteshade/ne-types
dist/types.js
extendsFrom
function extendsFrom(TestedClass, RootClass, enforceClasses = false) { if (!TestedClass || !RootClass) { return false; } if (TestedClass === RootClass) { return true; } TestedClass = TestedClass.constructor && typeof TestedClass !== 'function' ? TestedClass.constructor : TestedClass; RootClass = ...
javascript
function extendsFrom(TestedClass, RootClass, enforceClasses = false) { if (!TestedClass || !RootClass) { return false; } if (TestedClass === RootClass) { return true; } TestedClass = TestedClass.constructor && typeof TestedClass !== 'function' ? TestedClass.constructor : TestedClass; RootClass = ...
[ "function", "extendsFrom", "(", "TestedClass", ",", "RootClass", ",", "enforceClasses", "=", "false", ")", "{", "if", "(", "!", "TestedClass", "||", "!", "RootClass", ")", "{", "return", "false", ";", "}", "if", "(", "TestedClass", "===", "RootClass", ")",...
NOTE This function will not work on nodejs versions less than 6 as Reflect is needed natively. The instanceof keyword only works on instances of an object and not on the class objects the instances are created from. ```js class A {} class B extends A {} let a = new A(); let b = new B(); b instanceof A; // true a in...
[ "NOTE", "This", "function", "will", "not", "work", "on", "nodejs", "versions", "less", "than", "6", "as", "Reflect", "is", "needed", "natively", "." ]
46656c6b53e9b773e85dd7c24e6814d4717305ec
https://github.com/nyteshade/ne-types/blob/46656c6b53e9b773e85dd7c24e6814d4717305ec/dist/types.js#L324-L373
49,115
PanthR/panthrMath
panthrMath/distributions/geom.js
rgeom
function rgeom(prob) { var scale; if (prob <= 0 || prob > 1) { return function() { return NaN; }; } scale = prob / (1 - prob); return function() { return rpois(rexp(scale)())(); }; }
javascript
function rgeom(prob) { var scale; if (prob <= 0 || prob > 1) { return function() { return NaN; }; } scale = prob / (1 - prob); return function() { return rpois(rexp(scale)())(); }; }
[ "function", "rgeom", "(", "prob", ")", "{", "var", "scale", ";", "if", "(", "prob", "<=", "0", "||", "prob", ">", "1", ")", "{", "return", "function", "(", ")", "{", "return", "NaN", ";", "}", ";", "}", "scale", "=", "prob", "/", "(", "1", "-...
Returns a random variate from the geometric distribution. Expects the probability parameter $0 < p \leq 1$. Following R's code (rgeom.c) @fullName rgeom(prob)() @memberof geometric
[ "Returns", "a", "random", "variate", "from", "the", "geometric", "distribution", "." ]
54d249ca9903a9535f963da711bd3a87fb229c0b
https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/distributions/geom.js#L173-L183
49,116
Nazariglez/perenquen
lib/pixi/src/core/graphics/webgl/GraphicsRenderer.js
GraphicsRenderer
function GraphicsRenderer(renderer) { ObjectRenderer.call(this, renderer); this.graphicsDataPool = []; this.primitiveShader = null; this.complexPrimitiveShader = null; }
javascript
function GraphicsRenderer(renderer) { ObjectRenderer.call(this, renderer); this.graphicsDataPool = []; this.primitiveShader = null; this.complexPrimitiveShader = null; }
[ "function", "GraphicsRenderer", "(", "renderer", ")", "{", "ObjectRenderer", ".", "call", "(", "this", ",", "renderer", ")", ";", "this", ".", "graphicsDataPool", "=", "[", "]", ";", "this", ".", "primitiveShader", "=", "null", ";", "this", ".", "complexPr...
Renders the graphics object. @class @private @memberof PIXI @extends ObjectRenderer @param renderer {WebGLRenderer} The renderer this object renderer works for.
[ "Renders", "the", "graphics", "object", "." ]
e023964d05afeefebdcac4e2044819fdfa3899ae
https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/core/graphics/webgl/GraphicsRenderer.js#L17-L25
49,117
tolokoban/ToloFrameWork
ker/mod/tfw.view.js
ensureCodeBehind
function ensureCodeBehind(code_behind) { if (typeof code_behind === 'undefined') throw "Missing mandatory global variable CODE_BEHIND!"; var i, funcName; for (i = 1; i < arguments.length; i++) { funcName = arguments[i]; if (typeof code_behind[funcName] !== 'function') th...
javascript
function ensureCodeBehind(code_behind) { if (typeof code_behind === 'undefined') throw "Missing mandatory global variable CODE_BEHIND!"; var i, funcName; for (i = 1; i < arguments.length; i++) { funcName = arguments[i]; if (typeof code_behind[funcName] !== 'function') th...
[ "function", "ensureCodeBehind", "(", "code_behind", ")", "{", "if", "(", "typeof", "code_behind", "===", "'undefined'", ")", "throw", "\"Missing mandatory global variable CODE_BEHIND!\"", ";", "var", "i", ",", "funcName", ";", "for", "(", "i", "=", "1", ";", "i"...
Check if all needed function from code behind are defined.
[ "Check", "if", "all", "needed", "function", "from", "code", "behind", "are", "defined", "." ]
730845a833a9660ebfdb60ad027ebaab5ac871b6
https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.view.js#L191-L201
49,118
tolokoban/ToloFrameWork
ker/mod/tfw.view.js
defVal
function defVal(target, args, defaultValues) { var key, val; for (key in defaultValues) { val = defaultValues[key]; if (typeof args[key] === 'undefined') { target[key] = val; } else { target[key] = args[key]; } } }
javascript
function defVal(target, args, defaultValues) { var key, val; for (key in defaultValues) { val = defaultValues[key]; if (typeof args[key] === 'undefined') { target[key] = val; } else { target[key] = args[key]; } } }
[ "function", "defVal", "(", "target", ",", "args", ",", "defaultValues", ")", "{", "var", "key", ",", "val", ";", "for", "(", "key", "in", "defaultValues", ")", "{", "val", "=", "defaultValues", "[", "key", "]", ";", "if", "(", "typeof", "args", "[", ...
Assign default values.
[ "Assign", "default", "values", "." ]
730845a833a9660ebfdb60ad027ebaab5ac871b6
https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.view.js#L259-L269
49,119
FinalDevStudio/fi-auth
lib/index.js
generate
function generate(allows) { return function (req, res, next) { req.route.allows = allows; next(); }; }
javascript
function generate(allows) { return function (req, res, next) { req.route.allows = allows; next(); }; }
[ "function", "generate", "(", "allows", ")", "{", "return", "function", "(", "req", ",", "res", ",", "next", ")", "{", "req", ".", "route", ".", "allows", "=", "allows", ";", "next", "(", ")", ";", "}", ";", "}" ]
Generates the Express middleware to associate the allowed values to the route.
[ "Generates", "the", "Express", "middleware", "to", "associate", "the", "allowed", "values", "to", "the", "route", "." ]
0067e31af94b6f4c5cf0d6a630f37d710034faff
https://github.com/FinalDevStudio/fi-auth/blob/0067e31af94b6f4c5cf0d6a630f37d710034faff/lib/index.js#L81-L86
49,120
reptilbud/hapi-swagger
lib/index.js
function (plugin, settings) { plugin.ext('onPostHandler', (request, reply) => { let response = request.response; // if the reply is a view add settings data into template system if (response.variety === 'view') { // Added to fix bug that cannot yet be reproduced in test - REVI...
javascript
function (plugin, settings) { plugin.ext('onPostHandler', (request, reply) => { let response = request.response; // if the reply is a view add settings data into template system if (response.variety === 'view') { // Added to fix bug that cannot yet be reproduced in test - REVI...
[ "function", "(", "plugin", ",", "settings", ")", "{", "plugin", ".", "ext", "(", "'onPostHandler'", ",", "(", "request", ",", "reply", ")", "=>", "{", "let", "response", "=", "request", ".", "response", ";", "// if the reply is a view add settings data into temp...
appends settings data in template context @param {Object} plugin @param {Object} settings @return {Object}
[ "appends", "settings", "data", "in", "template", "context" ]
8a4a1059f060a7100270e837d2759c6a2b9c7e74
https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/lib/index.js#L253-L291
49,121
reptilbud/hapi-swagger
lib/index.js
function (url, qsName, qsValue) { let urlObj = Url.parse(url); if (qsName && qsValue) { urlObj.query = Querystring.parse(qsName + '=' + qsValue); urlObj.search = '?' + encodeURIComponent(qsName) + '=' + encodeURIComponent(qsValue); } else { urlObj.search = ''; } return urlOb...
javascript
function (url, qsName, qsValue) { let urlObj = Url.parse(url); if (qsName && qsValue) { urlObj.query = Querystring.parse(qsName + '=' + qsValue); urlObj.search = '?' + encodeURIComponent(qsName) + '=' + encodeURIComponent(qsValue); } else { urlObj.search = ''; } return urlOb...
[ "function", "(", "url", ",", "qsName", ",", "qsValue", ")", "{", "let", "urlObj", "=", "Url", ".", "parse", "(", "url", ")", ";", "if", "(", "qsName", "&&", "qsValue", ")", "{", "urlObj", ".", "query", "=", "Querystring", ".", "parse", "(", "qsName...
appends a querystring to a url path - will overwrite existings values @param {String} url @param {String} qsName @param {String} qsValue @return {String}
[ "appends", "a", "querystring", "to", "a", "url", "path", "-", "will", "overwrite", "existings", "values" ]
8a4a1059f060a7100270e837d2759c6a2b9c7e74
https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/lib/index.js#L302-L312
49,122
reptilbud/hapi-swagger
lib/index.js
function (settings) { let out = ''; if (settings.securityDefinitions) { Object.keys(settings.securityDefinitions).forEach((key) => { if (settings.securityDefinitions[key]['x-keyPrefix']) { out = settings.securityDefinitions[key]['x-keyPrefix']; } }); ...
javascript
function (settings) { let out = ''; if (settings.securityDefinitions) { Object.keys(settings.securityDefinitions).forEach((key) => { if (settings.securityDefinitions[key]['x-keyPrefix']) { out = settings.securityDefinitions[key]['x-keyPrefix']; } }); ...
[ "function", "(", "settings", ")", "{", "let", "out", "=", "''", ";", "if", "(", "settings", ".", "securityDefinitions", ")", "{", "Object", ".", "keys", "(", "settings", ".", "securityDefinitions", ")", ".", "forEach", "(", "(", "key", ")", "=>", "{", ...
finds any keyPrefix in securityDefinitions - also add x- to name @param {Object} settings @return {String}
[ "finds", "any", "keyPrefix", "in", "securityDefinitions", "-", "also", "add", "x", "-", "to", "name" ]
8a4a1059f060a7100270e837d2759c6a2b9c7e74
https://github.com/reptilbud/hapi-swagger/blob/8a4a1059f060a7100270e837d2759c6a2b9c7e74/lib/index.js#L321-L333
49,123
sendanor/nor-nopg
src/ResourceView.js
render_path
function render_path(path, params) { params = params || {}; return ARRAY( is.array(path) ? path : [path] ).map(function(p) { return p.replace(/:([a-z0-9A-Z\_]+)/g, function(match, key) { if(params[key] === undefined) { return ':'+key; } return ''+fix_object_ids(params[key]); }); }).valueOf(); }
javascript
function render_path(path, params) { params = params || {}; return ARRAY( is.array(path) ? path : [path] ).map(function(p) { return p.replace(/:([a-z0-9A-Z\_]+)/g, function(match, key) { if(params[key] === undefined) { return ':'+key; } return ''+fix_object_ids(params[key]); }); }).valueOf(); }
[ "function", "render_path", "(", "path", ",", "params", ")", "{", "params", "=", "params", "||", "{", "}", ";", "return", "ARRAY", "(", "is", ".", "array", "(", "path", ")", "?", "path", ":", "[", "path", "]", ")", ".", "map", "(", "function", "("...
Render `path` with optional `params`
[ "Render", "path", "with", "optional", "params" ]
0d99b86c1a1996b5828b56de8de23700df8bbc0c
https://github.com/sendanor/nor-nopg/blob/0d99b86c1a1996b5828b56de8de23700df8bbc0c/src/ResourceView.js#L42-L52
49,124
sendanor/nor-nopg
src/ResourceView.js
ResourceView
function ResourceView(opts) { var view = this; var compute_keys; if(opts && opts.compute_keys) { compute_keys = opts.compute_keys; } var element_keys; if(opts && opts.element_keys) { element_keys = opts.element_keys; } var collection_keys; if(opts && opts.collection_keys) { collection_keys = opts.coll...
javascript
function ResourceView(opts) { var view = this; var compute_keys; if(opts && opts.compute_keys) { compute_keys = opts.compute_keys; } var element_keys; if(opts && opts.element_keys) { element_keys = opts.element_keys; } var collection_keys; if(opts && opts.collection_keys) { collection_keys = opts.coll...
[ "function", "ResourceView", "(", "opts", ")", "{", "var", "view", "=", "this", ";", "var", "compute_keys", ";", "if", "(", "opts", "&&", "opts", ".", "compute_keys", ")", "{", "compute_keys", "=", "opts", ".", "compute_keys", ";", "}", "var", "element_ke...
Builds a builder for REST data views
[ "Builds", "a", "builder", "for", "REST", "data", "views" ]
0d99b86c1a1996b5828b56de8de23700df8bbc0c
https://github.com/sendanor/nor-nopg/blob/0d99b86c1a1996b5828b56de8de23700df8bbc0c/src/ResourceView.js#L55-L116
49,125
thelonious/kld-array-iterators
examples/flatten.js
flatten
function flatten(list) { return list.reduce(function (acc, item) { if (Array.isArray(item)) { return acc.concat(flatten(item)); } else { return acc.concat(item); } }, []); }
javascript
function flatten(list) { return list.reduce(function (acc, item) { if (Array.isArray(item)) { return acc.concat(flatten(item)); } else { return acc.concat(item); } }, []); }
[ "function", "flatten", "(", "list", ")", "{", "return", "list", ".", "reduce", "(", "function", "(", "acc", ",", "item", ")", "{", "if", "(", "Array", ".", "isArray", "(", "item", ")", ")", "{", "return", "acc", ".", "concat", "(", "flatten", "(", ...
export utility to flatten nested arrays
[ "export", "utility", "to", "flatten", "nested", "arrays" ]
20fa2ae9ce5f72d9e0b09945365cf44052057dc2
https://github.com/thelonious/kld-array-iterators/blob/20fa2ae9ce5f72d9e0b09945365cf44052057dc2/examples/flatten.js#L3-L12
49,126
aleclarson/testpass
src/context.js
getFile
function getFile(group) { while (group) { if (group.file) return group.file group = group.parent } }
javascript
function getFile(group) { while (group) { if (group.file) return group.file group = group.parent } }
[ "function", "getFile", "(", "group", ")", "{", "while", "(", "group", ")", "{", "if", "(", "group", ".", "file", ")", "return", "group", ".", "file", "group", "=", "group", ".", "parent", "}", "}" ]
Find which file the given group is in.
[ "Find", "which", "file", "the", "given", "group", "is", "in", "." ]
023f4d1a9ea525fd3abd3b456e9b604037282326
https://github.com/aleclarson/testpass/blob/023f4d1a9ea525fd3abd3b456e9b604037282326/src/context.js#L43-L48
49,127
aleclarson/testpass
src/context.js
getContext
function getContext(i) { if (context) { return context } else { const path = getCallsite(i || 2).getFileName() const file = files[path] if (file) return file.group throw Error(`Test module was not loaded properly: "${path}"`) } }
javascript
function getContext(i) { if (context) { return context } else { const path = getCallsite(i || 2).getFileName() const file = files[path] if (file) return file.group throw Error(`Test module was not loaded properly: "${path}"`) } }
[ "function", "getContext", "(", "i", ")", "{", "if", "(", "context", ")", "{", "return", "context", "}", "else", "{", "const", "path", "=", "getCallsite", "(", "i", "||", "2", ")", ".", "getFileName", "(", ")", "const", "file", "=", "files", "[", "p...
Create a file if no context exists.
[ "Create", "a", "file", "if", "no", "context", "exists", "." ]
023f4d1a9ea525fd3abd3b456e9b604037282326
https://github.com/aleclarson/testpass/blob/023f4d1a9ea525fd3abd3b456e9b604037282326/src/context.js#L56-L65
49,128
humanise-ai/botmaster-humanise-ware
lib/makeHumaniseWare.js
makeHumaniseWare
function makeHumaniseWare ({ apiKey, incomingWebhookUrl, logger, getHandoffFromUpdate }) { if (!apiKey || !incomingWebhookUrl) { throw new Error('botmaster-humanise-ware requires at least both of apiKey and incomingWebhookUrl parameters to be defined') } const HUMANISE_URL = incomingWebhookUrl if (!...
javascript
function makeHumaniseWare ({ apiKey, incomingWebhookUrl, logger, getHandoffFromUpdate }) { if (!apiKey || !incomingWebhookUrl) { throw new Error('botmaster-humanise-ware requires at least both of apiKey and incomingWebhookUrl parameters to be defined') } const HUMANISE_URL = incomingWebhookUrl if (!...
[ "function", "makeHumaniseWare", "(", "{", "apiKey", ",", "incomingWebhookUrl", ",", "logger", ",", "getHandoffFromUpdate", "}", ")", "{", "if", "(", "!", "apiKey", "||", "!", "incomingWebhookUrl", ")", "{", "throw", "new", "Error", "(", "'botmaster-humanise-ware...
Make botmaster middleware @param {$0.apiKey} ApiKey Humanise.AI API Key @param {$0.incomingWebhookUrl} incomingWebhookUrl Humanise.AI full webhook url that identifies your channel. It ends with your Webhook Id to humanise should go to. This package will then make calls to: https://alpha.humanise.ai/webhooks/{WebhookId}...
[ "Make", "botmaster", "middleware" ]
a94af55ace6a4c90f7f795d84d08ac7f2a920f82
https://github.com/humanise-ai/botmaster-humanise-ware/blob/a94af55ace6a4c90f7f795d84d08ac7f2a920f82/lib/makeHumaniseWare.js#L15-L136
49,129
ryanlabouve/ember-cli-randoport
lib/randoport.js
checkPort
function checkPort(basePort, callback){ return deasync(function(basePort, callback) { portfinder.basePort = basePort; portfinder.getPort(function (err, port) { callback(null, port); }); })(basePort); }
javascript
function checkPort(basePort, callback){ return deasync(function(basePort, callback) { portfinder.basePort = basePort; portfinder.getPort(function (err, port) { callback(null, port); }); })(basePort); }
[ "function", "checkPort", "(", "basePort", ",", "callback", ")", "{", "return", "deasync", "(", "function", "(", "basePort", ",", "callback", ")", "{", "portfinder", ".", "basePort", "=", "basePort", ";", "portfinder", ".", "getPort", "(", "function", "(", ...
Returns the next open port @method checkPort @param {Number} port to start checking from @return {Number} closest open port to one provided
[ "Returns", "the", "next", "open", "port" ]
628b3a5fefab6e9228b517648aa1bae2989bd54c
https://github.com/ryanlabouve/ember-cli-randoport/blob/628b3a5fefab6e9228b517648aa1bae2989bd54c/lib/randoport.js#L13-L20
49,130
ryanlabouve/ember-cli-randoport
lib/randoport.js
inBlackList
function inBlackList(port, additionalPorts) { const blacklist = [4200].concat(additionalPorts || []); return blacklist.indexOf(port) === -1 ? false : true; }
javascript
function inBlackList(port, additionalPorts) { const blacklist = [4200].concat(additionalPorts || []); return blacklist.indexOf(port) === -1 ? false : true; }
[ "function", "inBlackList", "(", "port", ",", "additionalPorts", ")", "{", "const", "blacklist", "=", "[", "4200", "]", ".", "concat", "(", "additionalPorts", "||", "[", "]", ")", ";", "return", "blacklist", ".", "indexOf", "(", "port", ")", "===", "-", ...
Checks if port is in blacklist @method inBlackList @param {Number} port we are checking @return {Number} additional array of blocked ports
[ "Checks", "if", "port", "is", "in", "blacklist" ]
628b3a5fefab6e9228b517648aa1bae2989bd54c
https://github.com/ryanlabouve/ember-cli-randoport/blob/628b3a5fefab6e9228b517648aa1bae2989bd54c/lib/randoport.js#L28-L31
49,131
blixt/js-starbound-files
lib/btreedb.js
Index
function Index(keySize, block) { var reader = new SbonReader(block.buffer); this.level = reader.readUint8(); // Number of keys in this index. this.keyCount = reader.readInt32(); // The blocks that the keys point to. There will be one extra block in the // beginning of this list that points to the block t...
javascript
function Index(keySize, block) { var reader = new SbonReader(block.buffer); this.level = reader.readUint8(); // Number of keys in this index. this.keyCount = reader.readInt32(); // The blocks that the keys point to. There will be one extra block in the // beginning of this list that points to the block t...
[ "function", "Index", "(", "keySize", ",", "block", ")", "{", "var", "reader", "=", "new", "SbonReader", "(", "block", ".", "buffer", ")", ";", "this", ".", "level", "=", "reader", ".", "readUint8", "(", ")", ";", "// Number of keys in this index.", "this",...
Wraps a block object to provide functionality for parsing and scanning an index.
[ "Wraps", "a", "block", "object", "to", "provide", "functionality", "for", "parsing", "and", "scanning", "an", "index", "." ]
f20f18e4caee87f940b3d9cbe92cacccee3f8d17
https://github.com/blixt/js-starbound-files/blob/f20f18e4caee87f940b3d9cbe92cacccee3f8d17/lib/btreedb.js#L107-L128
49,132
BartoszPiwek/FrontBox-Grunt
tasks/autoclass.js
function(className, array) { var len = array.length; for (var i = 0; i < len; i++) { if (array[i].indexOf(className) > -1) { return i; } } return -1; }
javascript
function(className, array) { var len = array.length; for (var i = 0; i < len; i++) { if (array[i].indexOf(className) > -1) { return i; } } return -1; }
[ "function", "(", "className", ",", "array", ")", "{", "var", "len", "=", "array", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "array", "[", "i", "]", ".", "indexOf", "(", ...
Return number of usage array
[ "Return", "number", "of", "usage", "array" ]
2943638c3ac55b0c6b372bf8238c037858be6d4b
https://github.com/BartoszPiwek/FrontBox-Grunt/blob/2943638c3ac55b0c6b372bf8238c037858be6d4b/tasks/autoclass.js#L49-L57
49,133
BartoszPiwek/FrontBox-Grunt
tasks/autoclass.js
function(className) { for (var i = 0; i < databaseLen; i++) { if (database["field" + i].regExp.test(className)) { return i; } } return -1; }
javascript
function(className) { for (var i = 0; i < databaseLen; i++) { if (database["field" + i].regExp.test(className)) { return i; } } return -1; }
[ "function", "(", "className", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "databaseLen", ";", "i", "++", ")", "{", "if", "(", "database", "[", "\"field\"", "+", "i", "]", ".", "regExp", ".", "test", "(", "className", ")", ")", "{...
Return database type number
[ "Return", "database", "type", "number" ]
2943638c3ac55b0c6b372bf8238c037858be6d4b
https://github.com/BartoszPiwek/FrontBox-Grunt/blob/2943638c3ac55b0c6b372bf8238c037858be6d4b/tasks/autoclass.js#L79-L86
49,134
BartoszPiwek/FrontBox-Grunt
tasks/autoclass.js
function(array) { // Run Functions regLoop(); // Functions var addOutputValue = function(objectField, value, property, addon) { var index = objectField.unit.indexOf(property), indexInDatabase, unit; if (addon === "responsive") { indexInDatabase = ...
javascript
function(array) { // Run Functions regLoop(); // Functions var addOutputValue = function(objectField, value, property, addon) { var index = objectField.unit.indexOf(property), indexInDatabase, unit; if (addon === "responsive") { indexInDatabase = ...
[ "function", "(", "array", ")", "{", "// Run Functions", "regLoop", "(", ")", ";", "// Functions", "var", "addOutputValue", "=", "function", "(", "objectField", ",", "value", ",", "property", ",", "addon", ")", "{", "var", "index", "=", "objectField", ".", ...
Return full array with class
[ "Return", "full", "array", "with", "class" ]
2943638c3ac55b0c6b372bf8238c037858be6d4b
https://github.com/BartoszPiwek/FrontBox-Grunt/blob/2943638c3ac55b0c6b372bf8238c037858be6d4b/tasks/autoclass.js#L89-L191
49,135
pzlr/build-core
lib/resolve.js
entry
function entry(name = '') { return path.normalize(path.join(sourceDir, config.entriesDir, name ? `${name}.js` : '')); }
javascript
function entry(name = '') { return path.normalize(path.join(sourceDir, config.entriesDir, name ? `${name}.js` : '')); }
[ "function", "entry", "(", "name", "=", "''", ")", "{", "return", "path", ".", "normalize", "(", "path", ".", "join", "(", "sourceDir", ",", "config", ".", "entriesDir", ",", "name", "?", "`", "${", "name", "}", "`", ":", "''", ")", ")", ";", "}" ...
Returns an absolute path to an entry by the specified name @param {string=} [name] - entry name (if empty, returns path to the entries folder)
[ "Returns", "an", "absolute", "path", "to", "an", "entry", "by", "the", "specified", "name" ]
11e20eda500682b9fa62c7804c66be1714df0df4
https://github.com/pzlr/build-core/blob/11e20eda500682b9fa62c7804c66be1714df0df4/lib/resolve.js#L254-L256
49,136
alexpods/InjectorJS
dist/InjectorJS.js
function(name, factory, object) { var that = this; var objects = this._resolveObjects(name, factory, object); _.each(objects, function(factoryObjects, factory) { _.each(factoryObjects, function(object, name) { ...
javascript
function(name, factory, object) { var that = this; var objects = this._resolveObjects(name, factory, object); _.each(objects, function(factoryObjects, factory) { _.each(factoryObjects, function(object, name) { ...
[ "function", "(", "name", ",", "factory", ",", "object", ")", "{", "var", "that", "=", "this", ";", "var", "objects", "=", "this", ".", "_resolveObjects", "(", "name", ",", "factory", ",", "object", ")", ";", "_", ".", "each", "(", "objects", ",", "...
Sets new object to the container @param {string|object} name Object name or hash of the objects @param {string} factory Factory name @param {*} object Object or its factory method @returns {Injector} this @this {Injector}
[ "Sets", "new", "object", "to", "the", "container" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L124-L136
49,137
alexpods/InjectorJS
dist/InjectorJS.js
function(name) { this._checkObject(name); if (!this._hasObject([name])) { this._setObject([name], this._getObjectCreator([name]).call())._removeObjectCreator([name]); } return this._getObject([na...
javascript
function(name) { this._checkObject(name); if (!this._hasObject([name])) { this._setObject([name], this._getObjectCreator([name]).call())._removeObjectCreator([name]); } return this._getObject([na...
[ "function", "(", "name", ")", "{", "this", ".", "_checkObject", "(", "name", ")", ";", "if", "(", "!", "this", ".", "_hasObject", "(", "[", "name", "]", ")", ")", "{", "this", ".", "_setObject", "(", "[", "name", "]", ",", "this", ".", "_getObjec...
Gets specified object @param {string} name Object name @returns {*} Specified object @throws {Error} if specified object does not exist @this {Injector}
[ "Gets", "specified", "object" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L160-L167
49,138
alexpods/InjectorJS
dist/InjectorJS.js
function(name) { this._checkObject(name); return (this._hasObject([name]) && this._removeObject([name])) || (this._hasObjectCreator([name]) && this._removeObjectCreator([name])); }
javascript
function(name) { this._checkObject(name); return (this._hasObject([name]) && this._removeObject([name])) || (this._hasObjectCreator([name]) && this._removeObjectCreator([name])); }
[ "function", "(", "name", ")", "{", "this", ".", "_checkObject", "(", "name", ")", ";", "return", "(", "this", ".", "_hasObject", "(", "[", "name", "]", ")", "&&", "this", ".", "_removeObject", "(", "[", "name", "]", ")", ")", "||", "(", "this", "...
Removes specified object @param {string} name Object name @returns {Injector} this @throws {Error} if specified object does not exist @this {Injector}
[ "Removes", "specified", "object" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L179-L183
49,139
alexpods/InjectorJS
dist/InjectorJS.js
function(name, factory) { if (_.isUndefined(factory)) { factory = name; name = undefined; } if (factory && factory.__clazz && factory.__clazz.__isSubclazzOf('/InjectorJS/Factories/Abstract'))...
javascript
function(name, factory) { if (_.isUndefined(factory)) { factory = name; name = undefined; } if (factory && factory.__clazz && factory.__clazz.__isSubclazzOf('/InjectorJS/Factories/Abstract'))...
[ "function", "(", "name", ",", "factory", ")", "{", "if", "(", "_", ".", "isUndefined", "(", "factory", ")", ")", "{", "factory", "=", "name", ";", "name", "=", "undefined", ";", "}", "if", "(", "factory", "&&", "factory", ".", "__clazz", "&&", "fac...
Sets object factory @param {string,Factory} name Factory name of factory instance @param {function|Factory} factory Object factory @returns {Injector} this @this {Injector}
[ "Sets", "object", "factory" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L194-L207
49,140
alexpods/InjectorJS
dist/InjectorJS.js
function(factory) { var factoryName = _.isString(factory) ? factory : factory.getName(); return this.__hasPropertyValue(['factory', factoryName]); }
javascript
function(factory) { var factoryName = _.isString(factory) ? factory : factory.getName(); return this.__hasPropertyValue(['factory', factoryName]); }
[ "function", "(", "factory", ")", "{", "var", "factoryName", "=", "_", ".", "isString", "(", "factory", ")", "?", "factory", ":", "factory", ".", "getName", "(", ")", ";", "return", "this", ".", "__hasPropertyValue", "(", "[", "'factory'", ",", "factoryNa...
Checks whether specified factory exist @param {string|Factory} factory Object factory or its name @returns {boolean} true if object factory exist @this {Injector}
[ "Checks", "whether", "specified", "factory", "exist" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L217-L220
49,141
alexpods/InjectorJS
dist/InjectorJS.js
function(name, factory, object) { var that = this; var objects = {}; var defaultFactory = this.getDefaultFactory().getName(); if (_.isObject(name)) { objects = name; } el...
javascript
function(name, factory, object) { var that = this; var objects = {}; var defaultFactory = this.getDefaultFactory().getName(); if (_.isObject(name)) { objects = name; } el...
[ "function", "(", "name", ",", "factory", ",", "object", ")", "{", "var", "that", "=", "this", ";", "var", "objects", "=", "{", "}", ";", "var", "defaultFactory", "=", "this", ".", "getDefaultFactory", "(", ")", ".", "getName", "(", ")", ";", "if", ...
Resolves specified objects @see set() method @param {string|object} name Object name or hash of the objects @param {string} factory Factory name @param {*} object Object or its factory method @returns {object} Resolved objects @this {Injector} @private
[ "Resolves", "specified", "objects" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L265-L299
49,142
alexpods/InjectorJS
dist/InjectorJS.js
function(factoryName, object) { if (_.isUndefined(object)) { object = factoryName; factoryName = undefined; } var that = this; return function() { ...
javascript
function(factoryName, object) { if (_.isUndefined(object)) { object = factoryName; factoryName = undefined; } var that = this; return function() { ...
[ "function", "(", "factoryName", ",", "object", ")", "{", "if", "(", "_", ".", "isUndefined", "(", "object", ")", ")", "{", "object", "=", "factoryName", ";", "factoryName", "=", "undefined", ";", "}", "var", "that", "=", "this", ";", "return", "functio...
Creates object creator @param {string} factoryName Factory name @param {*|factory} object Object or its factory function @returns {Function} Object creator @this {Injector} @private
[ "Creates", "object", "creator" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L311-L327
49,143
alexpods/InjectorJS
dist/InjectorJS.js
function(value, metaData, name, object) { name = name || 'unknown'; object = object || this; var that = this; var processors = this.getProcessor(); _.each(metaData, function(data, option) { ...
javascript
function(value, metaData, name, object) { name = name || 'unknown'; object = object || this; var that = this; var processors = this.getProcessor(); _.each(metaData, function(data, option) { ...
[ "function", "(", "value", ",", "metaData", ",", "name", ",", "object", ")", "{", "name", "=", "name", "||", "'unknown'", ";", "object", "=", "object", "||", "this", ";", "var", "that", "=", "this", ";", "var", "processors", "=", "this", ".", "getProc...
Process parameter value @param {*} value Parameter value @param {object} metaData Meta data for parameter @param {string} name Parameter name @param {object} object Object of specified parameter @returns {*} Processed parameter value @this {ParameterProcessor}
[ "Process", "parameter", "value" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L385-L402
49,144
alexpods/InjectorJS
dist/InjectorJS.js
function(params) { var that = this; var paramsDefinition = this.getParamsDefinition(); var parameterProcessor = this.getParameterProcessor(); _.each(params, function(value, param) { ...
javascript
function(params) { var that = this; var paramsDefinition = this.getParamsDefinition(); var parameterProcessor = this.getParameterProcessor(); _.each(params, function(value, param) { ...
[ "function", "(", "params", ")", "{", "var", "that", "=", "this", ";", "var", "paramsDefinition", "=", "this", ".", "getParamsDefinition", "(", ")", ";", "var", "parameterProcessor", "=", "this", ".", "getParameterProcessor", "(", ")", ";", "_", ".", "each"...
Process parameters for object creation @param {object} params Raw object parameters for object creation @returns {object} Processed object parameters @this {AbstractFactory}
[ "Process", "parameters", "for", "object", "creation" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L495-L509
49,145
alexpods/InjectorJS
dist/InjectorJS.js
function(params) { var clazz = this.getClazz(); return clazz(params.name, params.parent, params.deps) }
javascript
function(params) { var clazz = this.getClazz(); return clazz(params.name, params.parent, params.deps) }
[ "function", "(", "params", ")", "{", "var", "clazz", "=", "this", ".", "getClazz", "(", ")", ";", "return", "clazz", "(", "params", ".", "name", ",", "params", ".", "parent", ",", "params", ".", "deps", ")", "}" ]
Creates clazz using specified processed parameters @param {object} params Parameters for clazz creation @returns {*} Created clazz @this {ClazzFactory}
[ "Creates", "clazz", "using", "specified", "processed", "parameters" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L578-L581
49,146
alexpods/InjectorJS
dist/InjectorJS.js
function(params) { // Create '_createService' function for this purpose for parameters applying to clazz constructor. var service = this._createService(params.class, params.init); _.each(params.call, function(params, method) { ...
javascript
function(params) { // Create '_createService' function for this purpose for parameters applying to clazz constructor. var service = this._createService(params.class, params.init); _.each(params.call, function(params, method) { ...
[ "function", "(", "params", ")", "{", "// Create '_createService' function for this purpose for parameters applying to clazz constructor.", "var", "service", "=", "this", ".", "_createService", "(", "params", ".", "class", ",", "params", ".", "init", ")", ";", "_", ".", ...
Creates object using specified processed parameters @param {object} params Parameters for object creation @returns {*} Created object @this {ServiceFactory}
[ "Creates", "object", "using", "specified", "processed", "parameters" ]
e808ed504768a7b65b5a3710bd028502ebdedaf0
https://github.com/alexpods/InjectorJS/blob/e808ed504768a7b65b5a3710bd028502ebdedaf0/dist/InjectorJS.js#L677-L687
49,147
Everyplay/backbone-db-indexing-adapter
lib/indexing_db_local.js
function(collection, options, cb) { this.store().setItem( options.indexKey, JSON.stringify([]), function(err, res) { cb(err, [], res); } ); }
javascript
function(collection, options, cb) { this.store().setItem( options.indexKey, JSON.stringify([]), function(err, res) { cb(err, [], res); } ); }
[ "function", "(", "collection", ",", "options", ",", "cb", ")", "{", "this", ".", "store", "(", ")", ".", "setItem", "(", "options", ".", "indexKey", ",", "JSON", ".", "stringify", "(", "[", "]", ")", ",", "function", "(", "err", ",", "res", ")", ...
removes everything from index
[ "removes", "everything", "from", "index" ]
9e6e51dd918f4c2e71ef1d478fa9bc7e4eae3112
https://github.com/Everyplay/backbone-db-indexing-adapter/blob/9e6e51dd918f4c2e71ef1d478fa9bc7e4eae3112/lib/indexing_db_local.js#L131-L139
49,148
Everyplay/backbone-db-indexing-adapter
lib/indexing_db_local.js
function(collection, options, cb) { var ids = []; var keys = _.isFunction(collection.url) ? collection.url() : collection.url; keys += options.keys; debug('findKeys', keys); this.store().getItem(keys, function(err, data) { if (data) ids.push(keys); cb(null, ids); }); }
javascript
function(collection, options, cb) { var ids = []; var keys = _.isFunction(collection.url) ? collection.url() : collection.url; keys += options.keys; debug('findKeys', keys); this.store().getItem(keys, function(err, data) { if (data) ids.push(keys); cb(null, ids); }); }
[ "function", "(", "collection", ",", "options", ",", "cb", ")", "{", "var", "ids", "=", "[", "]", ";", "var", "keys", "=", "_", ".", "isFunction", "(", "collection", ".", "url", ")", "?", "collection", ".", "url", "(", ")", ":", "collection", ".", ...
mock adapter only supports exact match
[ "mock", "adapter", "only", "supports", "exact", "match" ]
9e6e51dd918f4c2e71ef1d478fa9bc7e4eae3112
https://github.com/Everyplay/backbone-db-indexing-adapter/blob/9e6e51dd918f4c2e71ef1d478fa9bc7e4eae3112/lib/indexing_db_local.js#L156-L165
49,149
sbj42/maze-generator-core
src/Maze.js
Cell
function Cell(north, east, south, west) { this._north = north; this._east = east; this._south = south; this._west = west; }
javascript
function Cell(north, east, south, west) { this._north = north; this._east = east; this._south = south; this._west = west; }
[ "function", "Cell", "(", "north", ",", "east", ",", "south", ",", "west", ")", "{", "this", ".", "_north", "=", "north", ";", "this", ".", "_east", "=", "east", ";", "this", ".", "_south", "=", "south", ";", "this", ".", "_west", "=", "west", ";"...
A Cell is a wrapper object that makes it easier to ask for passage information by name. @constructor @private @param {integer} width @param {integer} height
[ "A", "Cell", "is", "a", "wrapper", "object", "that", "makes", "it", "easier", "to", "ask", "for", "passage", "information", "by", "name", "." ]
0ea4825344ca0e0292edaa77d7ea493ba1eaa1e9
https://github.com/sbj42/maze-generator-core/blob/0ea4825344ca0e0292edaa77d7ea493ba1eaa1e9/src/Maze.js#L12-L17
49,150
sbj42/maze-generator-core
src/Maze.js
Maze
function Maze(width, height) { if (width < 0 || height < 0) throw new Error('invalid size: ' + width + 'x' + height); this._width = width; this._height = height; this._blockWidth = ((width+1)+15) >> 4; this._grid = new Array(this._blockWidth * (height + 1)); for (var i = 0; i < this._blo...
javascript
function Maze(width, height) { if (width < 0 || height < 0) throw new Error('invalid size: ' + width + 'x' + height); this._width = width; this._height = height; this._blockWidth = ((width+1)+15) >> 4; this._grid = new Array(this._blockWidth * (height + 1)); for (var i = 0; i < this._blo...
[ "function", "Maze", "(", "width", ",", "height", ")", "{", "if", "(", "width", "<", "0", "||", "height", "<", "0", ")", "throw", "new", "Error", "(", "'invalid size: '", "+", "width", "+", "'x'", "+", "height", ")", ";", "this", ".", "_width", "=",...
A Maze is a rectangular grid of cells, where each cell may have passages in each of the cardinal directions. The maze is initialized with each cell having no passages. @constructor @param {integer} width @param {integer} height
[ "A", "Maze", "is", "a", "rectangular", "grid", "of", "cells", "where", "each", "cell", "may", "have", "passages", "in", "each", "of", "the", "cardinal", "directions", ".", "The", "maze", "is", "initialized", "with", "each", "cell", "having", "no", "passage...
0ea4825344ca0e0292edaa77d7ea493ba1eaa1e9
https://github.com/sbj42/maze-generator-core/blob/0ea4825344ca0e0292edaa77d7ea493ba1eaa1e9/src/Maze.js#L44-L53
49,151
feedhenry/fh-mbaas-middleware
lib/middleware/envMongoDb.js
dropEnvironmentDatabase
function dropEnvironmentDatabase(domain, env, next) { _getEnvironmentDatabase({ domain: domain, environment: env }, function (err, found) { if (err) { return next(common.buildErrorObject({ err: err, msg: 'Failed to get environment', httpCode: 500 })); } if (!f...
javascript
function dropEnvironmentDatabase(domain, env, next) { _getEnvironmentDatabase({ domain: domain, environment: env }, function (err, found) { if (err) { return next(common.buildErrorObject({ err: err, msg: 'Failed to get environment', httpCode: 500 })); } if (!f...
[ "function", "dropEnvironmentDatabase", "(", "domain", ",", "env", ",", "next", ")", "{", "_getEnvironmentDatabase", "(", "{", "domain", ":", "domain", ",", "environment", ":", "env", "}", ",", "function", "(", "err", ",", "found", ")", "{", "if", "(", "e...
DropEnvironmentDatabase removes the database for specific environment completely
[ "DropEnvironmentDatabase", "removes", "the", "database", "for", "specific", "environment", "completely" ]
f906e98efbb4b0963bf5137b34b5e0589ba24e69
https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/envMongoDb.js#L14-L42
49,152
feedhenry/fh-mbaas-middleware
lib/middleware/envMongoDb.js
getOrCreateEnvironmentDatabase
function getOrCreateEnvironmentDatabase(req, res, next){ var models = mbaas.getModels(); log.logger.debug('process getOrCreateEnvironmentDatabase request', req.originalUrl , req.body, req.method, req.params); var domain = req.params.domain; var env = req.params.environment; log.logger.debug('process db cre...
javascript
function getOrCreateEnvironmentDatabase(req, res, next){ var models = mbaas.getModels(); log.logger.debug('process getOrCreateEnvironmentDatabase request', req.originalUrl , req.body, req.method, req.params); var domain = req.params.domain; var env = req.params.environment; log.logger.debug('process db cre...
[ "function", "getOrCreateEnvironmentDatabase", "(", "req", ",", "res", ",", "next", ")", "{", "var", "models", "=", "mbaas", ".", "getModels", "(", ")", ";", "log", ".", "logger", ".", "debug", "(", "'process getOrCreateEnvironmentDatabase request'", ",", "req", ...
Function that will return a mongo @param req @param res @param next
[ "Function", "that", "will", "return", "a", "mongo" ]
f906e98efbb4b0963bf5137b34b5e0589ba24e69
https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/envMongoDb.js#L50-L111
49,153
feedhenry/fh-mbaas-middleware
lib/middleware/envMongoDb.js
getEnvironmentDatabase
function getEnvironmentDatabase(req, res, next){ log.logger.debug('process getEnvironmentDatabase request', req.originalUrl ); _getEnvironmentDatabase({ domain: req.params.domain, environment: req.params.environment }, function(err, envDb){ if(err){ log.logger.error('Failed to get mbaas instanc...
javascript
function getEnvironmentDatabase(req, res, next){ log.logger.debug('process getEnvironmentDatabase request', req.originalUrl ); _getEnvironmentDatabase({ domain: req.params.domain, environment: req.params.environment }, function(err, envDb){ if(err){ log.logger.error('Failed to get mbaas instanc...
[ "function", "getEnvironmentDatabase", "(", "req", ",", "res", ",", "next", ")", "{", "log", ".", "logger", ".", "debug", "(", "'process getEnvironmentDatabase request'", ",", "req", ".", "originalUrl", ")", ";", "_getEnvironmentDatabase", "(", "{", "domain", ":"...
Middleware To Get An Environment Database
[ "Middleware", "To", "Get", "An", "Environment", "Database" ]
f906e98efbb4b0963bf5137b34b5e0589ba24e69
https://github.com/feedhenry/fh-mbaas-middleware/blob/f906e98efbb4b0963bf5137b34b5e0589ba24e69/lib/middleware/envMongoDb.js#L120-L150
49,154
crishernandezmaps/liqen-scrapper
src/downloadArticle.js
getMedia
function getMedia (hostname) { const patterns = { abc: /abc\.es/, ara: /ara\.cat/, elconfidencial: /elconfidencial\.com/, eldiario: /eldiario\.es/, elespanol: /elespanol\.com/, elmundo: /elmundo\.es/, elpais: /elpais\.com/, elperiodico: /elperiodico\.com/, esdiario: /esdiario\.com/...
javascript
function getMedia (hostname) { const patterns = { abc: /abc\.es/, ara: /ara\.cat/, elconfidencial: /elconfidencial\.com/, eldiario: /eldiario\.es/, elespanol: /elespanol\.com/, elmundo: /elmundo\.es/, elpais: /elpais\.com/, elperiodico: /elperiodico\.com/, esdiario: /esdiario\.com/...
[ "function", "getMedia", "(", "hostname", ")", "{", "const", "patterns", "=", "{", "abc", ":", "/", "abc\\.es", "/", ",", "ara", ":", "/", "ara\\.cat", "/", ",", "elconfidencial", ":", "/", "elconfidencial\\.com", "/", ",", "eldiario", ":", "/", "eldiario...
A full article object @typedef {Object} Article @property {string} title - The title of the article @property {string} html - The content of the article in HTML @property {string} image - The heading image URI of the article @property {Date} publishedDate - The publishing date of the article...
[ "A", "full", "article", "object" ]
0462d25359ed13fc8321e85cb6a0d87abece7218
https://github.com/crishernandezmaps/liqen-scrapper/blob/0462d25359ed13fc8321e85cb6a0d87abece7218/src/downloadArticle.js#L20-L48
49,155
PanthR/panthrMath
panthrMath/basicFunc/gratio.js
delta
function delta(a) { return lgamma(a) - (a - 0.5) * Math.log(a) + a - 0.5 * Math.log(2 * Math.PI); }
javascript
function delta(a) { return lgamma(a) - (a - 0.5) * Math.log(a) + a - 0.5 * Math.log(2 * Math.PI); }
[ "function", "delta", "(", "a", ")", "{", "return", "lgamma", "(", "a", ")", "-", "(", "a", "-", "0.5", ")", "*", "Math", ".", "log", "(", "a", ")", "+", "a", "-", "0.5", "*", "Math", ".", "log", "(", "2", "*", "Math", ".", "PI", ")", ";",...
From equation 3
[ "From", "equation", "3" ]
54d249ca9903a9535f963da711bd3a87fb229c0b
https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/basicFunc/gratio.js#L156-L158
49,156
PanthR/panthrMath
panthrMath/basicFunc/gratio.js
findx0SmallA
function findx0SmallA(a, p, q) { var B, u, temp; B = q * gamma(a); if (B > 0.6 || B >= 0.45 && a >= 0.3) { // use 21 u = B * q > 1e-8 ? Math.pow(p * gamma(a + 1), 1 / a) : Math.exp(-q / a - eulerGamma); return u / (1 - u / (a + 1)); } i...
javascript
function findx0SmallA(a, p, q) { var B, u, temp; B = q * gamma(a); if (B > 0.6 || B >= 0.45 && a >= 0.3) { // use 21 u = B * q > 1e-8 ? Math.pow(p * gamma(a + 1), 1 / a) : Math.exp(-q / a - eulerGamma); return u / (1 - u / (a + 1)); } i...
[ "function", "findx0SmallA", "(", "a", ",", "p", ",", "q", ")", "{", "var", "B", ",", "u", ",", "temp", ";", "B", "=", "q", "*", "gamma", "(", "a", ")", ";", "if", "(", "B", ">", "0.6", "||", "B", ">=", "0.45", "&&", "a", ">=", "0.3", ")",...
Use formulas 21 through 25 from DiDonato to get initial estimate for x when a < 1.
[ "Use", "formulas", "21", "through", "25", "from", "DiDonato", "to", "get", "initial", "estimate", "for", "x", "when", "a", "<", "1", "." ]
54d249ca9903a9535f963da711bd3a87fb229c0b
https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/basicFunc/gratio.js#L395-L427
49,157
PanthR/panthrMath
panthrMath/basicFunc/gratio.js
f
function f(x, n) { return Math.exp((logpg + x - Math.log(series(snTerm(x), n + 1))) / a); }
javascript
function f(x, n) { return Math.exp((logpg + x - Math.log(series(snTerm(x), n + 1))) / a); }
[ "function", "f", "(", "x", ",", "n", ")", "{", "return", "Math", ".", "exp", "(", "(", "logpg", "+", "x", "-", "Math", ".", "log", "(", "series", "(", "snTerm", "(", "x", ")", ",", "n", "+", "1", ")", ")", ")", "/", "a", ")", ";", "}" ]
See formula 34, where `n` is off by 1
[ "See", "formula", "34", "where", "n", "is", "off", "by", "1" ]
54d249ca9903a9535f963da711bd3a87fb229c0b
https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/basicFunc/gratio.js#L469-L471
49,158
PanthR/panthrMath
panthrMath/basicFunc/gratio.js
step
function step(x, a, p, q) { var temp, w; temp = p <= 0.5 ? gratio(a)(x) - p : q - gratioc(a)(x); temp /= r(a, x); w = (a - 1 - x) / 2; if (Math.max(Math.abs(temp), Math.abs(w * temp)) <= 0.1) { return x * (1 - (temp + w * temp * temp)); } return x * (1 - temp); }
javascript
function step(x, a, p, q) { var temp, w; temp = p <= 0.5 ? gratio(a)(x) - p : q - gratioc(a)(x); temp /= r(a, x); w = (a - 1 - x) / 2; if (Math.max(Math.abs(temp), Math.abs(w * temp)) <= 0.1) { return x * (1 - (temp + w * temp * temp)); } return x * (1 - temp); }
[ "function", "step", "(", "x", ",", "a", ",", "p", ",", "q", ")", "{", "var", "temp", ",", "w", ";", "temp", "=", "p", "<=", "0.5", "?", "gratio", "(", "a", ")", "(", "x", ")", "-", "p", ":", "q", "-", "gratioc", "(", "a", ")", "(", "x",...
Use Schroeder or Newton-Raphson to do one step of the iteration, formulas 37 and 38.
[ "Use", "Schroeder", "or", "Newton", "-", "Raphson", "to", "do", "one", "step", "of", "the", "iteration", "formulas", "37", "and", "38", "." ]
54d249ca9903a9535f963da711bd3a87fb229c0b
https://github.com/PanthR/panthrMath/blob/54d249ca9903a9535f963da711bd3a87fb229c0b/panthrMath/basicFunc/gratio.js#L514-L524
49,159
novadiscovery/nway
lib/decojs.js
decojs
function decojs(str) { var i , curChar, nextChar, lastNoSpaceChar , inString = false , inComment = false , inRegex = false , onlyComment = false , newStr = '' , curLine = '' , keepLineFeed = false // Keep a line feed after comment , stringOpenWith ;...
javascript
function decojs(str) { var i , curChar, nextChar, lastNoSpaceChar , inString = false , inComment = false , inRegex = false , onlyComment = false , newStr = '' , curLine = '' , keepLineFeed = false // Keep a line feed after comment , stringOpenWith ;...
[ "function", "decojs", "(", "str", ")", "{", "var", "i", ",", "curChar", ",", "nextChar", ",", "lastNoSpaceChar", ",", "inString", "=", "false", ",", "inComment", "=", "false", ",", "inRegex", "=", "false", ",", "onlyComment", "=", "false", ",", "newStr",...
Remove comment in a source code decojs() is remove javascript style single line and multiline comments (// and /*) @param {string} str The source to de-comment @return {string} Result string without comment
[ "Remove", "comment", "in", "a", "source", "code" ]
fa31c6fe56f2305721e581ac25e8ac9a87e15dda
https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/decojs.js#L38-L136
49,160
tjmehta/validate-reql
lib/validate-reql.js
validateReQL
function validateReQL (reql, reqlOpts, whitelist) { var args = assertArgs(arguments, { 'reql': '*', '[reqlOpts]': 'object', 'whitelist': 'array' }) reql = args.reql reqlOpts = args.reqlOpts whitelist = args.whitelist var firstErr var errCount = 0 var promises = whitelist.map(function (reqlVa...
javascript
function validateReQL (reql, reqlOpts, whitelist) { var args = assertArgs(arguments, { 'reql': '*', '[reqlOpts]': 'object', 'whitelist': 'array' }) reql = args.reql reqlOpts = args.reqlOpts whitelist = args.whitelist var firstErr var errCount = 0 var promises = whitelist.map(function (reqlVa...
[ "function", "validateReQL", "(", "reql", ",", "reqlOpts", ",", "whitelist", ")", "{", "var", "args", "=", "assertArgs", "(", "arguments", ",", "{", "'reql'", ":", "'*'", ",", "'[reqlOpts]'", ":", "'object'", ",", "'whitelist'", ":", "'array'", "}", ")", ...
validate reql and reql opts @param {Object} reql rethinkdb query reql @param {Object} [reqlOpts] rethinkdb reql opts @param {Array} whitelist reql validators/queries @return {Promise.<Boolean>} isValid promise
[ "validate", "reql", "and", "reql", "opts" ]
e510f5202e3ef0188a0632fff617c69940083785
https://github.com/tjmehta/validate-reql/blob/e510f5202e3ef0188a0632fff617c69940083785/lib/validate-reql.js#L22-L47
49,161
sendanor/nor-rest
src/request.js
do_plain
function do_plain(url, opts) { opts = do_args(url, opts); if(opts.redirect_loop_counter === undefined) { opts.redirect_loop_counter = 10; } var buffer; var d = Q.defer(); var req = require(opts.protocol).request(opts.url, function(res) { var buffer = ""; res.setEncoding('utf8'); function collect_chunks(ch...
javascript
function do_plain(url, opts) { opts = do_args(url, opts); if(opts.redirect_loop_counter === undefined) { opts.redirect_loop_counter = 10; } var buffer; var d = Q.defer(); var req = require(opts.protocol).request(opts.url, function(res) { var buffer = ""; res.setEncoding('utf8'); function collect_chunks(ch...
[ "function", "do_plain", "(", "url", ",", "opts", ")", "{", "opts", "=", "do_args", "(", "url", ",", "opts", ")", ";", "if", "(", "opts", ".", "redirect_loop_counter", "===", "undefined", ")", "{", "opts", ".", "redirect_loop_counter", "=", "10", ";", "...
Performs generic request
[ "Performs", "generic", "request" ]
b2571e689c7a7e5129e361a7c66c7e5e946d4ca1
https://github.com/sendanor/nor-rest/blob/b2571e689c7a7e5129e361a7c66c7e5e946d4ca1/src/request.js#L55-L118
49,162
sendanor/nor-rest
src/request.js
do_js
function do_js(url, opts) { opts = opts || {}; if(is.object(opts) && is['function'](opts.body)) { opts.body = FUNCTION(opts.body).stringify(); } else if(is.object(opts) && is.string(opts.body)) { } else { throw new TypeError('opts.body is not function nor string'); } opts.headers = opts.headers || {}; if(opt...
javascript
function do_js(url, opts) { opts = opts || {}; if(is.object(opts) && is['function'](opts.body)) { opts.body = FUNCTION(opts.body).stringify(); } else if(is.object(opts) && is.string(opts.body)) { } else { throw new TypeError('opts.body is not function nor string'); } opts.headers = opts.headers || {}; if(opt...
[ "function", "do_js", "(", "url", ",", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "if", "(", "is", ".", "object", "(", "opts", ")", "&&", "is", "[", "'function'", "]", "(", "opts", ".", "body", ")", ")", "{", "opts", ".", "bod...
JavaScript function request
[ "JavaScript", "function", "request" ]
b2571e689c7a7e5129e361a7c66c7e5e946d4ca1
https://github.com/sendanor/nor-rest/blob/b2571e689c7a7e5129e361a7c66c7e5e946d4ca1/src/request.js#L137-L159
49,163
rmariuzzo/entrify
index.js
entrify
function entrify(dir, options = {}) { if (!dir) { throw new Error('the path is required') } if (typeof dir !== 'string') { throw new Error('the path must be a string') } options = Object.assign({}, defaults, options) return entrifyFromPkg(dir, options) }
javascript
function entrify(dir, options = {}) { if (!dir) { throw new Error('the path is required') } if (typeof dir !== 'string') { throw new Error('the path must be a string') } options = Object.assign({}, defaults, options) return entrifyFromPkg(dir, options) }
[ "function", "entrify", "(", "dir", ",", "options", "=", "{", "}", ")", "{", "if", "(", "!", "dir", ")", "{", "throw", "new", "Error", "(", "'the path is required'", ")", "}", "if", "(", "typeof", "dir", "!==", "'string'", ")", "{", "throw", "new", ...
Entrify a path. @param {String} dir The path. @param {Object} options Hash of options.
[ "Entrify", "a", "path", "." ]
cd3f67fea55a78f95ae168cd66c9173d36a446a8
https://github.com/rmariuzzo/entrify/blob/cd3f67fea55a78f95ae168cd66c9173d36a446a8/index.js#L33-L47
49,164
rmariuzzo/entrify
index.js
entrifyFromPkg
function entrifyFromPkg(dir, options) { // Find package.json files. const pkgPaths = glob.sync('**/package.json', { cwd: dir, nodir: true, absolute: true }) pkgPaths.forEach((pkgPath) => { console.log('[entrify]', 'Found:', pkgPath) const pkg = require(pkgPath) // A package.json file should have a ...
javascript
function entrifyFromPkg(dir, options) { // Find package.json files. const pkgPaths = glob.sync('**/package.json', { cwd: dir, nodir: true, absolute: true }) pkgPaths.forEach((pkgPath) => { console.log('[entrify]', 'Found:', pkgPath) const pkg = require(pkgPath) // A package.json file should have a ...
[ "function", "entrifyFromPkg", "(", "dir", ",", "options", ")", "{", "// Find package.json files.", "const", "pkgPaths", "=", "glob", ".", "sync", "(", "'**/package.json'", ",", "{", "cwd", ":", "dir", ",", "nodir", ":", "true", ",", "absolute", ":", "true", ...
Entrify a directory by creating an index.js file when a valid package.json is found. @param {String} dir The directory to entrify. @param {Object} options Hash of options.
[ "Entrify", "a", "directory", "by", "creating", "an", "index", ".", "js", "file", "when", "a", "valid", "package", ".", "json", "is", "found", "." ]
cd3f67fea55a78f95ae168cd66c9173d36a446a8
https://github.com/rmariuzzo/entrify/blob/cd3f67fea55a78f95ae168cd66c9173d36a446a8/index.js#L55-L96
49,165
rmariuzzo/entrify
index.js
indexTemplate
function indexTemplate(format, data) { if (format === 'cjs') { return `module.exports = require('${data.main}')` } if (format === 'esm') { return `import ${data.name} from '${data.main}' export default ${data.name}` } }
javascript
function indexTemplate(format, data) { if (format === 'cjs') { return `module.exports = require('${data.main}')` } if (format === 'esm') { return `import ${data.name} from '${data.main}' export default ${data.name}` } }
[ "function", "indexTemplate", "(", "format", ",", "data", ")", "{", "if", "(", "format", "===", "'cjs'", ")", "{", "return", "`", "${", "data", ".", "main", "}", "`", "}", "if", "(", "format", "===", "'esm'", ")", "{", "return", "`", "${", "data", ...
Utility functions. @private Create contents for an index.js file. @param {String} format The format to use. 'cjs' or 'esm'. @param {Object} data The data to use as part of the template.
[ "Utility", "functions", "." ]
cd3f67fea55a78f95ae168cd66c9173d36a446a8
https://github.com/rmariuzzo/entrify/blob/cd3f67fea55a78f95ae168cd66c9173d36a446a8/index.js#L109-L118
49,166
rmariuzzo/entrify
index.js
camelize
function camelize(str) { return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => { return index === 0 ? letter.toLowerCase() : letter.toUpperCase() }).replace(/[\s\-_]+/g, '') }
javascript
function camelize(str) { return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (letter, index) => { return index === 0 ? letter.toLowerCase() : letter.toUpperCase() }).replace(/[\s\-_]+/g, '') }
[ "function", "camelize", "(", "str", ")", "{", "return", "str", ".", "replace", "(", "/", "(?:^\\w|[A-Z]|\\b\\w)", "/", "g", ",", "(", "letter", ",", "index", ")", "=>", "{", "return", "index", "===", "0", "?", "letter", ".", "toLowerCase", "(", ")", ...
Convert a string to camelCase. @param {String} str The string to camelize. @return {String} The camelized version of the provided string.
[ "Convert", "a", "string", "to", "camelCase", "." ]
cd3f67fea55a78f95ae168cd66c9173d36a446a8
https://github.com/rmariuzzo/entrify/blob/cd3f67fea55a78f95ae168cd66c9173d36a446a8/index.js#L126-L130
49,167
me-ventures/microservice-toolkit
src/swagger/corsMiddleware.js
getOperationResponseHeaders
function getOperationResponseHeaders(operation) { var headers = []; if (operation) { _.each(operation.responses, function(response, responseCode) { // Convert responseCode to a numeric value for sorting ("default" comes last) responseCode = parseInt(responseCode) || 999; ...
javascript
function getOperationResponseHeaders(operation) { var headers = []; if (operation) { _.each(operation.responses, function(response, responseCode) { // Convert responseCode to a numeric value for sorting ("default" comes last) responseCode = parseInt(responseCode) || 999; ...
[ "function", "getOperationResponseHeaders", "(", "operation", ")", "{", "var", "headers", "=", "[", "]", ";", "if", "(", "operation", ")", "{", "_", ".", "each", "(", "operation", ".", "responses", ",", "function", "(", "response", ",", "responseCode", ")",...
Returns all response headers for the given Swagger operation, sorted by HTTP response code. @param {object} operation - The Operation object from the Swagger API @returns {{responseCode: integer, name: string, value: string}[]}
[ "Returns", "all", "response", "headers", "for", "the", "given", "Swagger", "operation", "sorted", "by", "HTTP", "response", "code", "." ]
9aedc9542dffdc274a5142515bd22e92833220d2
https://github.com/me-ventures/microservice-toolkit/blob/9aedc9542dffdc274a5142515bd22e92833220d2/src/swagger/corsMiddleware.js#L141-L163
49,168
wunderbyte/grunt-spiritual-edbml
src/header.js
cast
function cast(string) { var result = String(string); switch (result) { case 'null': result = null; break; case 'true': case 'false': result = result === 'true'; break; default: if (String(parseInt(result, 10)) === result) { result = parseInt(result, 10); } else if (String(parseFloat(resu...
javascript
function cast(string) { var result = String(string); switch (result) { case 'null': result = null; break; case 'true': case 'false': result = result === 'true'; break; default: if (String(parseInt(result, 10)) === result) { result = parseInt(result, 10); } else if (String(parseFloat(resu...
[ "function", "cast", "(", "string", ")", "{", "var", "result", "=", "String", "(", "string", ")", ";", "switch", "(", "result", ")", "{", "case", "'null'", ":", "result", "=", "null", ";", "break", ";", "case", "'true'", ":", "case", "'false'", ":", ...
Autocast string to an inferred type. "123" returns a number while "true" and false" return a boolean. Empty string evals to `true` in order to support HTML attribute minimization. @param {string} string @returns {object}
[ "Autocast", "string", "to", "an", "inferred", "type", ".", "123", "returns", "a", "number", "while", "true", "and", "false", "return", "a", "boolean", ".", "Empty", "string", "evals", "to", "true", "in", "order", "to", "support", "HTML", "attribute", "mini...
2ba0aa8042eceee917f1ee48c7881345df3bce46
https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/src/header.js#L23-L42
49,169
moov2/grunt-orchard-development
tasks/remove-modules.js
function (srcpath) { return fs.readdirSync(srcpath).filter(function(file) { return fs.statSync(path.join(srcpath, file)).isDirectory(); }); }
javascript
function (srcpath) { return fs.readdirSync(srcpath).filter(function(file) { return fs.statSync(path.join(srcpath, file)).isDirectory(); }); }
[ "function", "(", "srcpath", ")", "{", "return", "fs", ".", "readdirSync", "(", "srcpath", ")", ".", "filter", "(", "function", "(", "file", ")", "{", "return", "fs", ".", "statSync", "(", "path", ".", "join", "(", "srcpath", ",", "file", ")", ")", ...
Returns directories inside the directory associated to the provided path.
[ "Returns", "directories", "inside", "the", "directory", "associated", "to", "the", "provided", "path", "." ]
658c5bae73f894469d099a7c2d735f9cda08d0cc
https://github.com/moov2/grunt-orchard-development/blob/658c5bae73f894469d099a7c2d735f9cda08d0cc/tasks/remove-modules.js#L26-L30
49,170
moov2/grunt-orchard-development
tasks/remove-modules.js
function (csprojFilePath, success, error) { var parser = new xml2js.Parser(), projectGuid; fs.readFile(csprojFilePath, function(err, data) { if (typeof(data) !== 'undefined') { parser.parseString(data, function (err, result) { ...
javascript
function (csprojFilePath, success, error) { var parser = new xml2js.Parser(), projectGuid; fs.readFile(csprojFilePath, function(err, data) { if (typeof(data) !== 'undefined') { parser.parseString(data, function (err, result) { ...
[ "function", "(", "csprojFilePath", ",", "success", ",", "error", ")", "{", "var", "parser", "=", "new", "xml2js", ".", "Parser", "(", ")", ",", "projectGuid", ";", "fs", ".", "readFile", "(", "csprojFilePath", ",", "function", "(", "err", ",", "data", ...
Extracts the project GUID from the provided .csproj file.
[ "Extracts", "the", "project", "GUID", "from", "the", "provided", ".", "csproj", "file", "." ]
658c5bae73f894469d099a7c2d735f9cda08d0cc
https://github.com/moov2/grunt-orchard-development/blob/658c5bae73f894469d099a7c2d735f9cda08d0cc/tasks/remove-modules.js#L35-L54
49,171
moov2/grunt-orchard-development
tasks/remove-modules.js
function () { fs.writeFile(solutionFile, solutionFileContents, function(err) { if (err) { grunt.fail.warning('Failed to update solution file.'); } done(); }); }
javascript
function () { fs.writeFile(solutionFile, solutionFileContents, function(err) { if (err) { grunt.fail.warning('Failed to update solution file.'); } done(); }); }
[ "function", "(", ")", "{", "fs", ".", "writeFile", "(", "solutionFile", ",", "solutionFileContents", ",", "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "grunt", ".", "fail", ".", "warning", "(", "'Failed to update solution file.'", ")", ";"...
Writes the update contents of the solution to file.
[ "Writes", "the", "update", "contents", "of", "the", "solution", "to", "file", "." ]
658c5bae73f894469d099a7c2d735f9cda08d0cc
https://github.com/moov2/grunt-orchard-development/blob/658c5bae73f894469d099a7c2d735f9cda08d0cc/tasks/remove-modules.js#L84-L92
49,172
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
storeActors
function storeActors() { test.actorsStored = 0; for (var i = 0; i < test.actorsInfo.length; i++) { test.actor.set('ID', null); test.actor.set('name', test.actorsInfo[i][0]); test.actor.set('born', test.actorsInfo[i][1]); test.actor.set('isMale', test.actorsInfo[i][2]); ...
javascript
function storeActors() { test.actorsStored = 0; for (var i = 0; i < test.actorsInfo.length; i++) { test.actor.set('ID', null); test.actor.set('name', test.actorsInfo[i][0]); test.actor.set('born', test.actorsInfo[i][1]); test.actor.set('isMale', test.actorsInfo[i][2]); ...
[ "function", "storeActors", "(", ")", "{", "test", ".", "actorsStored", "=", "0", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "test", ".", "actorsInfo", ".", "length", ";", "i", "++", ")", "{", "test", ".", "actor", ".", "set", "(", "'...
callback after model cleaned now, build List and add to store
[ "callback", "after", "model", "cleaned", "now", "build", "List", "and", "add", "to", "store" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L1617-L1626
49,173
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
actorStored
function actorStored(model, error) { if (typeof error != 'undefined') { callback(error); return; } if (++test.actorsStored >= test.actorsInfo.length) { getAllActors(); } }
javascript
function actorStored(model, error) { if (typeof error != 'undefined') { callback(error); return; } if (++test.actorsStored >= test.actorsInfo.length) { getAllActors(); } }
[ "function", "actorStored", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "callback", "(", "error", ")", ";", "return", ";", "}", "if", "(", "++", "test", ".", "actorsStored", ">=", "test", ".", "ac...
callback after actor stored
[ "callback", "after", "actor", "stored" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L1629-L1637
49,174
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
getAllActors
function getAllActors() { try { storeBeingTested.getList(test.list, {}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } test.shouldBeTrue(list._items.length == 20, '20'); getTomHanks(); }); ...
javascript
function getAllActors() { try { storeBeingTested.getList(test.list, {}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } test.shouldBeTrue(list._items.length == 20, '20'); getTomHanks(); }); ...
[ "function", "getAllActors", "(", ")", "{", "try", "{", "storeBeingTested", ".", "getList", "(", "test", ".", "list", ",", "{", "}", ",", "function", "(", "list", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "ca...
test getting all 20
[ "test", "getting", "all", "20" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L1640-L1654
49,175
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
getTomHanks
function getTomHanks() { try { storeBeingTested.getList(test.list, {name: "Tom Hanks"}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } test.shouldBeTrue(list._items.length == 1, ('1 not ' + list._items.length)); ...
javascript
function getTomHanks() { try { storeBeingTested.getList(test.list, {name: "Tom Hanks"}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } test.shouldBeTrue(list._items.length == 1, ('1 not ' + list._items.length)); ...
[ "function", "getTomHanks", "(", ")", "{", "try", "{", "storeBeingTested", ".", "getList", "(", "test", ".", "list", ",", "{", "name", ":", "\"Tom Hanks\"", "}", ",", "function", "(", "list", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", ...
only one Tom Hanks
[ "only", "one", "Tom", "Hanks" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L1657-L1671
49,176
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
getAlphabetical
function getAlphabetical() { try { storeBeingTested.getList(test.list, {}, {name: 1}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } // Verify each move returns true when move succeeds test.shouldBeTrue...
javascript
function getAlphabetical() { try { storeBeingTested.getList(test.list, {}, {name: 1}, function (list, error) { if (typeof error != 'undefined') { callback(error); return; } // Verify each move returns true when move succeeds test.shouldBeTrue...
[ "function", "getAlphabetical", "(", ")", "{", "try", "{", "storeBeingTested", ".", "getList", "(", "test", ".", "list", ",", "{", "}", ",", "{", "name", ":", "1", "}", ",", "function", "(", "list", ",", "error", ")", "{", "if", "(", "typeof", "erro...
Retrieve list alphabetically by name test order parameter
[ "Retrieve", "list", "alphabetically", "by", "name", "test", "order", "parameter" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L1713-L1733
49,177
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
storeStooges
function storeStooges() { self.log(self.oldStoogesFound); self.log(self.oldStoogesKilled); spec.integrationStore.putModel(self.moe, stoogeStored); spec.integrationStore.putModel(self.larry, stoogeStored); spec.integrationStore.putModel(self.shemp, stoogeStored); ...
javascript
function storeStooges() { self.log(self.oldStoogesFound); self.log(self.oldStoogesKilled); spec.integrationStore.putModel(self.moe, stoogeStored); spec.integrationStore.putModel(self.larry, stoogeStored); spec.integrationStore.putModel(self.shemp, stoogeStored); ...
[ "function", "storeStooges", "(", ")", "{", "self", ".", "log", "(", "self", ".", "oldStoogesFound", ")", ";", "self", ".", "log", "(", "self", ".", "oldStoogesKilled", ")", ";", "spec", ".", "integrationStore", ".", "putModel", "(", "self", ".", "moe", ...
callback to store new stooges
[ "callback", "to", "store", "new", "stooges" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2618-L2624
49,178
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
stoogeRetrieved
function stoogeRetrieved(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.stoogesRetrieved.push(model); if (self.stoogesRetrieved.length == 3) { self.shouldBeTrue(true,'here'); // Now we have stored...
javascript
function stoogeRetrieved(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.stoogesRetrieved.push(model); if (self.stoogesRetrieved.length == 3) { self.shouldBeTrue(true,'here'); // Now we have stored...
[ "function", "stoogeRetrieved", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "callback", "(", "error", ")", ";", "return", ";", "}", "self", ".", "stoogesRetrieved", ".", "push", "(", "model", ")", "...
callback after retrieving stored stooges
[ "callback", "after", "retrieving", "stored", "stooges" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2651-L2684
49,179
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
stoogeChanged
function stoogeChanged(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.shouldBeTrue(model.get('name') == 'Curly','Curly'); var curly = new self.Stooge(); curly.set('id', model.get('id')); try { ...
javascript
function stoogeChanged(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.shouldBeTrue(model.get('name') == 'Curly','Curly'); var curly = new self.Stooge(); curly.set('id', model.get('id')); try { ...
[ "function", "stoogeChanged", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "callback", "(", "error", ")", ";", "return", ";", "}", "self", ".", "shouldBeTrue", "(", "model", ".", "get", "(", "'name'"...
callback after storing changed stooge
[ "callback", "after", "storing", "changed", "stooge" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2687-L2701
49,180
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
storeChangedShempToCurly
function storeChangedShempToCurly(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.shouldBeTrue(model.get('name') == 'Curly','Curly'); // Now test delete self.deletedModelId = model.get('id'); // Remember this ...
javascript
function storeChangedShempToCurly(model, error) { if (typeof error != 'undefined') { callback(error); return; } self.shouldBeTrue(model.get('name') == 'Curly','Curly'); // Now test delete self.deletedModelId = model.get('id'); // Remember this ...
[ "function", "storeChangedShempToCurly", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "callback", "(", "error", ")", ";", "return", ";", "}", "self", ".", "shouldBeTrue", "(", "model", ".", "get", "(",...
callback after retrieving changed stooge
[ "callback", "after", "retrieving", "changed", "stooge" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2704-L2713
49,181
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
stoogeDeleted
function stoogeDeleted(model, error) { if (typeof error != 'undefined') { callback(error); return; } // model parameter is what was deleted self.shouldBeTrue(undefined === model.get('id')); // ID removed self.shouldBeTrue(model.get('name') == 'Cu...
javascript
function stoogeDeleted(model, error) { if (typeof error != 'undefined') { callback(error); return; } // model parameter is what was deleted self.shouldBeTrue(undefined === model.get('id')); // ID removed self.shouldBeTrue(model.get('name') == 'Cu...
[ "function", "stoogeDeleted", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "callback", "(", "error", ")", ";", "return", ";", "}", "// model parameter is what was deleted", "self", ".", "shouldBeTrue", "(", ...
callback when Curly is deleted
[ "callback", "when", "Curly", "is", "deleted" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2716-L2728
49,182
tgi-io/tgi-store-json-file
dist/tgi-store-json-file.spec.js
hesDeadJim
function hesDeadJim(model, error) { if (typeof error != 'undefined') { if ((error != 'Error: id not found in store') && (error != 'Error: model not found in store')) { callback(error); return; } } else { callback(Error('no error deletin...
javascript
function hesDeadJim(model, error) { if (typeof error != 'undefined') { if ((error != 'Error: id not found in store') && (error != 'Error: model not found in store')) { callback(error); return; } } else { callback(Error('no error deletin...
[ "function", "hesDeadJim", "(", "model", ",", "error", ")", "{", "if", "(", "typeof", "error", "!=", "'undefined'", ")", "{", "if", "(", "(", "error", "!=", "'Error: id not found in store'", ")", "&&", "(", "error", "!=", "'Error: model not found in store'", ")...
callback after lookup of dead stooge
[ "callback", "after", "lookup", "of", "dead", "stooge" ]
21f5c4164326c5e80989f19413d26ba591f362ac
https://github.com/tgi-io/tgi-store-json-file/blob/21f5c4164326c5e80989f19413d26ba591f362ac/dist/tgi-store-json-file.spec.js#L2731-L2754
49,183
MakerCollider/upm_mc
doxy/node/generators/yuidoc/generator.js
generateDocs
function generateDocs(specjs) { var docs = GENERATE_MODULE(specjs.MODULE, ''); GENERATE_TYPE = (function(enums) { return function(type) { return (_.contains(enums, type) ? ('Enum ' + type) : type); } })(_.keys(specjs.ENUMS_BY_GROUP)); docs = _.reduce(specjs.METHODS, function(memo, methodSpec, m...
javascript
function generateDocs(specjs) { var docs = GENERATE_MODULE(specjs.MODULE, ''); GENERATE_TYPE = (function(enums) { return function(type) { return (_.contains(enums, type) ? ('Enum ' + type) : type); } })(_.keys(specjs.ENUMS_BY_GROUP)); docs = _.reduce(specjs.METHODS, function(memo, methodSpec, m...
[ "function", "generateDocs", "(", "specjs", ")", "{", "var", "docs", "=", "GENERATE_MODULE", "(", "specjs", ".", "MODULE", ",", "''", ")", ";", "GENERATE_TYPE", "=", "(", "function", "(", "enums", ")", "{", "return", "function", "(", "type", ")", "{", "...
generate YuiDocs-style documentation
[ "generate", "YuiDocs", "-", "style", "documentation" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/yuidoc/generator.js#L30-L59
49,184
MakerCollider/upm_mc
doxy/node/generators/yuidoc/generator.js
GENERATE_CLASSES
function GENERATE_CLASSES(classes, parent) { return _.reduce(classes, function(memo, classSpec, className) { return memo + GENERATE_CLASS(className, classSpec.description, parent, classSpec.parent) + _.reduce(classSpec.methods, function(memo, methodSpec, methodName) { return memo += GENERATE_M...
javascript
function GENERATE_CLASSES(classes, parent) { return _.reduce(classes, function(memo, classSpec, className) { return memo + GENERATE_CLASS(className, classSpec.description, parent, classSpec.parent) + _.reduce(classSpec.methods, function(memo, methodSpec, methodName) { return memo += GENERATE_M...
[ "function", "GENERATE_CLASSES", "(", "classes", ",", "parent", ")", "{", "return", "_", ".", "reduce", "(", "classes", ",", "function", "(", "memo", ",", "classSpec", ",", "className", ")", "{", "return", "memo", "+", "GENERATE_CLASS", "(", "className", ",...
generate spec for the given list of classes
[ "generate", "spec", "for", "the", "given", "list", "of", "classes" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/yuidoc/generator.js#L76-L90
49,185
MakerCollider/upm_mc
doxy/node/generators/yuidoc/generator.js
GENERATE_CLASS
function GENERATE_CLASS(name, description, namespace, parent) { return GENERATE_DOC(description + '\n' + '@class ' + name + '\n' + (namespace ? ('@module ' + namespace + '\n') : '') /* TODO: leave out until figure out what swig does with inheritance + (parent ? ('@extends ' + parent + '\n') : '')...
javascript
function GENERATE_CLASS(name, description, namespace, parent) { return GENERATE_DOC(description + '\n' + '@class ' + name + '\n' + (namespace ? ('@module ' + namespace + '\n') : '') /* TODO: leave out until figure out what swig does with inheritance + (parent ? ('@extends ' + parent + '\n') : '')...
[ "function", "GENERATE_CLASS", "(", "name", ",", "description", ",", "namespace", ",", "parent", ")", "{", "return", "GENERATE_DOC", "(", "description", "+", "'\\n'", "+", "'@class '", "+", "name", "+", "'\\n'", "+", "(", "namespace", "?", "(", "'@module '", ...
generate class spec
[ "generate", "class", "spec" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/yuidoc/generator.js#L94-L103
49,186
MakerCollider/upm_mc
doxy/node/generators/yuidoc/generator.js
GENERATE_ENUM
function GENERATE_ENUM(name, spec, parent) { return GENERATE_DOC(spec.description + '\n' + '@property ' + name + '\n' + '@type Enum ' + spec.type + '\n' + '@for ' + (parent ? parent : 'common') + '\n'); }
javascript
function GENERATE_ENUM(name, spec, parent) { return GENERATE_DOC(spec.description + '\n' + '@property ' + name + '\n' + '@type Enum ' + spec.type + '\n' + '@for ' + (parent ? parent : 'common') + '\n'); }
[ "function", "GENERATE_ENUM", "(", "name", ",", "spec", ",", "parent", ")", "{", "return", "GENERATE_DOC", "(", "spec", ".", "description", "+", "'\\n'", "+", "'@property '", "+", "name", "+", "'\\n'", "+", "'@type Enum '", "+", "spec", ".", "type", "+", ...
generate enum spec
[ "generate", "enum", "spec" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/yuidoc/generator.js#L120-L125
49,187
MakerCollider/upm_mc
doxy/node/generators/yuidoc/generator.js
GENERATE_VAR
function GENERATE_VAR(name, spec, parent) { return GENERATE_DOC(spec.description + '\n' + '@property ' + name + '\n' + '@type ' + spec.type + '\n' + '@for ' + parent + '\n'); }
javascript
function GENERATE_VAR(name, spec, parent) { return GENERATE_DOC(spec.description + '\n' + '@property ' + name + '\n' + '@type ' + spec.type + '\n' + '@for ' + parent + '\n'); }
[ "function", "GENERATE_VAR", "(", "name", ",", "spec", ",", "parent", ")", "{", "return", "GENERATE_DOC", "(", "spec", ".", "description", "+", "'\\n'", "+", "'@property '", "+", "name", "+", "'\\n'", "+", "'@type '", "+", "spec", ".", "type", "+", "'\\n'...
generate variable specs
[ "generate", "variable", "specs" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/yuidoc/generator.js#L129-L134
49,188
marcin-chwedczuk/format.js
lib/bigint.js
function(lDigits, rDigits) { var difference = []; // assert: lDigits.length >= rDigits.length var carry = 0, i; for (i = 0; i < rDigits.length; i += 1) { difference[i] = lDigits[i] - rDigits[i] + carry; if (difference[i] < 0) { difference[i] += 2; carry = ...
javascript
function(lDigits, rDigits) { var difference = []; // assert: lDigits.length >= rDigits.length var carry = 0, i; for (i = 0; i < rDigits.length; i += 1) { difference[i] = lDigits[i] - rDigits[i] + carry; if (difference[i] < 0) { difference[i] += 2; carry = ...
[ "function", "(", "lDigits", ",", "rDigits", ")", "{", "var", "difference", "=", "[", "]", ";", "// assert: lDigits.length >= rDigits.length", "var", "carry", "=", "0", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "rDigits", ".", "length", "...
lDigits must represent number that is greater than number representated by rDigits.
[ "lDigits", "must", "represent", "number", "that", "is", "greater", "than", "number", "representated", "by", "rDigits", "." ]
01b146bc160cba9a70f6bdf6094bf353b4c56b5d
https://github.com/marcin-chwedczuk/format.js/blob/01b146bc160cba9a70f6bdf6094bf353b4c56b5d/lib/bigint.js#L170-L206
49,189
marcin-chwedczuk/format.js
lib/bigint.js
function(normalizedLeft, normalizedRight) { if (normalizedLeft.length !== normalizedRight.length) { return normalizedLeft.length - normalizedRight.length; } for (var i = normalizedLeft.length - 1; i >= 0; i -= 1) { if (normalizedLeft[i] !== normalizedRight[i]) { return normalize...
javascript
function(normalizedLeft, normalizedRight) { if (normalizedLeft.length !== normalizedRight.length) { return normalizedLeft.length - normalizedRight.length; } for (var i = normalizedLeft.length - 1; i >= 0; i -= 1) { if (normalizedLeft[i] !== normalizedRight[i]) { return normalize...
[ "function", "(", "normalizedLeft", ",", "normalizedRight", ")", "{", "if", "(", "normalizedLeft", ".", "length", "!==", "normalizedRight", ".", "length", ")", "{", "return", "normalizedLeft", ".", "length", "-", "normalizedRight", ".", "length", ";", "}", "for...
compares numbers represented by two NORMALIZED digits arrays
[ "compares", "numbers", "represented", "by", "two", "NORMALIZED", "digits", "arrays" ]
01b146bc160cba9a70f6bdf6094bf353b4c56b5d
https://github.com/marcin-chwedczuk/format.js/blob/01b146bc160cba9a70f6bdf6094bf353b4c56b5d/lib/bigint.js#L459-L471
49,190
redisjs/jsr-server
lib/socket.js
SocketProxy
function SocketProxy() { // the socket we are paired with this.pair = null; // internal sockets have fd -1 this._handle = {fd: -1}; // mimic a remote address / remote port this.remoteAddress = '0.0.0.0'; this.remotePort = '0'; // give the client some time to listen // for the connect event functi...
javascript
function SocketProxy() { // the socket we are paired with this.pair = null; // internal sockets have fd -1 this._handle = {fd: -1}; // mimic a remote address / remote port this.remoteAddress = '0.0.0.0'; this.remotePort = '0'; // give the client some time to listen // for the connect event functi...
[ "function", "SocketProxy", "(", ")", "{", "// the socket we are paired with", "this", ".", "pair", "=", "null", ";", "// internal sockets have fd -1", "this", ".", "_handle", "=", "{", "fd", ":", "-", "1", "}", ";", "// mimic a remote address / remote port", "this",...
Abstract socket class used to create a bi-directional link between a server and a client connecting in the same process. Simulates the `net.Socket` class so that the code flows in exactly the same way but bypasses encoding, decoding and TCP transmission overhead.
[ "Abstract", "socket", "class", "used", "to", "create", "a", "bi", "-", "directional", "link", "between", "a", "server", "and", "a", "client", "connecting", "in", "the", "same", "process", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/socket.js#L12-L29
49,191
loggur-legacy/baucis-decorator-deep-select
index.js
gatherPopulateParams
function gatherPopulateParams (populate, pointers, model, deepPath) { var modelName = model.modelName; var paths = model.schema.paths; var path = ''; var options; var params; var ref; var deep = false; while (deepPath.length) { path += (path ? '.' : '')+deepPath.shift(); options = paths[path]...
javascript
function gatherPopulateParams (populate, pointers, model, deepPath) { var modelName = model.modelName; var paths = model.schema.paths; var path = ''; var options; var params; var ref; var deep = false; while (deepPath.length) { path += (path ? '.' : '')+deepPath.shift(); options = paths[path]...
[ "function", "gatherPopulateParams", "(", "populate", ",", "pointers", ",", "model", ",", "deepPath", ")", "{", "var", "modelName", "=", "model", ".", "modelName", ";", "var", "paths", "=", "model", ".", "schema", ".", "paths", ";", "var", "path", "=", "'...
Gathers the params required for population of some deep path, if any. @param {Array} populate @param {Object} pointers @param {Model} model @param {Array} deepPath @return {Boolean} true if deep population @api private
[ "Gathers", "the", "params", "required", "for", "population", "of", "some", "deep", "path", "if", "any", "." ]
8f14bb6aca76d43fd163d2142ff49c3058ddc657
https://github.com/loggur-legacy/baucis-decorator-deep-select/blob/8f14bb6aca76d43fd163d2142ff49c3058ddc657/index.js#L117-L166
49,192
loggur-legacy/baucis-decorator-deep-select
index.js
selectPointers
function selectPointers (params) { if (params.pointers) { delete params.pointers['-_id']; params.select = Object.keys(params.pointers).join(' '); } else { delete params.select; } return params.select; }
javascript
function selectPointers (params) { if (params.pointers) { delete params.pointers['-_id']; params.select = Object.keys(params.pointers).join(' '); } else { delete params.select; } return params.select; }
[ "function", "selectPointers", "(", "params", ")", "{", "if", "(", "params", ".", "pointers", ")", "{", "delete", "params", ".", "pointers", "[", "'-_id'", "]", ";", "params", ".", "select", "=", "Object", ".", "keys", "(", "params", ".", "pointers", ")...
Sets the `select` parameter to the keys of the `pointers` and ensures `_id` can't be hidden. @param {Object} params @return {String} select @api private
[ "Sets", "the", "select", "parameter", "to", "the", "keys", "of", "the", "pointers", "and", "ensures", "_id", "can", "t", "be", "hidden", "." ]
8f14bb6aca76d43fd163d2142ff49c3058ddc657
https://github.com/loggur-legacy/baucis-decorator-deep-select/blob/8f14bb6aca76d43fd163d2142ff49c3058ddc657/index.js#L176-L184
49,193
gethuman/taste
lib/taste.js
firstBite
function firstBite(dir) { targetDir = dir || path.join(__dirname, '../../..'); if (targetDir.substring(targetDir.length - 1) === '/') { targetDir = targetDir.substring(0, targetDir.length - 1); } }
javascript
function firstBite(dir) { targetDir = dir || path.join(__dirname, '../../..'); if (targetDir.substring(targetDir.length - 1) === '/') { targetDir = targetDir.substring(0, targetDir.length - 1); } }
[ "function", "firstBite", "(", "dir", ")", "{", "targetDir", "=", "dir", "||", "path", ".", "join", "(", "__dirname", ",", "'../../..'", ")", ";", "if", "(", "targetDir", ".", "substring", "(", "targetDir", ".", "length", "-", "1", ")", "===", "'/'", ...
chai.config.truncateThreshold = 0; Initialize taste with the input params @param dir
[ "chai", ".", "config", ".", "truncateThreshold", "=", "0", ";", "Initialize", "taste", "with", "the", "input", "params" ]
f06938fe0c182235e88403e3341a94b6f47c2e2d
https://github.com/gethuman/taste/blob/f06938fe0c182235e88403e3341a94b6f47c2e2d/lib/taste.js#L27-L33
49,194
gethuman/taste
lib/taste.js
eventuallyEqual
function eventuallyEqual(promise, expected, done) { all([ promise.should.be.fulfilled, promise.should.eventually.deep.equal(expected) ], done); }
javascript
function eventuallyEqual(promise, expected, done) { all([ promise.should.be.fulfilled, promise.should.eventually.deep.equal(expected) ], done); }
[ "function", "eventuallyEqual", "(", "promise", ",", "expected", ",", "done", ")", "{", "all", "(", "[", "promise", ".", "should", ".", "be", ".", "fulfilled", ",", "promise", ".", "should", ".", "eventually", ".", "deep", ".", "equal", "(", "expected", ...
Shorthand for just making sure a promise eventually equals a value @param promise @param expected @param done
[ "Shorthand", "for", "just", "making", "sure", "a", "promise", "eventually", "equals", "a", "value" ]
f06938fe0c182235e88403e3341a94b6f47c2e2d
https://github.com/gethuman/taste/blob/f06938fe0c182235e88403e3341a94b6f47c2e2d/lib/taste.js#L51-L56
49,195
gethuman/taste
lib/taste.js
eventuallyRejectedWith
function eventuallyRejectedWith(promise, expected, done) { all([ promise.should.be.rejectedWith(expected) ], done); }
javascript
function eventuallyRejectedWith(promise, expected, done) { all([ promise.should.be.rejectedWith(expected) ], done); }
[ "function", "eventuallyRejectedWith", "(", "promise", ",", "expected", ",", "done", ")", "{", "all", "(", "[", "promise", ".", "should", ".", "be", ".", "rejectedWith", "(", "expected", ")", "]", ",", "done", ")", ";", "}" ]
Shorthand for making sure the promise will eventually be rejected @param promise @param expected @param done
[ "Shorthand", "for", "making", "sure", "the", "promise", "will", "eventually", "be", "rejected" ]
f06938fe0c182235e88403e3341a94b6f47c2e2d
https://github.com/gethuman/taste/blob/f06938fe0c182235e88403e3341a94b6f47c2e2d/lib/taste.js#L86-L90
49,196
web-mech/can-stream-x
interface-factory.js
function (updated) { // When the stream passes a new values, save a reference to it and call // the compute's internal `updated` method (which ultimately calls `get`) streamHandler = function (val) { lastValue = val; updated(); }; ...
javascript
function (updated) { // When the stream passes a new values, save a reference to it and call // the compute's internal `updated` method (which ultimately calls `get`) streamHandler = function (val) { lastValue = val; updated(); }; ...
[ "function", "(", "updated", ")", "{", "// When the stream passes a new values, save a reference to it and call", "// the compute's internal `updated` method (which ultimately calls `get`)", "streamHandler", "=", "function", "(", "val", ")", "{", "lastValue", "=", "val", ";", "upd...
When the compute is bound, bind to the resolved stream
[ "When", "the", "compute", "is", "bound", "bind", "to", "the", "resolved", "stream" ]
bb025a313c2432861ba7293c6d8f6128f187ced8
https://github.com/web-mech/can-stream-x/blob/bb025a313c2432861ba7293c6d8f6128f187ced8/interface-factory.js#L89-L98
49,197
chanoch/simple-react-router
src/route/SetRoute.js
setRoot
function setRoot(mountpath) { // mount to root if not mountpath let root=mountpath?mountpath:""; // add leading slash if needed root=root.match(/^\/.*/)?root:`/${root}`; // chop off trailing slash root=root.match(/^.*\/$/)?root.substring(0,root.length-1):root; // if root is just slash then...
javascript
function setRoot(mountpath) { // mount to root if not mountpath let root=mountpath?mountpath:""; // add leading slash if needed root=root.match(/^\/.*/)?root:`/${root}`; // chop off trailing slash root=root.match(/^.*\/$/)?root.substring(0,root.length-1):root; // if root is just slash then...
[ "function", "setRoot", "(", "mountpath", ")", "{", "// mount to root if not mountpath", "let", "root", "=", "mountpath", "?", "mountpath", ":", "\"\"", ";", "// add leading slash if needed", "root", "=", "root", ".", "match", "(", "/", "^\\/.*", "/", ")", "?", ...
make sure that mountpath has a leading slash and no training slash
[ "make", "sure", "that", "mountpath", "has", "a", "leading", "slash", "and", "no", "training", "slash" ]
3c71feeeb039111f33c934257732e2ea6ddde9ff
https://github.com/chanoch/simple-react-router/blob/3c71feeeb039111f33c934257732e2ea6ddde9ff/src/route/SetRoute.js#L19-L30
49,198
tnantoka/LooseLeaf
skeleton/public/javascripts/lib/cleditor/jquery.cleditor.js
popupClick
function popupClick(e) { var editor = this, popup = e.data.popup, target = e.target; // Check for message and prompt popups if (popup === popups.msg || $(popup).hasClass(PROMPT_CLASS)) return; // Get the button info var buttonDiv = $.data(popup, BUTTON), ...
javascript
function popupClick(e) { var editor = this, popup = e.data.popup, target = e.target; // Check for message and prompt popups if (popup === popups.msg || $(popup).hasClass(PROMPT_CLASS)) return; // Get the button info var buttonDiv = $.data(popup, BUTTON), ...
[ "function", "popupClick", "(", "e", ")", "{", "var", "editor", "=", "this", ",", "popup", "=", "e", ".", "data", ".", "popup", ",", "target", "=", "e", ".", "target", ";", "// Check for message and prompt popups\r", "if", "(", "popup", "===", "popups", "...
popupClick - click event handler for popup items
[ "popupClick", "-", "click", "event", "handler", "for", "popup", "items" ]
0c6333977224d8f4ef7ad40415aa69e0ff76f7b5
https://github.com/tnantoka/LooseLeaf/blob/0c6333977224d8f4ef7ad40415aa69e0ff76f7b5/skeleton/public/javascripts/lib/cleditor/jquery.cleditor.js#L500-L560
49,199
tnantoka/LooseLeaf
skeleton/public/javascripts/lib/cleditor/jquery.cleditor.js
createPopup
function createPopup(popupName, options, popupTypeClass, popupContent, popupHover) { // Check if popup already exists if (popups[popupName]) return popups[popupName]; // Create the popup var $popup = $(DIV_TAG) .hide() .addClass(POPUP_CLASS) .appendTo("body"); ...
javascript
function createPopup(popupName, options, popupTypeClass, popupContent, popupHover) { // Check if popup already exists if (popups[popupName]) return popups[popupName]; // Create the popup var $popup = $(DIV_TAG) .hide() .addClass(POPUP_CLASS) .appendTo("body"); ...
[ "function", "createPopup", "(", "popupName", ",", "options", ",", "popupTypeClass", ",", "popupContent", ",", "popupHover", ")", "{", "// Check if popup already exists\r", "if", "(", "popups", "[", "popupName", "]", ")", "return", "popups", "[", "popupName", "]", ...
createPopup - creates a popup and adds it to the body
[ "createPopup", "-", "creates", "a", "popup", "and", "adds", "it", "to", "the", "body" ]
0c6333977224d8f4ef7ad40415aa69e0ff76f7b5
https://github.com/tnantoka/LooseLeaf/blob/0c6333977224d8f4ef7ad40415aa69e0ff76f7b5/skeleton/public/javascripts/lib/cleditor/jquery.cleditor.js#L584-L668