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
41,300
rorymadden/neoprene
lib/errors/cast.js
CastError
function CastError (type, value) { NeopreneError.call(this, 'Cast to ' + type + ' failed for value "' + value + '"'); Error.captureStackTrace(this, arguments.callee); this.name = 'CastError'; this.type = type; this.value = value; }
javascript
function CastError (type, value) { NeopreneError.call(this, 'Cast to ' + type + ' failed for value "' + value + '"'); Error.captureStackTrace(this, arguments.callee); this.name = 'CastError'; this.type = type; this.value = value; }
[ "function", "CastError", "(", "type", ",", "value", ")", "{", "NeopreneError", ".", "call", "(", "this", ",", "'Cast to '", "+", "type", "+", "' failed for value \"'", "+", "value", "+", "'\"'", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ","...
Casting Error constructor. @param {String} type @param {String} value @inherits NeopreneError @api private
[ "Casting", "Error", "constructor", "." ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/errors/cast.js#L16-L22
41,301
crudlio/crudl-connectors-base
lib/createFrontendConnector.js
fc
function fc() { for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) { params[_key] = arguments[_key]; } return createFrontendConnector(parametrize(c, params), debug); }
javascript
function fc() { for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) { params[_key] = arguments[_key]; } return createFrontendConnector(parametrize(c, params), debug); }
[ "function", "fc", "(", ")", "{", "for", "(", "var", "_len", "=", "arguments", ".", "length", ",", "params", "=", "Array", "(", "_len", ")", ",", "_key", "=", "0", ";", "_key", "<", "_len", ";", "_key", "++", ")", "{", "params", "[", "_key", "]"...
Frontend connector is a function that returns a parametrized connector
[ "Frontend", "connector", "is", "a", "function", "that", "returns", "a", "parametrized", "connector" ]
454d541b3b3cf7eef5edf4fa84923458052c733a
https://github.com/crudlio/crudl-connectors-base/blob/454d541b3b3cf7eef5edf4fa84923458052c733a/lib/createFrontendConnector.js#L110-L116
41,302
rorymadden/neoprene
lib/errors/validation.js
ValidationError
function ValidationError (instance) { NeopreneError.call(this, "Validation failed"); Error.captureStackTrace(this, arguments.callee); this.name = 'ValidationError'; this.errors = instance.errors = {}; }
javascript
function ValidationError (instance) { NeopreneError.call(this, "Validation failed"); Error.captureStackTrace(this, arguments.callee); this.name = 'ValidationError'; this.errors = instance.errors = {}; }
[ "function", "ValidationError", "(", "instance", ")", "{", "NeopreneError", ".", "call", "(", "this", ",", "\"Validation failed\"", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ",", "arguments", ".", "callee", ")", ";", "this", ".", "name", "=", ...
Document Validation Error @api private @param {Document} instance @inherits NeopreneError
[ "Document", "Validation", "Error" ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/errors/validation.js#L16-L21
41,303
mattdesl/gl-sprite-batch
demo/dynamic.js
render
function render(gl, width, height, dt, batch, shader) { time+=dt var anim = Math.sin(time/1000)/2+0.5 //clear the batch to zero batch.clear() //bind before drawing batch.bind(shader) //push our sprites which may have a variety //of textures batch.push({ position: [...
javascript
function render(gl, width, height, dt, batch, shader) { time+=dt var anim = Math.sin(time/1000)/2+0.5 //clear the batch to zero batch.clear() //bind before drawing batch.bind(shader) //push our sprites which may have a variety //of textures batch.push({ position: [...
[ "function", "render", "(", "gl", ",", "width", ",", "height", ",", "dt", ",", "batch", ",", "shader", ")", "{", "time", "+=", "dt", "var", "anim", "=", "Math", ".", "sin", "(", "time", "/", "1000", ")", "/", "2", "+", "0.5", "//clear the batch to z...
The "dynamic" flag to the Batch constructor is an optional hint for how the buffer will be stored on the GPU.
[ "The", "dynamic", "flag", "to", "the", "Batch", "constructor", "is", "an", "optional", "hint", "for", "how", "the", "buffer", "will", "be", "stored", "on", "the", "GPU", "." ]
664a6dc437bab3916968015b4580574335422243
https://github.com/mattdesl/gl-sprite-batch/blob/664a6dc437bab3916968015b4580574335422243/demo/dynamic.js#L21-L67
41,304
rorymadden/neoprene
lib/schema/mixed.js
Mixed
function Mixed (path, options) { // make sure empty array defaults are handled if (options && options.default && Array.isArray(options.default) && 0 === options.default.length) { options.default = Array; } SchemaType.call(this, path, options); }
javascript
function Mixed (path, options) { // make sure empty array defaults are handled if (options && options.default && Array.isArray(options.default) && 0 === options.default.length) { options.default = Array; } SchemaType.call(this, path, options); }
[ "function", "Mixed", "(", "path", ",", "options", ")", "{", "// make sure empty array defaults are handled", "if", "(", "options", "&&", "options", ".", "default", "&&", "Array", ".", "isArray", "(", "options", ".", "default", ")", "&&", "0", "===", "options",...
Mixed SchemaType constructor. @param {String} path @param {Object} options @inherits SchemaType @api private
[ "Mixed", "SchemaType", "constructor", "." ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/schema/mixed.js#L17-L27
41,305
3rd-Eden/node-bisection
index.js
bisection
function bisection(array, x, low, high){ // The low and high bounds the inital slice of the array that needs to be searched // this is optional low = low || 0; high = high || array.length; var mid; while (low < high) { mid = (low + high) >> 1; if (x < array[mid]) { high = mid; } else { ...
javascript
function bisection(array, x, low, high){ // The low and high bounds the inital slice of the array that needs to be searched // this is optional low = low || 0; high = high || array.length; var mid; while (low < high) { mid = (low + high) >> 1; if (x < array[mid]) { high = mid; } else { ...
[ "function", "bisection", "(", "array", ",", "x", ",", "low", ",", "high", ")", "{", "// The low and high bounds the inital slice of the array that needs to be searched", "// this is optional", "low", "=", "low", "||", "0", ";", "high", "=", "high", "||", "array", "....
Calculates the index of the Array where item X should be placed, assuming the Array is sorted. @param {Array} array The array containing the items. @param {Number} x The item that needs to be added to the array. @param {Number} low Inital Index that is used to start searching, optional. @param {Number} high The maximu...
[ "Calculates", "the", "index", "of", "the", "Array", "where", "item", "X", "should", "be", "placed", "assuming", "the", "Array", "is", "sorted", "." ]
d90998fa1ebc059e9707b68094eb38a99eaf406a
https://github.com/3rd-Eden/node-bisection/blob/d90998fa1ebc059e9707b68094eb38a99eaf406a/index.js#L12-L31
41,306
rorymadden/neoprene
lib/model.js
model
function model (doc, fields) { if (!(this instanceof model)) return new model(doc, fields); Model.call(this, doc, fields); }
javascript
function model (doc, fields) { if (!(this instanceof model)) return new model(doc, fields); Model.call(this, doc, fields); }
[ "function", "model", "(", "doc", ",", "fields", ")", "{", "if", "(", "!", "(", "this", "instanceof", "model", ")", ")", "return", "new", "model", "(", "doc", ",", "fields", ")", ";", "Model", ".", "call", "(", "this", ",", "doc", ",", "fields", "...
generate new class
[ "generate", "new", "class" ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/model.js#L50-L54
41,307
rorymadden/neoprene
lib/graphObject.js
GraphObject
function GraphObject(obj, fields) { this.isNew = true; this.errors = undefined; this._saveError = undefined; this._validationError = undefined; // this._adhocPaths = undefined; // this._removing = undefined; // this._inserting = undefined; // this.__version = undefined; this.__getters = {}; // this....
javascript
function GraphObject(obj, fields) { this.isNew = true; this.errors = undefined; this._saveError = undefined; this._validationError = undefined; // this._adhocPaths = undefined; // this._removing = undefined; // this._inserting = undefined; // this.__version = undefined; this.__getters = {}; // this....
[ "function", "GraphObject", "(", "obj", ",", "fields", ")", "{", "this", ".", "isNew", "=", "true", ";", "this", ".", "errors", "=", "undefined", ";", "this", ".", "_saveError", "=", "undefined", ";", "this", ".", "_validationError", "=", "undefined", ";"...
A wrapper object for a neo4j node or relationship @param {String} url Url for the neo4j database. @param {Object} data The properties of the neo4j object. @param {String} objectType node or relationship. @return {Object} The GraphObject object. @api private
[ "A", "wrapper", "object", "for", "a", "neo4j", "node", "or", "relationship" ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/graphObject.js#L35-L58
41,308
rorymadden/neoprene
lib/index.js
function(row, callback) { var map = {}, value; for (var i = 0, j = row.length; i < j; i++) { value = row[i]; // transform the value to either Node, Relationship or Path map[resColumns[i]] = utils.transform(value, self); } return callback(null, ...
javascript
function(row, callback) { var map = {}, value; for (var i = 0, j = row.length; i < j; i++) { value = row[i]; // transform the value to either Node, Relationship or Path map[resColumns[i]] = utils.transform(value, self); } return callback(null, ...
[ "function", "(", "row", ",", "callback", ")", "{", "var", "map", "=", "{", "}", ",", "value", ";", "for", "(", "var", "i", "=", "0", ",", "j", "=", "row", ".", "length", ";", "i", "<", "j", ";", "i", "++", ")", "{", "value", "=", "row", "...
each row returned could represent a node, relationship or path
[ "each", "row", "returned", "could", "represent", "a", "node", "relationship", "or", "path" ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/index.js#L248-L256
41,309
crudlio/crudl-connectors-base
lib/middleware/transformData.js
transformData
function transformData(methodRegExp) { var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (data) { return data; }; var re = new RegExp(methodRegExp || '.*'); // The middleware function return function transformDataMiddleware(next) { // Chec...
javascript
function transformData(methodRegExp) { var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (data) { return data; }; var re = new RegExp(methodRegExp || '.*'); // The middleware function return function transformDataMiddleware(next) { // Chec...
[ "function", "transformData", "(", "methodRegExp", ")", "{", "var", "transform", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "function", "(", "data", ")", "{", "r...
Creates a transformData middleware @methodRegExp Which methods should be transformed e.g. 'create|update' @transform The transform function
[ "Creates", "a", "transformData", "middleware" ]
454d541b3b3cf7eef5edf4fa84923458052c733a
https://github.com/crudlio/crudl-connectors-base/blob/454d541b3b3cf7eef5edf4fa84923458052c733a/lib/middleware/transformData.js#L12-L40
41,310
crudlio/crudl-connectors-base
lib/middleware/transformData.js
checkAndTransform
function checkAndTransform(method) { return re.test(method) ? function (req) { return next[method](req).then(function (res) { return Object.assign(res, { data: transform(res.data) }); }); } : function (req) { return next[method]...
javascript
function checkAndTransform(method) { return re.test(method) ? function (req) { return next[method](req).then(function (res) { return Object.assign(res, { data: transform(res.data) }); }); } : function (req) { return next[method]...
[ "function", "checkAndTransform", "(", "method", ")", "{", "return", "re", ".", "test", "(", "method", ")", "?", "function", "(", "req", ")", "{", "return", "next", "[", "method", "]", "(", "req", ")", ".", "then", "(", "function", "(", "res", ")", ...
Checks if the call should be transformed. If yes, it applies the transform function
[ "Checks", "if", "the", "call", "should", "be", "transformed", ".", "If", "yes", "it", "applies", "the", "transform", "function" ]
454d541b3b3cf7eef5edf4fa84923458052c733a
https://github.com/crudlio/crudl-connectors-base/blob/454d541b3b3cf7eef5edf4fa84923458052c733a/lib/middleware/transformData.js#L22-L30
41,311
rorymadden/neoprene
lib/schema.js
Schema
function Schema (obj, options) { if (!(this instanceof Schema)) return new Schema(obj, options); this.paths = {}; this.virtuals = {}; this.callQueue = []; this._indexes = []; this.methods = {}; this.statics = {}; this.tree = {}; this._requiredpaths = undefined; // set options this.options = ...
javascript
function Schema (obj, options) { if (!(this instanceof Schema)) return new Schema(obj, options); this.paths = {}; this.virtuals = {}; this.callQueue = []; this._indexes = []; this.methods = {}; this.statics = {}; this.tree = {}; this._requiredpaths = undefined; // set options this.options = ...
[ "function", "Schema", "(", "obj", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Schema", ")", ")", "return", "new", "Schema", "(", "obj", ",", "options", ")", ";", "this", ".", "paths", "=", "{", "}", ";", "this", ".", "vi...
Schema constructor. ####Example: var child = new Schema({ name: String }); var schema = new Schema({ name: String, age: Number }); var Tree = mongoose.model('node', Tree', schema); ####Options: - [safe](/docs/guide.html#safe): bool - defaults to true NOT IMPLEMENTED - [strict](/docs/guide.html#strict): bool - defau...
[ "Schema", "constructor", "." ]
11f22f65a006c25b779b2add9058e9b00b053466
https://github.com/rorymadden/neoprene/blob/11f22f65a006c25b779b2add9058e9b00b053466/lib/schema.js#L34-L63
41,312
joshmarinacci/aminogfx
src/widgets.js
function() { this.comps.base.add(this.comps.background); this.comps.base.add(this.comps.label); var self = this; this.setFill(amino.colortheme.button.fill.normal); amino.getCore().on('press', this, function(e) { self.setFill(amino.colortheme.button.fill.press...
javascript
function() { this.comps.base.add(this.comps.background); this.comps.base.add(this.comps.label); var self = this; this.setFill(amino.colortheme.button.fill.normal); amino.getCore().on('press', this, function(e) { self.setFill(amino.colortheme.button.fill.press...
[ "function", "(", ")", "{", "this", ".", "comps", ".", "base", ".", "add", "(", "this", ".", "comps", ".", "background", ")", ";", "this", ".", "comps", ".", "base", ".", "add", "(", "this", ".", "comps", ".", "label", ")", ";", "var", "self", "...
replaces all setters
[ "replaces", "all", "setters" ]
bafc6567f3fc3f244d7bff3d6c980fd69750b663
https://github.com/joshmarinacci/aminogfx/blob/bafc6567f3fc3f244d7bff3d6c980fd69750b663/src/widgets.js#L87-L124
41,313
eivindfjeldstad/textarea-editor
src/editor.js
hasPrefix
function hasPrefix(text, prefix) { let exp = new RegExp(`^${prefix.pattern}`); let result = exp.test(text); if (prefix.antipattern) { let exp = new RegExp(`^${prefix.antipattern}`); result = result && !exp.test(text); } return result; }
javascript
function hasPrefix(text, prefix) { let exp = new RegExp(`^${prefix.pattern}`); let result = exp.test(text); if (prefix.antipattern) { let exp = new RegExp(`^${prefix.antipattern}`); result = result && !exp.test(text); } return result; }
[ "function", "hasPrefix", "(", "text", ",", "prefix", ")", "{", "let", "exp", "=", "new", "RegExp", "(", "`", "${", "prefix", ".", "pattern", "}", "`", ")", ";", "let", "result", "=", "exp", ".", "test", "(", "text", ")", ";", "if", "(", "prefix",...
Check if given prefix is present. @private
[ "Check", "if", "given", "prefix", "is", "present", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L279-L289
41,314
eivindfjeldstad/textarea-editor
src/editor.js
hasSuffix
function hasSuffix(text, suffix) { let exp = new RegExp(`${suffix.pattern}$`); let result = exp.test(text); if (suffix.antipattern) { let exp = new RegExp(`${suffix.antipattern}$`); result = result && !exp.test(text); } return result; }
javascript
function hasSuffix(text, suffix) { let exp = new RegExp(`${suffix.pattern}$`); let result = exp.test(text); if (suffix.antipattern) { let exp = new RegExp(`${suffix.antipattern}$`); result = result && !exp.test(text); } return result; }
[ "function", "hasSuffix", "(", "text", ",", "suffix", ")", "{", "let", "exp", "=", "new", "RegExp", "(", "`", "${", "suffix", ".", "pattern", "}", "`", ")", ";", "let", "result", "=", "exp", ".", "test", "(", "text", ")", ";", "if", "(", "suffix",...
Check if given suffix is present. @private
[ "Check", "if", "given", "suffix", "is", "present", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L296-L306
41,315
eivindfjeldstad/textarea-editor
src/editor.js
matchLength
function matchLength(text, exp) { const match = text.match(exp); return match ? match[0].length : 0; }
javascript
function matchLength(text, exp) { const match = text.match(exp); return match ? match[0].length : 0; }
[ "function", "matchLength", "(", "text", ",", "exp", ")", "{", "const", "match", "=", "text", ".", "match", "(", "exp", ")", ";", "return", "match", "?", "match", "[", "0", "]", ".", "length", ":", "0", ";", "}" ]
Get length of match. @private
[ "Get", "length", "of", "match", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L313-L316
41,316
eivindfjeldstad/textarea-editor
src/editor.js
prefixLength
function prefixLength(text, prefix) { const exp = new RegExp(`^${prefix.pattern}`); return matchLength(text, exp); }
javascript
function prefixLength(text, prefix) { const exp = new RegExp(`^${prefix.pattern}`); return matchLength(text, exp); }
[ "function", "prefixLength", "(", "text", ",", "prefix", ")", "{", "const", "exp", "=", "new", "RegExp", "(", "`", "${", "prefix", ".", "pattern", "}", "`", ")", ";", "return", "matchLength", "(", "text", ",", "exp", ")", ";", "}" ]
Get prefix length. @private
[ "Get", "prefix", "length", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L323-L326
41,317
eivindfjeldstad/textarea-editor
src/editor.js
suffixLength
function suffixLength(text, suffix) { let exp = new RegExp(`${suffix.pattern}$`); return matchLength(text, exp); }
javascript
function suffixLength(text, suffix) { let exp = new RegExp(`${suffix.pattern}$`); return matchLength(text, exp); }
[ "function", "suffixLength", "(", "text", ",", "suffix", ")", "{", "let", "exp", "=", "new", "RegExp", "(", "`", "${", "suffix", ".", "pattern", "}", "`", ")", ";", "return", "matchLength", "(", "text", ",", "exp", ")", ";", "}" ]
Get suffix length. @private
[ "Get", "suffix", "length", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L333-L336
41,318
eivindfjeldstad/textarea-editor
src/editor.js
normalizeFormat
function normalizeFormat(format) { const clone = Object.assign({}, format); clone.prefix = normalizePrefixSuffix(format.prefix); clone.suffix = normalizePrefixSuffix(format.suffix); return clone; }
javascript
function normalizeFormat(format) { const clone = Object.assign({}, format); clone.prefix = normalizePrefixSuffix(format.prefix); clone.suffix = normalizePrefixSuffix(format.suffix); return clone; }
[ "function", "normalizeFormat", "(", "format", ")", "{", "const", "clone", "=", "Object", ".", "assign", "(", "{", "}", ",", "format", ")", ";", "clone", ".", "prefix", "=", "normalizePrefixSuffix", "(", "format", ".", "prefix", ")", ";", "clone", ".", ...
Normalize format. @private
[ "Normalize", "format", "." ]
f3c0183291a014a82b5c7657c282bce727323da7
https://github.com/eivindfjeldstad/textarea-editor/blob/f3c0183291a014a82b5c7657c282bce727323da7/src/editor.js#L352-L357
41,319
joshmarinacci/aminogfx
demos/slideshow/slideshow.js
scaleImage
function scaleImage(img,prop,obj) { var scale = Math.min(sw/img.w,sh/img.h); obj.sx(scale).sy(scale); }
javascript
function scaleImage(img,prop,obj) { var scale = Math.min(sw/img.w,sh/img.h); obj.sx(scale).sy(scale); }
[ "function", "scaleImage", "(", "img", ",", "prop", ",", "obj", ")", "{", "var", "scale", "=", "Math", ".", "min", "(", "sw", "/", "img", ".", "w", ",", "sh", "/", "img", ".", "h", ")", ";", "obj", ".", "sx", "(", "scale", ")", ".", "sy", "(...
auto scale them
[ "auto", "scale", "them" ]
bafc6567f3fc3f244d7bff3d6c980fd69750b663
https://github.com/joshmarinacci/aminogfx/blob/bafc6567f3fc3f244d7bff3d6c980fd69750b663/demos/slideshow/slideshow.js#L50-L53
41,320
joshmarinacci/aminogfx
demos/slideshow/slideshow.js
swap
function swap() { iv1.x.anim().delay(1000).from(0).to(-sw).dur(3000).start(); iv2.x.anim().delay(1000).from(sw).to(0).dur(3000) .then(afterAnim).start(); }
javascript
function swap() { iv1.x.anim().delay(1000).from(0).to(-sw).dur(3000).start(); iv2.x.anim().delay(1000).from(sw).to(0).dur(3000) .then(afterAnim).start(); }
[ "function", "swap", "(", ")", "{", "iv1", ".", "x", ".", "anim", "(", ")", ".", "delay", "(", "1000", ")", ".", "from", "(", "0", ")", ".", "to", "(", "-", "sw", ")", ".", "dur", "(", "3000", ")", ".", "start", "(", ")", ";", "iv2", ".", ...
animate out and in
[ "animate", "out", "and", "in" ]
bafc6567f3fc3f244d7bff3d6c980fd69750b663
https://github.com/joshmarinacci/aminogfx/blob/bafc6567f3fc3f244d7bff3d6c980fd69750b663/demos/slideshow/slideshow.js#L64-L68
41,321
joshmarinacci/aminogfx
demos/adsr/adsr.js
updatePolys
function updatePolys() { border.geometry([0,200, adsr.a(),50, adsr.d(),adsr.s(), adsr.r(),adsr.s(), 300,200]); aPoly.geometry([ 0,200, adsr.a(),50, adsr.a(),200 ]); dPoly.geometry([ adsr.a...
javascript
function updatePolys() { border.geometry([0,200, adsr.a(),50, adsr.d(),adsr.s(), adsr.r(),adsr.s(), 300,200]); aPoly.geometry([ 0,200, adsr.a(),50, adsr.a(),200 ]); dPoly.geometry([ adsr.a...
[ "function", "updatePolys", "(", ")", "{", "border", ".", "geometry", "(", "[", "0", ",", "200", ",", "adsr", ".", "a", "(", ")", ",", "50", ",", "adsr", ".", "d", "(", ")", ",", "adsr", ".", "s", "(", ")", ",", "adsr", ".", "r", "(", ")", ...
update the polygons when the model changes
[ "update", "the", "polygons", "when", "the", "model", "changes" ]
bafc6567f3fc3f244d7bff3d6c980fd69750b663
https://github.com/joshmarinacci/aminogfx/blob/bafc6567f3fc3f244d7bff3d6c980fd69750b663/demos/adsr/adsr.js#L48-L77
41,322
nathanboktae/q-xhr
q-xhr.js
extend
function extend(dst) { Array.prototype.forEach.call(arguments, function(obj) { if (obj && obj !== dst) { Object.keys(obj).forEach(function(key) { dst[key] = obj[key] }) } }) return dst }
javascript
function extend(dst) { Array.prototype.forEach.call(arguments, function(obj) { if (obj && obj !== dst) { Object.keys(obj).forEach(function(key) { dst[key] = obj[key] }) } }) return dst }
[ "function", "extend", "(", "dst", ")", "{", "Array", ".", "prototype", ".", "forEach", ".", "call", "(", "arguments", ",", "function", "(", "obj", ")", "{", "if", "(", "obj", "&&", "obj", "!==", "dst", ")", "{", "Object", ".", "keys", "(", "obj", ...
shallow extend with varargs
[ "shallow", "extend", "with", "varargs" ]
40525e1871b8eec8a9ffaf8e222ede6ec5f389bd
https://github.com/nathanboktae/q-xhr/blob/40525e1871b8eec8a9ffaf8e222ede6ec5f389bd/q-xhr.js#L21-L31
41,323
herrstucki/sprout
src/hasIn.js
hasIn
function hasIn(obj, keys) { var k = keys[0], ks = keys.slice(1); if (ks.length) return !(k in obj) ? false : hasIn(obj[k], ks); return (k in obj); }
javascript
function hasIn(obj, keys) { var k = keys[0], ks = keys.slice(1); if (ks.length) return !(k in obj) ? false : hasIn(obj[k], ks); return (k in obj); }
[ "function", "hasIn", "(", "obj", ",", "keys", ")", "{", "var", "k", "=", "keys", "[", "0", "]", ",", "ks", "=", "keys", ".", "slice", "(", "1", ")", ";", "if", "(", "ks", ".", "length", ")", "return", "!", "(", "k", "in", "obj", ")", "?", ...
Check if a nested property is present. Currently only used internally
[ "Check", "if", "a", "nested", "property", "is", "present", ".", "Currently", "only", "used", "internally" ]
9bb4697cdf6b84411e0e727683e032ee44b5dd83
https://github.com/herrstucki/sprout/blob/9bb4697cdf6b84411e0e727683e032ee44b5dd83/src/hasIn.js#L3-L8
41,324
herrstucki/sprout
src/getIn.js
getIn
function getIn(obj, keys, orValue) { var k = keys[0], ks = keys.slice(1); return get(obj, k) && ks.length ? getIn(obj[k], ks, orValue) : get(obj, k, orValue); }
javascript
function getIn(obj, keys, orValue) { var k = keys[0], ks = keys.slice(1); return get(obj, k) && ks.length ? getIn(obj[k], ks, orValue) : get(obj, k, orValue); }
[ "function", "getIn", "(", "obj", ",", "keys", ",", "orValue", ")", "{", "var", "k", "=", "keys", "[", "0", "]", ",", "ks", "=", "keys", ".", "slice", "(", "1", ")", ";", "return", "get", "(", "obj", ",", "k", ")", "&&", "ks", ".", "length", ...
Get value from a nested structure or null.
[ "Get", "value", "from", "a", "nested", "structure", "or", "null", "." ]
9bb4697cdf6b84411e0e727683e032ee44b5dd83
https://github.com/herrstucki/sprout/blob/9bb4697cdf6b84411e0e727683e032ee44b5dd83/src/getIn.js#L4-L8
41,325
75lb/array-tools
lib/array-tools.js
pluck
function pluck (recordset, property) { recordset = arrayify(recordset) var properties = arrayify(property) return recordset .map(function (record) { for (var i = 0; i < properties.length; i++) { var propValue = objectGet(record, properties[i]) if (propValue) return propValue } ...
javascript
function pluck (recordset, property) { recordset = arrayify(recordset) var properties = arrayify(property) return recordset .map(function (record) { for (var i = 0; i < properties.length; i++) { var propValue = objectGet(record, properties[i]) if (propValue) return propValue } ...
[ "function", "pluck", "(", "recordset", ",", "property", ")", "{", "recordset", "=", "arrayify", "(", "recordset", ")", "var", "properties", "=", "arrayify", "(", "property", ")", "return", "recordset", ".", "map", "(", "function", "(", "record", ")", "{", ...
Returns an array containing each value plucked from the specified property of each object in the input array. @param recordset {object[]} - The input recordset @param property {string|string[]} - Property name, or an array of property names. If an array is supplied, the first existing property will be returned. @retur...
[ "Returns", "an", "array", "containing", "each", "value", "plucked", "from", "the", "specified", "property", "of", "each", "object", "in", "the", "input", "array", "." ]
0b0bc3db025ada4cc58c182b40a45ee641d27a87
https://github.com/75lb/array-tools/blob/0b0bc3db025ada4cc58c182b40a45ee641d27a87/lib/array-tools.js#L289-L303
41,326
75lb/array-tools
lib/array-tools.js
spliceWhile
function spliceWhile (array, index, test) { for (var i = 0; i < array.length; i++) { if (!testValue(array[i], test)) break } var spliceArgs = [ index, i ] spliceArgs = spliceArgs.concat(arrayify(arguments).slice(3)) return array.splice.apply(array, spliceArgs) }
javascript
function spliceWhile (array, index, test) { for (var i = 0; i < array.length; i++) { if (!testValue(array[i], test)) break } var spliceArgs = [ index, i ] spliceArgs = spliceArgs.concat(arrayify(arguments).slice(3)) return array.splice.apply(array, spliceArgs) }
[ "function", "spliceWhile", "(", "array", ",", "index", ",", "test", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "array", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "testValue", "(", "array", "[", "i", "]", ",", "t...
Splice items from the input array until the matching test fails. Returns an array containing the items removed. @param array {Array} - the input array @param index {number} - the position to begin splicing from @param test {any} - the sequence of items passing this test will be removed @param [elementN] {...*} - eleme...
[ "Splice", "items", "from", "the", "input", "array", "until", "the", "matching", "test", "fails", ".", "Returns", "an", "array", "containing", "the", "items", "removed", "." ]
0b0bc3db025ada4cc58c182b40a45ee641d27a87
https://github.com/75lb/array-tools/blob/0b0bc3db025ada4cc58c182b40a45ee641d27a87/lib/array-tools.js#L434-L441
41,327
sazze/node-pm
lib/clusterEvents.js
forkTimeoutHandler
function forkTimeoutHandler(worker, cluster) { verbose('worker %d is stuck in fork', worker.process.pid); if (!cluster.workers[worker.id]) { return; } // something is wrong with this worker. Kill it! master.suicideOverrides[worker.id] = worker.id; master.isRunning(worker, function(runn...
javascript
function forkTimeoutHandler(worker, cluster) { verbose('worker %d is stuck in fork', worker.process.pid); if (!cluster.workers[worker.id]) { return; } // something is wrong with this worker. Kill it! master.suicideOverrides[worker.id] = worker.id; master.isRunning(worker, function(runn...
[ "function", "forkTimeoutHandler", "(", "worker", ",", "cluster", ")", "{", "verbose", "(", "'worker %d is stuck in fork'", ",", "worker", ".", "process", ".", "pid", ")", ";", "if", "(", "!", "cluster", ".", "workers", "[", "worker", ".", "id", "]", ")", ...
Called when worker takes too long to fork @private @param worker @param cluster
[ "Called", "when", "worker", "takes", "too", "long", "to", "fork" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/clusterEvents.js#L155-L177
41,328
sazze/node-pm
lib/clusterEvents.js
disconnectTimeoutHandler
function disconnectTimeoutHandler(worker, cluster) { verbose('worker %d is stuck in disconnect', worker.process.pid); // if this is not a suicide we need to preserve that as worker.kill() will make this a suicide if (!worker.suicide) { master.suicideOverrides[worker.id] = worker.id; } master...
javascript
function disconnectTimeoutHandler(worker, cluster) { verbose('worker %d is stuck in disconnect', worker.process.pid); // if this is not a suicide we need to preserve that as worker.kill() will make this a suicide if (!worker.suicide) { master.suicideOverrides[worker.id] = worker.id; } master...
[ "function", "disconnectTimeoutHandler", "(", "worker", ",", "cluster", ")", "{", "verbose", "(", "'worker %d is stuck in disconnect'", ",", "worker", ".", "process", ".", "pid", ")", ";", "// if this is not a suicide we need to preserve that as worker.kill() will make this a su...
Called when worker is taking too long to disconnect @private @param worker @param cluster
[ "Called", "when", "worker", "is", "taking", "too", "long", "to", "disconnect" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/clusterEvents.js#L186-L206
41,329
hapticdata/animitter
index.js
makeThrottle
function makeThrottle(fps){ var delay = 1000/fps; var lastTime = Date.now(); if( fps<=0 || fps === Infinity ){ return returnTrue; } //if an fps throttle has been set then we'll assume //it natively runs at 60fps, var half = Math.ceil(1000 / 60) / 2; return function(){ ...
javascript
function makeThrottle(fps){ var delay = 1000/fps; var lastTime = Date.now(); if( fps<=0 || fps === Infinity ){ return returnTrue; } //if an fps throttle has been set then we'll assume //it natively runs at 60fps, var half = Math.ceil(1000 / 60) / 2; return function(){ ...
[ "function", "makeThrottle", "(", "fps", ")", "{", "var", "delay", "=", "1000", "/", "fps", ";", "var", "lastTime", "=", "Date", ".", "now", "(", ")", ";", "if", "(", "fps", "<=", "0", "||", "fps", "===", "Infinity", ")", "{", "return", "returnTrue"...
manage FPS if < 60, else return true;
[ "manage", "FPS", "if", "<", "60", "else", "return", "true", ";" ]
4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e
https://github.com/hapticdata/animitter/blob/4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e/index.js#L16-L40
41,330
hapticdata/animitter
index.js
Animitter
function Animitter( opts ){ opts = opts || {}; this.__delay = opts.delay || 0; /** @expose */ this.fixedDelta = !!opts.fixedDelta; /** @expose */ this.frameCount = 0; /** @expose */ this.deltaTime = 0; /** @expose */ this.elapsedTime = 0; /** @private */ this.__runnin...
javascript
function Animitter( opts ){ opts = opts || {}; this.__delay = opts.delay || 0; /** @expose */ this.fixedDelta = !!opts.fixedDelta; /** @expose */ this.frameCount = 0; /** @expose */ this.deltaTime = 0; /** @expose */ this.elapsedTime = 0; /** @private */ this.__runnin...
[ "function", "Animitter", "(", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "this", ".", "__delay", "=", "opts", ".", "delay", "||", "0", ";", "/** @expose */", "this", ".", "fixedDelta", "=", "!", "!", "opts", ".", "fixedDelta", ";", ...
Animitter provides event-based loops for the browser and node, using `requestAnimationFrame` @param {Object} [opts] @param {Number} [opts.fps=Infinity] the framerate requested, defaults to as fast as it can (60fps on window) @param {Number} [opts.delay=0] milliseconds delay between invoking `start` and initializing the...
[ "Animitter", "provides", "event", "-", "based", "loops", "for", "the", "browser", "and", "node", "using", "requestAnimationFrame" ]
4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e
https://github.com/hapticdata/animitter/blob/4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e/index.js#L53-L75
41,331
hapticdata/animitter
index.js
function(){ this.frameCount++; /** @private */ var now = Date.now(); this.__lastTime = this.__lastTime || now; this.deltaTime = (this.fixedDelta || exports.globalFixedDelta) ? 1000/Math.min(60, this.__fps) : now - this.__lastTime; this.elapsedTime += this.deltaTime; ...
javascript
function(){ this.frameCount++; /** @private */ var now = Date.now(); this.__lastTime = this.__lastTime || now; this.deltaTime = (this.fixedDelta || exports.globalFixedDelta) ? 1000/Math.min(60, this.__fps) : now - this.__lastTime; this.elapsedTime += this.deltaTime; ...
[ "function", "(", ")", "{", "this", ".", "frameCount", "++", ";", "/** @private */", "var", "now", "=", "Date", ".", "now", "(", ")", ";", "this", ".", "__lastTime", "=", "this", ".", "__lastTime", "||", "now", ";", "this", ".", "deltaTime", "=", "(",...
update the animation loop once @emit Animitter#update @return {Animitter}
[ "update", "the", "animation", "loop", "once" ]
4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e
https://github.com/hapticdata/animitter/blob/4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e/index.js#L311-L322
41,332
hapticdata/animitter
index.js
createAnimitter
function createAnimitter(options, fn){ if( arguments.length === 1 && typeof options === 'function'){ fn = options; options = {}; } var _instance = new Animitter( options ); if( fn ){ _instance.on('update', fn); } return _instance; }
javascript
function createAnimitter(options, fn){ if( arguments.length === 1 && typeof options === 'function'){ fn = options; options = {}; } var _instance = new Animitter( options ); if( fn ){ _instance.on('update', fn); } return _instance; }
[ "function", "createAnimitter", "(", "options", ",", "fn", ")", "{", "if", "(", "arguments", ".", "length", "===", "1", "&&", "typeof", "options", "===", "'function'", ")", "{", "fn", "=", "options", ";", "options", "=", "{", "}", ";", "}", "var", "_i...
create an animitter instance, @param {Object} [options] @param {Function} fn( deltaTime:Number, elapsedTime:Number, frameCount:Number ) @returns {Animitter}
[ "create", "an", "animitter", "instance" ]
4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e
https://github.com/hapticdata/animitter/blob/4488a9e3ac8e3bf04ea09f6b253b00c3f8701d6e/index.js#L338-L352
41,333
sazze/node-pm
lib/master.js
fork
function fork(number) { var numProc = number || require('os').cpus().length; config.n = numProc; debug('forking %d workers', numProc); forkLoopProtect(); for (var i = 0; i < numProc; i++) { cluster.fork({PWD: config.CWD}); } }
javascript
function fork(number) { var numProc = number || require('os').cpus().length; config.n = numProc; debug('forking %d workers', numProc); forkLoopProtect(); for (var i = 0; i < numProc; i++) { cluster.fork({PWD: config.CWD}); } }
[ "function", "fork", "(", "number", ")", "{", "var", "numProc", "=", "number", "||", "require", "(", "'os'", ")", ".", "cpus", "(", ")", ".", "length", ";", "config", ".", "n", "=", "numProc", ";", "debug", "(", "'forking %d workers'", ",", "numProc", ...
Fork Workers N times @private @param {int} [number=cpus.length] the number of processes to start
[ "Fork", "Workers", "N", "times" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/master.js#L339-L351
41,334
sazze/node-pm
lib/master.js
lifecycleTimeoutHandler
function lifecycleTimeoutHandler() { if (shutdownCalled) { return; } verbose('workers have reached the end of their life'); master.restart(function () { if (!shutdownCalled) { lifecycleTimer = setTimeout(lifecycleTimeoutHandler.bind(master), config.timeouts.maxAge); } }); }
javascript
function lifecycleTimeoutHandler() { if (shutdownCalled) { return; } verbose('workers have reached the end of their life'); master.restart(function () { if (!shutdownCalled) { lifecycleTimer = setTimeout(lifecycleTimeoutHandler.bind(master), config.timeouts.maxAge); } }); }
[ "function", "lifecycleTimeoutHandler", "(", ")", "{", "if", "(", "shutdownCalled", ")", "{", "return", ";", "}", "verbose", "(", "'workers have reached the end of their life'", ")", ";", "master", ".", "restart", "(", "function", "(", ")", "{", "if", "(", "!",...
Called when workers have reached the end of their lifespan @private
[ "Called", "when", "workers", "have", "reached", "the", "end", "of", "their", "lifespan" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/master.js#L358-L370
41,335
snatalenko/node-cqrs
src/Observer.js
subscribe
function subscribe(observable, observer, options) { if (typeof observable !== 'object' || !observable) throw new TypeError('observable argument must be an Object'); if (typeof observable.on !== 'function') throw new TypeError('observable.on must be a Function'); if (typeof observer !== 'object' || !observer) t...
javascript
function subscribe(observable, observer, options) { if (typeof observable !== 'object' || !observable) throw new TypeError('observable argument must be an Object'); if (typeof observable.on !== 'function') throw new TypeError('observable.on must be a Function'); if (typeof observer !== 'object' || !observer) t...
[ "function", "subscribe", "(", "observable", ",", "observer", ",", "options", ")", "{", "if", "(", "typeof", "observable", "!==", "'object'", "||", "!", "observable", ")", "throw", "new", "TypeError", "(", "'observable argument must be an Object'", ")", ";", "if"...
Subscribe observer to observable @param {IObservable} observable @param {IObserver} observer @param {TSubscribeOptions} [options]
[ "Subscribe", "observer", "to", "observable" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/Observer.js#L14-L44
41,336
battlejj/recursive-readdir-sync
index.js
recursiveReaddirSync
function recursiveReaddirSync(path) { var list = [] , files = fs.readdirSync(path) , stats ; files.forEach(function (file) { stats = fs.lstatSync(p.join(path, file)); if(stats.isDirectory()) { list = list.concat(recursiveReaddirSync(p.join(path, file))); } else { list.push(p.joi...
javascript
function recursiveReaddirSync(path) { var list = [] , files = fs.readdirSync(path) , stats ; files.forEach(function (file) { stats = fs.lstatSync(p.join(path, file)); if(stats.isDirectory()) { list = list.concat(recursiveReaddirSync(p.join(path, file))); } else { list.push(p.joi...
[ "function", "recursiveReaddirSync", "(", "path", ")", "{", "var", "list", "=", "[", "]", ",", "files", "=", "fs", ".", "readdirSync", "(", "path", ")", ",", "stats", ";", "files", ".", "forEach", "(", "function", "(", "file", ")", "{", "stats", "=", ...
how to know when you are done?
[ "how", "to", "know", "when", "you", "are", "done?" ]
77b9b005c95128252f9f4a8a17a8318c0219e7c3
https://github.com/battlejj/recursive-readdir-sync/blob/77b9b005c95128252f9f4a8a17a8318c0219e7c3/index.js#L6-L22
41,337
snatalenko/node-cqrs
src/EventStore.js
validateEvent
function validateEvent(event) { if (typeof event !== 'object' || !event) throw new TypeError('event must be an Object'); if (typeof event.type !== 'string' || !event.type.length) throw new TypeError('event.type must be a non-empty String'); if (!event.aggregateId && !event.sagaId) throw new TypeError('either event.a...
javascript
function validateEvent(event) { if (typeof event !== 'object' || !event) throw new TypeError('event must be an Object'); if (typeof event.type !== 'string' || !event.type.length) throw new TypeError('event.type must be a non-empty String'); if (!event.aggregateId && !event.sagaId) throw new TypeError('either event.a...
[ "function", "validateEvent", "(", "event", ")", "{", "if", "(", "typeof", "event", "!==", "'object'", "||", "!", "event", ")", "throw", "new", "TypeError", "(", "'event must be an Object'", ")", ";", "if", "(", "typeof", "event", ".", "type", "!==", "'stri...
Validate event structure @param {IEvent} event
[ "Validate", "event", "structure" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/EventStore.js#L19-L24
41,338
snatalenko/node-cqrs
src/EventStore.js
validateEventStorage
function validateEventStorage(storage) { if (!storage) throw new TypeError('storage argument required'); if (typeof storage !== 'object') throw new TypeError('storage argument must be an Object'); if (typeof storage.commitEvents !== 'function') throw new TypeError('storage.commitEvents must be a Function'); if (typ...
javascript
function validateEventStorage(storage) { if (!storage) throw new TypeError('storage argument required'); if (typeof storage !== 'object') throw new TypeError('storage argument must be an Object'); if (typeof storage.commitEvents !== 'function') throw new TypeError('storage.commitEvents must be a Function'); if (typ...
[ "function", "validateEventStorage", "(", "storage", ")", "{", "if", "(", "!", "storage", ")", "throw", "new", "TypeError", "(", "'storage argument required'", ")", ";", "if", "(", "typeof", "storage", "!==", "'object'", ")", "throw", "new", "TypeError", "(", ...
Ensure provided eventStorage matches the expected format @param {IEventStorage} storage
[ "Ensure", "provided", "eventStorage", "matches", "the", "expected", "format" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/EventStore.js#L30-L38
41,339
snatalenko/node-cqrs
src/EventStore.js
validateSnapshotStorage
function validateSnapshotStorage(snapshotStorage) { if (typeof snapshotStorage !== 'object' || !snapshotStorage) throw new TypeError('snapshotStorage argument must be an Object'); if (typeof snapshotStorage.getAggregateSnapshot !== 'function') throw new TypeError('snapshotStorage.getAggregateSnapshot argument mus...
javascript
function validateSnapshotStorage(snapshotStorage) { if (typeof snapshotStorage !== 'object' || !snapshotStorage) throw new TypeError('snapshotStorage argument must be an Object'); if (typeof snapshotStorage.getAggregateSnapshot !== 'function') throw new TypeError('snapshotStorage.getAggregateSnapshot argument mus...
[ "function", "validateSnapshotStorage", "(", "snapshotStorage", ")", "{", "if", "(", "typeof", "snapshotStorage", "!==", "'object'", "||", "!", "snapshotStorage", ")", "throw", "new", "TypeError", "(", "'snapshotStorage argument must be an Object'", ")", ";", "if", "("...
Ensure snapshotStorage matches the expected format @param {IAggregateSnapshotStorage} snapshotStorage
[ "Ensure", "snapshotStorage", "matches", "the", "expected", "format" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/EventStore.js#L54-L61
41,340
snatalenko/node-cqrs
src/EventStore.js
validateMessageBus
function validateMessageBus(messageBus) { if (typeof messageBus !== 'object' || !messageBus) throw new TypeError('messageBus argument must be an Object'); if (typeof messageBus.on !== 'function') throw new TypeError('messageBus.on argument must be a Function'); if (typeof messageBus.publish !== 'function') thr...
javascript
function validateMessageBus(messageBus) { if (typeof messageBus !== 'object' || !messageBus) throw new TypeError('messageBus argument must be an Object'); if (typeof messageBus.on !== 'function') throw new TypeError('messageBus.on argument must be a Function'); if (typeof messageBus.publish !== 'function') thr...
[ "function", "validateMessageBus", "(", "messageBus", ")", "{", "if", "(", "typeof", "messageBus", "!==", "'object'", "||", "!", "messageBus", ")", "throw", "new", "TypeError", "(", "'messageBus argument must be an Object'", ")", ";", "if", "(", "typeof", "messageB...
Ensure messageBus matches the expected format @param {IMessageBus} messageBus
[ "Ensure", "messageBus", "matches", "the", "expected", "format" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/EventStore.js#L67-L74
41,341
snatalenko/node-cqrs
src/EventStore.js
setupOneTimeEmitterSubscription
function setupOneTimeEmitterSubscription(emitter, messageTypes, filter, handler) { if (typeof emitter !== 'object' || !emitter) throw new TypeError('emitter argument must be an Object'); if (!Array.isArray(messageTypes) || messageTypes.some(m => !m || typeof m !== 'string')) throw new TypeError('messageTypes argu...
javascript
function setupOneTimeEmitterSubscription(emitter, messageTypes, filter, handler) { if (typeof emitter !== 'object' || !emitter) throw new TypeError('emitter argument must be an Object'); if (!Array.isArray(messageTypes) || messageTypes.some(m => !m || typeof m !== 'string')) throw new TypeError('messageTypes argu...
[ "function", "setupOneTimeEmitterSubscription", "(", "emitter", ",", "messageTypes", ",", "filter", ",", "handler", ")", "{", "if", "(", "typeof", "emitter", "!==", "'object'", "||", "!", "emitter", ")", "throw", "new", "TypeError", "(", "'emitter argument must be ...
Create one-time eventEmitter subscription for one or multiple events that match a filter @param {IEventEmitter} emitter @param {string[]} messageTypes Array of event type to subscribe to @param {function(IEvent):any} [handler] Optional handler to execute for a first event received @param {function(IEvent):boolean} [fi...
[ "Create", "one", "-", "time", "eventEmitter", "subscription", "for", "one", "or", "multiple", "events", "that", "match", "a", "filter" ]
32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c
https://github.com/snatalenko/node-cqrs/blob/32e2a8ff8bbb70e199e60cd44fd2f4ee19ee5a5c/src/EventStore.js#L86-L124
41,342
sazze/node-pm
lib/main.js
function(settings, callback) { "use strict"; if (typeof settings === 'function') { callback = settings; settings = {}; } if (typeof settings === 'undefined') { settings = {}; } if (typeof callback !== 'function') { callback = function () {}; } getLogFiles(func...
javascript
function(settings, callback) { "use strict"; if (typeof settings === 'function') { callback = settings; settings = {}; } if (typeof settings === 'undefined') { settings = {}; } if (typeof callback !== 'function') { callback = function () {}; } getLogFiles(func...
[ "function", "(", "settings", ",", "callback", ")", "{", "\"use strict\"", ";", "if", "(", "typeof", "settings", "===", "'function'", ")", "{", "callback", "=", "settings", ";", "settings", "=", "{", "}", ";", "}", "if", "(", "typeof", "settings", "===", ...
Start the Worker Manager @param [settings={}] @param [callback=function]
[ "Start", "the", "Worker", "Manager" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/main.js#L28-L60
41,343
sazze/node-pm
lib/Logger.js
log
function log(logLevel, prefix, args) { "use strict"; if (logLevel > level) { return; } args = Array.prototype.slice.call(args); if (typeof args[0] === 'undefined') { return; } var message = args[0]; args.splice(0, 1, prefix + message); console.log.apply(this, args); }
javascript
function log(logLevel, prefix, args) { "use strict"; if (logLevel > level) { return; } args = Array.prototype.slice.call(args); if (typeof args[0] === 'undefined') { return; } var message = args[0]; args.splice(0, 1, prefix + message); console.log.apply(this, args); }
[ "function", "log", "(", "logLevel", ",", "prefix", ",", "args", ")", "{", "\"use strict\"", ";", "if", "(", "logLevel", ">", "level", ")", "{", "return", ";", "}", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "args", ")", ...
The internal log function @private @param {int} logLevel the log level that is allowed @param prefix the prefix that gets prepended to the message @param args and object of arguments, usually from global [arguments]
[ "The", "internal", "log", "function" ]
d2f1348cb0446e98dcf873e319b55ce89f79b386
https://github.com/sazze/node-pm/blob/d2f1348cb0446e98dcf873e319b55ce89f79b386/lib/Logger.js#L95-L111
41,344
dpw/promisify
promisify.js
append
function append(arrlike /* , items... */) { return Array.prototype.slice.call(arrlike, 0).concat(Array.prototype.slice.call(arguments, 1)); }
javascript
function append(arrlike /* , items... */) { return Array.prototype.slice.call(arrlike, 0).concat(Array.prototype.slice.call(arguments, 1)); }
[ "function", "append", "(", "arrlike", "/* , items... */", ")", "{", "return", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arrlike", ",", "0", ")", ".", "concat", "(", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments",...
Append items to an array-like object
[ "Append", "items", "to", "an", "array", "-", "like", "object" ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L11-L13
41,345
dpw/promisify
promisify.js
promisify_value
function promisify_value(result_transformer) { result_transformer = result_transformer || identity; var transformer = function (promise) { result_transformer(promise); }; transformer.for_property = function (obj_promise, prop) { return when(obj_promise, function (obj) { res...
javascript
function promisify_value(result_transformer) { result_transformer = result_transformer || identity; var transformer = function (promise) { result_transformer(promise); }; transformer.for_property = function (obj_promise, prop) { return when(obj_promise, function (obj) { res...
[ "function", "promisify_value", "(", "result_transformer", ")", "{", "result_transformer", "=", "result_transformer", "||", "identity", ";", "var", "transformer", "=", "function", "(", "promise", ")", "{", "result_transformer", "(", "promise", ")", ";", "}", ";", ...
Produces a transformer that takes a value and simply returns it.
[ "Produces", "a", "transformer", "that", "takes", "a", "value", "and", "simply", "returns", "it", "." ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L19-L33
41,346
dpw/promisify
promisify.js
promisify_func
function promisify_func(result_transformer) { result_transformer = result_transformer || identity; var transformer = function (func_promise) { return function (/* ... */) { var args = arguments; return result_transformer(when(func_promise, function (func) { retur...
javascript
function promisify_func(result_transformer) { result_transformer = result_transformer || identity; var transformer = function (func_promise) { return function (/* ... */) { var args = arguments; return result_transformer(when(func_promise, function (func) { retur...
[ "function", "promisify_func", "(", "result_transformer", ")", "{", "result_transformer", "=", "result_transformer", "||", "identity", ";", "var", "transformer", "=", "function", "(", "func_promise", ")", "{", "return", "function", "(", "/* ... */", ")", "{", "var"...
Produces a transformer that takes a promised function, and returns a function returning a promise, optionally transforming that promise.
[ "Produces", "a", "transformer", "that", "takes", "a", "promised", "function", "and", "returns", "a", "function", "returning", "a", "promise", "optionally", "transforming", "that", "promise", "." ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L38-L60
41,347
dpw/promisify
promisify.js
promisify_cb_func_generic
function promisify_cb_func_generic(result_transformer, cb_generator) { result_transformer = result_transformer || identity; var transformer = function (func_promise) { return function (/* ... */) { var args = arguments; return result_transformer(when(func_promise, function (func...
javascript
function promisify_cb_func_generic(result_transformer, cb_generator) { result_transformer = result_transformer || identity; var transformer = function (func_promise) { return function (/* ... */) { var args = arguments; return result_transformer(when(func_promise, function (func...
[ "function", "promisify_cb_func_generic", "(", "result_transformer", ",", "cb_generator", ")", "{", "result_transformer", "=", "result_transformer", "||", "identity", ";", "var", "transformer", "=", "function", "(", "func_promise", ")", "{", "return", "function", "(", ...
Produces a transformer that takes a promised function taking a callback, and returns a function returning a promise, optionally transforming that promise.
[ "Produces", "a", "transformer", "that", "takes", "a", "promised", "function", "taking", "a", "callback", "and", "returns", "a", "function", "returning", "a", "promise", "optionally", "transforming", "that", "promise", "." ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L65-L91
41,348
dpw/promisify
promisify.js
promisify_object
function promisify_object(template, object_creator) { object_creator = object_creator || new_object; var transformer = function (obj_promise) { var res = object_creator(obj_promise); for (var prop in template) { res[prop] = template[prop].for_property(obj_promise, prop); } ...
javascript
function promisify_object(template, object_creator) { object_creator = object_creator || new_object; var transformer = function (obj_promise) { var res = object_creator(obj_promise); for (var prop in template) { res[prop] = template[prop].for_property(obj_promise, prop); } ...
[ "function", "promisify_object", "(", "template", ",", "object_creator", ")", "{", "object_creator", "=", "object_creator", "||", "new_object", ";", "var", "transformer", "=", "function", "(", "obj_promise", ")", "{", "var", "res", "=", "object_creator", "(", "ob...
Produces a transformer that takes a promised object, and returns an object with the properties transformed according to the template.
[ "Produces", "a", "transformer", "that", "takes", "a", "promised", "object", "and", "returns", "an", "object", "with", "the", "properties", "transformed", "according", "to", "the", "template", "." ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L115-L132
41,349
dpw/promisify
promisify.js
promisify_read_stream
function promisify_read_stream() { var transformer = function (stream_promise) { var res = new PStream(); res.to = function (dest) { when(stream_promise, function (stream) { PStream.wrap_read_stream(stream).to(dest); }, function (err) { dest.er...
javascript
function promisify_read_stream() { var transformer = function (stream_promise) { var res = new PStream(); res.to = function (dest) { when(stream_promise, function (stream) { PStream.wrap_read_stream(stream).to(dest); }, function (err) { dest.er...
[ "function", "promisify_read_stream", "(", ")", "{", "var", "transformer", "=", "function", "(", "stream_promise", ")", "{", "var", "res", "=", "new", "PStream", "(", ")", ";", "res", ".", "to", "=", "function", "(", "dest", ")", "{", "when", "(", "stre...
Takes a promised read stream and returns a PStream
[ "Takes", "a", "promised", "read", "stream", "and", "returns", "a", "PStream" ]
23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc
https://github.com/dpw/promisify/blob/23e1e783fb22b6b4bca86f53ec3cbb7bc864a4cc/promisify.js#L135-L155
41,350
mattrayner/cordova-plugin-vuforia-sdk
hooks/AfterPluginInstall.js
function() { let xcConfigBuildFilePath = path.join(cwd, 'platforms', 'ios', 'cordova', 'build.xcconfig'); try { let xcConfigBuildFileExists = fs.accessSync(xcConfigBuildFilePath); } catch(e) { console.log('Could not locate build.xcconfig, you will need to set HEA...
javascript
function() { let xcConfigBuildFilePath = path.join(cwd, 'platforms', 'ios', 'cordova', 'build.xcconfig'); try { let xcConfigBuildFileExists = fs.accessSync(xcConfigBuildFilePath); } catch(e) { console.log('Could not locate build.xcconfig, you will need to set HEA...
[ "function", "(", ")", "{", "let", "xcConfigBuildFilePath", "=", "path", ".", "join", "(", "cwd", ",", "'platforms'", ",", "'ios'", ",", "'cordova'", ",", "'build.xcconfig'", ")", ";", "try", "{", "let", "xcConfigBuildFileExists", "=", "fs", ".", "accessSync"...
Modify the xcconfig build path and pass the resulting file path to the addHeaderSearchPaths function.
[ "Modify", "the", "xcconfig", "build", "path", "and", "pass", "the", "resulting", "file", "path", "to", "the", "addHeaderSearchPaths", "function", "." ]
d75349a1c4e5a4d6d6890c52fba9602df2ea6bc6
https://github.com/mattrayner/cordova-plugin-vuforia-sdk/blob/d75349a1c4e5a4d6d6890c52fba9602df2ea6bc6/hooks/AfterPluginInstall.js#L12-L26
41,351
mattrayner/cordova-plugin-vuforia-sdk
hooks/AfterPluginInstall.js
function(xcConfigBuildFilePath) { let lines = fs.readFileSync(xcConfigBuildFilePath, 'utf8').split('\n'); let paths = hookData.headerPaths; let headerSearchPathLineNumber; lines.forEach((l, i) => { if (l.indexOf('HEADER_SEARCH_PATHS') > -1) { headerSearchPat...
javascript
function(xcConfigBuildFilePath) { let lines = fs.readFileSync(xcConfigBuildFilePath, 'utf8').split('\n'); let paths = hookData.headerPaths; let headerSearchPathLineNumber; lines.forEach((l, i) => { if (l.indexOf('HEADER_SEARCH_PATHS') > -1) { headerSearchPat...
[ "function", "(", "xcConfigBuildFilePath", ")", "{", "let", "lines", "=", "fs", ".", "readFileSync", "(", "xcConfigBuildFilePath", ",", "'utf8'", ")", ".", "split", "(", "'\\n'", ")", ";", "let", "paths", "=", "hookData", ".", "headerPaths", ";", "let", "he...
Read the build config, add the correct Header Search Paths to the config before calling modifyAppDelegate.
[ "Read", "the", "build", "config", "add", "the", "correct", "Header", "Search", "Paths", "to", "the", "config", "before", "calling", "modifyAppDelegate", "." ]
d75349a1c4e5a4d6d6890c52fba9602df2ea6bc6
https://github.com/mattrayner/cordova-plugin-vuforia-sdk/blob/d75349a1c4e5a4d6d6890c52fba9602df2ea6bc6/hooks/AfterPluginInstall.js#L29-L69
41,352
MattL922/implied-volatility
implied-volatility.js
getImpliedVolatility
function getImpliedVolatility(expectedCost, s, k, t, r, callPut, estimate) { estimate = estimate || .1; var low = 0; var high = Infinity; // perform 100 iterations max for(var i = 0; i < 100; i++) { var actualCost = bs.blackScholes(s, k, t, estimate, r, callPut); // compare the price down to the cen...
javascript
function getImpliedVolatility(expectedCost, s, k, t, r, callPut, estimate) { estimate = estimate || .1; var low = 0; var high = Infinity; // perform 100 iterations max for(var i = 0; i < 100; i++) { var actualCost = bs.blackScholes(s, k, t, estimate, r, callPut); // compare the price down to the cen...
[ "function", "getImpliedVolatility", "(", "expectedCost", ",", "s", ",", "k", ",", "t", ",", "r", ",", "callPut", ",", "estimate", ")", "{", "estimate", "=", "estimate", "||", ".1", ";", "var", "low", "=", "0", ";", "var", "high", "=", "Infinity", ";"...
Calculate a close estimate of implied volatility given an option price. A binary search type approach is used to determine the implied volatility. @param {Number} expectedCost The market price of the option @param {Number} s Current price of the underlying @param {Number} k Strike price @param {Number} t Time to expe...
[ "Calculate", "a", "close", "estimate", "of", "implied", "volatility", "given", "an", "option", "price", ".", "A", "binary", "search", "type", "approach", "is", "used", "to", "determine", "the", "implied", "volatility", "." ]
7b9a5e957d895645a46fd910769fe5243ed0d504
https://github.com/MattL922/implied-volatility/blob/7b9a5e957d895645a46fd910769fe5243ed0d504/implied-volatility.js#L23-L50
41,353
alexeykuzmin/jsonpointer.js
src/jsonpointer.js
getPointedValue
function getPointedValue(target, opt_pointer) { // .get() method implementation. // First argument must be either string or object. if (isString(target)) { // If string it must be valid JSON document. try { // Let's try to parse it as JSON. target = JSON.parse(target); } ...
javascript
function getPointedValue(target, opt_pointer) { // .get() method implementation. // First argument must be either string or object. if (isString(target)) { // If string it must be valid JSON document. try { // Let's try to parse it as JSON. target = JSON.parse(target); } ...
[ "function", "getPointedValue", "(", "target", ",", "opt_pointer", ")", "{", "// .get() method implementation.", "// First argument must be either string or object.", "if", "(", "isString", "(", "target", ")", ")", "{", "// If string it must be valid JSON document.", "try", "{...
Returns |target| object's value pointed by |opt_pointer|, returns undefined if |opt_pointer| points to non-existing value. If pointer is not provided, validates first argument and returns evaluator function that takes pointer as argument. @param {(string|Object|Array)} target Evaluation target. @param {string=} opt_poi...
[ "Returns", "|target|", "object", "s", "value", "pointed", "by", "|opt_pointer|", "returns", "undefined", "if", "|opt_pointer|", "points", "to", "non", "-", "existing", "value", ".", "If", "pointer", "is", "not", "provided", "validates", "first", "argument", "and...
57d7cf484d906792255a7c30cbb6c2d90d4ab152
https://github.com/alexeykuzmin/jsonpointer.js/blob/57d7cf484d906792255a7c30cbb6c2d90d4ab152/src/jsonpointer.js#L77-L109
41,354
alexeykuzmin/jsonpointer.js
src/jsonpointer.js
isValidJSONPointer
function isValidJSONPointer(pointer) { // Validates JSON pointer string. if (!isString(pointer)) { // If it's not a string, it obviously is not valid. return false; } if ('' === pointer) { // If it is string and is an empty string, it's valid. return true; } // If it i...
javascript
function isValidJSONPointer(pointer) { // Validates JSON pointer string. if (!isString(pointer)) { // If it's not a string, it obviously is not valid. return false; } if ('' === pointer) { // If it is string and is an empty string, it's valid. return true; } // If it i...
[ "function", "isValidJSONPointer", "(", "pointer", ")", "{", "// Validates JSON pointer string.", "if", "(", "!", "isString", "(", "pointer", ")", ")", "{", "// If it's not a string, it obviously is not valid.", "return", "false", ";", "}", "if", "(", "''", "===", "p...
Returns true if given |pointer| is valid, returns false otherwise. @param {!string} pointer @returns {boolean} Whether pointer is valid.
[ "Returns", "true", "if", "given", "|pointer|", "is", "valid", "returns", "false", "otherwise", "." ]
57d7cf484d906792255a7c30cbb6c2d90d4ab152
https://github.com/alexeykuzmin/jsonpointer.js/blob/57d7cf484d906792255a7c30cbb6c2d90d4ab152/src/jsonpointer.js#L164-L180
41,355
shaun-h/nodejs-disks
lib/disks.js
getDrives
function getDrives(command, callback) { var child = exec( command, function (err, stdout, stderr) { if (err) return callback(err); var drives = stdout.split('\n'); drives.splice(0, 1); drives.splice(-1, 1); // Removes ram drives ...
javascript
function getDrives(command, callback) { var child = exec( command, function (err, stdout, stderr) { if (err) return callback(err); var drives = stdout.split('\n'); drives.splice(0, 1); drives.splice(-1, 1); // Removes ram drives ...
[ "function", "getDrives", "(", "command", ",", "callback", ")", "{", "var", "child", "=", "exec", "(", "command", ",", "function", "(", "err", ",", "stdout", ",", "stderr", ")", "{", "if", "(", "err", ")", "return", "callback", "(", "err", ")", ";", ...
Execute a command to retrieve disks list. @param command @param callback
[ "Execute", "a", "command", "to", "retrieve", "disks", "list", "." ]
615c2c6477dbf81ff693f0b2ff0c44f669d5892b
https://github.com/shaun-h/nodejs-disks/blob/615c2c6477dbf81ff693f0b2ff0c44f669d5892b/lib/disks.js#L29-L44
41,356
shaun-h/nodejs-disks
lib/disks.js
detail
function detail(drive, callback) { async.series( { used: function (callback) { switch (os.platform().toLowerCase()) { case'darwin': getDetail('df -kl | grep ' + drive + ' | awk \'{print $3}\'', callback); break; ...
javascript
function detail(drive, callback) { async.series( { used: function (callback) { switch (os.platform().toLowerCase()) { case'darwin': getDetail('df -kl | grep ' + drive + ' | awk \'{print $3}\'', callback); break; ...
[ "function", "detail", "(", "drive", ",", "callback", ")", "{", "async", ".", "series", "(", "{", "used", ":", "function", "(", "callback", ")", "{", "switch", "(", "os", ".", "platform", "(", ")", ".", "toLowerCase", "(", ")", ")", "{", "case", "'d...
Retrieve space information about one drive. @param drive @param callback
[ "Retrieve", "space", "information", "about", "one", "drive", "." ]
615c2c6477dbf81ff693f0b2ff0c44f669d5892b
https://github.com/shaun-h/nodejs-disks/blob/615c2c6477dbf81ff693f0b2ff0c44f669d5892b/lib/disks.js#L90-L142
41,357
71104/rwlock
src/lock.js
writeLock
function writeLock(key, callback, options) { var lock; if (typeof key !== 'function') { if (!table.hasOwnProperty(key)) { table[key] = new Lock(); } lock = table[key]; } else { options = callback; callback = key; lock = defaultLock; } if (!options) { options = {}; } var scope = nu...
javascript
function writeLock(key, callback, options) { var lock; if (typeof key !== 'function') { if (!table.hasOwnProperty(key)) { table[key] = new Lock(); } lock = table[key]; } else { options = callback; callback = key; lock = defaultLock; } if (!options) { options = {}; } var scope = nu...
[ "function", "writeLock", "(", "key", ",", "callback", ",", "options", ")", "{", "var", "lock", ";", "if", "(", "typeof", "key", "!==", "'function'", ")", "{", "if", "(", "!", "table", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "table", "[", ...
Acquires a write lock and invokes a user-defined callback as soon as it is acquired. The operation might require some time as there may be one or more readers. You can optionally specify a timeout in milliseconds: if it expires before a read lock can be acquired, this request is canceled and no lock will be acquired. ...
[ "Acquires", "a", "write", "lock", "and", "invokes", "a", "user", "-", "defined", "callback", "as", "soon", "as", "it", "is", "acquired", "." ]
86a1affae69c3ec8cd1adbb7dad75befb75ea74e
https://github.com/71104/rwlock/blob/86a1affae69c3ec8cd1adbb7dad75befb75ea74e/src/lock.js#L158-L218
41,358
http-auth/htdigest
src/processor.js
readPassword
function readPassword(program) { prompt.message = ""; prompt.delimiter = ""; const passportOption = [{name: 'password', description: 'New password:', hidden: true}]; const rePassportOption = [{name: 'rePassword', description: 'Re-type new password:', hidden: true}]; // Try to read password. pr...
javascript
function readPassword(program) { prompt.message = ""; prompt.delimiter = ""; const passportOption = [{name: 'password', description: 'New password:', hidden: true}]; const rePassportOption = [{name: 'rePassword', description: 'Re-type new password:', hidden: true}]; // Try to read password. pr...
[ "function", "readPassword", "(", "program", ")", "{", "prompt", ".", "message", "=", "\"\"", ";", "prompt", ".", "delimiter", "=", "\"\"", ";", "const", "passportOption", "=", "[", "{", "name", ":", "'password'", ",", "description", ":", "'New password:'", ...
Read password.
[ "Read", "password", "." ]
be5222ea2a72509750d4b5822ce55b97ed658d63
https://github.com/http-auth/htdigest/blob/be5222ea2a72509750d4b5822ce55b97ed658d63/src/processor.js#L63-L93
41,359
alexhisen/mobx-form-store
src/FormStore.js
observableChanged
function observableChanged(change) { const store = this; action(() => { store.dataChanges.set(change.name, change.newValue); if (store.isSame(store.dataChanges.get(change.name), store.dataServer[change.name])) { store.dataChanges.delete(change.name); } })(); }
javascript
function observableChanged(change) { const store = this; action(() => { store.dataChanges.set(change.name, change.newValue); if (store.isSame(store.dataChanges.get(change.name), store.dataServer[change.name])) { store.dataChanges.delete(change.name); } })(); }
[ "function", "observableChanged", "(", "change", ")", "{", "const", "store", "=", "this", ";", "action", "(", "(", ")", "=>", "{", "store", ".", "dataChanges", ".", "set", "(", "change", ".", "name", ",", "change", ".", "newValue", ")", ";", "if", "("...
Observes data and if changes come, add them to dataChanges, unless it resets back to dataServer value, then clear that change @this {FormStore} @param {Object} change @param {String} change.name - name of property that changed @param {*} change.newValue
[ "Observes", "data", "and", "if", "changes", "come", "add", "them", "to", "dataChanges", "unless", "it", "resets", "back", "to", "dataServer", "value", "then", "clear", "that", "change" ]
c2058a883c4658aaaefcf1dc3429958c68d59343
https://github.com/alexhisen/mobx-form-store/blob/c2058a883c4658aaaefcf1dc3429958c68d59343/src/FormStore.js#L19-L28
41,360
alexhisen/mobx-form-store
src/FormStore.js
processSaveResponse
async function processSaveResponse(store, updates, response) { store.options.log(`[${store.options.name}] Response received from server.`); if (response.status === 'error') { action(() => { let errorFields = []; if (response.error) { if (typeof response.error === 'string') { store...
javascript
async function processSaveResponse(store, updates, response) { store.options.log(`[${store.options.name}] Response received from server.`); if (response.status === 'error') { action(() => { let errorFields = []; if (response.error) { if (typeof response.error === 'string') { store...
[ "async", "function", "processSaveResponse", "(", "store", ",", "updates", ",", "response", ")", "{", "store", ".", "options", ".", "log", "(", "`", "${", "store", ".", "options", ".", "name", "}", "`", ")", ";", "if", "(", "response", ".", "status", ...
Records successfully saved data as saved and reverts fields server indicates to be in error @param {FormStore} store @param {Object} updates - what we sent to the server @param {Object} response @param {String} [response.data] - optional updated data to merge into the store (server.create can return id here) @param {St...
[ "Records", "successfully", "saved", "data", "as", "saved", "and", "reverts", "fields", "server", "indicates", "to", "be", "in", "error" ]
c2058a883c4658aaaefcf1dc3429958c68d59343
https://github.com/alexhisen/mobx-form-store/blob/c2058a883c4658aaaefcf1dc3429958c68d59343/src/FormStore.js#L43-L91
41,361
AZaviruha/react-form-generator
src/tools/routing.js
buildRouter
function buildRouter () { var args = g.argsToArray( arguments ) , simpleConf = {} , regexpConf = [] , reLength , i, len, route, handlers; if ( (args.length === 0) || (args.length % 2 !== 0) ) throw new Error( 'Wrong number of arguments!' ); for ( i = 0, le...
javascript
function buildRouter () { var args = g.argsToArray( arguments ) , simpleConf = {} , regexpConf = [] , reLength , i, len, route, handlers; if ( (args.length === 0) || (args.length % 2 !== 0) ) throw new Error( 'Wrong number of arguments!' ); for ( i = 0, le...
[ "function", "buildRouter", "(", ")", "{", "var", "args", "=", "g", ".", "argsToArray", "(", "arguments", ")", ",", "simpleConf", "=", "{", "}", ",", "regexpConf", "=", "[", "]", ",", "reLength", ",", "i", ",", "len", ",", "route", ",", "handlers", ...
Builds a routing function, that matches event's name to the list of handlers and executes all of them. @param {string|RegExp} event1 - event's mask. @param [Function] handlers1 - handlers for event1. @param {string|RegExp} event2 - event's mask. @param [Function] handlers2 - handlers for event2. ... @returns {Func...
[ "Builds", "a", "routing", "function", "that", "matches", "event", "s", "name", "to", "the", "list", "of", "handlers", "and", "executes", "all", "of", "them", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/tools/routing.js#L15-L66
41,362
AZaviruha/react-form-generator
src/validation/index.js
composite
function composite ( comb, zero ) { return function ( conf, value, fieldMeta ) { var validators = conf.value; return reduce(function ( acc, v ) { var f = VALIDATORS[ v.rule ]; checkRuleExistence( f, v.rule ); return comb( acc, f( v, value, ...
javascript
function composite ( comb, zero ) { return function ( conf, value, fieldMeta ) { var validators = conf.value; return reduce(function ( acc, v ) { var f = VALIDATORS[ v.rule ]; checkRuleExistence( f, v.rule ); return comb( acc, f( v, value, ...
[ "function", "composite", "(", "comb", ",", "zero", ")", "{", "return", "function", "(", "conf", ",", "value", ",", "fieldMeta", ")", "{", "var", "validators", "=", "conf", ".", "value", ";", "return", "reduce", "(", "function", "(", "acc", ",", "v", ...
Build composite validator, which combines result of all nested validators by `comb` function. @param {Function} comp - `and`, `or`, etc. @param {Object} zero - intital value of composite validator result. @returns {Function)
[ "Build", "composite", "validator", "which", "combines", "result", "of", "all", "nested", "validators", "by", "comb", "function", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L32-L41
41,363
AZaviruha/react-form-generator
src/validation/index.js
checkByRule
function checkByRule ( ruleInfo, value, fieldMeta ) { var rule = ruleInfo.rule , isValid = VALIDATORS[ rule ]; checkRuleExistence( isValid, rule ); return isValid( ruleInfo, value, fieldMeta ) ? null : ruleInfo; }
javascript
function checkByRule ( ruleInfo, value, fieldMeta ) { var rule = ruleInfo.rule , isValid = VALIDATORS[ rule ]; checkRuleExistence( isValid, rule ); return isValid( ruleInfo, value, fieldMeta ) ? null : ruleInfo; }
[ "function", "checkByRule", "(", "ruleInfo", ",", "value", ",", "fieldMeta", ")", "{", "var", "rule", "=", "ruleInfo", ".", "rule", ",", "isValid", "=", "VALIDATORS", "[", "rule", "]", ";", "checkRuleExistence", "(", "isValid", ",", "rule", ")", ";", "ret...
Validates field's value against of validation rule. Returs sublist of validateion rules that was not sutisfied by value. @param {Object} ruleInfo - validation rules. @param {Object} value - value to validate. @param {Object} fieldMeta - for some validation rules field meta is required. @returns {Object}
[ "Validates", "field", "s", "value", "against", "of", "validation", "rule", ".", "Returs", "sublist", "of", "validateion", "rules", "that", "was", "not", "sutisfied", "by", "value", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L54-L60
41,364
AZaviruha/react-form-generator
src/validation/index.js
checkByAll
function checkByAll ( rules, value, fieldMeta ) { return (rules || []) .map(function ( rule ) { return checkByRule( rule, value, fieldMeta ); }) .filter(function ( el ) { return null !== el; }); }
javascript
function checkByAll ( rules, value, fieldMeta ) { return (rules || []) .map(function ( rule ) { return checkByRule( rule, value, fieldMeta ); }) .filter(function ( el ) { return null !== el; }); }
[ "function", "checkByAll", "(", "rules", ",", "value", ",", "fieldMeta", ")", "{", "return", "(", "rules", "||", "[", "]", ")", ".", "map", "(", "function", "(", "rule", ")", "{", "return", "checkByRule", "(", "rule", ",", "value", ",", "fieldMeta", "...
Validates field's value against list of validation rules. Returs sublist of validation rules that was not sutisfied by value. @param {Object[]} rules - list of validation rules. @param {Object} value - value to validate. @returns {Object[]}
[ "Validates", "field", "s", "value", "against", "list", "of", "validation", "rules", ".", "Returs", "sublist", "of", "validation", "rules", "that", "was", "not", "sutisfied", "by", "value", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L76-L82
41,365
AZaviruha/react-form-generator
src/validation/index.js
validateField
function validateField ( fldID, fieldMeta, value ) { var res = {} , errs = checkByAll( fieldMeta.validators, value, fieldMeta ); res[ fldID ] = errs.length ? errs : null; return res; }
javascript
function validateField ( fldID, fieldMeta, value ) { var res = {} , errs = checkByAll( fieldMeta.validators, value, fieldMeta ); res[ fldID ] = errs.length ? errs : null; return res; }
[ "function", "validateField", "(", "fldID", ",", "fieldMeta", ",", "value", ")", "{", "var", "res", "=", "{", "}", ",", "errs", "=", "checkByAll", "(", "fieldMeta", ".", "validators", ",", "value", ",", "fieldMeta", ")", ";", "res", "[", "fldID", "]", ...
Calculates field's validity by it's meta and value. @param {Object} fieldMeta - metadata of one field in FormGenerator format. @param {Object} value - { %fieldID%: %fieldValue% } @return {Object[]} - [ %failed_validators% ]
[ "Calculates", "field", "s", "validity", "by", "it", "s", "meta", "and", "value", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L92-L97
41,366
AZaviruha/react-form-generator
src/validation/index.js
validateFields
function validateFields ( fldsMeta, fldsValue ) { return reduce(function ( acc, fldMeta, fldID ) { var value = getOrNull( fldsValue, fldID ) , errors = validateField( fldID, fldMeta, value ); return t.merge( acc, errors ); }, {}, fldsMeta ); }
javascript
function validateFields ( fldsMeta, fldsValue ) { return reduce(function ( acc, fldMeta, fldID ) { var value = getOrNull( fldsValue, fldID ) , errors = validateField( fldID, fldMeta, value ); return t.merge( acc, errors ); }, {}, fldsMeta ); }
[ "function", "validateFields", "(", "fldsMeta", ",", "fldsValue", ")", "{", "return", "reduce", "(", "function", "(", "acc", ",", "fldMeta", ",", "fldID", ")", "{", "var", "value", "=", "getOrNull", "(", "fldsValue", ",", "fldID", ")", ",", "errors", "=",...
Calculates validity of the array of fields. @param {Object[]} fldsMeta - array of metadata. @param {Object[]} fldsValue - map with fields value. @returns {Object} - { %fieldID%: [ %failed_validators% ], ... }
[ "Calculates", "validity", "of", "the", "array", "of", "fields", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L109-L115
41,367
AZaviruha/react-form-generator
src/validation/index.js
validateForm
function validateForm ( formMeta, formValue ) { var fields = getOrNull( formMeta, 'fields' ) , validable = reduce(function ( acc, fld, fldID ) { var noValidate = !t.isDefined( fld.validators ) || fld.isHidden || fld....
javascript
function validateForm ( formMeta, formValue ) { var fields = getOrNull( formMeta, 'fields' ) , validable = reduce(function ( acc, fld, fldID ) { var noValidate = !t.isDefined( fld.validators ) || fld.isHidden || fld....
[ "function", "validateForm", "(", "formMeta", ",", "formValue", ")", "{", "var", "fields", "=", "getOrNull", "(", "formMeta", ",", "'fields'", ")", ",", "validable", "=", "reduce", "(", "function", "(", "acc", ",", "fld", ",", "fldID", ")", "{", "var", ...
Calculates form's validity by it's meta and value. Wraps `validateFields` and filters array of fields before validation. @param {Object} formMeta - metadata in GeneratedForm format. @param {Object} formValue - data in GeneratedForm format. @returns {Object} - { %fieldID%: [ %failed_validators% ], ... }
[ "Calculates", "form", "s", "validity", "by", "it", "s", "meta", "and", "value", ".", "Wraps", "validateFields", "and", "filters", "array", "of", "fields", "before", "validation", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L129-L146
41,368
AZaviruha/react-form-generator
src/validation/index.js
isFormValid
function isFormValid ( formErrors ) { return t.reduce(function ( acc, v, k ) { return acc && !(v && v.length); }, true, formErrors ); }
javascript
function isFormValid ( formErrors ) { return t.reduce(function ( acc, v, k ) { return acc && !(v && v.length); }, true, formErrors ); }
[ "function", "isFormValid", "(", "formErrors", ")", "{", "return", "t", ".", "reduce", "(", "function", "(", "acc", ",", "v", ",", "k", ")", "{", "return", "acc", "&&", "!", "(", "v", "&&", "v", ".", "length", ")", ";", "}", ",", "true", ",", "f...
Accepts result of `validateForm` and returns true if `formErrors` contains only null-values. @param {Object} formErrors - { %fieldID%: [ %failed_validators% ], ... } @returns {Boolean}
[ "Accepts", "result", "of", "validateForm", "and", "returns", "true", "if", "formErrors", "contains", "only", "null", "-", "values", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/validation/index.js#L158-L162
41,369
julienetie/resizilla
dist/resizilla.js
setTimeoutWithTimestamp
function setTimeoutWithTimestamp(callback) { const immediateTime = Date.now(); let lapsedTime = Math.max(previousTime + 16, immediateTime); return setTimeout(function () { callback(previousTime = lapsedTime); }, lapsedTime - immediateTime); }
javascript
function setTimeoutWithTimestamp(callback) { const immediateTime = Date.now(); let lapsedTime = Math.max(previousTime + 16, immediateTime); return setTimeout(function () { callback(previousTime = lapsedTime); }, lapsedTime - immediateTime); }
[ "function", "setTimeoutWithTimestamp", "(", "callback", ")", "{", "const", "immediateTime", "=", "Date", ".", "now", "(", ")", ";", "let", "lapsedTime", "=", "Math", ".", "max", "(", "previousTime", "+", "16", ",", "immediateTime", ")", ";", "return", "set...
IE-9 Polyfill for requestAnimationFrame @callback {Number} Timestamp. @return {Function} setTimeout Function.
[ "IE", "-", "9", "Polyfill", "for", "requestAnimationFrame" ]
a73b4177dcf303438c6a93e8d33bd6dd578d3910
https://github.com/julienetie/resizilla/blob/a73b4177dcf303438c6a93e8d33bd6dd578d3910/dist/resizilla.js#L45-L51
41,370
julienetie/resizilla
dist/resizilla.js
debounce
function debounce(callback, delay, lead) { var debounceRange = 0; var currentTime; var lastCall; var setDelay; var timeoutId; const call = parameters => { callback(parameters); }; return parameters => { if (lead) { currentTime = Date.now(); if (c...
javascript
function debounce(callback, delay, lead) { var debounceRange = 0; var currentTime; var lastCall; var setDelay; var timeoutId; const call = parameters => { callback(parameters); }; return parameters => { if (lead) { currentTime = Date.now(); if (c...
[ "function", "debounce", "(", "callback", ",", "delay", ",", "lead", ")", "{", "var", "debounceRange", "=", "0", ";", "var", "currentTime", ";", "var", "lastCall", ";", "var", "setDelay", ";", "var", "timeoutId", ";", "const", "call", "=", "parameters", "...
Debounce a function call during repetiton. @param {Function} callback - Callback function. @param {Number} delay - Delay in milliseconds. @param {Boolean} lead - Leading or trailing. @return {Function} - The debounce function.
[ "Debounce", "a", "function", "call", "during", "repetiton", "." ]
a73b4177dcf303438c6a93e8d33bd6dd578d3910
https://github.com/julienetie/resizilla/blob/a73b4177dcf303438c6a93e8d33bd6dd578d3910/dist/resizilla.js#L90-L118
41,371
timwhitlock/node-twitter-api
lib/twitter.js
uriEncodeParams
function uriEncodeParams( obj ){ var pairs = [], key; for( key in obj ){ pairs.push( uriEncodeString(key) +'='+ uriEncodeString(obj[key]) ); } return pairs.join('&'); }
javascript
function uriEncodeParams( obj ){ var pairs = [], key; for( key in obj ){ pairs.push( uriEncodeString(key) +'='+ uriEncodeString(obj[key]) ); } return pairs.join('&'); }
[ "function", "uriEncodeParams", "(", "obj", ")", "{", "var", "pairs", "=", "[", "]", ",", "key", ";", "for", "(", "key", "in", "obj", ")", "{", "pairs", ".", "push", "(", "uriEncodeString", "(", "key", ")", "+", "'='", "+", "uriEncodeString", "(", "...
OAuth safe encodeURIComponent of params object
[ "OAuth", "safe", "encodeURIComponent", "of", "params", "object" ]
6ac423f9c718153c7fac24ce76fb6ae90707ec30
https://github.com/timwhitlock/node-twitter-api/blob/6ac423f9c718153c7fac24ce76fb6ae90707ec30/lib/twitter.js#L39-L45
41,372
timwhitlock/node-twitter-api
lib/twitter.js
OAuthToken
function OAuthToken( key, secret ){ if( ! key || ! secret ){ throw new Error('OAuthToken params must not be empty'); } this.key = key; this.secret = secret; }
javascript
function OAuthToken( key, secret ){ if( ! key || ! secret ){ throw new Error('OAuthToken params must not be empty'); } this.key = key; this.secret = secret; }
[ "function", "OAuthToken", "(", "key", ",", "secret", ")", "{", "if", "(", "!", "key", "||", "!", "secret", ")", "{", "throw", "new", "Error", "(", "'OAuthToken params must not be empty'", ")", ";", "}", "this", ".", "key", "=", "key", ";", "this", ".",...
Simple token object that holds key and secret
[ "Simple", "token", "object", "that", "holds", "key", "and", "secret" ]
6ac423f9c718153c7fac24ce76fb6ae90707ec30
https://github.com/timwhitlock/node-twitter-api/blob/6ac423f9c718153c7fac24ce76fb6ae90707ec30/lib/twitter.js#L51-L57
41,373
FormidableLabs/multibot
lib/repos.js
function (cb) { async.map(self._repos, function (repo, repoCb) { self._client.gitdata.getReference({ user: self._repoParts[repo].org, repo: self._repoParts[repo].repo, ref: branchSrcFull }, function (err, res) { if (self._checkAndHandleError(err, repo, repoC...
javascript
function (cb) { async.map(self._repos, function (repo, repoCb) { self._client.gitdata.getReference({ user: self._repoParts[repo].org, repo: self._repoParts[repo].repo, ref: branchSrcFull }, function (err, res) { if (self._checkAndHandleError(err, repo, repoC...
[ "function", "(", "cb", ")", "{", "async", ".", "map", "(", "self", ".", "_repos", ",", "function", "(", "repo", ",", "repoCb", ")", "{", "self", ".", "_client", ".", "gitdata", ".", "getReference", "(", "{", "user", ":", "self", ".", "_repoParts", ...
Get the most recent commit of the source branch.
[ "Get", "the", "most", "recent", "commit", "of", "the", "source", "branch", "." ]
2434455354f74926aa85b2bbf2eb1548e873cc82
https://github.com/FormidableLabs/multibot/blob/2434455354f74926aa85b2bbf2eb1548e873cc82/lib/repos.js#L372-L386
41,374
FormidableLabs/multibot
lib/repos.js
function (cb) { async.map(self._repos, function (repo, repoCb) { self._client.gitdata.getReference({ user: self._repoParts[repo].org, repo: self._repoParts[repo].repo, ref: branchDestFull }, function (err, res) { // Allow not found. if (err && err....
javascript
function (cb) { async.map(self._repos, function (repo, repoCb) { self._client.gitdata.getReference({ user: self._repoParts[repo].org, repo: self._repoParts[repo].repo, ref: branchDestFull }, function (err, res) { // Allow not found. if (err && err....
[ "function", "(", "cb", ")", "{", "async", ".", "map", "(", "self", ".", "_repos", ",", "function", "(", "repo", ",", "repoCb", ")", "{", "self", ".", "_client", ".", "gitdata", ".", "getReference", "(", "{", "user", ":", "self", ".", "_repoParts", ...
Check if the destination branches exist.
[ "Check", "if", "the", "destination", "branches", "exist", "." ]
2434455354f74926aa85b2bbf2eb1548e873cc82
https://github.com/FormidableLabs/multibot/blob/2434455354f74926aa85b2bbf2eb1548e873cc82/lib/repos.js#L389-L429
41,375
balderdashy/angularSails
lib/sails.io.js
ajax
function ajax(opts, cb) { opts = opts || {}; var xmlhttp; if (typeof window === 'undefined') { // TODO: refactor node usage to live in here return cb(); } if (window.XMLHttpRequest) { // code for IE7+, Firefox,...
javascript
function ajax(opts, cb) { opts = opts || {}; var xmlhttp; if (typeof window === 'undefined') { // TODO: refactor node usage to live in here return cb(); } if (window.XMLHttpRequest) { // code for IE7+, Firefox,...
[ "function", "ajax", "(", "opts", ",", "cb", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "var", "xmlhttp", ";", "if", "(", "typeof", "window", "===", "'undefined'", ")", "{", "// TODO: refactor node usage to live in here", "return", "cb", "(", ")", ...
Send an AJAX request. @param {Object} opts [optional] @param {Function} cb @return {XMLHttpRequest}
[ "Send", "an", "AJAX", "request", "." ]
1deb8a05d737e5cb9224096378ebe949586cf570
https://github.com/balderdashy/angularSails/blob/1deb8a05d737e5cb9224096378ebe949586cf570/lib/sails.io.js#L260-L286
41,376
AZaviruha/react-form-generator
src/tools/general.js
getOrDefault
function getOrDefault ( source, path, defaultVal ) { var isAlreadySplitted = isArray( path ); if ( !isDefined(source) ) return defaultVal; if ( !isString(path) && !isAlreadySplitted ) return defaultVal; var tokens = isAlreadySplitted ? path : path.split( '.' ) , idx, key; for ( idx in token...
javascript
function getOrDefault ( source, path, defaultVal ) { var isAlreadySplitted = isArray( path ); if ( !isDefined(source) ) return defaultVal; if ( !isString(path) && !isAlreadySplitted ) return defaultVal; var tokens = isAlreadySplitted ? path : path.split( '.' ) , idx, key; for ( idx in token...
[ "function", "getOrDefault", "(", "source", ",", "path", ",", "defaultVal", ")", "{", "var", "isAlreadySplitted", "=", "isArray", "(", "path", ")", ";", "if", "(", "!", "isDefined", "(", "source", ")", ")", "return", "defaultVal", ";", "if", "(", "!", "...
Returns path's value or null if path's chain has undefined member. @param {Object} source - root object. @param {string} path - path to `source` value. @return {Object}
[ "Returns", "path", "s", "value", "or", "null", "if", "path", "s", "chain", "has", "undefined", "member", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/tools/general.js#L33-L52
41,377
AZaviruha/react-form-generator
src/tools/general.js
arrayToObject
function arrayToObject ( keyPath, arr ) { var res = {}, key, element; for ( var i = 0, len = arr.length; i < len; i++ ) { element = arr[ i ]; key = getOrNull( element, keyPath ); if ( key ) res[ key ] = element; } return res; }
javascript
function arrayToObject ( keyPath, arr ) { var res = {}, key, element; for ( var i = 0, len = arr.length; i < len; i++ ) { element = arr[ i ]; key = getOrNull( element, keyPath ); if ( key ) res[ key ] = element; } return res; }
[ "function", "arrayToObject", "(", "keyPath", ",", "arr", ")", "{", "var", "res", "=", "{", "}", ",", "key", ",", "element", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "arr", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")...
Converts array to object, using `keyPath` for building unique keys. @param {(String|Array)} keyPath - path to `key` value in the array element. @param {Object[]} - array to convert. @return {Object}
[ "Converts", "array", "to", "object", "using", "keyPath", "for", "building", "unique", "keys", "." ]
d3ce8ef216f9d888f5ed641c33456821fce902c2
https://github.com/AZaviruha/react-form-generator/blob/d3ce8ef216f9d888f5ed641c33456821fce902c2/src/tools/general.js#L69-L79
41,378
vincentmorneau/node-package-configurator
lib/src/js/bf.js
createPropertyProvider
function createPropertyProvider(getValue, onchange) { var ret = new Object(); ret.getValue = getValue; ret.onchange = onchange; return ret; }
javascript
function createPropertyProvider(getValue, onchange) { var ret = new Object(); ret.getValue = getValue; ret.onchange = onchange; return ret; }
[ "function", "createPropertyProvider", "(", "getValue", ",", "onchange", ")", "{", "var", "ret", "=", "new", "Object", "(", ")", ";", "ret", ".", "getValue", "=", "getValue", ";", "ret", ".", "onchange", "=", "onchange", ";", "return", "ret", ";", "}" ]
Used in object additionalProperties and arrays @param {type} getValue @param {type} onchange @returns {Object.create.createPropertyProvider.ret}
[ "Used", "in", "object", "additionalProperties", "and", "arrays" ]
489df6129a26238e8d783a3dfab1f354e27994a9
https://github.com/vincentmorneau/node-package-configurator/blob/489df6129a26238e8d783a3dfab1f354e27994a9/lib/src/js/bf.js#L1239-L1244
41,379
jwilsson/domtokenlist
dist/domtokenlist.js
function (fn) { return function () { var tokens = arguments; var i; for (i = 0; i < tokens.length; i += 1) { fn.call(this, tokens[i]); } }; }
javascript
function (fn) { return function () { var tokens = arguments; var i; for (i = 0; i < tokens.length; i += 1) { fn.call(this, tokens[i]); } }; }
[ "function", "(", "fn", ")", "{", "return", "function", "(", ")", "{", "var", "tokens", "=", "arguments", ";", "var", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "tokens", ".", "length", ";", "i", "+=", "1", ")", "{", "fn", ".", "call"...
Older versions of the HTMLElement.classList spec didn't allow multiple arguments, easy to test for
[ "Older", "versions", "of", "the", "HTMLElement", ".", "classList", "spec", "didn", "t", "allow", "multiple", "arguments", "easy", "to", "test", "for" ]
4c643cd6aef8b8051822d86f60a4cdbccdca7dd2
https://github.com/jwilsson/domtokenlist/blob/4c643cd6aef8b8051822d86f60a4cdbccdca7dd2/dist/domtokenlist.js#L19-L28
41,380
Couto/Blueprint
src/Blueprint.js
function (methods) { methods = [].concat(methods); var i = methods.length - 1; for (i; i >= 0; i -= 1) { this[methods[i]] = proxy(this[methods[i]], this); } return this; }
javascript
function (methods) { methods = [].concat(methods); var i = methods.length - 1; for (i; i >= 0; i -= 1) { this[methods[i]] = proxy(this[methods[i]], this); } return this; }
[ "function", "(", "methods", ")", "{", "methods", "=", "[", "]", ".", "concat", "(", "methods", ")", ";", "var", "i", "=", "methods", ".", "length", "-", "1", ";", "for", "(", "i", ";", "i", ">=", "0", ";", "i", "-=", "1", ")", "{", "this", ...
Describe what this method does @public @param {String|Object|Array|Boolean|Number} paramName Describe this parameter @returns Describe what it returns @type String|Object|Array|Boolean|Number
[ "Describe", "what", "this", "method", "does" ]
90dd099f40c6d6313a12a83d3450685704b6f6e0
https://github.com/Couto/Blueprint/blob/90dd099f40c6d6313a12a83d3450685704b6f6e0/src/Blueprint.js#L123-L132
41,381
voxel/voxel-mesher
mesh-buffer.js
createVoxelMesh
function createVoxelMesh(gl, voxels, voxelSideTextureIDs, voxelSideTextureSizes, position, pad, that) { //Create mesh var vert_data = createAOMesh(voxels, voxelSideTextureIDs, voxelSideTextureSizes) var vertexArrayObjects = {} if (vert_data === null) { // no vertices allocated } else { //Upload trian...
javascript
function createVoxelMesh(gl, voxels, voxelSideTextureIDs, voxelSideTextureSizes, position, pad, that) { //Create mesh var vert_data = createAOMesh(voxels, voxelSideTextureIDs, voxelSideTextureSizes) var vertexArrayObjects = {} if (vert_data === null) { // no vertices allocated } else { //Upload trian...
[ "function", "createVoxelMesh", "(", "gl", ",", "voxels", ",", "voxelSideTextureIDs", ",", "voxelSideTextureSizes", ",", "position", ",", "pad", ",", "that", ")", "{", "//Create mesh", "var", "vert_data", "=", "createAOMesh", "(", "voxels", ",", "voxelSideTextureID...
Creates a mesh from a set of voxels
[ "Creates", "a", "mesh", "from", "a", "set", "of", "voxels" ]
fc6d48247fd9393e32db89a6f239317212fdbb9b
https://github.com/voxel/voxel-mesher/blob/fc6d48247fd9393e32db89a6f239317212fdbb9b/mesh-buffer.js#L11-L63
41,382
TendaDigital/Tournamenter
controllers/Group.js
function(req, res, next){ // Search for ID if requested var id = req.param('id'); findAssociated(id, finishRendering); // Render JSON content function finishRendering(data){ // If none object found with given id return error if(id && !data[0]) return next(); // If querying for id, then return...
javascript
function(req, res, next){ // Search for ID if requested var id = req.param('id'); findAssociated(id, finishRendering); // Render JSON content function finishRendering(data){ // If none object found with given id return error if(id && !data[0]) return next(); // If querying for id, then return...
[ "function", "(", "req", ",", "res", ",", "next", ")", "{", "// Search for ID if requested", "var", "id", "=", "req", ".", "param", "(", "'id'", ")", ";", "findAssociated", "(", "id", ",", "finishRendering", ")", ";", "// Render JSON content", "function", "fi...
Mix in matches inside groups data
[ "Mix", "in", "matches", "inside", "groups", "data" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Group.js#L19-L39
41,383
TendaDigital/Tournamenter
controllers/Group.js
finishRendering
function finishRendering(data){ // If none object found with given id return error if(id && !data[0]) return next(); // If querying for id, then returns only the object if(id) data = data[0]; // Render the json res.send(data); }
javascript
function finishRendering(data){ // If none object found with given id return error if(id && !data[0]) return next(); // If querying for id, then returns only the object if(id) data = data[0]; // Render the json res.send(data); }
[ "function", "finishRendering", "(", "data", ")", "{", "// If none object found with given id return error", "if", "(", "id", "&&", "!", "data", "[", "0", "]", ")", "return", "next", "(", ")", ";", "// If querying for id, then returns only the object", "if", "(", "id...
Render JSON content
[ "Render", "JSON", "content" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Group.js#L27-L38
41,384
TendaDigital/Tournamenter
controllers/Group.js
afterFindGroups
function afterFindGroups(models){ data = models; completed = 0; if(data.length <= 0) return next([]); // Load Matches for each Group and associates data.forEach(function(group){ app.models.Match.find() .where({'groupId': group.id}) .sort('state DESC') .sort('day ASC') .sort('hour ASC'...
javascript
function afterFindGroups(models){ data = models; completed = 0; if(data.length <= 0) return next([]); // Load Matches for each Group and associates data.forEach(function(group){ app.models.Match.find() .where({'groupId': group.id}) .sort('state DESC') .sort('day ASC') .sort('hour ASC'...
[ "function", "afterFindGroups", "(", "models", ")", "{", "data", "=", "models", ";", "completed", "=", "0", ";", "if", "(", "data", ".", "length", "<=", "0", ")", "return", "next", "(", "[", "]", ")", ";", "// Load Matches for each Group and associates", "d...
After finishing search
[ "After", "finishing", "search" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Group.js#L78-L106
41,385
TendaDigital/Tournamenter
controllers/Group.js
afterFindTeams
function afterFindTeams(err, teamData){ var teamList = {}; // Load teams and assing it's key as it's id teamData.forEach(function(team){ teamList[team.id] = team; }); // Includes team object in 'table' data data.forEach(function(group){ // console.log(group); // Go trough all the table adding ke...
javascript
function afterFindTeams(err, teamData){ var teamList = {}; // Load teams and assing it's key as it's id teamData.forEach(function(team){ teamList[team.id] = team; }); // Includes team object in 'table' data data.forEach(function(group){ // console.log(group); // Go trough all the table adding ke...
[ "function", "afterFindTeams", "(", "err", ",", "teamData", ")", "{", "var", "teamList", "=", "{", "}", ";", "// Load teams and assing it's key as it's id", "teamData", ".", "forEach", "(", "function", "(", "team", ")", "{", "teamList", "[", "team", ".", "id", ...
Associate keys with teams
[ "Associate", "keys", "with", "teams" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Group.js#L122-L152
41,386
jhaynie/request-ssl
lib/index.js
RequestSSLError
function RequestSSLError(message, id) { Error.call(this); Error.captureStackTrace(this, RequestSSLError); this.id = id; this.name = 'RequestSSLError'; this.message = message; }
javascript
function RequestSSLError(message, id) { Error.call(this); Error.captureStackTrace(this, RequestSSLError); this.id = id; this.name = 'RequestSSLError'; this.message = message; }
[ "function", "RequestSSLError", "(", "message", ",", "id", ")", "{", "Error", ".", "call", "(", "this", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ",", "RequestSSLError", ")", ";", "this", ".", "id", "=", "id", ";", "this", ".", "name", ...
create a custom error so we can get proper error code
[ "create", "a", "custom", "error", "so", "we", "can", "get", "proper", "error", "code" ]
715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06
https://github.com/jhaynie/request-ssl/blob/715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06/lib/index.js#L131-L137
41,387
jhaynie/request-ssl
lib/index.js
createErrorMessage
function createErrorMessage(errorcode) { if (errorcode in ERRORS) { var args = Array.prototype.slice.call(arguments,1); var entry = ERRORS[errorcode]; if (entry.argcount && entry.argcount!==args.length) { // this should only ever get called if we have a bug in this library throw new Error("Internal failure...
javascript
function createErrorMessage(errorcode) { if (errorcode in ERRORS) { var args = Array.prototype.slice.call(arguments,1); var entry = ERRORS[errorcode]; if (entry.argcount && entry.argcount!==args.length) { // this should only ever get called if we have a bug in this library throw new Error("Internal failure...
[ "function", "createErrorMessage", "(", "errorcode", ")", "{", "if", "(", "errorcode", "in", "ERRORS", ")", "{", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "var", "entry", "=", "ERRORS...
construct the proper error message
[ "construct", "the", "proper", "error", "message" ]
715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06
https://github.com/jhaynie/request-ssl/blob/715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06/lib/index.js#L158-L172
41,388
jhaynie/request-ssl
lib/index.js
getDomain
function getDomain(url) { var domain = _.isObject(url) ? url.host : urlib.parse(url).host; return domain || url; }
javascript
function getDomain(url) { var domain = _.isObject(url) ? url.host : urlib.parse(url).host; return domain || url; }
[ "function", "getDomain", "(", "url", ")", "{", "var", "domain", "=", "_", ".", "isObject", "(", "url", ")", "?", "url", ".", "host", ":", "urlib", ".", "parse", "(", "url", ")", ".", "host", ";", "return", "domain", "||", "url", ";", "}" ]
given a url return a domain part
[ "given", "a", "url", "return", "a", "domain", "part" ]
715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06
https://github.com/jhaynie/request-ssl/blob/715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06/lib/index.js#L177-L180
41,389
jhaynie/request-ssl
lib/index.js
getFingerprintForURL
function getFingerprintForURL(url) { var domain = getDomain(url); var found = global.requestSSLFingerprints[domain]; debug('getFingerprintForURL %s -> %s=%s',url,domain,found); if (!found) { // try a wildcard search var u = urlib.parse(domain), tokens = (u && u.host || domain).split('.'); domain = '*.'+tok...
javascript
function getFingerprintForURL(url) { var domain = getDomain(url); var found = global.requestSSLFingerprints[domain]; debug('getFingerprintForURL %s -> %s=%s',url,domain,found); if (!found) { // try a wildcard search var u = urlib.parse(domain), tokens = (u && u.host || domain).split('.'); domain = '*.'+tok...
[ "function", "getFingerprintForURL", "(", "url", ")", "{", "var", "domain", "=", "getDomain", "(", "url", ")", ";", "var", "found", "=", "global", ".", "requestSSLFingerprints", "[", "domain", "]", ";", "debug", "(", "'getFingerprintForURL %s -> %s=%s'", ",", "...
lookup a fingerprint for a given URL by using the domain. returns null if not found
[ "lookup", "a", "fingerprint", "for", "a", "given", "URL", "by", "using", "the", "domain", ".", "returns", "null", "if", "not", "found" ]
715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06
https://github.com/jhaynie/request-ssl/blob/715d9ad7aa003b2ec4beae3b5c94ac7f0b942a06/lib/index.js#L186-L199
41,390
stoprocent/node-itunesconnect
index.js
Connect
function Connect(username, password, options) { // Default Options this.options = { baseURL : "https://itunesconnect.apple.com", apiURL : "https://reportingitc2.apple.com/api/", loginURL : "https://idmsa.apple.com/appleauth/auth/signin", appleWidgetKey : "22d448248055bab0dc197c6271d738c3", conc...
javascript
function Connect(username, password, options) { // Default Options this.options = { baseURL : "https://itunesconnect.apple.com", apiURL : "https://reportingitc2.apple.com/api/", loginURL : "https://idmsa.apple.com/appleauth/auth/signin", appleWidgetKey : "22d448248055bab0dc197c6271d738c3", conc...
[ "function", "Connect", "(", "username", ",", "password", ",", "options", ")", "{", "// Default Options", "this", ".", "options", "=", "{", "baseURL", ":", "\"https://itunesconnect.apple.com\"", ",", "apiURL", ":", "\"https://reportingitc2.apple.com/api/\"", ",", "logi...
Initialize a new `Connect` with the given `username`, `password` and `options`. Examples: // Import itc-report var itc = require("itunesconnect"), Report = itc.Report; // Init new iTunes Connect var itunes = new itc.Connect('apple@id.com', 'password'); // Init new iTunes Connect var itunes = new itc.Connect('appl...
[ "Initialize", "a", "new", "Connect", "with", "the", "given", "username", "password", "and", "options", "." ]
9d7c7ebe79eb8708a92631c55ce71e85ff89d1af
https://github.com/stoprocent/node-itunesconnect/blob/9d7c7ebe79eb8708a92631c55ce71e85ff89d1af/index.js#L110-L143
41,391
stoprocent/node-itunesconnect
index.js
Report
function Report(type, config) { var fn = Query.prototype[type]; if(typeof fn !== 'function') { throw new Error('Unknown Report type: ' + type); } return new Query(config)[type](); }
javascript
function Report(type, config) { var fn = Query.prototype[type]; if(typeof fn !== 'function') { throw new Error('Unknown Report type: ' + type); } return new Query(config)[type](); }
[ "function", "Report", "(", "type", ",", "config", ")", "{", "var", "fn", "=", "Query", ".", "prototype", "[", "type", "]", ";", "if", "(", "typeof", "fn", "!==", "'function'", ")", "{", "throw", "new", "Error", "(", "'Unknown Report type: '", "+", "typ...
Initialize a new `Query` with the given `type` and `config`. Examples: // Import itc-report var itc = require("itunesconnect"), Report = itc.Report; // Init new iTunes Connect var itunes = new itc.Connect('apple@id.com', 'password'); // Timed type query var query = Report('timed'); // Ranked type query with conf...
[ "Initialize", "a", "new", "Query", "with", "the", "given", "type", "and", "config", "." ]
9d7c7ebe79eb8708a92631c55ce71e85ff89d1af
https://github.com/stoprocent/node-itunesconnect/blob/9d7c7ebe79eb8708a92631c55ce71e85ff89d1af/index.js#L397-L403
41,392
stoprocent/node-itunesconnect
index.js
Query
function Query(config) { this.type = null; this.endpoint = null; this.config = { start : moment(), end : moment(), filters : {}, measures : ['units'], limit : 100 }; // Extend options with user stuff _.extend(this.config, config); // Private Options this._time = null; this._body = ...
javascript
function Query(config) { this.type = null; this.endpoint = null; this.config = { start : moment(), end : moment(), filters : {}, measures : ['units'], limit : 100 }; // Extend options with user stuff _.extend(this.config, config); // Private Options this._time = null; this._body = ...
[ "function", "Query", "(", "config", ")", "{", "this", ".", "type", "=", "null", ";", "this", ".", "endpoint", "=", "null", ";", "this", ".", "config", "=", "{", "start", ":", "moment", "(", ")", ",", "end", ":", "moment", "(", ")", ",", "filters"...
Initialize a new `Query` with the given `query`. Constants to use with Query // Import itc-report var itc = require("itunesconnect"), // Types itc.type.inapp itc.type.app // Transactions itc.transaction.free itc.transaction.paid itc.transaction.redownload itc.transaction.update itc.transaction.refund // Platforms ...
[ "Initialize", "a", "new", "Query", "with", "the", "given", "query", "." ]
9d7c7ebe79eb8708a92631c55ce71e85ff89d1af
https://github.com/stoprocent/node-itunesconnect/blob/9d7c7ebe79eb8708a92631c55ce71e85ff89d1af/index.js#L504-L521
41,393
TendaDigital/Tournamenter
controllers/Match.js
afterFindMatch
function afterFindMatch(models){ if(models.length != 1) return next(404); model = models[0]; // Fetch Both Teams app.models.Team.findById(model.teamAId).exec(function(err, models){ model.teamA = models.length ? models[0] : null; checkFetch(); }); app.models.Team.findById(model.teamBId).exec(functio...
javascript
function afterFindMatch(models){ if(models.length != 1) return next(404); model = models[0]; // Fetch Both Teams app.models.Team.findById(model.teamAId).exec(function(err, models){ model.teamA = models.length ? models[0] : null; checkFetch(); }); app.models.Team.findById(model.teamBId).exec(functio...
[ "function", "afterFindMatch", "(", "models", ")", "{", "if", "(", "models", ".", "length", "!=", "1", ")", "return", "next", "(", "404", ")", ";", "model", "=", "models", "[", "0", "]", ";", "// Fetch Both Teams", "app", ".", "models", ".", "Team", "...
Called after match is fetched. Associate with Group and Teams
[ "Called", "after", "match", "is", "fetched", ".", "Associate", "with", "Group", "and", "Teams" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Match.js#L56-L77
41,394
voxel/voxel-mesher
mesh.js
computeMesh
function computeMesh(array, voxelSideTextureIDs, voxelSideTextureSizes) { var shp = array.shape.slice(0) var nx = (shp[0]-2)|0 var ny = (shp[1]-2)|0 var nz = (shp[2]-2)|0 var sz = nx * ny * nz var scratch0 = pool.mallocInt32(sz) var scratch1 = pool.mallocInt32(sz) var scratch2 = pool.mallocInt32(sz) v...
javascript
function computeMesh(array, voxelSideTextureIDs, voxelSideTextureSizes) { var shp = array.shape.slice(0) var nx = (shp[0]-2)|0 var ny = (shp[1]-2)|0 var nz = (shp[2]-2)|0 var sz = nx * ny * nz var scratch0 = pool.mallocInt32(sz) var scratch1 = pool.mallocInt32(sz) var scratch2 = pool.mallocInt32(sz) v...
[ "function", "computeMesh", "(", "array", ",", "voxelSideTextureIDs", ",", "voxelSideTextureSizes", ")", "{", "var", "shp", "=", "array", ".", "shape", ".", "slice", "(", "0", ")", "var", "nx", "=", "(", "shp", "[", "0", "]", "-", "2", ")", "|", "0", ...
Compute a mesh
[ "Compute", "a", "mesh" ]
fc6d48247fd9393e32db89a6f239317212fdbb9b
https://github.com/voxel/voxel-mesher/blob/fc6d48247fd9393e32db89a6f239317212fdbb9b/mesh.js#L487-L547
41,395
mafintosh/pbs
index.js
function () { var self = this pb.toJSON().enums.forEach(function (e) { self[e.name] = e.values }) pb.toJSON().messages.forEach(function (m) { var message = {} m.enums.forEach(function (e) { message[e.name] = e }) message.name = m.name message.encode = encode...
javascript
function () { var self = this pb.toJSON().enums.forEach(function (e) { self[e.name] = e.values }) pb.toJSON().messages.forEach(function (m) { var message = {} m.enums.forEach(function (e) { message[e.name] = e }) message.name = m.name message.encode = encode...
[ "function", "(", ")", "{", "var", "self", "=", "this", "pb", ".", "toJSON", "(", ")", ".", "enums", ".", "forEach", "(", "function", "(", "e", ")", "{", "self", "[", "e", ".", "name", "]", "=", "e", ".", "values", "}", ")", "pb", ".", "toJSON...
to not make toString,toJSON enumarable we make a fire-and-forget prototype
[ "to", "not", "make", "toString", "toJSON", "enumarable", "we", "make", "a", "fire", "-", "and", "-", "forget", "prototype" ]
163e2390e01bf81b83f3fda0ca2823d7eea96e2b
https://github.com/mafintosh/pbs/blob/163e2390e01bf81b83f3fda0ca2823d7eea96e2b/index.js#L9-L26
41,396
TendaDigital/Tournamenter
modules/pageview-live-match/public/js/pageview-live-match.js
function($root) { var match = this.model.get('data'); this.updateScore(match.teamAScore, $root.find('.team.left .team-score')); this.updateScore(match.teamBScore, $root.find('.team.right .team-score')); }
javascript
function($root) { var match = this.model.get('data'); this.updateScore(match.teamAScore, $root.find('.team.left .team-score')); this.updateScore(match.teamBScore, $root.find('.team.right .team-score')); }
[ "function", "(", "$root", ")", "{", "var", "match", "=", "this", ".", "model", ".", "get", "(", "'data'", ")", ";", "this", ".", "updateScore", "(", "match", ".", "teamAScore", ",", "$root", ".", "find", "(", "'.team.left .team-score'", ")", ")", ";", ...
Update both score values
[ "Update", "both", "score", "values" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/modules/pageview-live-match/public/js/pageview-live-match.js#L182-L187
41,397
TendaDigital/Tournamenter
modules/pageview-live-match/public/js/pageview-live-match.js
function(state){ var match = this.model.get('data'); var countryA = match.teamA ? match.teamA.country : null; this.setFlagsState(state, countryA, this.$('.flag-3d-left')); var countryB = match.teamB ? match.teamB.country : null; this.setFlagsState(state, countryB, this.$('.flag-3d-right')); }
javascript
function(state){ var match = this.model.get('data'); var countryA = match.teamA ? match.teamA.country : null; this.setFlagsState(state, countryA, this.$('.flag-3d-left')); var countryB = match.teamB ? match.teamB.country : null; this.setFlagsState(state, countryB, this.$('.flag-3d-right')); }
[ "function", "(", "state", ")", "{", "var", "match", "=", "this", ".", "model", ".", "get", "(", "'data'", ")", ";", "var", "countryA", "=", "match", ".", "teamA", "?", "match", ".", "teamA", ".", "country", ":", "null", ";", "this", ".", "setFlagsS...
Animate both flags
[ "Animate", "both", "flags" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/modules/pageview-live-match/public/js/pageview-live-match.js#L204-L212
41,398
fnogatz/CHR.js
src/index.js
tag
function tag (chrSource) { var program var replacements // Examine caller format if (typeof chrSource === 'object' && chrSource.type && chrSource.type === 'Program') { // called with already parsed source code // e.g. tag({ type: 'Program', body: [ ... ] }) program = chr...
javascript
function tag (chrSource) { var program var replacements // Examine caller format if (typeof chrSource === 'object' && chrSource.type && chrSource.type === 'Program') { // called with already parsed source code // e.g. tag({ type: 'Program', body: [ ... ] }) program = chr...
[ "function", "tag", "(", "chrSource", ")", "{", "var", "program", "var", "replacements", "// Examine caller format", "if", "(", "typeof", "chrSource", "===", "'object'", "&&", "chrSource", ".", "type", "&&", "chrSource", ".", "type", "===", "'Program'", ")", "{...
Adds a number of rules given.
[ "Adds", "a", "number", "of", "rules", "given", "." ]
d87688327f139d726993537c7da98fcac0a4a89f
https://github.com/fnogatz/CHR.js/blob/d87688327f139d726993537c7da98fcac0a4a89f/src/index.js#L30-L81
41,399
TendaDigital/Tournamenter
controllers/Table.js
associateWithTeams
function associateWithTeams(teams, tableModel){ // Go through all team rows inside the table's data, and add's team object // _.forEach(tableModel.table, function(teamRow){ // teamRow['team'] = teams[teamRow.teamId] || {}; // }); // Go through all team rows inside scores, and add's a team object _.f...
javascript
function associateWithTeams(teams, tableModel){ // Go through all team rows inside the table's data, and add's team object // _.forEach(tableModel.table, function(teamRow){ // teamRow['team'] = teams[teamRow.teamId] || {}; // }); // Go through all team rows inside scores, and add's a team object _.f...
[ "function", "associateWithTeams", "(", "teams", ",", "tableModel", ")", "{", "// Go through all team rows inside the table's data, and add's team object", "// _.forEach(tableModel.table, function(teamRow){", "// \tteamRow['team'] = teams[teamRow.teamId] || {};", "// });", "// Go through all ...
Helper method used to save team data inside each table row
[ "Helper", "method", "used", "to", "save", "team", "data", "inside", "each", "table", "row" ]
2733ae9b454ae90896249ab1d7a07007eb4a69e4
https://github.com/TendaDigital/Tournamenter/blob/2733ae9b454ae90896249ab1d7a07007eb4a69e4/controllers/Table.js#L217-L227