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
52,500
berkeleybop/bbopx-js
external/bbop.js
_draw_table_or_something
function _draw_table_or_something(resp, manager){ // Wipe interface. jQuery('#' + interface_id).empty(); // Vary by what we got. if( ! resp.success() || resp.total_documents() === 0 ){ jQuery('#' + interface_id).append('<em>No results given your input and search fields. Please refine and try again.</em>'); ...
javascript
function _draw_table_or_something(resp, manager){ // Wipe interface. jQuery('#' + interface_id).empty(); // Vary by what we got. if( ! resp.success() || resp.total_documents() === 0 ){ jQuery('#' + interface_id).append('<em>No results given your input and search fields. Please refine and try again.</em>'); ...
[ "function", "_draw_table_or_something", "(", "resp", ",", "manager", ")", "{", "// Wipe interface.", "jQuery", "(", "'#'", "+", "interface_id", ")", ".", "empty", "(", ")", ";", "// Vary by what we got.", "if", "(", "!", "resp", ".", "success", "(", ")", "||...
Draw a table at the right place or an error message.
[ "Draw", "a", "table", "at", "the", "right", "place", "or", "an", "error", "message", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L20968-L21014
52,501
berkeleybop/bbopx-js
external/bbop.js
read_cli
function read_cli(event){ var which = event.which; var ctrl_p = event.ctrlKey; //log('cli: ' + which + ', ' + ctrl_p); if ( which == 13 ) { // return // Stop events. event.preventDefault(); // Get and ensure nice JS, wipe CLI clean. var to_eval = jQuery('#' + command_line.get_id())...
javascript
function read_cli(event){ var which = event.which; var ctrl_p = event.ctrlKey; //log('cli: ' + which + ', ' + ctrl_p); if ( which == 13 ) { // return // Stop events. event.preventDefault(); // Get and ensure nice JS, wipe CLI clean. var to_eval = jQuery('#' + command_line.get_id())...
[ "function", "read_cli", "(", "event", ")", "{", "var", "which", "=", "event", ".", "which", ";", "var", "ctrl_p", "=", "event", ".", "ctrlKey", ";", "//log('cli: ' + which + ', ' + ctrl_p);", "if", "(", "which", "==", "13", ")", "{", "// return", "// Stop ev...
A lot of cases for button presses when reading from the command line.
[ "A", "lot", "of", "cases", "for", "button", "presses", "when", "reading", "from", "the", "command", "line", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L21346-L21407
52,502
berkeleybop/bbopx-js
external/bbop.js
read_buffer
function read_buffer(){ var to_eval = jQuery('#' + command_buffer.get_id()).val(); if( to_eval != '' ){ log('// Evaluating buffer...'); var evals = _evaluate(to_eval); log('// ' + evals[1]); _advance_log_to_bottom(); } }
javascript
function read_buffer(){ var to_eval = jQuery('#' + command_buffer.get_id()).val(); if( to_eval != '' ){ log('// Evaluating buffer...'); var evals = _evaluate(to_eval); log('// ' + evals[1]); _advance_log_to_bottom(); } }
[ "function", "read_buffer", "(", ")", "{", "var", "to_eval", "=", "jQuery", "(", "'#'", "+", "command_buffer", ".", "get_id", "(", ")", ")", ".", "val", "(", ")", ";", "if", "(", "to_eval", "!=", "''", ")", "{", "log", "(", "'// Evaluating buffer...'", ...
Bind buffer eval.
[ "Bind", "buffer", "eval", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L21411-L21419
52,503
berkeleybop/bbopx-js
external/bbop.js
gather_list_from_hash
function gather_list_from_hash(nid, hash){ var retlist = new Array(); retlist.push(nid); // Get all nodes cribbing from distances. for( vt in hash[nid] ){ //ll("id: " + id + ", v: " + ct); retlist.push(vt); } return retlist; }
javascript
function gather_list_from_hash(nid, hash){ var retlist = new Array(); retlist.push(nid); // Get all nodes cribbing from distances. for( vt in hash[nid] ){ //ll("id: " + id + ", v: " + ct); retlist.push(vt); } return retlist; }
[ "function", "gather_list_from_hash", "(", "nid", ",", "hash", ")", "{", "var", "retlist", "=", "new", "Array", "(", ")", ";", "retlist", ".", "push", "(", "nid", ")", ";", "// Get all nodes cribbing from distances.", "for", "(", "vt", "in", "hash", "[", "n...
Subtree list, including self.
[ "Subtree", "list", "including", "self", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L22185-L22194
52,504
berkeleybop/bbopx-js
external/bbop.js
get_connections
function get_connections(phynode_id, phynode_getter, conn_hash){ var retlist = new Array(); // Fish in the connection ancestor hash for edges. var tmp_phynodes = phynode_getter(phynode_id); for( var si = 0; si < tmp_phynodes.length; si++ ){ var tshp = tmp_phynodes[si]; var tnid = phynode_id_to...
javascript
function get_connections(phynode_id, phynode_getter, conn_hash){ var retlist = new Array(); // Fish in the connection ancestor hash for edges. var tmp_phynodes = phynode_getter(phynode_id); for( var si = 0; si < tmp_phynodes.length; si++ ){ var tshp = tmp_phynodes[si]; var tnid = phynode_id_to...
[ "function", "get_connections", "(", "phynode_id", ",", "phynode_getter", ",", "conn_hash", ")", "{", "var", "retlist", "=", "new", "Array", "(", ")", ";", "// Fish in the connection ancestor hash for edges.", "var", "tmp_phynodes", "=", "phynode_getter", "(", "phynode...
General func.
[ "General", "func", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L22238-L22259
52,505
berkeleybop/bbopx-js
external/bbop.js
function () { var phynode_id = this.id; // Fade boxes. var assoc_phynodes = get_descendant_phynodes(phynode_id); for( var si = 0; si < assoc_phynodes.length; si++ ){ var mshp = assoc_phynodes[si]; mshp.update(); } // Update connections; bring them all back to normal....
javascript
function () { var phynode_id = this.id; // Fade boxes. var assoc_phynodes = get_descendant_phynodes(phynode_id); for( var si = 0; si < assoc_phynodes.length; si++ ){ var mshp = assoc_phynodes[si]; mshp.update(); } // Update connections; bring them all back to normal....
[ "function", "(", ")", "{", "var", "phynode_id", "=", "this", ".", "id", ";", "// Fade boxes.", "var", "assoc_phynodes", "=", "get_descendant_phynodes", "(", "phynode_id", ")", ";", "for", "(", "var", "si", "=", "0", ";", "si", "<", "assoc_phynodes", ".", ...
Undrag animation.
[ "Undrag", "animation", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L22335-L22351
52,506
berkeleybop/bbopx-js
external/bbop.js
dblclick_event_handler
function dblclick_event_handler(event){ var phynode_id = this.id; // If this is the first double click here... var pn = get_pnode_from_phynode_id(phynode_id); if( pn.open == true ){ // "Vanish" edges. var subtree_edges = get_descendant_connections(phynode_id); for( var se = 0; se < subtre...
javascript
function dblclick_event_handler(event){ var phynode_id = this.id; // If this is the first double click here... var pn = get_pnode_from_phynode_id(phynode_id); if( pn.open == true ){ // "Vanish" edges. var subtree_edges = get_descendant_connections(phynode_id); for( var se = 0; se < subtre...
[ "function", "dblclick_event_handler", "(", "event", ")", "{", "var", "phynode_id", "=", "this", ".", "id", ";", "// If this is the first double click here...", "var", "pn", "=", "get_pnode_from_phynode_id", "(", "phynode_id", ")", ";", "if", "(", "pn", ".", "open"...
Experiment with double click.
[ "Experiment", "with", "double", "click", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L22354-L22402
52,507
berkeleybop/bbopx-js
external/bbop.js
_generate_element
function _generate_element(ctype, str){ var message_classes = ['bbop-js-message', 'bbop-js-message-' + ctype]; var message_elt = new bbop.html.tag('div', {'generate_id': true, 'class': message_classes.join(' ')}, '<h2>' + str + '</h2>'); jQuery("body").append(jQuery(...
javascript
function _generate_element(ctype, str){ var message_classes = ['bbop-js-message', 'bbop-js-message-' + ctype]; var message_elt = new bbop.html.tag('div', {'generate_id': true, 'class': message_classes.join(' ')}, '<h2>' + str + '</h2>'); jQuery("body").append(jQuery(...
[ "function", "_generate_element", "(", "ctype", ",", "str", ")", "{", "var", "message_classes", "=", "[", "'bbop-js-message'", ",", "'bbop-js-message-'", "+", "ctype", "]", ";", "var", "message_elt", "=", "new", "bbop", ".", "html", ".", "tag", "(", "'div'", ...
Generate tags.
[ "Generate", "tags", "." ]
847d87f5980f144c19c4caef3786044930fe51db
https://github.com/berkeleybop/bbopx-js/blob/847d87f5980f144c19c4caef3786044930fe51db/external/bbop.js#L24584-L24600
52,508
briancsparks/run-anywhere
ra.js
function(dirname) { var result; if (!fs.test('-d', dirname)) { return result; } result = {}; _.each(sg.fs.ls(dirname), (name_) => { const name = path.basename(name_, '.js'); const filename = path.join(dirname, name); if (!fs.test('-f', `${filename}.js`)) { return; } // skip if (name.s...
javascript
function(dirname) { var result; if (!fs.test('-d', dirname)) { return result; } result = {}; _.each(sg.fs.ls(dirname), (name_) => { const name = path.basename(name_, '.js'); const filename = path.join(dirname, name); if (!fs.test('-f', `${filename}.js`)) { return; } // skip if (name.s...
[ "function", "(", "dirname", ")", "{", "var", "result", ";", "if", "(", "!", "fs", ".", "test", "(", "'-d'", ",", "dirname", ")", ")", "{", "return", "result", ";", "}", "result", "=", "{", "}", ";", "_", ".", "each", "(", "sg", ".", "fs", "."...
Loads all the scripts in a dir.
[ "Loads", "all", "the", "scripts", "in", "a", "dir", "." ]
b73d170dc86cc00e6562ca8544fceb3478d51e20
https://github.com/briancsparks/run-anywhere/blob/b73d170dc86cc00e6562ca8544fceb3478d51e20/ra.js#L269-L286
52,509
RangerMauve/cypher-promise
index.js
make_query_maker
function make_query_maker(connection_string, connection_opts) { connection_string = connection_string || "http://localhost:7474"; connection_opts = connection_opts || {}; var client_cache = null; return { query: query, multi: multi }; /** * Makes a cypher query and resolves to the result * @param {Stri...
javascript
function make_query_maker(connection_string, connection_opts) { connection_string = connection_string || "http://localhost:7474"; connection_opts = connection_opts || {}; var client_cache = null; return { query: query, multi: multi }; /** * Makes a cypher query and resolves to the result * @param {Stri...
[ "function", "make_query_maker", "(", "connection_string", ",", "connection_opts", ")", "{", "connection_string", "=", "connection_string", "||", "\"http://localhost:7474\"", ";", "connection_opts", "=", "connection_opts", "||", "{", "}", ";", "var", "client_cache", "=",...
Creates a new client for making cypher queries @param {String} connection_string The url of the Neo4j server @param {Object} [connection_opts] Options for node-cypher @return {Cypher} Returns a new Cypher client
[ "Creates", "a", "new", "client", "for", "making", "cypher", "queries" ]
cc2bdc95fce6525427a76a891d174afcfc5bcd8e
https://github.com/RangerMauve/cypher-promise/blob/cc2bdc95fce6525427a76a891d174afcfc5bcd8e/index.js#L15-L84
52,510
RangerMauve/cypher-promise
index.js
query_with
function query_with(client, cypher_query, parameters) { parameters = parameters || {}; return make_promise(client.query.bind(client, cypher_query, parameters)); }
javascript
function query_with(client, cypher_query, parameters) { parameters = parameters || {}; return make_promise(client.query.bind(client, cypher_query, parameters)); }
[ "function", "query_with", "(", "client", ",", "cypher_query", ",", "parameters", ")", "{", "parameters", "=", "parameters", "||", "{", "}", ";", "return", "make_promise", "(", "client", ".", "query", ".", "bind", "(", "client", ",", "cypher_query", ",", "p...
Makes a query with a given client and returns a promise
[ "Makes", "a", "query", "with", "a", "given", "client", "and", "returns", "a", "promise" ]
cc2bdc95fce6525427a76a891d174afcfc5bcd8e
https://github.com/RangerMauve/cypher-promise/blob/cc2bdc95fce6525427a76a891d174afcfc5bcd8e/index.js#L66-L69
52,511
RangerMauve/cypher-promise
index.js
get_client
function get_client() { if (client_cache) return Promise.resolve(client_cache); return make_promise( cypher.createClient.bind(cypher, connection_string, connection_opts) ).then(cache_client); }
javascript
function get_client() { if (client_cache) return Promise.resolve(client_cache); return make_promise( cypher.createClient.bind(cypher, connection_string, connection_opts) ).then(cache_client); }
[ "function", "get_client", "(", ")", "{", "if", "(", "client_cache", ")", "return", "Promise", ".", "resolve", "(", "client_cache", ")", ";", "return", "make_promise", "(", "cypher", ".", "createClient", ".", "bind", "(", "cypher", ",", "connection_string", "...
Creates a new client or returns a cached one
[ "Creates", "a", "new", "client", "or", "returns", "a", "cached", "one" ]
cc2bdc95fce6525427a76a891d174afcfc5bcd8e
https://github.com/RangerMauve/cypher-promise/blob/cc2bdc95fce6525427a76a891d174afcfc5bcd8e/index.js#L72-L77
52,512
Nazariglez/perenquen
lib/pixi/src/filters/dropshadow/BlurYTintFilter.js
BlurYTintFilter
function BlurYTintFilter() { core.AbstractFilter.call(this, // vertex shader fs.readFileSync(__dirname + '/blurYTint.vert', 'utf8'), // fragment shader fs.readFileSync(__dirname + '/blurYTint.frag', 'utf8'), // set the uniforms { blur: { type: '1f', value:...
javascript
function BlurYTintFilter() { core.AbstractFilter.call(this, // vertex shader fs.readFileSync(__dirname + '/blurYTint.vert', 'utf8'), // fragment shader fs.readFileSync(__dirname + '/blurYTint.frag', 'utf8'), // set the uniforms { blur: { type: '1f', value:...
[ "function", "BlurYTintFilter", "(", ")", "{", "core", ".", "AbstractFilter", ".", "call", "(", "this", ",", "// vertex shader", "fs", ".", "readFileSync", "(", "__dirname", "+", "'/blurYTint.vert'", ",", "'utf8'", ")", ",", "// fragment shader", "fs", ".", "re...
The BlurYTintFilter applies a vertical Gaussian blur to an object. @class @extends AbstractFilter @memberof PIXI.filters
[ "The", "BlurYTintFilter", "applies", "a", "vertical", "Gaussian", "blur", "to", "an", "object", "." ]
e023964d05afeefebdcac4e2044819fdfa3899ae
https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/filters/dropshadow/BlurYTintFilter.js#L13-L32
52,513
wunderbyte/grunt-spiritual-dox
src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js
function ( src ) { var cuts = src.split ( "/" ); var name = cuts.pop (); var dots = src.split ( "." ); var type = dots.pop (); new gui.Request(src).acceptText().get().then(function(status, data) { this._output(name, type, data); }, this); }
javascript
function ( src ) { var cuts = src.split ( "/" ); var name = cuts.pop (); var dots = src.split ( "." ); var type = dots.pop (); new gui.Request(src).acceptText().get().then(function(status, data) { this._output(name, type, data); }, this); }
[ "function", "(", "src", ")", "{", "var", "cuts", "=", "src", ".", "split", "(", "\"/\"", ")", ";", "var", "name", "=", "cuts", ".", "pop", "(", ")", ";", "var", "dots", "=", "src", ".", "split", "(", "\".\"", ")", ";", "var", "type", "=", "do...
Fetch file from server. @return {String} src
[ "Fetch", "file", "from", "server", "." ]
5afcfe31ddbf7d654166aa15b938553b61de5811
https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js#L37-L45
52,514
wunderbyte/grunt-spiritual-dox
src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js
function ( text, type ) { switch ( type ) { case "js" : return new dox.JSDoc ({ title : document.title, chapters : this._chapters ( text ) }); case "md" : return new dox.MDDoc ({ title : document.title, markup : this._markup ( text ) }); } }
javascript
function ( text, type ) { switch ( type ) { case "js" : return new dox.JSDoc ({ title : document.title, chapters : this._chapters ( text ) }); case "md" : return new dox.MDDoc ({ title : document.title, markup : this._markup ( text ) }); } }
[ "function", "(", "text", ",", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "\"js\"", ":", "return", "new", "dox", ".", "JSDoc", "(", "{", "title", ":", "document", ".", "title", ",", "chapters", ":", "this", ".", "_chapters", "(", "te...
Compute Doc object for file text. @param {String} text File text @param {String} type File type @returns {dox.JSDoc|dox.MDDoc}
[ "Compute", "Doc", "object", "for", "file", "text", "." ]
5afcfe31ddbf7d654166aa15b938553b61de5811
https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js#L66-L79
52,515
wunderbyte/grunt-spiritual-dox
src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js
function ( source ) { var comment = false; var chapters = []; var chapter = null; var sections = []; var section = null; var marker = new Showdown.converter (); function nextchapter ( title ) { if ( chapter ) { chapter.sections = sections.map ( function ( section, i ) { section.desc = marker...
javascript
function ( source ) { var comment = false; var chapters = []; var chapter = null; var sections = []; var section = null; var marker = new Showdown.converter (); function nextchapter ( title ) { if ( chapter ) { chapter.sections = sections.map ( function ( section, i ) { section.desc = marker...
[ "function", "(", "source", ")", "{", "var", "comment", "=", "false", ";", "var", "chapters", "=", "[", "]", ";", "var", "chapter", "=", "null", ";", "var", "sections", "=", "[", "]", ";", "var", "section", "=", "null", ";", "var", "marker", "=", ...
Parse source code to chapters. @param {String} source @return {Array<dox.Chapter>}
[ "Parse", "source", "code", "to", "chapters", "." ]
5afcfe31ddbf7d654166aa15b938553b61de5811
https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/output/dox.DocsOutputSpirit.js#L86-L171
52,516
IonicaBizau/indento
lib/index.js
indento
function indento(input, width, char) { char = typeof char !== "string" ? " " : char; return String(input).replace(/^/gm, char.repeat(width)); }
javascript
function indento(input, width, char) { char = typeof char !== "string" ? " " : char; return String(input).replace(/^/gm, char.repeat(width)); }
[ "function", "indento", "(", "input", ",", "width", ",", "char", ")", "{", "char", "=", "typeof", "char", "!==", "\"string\"", "?", "\" \"", ":", "char", ";", "return", "String", "(", "input", ")", ".", "replace", "(", "/", "^", "/", "gm", ",", "cha...
indento Indents the input string. @name indento @function @param {String} input The input string. @param {Number} width The indent width. @param {String} char The character to use for indentation (default: `" "`). @return {String} The indented string.
[ "indento", "Indents", "the", "input", "string", "." ]
8d1a2745ff03bd92484e115eb28c473c09e52c02
https://github.com/IonicaBizau/indento/blob/8d1a2745ff03bd92484e115eb28c473c09e52c02/lib/index.js#L12-L15
52,517
Jonjump/trakter
index.js
request
function request (suppliedOptions,data,next) { var options = makeOptions(suppliedOptions); switch (options.method ? options.method.toUpperCase() : "BADMETHOD") { case "PUT": case "POST": var dataString = JSON.stringify(data); options.headers['Content-Leng...
javascript
function request (suppliedOptions,data,next) { var options = makeOptions(suppliedOptions); switch (options.method ? options.method.toUpperCase() : "BADMETHOD") { case "PUT": case "POST": var dataString = JSON.stringify(data); options.headers['Content-Leng...
[ "function", "request", "(", "suppliedOptions", ",", "data", ",", "next", ")", "{", "var", "options", "=", "makeOptions", "(", "suppliedOptions", ")", ";", "switch", "(", "options", ".", "method", "?", "options", ".", "method", ".", "toUpperCase", "(", ")",...
make a request to Trakt.tv @method request @param {Object} options The options for the call @param {Object} data The data for the call, or null @param {Function} next(err,traktResponseString) @example trakter.request(options,data,next )
[ "make", "a", "request", "to", "Trakt", ".", "tv" ]
637c73bd67c3507660e3057570c726420553c9f2
https://github.com/Jonjump/trakter/blob/637c73bd67c3507660e3057570c726420553c9f2/index.js#L95-L139
52,518
MakerCollider/upm_mc
doxy/node/generators/ternjs/generator.js
GENERATE_CLASSES
function GENERATE_CLASSES(classes) { var docs = {}; _.each(classes, function(classSpec, parentClass) { var constructor = classSpec.methods[parentClass]; _.extend(docs, GENERATE_METHOD(parentClass, constructor ? constructor : { params: {}, return: {}, description: '' } )); if (_.has(docs, parentClass)) ...
javascript
function GENERATE_CLASSES(classes) { var docs = {}; _.each(classes, function(classSpec, parentClass) { var constructor = classSpec.methods[parentClass]; _.extend(docs, GENERATE_METHOD(parentClass, constructor ? constructor : { params: {}, return: {}, description: '' } )); if (_.has(docs, parentClass)) ...
[ "function", "GENERATE_CLASSES", "(", "classes", ")", "{", "var", "docs", "=", "{", "}", ";", "_", ".", "each", "(", "classes", ",", "function", "(", "classSpec", ",", "parentClass", ")", "{", "var", "constructor", "=", "classSpec", ".", "methods", "[", ...
generate the spec for the given list of classes
[ "generate", "the", "spec", "for", "the", "given", "list", "of", "classes" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/ternjs/generator.js#L69-L88
52,519
MakerCollider/upm_mc
doxy/node/generators/ternjs/generator.js
GENERATE_METHOD
function GENERATE_METHOD(name, spec) { var doc = {}; doc[name] = { '!type': 'fn(' + GENERATE_PARAMS(spec.params) + ')' + GENERATE_RETURN(spec.return), '!doc': spec.description } return doc; }
javascript
function GENERATE_METHOD(name, spec) { var doc = {}; doc[name] = { '!type': 'fn(' + GENERATE_PARAMS(spec.params) + ')' + GENERATE_RETURN(spec.return), '!doc': spec.description } return doc; }
[ "function", "GENERATE_METHOD", "(", "name", ",", "spec", ")", "{", "var", "doc", "=", "{", "}", ";", "doc", "[", "name", "]", "=", "{", "'!type'", ":", "'fn('", "+", "GENERATE_PARAMS", "(", "spec", ".", "params", ")", "+", "')'", "+", "GENERATE_RETUR...
generate method spec
[ "generate", "method", "spec" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/ternjs/generator.js#L92-L99
52,520
MakerCollider/upm_mc
doxy/node/generators/ternjs/generator.js
GENERATE_PARAMS
function GENERATE_PARAMS(spec) { return _.map(spec, function(paramSpec, paramName) { return paramName + ': ' + paramSpec.type; }).join(', '); }
javascript
function GENERATE_PARAMS(spec) { return _.map(spec, function(paramSpec, paramName) { return paramName + ': ' + paramSpec.type; }).join(', '); }
[ "function", "GENERATE_PARAMS", "(", "spec", ")", "{", "return", "_", ".", "map", "(", "spec", ",", "function", "(", "paramSpec", ",", "paramName", ")", "{", "return", "paramName", "+", "': '", "+", "paramSpec", ".", "type", ";", "}", ")", ".", "join", ...
generate parameter signatures for method
[ "generate", "parameter", "signatures", "for", "method" ]
525e775a17b85c30716c00435a2acb26bb198c12
https://github.com/MakerCollider/upm_mc/blob/525e775a17b85c30716c00435a2acb26bb198c12/doxy/node/generators/ternjs/generator.js#L103-L107
52,521
sendanor/nor-db
orig/2013-08-21/extend.js
extend_if_promise
function extend_if_promise(methods, ret) { if(ret && ret.then) { // Check if return value is promise compatible return extend.promise(methods, ret); // ..and if so, extend it, too. } return ret; // ..and if not, return the s...
javascript
function extend_if_promise(methods, ret) { if(ret && ret.then) { // Check if return value is promise compatible return extend.promise(methods, ret); // ..and if so, extend it, too. } return ret; // ..and if not, return the s...
[ "function", "extend_if_promise", "(", "methods", ",", "ret", ")", "{", "if", "(", "ret", "&&", "ret", ".", "then", ")", "{", "// Check if return value is promise compatible", "return", "extend", ".", "promise", "(", "methods", ",", "ret", ")", ";", "// ..and i...
original extend_promise Extend the value if it's a promise, otherwise just return it instead. @returns the extended promise or the value itself.
[ "original", "extend_promise", "Extend", "the", "value", "if", "it", "s", "a", "promise", "otherwise", "just", "return", "it", "instead", "." ]
db4b78691956a49370fc9d9a4eed27e7d3720aeb
https://github.com/sendanor/nor-db/blob/db4b78691956a49370fc9d9a4eed27e7d3720aeb/orig/2013-08-21/extend.js#L52-L57
52,522
node-ci/nci-projects-reloader
lib/index.js
function(filename, fileInfo) { var projectName = path.relative( app.config.paths.projects, path.dirname(filename) ); if (app.projects.get(projectName)) { logger.log('Unload project: "' + projectName + '"'); app.projects.unload({name: projectName}); } // on add or change (info is falsy on unlink)...
javascript
function(filename, fileInfo) { var projectName = path.relative( app.config.paths.projects, path.dirname(filename) ); if (app.projects.get(projectName)) { logger.log('Unload project: "' + projectName + '"'); app.projects.unload({name: projectName}); } // on add or change (info is falsy on unlink)...
[ "function", "(", "filename", ",", "fileInfo", ")", "{", "var", "projectName", "=", "path", ".", "relative", "(", "app", ".", "config", ".", "paths", ".", "projects", ",", "path", ".", "dirname", "(", "filename", ")", ")", ";", "if", "(", "app", ".", ...
start file watcher for reloading projects on change
[ "start", "file", "watcher", "for", "reloading", "projects", "on", "change" ]
25f125a5135853e9cffd4db62246e0a6984d0fc3
https://github.com/node-ci/nci-projects-reloader/blob/25f125a5135853e9cffd4db62246e0a6984d0fc3/lib/index.js#L10-L37
52,523
mikolalysenko/splat-points
splat.js
splatND
function splatND(out, points, weights, radius) { var n = points.shape[0] var d = points.shape[1] var lo = new Array(d) var hi = new Array(d) var bounds = out.shape var coord = new Array(d+1) var w = 1.0 function splatRec(k) { if(k < 0) { coord[d] = out.get.apply(out, coord) + w out.set.a...
javascript
function splatND(out, points, weights, radius) { var n = points.shape[0] var d = points.shape[1] var lo = new Array(d) var hi = new Array(d) var bounds = out.shape var coord = new Array(d+1) var w = 1.0 function splatRec(k) { if(k < 0) { coord[d] = out.get.apply(out, coord) + w out.set.a...
[ "function", "splatND", "(", "out", ",", "points", ",", "weights", ",", "radius", ")", "{", "var", "n", "=", "points", ".", "shape", "[", "0", "]", "var", "d", "=", "points", ".", "shape", "[", "1", "]", "var", "lo", "=", "new", "Array", "(", "d...
Slow generic routine
[ "Slow", "generic", "routine" ]
d89e439d27795130ee9f4f597670ef0376f13b39
https://github.com/mikolalysenko/splat-points/blob/d89e439d27795130ee9f4f597670ef0376f13b39/splat.js#L14-L50
52,524
novadiscovery/nway
lib/templates/loader.js
fireOnLoad
function fireOnLoad() { var args = arguments, i; for(i = 0, len = addOnLoadHandler.stack.length; i<len; i++) { addOnLoadHandler.stack[i].apply(null, args); } }
javascript
function fireOnLoad() { var args = arguments, i; for(i = 0, len = addOnLoadHandler.stack.length; i<len; i++) { addOnLoadHandler.stack[i].apply(null, args); } }
[ "function", "fireOnLoad", "(", ")", "{", "var", "args", "=", "arguments", ",", "i", ";", "for", "(", "i", "=", "0", ",", "len", "=", "addOnLoadHandler", ".", "stack", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "addOnLoadHandler"...
Call on load handlers
[ "Call", "on", "load", "handlers" ]
fa31c6fe56f2305721e581ac25e8ac9a87e15dda
https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/templates/loader.js#L23-L28
52,525
novadiscovery/nway
lib/templates/loader.js
findHash
function findHash(path) { var h, m, len; for(h in config.map) { var modules = config.map[h]; for(m = 0, len = modules.length; m < len; m++ ) { if(modules[m] === path) return h } } return null; }
javascript
function findHash(path) { var h, m, len; for(h in config.map) { var modules = config.map[h]; for(m = 0, len = modules.length; m < len; m++ ) { if(modules[m] === path) return h } } return null; }
[ "function", "findHash", "(", "path", ")", "{", "var", "h", ",", "m", ",", "len", ";", "for", "(", "h", "in", "config", ".", "map", ")", "{", "var", "modules", "=", "config", ".", "map", "[", "h", "]", ";", "for", "(", "m", "=", "0", ",", "l...
Find the pack hash for the given path @param {string} path The path to resolve @return {string} The hash for the path @api private
[ "Find", "the", "pack", "hash", "for", "the", "given", "path" ]
fa31c6fe56f2305721e581ac25e8ac9a87e15dda
https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/templates/loader.js#L52-L61
52,526
novadiscovery/nway
lib/templates/loader.js
scriptLoader
function scriptLoader(url, callback) { var doc = document, s = doc.createElement("script") , head = doc.getElementsByTagName("head")[0] , node , done = false; ; // On success listener function onScriptLoad() { if ( !done && (!this.readyState || this.readyState == "...
javascript
function scriptLoader(url, callback) { var doc = document, s = doc.createElement("script") , head = doc.getElementsByTagName("head")[0] , node , done = false; ; // On success listener function onScriptLoad() { if ( !done && (!this.readyState || this.readyState == "...
[ "function", "scriptLoader", "(", "url", ",", "callback", ")", "{", "var", "doc", "=", "document", ",", "s", "=", "doc", ".", "createElement", "(", "\"script\"", ")", ",", "head", "=", "doc", ".", "getElementsByTagName", "(", "\"head\"", ")", "[", "0", ...
The script loader Load a packed script and return to the callback the resulting value @param {string} url The packed script url @param {Function} callback A callback function that receive and error object
[ "The", "script", "loader" ]
fa31c6fe56f2305721e581ac25e8ac9a87e15dda
https://github.com/novadiscovery/nway/blob/fa31c6fe56f2305721e581ac25e8ac9a87e15dda/lib/templates/loader.js#L73-L116
52,527
RaphaelDeLaGhetto/gebo-utils
index.js
_getMongoDbName
function _getMongoDbName(str) { if (!/[/\. "*<>:|?@]/.test(str)) { return str; } str = str.replace(/\//g, exports.constants.slash); str = str.replace(/\\/g, exports.constants.backslash); str = str.replace(/\./g, exports.constants.dot); str = str.replace...
javascript
function _getMongoDbName(str) { if (!/[/\. "*<>:|?@]/.test(str)) { return str; } str = str.replace(/\//g, exports.constants.slash); str = str.replace(/\\/g, exports.constants.backslash); str = str.replace(/\./g, exports.constants.dot); str = str.replace...
[ "function", "_getMongoDbName", "(", "str", ")", "{", "if", "(", "!", "/", "[/\\. \"*<>:|?@]", "/", ".", "test", "(", "str", ")", ")", "{", "return", "str", ";", "}", "str", "=", "str", ".", "replace", "(", "/", "\\/", "/", "g", ",", "exports", "....
Make the gebo user's email address suitable for naming a database... and more! Mongo does not allow these characters: /\. "*<>:|? (http://docs.mongodb.org/manual/reference/limits/) This function sanitizes @s as well, though it is not required by Mongo. @param string @return string
[ "Make", "the", "gebo", "user", "s", "email", "address", "suitable", "for", "naming", "a", "database", "...", "and", "more!" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L94-L113
52,528
RaphaelDeLaGhetto/gebo-utils
index.js
_getSafeFileName
function _getSafeFileName(filename, directory) { var deferred = q.defer(); fs.readdir(directory, function(err, files) { if(err) { // This means the directory doesn't exist if (err.errno === 34 && err.code === 'ENOENT') { deferred.resolve(...
javascript
function _getSafeFileName(filename, directory) { var deferred = q.defer(); fs.readdir(directory, function(err, files) { if(err) { // This means the directory doesn't exist if (err.errno === 34 && err.code === 'ENOENT') { deferred.resolve(...
[ "function", "_getSafeFileName", "(", "filename", ",", "directory", ")", "{", "var", "deferred", "=", "q", ".", "defer", "(", ")", ";", "fs", ".", "readdir", "(", "directory", ",", "function", "(", "err", ",", "files", ")", "{", "if", "(", "err", ")",...
Append a copy number to a filename if a file by that same name already exists @param string @param string @return promise
[ "Append", "a", "copy", "number", "to", "a", "filename", "if", "a", "file", "by", "that", "same", "name", "already", "exists" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L209-L274
52,529
RaphaelDeLaGhetto/gebo-utils
index.js
_getOutputFileName
function _getOutputFileName(path, extension) { var filename = path.split('/'); filename = filename[filename.length - 1]; filename = filename.split('.'); // No extension found if (filename.length === 1) { return filename[0] + '.' + extension; } ...
javascript
function _getOutputFileName(path, extension) { var filename = path.split('/'); filename = filename[filename.length - 1]; filename = filename.split('.'); // No extension found if (filename.length === 1) { return filename[0] + '.' + extension; } ...
[ "function", "_getOutputFileName", "(", "path", ",", "extension", ")", "{", "var", "filename", "=", "path", ".", "split", "(", "'/'", ")", ";", "filename", "=", "filename", "[", "filename", ".", "length", "-", "1", "]", ";", "filename", "=", "filename", ...
Take the incoming filename and its extension and return the hypothetical output filename @param string @param string @return string
[ "Take", "the", "incoming", "filename", "and", "its", "extension", "and", "return", "the", "hypothetical", "output", "filename" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L334-L356
52,530
RaphaelDeLaGhetto/gebo-utils
index.js
_setTimeLimit
function _setTimeLimit(options, done) { if (options && options.timeLimit && options.pidFile) { var timeout = setTimeout(function() { var kill = 'kill $(cat ' + options.pidFile + ')'; if (logLevel === 'trace') logger.warn('process', kill); childProcess.ex...
javascript
function _setTimeLimit(options, done) { if (options && options.timeLimit && options.pidFile) { var timeout = setTimeout(function() { var kill = 'kill $(cat ' + options.pidFile + ')'; if (logLevel === 'trace') logger.warn('process', kill); childProcess.ex...
[ "function", "_setTimeLimit", "(", "options", ",", "done", ")", "{", "if", "(", "options", "&&", "options", ".", "timeLimit", "&&", "options", ".", "pidFile", ")", "{", "var", "timeout", "=", "setTimeout", "(", "function", "(", ")", "{", "var", "kill", ...
Set time limit on operating system process @param object @param function @return timeoutObject
[ "Set", "time", "limit", "on", "operating", "system", "process" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L367-L390
52,531
RaphaelDeLaGhetto/gebo-utils
index.js
_stopTimer
function _stopTimer(timer, options) { if (timer) { options.timeLimit = _getTimeLeft(timer); clearTimeout(timer); } }
javascript
function _stopTimer(timer, options) { if (timer) { options.timeLimit = _getTimeLeft(timer); clearTimeout(timer); } }
[ "function", "_stopTimer", "(", "timer", ",", "options", ")", "{", "if", "(", "timer", ")", "{", "options", ".", "timeLimit", "=", "_getTimeLeft", "(", "timer", ")", ";", "clearTimeout", "(", "timer", ")", ";", "}", "}" ]
Clear the timer and record the time remaining @param timeoutObject @param object
[ "Clear", "the", "timer", "and", "record", "the", "time", "remaining" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L399-L404
52,532
RaphaelDeLaGhetto/gebo-utils
index.js
_echoPidToFile
function _echoPidToFile(options) { var command = ''; if (options && options.pidFile) { command = ' & echo $! > ' + options.pidFile; } return command; }
javascript
function _echoPidToFile(options) { var command = ''; if (options && options.pidFile) { command = ' & echo $! > ' + options.pidFile; } return command; }
[ "function", "_echoPidToFile", "(", "options", ")", "{", "var", "command", "=", "''", ";", "if", "(", "options", "&&", "options", ".", "pidFile", ")", "{", "command", "=", "' & echo $! > '", "+", "options", ".", "pidFile", ";", "}", "return", "command", "...
Format the echo-to-PID-file command string @param object @return string
[ "Format", "the", "echo", "-", "to", "-", "PID", "-", "file", "command", "string" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L414-L420
52,533
RaphaelDeLaGhetto/gebo-utils
index.js
_getTimeLeft
function _getTimeLeft(timeout) { return Math.ceil(timeout._idleStart + timeout._idleTimeout - Date.now()); }
javascript
function _getTimeLeft(timeout) { return Math.ceil(timeout._idleStart + timeout._idleTimeout - Date.now()); }
[ "function", "_getTimeLeft", "(", "timeout", ")", "{", "return", "Math", ".", "ceil", "(", "timeout", ".", "_idleStart", "+", "timeout", ".", "_idleTimeout", "-", "Date", ".", "now", "(", ")", ")", ";", "}" ]
Get time left 2014-11-6 http://stackoverflow.com/questions/3144711/javascript-find-the-time-left-in-a-settimeout Courtesy of Fluffy @param timeoutObject @return integer
[ "Get", "time", "left" ]
338bc15f8a94621f145eb378f0b42123548ca545
https://github.com/RaphaelDeLaGhetto/gebo-utils/blob/338bc15f8a94621f145eb378f0b42123548ca545/index.js#L434-L436
52,534
emiljohansson/captn
captn.dom.show/index.js
hide
function hide(element) { if (!element || !element.style || typeof element.style.display !== 'string') { return; } element.style.display = ""; }
javascript
function hide(element) { if (!element || !element.style || typeof element.style.display !== 'string') { return; } element.style.display = ""; }
[ "function", "hide", "(", "element", ")", "{", "if", "(", "!", "element", "||", "!", "element", ".", "style", "||", "typeof", "element", ".", "style", ".", "display", "!==", "'string'", ")", "{", "return", ";", "}", "element", ".", "style", ".", "disp...
Hides an element. @static @param {DOMElement} element The DOM element to be modified. @example hide(el); el.style // => display: "";
[ "Hides", "an", "element", "." ]
dae7520116dc2148b4de06af7e1d7a47a3a3ac37
https://github.com/emiljohansson/captn/blob/dae7520116dc2148b4de06af7e1d7a47a3a3ac37/captn.dom.show/index.js#L15-L20
52,535
base/base-scaffold
index.js
function(name, config) { if (!config && typeof name === 'string' || utils.isObject(name)) { return this.getScaffold(name); } this.setScaffold.apply(this, arguments); if (typeof name === 'string') { return this.getScaffold(name); } return this; }
javascript
function(name, config) { if (!config && typeof name === 'string' || utils.isObject(name)) { return this.getScaffold(name); } this.setScaffold.apply(this, arguments); if (typeof name === 'string') { return this.getScaffold(name); } return this; }
[ "function", "(", "name", ",", "config", ")", "{", "if", "(", "!", "config", "&&", "typeof", "name", "===", "'string'", "||", "utils", ".", "isObject", "(", "name", ")", ")", "{", "return", "this", ".", "getScaffold", "(", "name", ")", ";", "}", "th...
Get scaffold `name` from `app.scaffolds`, or set scaffold `name` with the given `config`. ```js app.scaffold('foo', { docs: { options: {}, files: { src: ['*'], dest: 'foo' } } }); // or var scaffold = app.scaffold('foo'); ``` @name .scaffold @param {String|Object|Function} `name` @param {Object|Fucntion} `config` @re...
[ "Get", "scaffold", "name", "from", "app", ".", "scaffolds", "or", "set", "scaffold", "name", "with", "the", "given", "config", "." ]
d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1
https://github.com/base/base-scaffold/blob/d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1/index.js#L77-L87
52,536
base/base-scaffold
index.js
function(name, config) { if (typeof name !== 'string') { throw new TypeError('expected the first argument to be a string'); } if (utils.isObject(config)) { config.name = name; } this.emit('scaffold.set', name, config); this.scaffolds[name] = config; ...
javascript
function(name, config) { if (typeof name !== 'string') { throw new TypeError('expected the first argument to be a string'); } if (utils.isObject(config)) { config.name = name; } this.emit('scaffold.set', name, config); this.scaffolds[name] = config; ...
[ "function", "(", "name", ",", "config", ")", "{", "if", "(", "typeof", "name", "!==", "'string'", ")", "{", "throw", "new", "TypeError", "(", "'expected the first argument to be a string'", ")", ";", "}", "if", "(", "utils", ".", "isObject", "(", "config", ...
Add scaffold `name` to `app.scaffolds`. ```js app.addScaffold('foo', { docs: { options: {}, files: { src: ['*'], dest: 'foo' } } }); ``` @param {String} `name` @param {Object|Function} `config` @api public
[ "Add", "scaffold", "name", "to", "app", ".", "scaffolds", "." ]
d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1
https://github.com/base/base-scaffold/blob/d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1/index.js#L108-L118
52,537
base/base-scaffold
index.js
function(name, options) { var opts = utils.merge({}, this.options, options); var config; switch (utils.typeOf(name)) { case 'function': config = name; break; case 'object': config = name; name = config.name; break; ...
javascript
function(name, options) { var opts = utils.merge({}, this.options, options); var config; switch (utils.typeOf(name)) { case 'function': config = name; break; case 'object': config = name; name = config.name; break; ...
[ "function", "(", "name", ",", "options", ")", "{", "var", "opts", "=", "utils", ".", "merge", "(", "{", "}", ",", "this", ".", "options", ",", "options", ")", ";", "var", "config", ";", "switch", "(", "utils", ".", "typeOf", "(", "name", ")", ")"...
Get scaffold `name` from `app.scaffolds`, or return a normalized instance of `Scaffold` if an object or function is passed. ```js var scaffold = app.getScaffold('foo'); // or create an instance of `Scaffold` using the given object var scaffold = app.getScaffold({ docs: { options: {}, files: { src: ['*'], dest: 'foo' ...
[ "Get", "scaffold", "name", "from", "app", ".", "scaffolds", "or", "return", "a", "normalized", "instance", "of", "Scaffold", "if", "an", "object", "or", "function", "is", "passed", "." ]
d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1
https://github.com/base/base-scaffold/blob/d03b0f4a7ba7a1b44be8b1708a2bce613be1c4e1/index.js#L143-L209
52,538
nashdot/Preprocessor.js
Preprocessor.js
Preprocessor
function Preprocessor(source, baseDirOrIncludes, preserveLineNumbers) { /** * Source code to pre-process. * @type {string} * @expose */ this.source = '' + source; /** * Source base directory. * @type {string} * @expose */ this.baseDir = typeof baseDirOrIncludes =...
javascript
function Preprocessor(source, baseDirOrIncludes, preserveLineNumbers) { /** * Source code to pre-process. * @type {string} * @expose */ this.source = '' + source; /** * Source base directory. * @type {string} * @expose */ this.baseDir = typeof baseDirOrIncludes =...
[ "function", "Preprocessor", "(", "source", ",", "baseDirOrIncludes", ",", "preserveLineNumbers", ")", "{", "/**\n * Source code to pre-process.\n * @type {string}\n * @expose\n */", "this", ".", "source", "=", "''", "+", "source", ";", "/**\n * Source base d...
Constructs a new Preprocessor. @exports Preprocessor @class Provides pre-processing of JavaScript source files, e.g. to build different versions of a library. @param {string} source Source to process @param {string|Object.<string,string>=} baseDirOrIncludes Source base directory used for includes (node.js only) or an o...
[ "Constructs", "a", "new", "Preprocessor", "." ]
3c4c285e335acf096eb3df4beaaa2def6fe135e0
https://github.com/nashdot/Preprocessor.js/blob/3c4c285e335acf096eb3df4beaaa2def6fe135e0/Preprocessor.js#L46-L92
52,539
bbusschots-mu/validateParams.js
validateParams.js
function(mCons, vCons, k){ var nCons = {}; // the final nested constraints // if there are per-key constraints for k, add them all if(validate.isObject(mCons[k])){ nCons = validateParams.extendObject({}, mCons[k]); } /...
javascript
function(mCons, vCons, k){ var nCons = {}; // the final nested constraints // if there are per-key constraints for k, add them all if(validate.isObject(mCons[k])){ nCons = validateParams.extendObject({}, mCons[k]); } /...
[ "function", "(", "mCons", ",", "vCons", ",", "k", ")", "{", "var", "nCons", "=", "{", "}", ";", "// the final nested constraints", "// if there are per-key constraints for k, add them all", "if", "(", "validate", ".", "isObject", "(", "mCons", "[", "k", "]", ")"...
a private inner function for merging per-key and universal constraints
[ "a", "private", "inner", "function", "for", "merging", "per", "-", "key", "and", "universal", "constraints" ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L613-L633
52,540
bbusschots-mu/validateParams.js
validateParams.js
function(cName){ if(validate.isEmpty(cName)){ validateParams._warn('ignoring invalid coercion name: ' + cName); } if(validate.isFunction(validateParams.coercions[cName])){ return validateParams.coercions[cName]; }else{ validateParams._warn("no coercion...
javascript
function(cName){ if(validate.isEmpty(cName)){ validateParams._warn('ignoring invalid coercion name: ' + cName); } if(validate.isFunction(validateParams.coercions[cName])){ return validateParams.coercions[cName]; }else{ validateParams._warn("no coercion...
[ "function", "(", "cName", ")", "{", "if", "(", "validate", ".", "isEmpty", "(", "cName", ")", ")", "{", "validateParams", ".", "_warn", "(", "'ignoring invalid coercion name: '", "+", "cName", ")", ";", "}", "if", "(", "validate", ".", "isFunction", "(", ...
make sure there's always an options object local function for resolving coersion names to functions
[ "make", "sure", "there", "s", "always", "an", "options", "object", "local", "function", "for", "resolving", "coersion", "names", "to", "functions" ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L854-L864
52,541
bbusschots-mu/validateParams.js
validateParams.js
function(value, options){ // make sure the default options object exists if(typeof this.options !== 'object') this.options = {}; // build up a base config from the pre-defined defaults var config = { rejectUndefined: true }; config.message = validateParams.extractValidat...
javascript
function(value, options){ // make sure the default options object exists if(typeof this.options !== 'object') this.options = {}; // build up a base config from the pre-defined defaults var config = { rejectUndefined: true }; config.message = validateParams.extractValidat...
[ "function", "(", "value", ",", "options", ")", "{", "// make sure the default options object exists", "if", "(", "typeof", "this", ".", "options", "!==", "'object'", ")", "this", ".", "options", "=", "{", "}", ";", "// build up a base config from the pre-defined defau...
A validator for rejecting undefined values. Effectively a stricter version of the `presence` validator bundled with validate.js. This validator supports the following options in addition to the standard `message` option: * `rejectUndefined` - a truthy value will reject undefined values, all all other values will accpe...
[ "A", "validator", "for", "rejecting", "undefined", "values", ".", "Effectively", "a", "stricter", "version", "of", "the", "presence", "validator", "bundled", "with", "validate", ".", "js", "." ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L2014-L2044
52,542
bbusschots-mu/validateParams.js
validateParams.js
function(value, options){ // implicitly pass undefined var valType = typeof value; if(valType === 'undefined') return undefined; // make sure the default options object exists if(typeof this.options !== 'object') this.options = {}; // build up a base con...
javascript
function(value, options){ // implicitly pass undefined var valType = typeof value; if(valType === 'undefined') return undefined; // make sure the default options object exists if(typeof this.options !== 'object') this.options = {}; // build up a base con...
[ "function", "(", "value", ",", "options", ")", "{", "// implicitly pass undefined", "var", "valType", "=", "typeof", "value", ";", "if", "(", "valType", "===", "'undefined'", ")", "return", "undefined", ";", "// make sure the default options object exists", "if", "(...
A validator for filtering values by the result of applying the `typeof` operator to them. This validator supports the following options in addition to the standard `message` option: * `types` - an array of one or more types as strings * `inverseMatch` - a truthy value to invert the search, accepting all types except t...
[ "A", "validator", "for", "filtering", "values", "by", "the", "result", "of", "applying", "the", "typeof", "operator", "to", "them", "." ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L2084-L2153
52,543
bbusschots-mu/validateParams.js
validateParams.js
function(value, options){ if(!validate.isObject(options)) options = {}; // deal with undefined if(options.ignoreUndefined && typeof value === 'undefined'){ return undefined; } // cast to boolean as appropriate if(options.nativeTruthinessOnly)...
javascript
function(value, options){ if(!validate.isObject(options)) options = {}; // deal with undefined if(options.ignoreUndefined && typeof value === 'undefined'){ return undefined; } // cast to boolean as appropriate if(options.nativeTruthinessOnly)...
[ "function", "(", "value", ",", "options", ")", "{", "if", "(", "!", "validate", ".", "isObject", "(", "options", ")", ")", "options", "=", "{", "}", ";", "// deal with undefined", "if", "(", "options", ".", "ignoreUndefined", "&&", "typeof", "value", "==...
A coercion for converting any arbitrary value to a boolean. By default, and value that is either natively falsey, like `0`, or that's considered empty by the [validate.isEmpty()]{@link external:isEmpty} function from validate.js will be coerced to `false`. Setting the coersion option `nativeTruthinessOnly` to a truthy...
[ "A", "coercion", "for", "converting", "any", "arbitrary", "value", "to", "a", "boolean", "." ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L2604-L2617
52,544
bbusschots-mu/validateParams.js
validateParams.js
function(value, options){ if(validate.isObject(options) && options.onlyCoercePrimitives && !validateParams.isPrimitive(value)){ return value; } if(validate.isEmpty(value)) return ''; return String(value); }
javascript
function(value, options){ if(validate.isObject(options) && options.onlyCoercePrimitives && !validateParams.isPrimitive(value)){ return value; } if(validate.isEmpty(value)) return ''; return String(value); }
[ "function", "(", "value", ",", "options", ")", "{", "if", "(", "validate", ".", "isObject", "(", "options", ")", "&&", "options", ".", "onlyCoercePrimitives", "&&", "!", "validateParams", ".", "isPrimitive", "(", "value", ")", ")", "{", "return", "value", ...
A coercion for converting any arbitrary value to a string. Empty values, as per the [validate.isEmpty()]{@link external:isEmpty} function from validate.js will be coerced to an empty string, other values will be cast to a string using JavaScript's `String()` function. It's possible to ristrict the coercion to primiti...
[ "A", "coercion", "for", "converting", "any", "arbitrary", "value", "to", "a", "string", "." ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L2634-L2640
52,545
bbusschots-mu/validateParams.js
validateParams.js
function(value, options){ var typeVal = typeof value; // if we already have a number that's not NaN, return it unaltered if(typeVal === 'number' && !isNaN(value)) return value; // otherwise, try do a conversion var numVal = NaN; if(typeVal === 'string' |...
javascript
function(value, options){ var typeVal = typeof value; // if we already have a number that's not NaN, return it unaltered if(typeVal === 'number' && !isNaN(value)) return value; // otherwise, try do a conversion var numVal = NaN; if(typeVal === 'string' |...
[ "function", "(", "value", ",", "options", ")", "{", "var", "typeVal", "=", "typeof", "value", ";", "// if we already have a number that's not NaN, return it unaltered", "if", "(", "typeVal", "===", "'number'", "&&", "!", "isNaN", "(", "value", ")", ")", "return", ...
A coercion for converting any arbitrary value to a number. If a given value already is a number it is passed un-altered. Otherwise, if it has a `typeof` of `string` or `boolean` an attempt will be made to convert the value to a number with JavaScript's `Number()` function. Other values are converted to `NaN`. If the ...
[ "A", "coercion", "for", "converting", "any", "arbitrary", "value", "to", "a", "number", "." ]
6952ebeaff09892933c4095396dff00595029ab5
https://github.com/bbusschots-mu/validateParams.js/blob/6952ebeaff09892933c4095396dff00595029ab5/validateParams.js#L2657-L2674
52,546
yefremov/aggregatejs
min.js
min
function min(array) { var length = array.length; if (length === 0) { return 0; } var index = -1; var result = array[++index]; while (++index < length) { if (array[index] < result) { result = array[index]; } } return result; }
javascript
function min(array) { var length = array.length; if (length === 0) { return 0; } var index = -1; var result = array[++index]; while (++index < length) { if (array[index] < result) { result = array[index]; } } return result; }
[ "function", "min", "(", "array", ")", "{", "var", "length", "=", "array", ".", "length", ";", "if", "(", "length", "===", "0", ")", "{", "return", "0", ";", "}", "var", "index", "=", "-", "1", ";", "var", "result", "=", "array", "[", "++", "ind...
Returns the smallest number in `array`. @param {Array} array Range of numbers to get minimum. @return {number} @example min([100, -100, 150, -50, 250, 100]); // => -100
[ "Returns", "the", "smallest", "number", "in", "array", "." ]
932b28a15a5707135e7095950000a838db409511
https://github.com/yefremov/aggregatejs/blob/932b28a15a5707135e7095950000a838db409511/min.js#L19-L36
52,547
wwwouter/tslint-contrib
noPromiseAsBooleanRule.js
isBooleanBinaryExpression
function isBooleanBinaryExpression(node) { return node.kind === ts.SyntaxKind.BinaryExpression && binaryBooleanExpressionKind(node) !== undefined; }
javascript
function isBooleanBinaryExpression(node) { return node.kind === ts.SyntaxKind.BinaryExpression && binaryBooleanExpressionKind(node) !== undefined; }
[ "function", "isBooleanBinaryExpression", "(", "node", ")", "{", "return", "node", ".", "kind", "===", "ts", ".", "SyntaxKind", ".", "BinaryExpression", "&&", "binaryBooleanExpressionKind", "(", "node", ")", "!==", "undefined", ";", "}" ]
Matches `&&` and `||` operators.
[ "Matches", "&&", "and", "||", "operators", "." ]
fdf83c7e65fcd5dbc5dbe39bb5d081561a339be9
https://github.com/wwwouter/tslint-contrib/blob/fdf83c7e65fcd5dbc5dbe39bb5d081561a339be9/noPromiseAsBooleanRule.js#L85-L87
52,548
elidoran/node-stating
examples/strings/counter/index.js
prop
function prop(v, w) { return { value: v, writable: w, enumerable: true, configurable: false }}
javascript
function prop(v, w) { return { value: v, writable: w, enumerable: true, configurable: false }}
[ "function", "prop", "(", "v", ",", "w", ")", "{", "return", "{", "value", ":", "v", ",", "writable", ":", "w", ",", "enumerable", ":", "true", ",", "configurable", ":", "false", "}", "}" ]
build an "executor" which will accept strings and use the specified context. the context has a custom `reset` function, and default values for the properties used.
[ "build", "an", "executor", "which", "will", "accept", "strings", "and", "use", "the", "specified", "context", ".", "the", "context", "has", "a", "custom", "reset", "function", "and", "default", "values", "for", "the", "properties", "used", "." ]
557facf637dafb3747183b8f3e165a4e27e045db
https://github.com/elidoran/node-stating/blob/557facf637dafb3747183b8f3e165a4e27e045db/examples/strings/counter/index.js#L75-L77
52,549
redisjs/jsr-server
lib/command/script/eval.js
execute
function execute(req, res) { ScriptManager.eval(req, res, '' + req.args[0], req.args.slice(1)); }
javascript
function execute(req, res) { ScriptManager.eval(req, res, '' + req.args[0], req.args.slice(1)); }
[ "function", "execute", "(", "req", ",", "res", ")", "{", "ScriptManager", ".", "eval", "(", "req", ",", "res", ",", "''", "+", "req", ".", "args", "[", "0", "]", ",", "req", ".", "args", ".", "slice", "(", "1", ")", ")", ";", "}" ]
Respond to the EVAL command.
[ "Respond", "to", "the", "EVAL", "command", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/script/eval.js#L20-L22
52,550
vkiding/judpack-lib
src/cordova/metadata/parser.js
Parser
function Parser (platform, projectPath) { this.platform = platform || ''; this.path = projectPath || ''; // Extend with a ParserHelper instance Object.defineProperty(this, 'helper', { value: new ParserHelper(this.platform), enumerable: true, configurable: false, writabl...
javascript
function Parser (platform, projectPath) { this.platform = platform || ''; this.path = projectPath || ''; // Extend with a ParserHelper instance Object.defineProperty(this, 'helper', { value: new ParserHelper(this.platform), enumerable: true, configurable: false, writabl...
[ "function", "Parser", "(", "platform", ",", "projectPath", ")", "{", "this", ".", "platform", "=", "platform", "||", "''", ";", "this", ".", "path", "=", "projectPath", "||", "''", ";", "// Extend with a ParserHelper instance", "Object", ".", "defineProperty", ...
Base module for platform parsers @param {String} [platform] Platform name (e.g. android) @param {String} [projectPath] path/to/platform/project
[ "Base", "module", "for", "platform", "parsers" ]
8657cecfec68221109279106adca8dbc81f430f4
https://github.com/vkiding/judpack-lib/blob/8657cecfec68221109279106adca8dbc81f430f4/src/cordova/metadata/parser.js#L32-L45
52,551
copress/copress-component-oauth2
lib/resource-server.js
authenticate
function authenticate(options) { options = options || {}; var authenticators = [ passport.authenticate(['copress-oauth2-bearer', 'copress-oauth2-mac'], options)]; if (options.scopes || options.scope) { authenticators.push(scopeValidator(options)); ...
javascript
function authenticate(options) { options = options || {}; var authenticators = [ passport.authenticate(['copress-oauth2-bearer', 'copress-oauth2-mac'], options)]; if (options.scopes || options.scope) { authenticators.push(scopeValidator(options)); ...
[ "function", "authenticate", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "authenticators", "=", "[", "passport", ".", "authenticate", "(", "[", "'copress-oauth2-bearer'", ",", "'copress-oauth2-mac'", "]", ",", "options", ")"...
Return the middleware chain to enforce oAuth 2.0 authentication and authorization @param {Object} [options] Options object - scope - jwt
[ "Return", "the", "middleware", "chain", "to", "enforce", "oAuth", "2", ".", "0", "authentication", "and", "authorization" ]
4819f379a0d42753bfd51e237c5c3aaddee37544
https://github.com/copress/copress-component-oauth2/blob/4819f379a0d42753bfd51e237c5c3aaddee37544/lib/resource-server.js#L159-L170
52,552
joshuamurray/storage.json
lib/Path.js
function( string ){ if( string[ string.length -1 ] !== $this.slash.get()) string = string + $this.slash.get(); return string; }
javascript
function( string ){ if( string[ string.length -1 ] !== $this.slash.get()) string = string + $this.slash.get(); return string; }
[ "function", "(", "string", ")", "{", "if", "(", "string", "[", "string", ".", "length", "-", "1", "]", "!==", "$this", ".", "slash", ".", "get", "(", ")", ")", "string", "=", "string", "+", "$this", ".", "slash", ".", "get", "(", ")", ";", "ret...
Adds the value of "slash.string" to the end of the provided string, unless the last character is already the value of "slash.string". @param {string} string @returns {string}
[ "Adds", "the", "value", "of", "slash", ".", "string", "to", "the", "end", "of", "the", "provided", "string", "unless", "the", "last", "character", "is", "already", "the", "value", "of", "slash", ".", "string", "." ]
9ed7ecbb6882e14be31635facba2b80f89456531
https://github.com/joshuamurray/storage.json/blob/9ed7ecbb6882e14be31635facba2b80f89456531/lib/Path.js#L72-L76
52,553
joshuamurray/storage.json
lib/Path.js
function( string ){ string = $this.slash.clean( string ); if( string[ 0 ] === $this.slash.get()) string = string.substr( 1 ); if( string[ string.length -1 ] === $this.slash.get()) string = string.substr( 0, string.length -1 ); return string; }
javascript
function( string ){ string = $this.slash.clean( string ); if( string[ 0 ] === $this.slash.get()) string = string.substr( 1 ); if( string[ string.length -1 ] === $this.slash.get()) string = string.substr( 0, string.length -1 ); return string; }
[ "function", "(", "string", ")", "{", "string", "=", "$this", ".", "slash", ".", "clean", "(", "string", ")", ";", "if", "(", "string", "[", "0", "]", "===", "$this", ".", "slash", ".", "get", "(", ")", ")", "string", "=", "string", ".", "substr",...
Removes the value of "slash.string" from the start AND end of the provided string, unless the first AND last characters do not match the value of "slash.string". @param {string} string @returns {string}
[ "Removes", "the", "value", "of", "slash", ".", "string", "from", "the", "start", "AND", "end", "of", "the", "provided", "string", "unless", "the", "first", "AND", "last", "characters", "do", "not", "match", "the", "value", "of", "slash", ".", "string", "...
9ed7ecbb6882e14be31635facba2b80f89456531
https://github.com/joshuamurray/storage.json/blob/9ed7ecbb6882e14be31635facba2b80f89456531/lib/Path.js#L94-L101
52,554
taoyuan/path-rewriter
lib/rewriter.js
to_map
function to_map(params) { var map = {}; params.forEach(function (param, i) { param.index = i; map[param.name] = param; }); map.length = params.length; return map; }
javascript
function to_map(params) { var map = {}; params.forEach(function (param, i) { param.index = i; map[param.name] = param; }); map.length = params.length; return map; }
[ "function", "to_map", "(", "params", ")", "{", "var", "map", "=", "{", "}", ";", "params", ".", "forEach", "(", "function", "(", "param", ",", "i", ")", "{", "param", ".", "index", "=", "i", ";", "map", "[", "param", ".", "name", "]", "=", "par...
Turn params array into a map for quick lookup. @param {Array} params @return {Object} @api private
[ "Turn", "params", "array", "into", "a", "map", "for", "quick", "lookup", "." ]
8dc82918e09af399006f8d6b0158399414470032
https://github.com/taoyuan/path-rewriter/blob/8dc82918e09af399006f8d6b0158399414470032/lib/rewriter.js#L140-L151
52,555
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this._existsCb.bind(this, selector, hash)); return this; }
javascript
function (selector, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this._existsCb.bind(this, selector, hash)); return this; }
[ "function", "(", "selector", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ".", "actionQueue"...
Checks if an element exists @method exists @param {string} selector Selector expression to find the element @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "exists" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L49-L53
52,556
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.displayed.bind(this.webdriverClient, selector)); this.actionQueue.push(this._visibleCb.bind(this, selector, hash)); return this; }
javascript
function (selector, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.displayed.bind(this.webdriverClient, selector)); this.actionQueue.push(this._visibleCb.bind(this, selector, hash)); return this; }
[ "function", "(", "selector", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ".", "actionQueue"...
Checks if an element is visible @method visible @param {string} selector Selector expression to find the element @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "is", "visible" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L82-L87
52,557
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.text.bind(this.webdriverClient, selector)); this.actionQueue.push(this._textCb.bind(this, selector, hash, expected)); return this; ...
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.text.bind(this.webdriverClient, selector)); this.actionQueue.push(this._textCb.bind(this, selector, hash, expected)); return this; ...
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Checks if an element has the expected text @method text @param {string} selector Selector expression to find the element @param {string} expected The expected text content @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "has", "the", "expected", "text" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L117-L122
52,558
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.size.bind(this.webdriverClient)); this.actionQueue.push(this._widthCb.bind(this, selector, hash, expected)); return this; }
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.size.bind(this.webdriverClient)); this.actionQueue.push(this._widthCb.bind(this, selector, hash, expected)); return this; }
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Checks th width of an element @method width @param {string} selector Selector expression to find the element @param {string} expected The expected width value @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "th", "width", "of", "an", "element" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L191-L196
52,559
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, attribute, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.getAttribute.bind(this.webdriverClient, attribute)); this.actionQueue.push(this._attributeCb.bind(this, selector, hash, attrib...
javascript
function (selector, attribute, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.getAttribute.bind(this.webdriverClient, attribute)); this.actionQueue.push(this._attributeCb.bind(this, selector, hash, attrib...
[ "function", "(", "selector", ",", "attribute", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", "...
Checks if an element has an attribute with the expected value @method attribute @param {string} selector Selector expression to find the element @param {string} attribute The attribute that should be checked @param {string} expected The expected text content @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "has", "an", "attribute", "with", "the", "expected", "value" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L264-L269
52,560
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.getAttribute.bind(this.webdriverClient, 'value')); this.actionQueue.push(this._valCb.bind(this, selector, hash, expected)); return th...
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.getAttribute.bind(this.webdriverClient, 'value')); this.actionQueue.push(this._valCb.bind(this, selector, hash, expected)); return th...
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Checks if an element has the expected value @method val @param {string} selector Selector expression to find the element @param {string} expected The expected content @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "has", "the", "expected", "value" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L301-L306
52,561
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.selected.bind(this.webdriverClient)); this.actionQueue.push(this._selectedCb.bind(this, selector, hash, expected)); return this; }
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.selected.bind(this.webdriverClient)); this.actionQueue.push(this._selectedCb.bind(this, selector, hash, expected)); return this; }
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Checks if an element is selected @method selected @param {string} selector Selector expression to find the element @param {string} expected The expected content @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "is", "selected" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L337-L342
52,562
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.enabled.bind(this.webdriverClient)); this.actionQueue.push(this._enabledCb.bind(this, selector, hash, expected)); return this; }
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.enabled.bind(this.webdriverClient)); this.actionQueue.push(this._enabledCb.bind(this, selector, hash, expected)); return this; }
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Checks if an element is enabled @method enabled @param {string} selector Selector expression to find the element @param {string} expected The expected content @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "if", "an", "element", "is", "enabled" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L373-L378
52,563
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, hash, uuid) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.submit.bind(this.webdriverClient)); this.actionQueue.push(this._submitCb.bind(this, selector, hash, uuid)); return this; }
javascript
function (selector, hash, uuid) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector)); this.actionQueue.push(this.webdriverClient.submit.bind(this.webdriverClient)); this.actionQueue.push(this._submitCb.bind(this, selector, hash, uuid)); return this; }
[ "function", "(", "selector", ",", "hash", ",", "uuid", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", "."...
Submits a form @method submit @param {string} selector Selector expression to find the element @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @chainable
[ "Submits", "a", "form" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L409-L414
52,564
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, hash, uuid) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'submit', value: selector, uuid: uuid, hash: hash}); deferred.resolve(); return deferred.promise; }
javascript
function (selector, hash, uuid) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'submit', value: selector, uuid: uuid, hash: hash}); deferred.resolve(); return deferred.promise; }
[ "function", "(", "selector", ",", "hash", ",", "uuid", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "this", ".", "events", ".", "emit", "(", "'driver:message'", ",", "{", "key", ":", "'submit'", ",", "value", ":", "selector", ...
Sends out an event with the results of the `submit` call @method _submitCb @param {string} selector Selector expression to find the element @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @return {object} promise Click promise @private
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "submit", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L427-L432
52,565
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, options, hash, uuid) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector, options)); this.actionQueue.push(this.webdriverClient.scroll.bind(this.webdriverClient)); this.actionQueue.push(this._clickCb.bind(this, selector, options, hash, uuid)); ret...
javascript
function (selector, options, hash, uuid) { this.actionQueue.push(this.webdriverClient.element.bind(this.webdriverClient, selector, options)); this.actionQueue.push(this.webdriverClient.scroll.bind(this.webdriverClient)); this.actionQueue.push(this._clickCb.bind(this, selector, options, hash, uuid)); ret...
[ "function", "(", "selector", ",", "options", ",", "hash", ",", "uuid", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "element", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ",", "option...
Scrolls from an element to a location defined in pixels @method scroll @param {string} selector Selector expression to find the element @param {object} options X offset, Y offset, Speed @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @chainable
[ "Scrolls", "from", "an", "element", "to", "a", "location", "defined", "in", "pixels" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L480-L485
52,566
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, timeout, hash, uuid) { this.actionQueue.push(this.webdriverClient.implicitWait.bind(this.webdriverClient, timeout)); this.actionQueue.push(this._waitForElementCb.bind(this, selector, hash, uuid)); return this; }
javascript
function (selector, timeout, hash, uuid) { this.actionQueue.push(this.webdriverClient.implicitWait.bind(this.webdriverClient, timeout)); this.actionQueue.push(this._waitForElementCb.bind(this, selector, hash, uuid)); return this; }
[ "function", "(", "selector", ",", "timeout", ",", "hash", ",", "uuid", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "implicitWait", ".", "bind", "(", "this", ".", "webdriverClient", ",", "timeout", ")", ")"...
Wait for an element for a specific amount of time @method waitForElement @param {string} selector Selector expression to find the element @param {integer} timeout Time to wait in ms @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @chainable
[ "Wait", "for", "an", "element", "for", "a", "specific", "amount", "of", "time" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L584-L588
52,567
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.elements.bind(this.webdriverClient, selector)); this.actionQueue.push(this._getNumberOfElementsCb.bind(this, selector, hash, expected)); return this; }
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.elements.bind(this.webdriverClient, selector)); this.actionQueue.push(this._getNumberOfElementsCb.bind(this, selector, hash, expected)); return this; }
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "elements", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Returns the number of elements matched by the selector @method getNumberOfElements @param {string} selector Selector expression to find the elements @param {integer} expected Expected number of matched elements @param {string} uuid Unique hash of that fn call @chainable
[ "Returns", "the", "number", "of", "elements", "matched", "by", "the", "selector" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L618-L622
52,568
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.elements.bind(this.webdriverClient, selector)); this.actionQueue.push(function (result) { var deferred = Q.defer(); var res = JSON.parse(result); var resLength = res.value.length; var curLength = 0; va...
javascript
function (selector, expected, hash) { this.actionQueue.push(this.webdriverClient.elements.bind(this.webdriverClient, selector)); this.actionQueue.push(function (result) { var deferred = Q.defer(); var res = JSON.parse(result); var resLength = res.value.length; var curLength = 0; va...
[ "function", "(", "selector", ",", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "elements", ".", "bind", "(", "this", ".", "webdriverClient", ",", "selector", ")", ")", ";", "this", ...
Returns the number of visible elements matched by the selector @method getNumberOfVisibleElements @param {string} selector Selector expression to find the elements @param {integer} expected Expected number of matched elements @param {string} uuid Unique hash of that fn call @chainable
[ "Returns", "the", "number", "of", "visible", "elements", "matched", "by", "the", "selector" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L661-L688
52,569
dalekjs/dalek-driver-sauce
lib/commands/element.js
function (selector, hash, expected, res) { var deferred = Q.defer(); var result = JSON.parse(res); // check if the expression matched any element if (result.value === -1) { this.events.emit('driver:message', {key: 'numberOfVisibleElements', hash: hash, selector: selector, expected: expected, valu...
javascript
function (selector, hash, expected, res) { var deferred = Q.defer(); var result = JSON.parse(res); // check if the expression matched any element if (result.value === -1) { this.events.emit('driver:message', {key: 'numberOfVisibleElements', hash: hash, selector: selector, expected: expected, valu...
[ "function", "(", "selector", ",", "hash", ",", "expected", ",", "res", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "var", "result", "=", "JSON", ".", "parse", "(", "res", ")", ";", "// check if the expression matched any element", ...
Sends out an event with the results of the `getNumberOfVisibleElements` call @method _getNumberOfElementsCb @param {string} selector Selector expression to find the element @param {string} hash Unique hash of that fn call @param {integer} expected Expected number of matched elements @param {string} res Serialized JSON...
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "getNumberOfVisibleElements", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/element.js#L702-L715
52,570
mobilehero-archive/aplus-underscore
aplus-underscore.js
replace_content
function replace_content(fullpath) { var source = fs.readFileSync(fullpath, 'utf8'); var regex = /(require\s*\(\s*['"]alloy\/underscore['"]\s*\))._/g var test = regex.test(source); if(test) { logger.trace("Fixing file: " + fullpath); source = source.replace(regex, "$1"); fs.writeFileSync(fullpath, source); }...
javascript
function replace_content(fullpath) { var source = fs.readFileSync(fullpath, 'utf8'); var regex = /(require\s*\(\s*['"]alloy\/underscore['"]\s*\))._/g var test = regex.test(source); if(test) { logger.trace("Fixing file: " + fullpath); source = source.replace(regex, "$1"); fs.writeFileSync(fullpath, source); }...
[ "function", "replace_content", "(", "fullpath", ")", "{", "var", "source", "=", "fs", ".", "readFileSync", "(", "fullpath", ",", "'utf8'", ")", ";", "var", "regex", "=", "/", "(require\\s*\\(\\s*['\"]alloy\\/underscore['\"]\\s*\\))._", "/", "g", "var", "test", "...
Remove invalid underscore calls from a file @param {string} fullpath
[ "Remove", "invalid", "underscore", "calls", "from", "a", "file" ]
bb518fec188b04053131225b28d8fe36becd1d41
https://github.com/mobilehero-archive/aplus-underscore/blob/bb518fec188b04053131225b28d8fe36becd1d41/aplus-underscore.js#L39-L48
52,571
mobilehero-archive/aplus-underscore
aplus-underscore.js
plugin
function plugin(params) { logger = params.logger; params.dirname = params.dirname ? _.template(params.dirname)(params) : params.event.dir.resourcesPlatform; logger.trace("fixing underscore in directory: " + params.dirname); replace_content(path.join(params.dirname, "alloy.js")) replace_content(path.join(params.di...
javascript
function plugin(params) { logger = params.logger; params.dirname = params.dirname ? _.template(params.dirname)(params) : params.event.dir.resourcesPlatform; logger.trace("fixing underscore in directory: " + params.dirname); replace_content(path.join(params.dirname, "alloy.js")) replace_content(path.join(params.di...
[ "function", "plugin", "(", "params", ")", "{", "logger", "=", "params", ".", "logger", ";", "params", ".", "dirname", "=", "params", ".", "dirname", "?", "_", ".", "template", "(", "params", ".", "dirname", ")", "(", "params", ")", ":", "params", "."...
Fix certain usages of underscore.js in Alloy source code @param {object} params
[ "Fix", "certain", "usages", "of", "underscore", ".", "js", "in", "Alloy", "source", "code" ]
bb518fec188b04053131225b28d8fe36becd1d41
https://github.com/mobilehero-archive/aplus-underscore/blob/bb518fec188b04053131225b28d8fe36becd1d41/aplus-underscore.js#L55-L63
52,572
Crafity/crafity-core
lib/modules/crafity.query.js
Enumerator
function Enumerator(getCurrent, moveNext, reset) { var index = 0, self = this; /** * Get the current index of the enumerator */ this.getIndex = function getIndexEnumeratorInternal() { return index; }; /** * Function that retrieves the current value * @function * @returns {Object} The c...
javascript
function Enumerator(getCurrent, moveNext, reset) { var index = 0, self = this; /** * Get the current index of the enumerator */ this.getIndex = function getIndexEnumeratorInternal() { return index; }; /** * Function that retrieves the current value * @function * @returns {Object} The c...
[ "function", "Enumerator", "(", "getCurrent", ",", "moveNext", ",", "reset", ")", "{", "var", "index", "=", "0", ",", "self", "=", "this", ";", "/**\n * Get the current index of the enumerator\n */", "this", ".", "getIndex", "=", "function", "getIndexEnumeratorIn...
The Enumerator base class @class Enumerator @param {Function} getCurrent Function that retrieves the current value @param {Function} moveNext Function that moves to the next item and returns true if there was a next item, otherwise false @param {Function} reset Function that resets the enumerator to the beginning of th...
[ "The", "Enumerator", "base", "class" ]
c0f2271fa6f9c1164450928b2b480f397c9ec20b
https://github.com/Crafity/crafity-core/blob/c0f2271fa6f9c1164450928b2b480f397c9ec20b/lib/modules/crafity.query.js#L84-L127
52,573
svbatalov/ractive-component-iscroll
index.js
function (t) { var self = this; this.node = t.node; var userOpts = this.get('opts'); this.opts = extend(defaultOpts, userOpts); setTimeout(function () { self.s = new IScroll(t.node, self.opts); t.complete(); }, 0); }
javascript
function (t) { var self = this; this.node = t.node; var userOpts = this.get('opts'); this.opts = extend(defaultOpts, userOpts); setTimeout(function () { self.s = new IScroll(t.node, self.opts); t.complete(); }, 0); }
[ "function", "(", "t", ")", "{", "var", "self", "=", "this", ";", "this", ".", "node", "=", "t", ".", "node", ";", "var", "userOpts", "=", "this", ".", "get", "(", "'opts'", ")", ";", "this", ".", "opts", "=", "extend", "(", "defaultOpts", ",", ...
Use intro transition to determine when wrapped template has finished animations and to get actual DOM node.
[ "Use", "intro", "transition", "to", "determine", "when", "wrapped", "template", "has", "finished", "animations", "and", "to", "get", "actual", "DOM", "node", "." ]
ab378a53b2b047b1d9fa494ac76f3bdcc716a2d0
https://github.com/svbatalov/ractive-component-iscroll/blob/ab378a53b2b047b1d9fa494ac76f3bdcc716a2d0/index.js#L55-L65
52,574
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (message, hash) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'noop', uuid: hash, hash: hash, value: message}); deferred.resolve(); return deferred.promise; }
javascript
function (message, hash) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'noop', uuid: hash, hash: hash, value: message}); deferred.resolve(); return deferred.promise; }
[ "function", "(", "message", ",", "hash", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "this", ".", "events", ".", "emit", "(", "'driver:message'", ",", "{", "key", ":", "'noop'", ",", "uuid", ":", "hash", ",", "hash", ":", ...
Sends out an event with the results of the `noop` call @method _noopCb @param {mixed} message Whatever yu like @param {string} hash Unique hash of that fn call @return {object} Promise @private
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "noop", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L64-L69
52,575
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (hash) { this.actionQueue.push(this.webdriverClient.source.bind(this.webdriverClient)); this.actionQueue.push(this._sourceCb.bind(this, hash)); return this; }
javascript
function (hash) { this.actionQueue.push(this.webdriverClient.source.bind(this.webdriverClient)); this.actionQueue.push(this._sourceCb.bind(this, hash)); return this; }
[ "function", "(", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "source", ".", "bind", "(", "this", ".", "webdriverClient", ")", ")", ";", "this", ".", "actionQueue", ".", "push", "(", "this", ".", ...
Gets the HTML source of a page @method source @param {string} hash Unique hash of that fn call @chainable
[ "Gets", "the", "HTML", "source", "of", "a", "page" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L79-L83
52,576
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (hash, source) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'source', uuid: hash, hash: hash, value: JSON.parse(source).value}); deferred.resolve(); return deferred.promise; }
javascript
function (hash, source) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'source', uuid: hash, hash: hash, value: JSON.parse(source).value}); deferred.resolve(); return deferred.promise; }
[ "function", "(", "hash", ",", "source", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "this", ".", "events", ".", "emit", "(", "'driver:message'", ",", "{", "key", ":", "'source'", ",", "uuid", ":", "hash", ",", "hash", ":", ...
Sends out an event with the results of the `source` call @method _sourceCb @param {string} hash Unique hash of that fn call @param {string} source Serialized JSON with the results of the source call @return {object} Promise @private
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "source", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L95-L100
52,577
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (expected, hash) { this.actionQueue.push(this.webdriverClient.title.bind(this.webdriverClient)); this.actionQueue.push(this._titleCb.bind(this, expected, hash)); return this; }
javascript
function (expected, hash) { this.actionQueue.push(this.webdriverClient.title.bind(this.webdriverClient)); this.actionQueue.push(this._titleCb.bind(this, expected, hash)); return this; }
[ "function", "(", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "title", ".", "bind", "(", "this", ".", "webdriverClient", ")", ")", ";", "this", ".", "actionQueue", ".", "push", "(...
Checks the document title of a page @method title @param {string} expected Expected page title @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "the", "document", "title", "of", "a", "page" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L111-L115
52,578
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (expected, hash, title) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'title', expected: expected, hash: hash, value: JSON.parse(title).value}); deferred.resolve(); return deferred.promise; }
javascript
function (expected, hash, title) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'title', expected: expected, hash: hash, value: JSON.parse(title).value}); deferred.resolve(); return deferred.promise; }
[ "function", "(", "expected", ",", "hash", ",", "title", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "this", ".", "events", ".", "emit", "(", "'driver:message'", ",", "{", "key", ":", "'title'", ",", "expected", ":", "expected"...
Sends out an event with the results of the `title` call @method _titleCb @param {string} expected Expected page title @param {string} hash Unique hash of that fn call @param {string} title Serialized JSON with the results of the title call @return {object} promise Title promise @private
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "title", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L128-L133
52,579
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (expected, hash) { this.actionQueue.push(this.webdriverClient.alertText.bind(this.webdriverClient)); this.actionQueue.push(this._alertTextCb.bind(this, expected, hash)); return this; }
javascript
function (expected, hash) { this.actionQueue.push(this.webdriverClient.alertText.bind(this.webdriverClient)); this.actionQueue.push(this._alertTextCb.bind(this, expected, hash)); return this; }
[ "function", "(", "expected", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "alertText", ".", "bind", "(", "this", ".", "webdriverClient", ")", ")", ";", "this", ".", "actionQueue", ".", "push", ...
Checks the text of an alaert, prompt or confirm dialog @method alertText @param {string} expected Expected alert text @param {string} hash Unique hash of that fn call @chainable
[ "Checks", "the", "text", "of", "an", "alaert", "prompt", "or", "confirm", "dialog" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L144-L148
52,580
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (text, hash) { this.actionQueue.push(this.webdriverClient.promptText.bind(this.webdriverClient, text)); this.actionQueue.push(this._promptTextCb.bind(this, text, hash)); return this; }
javascript
function (text, hash) { this.actionQueue.push(this.webdriverClient.promptText.bind(this.webdriverClient, text)); this.actionQueue.push(this._promptTextCb.bind(this, text, hash)); return this; }
[ "function", "(", "text", ",", "hash", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "promptText", ".", "bind", "(", "this", ".", "webdriverClient", ",", "text", ")", ")", ";", "this", ".", "actionQueue", "...
Sends text to a javascript prompt dialog box @method promptText @param {object} dimensions New window width & height @param {string} hash Unique hash of that fn call @chainable
[ "Sends", "text", "to", "a", "javascript", "prompt", "dialog", "box" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L177-L181
52,581
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (timeout, hash, uuid) { this.actionQueue.push(this.webdriverClient.implicitWait.bind(this.webdriverClient, timeout)); this.actionQueue.push(this._waitCb.bind(this, timeout, hash, uuid)); return this; }
javascript
function (timeout, hash, uuid) { this.actionQueue.push(this.webdriverClient.implicitWait.bind(this.webdriverClient, timeout)); this.actionQueue.push(this._waitCb.bind(this, timeout, hash, uuid)); return this; }
[ "function", "(", "timeout", ",", "hash", ",", "uuid", ")", "{", "this", ".", "actionQueue", ".", "push", "(", "this", ".", "webdriverClient", ".", "implicitWait", ".", "bind", "(", "this", ".", "webdriverClient", ",", "timeout", ")", ")", ";", "this", ...
Wait for a specific amount of time @method wait @param {integer} timeout Time to wait in ms @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @chainable
[ "Wait", "for", "a", "specific", "amount", "of", "time" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L273-L277
52,582
dalekjs/dalek-driver-sauce
lib/commands/page.js
function (timeout, hash, uuid) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'wait', timeout: timeout, uuid: uuid, hash: hash, value: timeout + ' ms'}); setTimeout(function () { deferred.resolve(); }.bind(this), timeout); return deferred.promise; }
javascript
function (timeout, hash, uuid) { var deferred = Q.defer(); this.events.emit('driver:message', {key: 'wait', timeout: timeout, uuid: uuid, hash: hash, value: timeout + ' ms'}); setTimeout(function () { deferred.resolve(); }.bind(this), timeout); return deferred.promise; }
[ "function", "(", "timeout", ",", "hash", ",", "uuid", ")", "{", "var", "deferred", "=", "Q", ".", "defer", "(", ")", ";", "this", ".", "events", ".", "emit", "(", "'driver:message'", ",", "{", "key", ":", "'wait'", ",", "timeout", ":", "timeout", "...
Sends out an event with the results of the `wait` call @method _waitCb @param {integer} timeout Time to wait in ms @param {string} hash Unique hash of that fn call @param {string} uuid Unique hash of that fn call @return {object} promise WaitForElement promise @private
[ "Sends", "out", "an", "event", "with", "the", "results", "of", "the", "wait", "call" ]
4b3ef87a0c35a91db8456d074b0d47a3e0df58f7
https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/page.js#L290-L297
52,583
psalaets/pie-slice
lib/pie.js
function(referencePoint, otherPoint) { if (this.yDown) { if (otherPoint.y > referencePoint.y) { otherPoint = { x: otherPoint.x, y: referencePoint.y - (otherPoint.y - referencePoint.y) } } else if (otherPoint.y < referencePoint.y) { otherPoint = { x: ...
javascript
function(referencePoint, otherPoint) { if (this.yDown) { if (otherPoint.y > referencePoint.y) { otherPoint = { x: otherPoint.x, y: referencePoint.y - (otherPoint.y - referencePoint.y) } } else if (otherPoint.y < referencePoint.y) { otherPoint = { x: ...
[ "function", "(", "referencePoint", ",", "otherPoint", ")", "{", "if", "(", "this", ".", "yDown", ")", "{", "if", "(", "otherPoint", ".", "y", ">", "referencePoint", ".", "y", ")", "{", "otherPoint", "=", "{", "x", ":", "otherPoint", ".", "x", ",", ...
Tells what slice some point is in relative to a reference point. @param referencePoint Object with x and y properties @param otherPoint Object with x and y properties @return zero based slice number
[ "Tells", "what", "slice", "some", "point", "is", "in", "relative", "to", "a", "reference", "point", "." ]
ca119bb63ccefc09cc66ebfdf0bc19ebce364b88
https://github.com/psalaets/pie-slice/blob/ca119bb63ccefc09cc66ebfdf0bc19ebce364b88/lib/pie.js#L13-L37
52,584
redisjs/jsr-server
lib/command/database/string/getbit.js
validate
function validate(cmd, args, info) { AbstractCommand.prototype.validate.apply(this, arguments); var offset = parseInt('' + args[1]); if(isNaN(offset) || offset < 0 || offset > Constants.MAX_BIT_LEN) { throw IntegerRange; } args[1] = offset; }
javascript
function validate(cmd, args, info) { AbstractCommand.prototype.validate.apply(this, arguments); var offset = parseInt('' + args[1]); if(isNaN(offset) || offset < 0 || offset > Constants.MAX_BIT_LEN) { throw IntegerRange; } args[1] = offset; }
[ "function", "validate", "(", "cmd", ",", "args", ",", "info", ")", "{", "AbstractCommand", ".", "prototype", ".", "validate", ".", "apply", "(", "this", ",", "arguments", ")", ";", "var", "offset", "=", "parseInt", "(", "''", "+", "args", "[", "1", "...
Validate the GETBIT command.
[ "Validate", "the", "GETBIT", "command", "." ]
49413052d3039524fbdd2ade0ef9bae26cb4d647
https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/database/string/getbit.js#L19-L26
52,585
buzzin0609/tagbuildr
src/handleClassesAndId.js
handleClassesAndId
function handleClassesAndId(str) { return str.replace(/(.*?)([\.|#].[^|]*)(.*)/, function (fullStr, tag, classAndIds, end) { if (classAndIds[0] === '|') { return fullStr; } const clsIdArr = classAndIds.split(/(\..[^\.|#]*)/).filter(Boolean); const returnArr = []; let i = clsIdArr.length; while (i--) { ...
javascript
function handleClassesAndId(str) { return str.replace(/(.*?)([\.|#].[^|]*)(.*)/, function (fullStr, tag, classAndIds, end) { if (classAndIds[0] === '|') { return fullStr; } const clsIdArr = classAndIds.split(/(\..[^\.|#]*)/).filter(Boolean); const returnArr = []; let i = clsIdArr.length; while (i--) { ...
[ "function", "handleClassesAndId", "(", "str", ")", "{", "return", "str", ".", "replace", "(", "/", "(.*?)([\\.|#].[^|]*)(.*)", "/", ",", "function", "(", "fullStr", ",", "tag", ",", "classAndIds", ",", "end", ")", "{", "if", "(", "classAndIds", "[", "0", ...
Remove the css style classes and ids then replace them with tagbuildr attribute strings to use later on @private @param {string} str @return {string} reformatted tagString
[ "Remove", "the", "css", "style", "classes", "and", "ids", "then", "replace", "them", "with", "tagbuildr", "attribute", "strings", "to", "use", "later", "on" ]
9d6a52ad51c0fc3230de2da1e8e3f63f95a6e542
https://github.com/buzzin0609/tagbuildr/blob/9d6a52ad51c0fc3230de2da1e8e3f63f95a6e542/src/handleClassesAndId.js#L13-L27
52,586
mathieudutour/nplint
lib/config.js
readConfigFromFile
function readConfigFromFile(filePath) { var config = {}; if (isFilePath(filePath)) { try { config = yaml.safeLoad(stripComments(fs.readFileSync(filePath, 'utf8'))) || {}; } catch (e) { e.message = 'Cannot read config file: ' + filePath + '\nError: ' + e.message; throw e; } if (pa...
javascript
function readConfigFromFile(filePath) { var config = {}; if (isFilePath(filePath)) { try { config = yaml.safeLoad(stripComments(fs.readFileSync(filePath, 'utf8'))) || {}; } catch (e) { e.message = 'Cannot read config file: ' + filePath + '\nError: ' + e.message; throw e; } if (pa...
[ "function", "readConfigFromFile", "(", "filePath", ")", "{", "var", "config", "=", "{", "}", ";", "if", "(", "isFilePath", "(", "filePath", ")", ")", "{", "try", "{", "config", "=", "yaml", ".", "safeLoad", "(", "stripComments", "(", "fs", ".", "readFi...
Read the config from the config JSON file @param {string} filePath the path to the JSON config file @returns {Object} config object @private
[ "Read", "the", "config", "from", "the", "config", "JSON", "file" ]
ef444abcc6dd08fb61d5fc8ce618598d4455e08e
https://github.com/mathieudutour/nplint/blob/ef444abcc6dd08fb61d5fc8ce618598d4455e08e/lib/config.js#L51-L88
52,587
mathieudutour/nplint
lib/config.js
loadConfig
function loadConfig(configToLoad) { var config = {}; var filePath = ''; if (configToLoad) { if (isObject(configToLoad)) { config = configToLoad; } else { filePath = configToLoad; config = readConfigFromFile(filePath); } if (!config.rules) { config.rules = {}; } c...
javascript
function loadConfig(configToLoad) { var config = {}; var filePath = ''; if (configToLoad) { if (isObject(configToLoad)) { config = configToLoad; } else { filePath = configToLoad; config = readConfigFromFile(filePath); } if (!config.rules) { config.rules = {}; } c...
[ "function", "loadConfig", "(", "configToLoad", ")", "{", "var", "config", "=", "{", "}", ";", "var", "filePath", "=", "''", ";", "if", "(", "configToLoad", ")", "{", "if", "(", "isObject", "(", "configToLoad", ")", ")", "{", "config", "=", "configToLoa...
Load and parse a JSON config object from a file. @param {string|Object} configToLoad the path to the JSON config file or the config object itself. @returns {Object} the parsed config object (empty object if there was a parse error) @private
[ "Load", "and", "parse", "a", "JSON", "config", "object", "from", "a", "file", "." ]
ef444abcc6dd08fb61d5fc8ce618598d4455e08e
https://github.com/mathieudutour/nplint/blob/ef444abcc6dd08fb61d5fc8ce618598d4455e08e/lib/config.js#L96-L163
52,588
mathieudutour/nplint
lib/config.js
getPluginsConfig
function getPluginsConfig(pluginNames) { var pluginConfig = {}; pluginNames.forEach(function(pluginName) { var pluginNamespace = util.getNamespace(pluginName), pluginNameWithoutNamespace = util.removeNameSpace(pluginName), pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace...
javascript
function getPluginsConfig(pluginNames) { var pluginConfig = {}; pluginNames.forEach(function(pluginName) { var pluginNamespace = util.getNamespace(pluginName), pluginNameWithoutNamespace = util.removeNameSpace(pluginName), pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace...
[ "function", "getPluginsConfig", "(", "pluginNames", ")", "{", "var", "pluginConfig", "=", "{", "}", ";", "pluginNames", ".", "forEach", "(", "function", "(", "pluginName", ")", "{", "var", "pluginNamespace", "=", "util", ".", "getNamespace", "(", "pluginName",...
Load configuration for all plugins provided. @param {string[]} pluginNames An array of plugin names which should be loaded. @returns {Object} all plugin configurations merged together
[ "Load", "configuration", "for", "all", "plugins", "provided", "." ]
ef444abcc6dd08fb61d5fc8ce618598d4455e08e
https://github.com/mathieudutour/nplint/blob/ef444abcc6dd08fb61d5fc8ce618598d4455e08e/lib/config.js#L170-L203
52,589
mathieudutour/nplint
lib/config.js
getLocalConfig
function getLocalConfig(thisConfig, directory) { var found, i, localConfig, localConfigFile, config = {}, localConfigFiles = thisConfig.findLocalConfigFiles(directory), numFiles = localConfigFiles.length, rootPath, projectConfigPath = path.join(process.cwd(), LOCAL_CONFIG_FILENAME); ...
javascript
function getLocalConfig(thisConfig, directory) { var found, i, localConfig, localConfigFile, config = {}, localConfigFiles = thisConfig.findLocalConfigFiles(directory), numFiles = localConfigFiles.length, rootPath, projectConfigPath = path.join(process.cwd(), LOCAL_CONFIG_FILENAME); ...
[ "function", "getLocalConfig", "(", "thisConfig", ",", "directory", ")", "{", "var", "found", ",", "i", ",", "localConfig", ",", "localConfigFile", ",", "config", "=", "{", "}", ",", "localConfigFiles", "=", "thisConfig", ".", "findLocalConfigFiles", "(", "dire...
Get a local config object. @param {Object} thisConfig A Config object. @param {string} directory The directory to start looking in for a local config file. @returns {Object} The local config object, or an empty object if there is no local config.
[ "Get", "a", "local", "config", "object", "." ]
ef444abcc6dd08fb61d5fc8ce618598d4455e08e
https://github.com/mathieudutour/nplint/blob/ef444abcc6dd08fb61d5fc8ce618598d4455e08e/lib/config.js#L226-L270
52,590
vkiding/jud-vue-render
src/render/browser/extend/components/neighbor/index.js
SliderNeighbor
function SliderNeighbor (data) { this.autoPlay = false // default value is false. this.interval = DEFAULT_INTERVAL this.direction = 'row' // 'column' is not temporarily supported. this.slides = [] this.isPageShow = true this.isDomRendering = true this.currentIndex = 0 this.neighborSpac...
javascript
function SliderNeighbor (data) { this.autoPlay = false // default value is false. this.interval = DEFAULT_INTERVAL this.direction = 'row' // 'column' is not temporarily supported. this.slides = [] this.isPageShow = true this.isDomRendering = true this.currentIndex = 0 this.neighborSpac...
[ "function", "SliderNeighbor", "(", "data", ")", "{", "this", ".", "autoPlay", "=", "false", "// default value is false.", "this", ".", "interval", "=", "DEFAULT_INTERVAL", "this", ".", "direction", "=", "'row'", "// 'column' is not temporarily supported.", "this", "."...
data.attr support slider's attributes and three @param {number} neighbor-space 0 - 375, the exposing width of slides on both other sides. @param {number} neighbor-alpha 0 - 1, opacity of both other sides of slides, default is 0.6. @param {number} neighbor-scale 0 - 1, the scale of both other sides of slides, default is...
[ "data", ".", "attr", "support", "slider", "s", "attributes", "and", "three" ]
07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47
https://github.com/vkiding/jud-vue-render/blob/07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47/src/render/browser/extend/components/neighbor/index.js#L610-L629
52,591
wenwuwu/array-es5
lib/arrays.js
function (key, array, index, fnEqual) { var idx = Arrays.indexOf(key, array, index, fnEqual); if (idx >= 0) array.splice(idx, 1); return idx; }
javascript
function (key, array, index, fnEqual) { var idx = Arrays.indexOf(key, array, index, fnEqual); if (idx >= 0) array.splice(idx, 1); return idx; }
[ "function", "(", "key", ",", "array", ",", "index", ",", "fnEqual", ")", "{", "var", "idx", "=", "Arrays", ".", "indexOf", "(", "key", ",", "array", ",", "index", ",", "fnEqual", ")", ";", "if", "(", "idx", ">=", "0", ")", "array", ".", "splice",...
Removes an item from an Array. The search for the item is left-to-right. This method returns the index position at which the item was found. @param key {Object} @param array {Array} @param index {Number or String} Optional. @param fnEqual {Function} Optional. The function to use to compare "key" with each item within...
[ "Removes", "an", "item", "from", "an", "Array", ".", "The", "search", "for", "the", "item", "is", "left", "-", "to", "-", "right", ".", "This", "method", "returns", "the", "index", "position", "at", "which", "the", "item", "was", "found", "." ]
5331feed7e779534989f20919764a8224073ead2
https://github.com/wenwuwu/array-es5/blob/5331feed7e779534989f20919764a8224073ead2/lib/arrays.js#L636-L641
52,592
wenwuwu/array-es5
lib/arrays.js
function (key, array, index) { var idx = Arrays.lastIndexOf(key, array, index); if (idx >= 0) array.splice(idx, 1); return idx; }
javascript
function (key, array, index) { var idx = Arrays.lastIndexOf(key, array, index); if (idx >= 0) array.splice(idx, 1); return idx; }
[ "function", "(", "key", ",", "array", ",", "index", ")", "{", "var", "idx", "=", "Arrays", ".", "lastIndexOf", "(", "key", ",", "array", ",", "index", ")", ";", "if", "(", "idx", ">=", "0", ")", "array", ".", "splice", "(", "idx", ",", "1", ")"...
Removes an item from an Array. The search for the item is right-to-left. This method returns the index position at which the item was found. @param key {Object} @param array {Array} @param index {Number or String} optional @returns {Number} Integer. The index position of the removed item, or -1 if the array was not m...
[ "Removes", "an", "item", "from", "an", "Array", ".", "The", "search", "for", "the", "item", "is", "right", "-", "to", "-", "left", ".", "This", "method", "returns", "the", "index", "position", "at", "which", "the", "item", "was", "found", "." ]
5331feed7e779534989f20919764a8224073ead2
https://github.com/wenwuwu/array-es5/blob/5331feed7e779534989f20919764a8224073ead2/lib/arrays.js#L653-L658
52,593
wenwuwu/array-es5
lib/arrays.js
function (items, array, index) { // There might be some optimization to be made here. // Right now, I'm just going for a simple solution. if ( !(items instanceof Array) || !(array instanceof Array) ) throw "IllegalArgumentException: items and ar...
javascript
function (items, array, index) { // There might be some optimization to be made here. // Right now, I'm just going for a simple solution. if ( !(items instanceof Array) || !(array instanceof Array) ) throw "IllegalArgumentException: items and ar...
[ "function", "(", "items", ",", "array", ",", "index", ")", "{", "// There might be some optimization to be made here.\r", "// Right now, I'm just going for a simple solution.\r", "if", "(", "!", "(", "items", "instanceof", "Array", ")", "||", "!", "(", "array", "instanc...
Removes a list of items from an Array. @param items {Array} Items to be removed @param array {Array} Array from which to remove the items. @param index {Number or String} optional @returns {Number} The number of successfully removed items.
[ "Removes", "a", "list", "of", "items", "from", "an", "Array", "." ]
5331feed7e779534989f20919764a8224073ead2
https://github.com/wenwuwu/array-es5/blob/5331feed7e779534989f20919764a8224073ead2/lib/arrays.js#L667-L683
52,594
redisjs/jsr-resp
lib/interpreter.js
Interpreter
function Interpreter(options) { options = options || {}; this.quote = typeof options.quote === 'boolean' ? options.quote : true; }
javascript
function Interpreter(options) { options = options || {}; this.quote = typeof options.quote === 'boolean' ? options.quote : true; }
[ "function", "Interpreter", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "this", ".", "quote", "=", "typeof", "options", ".", "quote", "===", "'boolean'", "?", "options", ".", "quote", ":", "true", ";", "}" ]
Interprets a single string value into a command string and corresponding arguments. Typically used to recieve input from stdin and create a command that may be sent to a server. Arguments are coerced to strings or integers. The values `null`, `true` and `false` are interpreted as strings. Quotes (single or double) ...
[ "Interprets", "a", "single", "string", "value", "into", "a", "command", "string", "and", "corresponding", "arguments", "." ]
9f998fc65a4494a358fca296adfe37fc5fb3f03c
https://github.com/redisjs/jsr-resp/blob/9f998fc65a4494a358fca296adfe37fc5fb3f03c/lib/interpreter.js#L20-L23
52,595
redisjs/jsr-resp
lib/interpreter.js
interpret
function interpret(input) { var cli = [] , exp = null , i , s , q , e , sre = /^("|').*/ , ere = /.*("|')$/; assert( typeof input === 'string' || input instanceof String, 'interpret invalid input: must be a string'); input = '' + input; assert( input && !/^\s+$/.test(i...
javascript
function interpret(input) { var cli = [] , exp = null , i , s , q , e , sre = /^("|').*/ , ere = /.*("|')$/; assert( typeof input === 'string' || input instanceof String, 'interpret invalid input: must be a string'); input = '' + input; assert( input && !/^\s+$/.test(i...
[ "function", "interpret", "(", "input", ")", "{", "var", "cli", "=", "[", "]", ",", "exp", "=", "null", ",", "i", ",", "s", ",", "q", ",", "e", ",", "sre", "=", "/", "^(\"|').*", "/", ",", "ere", "=", "/", ".*(\"|')$", "/", ";", "assert", "(",...
Interpret a string value into a command and arguments. @param input The input string. @return An array containing a command and arguments.
[ "Interpret", "a", "string", "value", "into", "a", "command", "and", "arguments", "." ]
9f998fc65a4494a358fca296adfe37fc5fb3f03c
https://github.com/redisjs/jsr-resp/blob/9f998fc65a4494a358fca296adfe37fc5fb3f03c/lib/interpreter.js#L33-L102
52,596
nbrownus/ppunit
lib/writers/FileWriter.js
function (options) { if (!options.path) { throw new Error('A path must be supplied to write to') } this.path = options.path this.useColors = options.useColors || false mkdirp.sync(path.dirname(this.path)) this.fd = fs.openSync(this.path, 'w', options.mode || 0644) }
javascript
function (options) { if (!options.path) { throw new Error('A path must be supplied to write to') } this.path = options.path this.useColors = options.useColors || false mkdirp.sync(path.dirname(this.path)) this.fd = fs.openSync(this.path, 'w', options.mode || 0644) }
[ "function", "(", "options", ")", "{", "if", "(", "!", "options", ".", "path", ")", "{", "throw", "new", "Error", "(", "'A path must be supplied to write to'", ")", "}", "this", ".", "path", "=", "options", ".", "path", "this", ".", "useColors", "=", "opt...
Handles writing output to a file @param {Object} options An object containing options pertaining to this writer @param {String} options.path An absolute or relative path to write output to @param {String} [options.useColors=false] Whether or not to use colors @param {String} [options.mode=0644] A file mode to create t...
[ "Handles", "writing", "output", "to", "a", "file" ]
dcce602497d9548ce9085a8db115e65561dcc3de
https://github.com/nbrownus/ppunit/blob/dcce602497d9548ce9085a8db115e65561dcc3de/lib/writers/FileWriter.js#L17-L28
52,597
interlockjs/plugins
packages/css/src/gen-css-bundles.js
replaceCssModules
function replaceCssModules (bundles, cssBundles, originBundleCssBundleMap, moduleClassnameMaps) { const cssBundlesStats = moduleClassnameMaps && cssBundles.map(bundle => { const moduleClassnames = bundle.modules.map(module => moduleClassnameMaps[module.path]); const combinedJson = assign(...[{}].concat(modul...
javascript
function replaceCssModules (bundles, cssBundles, originBundleCssBundleMap, moduleClassnameMaps) { const cssBundlesStats = moduleClassnameMaps && cssBundles.map(bundle => { const moduleClassnames = bundle.modules.map(module => moduleClassnameMaps[module.path]); const combinedJson = assign(...[{}].concat(modul...
[ "function", "replaceCssModules", "(", "bundles", ",", "cssBundles", ",", "originBundleCssBundleMap", ",", "moduleClassnameMaps", ")", "{", "const", "cssBundlesStats", "=", "moduleClassnameMaps", "&&", "cssBundles", ".", "map", "(", "bundle", "=>", "{", "const", "mod...
Replace CSS modules with JavaScript modules which reference the CSS output bundle destination. @param {Array} bundles Original bundles array. @param {Array} cssBundles New CSS bundles. @param {Object} originBundleCssBundleMap Mapping of origin bundle to sibling CSS bundle. @param {...
[ "Replace", "CSS", "modules", "with", "JavaScript", "modules", "which", "reference", "the", "CSS", "output", "bundle", "destination", "." ]
05197e4511b64d269260fe3c701ceff864897ab3
https://github.com/interlockjs/plugins/blob/05197e4511b64d269260fe3c701ceff864897ab3/packages/css/src/gen-css-bundles.js#L25-L60
52,598
mountain/miniweb
miniweb/environment.js
visitEntry
function visitEntry (pkey, context, callback) { _(context).chain().keys().each(function (key) { var entry = context[key], curkey = pkey?(pkey + '.' + key):key; if(_.isFunction(entry) || _.isString(entry) || _.isBoolean(entry) || _.isArray(entry) || _.isNumber(entry) || _.isRegExp(entry)) ...
javascript
function visitEntry (pkey, context, callback) { _(context).chain().keys().each(function (key) { var entry = context[key], curkey = pkey?(pkey + '.' + key):key; if(_.isFunction(entry) || _.isString(entry) || _.isBoolean(entry) || _.isArray(entry) || _.isNumber(entry) || _.isRegExp(entry)) ...
[ "function", "visitEntry", "(", "pkey", ",", "context", ",", "callback", ")", "{", "_", "(", "context", ")", ".", "chain", "(", ")", ".", "keys", "(", ")", ".", "each", "(", "function", "(", "key", ")", "{", "var", "entry", "=", "context", "[", "k...
Visit object hierachy structure
[ "Visit", "object", "hierachy", "structure" ]
8d06fd298cb2236a99d8a71b4b2486d27e607f04
https://github.com/mountain/miniweb/blob/8d06fd298cb2236a99d8a71b4b2486d27e607f04/miniweb/environment.js#L53-L63
52,599
mountain/miniweb
miniweb/environment.js
accessEntry
function accessEntry (context, keys) { _.each(keys, function (key) { if (context) { context = context[key]; } }); return context; }
javascript
function accessEntry (context, keys) { _.each(keys, function (key) { if (context) { context = context[key]; } }); return context; }
[ "function", "accessEntry", "(", "context", ",", "keys", ")", "{", "_", ".", "each", "(", "keys", ",", "function", "(", "key", ")", "{", "if", "(", "context", ")", "{", "context", "=", "context", "[", "key", "]", ";", "}", "}", ")", ";", "return",...
Access object hierachy structure
[ "Access", "object", "hierachy", "structure" ]
8d06fd298cb2236a99d8a71b4b2486d27e607f04
https://github.com/mountain/miniweb/blob/8d06fd298cb2236a99d8a71b4b2486d27e607f04/miniweb/environment.js#L74-L81