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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,900 | berkeleybop/bbop-graph-noctua | lib/edit.js | _get_annotation_by_id | function _get_annotation_by_id(aid){
var anchor = this;
var ret = null;
each(anchor._annotations, function(ann){
if( ann.id() === aid ){
ret = ann;
}
});
return ret;
} | javascript | function _get_annotation_by_id(aid){
var anchor = this;
var ret = null;
each(anchor._annotations, function(ann){
if( ann.id() === aid ){
ret = ann;
}
});
return ret;
} | [
"function",
"_get_annotation_by_id",
"(",
"aid",
")",
"{",
"var",
"anchor",
"=",
"this",
";",
"var",
"ret",
"=",
"null",
";",
"each",
"(",
"anchor",
".",
"_annotations",
",",
"function",
"(",
"ann",
")",
"{",
"if",
"(",
"ann",
".",
"id",
"(",
")",
... | Get sublist of annotations with a certain ID.
@name get_annotations_by_id
@function
@param {String} aid - annotation ID to look for
@returns {Array} list of list of annotations with that ID | [
"Get",
"sublist",
"of",
"annotations",
"with",
"a",
"certain",
"ID",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L308-L318 |
39,901 | berkeleybop/bbop-graph-noctua | lib/edit.js | _get_referenced_subgraphs_by_filter | function _get_referenced_subgraphs_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._referenced_subgraphs, function(g){
var res = filter(g);
if( res && res === true ){
ret.push(g);
}
});
return ret;
} | javascript | function _get_referenced_subgraphs_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._referenced_subgraphs, function(g){
var res = filter(g);
if( res && res === true ){
ret.push(g);
}
});
return ret;
} | [
"function",
"_get_referenced_subgraphs_by_filter",
"(",
"filter",
")",
"{",
"var",
"anchor",
"=",
"this",
";",
"var",
"ret",
"=",
"[",
"]",
";",
"each",
"(",
"anchor",
".",
"_referenced_subgraphs",
",",
"function",
"(",
"g",
")",
"{",
"var",
"res",
"=",
... | Get a sublist of referenced subgraphs using the filter
function. The filter function take a single subgraph as an
argument, and adds it to the return list if it evaluates to true.
@name get_referenced_subgraphs_by_filter
@function
@param {Function} filter - function described above
@returns {Array} list of passing sub... | [
"Get",
"a",
"sublist",
"of",
"referenced",
"subgraphs",
"using",
"the",
"filter",
"function",
".",
"The",
"filter",
"function",
"take",
"a",
"single",
"subgraph",
"as",
"an",
"argument",
"and",
"adds",
"it",
"to",
"the",
"return",
"list",
"if",
"it",
"eval... | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L377-L389 |
39,902 | berkeleybop/bbop-graph-noctua | lib/edit.js | _get_referenced_subgraph_by_id | function _get_referenced_subgraph_by_id(iid){
var anchor = this;
var ret = null;
each(anchor._referenced_subgraphs, function(g){
if( g.id() === iid ){
ret = g;
}
});
return ret;
} | javascript | function _get_referenced_subgraph_by_id(iid){
var anchor = this;
var ret = null;
each(anchor._referenced_subgraphs, function(g){
if( g.id() === iid ){
ret = g;
}
});
return ret;
} | [
"function",
"_get_referenced_subgraph_by_id",
"(",
"iid",
")",
"{",
"var",
"anchor",
"=",
"this",
";",
"var",
"ret",
"=",
"null",
";",
"each",
"(",
"anchor",
".",
"_referenced_subgraphs",
",",
"function",
"(",
"g",
")",
"{",
"if",
"(",
"g",
".",
"id",
... | Get a referenced_subgraph with a certain ID.
@name get_referenced_subgraph_by_id
@function
@param {String} iid - referenced_individual ID to look for
@returns {Object|null} referenced_subgraph with that ID | [
"Get",
"a",
"referenced_subgraph",
"with",
"a",
"certain",
"ID",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L399-L410 |
39,903 | berkeleybop/bbop-graph-noctua | lib/edit.js | noctua_graph | function noctua_graph(new_id){
bbop_graph.call(this);
this._is_a = 'bbop-graph-noctua.graph';
// Deal with id or generate a new one.
if( typeof(new_id) !== 'undefined' ){
this.id(new_id);
}
// The old edit core.
this.core = {
'edges': {}, // map of id to edit_edge - edges not completely ... | javascript | function noctua_graph(new_id){
bbop_graph.call(this);
this._is_a = 'bbop-graph-noctua.graph';
// Deal with id or generate a new one.
if( typeof(new_id) !== 'undefined' ){
this.id(new_id);
}
// The old edit core.
this.core = {
'edges': {}, // map of id to edit_edge - edges not completely ... | [
"function",
"noctua_graph",
"(",
"new_id",
")",
"{",
"bbop_graph",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"_is_a",
"=",
"'bbop-graph-noctua.graph'",
";",
"// Deal with id or generate a new one.",
"if",
"(",
"typeof",
"(",
"new_id",
")",
"!==",
"'undefi... | Sublcass of bbop-graph for use with Noctua ideas and concepts.
Unlike the superclass, can take an id as an argument, or will
generate on on its own.
@constructor
@see module:bbop-graph
@alias graph
@param {String} [new_id] - new id; otherwise new unique generated
@returns {this} | [
"Sublcass",
"of",
"bbop",
"-",
"graph",
"for",
"use",
"with",
"Noctua",
"ideas",
"and",
"concepts",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L569-L598 |
39,904 | berkeleybop/bbop-graph-noctua | lib/edit.js | _is_same_ann | function _is_same_ann(a1, a2){
var ret = false;
if( a1.key() === a2.key() &&
a1.value() === a2.value() &&
a1.value_type() === a2.value_type() ){
ret = true;
}
return ret;
} | javascript | function _is_same_ann(a1, a2){
var ret = false;
if( a1.key() === a2.key() &&
a1.value() === a2.value() &&
a1.value_type() === a2.value_type() ){
ret = true;
}
return ret;
} | [
"function",
"_is_same_ann",
"(",
"a1",
",",
"a2",
")",
"{",
"var",
"ret",
"=",
"false",
";",
"if",
"(",
"a1",
".",
"key",
"(",
")",
"===",
"a2",
".",
"key",
"(",
")",
"&&",
"a1",
".",
"value",
"(",
")",
"===",
"a2",
".",
"value",
"(",
")",
... | Function to check if two annotations are the same. | [
"Function",
"to",
"check",
"if",
"two",
"annotations",
"are",
"the",
"same",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L1105-L1113 |
39,905 | berkeleybop/bbop-graph-noctua | lib/edit.js | is_iri_ev_p | function is_iri_ev_p(ann){
var ret = false;
if( ann.key() === 'evidence' && ann.value_type() === 'IRI' ){
ret = true;
}
return ret;
} | javascript | function is_iri_ev_p(ann){
var ret = false;
if( ann.key() === 'evidence' && ann.value_type() === 'IRI' ){
ret = true;
}
return ret;
} | [
"function",
"is_iri_ev_p",
"(",
"ann",
")",
"{",
"var",
"ret",
"=",
"false",
";",
"if",
"(",
"ann",
".",
"key",
"(",
")",
"===",
"'evidence'",
"&&",
"ann",
".",
"value_type",
"(",
")",
"===",
"'IRI'",
")",
"{",
"ret",
"=",
"true",
";",
"}",
"retu... | Take and, and see if it is an evidence reference. | [
"Take",
"and",
"and",
"see",
"if",
"it",
"is",
"an",
"evidence",
"reference",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L1339-L1345 |
39,906 | berkeleybop/bbop-graph-noctua | lib/edit.js | pull_seeds | function pull_seeds(entity, test_p){
each(entity.annotations(), function(ann){
//console.log(ann.key(), ann.value_type(), ann.value());
// Is it an evidence annotation.
if( ! test_p(ann) ){
// Skip.
//console.log('skip folding with failed test');
}else{
//console.log('start foldin... | javascript | function pull_seeds(entity, test_p){
each(entity.annotations(), function(ann){
//console.log(ann.key(), ann.value_type(), ann.value());
// Is it an evidence annotation.
if( ! test_p(ann) ){
// Skip.
//console.log('skip folding with failed test');
}else{
//console.log('start foldin... | [
"function",
"pull_seeds",
"(",
"entity",
",",
"test_p",
")",
"{",
"each",
"(",
"entity",
".",
"annotations",
"(",
")",
",",
"function",
"(",
"ann",
")",
"{",
"//console.log(ann.key(), ann.value_type(), ann.value());",
"// Is it an evidence annotation.",
"if",
"(",
"... | collect all possibilities here | [
"collect",
"all",
"possibilities",
"here"
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L1351-L1373 |
39,907 | berkeleybop/bbop-graph-noctua | lib/edit.js | _unfold_subgraph | function _unfold_subgraph(sub){
// Restore to graph.
// console.log(' unfold # (' + sub.all_nodes().length + ', ' +
// sub.all_edges().length + ')');
each(sub.all_nodes(), function(node){
anchor.add_node(node);
});
each(sub.all_edges(), function(edge){
anchor.add_edge(edge);
});
} | javascript | function _unfold_subgraph(sub){
// Restore to graph.
// console.log(' unfold # (' + sub.all_nodes().length + ', ' +
// sub.all_edges().length + ')');
each(sub.all_nodes(), function(node){
anchor.add_node(node);
});
each(sub.all_edges(), function(edge){
anchor.add_edge(edge);
});
} | [
"function",
"_unfold_subgraph",
"(",
"sub",
")",
"{",
"// Restore to graph.",
"// console.log(' unfold # (' + sub.all_nodes().length + ', ' +",
"// \t sub.all_edges().length + ')');",
"each",
"(",
"sub",
".",
"all_nodes",
"(",
")",
",",
"function",
"(",
"node",
")",
"{... | For any entity, remove its referenced individuals and re-add them to the graph. | [
"For",
"any",
"entity",
"remove",
"its",
"referenced",
"individuals",
"and",
"re",
"-",
"add",
"them",
"to",
"the",
"graph",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L1800-L1811 |
39,908 | berkeleybop/bbop-graph-noctua | lib/edit.js | noctua_node | function noctua_node(in_id, in_label, in_types, in_inferred_types){
bbop_node.call(this, in_id, in_label);
this._is_a = 'bbop-graph-noctua.node';
var anchor = this;
// Let's make this an OWL-like world.
this._types = [];
this._inferred_types = [];
this._id2type = {}; // contains map to both... | javascript | function noctua_node(in_id, in_label, in_types, in_inferred_types){
bbop_node.call(this, in_id, in_label);
this._is_a = 'bbop-graph-noctua.node';
var anchor = this;
// Let's make this an OWL-like world.
this._types = [];
this._inferred_types = [];
this._id2type = {}; // contains map to both... | [
"function",
"noctua_node",
"(",
"in_id",
",",
"in_label",
",",
"in_types",
",",
"in_inferred_types",
")",
"{",
"bbop_node",
".",
"call",
"(",
"this",
",",
"in_id",
",",
"in_label",
")",
";",
"this",
".",
"_is_a",
"=",
"'bbop-graph-noctua.node'",
";",
"var",
... | Sublcass of bbop-graph.node for use with Noctua ideas and concepts.
@constructor
@see module:bbop-graph
@alias node
@param {String} [in_id] - new id; otherwise new unique generated
@param {String} [in_label] - node "label"
@param {Array} [in_types] - list of Objects or strings--anything that can be parsed by class_exp... | [
"Sublcass",
"of",
"bbop",
"-",
"graph",
".",
"node",
"for",
"use",
"with",
"Noctua",
"ideas",
"and",
"concepts",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L1990-L2026 |
39,909 | berkeleybop/bbop-graph-noctua | lib/edit.js | noctua_edge | function noctua_edge(subject, object, predicate){
bbop_edge.call(this, subject, object, predicate);
this._is_a = 'bbop-graph-noctua.edge';
// Edges are not completely anonymous in this world.
this._id = bbop.uuid();
this._predicate_label = null;
this._annotations = [];
this._referenced_sub... | javascript | function noctua_edge(subject, object, predicate){
bbop_edge.call(this, subject, object, predicate);
this._is_a = 'bbop-graph-noctua.edge';
// Edges are not completely anonymous in this world.
this._id = bbop.uuid();
this._predicate_label = null;
this._annotations = [];
this._referenced_sub... | [
"function",
"noctua_edge",
"(",
"subject",
",",
"object",
",",
"predicate",
")",
"{",
"bbop_edge",
".",
"call",
"(",
"this",
",",
"subject",
",",
"object",
",",
"predicate",
")",
";",
"this",
".",
"_is_a",
"=",
"'bbop-graph-noctua.edge'",
";",
"// Edges are ... | Sublcass of bbop-graph.edge for use with Noctua ideas and concepts.
@constructor
@see module:bbop-graph
@alias edge
@param {String} subject - required subject id
@param {String} object - required object id
@param {String} [predicate] - preidcate id; if not provided, will use defined default (you probably want to provi... | [
"Sublcass",
"of",
"bbop",
"-",
"graph",
".",
"edge",
"for",
"use",
"with",
"Noctua",
"ideas",
"and",
"concepts",
"."
] | 14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3 | https://github.com/berkeleybop/bbop-graph-noctua/blob/14ec0e6c9f93ece0ff7ee80a736596ddbe601cd3/lib/edit.js#L2243-L2253 |
39,910 | tostegroo/node-easy-mysql-promise | index.js | getStringValue | function getStringValue(value)
{
var return_value = '';
switch(typeof(value))
{
case 'string':
return_value = "'" + value + "'";
break;
case 'number':
return_value = value;
break;
case 'object':
if(value==null)
return_value = value;
else
{
var valuestring = JSON.stringify(valu... | javascript | function getStringValue(value)
{
var return_value = '';
switch(typeof(value))
{
case 'string':
return_value = "'" + value + "'";
break;
case 'number':
return_value = value;
break;
case 'object':
if(value==null)
return_value = value;
else
{
var valuestring = JSON.stringify(valu... | [
"function",
"getStringValue",
"(",
"value",
")",
"{",
"var",
"return_value",
"=",
"''",
";",
"switch",
"(",
"typeof",
"(",
"value",
")",
")",
"{",
"case",
"'string'",
":",
"return_value",
"=",
"\"'\"",
"+",
"value",
"+",
"\"'\"",
";",
"break",
";",
"ca... | A private function to normalize the value for sql query
@param {String|Number|Object} value - The given value
@return {String} | [
"A",
"private",
"function",
"to",
"normalize",
"the",
"value",
"for",
"sql",
"query"
] | 5714cdc16bb975d9a7d4238132135af1af7d55a8 | https://github.com/tostegroo/node-easy-mysql-promise/blob/5714cdc16bb975d9a7d4238132135af1af7d55a8/index.js#L429-L458 |
39,911 | tostegroo/node-easy-mysql-promise | index.js | JSONparse | function JSONparse(string)
{
string = string.replace(/:\s*"([^"]*)"/g, function(match, p1) {
return ': "' + p1.replace(/:/g, '@colon@') + '"';
}).replace(/:\s*'([^']*)'/g, function(match, p1) {
return ': "' + p1.replace(/:/g, '@colon@') + '"';
}).replace(/(['"])?([a-z0-9A-Z_]+)(['"])?\s*:/g, '"$2": ');
string ... | javascript | function JSONparse(string)
{
string = string.replace(/:\s*"([^"]*)"/g, function(match, p1) {
return ': "' + p1.replace(/:/g, '@colon@') + '"';
}).replace(/:\s*'([^']*)'/g, function(match, p1) {
return ': "' + p1.replace(/:/g, '@colon@') + '"';
}).replace(/(['"])?([a-z0-9A-Z_]+)(['"])?\s*:/g, '"$2": ');
string ... | [
"function",
"JSONparse",
"(",
"string",
")",
"{",
"string",
"=",
"string",
".",
"replace",
"(",
"/",
":\\s*\"([^\"]*)\"",
"/",
"g",
",",
"function",
"(",
"match",
",",
"p1",
")",
"{",
"return",
"': \"'",
"+",
"p1",
".",
"replace",
"(",
"/",
":",
"/",... | A private function get a Json object
@param {String} string - The given string
@return {JSON Object} | [
"A",
"private",
"function",
"get",
"a",
"Json",
"object"
] | 5714cdc16bb975d9a7d4238132135af1af7d55a8 | https://github.com/tostegroo/node-easy-mysql-promise/blob/5714cdc16bb975d9a7d4238132135af1af7d55a8/index.js#L465-L476 |
39,912 | StorjOld/bridge-client-javascript | lib/keypair.js | KeyPair | function KeyPair(privkey) {
if (!(this instanceof KeyPair)) {
return new KeyPair(privkey);
}
if (privkey) {
this._keypair = ecdsa.keyFromPrivate(privkey);
} else {
this._keypair = ecdsa.genKeyPair();
}
} | javascript | function KeyPair(privkey) {
if (!(this instanceof KeyPair)) {
return new KeyPair(privkey);
}
if (privkey) {
this._keypair = ecdsa.keyFromPrivate(privkey);
} else {
this._keypair = ecdsa.genKeyPair();
}
} | [
"function",
"KeyPair",
"(",
"privkey",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"KeyPair",
")",
")",
"{",
"return",
"new",
"KeyPair",
"(",
"privkey",
")",
";",
"}",
"if",
"(",
"privkey",
")",
"{",
"this",
".",
"_keypair",
"=",
"ecdsa",
... | Creates a ECDSA key pair instance for bridge authentication
@constructor
@param {String|Buffer} privkey - Hex encoded ECDSA (secp256k1) public key | [
"Creates",
"a",
"ECDSA",
"key",
"pair",
"instance",
"for",
"bridge",
"authentication"
] | a0778231a649937ad66b0605001bf19f5b007edf | https://github.com/StorjOld/bridge-client-javascript/blob/a0778231a649937ad66b0605001bf19f5b007edf/lib/keypair.js#L13-L23 |
39,913 | ruudboon/node-davis-vantage | lib/parsePacket.js | parsePacket | function parsePacket(packet) {
var parsedPacket = loopPacket.parse(packet);
var convertedPacket = {};
for(var property in parsedPacket) {
var value = parsedPacket[property];
switch (property){
case "BarTrend":
value = _convertBarTrend(value);
break;
case "TempIn":
case "T... | javascript | function parsePacket(packet) {
var parsedPacket = loopPacket.parse(packet);
var convertedPacket = {};
for(var property in parsedPacket) {
var value = parsedPacket[property];
switch (property){
case "BarTrend":
value = _convertBarTrend(value);
break;
case "TempIn":
case "T... | [
"function",
"parsePacket",
"(",
"packet",
")",
"{",
"var",
"parsedPacket",
"=",
"loopPacket",
".",
"parse",
"(",
"packet",
")",
";",
"var",
"convertedPacket",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"property",
"in",
"parsedPacket",
")",
"{",
"var",
"valu... | Parse Davis Packet
@param packet | [
"Parse",
"Davis",
"Packet"
] | 6ead4d350d19af5dcd9bd22e5882aeca985caf4d | https://github.com/ruudboon/node-davis-vantage/blob/6ead4d350d19af5dcd9bd22e5882aeca985caf4d/lib/parsePacket.js#L341-L378 |
39,914 | ruudboon/node-davis-vantage | lib/debug.js | writeToLogFile | function writeToLogFile(rawPacket, parsedPacket) {
if (!debugMode) { return; }
var now = new Date().toUTCString();
fs.appendFile(config.debugRawDataFile, 'Package received at ' + now + ':\n' + rawPacket + '\n\n', function (err) {
if (err) {
console.error('Could not write raw package to ' + config.debu... | javascript | function writeToLogFile(rawPacket, parsedPacket) {
if (!debugMode) { return; }
var now = new Date().toUTCString();
fs.appendFile(config.debugRawDataFile, 'Package received at ' + now + ':\n' + rawPacket + '\n\n', function (err) {
if (err) {
console.error('Could not write raw package to ' + config.debu... | [
"function",
"writeToLogFile",
"(",
"rawPacket",
",",
"parsedPacket",
")",
"{",
"if",
"(",
"!",
"debugMode",
")",
"{",
"return",
";",
"}",
"var",
"now",
"=",
"new",
"Date",
"(",
")",
".",
"toUTCString",
"(",
")",
";",
"fs",
".",
"appendFile",
"(",
"co... | Write raw and parsed data to log file for debugging purposes
@param rawPacket : Raw packet as received via the serial port
@param parsedPacket : Parsed packet object | [
"Write",
"raw",
"and",
"parsed",
"data",
"to",
"log",
"file",
"for",
"debugging",
"purposes"
] | 6ead4d350d19af5dcd9bd22e5882aeca985caf4d | https://github.com/ruudboon/node-davis-vantage/blob/6ead4d350d19af5dcd9bd22e5882aeca985caf4d/lib/debug.js#L35-L51 |
39,915 | divshot/ask | index.js | function (params) {
var resourceObject = {
url: resource.url(),
method: method,
headers: resource.headers
};
if (typeof params === 'object') {
resourceObject.json = true;
resourceObject.body = params;
}
else if (typeof params === 'string') {
resourceObject.bo... | javascript | function (params) {
var resourceObject = {
url: resource.url(),
method: method,
headers: resource.headers
};
if (typeof params === 'object') {
resourceObject.json = true;
resourceObject.body = params;
}
else if (typeof params === 'string') {
resourceObject.bo... | [
"function",
"(",
"params",
")",
"{",
"var",
"resourceObject",
"=",
"{",
"url",
":",
"resource",
".",
"url",
"(",
")",
",",
"method",
":",
"method",
",",
"headers",
":",
"resource",
".",
"headers",
"}",
";",
"if",
"(",
"typeof",
"params",
"===",
"'obj... | New resource object | [
"New",
"resource",
"object"
] | bd37e5654374c98d48e9d37c65984579d3bda445 | https://github.com/divshot/ask/blob/bd37e5654374c98d48e9d37c65984579d3bda445/index.js#L90-L121 | |
39,916 | FlorinDavid/node-math-precision | index.js | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.round(number * multiplier) / multiplier;
} | javascript | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.round(number * multiplier) / multiplier;
} | [
"function",
"(",
"number",
",",
"precision",
")",
"{",
"const",
"multiplier",
"=",
"!",
"!",
"precision",
"?",
"Math",
".",
"pow",
"(",
"10",
",",
"precision",
")",
":",
"1",
";",
"return",
"Math",
".",
"round",
"(",
"number",
"*",
"multiplier",
")",... | Math.round with 'precision' parameter
@param {number} number
@param {number} precision
@return {number} | [
"Math",
".",
"round",
"with",
"precision",
"parameter"
] | d12af7a9a3044343145902b09bcf0a20225da3e2 | https://github.com/FlorinDavid/node-math-precision/blob/d12af7a9a3044343145902b09bcf0a20225da3e2/index.js#L12-L17 | |
39,917 | FlorinDavid/node-math-precision | index.js | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.ceil(number * multiplier) / multiplier;
} | javascript | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.ceil(number * multiplier) / multiplier;
} | [
"function",
"(",
"number",
",",
"precision",
")",
"{",
"const",
"multiplier",
"=",
"!",
"!",
"precision",
"?",
"Math",
".",
"pow",
"(",
"10",
",",
"precision",
")",
":",
"1",
";",
"return",
"Math",
".",
"ceil",
"(",
"number",
"*",
"multiplier",
")",
... | Math.ceil with 'precision' parameter
@param {number} number
@param {number} precision
@return {number} | [
"Math",
".",
"ceil",
"with",
"precision",
"parameter"
] | d12af7a9a3044343145902b09bcf0a20225da3e2 | https://github.com/FlorinDavid/node-math-precision/blob/d12af7a9a3044343145902b09bcf0a20225da3e2/index.js#L27-L32 | |
39,918 | FlorinDavid/node-math-precision | index.js | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.floor(number * multiplier) / multiplier;
} | javascript | function(number, precision) {
const multiplier = !!precision ? Math.pow(10, precision) : 1;
return Math.floor(number * multiplier) / multiplier;
} | [
"function",
"(",
"number",
",",
"precision",
")",
"{",
"const",
"multiplier",
"=",
"!",
"!",
"precision",
"?",
"Math",
".",
"pow",
"(",
"10",
",",
"precision",
")",
":",
"1",
";",
"return",
"Math",
".",
"floor",
"(",
"number",
"*",
"multiplier",
")",... | Math.floor with 'precision' parameter
@param {number} number
@param {number} precision
@return {number} | [
"Math",
".",
"floor",
"with",
"precision",
"parameter"
] | d12af7a9a3044343145902b09bcf0a20225da3e2 | https://github.com/FlorinDavid/node-math-precision/blob/d12af7a9a3044343145902b09bcf0a20225da3e2/index.js#L42-L47 | |
39,919 | skerit/protoblast | lib/benchmark.js | getFunctionOverhead | function getFunctionOverhead(runs) {
var result,
dummy,
start,
i;
// The dummy has to return something,
// or it'll get insanely optimized
dummy = Function('return 1');
// Call dummy now to get it jitted
dummy();
start = Blast.performanceNow();
for (i = 0; i < runs; i++) {
dumm... | javascript | function getFunctionOverhead(runs) {
var result,
dummy,
start,
i;
// The dummy has to return something,
// or it'll get insanely optimized
dummy = Function('return 1');
// Call dummy now to get it jitted
dummy();
start = Blast.performanceNow();
for (i = 0; i < runs; i++) {
dumm... | [
"function",
"getFunctionOverhead",
"(",
"runs",
")",
"{",
"var",
"result",
",",
"dummy",
",",
"start",
",",
"i",
";",
"// The dummy has to return something,",
"// or it'll get insanely optimized",
"dummy",
"=",
"Function",
"(",
"'return 1'",
")",
";",
"// Call dummy n... | This function determines the ms overhead cost of calling a
function the given amount of time
@author Jelle De Loecker <jelle@develry.be>
@since 0.1.2
@version 0.5.4
@param {Number} runs | [
"This",
"function",
"determines",
"the",
"ms",
"overhead",
"cost",
"of",
"calling",
"a",
"function",
"the",
"given",
"amount",
"of",
"time"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/benchmark.js#L103-L131 |
39,920 | skerit/protoblast | lib/benchmark.js | doSyncBench | function doSyncBench(fn, callback) {
var start,
fnOverhead,
pretotal,
result,
runs,
name;
runs = 0;
// For the initial test, to determine how many iterations we should
// test later, we just use Date.now()
start = Date.now();
// See how many times we can get it to run for 5... | javascript | function doSyncBench(fn, callback) {
var start,
fnOverhead,
pretotal,
result,
runs,
name;
runs = 0;
// For the initial test, to determine how many iterations we should
// test later, we just use Date.now()
start = Date.now();
// See how many times we can get it to run for 5... | [
"function",
"doSyncBench",
"(",
"fn",
",",
"callback",
")",
"{",
"var",
"start",
",",
"fnOverhead",
",",
"pretotal",
",",
"result",
",",
"runs",
",",
"name",
";",
"runs",
"=",
"0",
";",
"// For the initial test, to determine how many iterations we should",
"// tes... | Function that sets up the synchronous benchmark
@author Jelle De Loecker <jelle@develry.be>
@since 0.1.2
@version 0.1.2
@param {Function} fn
@param {Function} callback
@return {Object} | [
"Function",
"that",
"sets",
"up",
"the",
"synchronous",
"benchmark"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/benchmark.js#L302-L342 |
39,921 | skerit/protoblast | lib/benchmark.js | doAsyncBench | function doAsyncBench(fn, callback) {
var fnOverhead,
pretotal,
result,
args,
i;
if (benchRunning > 0) {
// Keep function optimized by not leaking the `arguments` object
args = new Array(arguments.length);
for (i = 0; i < args.length; i++) args[i] = arguments[i];
benchQueue.p... | javascript | function doAsyncBench(fn, callback) {
var fnOverhead,
pretotal,
result,
args,
i;
if (benchRunning > 0) {
// Keep function optimized by not leaking the `arguments` object
args = new Array(arguments.length);
for (i = 0; i < args.length; i++) args[i] = arguments[i];
benchQueue.p... | [
"function",
"doAsyncBench",
"(",
"fn",
",",
"callback",
")",
"{",
"var",
"fnOverhead",
",",
"pretotal",
",",
"result",
",",
"args",
",",
"i",
";",
"if",
"(",
"benchRunning",
">",
"0",
")",
"{",
"// Keep function optimized by not leaking the `arguments` object",
... | Function that sets up the asynchronous benchmark
@author Jelle De Loecker <jelle@develry.be>
@since 0.1.2
@version 0.6.0
@param {Function} fn
@param {Function} callback
@return {Object} | [
"Function",
"that",
"sets",
"up",
"the",
"asynchronous",
"benchmark"
] | 22f35b05611bd507d380782023179a3f6ec383ae | https://github.com/skerit/protoblast/blob/22f35b05611bd507d380782023179a3f6ec383ae/lib/benchmark.js#L359-L415 |
39,922 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js | WhileStatement | function WhileStatement(node, print) {
this.keyword("while");
this.push("(");
print.plain(node.test);
this.push(")");
print.block(node.body);
} | javascript | function WhileStatement(node, print) {
this.keyword("while");
this.push("(");
print.plain(node.test);
this.push(")");
print.block(node.body);
} | [
"function",
"WhileStatement",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"keyword",
"(",
"\"while\"",
")",
";",
"this",
".",
"push",
"(",
"\"(\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"test",
")",
";",
"this",
".",
"push",
"(",... | Prints WhileStatement, prints test and body. | [
"Prints",
"WhileStatement",
"prints",
"test",
"and",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js#L99-L105 |
39,923 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js | buildForXStatement | function buildForXStatement(op) {
return function (node, print) {
this.keyword("for");
this.push("(");
print.plain(node.left);
this.push(" " + op + " ");
print.plain(node.right);
this.push(")");
print.block(node.body);
};
} | javascript | function buildForXStatement(op) {
return function (node, print) {
this.keyword("for");
this.push("(");
print.plain(node.left);
this.push(" " + op + " ");
print.plain(node.right);
this.push(")");
print.block(node.body);
};
} | [
"function",
"buildForXStatement",
"(",
"op",
")",
"{",
"return",
"function",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"keyword",
"(",
"\"for\"",
")",
";",
"this",
".",
"push",
"(",
"\"(\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
... | Builds ForIn or ForOf statement printers.
Prints left, right, and body. | [
"Builds",
"ForIn",
"or",
"ForOf",
"statement",
"printers",
".",
"Prints",
"left",
"right",
"and",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js#L112-L122 |
39,924 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js | CatchClause | function CatchClause(node, print) {
this.keyword("catch");
this.push("(");
print.plain(node.param);
this.push(") ");
print.plain(node.body);
} | javascript | function CatchClause(node, print) {
this.keyword("catch");
this.push("(");
print.plain(node.param);
this.push(") ");
print.plain(node.body);
} | [
"function",
"CatchClause",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"keyword",
"(",
"\"catch\"",
")",
";",
"this",
".",
"push",
"(",
"\"(\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"param",
")",
";",
"this",
".",
"push",
"(",
... | Prints CatchClause, prints param and body. | [
"Prints",
"CatchClause",
"prints",
"param",
"and",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js#L222-L228 |
39,925 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js | SwitchStatement | function SwitchStatement(node, print) {
this.keyword("switch");
this.push("(");
print.plain(node.discriminant);
this.push(")");
this.space();
this.push("{");
print.sequence(node.cases, {
indent: true,
addNewlines: function addNewlines(leading, cas) {
if (!leading && node.cases[node.cases.le... | javascript | function SwitchStatement(node, print) {
this.keyword("switch");
this.push("(");
print.plain(node.discriminant);
this.push(")");
this.space();
this.push("{");
print.sequence(node.cases, {
indent: true,
addNewlines: function addNewlines(leading, cas) {
if (!leading && node.cases[node.cases.le... | [
"function",
"SwitchStatement",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"keyword",
"(",
"\"switch\"",
")",
";",
"this",
".",
"push",
"(",
"\"(\"",
")",
";",
"print",
".",
"plain",
"(",
"node",
".",
"discriminant",
")",
";",
"this",
".",
"pus... | Prints SwitchStatement, prints discriminant and cases. | [
"Prints",
"SwitchStatement",
"prints",
"discriminant",
"and",
"cases",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/statements.js#L234-L250 |
39,926 | EikosPartners/scalejs | dist/scalejs.base.object.js | has | function has(object) {
// The intent of this method is to replace unsafe tests relying on type
// coercion for optional arguments or obj properties:
// | function on(event,options){
// | options = options || {}; // type coercion
// | if (!event || !event.data || !event.data.value){
// | ... | javascript | function has(object) {
// The intent of this method is to replace unsafe tests relying on type
// coercion for optional arguments or obj properties:
// | function on(event,options){
// | options = options || {}; // type coercion
// | if (!event || !event.data || !event.data.value){
// | ... | [
"function",
"has",
"(",
"object",
")",
"{",
"// The intent of this method is to replace unsafe tests relying on type",
"// coercion for optional arguments or obj properties:",
"// | function on(event,options){",
"// | options = options || {}; // type coercion",
"// | if (!event || !event.dat... | Determines if an object exists and if it does checks that each in
the chain of properties also exist
@param {Object|Any} obj object to test
@param {String} [prop...] property chain of the object to test
@memberOf object
@return {Boolean} if the object 'has' (see inline documentation) | [
"Determines",
"if",
"an",
"object",
"exists",
"and",
"if",
"it",
"does",
"checks",
"that",
"each",
"in",
"the",
"chain",
"of",
"properties",
"also",
"exist"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.object.js#L33-L81 |
39,927 | EikosPartners/scalejs | dist/scalejs.base.object.js | extend | function extend(receiver, extension, path) {
var props = has(path) ? path.split('.') : [],
target = receiver,
i; // iterative variable
for (i = 0; i < props.length; i += 1) {
if (!has(target, props[i])) {
target[props[i]] = {};
}
target = target[props[i]];
... | javascript | function extend(receiver, extension, path) {
var props = has(path) ? path.split('.') : [],
target = receiver,
i; // iterative variable
for (i = 0; i < props.length; i += 1) {
if (!has(target, props[i])) {
target[props[i]] = {};
}
target = target[props[i]];
... | [
"function",
"extend",
"(",
"receiver",
",",
"extension",
",",
"path",
")",
"{",
"var",
"props",
"=",
"has",
"(",
"path",
")",
"?",
"path",
".",
"split",
"(",
"'.'",
")",
":",
"[",
"]",
",",
"target",
"=",
"receiver",
",",
"i",
";",
"// iterative va... | Extends the extension into the reciever
@param {Object} reciever object into which to extend
@param {Object} extension object from which to extend
@param {String} [path] followed on the reciever before executing
the extend (form: "obj.obj.obj")
@memberOf object
@return the extended object (after having followed th... | [
"Extends",
"the",
"extension",
"into",
"the",
"reciever"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.object.js#L149-L164 |
39,928 | EikosPartners/scalejs | dist/scalejs.base.object.js | get | function get(o, path, defaultValue) {
var props = path.split('.'),
i,
// iterative variable
p,
// current property
success = true;
for (i = 0; i < props.length; i += 1) {
p = props[i];
if (has(o, p)) {
o = o[p];
} else {
success = ... | javascript | function get(o, path, defaultValue) {
var props = path.split('.'),
i,
// iterative variable
p,
// current property
success = true;
for (i = 0; i < props.length; i += 1) {
p = props[i];
if (has(o, p)) {
o = o[p];
} else {
success = ... | [
"function",
"get",
"(",
"o",
",",
"path",
",",
"defaultValue",
")",
"{",
"var",
"props",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
",",
"i",
",",
"// iterative variable",
"p",
",",
"// current property",
"success",
"=",
"true",
";",
"for",
"(",
"i",
... | Obtains a value from an object following a path with the option to
return a default value if that object was not found
@param {Object} o object in which to look for the specified path
@param {String} path string representing the chain of properties to
to be followed (form: "obj.obj.obj")
@param {Any} [defaultVal... | [
"Obtains",
"a",
"value",
"from",
"an",
"object",
"following",
"a",
"path",
"with",
"the",
"option",
"to",
"return",
"a",
"default",
"value",
"if",
"that",
"object",
"was",
"not",
"found"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.object.js#L179-L198 |
39,929 | EikosPartners/scalejs | dist/scalejs.base.object.js | stringify | function stringify(obj) {
var cache = [];
return JSON.stringify(obj, function (key, value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return '[Circular]';
}
... | javascript | function stringify(obj) {
var cache = [];
return JSON.stringify(obj, function (key, value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return '[Circular]';
}
... | [
"function",
"stringify",
"(",
"obj",
")",
"{",
"var",
"cache",
"=",
"[",
"]",
";",
"return",
"JSON",
".",
"stringify",
"(",
"obj",
",",
"function",
"(",
"key",
",",
"value",
")",
"{",
"if",
"(",
"(",
"typeof",
"value",
"===",
"'undefined'",
"?",
"'... | Stringifies an object without the chance for circular error
@param {Object} obj object to stringify
@memberOf object
@return {String} string form of the passed object | [
"Stringifies",
"an",
"object",
"without",
"the",
"chance",
"for",
"circular",
"error"
] | 115d0eac1a90aebb54f50485ed92de25165f9c30 | https://github.com/EikosPartners/scalejs/blob/115d0eac1a90aebb54f50485ed92de25165f9c30/dist/scalejs.base.object.js#L219-L231 |
39,930 | SuperheroUI/shCore | src/util/get-class-names.js | getClassNames | function getClassNames(classObject) {
var classNames = [];
for (var key in classObject) {
if (classObject.hasOwnProperty(key)) {
let check = classObject[key];
let className = _.kebabCase(key);
if (_.isFunction(check)) {
if (check()) {
... | javascript | function getClassNames(classObject) {
var classNames = [];
for (var key in classObject) {
if (classObject.hasOwnProperty(key)) {
let check = classObject[key];
let className = _.kebabCase(key);
if (_.isFunction(check)) {
if (check()) {
... | [
"function",
"getClassNames",
"(",
"classObject",
")",
"{",
"var",
"classNames",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"key",
"in",
"classObject",
")",
"{",
"if",
"(",
"classObject",
".",
"hasOwnProperty",
"(",
"key",
")",
")",
"{",
"let",
"check",
"="... | Get a string of classNames from the object passed in. Uses the keys for class names and only adds them if the value is true. Value of keys can be boolean, function, or strings. Functions are evaluated on call. Strings are appended to end of key.
@param {object} classObject Object containing keys of class names.
@retur... | [
"Get",
"a",
"string",
"of",
"classNames",
"from",
"the",
"object",
"passed",
"in",
".",
"Uses",
"the",
"keys",
"for",
"class",
"names",
"and",
"only",
"adds",
"them",
"if",
"the",
"value",
"is",
"true",
".",
"Value",
"of",
"keys",
"can",
"be",
"boolean... | d92e2094a00e1148a5790cd928af70428524fb34 | https://github.com/SuperheroUI/shCore/blob/d92e2094a00e1148a5790cd928af70428524fb34/src/util/get-class-names.js#L9-L35 |
39,931 | dreampiggy/functional.js | Retroactive/lib/data_structures/double_linked_list.js | function (data){
//create a new item object, place data in
var node = {
data: data,
next: null,
prev: null
};
//special case: no items in the list yet
if (this._length == 0) {
this._head = node;
... | javascript | function (data){
//create a new item object, place data in
var node = {
data: data,
next: null,
prev: null
};
//special case: no items in the list yet
if (this._length == 0) {
this._head = node;
... | [
"function",
"(",
"data",
")",
"{",
"//create a new item object, place data in",
"var",
"node",
"=",
"{",
"data",
":",
"data",
",",
"next",
":",
"null",
",",
"prev",
":",
"null",
"}",
";",
"//special case: no items in the list yet",
"if",
"(",
"this",
".",
"_le... | Appends some data to the end of the list. This method traverses
the existing list and places the value at the end in a new item.
@param {variant} data The data to add to the list.
@return {Void}
@method add | [
"Appends",
"some",
"data",
"to",
"the",
"end",
"of",
"the",
"list",
".",
"This",
"method",
"traverses",
"the",
"existing",
"list",
"and",
"places",
"the",
"value",
"at",
"the",
"end",
"in",
"a",
"new",
"item",
"."
] | ec7b7213de7965659a8a1e8fa61438e3ae564260 | https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/double_linked_list.js#L40-L64 | |
39,932 | dreampiggy/functional.js | Retroactive/lib/data_structures/double_linked_list.js | function(index){
//check for out-of-bounds values
if (index > -1 && index < this._length){
var current = this._head,
i = 0;
while(i++ < index){
current = current.next;
}
return curr... | javascript | function(index){
//check for out-of-bounds values
if (index > -1 && index < this._length){
var current = this._head,
i = 0;
while(i++ < index){
current = current.next;
}
return curr... | [
"function",
"(",
"index",
")",
"{",
"//check for out-of-bounds values",
"if",
"(",
"index",
">",
"-",
"1",
"&&",
"index",
"<",
"this",
".",
"_length",
")",
"{",
"var",
"current",
"=",
"this",
".",
"_head",
",",
"i",
"=",
"0",
";",
"while",
"(",
"i",
... | Retrieves the data in the given position in the list.
@param {int} index The zero-based index of the item whose value
should be returned.
@return {variant} The value in the "data" portion of the given item
or null if the item doesn't exist.
@method item | [
"Retrieves",
"the",
"data",
"in",
"the",
"given",
"position",
"in",
"the",
"list",
"."
] | ec7b7213de7965659a8a1e8fa61438e3ae564260 | https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/double_linked_list.js#L74-L89 | |
39,933 | dreampiggy/functional.js | Retroactive/lib/data_structures/double_linked_list.js | function(start, end){
//subQueue to Array
if(start >= 0 && start < end && end <= this._length) {
var result = [],
current = this._head,
i = 0;
while(i++ < start) {
current = current.next;
}
while(start++ < e... | javascript | function(start, end){
//subQueue to Array
if(start >= 0 && start < end && end <= this._length) {
var result = [],
current = this._head,
i = 0;
while(i++ < start) {
current = current.next;
}
while(start++ < e... | [
"function",
"(",
"start",
",",
"end",
")",
"{",
"//subQueue to Array",
"if",
"(",
"start",
">=",
"0",
"&&",
"start",
"<",
"end",
"&&",
"end",
"<=",
"this",
".",
"_length",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"current",
"=",
"this",
".",
... | Converts the list into an array.
@return {Array} An array containing all of the data in the list.
@method toArray | [
"Converts",
"the",
"list",
"into",
"an",
"array",
"."
] | ec7b7213de7965659a8a1e8fa61438e3ae564260 | https://github.com/dreampiggy/functional.js/blob/ec7b7213de7965659a8a1e8fa61438e3ae564260/Retroactive/lib/data_structures/double_linked_list.js#L167-L197 | |
39,934 | noderaider/repackage | jspm_packages/system-polyfills.src.js | formatError | function formatError(e) {
var s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);
return e instanceof Error ? s : s + ' (WARNING: non-Error used)';
} | javascript | function formatError(e) {
var s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);
return e instanceof Error ? s : s + ' (WARNING: non-Error used)';
} | [
"function",
"formatError",
"(",
"e",
")",
"{",
"var",
"s",
"=",
"typeof",
"e",
"===",
"'object'",
"&&",
"e",
"!==",
"null",
"&&",
"(",
"e",
".",
"stack",
"||",
"e",
".",
"message",
")",
"?",
"e",
".",
"stack",
"||",
"e",
".",
"message",
":",
"f... | Format an error into a string. If e is an Error and has a stack property,
it's returned. Otherwise, e is formatted using formatObject, with a
warning added about e not being a proper Error.
@param {*} e
@returns {String} formatted string, suitable for output to developers | [
"Format",
"an",
"error",
"into",
"a",
"string",
".",
"If",
"e",
"is",
"an",
"Error",
"and",
"has",
"a",
"stack",
"property",
"it",
"s",
"returned",
".",
"Otherwise",
"e",
"is",
"formatted",
"using",
"formatObject",
"with",
"a",
"warning",
"added",
"about... | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L306-L309 |
39,935 | noderaider/repackage | jspm_packages/system-polyfills.src.js | formatObject | function formatObject(o) {
var s = String(o);
if(s === '[object Object]' && typeof JSON !== 'undefined') {
s = tryStringify(o, s);
}
return s;
} | javascript | function formatObject(o) {
var s = String(o);
if(s === '[object Object]' && typeof JSON !== 'undefined') {
s = tryStringify(o, s);
}
return s;
} | [
"function",
"formatObject",
"(",
"o",
")",
"{",
"var",
"s",
"=",
"String",
"(",
"o",
")",
";",
"if",
"(",
"s",
"===",
"'[object Object]'",
"&&",
"typeof",
"JSON",
"!==",
"'undefined'",
")",
"{",
"s",
"=",
"tryStringify",
"(",
"o",
",",
"s",
")",
";... | Format an object, detecting "plain" objects and running them through
JSON.stringify if possible.
@param {Object} o
@returns {string} | [
"Format",
"an",
"object",
"detecting",
"plain",
"objects",
"and",
"running",
"them",
"through",
"JSON",
".",
"stringify",
"if",
"possible",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L317-L323 |
39,936 | noderaider/repackage | jspm_packages/system-polyfills.src.js | init | function init(resolver) {
var handler = new Pending();
try {
resolver(promiseResolve, promiseReject, promiseNotify);
} catch (e) {
promiseReject(e);
}
return handler;
/**
* Transition from pre-resolution state to post-resolution state, notifying
* all listeners of the ultimate fulfi... | javascript | function init(resolver) {
var handler = new Pending();
try {
resolver(promiseResolve, promiseReject, promiseNotify);
} catch (e) {
promiseReject(e);
}
return handler;
/**
* Transition from pre-resolution state to post-resolution state, notifying
* all listeners of the ultimate fulfi... | [
"function",
"init",
"(",
"resolver",
")",
"{",
"var",
"handler",
"=",
"new",
"Pending",
"(",
")",
";",
"try",
"{",
"resolver",
"(",
"promiseResolve",
",",
"promiseReject",
",",
"promiseNotify",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"promiseReject",... | Run the supplied resolver
@param resolver
@returns {Pending} | [
"Run",
"the",
"supplied",
"resolver"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L378-L414 |
39,937 | noderaider/repackage | jspm_packages/system-polyfills.src.js | resolve | function resolve(x) {
return isPromise(x) ? x
: new Promise(Handler, new Async(getHandler(x)));
} | javascript | function resolve(x) {
return isPromise(x) ? x
: new Promise(Handler, new Async(getHandler(x)));
} | [
"function",
"resolve",
"(",
"x",
")",
"{",
"return",
"isPromise",
"(",
"x",
")",
"?",
"x",
":",
"new",
"Promise",
"(",
"Handler",
",",
"new",
"Async",
"(",
"getHandler",
"(",
"x",
")",
")",
")",
";",
"}"
] | Returns a trusted promise. If x is already a trusted promise, it is
returned, otherwise returns a new trusted Promise which follows x.
@param {*} x
@return {Promise} promise | [
"Returns",
"a",
"trusted",
"promise",
".",
"If",
"x",
"is",
"already",
"a",
"trusted",
"promise",
"it",
"is",
"returned",
"otherwise",
"returns",
"a",
"new",
"trusted",
"Promise",
"which",
"follows",
"x",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L431-L434 |
39,938 | noderaider/repackage | jspm_packages/system-polyfills.src.js | race | function race(promises) {
if(typeof promises !== 'object' || promises === null) {
return reject(new TypeError('non-iterable passed to race()'));
}
// Sigh, race([]) is untestable unless we return *something*
// that is recognizable without calling .then() on it.
return promises.length === 0 ? never(... | javascript | function race(promises) {
if(typeof promises !== 'object' || promises === null) {
return reject(new TypeError('non-iterable passed to race()'));
}
// Sigh, race([]) is untestable unless we return *something*
// that is recognizable without calling .then() on it.
return promises.length === 0 ? never(... | [
"function",
"race",
"(",
"promises",
")",
"{",
"if",
"(",
"typeof",
"promises",
"!==",
"'object'",
"||",
"promises",
"===",
"null",
")",
"{",
"return",
"reject",
"(",
"new",
"TypeError",
"(",
"'non-iterable passed to race()'",
")",
")",
";",
"}",
"// Sigh, r... | Fulfill-reject competitive race. Return a promise that will settle
to the same state as the earliest input promise to settle.
WARNING: The ES6 Promise spec requires that race()ing an empty array
must return a promise that is pending forever. This implementation
returns a singleton forever-pending promise, the same si... | [
"Fulfill",
"-",
"reject",
"competitive",
"race",
".",
"Return",
"a",
"promise",
"that",
"will",
"settle",
"to",
"the",
"same",
"state",
"as",
"the",
"earliest",
"input",
"promise",
"to",
"settle",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L634-L644 |
39,939 | noderaider/repackage | jspm_packages/system-polyfills.src.js | getHandler | function getHandler(x) {
if(isPromise(x)) {
return x._handler.join();
}
return maybeThenable(x) ? getHandlerUntrusted(x) : new Fulfilled(x);
} | javascript | function getHandler(x) {
if(isPromise(x)) {
return x._handler.join();
}
return maybeThenable(x) ? getHandlerUntrusted(x) : new Fulfilled(x);
} | [
"function",
"getHandler",
"(",
"x",
")",
"{",
"if",
"(",
"isPromise",
"(",
"x",
")",
")",
"{",
"return",
"x",
".",
"_handler",
".",
"join",
"(",
")",
";",
"}",
"return",
"maybeThenable",
"(",
"x",
")",
"?",
"getHandlerUntrusted",
"(",
"x",
")",
":"... | Promise internals Below this, everything is @private
Get an appropriate handler for x, without checking for cycles
@param {*} x
@returns {object} handler | [
"Promise",
"internals",
"Below",
"this",
"everything",
"is"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L675-L680 |
39,940 | noderaider/repackage | jspm_packages/system-polyfills.src.js | getHandlerUntrusted | function getHandlerUntrusted(x) {
try {
var untrustedThen = x.then;
return typeof untrustedThen === 'function'
? new Thenable(untrustedThen, x)
: new Fulfilled(x);
} catch(e) {
return new Rejected(e);
}
} | javascript | function getHandlerUntrusted(x) {
try {
var untrustedThen = x.then;
return typeof untrustedThen === 'function'
? new Thenable(untrustedThen, x)
: new Fulfilled(x);
} catch(e) {
return new Rejected(e);
}
} | [
"function",
"getHandlerUntrusted",
"(",
"x",
")",
"{",
"try",
"{",
"var",
"untrustedThen",
"=",
"x",
".",
"then",
";",
"return",
"typeof",
"untrustedThen",
"===",
"'function'",
"?",
"new",
"Thenable",
"(",
"untrustedThen",
",",
"x",
")",
":",
"new",
"Fulfi... | Get a handler for potentially untrusted thenable x
@param {*} x
@returns {object} handler | [
"Get",
"a",
"handler",
"for",
"potentially",
"untrusted",
"thenable",
"x"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L697-L706 |
39,941 | noderaider/repackage | jspm_packages/system-polyfills.src.js | Pending | function Pending(receiver, inheritedContext) {
Promise.createContext(this, inheritedContext);
this.consumers = void 0;
this.receiver = receiver;
this.handler = void 0;
this.resolved = false;
} | javascript | function Pending(receiver, inheritedContext) {
Promise.createContext(this, inheritedContext);
this.consumers = void 0;
this.receiver = receiver;
this.handler = void 0;
this.resolved = false;
} | [
"function",
"Pending",
"(",
"receiver",
",",
"inheritedContext",
")",
"{",
"Promise",
".",
"createContext",
"(",
"this",
",",
"inheritedContext",
")",
";",
"this",
".",
"consumers",
"=",
"void",
"0",
";",
"this",
".",
"receiver",
"=",
"receiver",
";",
"thi... | Handler that manages a queue of consumers waiting on a pending promise
@constructor | [
"Handler",
"that",
"manages",
"a",
"queue",
"of",
"consumers",
"waiting",
"on",
"a",
"pending",
"promise"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L777-L784 |
39,942 | noderaider/repackage | jspm_packages/system-polyfills.src.js | Thenable | function Thenable(then, thenable) {
Pending.call(this);
tasks.enqueue(new AssimilateTask(then, thenable, this));
} | javascript | function Thenable(then, thenable) {
Pending.call(this);
tasks.enqueue(new AssimilateTask(then, thenable, this));
} | [
"function",
"Thenable",
"(",
"then",
",",
"thenable",
")",
"{",
"Pending",
".",
"call",
"(",
"this",
")",
";",
"tasks",
".",
"enqueue",
"(",
"new",
"AssimilateTask",
"(",
"then",
",",
"thenable",
",",
"this",
")",
")",
";",
"}"
] | Handler that wraps an untrusted thenable and assimilates it in a future stack
@param {function} then
@param {{then: function}} thenable
@constructor | [
"Handler",
"that",
"wraps",
"an",
"untrusted",
"thenable",
"and",
"assimilates",
"it",
"in",
"a",
"future",
"stack"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L909-L912 |
39,943 | noderaider/repackage | jspm_packages/system-polyfills.src.js | Rejected | function Rejected(x) {
Promise.createContext(this);
this.id = ++errorId;
this.value = x;
this.handled = false;
this.reported = false;
this._report();
} | javascript | function Rejected(x) {
Promise.createContext(this);
this.id = ++errorId;
this.value = x;
this.handled = false;
this.reported = false;
this._report();
} | [
"function",
"Rejected",
"(",
"x",
")",
"{",
"Promise",
".",
"createContext",
"(",
"this",
")",
";",
"this",
".",
"id",
"=",
"++",
"errorId",
";",
"this",
".",
"value",
"=",
"x",
";",
"this",
".",
"handled",
"=",
"false",
";",
"this",
".",
"reported... | Handler for a rejected promise
@param {*} x rejection reason
@constructor | [
"Handler",
"for",
"a",
"rejected",
"promise"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L945-L954 |
39,944 | noderaider/repackage | jspm_packages/system-polyfills.src.js | AssimilateTask | function AssimilateTask(then, thenable, resolver) {
this._then = then;
this.thenable = thenable;
this.resolver = resolver;
} | javascript | function AssimilateTask(then, thenable, resolver) {
this._then = then;
this.thenable = thenable;
this.resolver = resolver;
} | [
"function",
"AssimilateTask",
"(",
"then",
",",
"thenable",
",",
"resolver",
")",
"{",
"this",
".",
"_then",
"=",
"then",
";",
"this",
".",
"thenable",
"=",
"thenable",
";",
"this",
".",
"resolver",
"=",
"resolver",
";",
"}"
] | Assimilate a thenable, sending it's value to resolver
@param {function} then
@param {object|function} thenable
@param {object} resolver
@constructor | [
"Assimilate",
"a",
"thenable",
"sending",
"it",
"s",
"value",
"to",
"resolver"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L1076-L1080 |
39,945 | noderaider/repackage | jspm_packages/system-polyfills.src.js | Fold | function Fold(f, z, c, to) {
this.f = f; this.z = z; this.c = c; this.to = to;
this.resolver = failIfRejected;
this.receiver = this;
} | javascript | function Fold(f, z, c, to) {
this.f = f; this.z = z; this.c = c; this.to = to;
this.resolver = failIfRejected;
this.receiver = this;
} | [
"function",
"Fold",
"(",
"f",
",",
"z",
",",
"c",
",",
"to",
")",
"{",
"this",
".",
"f",
"=",
"f",
";",
"this",
".",
"z",
"=",
"z",
";",
"this",
".",
"c",
"=",
"c",
";",
"this",
".",
"to",
"=",
"to",
";",
"this",
".",
"resolver",
"=",
"... | Fold a handler value with z
@constructor | [
"Fold",
"a",
"handler",
"value",
"with",
"z"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L1103-L1107 |
39,946 | noderaider/repackage | jspm_packages/system-polyfills.src.js | tryCatchReject3 | function tryCatchReject3(f, x, y, thisArg, next) {
try {
f.call(thisArg, x, y, next);
} catch(e) {
next.become(new Rejected(e));
}
} | javascript | function tryCatchReject3(f, x, y, thisArg, next) {
try {
f.call(thisArg, x, y, next);
} catch(e) {
next.become(new Rejected(e));
}
} | [
"function",
"tryCatchReject3",
"(",
"f",
",",
"x",
",",
"y",
",",
"thisArg",
",",
"next",
")",
"{",
"try",
"{",
"f",
".",
"call",
"(",
"thisArg",
",",
"x",
",",
"y",
",",
"next",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"next",
".",
"becom... | Same as above, but includes the extra argument parameter. | [
"Same",
"as",
"above",
"but",
"includes",
"the",
"extra",
"argument",
"parameter",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-polyfills.src.js#L1197-L1203 |
39,947 | stackgl/gl-mat2 | copy.js | copy | function copy(out, a) {
out[0] = a[0]
out[1] = a[1]
out[2] = a[2]
out[3] = a[3]
return out
} | javascript | function copy(out, a) {
out[0] = a[0]
out[1] = a[1]
out[2] = a[2]
out[3] = a[3]
return out
} | [
"function",
"copy",
"(",
"out",
",",
"a",
")",
"{",
"out",
"[",
"0",
"]",
"=",
"a",
"[",
"0",
"]",
"out",
"[",
"1",
"]",
"=",
"a",
"[",
"1",
"]",
"out",
"[",
"2",
"]",
"=",
"a",
"[",
"2",
"]",
"out",
"[",
"3",
"]",
"=",
"a",
"[",
"3... | Copy the values from one mat2 to another
@alias mat2.copy
@param {mat2} out the receiving matrix
@param {mat2} a the source matrix
@returns {mat2} out | [
"Copy",
"the",
"values",
"from",
"one",
"mat2",
"to",
"another"
] | d6a04d55d605150240dc8e57ca7d2821aaa23c56 | https://github.com/stackgl/gl-mat2/blob/d6a04d55d605150240dc8e57ca7d2821aaa23c56/copy.js#L11-L17 |
39,948 | rm-rf-etc/encore | internal/e_controllers.js | RESTController | function RESTController(i,o,a,r){
var fn
for (var j=0; j < RESTController.filters.length; j++) {
fn = RESTController.filters[j]
if (typeof fn === 'function')
fn(i,o,a,r)
}
fn = RESTController[i.method.toLowerCase()]
if (fn)
fn(... | javascript | function RESTController(i,o,a,r){
var fn
for (var j=0; j < RESTController.filters.length; j++) {
fn = RESTController.filters[j]
if (typeof fn === 'function')
fn(i,o,a,r)
}
fn = RESTController[i.method.toLowerCase()]
if (fn)
fn(... | [
"function",
"RESTController",
"(",
"i",
",",
"o",
",",
"a",
",",
"r",
")",
"{",
"var",
"fn",
"for",
"(",
"var",
"j",
"=",
"0",
";",
"j",
"<",
"RESTController",
".",
"filters",
".",
"length",
";",
"j",
"++",
")",
"{",
"fn",
"=",
"RESTController",
... | var self = this | [
"var",
"self",
"=",
"this"
] | 09262df0bd85dc3378c765d1d18e9621c248ccb4 | https://github.com/rm-rf-etc/encore/blob/09262df0bd85dc3378c765d1d18e9621c248ccb4/internal/e_controllers.js#L5-L18 |
39,949 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function(element, options) {
var $el = $(element);
// React on every server/socket.io message.
// If the element is defined with a data-react-on-event attribute
// we take that as an eventType the user wants to be warned on this
// element and we forward the event via jQuery events on $(this).
... | javascript | function(element, options) {
var $el = $(element);
// React on every server/socket.io message.
// If the element is defined with a data-react-on-event attribute
// we take that as an eventType the user wants to be warned on this
// element and we forward the event via jQuery events on $(this).
... | [
"function",
"(",
"element",
",",
"options",
")",
"{",
"var",
"$el",
"=",
"$",
"(",
"element",
")",
";",
"// React on every server/socket.io message.",
"// If the element is defined with a data-react-on-event attribute",
"// we take that as an eventType the user wants to be warned o... | Initializes an element to give it the functionality
provided by the myelements library
@param {HTMLElement} element. the element to initialize
@param {Object} options. options for initReactOnDataupdate,
initReactOnUserInput and initReactOnMessage. | [
"Initializes",
"an",
"element",
"to",
"give",
"it",
"the",
"functionality",
"provided",
"by",
"the",
"myelements",
"library"
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L111-L157 | |
39,950 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function(el, data) {
var dataupdateScope = $(el).data().reactOnDataupdate;
var templateScope = $(el).data().templateScope;
var userinputScope = $(el).data().reactOnUserinput;
if (data) {
$myelements.doRender(el, data);
} else if (!data && templateScope) {
$myelements.recoverTemplateScope... | javascript | function(el, data) {
var dataupdateScope = $(el).data().reactOnDataupdate;
var templateScope = $(el).data().templateScope;
var userinputScope = $(el).data().reactOnUserinput;
if (data) {
$myelements.doRender(el, data);
} else if (!data && templateScope) {
$myelements.recoverTemplateScope... | [
"function",
"(",
"el",
",",
"data",
")",
"{",
"var",
"dataupdateScope",
"=",
"$",
"(",
"el",
")",
".",
"data",
"(",
")",
".",
"reactOnDataupdate",
";",
"var",
"templateScope",
"=",
"$",
"(",
"el",
")",
".",
"data",
"(",
")",
".",
"templateScope",
"... | Updates the data associated to an element trying to re-render the template
associated to the element.
with the values from 'data' as scope.
If data is empty, it tries to load data for this element
from browser storage (indexedDB/localStorage).
@param {HTMLElement} el. The element the update affects.
@param {Object} d... | [
"Updates",
"the",
"data",
"associated",
"to",
"an",
"element",
"trying",
"to",
"re",
"-",
"render",
"the",
"template",
"associated",
"to",
"the",
"element",
".",
"with",
"the",
"values",
"from",
"data",
"as",
"scope",
"."
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L170-L185 | |
39,951 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function(el, scope) {
var tplScopeObject = {};
$myelements.debug("Trying to update Element Scope without data from scope: %s", scope);
// If no data is passed
// we look up in localstorage
$myelements.localDataForElement(el, scope, function onLocalDataForElement(err, data) {
if (err) {
... | javascript | function(el, scope) {
var tplScopeObject = {};
$myelements.debug("Trying to update Element Scope without data from scope: %s", scope);
// If no data is passed
// we look up in localstorage
$myelements.localDataForElement(el, scope, function onLocalDataForElement(err, data) {
if (err) {
... | [
"function",
"(",
"el",
",",
"scope",
")",
"{",
"var",
"tplScopeObject",
"=",
"{",
"}",
";",
"$myelements",
".",
"debug",
"(",
"\"Trying to update Element Scope without data from scope: %s\"",
",",
"scope",
")",
";",
"// If no data is passed",
"// we look up in localstor... | Recovers and element's event scope from browser storage.
@param {HTMLElement} el. The element you are trying to recover the scope from.
@param {String} scope. The scope name to recover. | [
"Recovers",
"and",
"element",
"s",
"event",
"scope",
"from",
"browser",
"storage",
"."
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L192-L210 | |
39,952 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function(el, data, done) {
if (!el.template) {
$myelements.debug("Creating EJS template from innerHTML for element: ", el);
// Save the compiled template only once
try {
el.template = new EJS({
element: el
});
} catch (e) {
console.error("myelements.jquery... | javascript | function(el, data, done) {
if (!el.template) {
$myelements.debug("Creating EJS template from innerHTML for element: ", el);
// Save the compiled template only once
try {
el.template = new EJS({
element: el
});
} catch (e) {
console.error("myelements.jquery... | [
"function",
"(",
"el",
",",
"data",
",",
"done",
")",
"{",
"if",
"(",
"!",
"el",
".",
"template",
")",
"{",
"$myelements",
".",
"debug",
"(",
"\"Creating EJS template from innerHTML for element: \"",
",",
"el",
")",
";",
"// Save the compiled template only once",
... | Re render the element template. It saves it because
on every render, the EJS tags get dumped, so we compile
the template only once.
@param {HTMLElement} el
@param {Object} scope data to be passed to the EJS template render.
@param {Function} done called when rendering is done
- {Error} err. Null if nothing bad happene... | [
"Re",
"render",
"the",
"element",
"template",
".",
"It",
"saves",
"it",
"because",
"on",
"every",
"render",
"the",
"EJS",
"tags",
"get",
"dumped",
"so",
"we",
"compile",
"the",
"template",
"only",
"once",
"."
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L245-L284 | |
39,953 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function(cb) {
// If we're inside phonegap use its event.
if (window.phonegap) {
return document.addEventListener("offline", cb, false);
} else if (window.addEventListener) {
// With the offline HTML5 event from the window
this.addLocalEventListener(window, "offline", cb);
} else {
... | javascript | function(cb) {
// If we're inside phonegap use its event.
if (window.phonegap) {
return document.addEventListener("offline", cb, false);
} else if (window.addEventListener) {
// With the offline HTML5 event from the window
this.addLocalEventListener(window, "offline", cb);
} else {
... | [
"function",
"(",
"cb",
")",
"{",
"// If we're inside phonegap use its event.",
"if",
"(",
"window",
".",
"phonegap",
")",
"{",
"return",
"document",
".",
"addEventListener",
"(",
"\"offline\"",
",",
"cb",
",",
"false",
")",
";",
"}",
"else",
"if",
"(",
"wind... | Calls cb when the app is offline from the backend
TODO: Find a kludge for this, for Firefox. Firefox only triggers offline when
the user sets the browser to "Offline mode"
@param {Function} cb. | [
"Calls",
"cb",
"when",
"the",
"app",
"is",
"offline",
"from",
"the",
"backend"
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L314-L329 | |
39,954 | myelements/myelements.jquery | lib/client/myelements.jquery.js | function($el) {
// Reaction to socket.io messages
$myelements.socket.on("message", function onMessage(message) {
if ($el.data().templateScope === message.event) {
// Update element scope (maybe re-render)
var scope = {};
scope[message.event] = message.data;
$myelements.upda... | javascript | function($el) {
// Reaction to socket.io messages
$myelements.socket.on("message", function onMessage(message) {
if ($el.data().templateScope === message.event) {
// Update element scope (maybe re-render)
var scope = {};
scope[message.event] = message.data;
$myelements.upda... | [
"function",
"(",
"$el",
")",
"{",
"// Reaction to socket.io messages",
"$myelements",
".",
"socket",
".",
"on",
"(",
"\"message\"",
",",
"function",
"onMessage",
"(",
"message",
")",
"{",
"if",
"(",
"$el",
".",
"data",
"(",
")",
".",
"templateScope",
"===",
... | Prepares HTML elements for being able to receive socket.io's messages
as jQuery events on the element | [
"Prepares",
"HTML",
"elements",
"for",
"being",
"able",
"to",
"receive",
"socket",
".",
"io",
"s",
"messages",
"as",
"jQuery",
"events",
"on",
"the",
"element"
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/myelements.jquery.js#L433-L465 | |
39,955 | sonnym/node-elm-loader | src/index.js | execute | function execute() {
var context = getDefaultContext();
var compiledOutput = fs.readFileSync(this.outputPath)
vm.runInContext(compiledOutput, context, this.outputPath);
var module = extractModule(this.moduleName, context);
this.compiledModule = context.Elm.fullscreen(module, this.defaults);
} | javascript | function execute() {
var context = getDefaultContext();
var compiledOutput = fs.readFileSync(this.outputPath)
vm.runInContext(compiledOutput, context, this.outputPath);
var module = extractModule(this.moduleName, context);
this.compiledModule = context.Elm.fullscreen(module, this.defaults);
} | [
"function",
"execute",
"(",
")",
"{",
"var",
"context",
"=",
"getDefaultContext",
"(",
")",
";",
"var",
"compiledOutput",
"=",
"fs",
".",
"readFileSync",
"(",
"this",
".",
"outputPath",
")",
"vm",
".",
"runInContext",
"(",
"compiledOutput",
",",
"context",
... | execute script generated by elm-make in a vm context | [
"execute",
"script",
"generated",
"by",
"elm",
"-",
"make",
"in",
"a",
"vm",
"context"
] | e6a6fa4dd8c3352c65f338b6f2760b16687b760a | https://github.com/sonnym/node-elm-loader/blob/e6a6fa4dd8c3352c65f338b6f2760b16687b760a/src/index.js#L73-L82 |
39,956 | sonnym/node-elm-loader | src/index.js | wrap | function wrap() {
var ports = this.compiledModule.ports;
var incomingEmitter = new EventEmitter();
var outgoingEmitter = new EventEmitter();
var emit = incomingEmitter.emit.bind(incomingEmitter);
Object.keys(ports).forEach(function(key) {
outgoingEmitter.addListener(key, function() {
var args = A... | javascript | function wrap() {
var ports = this.compiledModule.ports;
var incomingEmitter = new EventEmitter();
var outgoingEmitter = new EventEmitter();
var emit = incomingEmitter.emit.bind(incomingEmitter);
Object.keys(ports).forEach(function(key) {
outgoingEmitter.addListener(key, function() {
var args = A... | [
"function",
"wrap",
"(",
")",
"{",
"var",
"ports",
"=",
"this",
".",
"compiledModule",
".",
"ports",
";",
"var",
"incomingEmitter",
"=",
"new",
"EventEmitter",
"(",
")",
";",
"var",
"outgoingEmitter",
"=",
"new",
"EventEmitter",
"(",
")",
";",
"var",
"em... | wrap compiled and executed object in EventEmitters | [
"wrap",
"compiled",
"and",
"executed",
"object",
"in",
"EventEmitters"
] | e6a6fa4dd8c3352c65f338b6f2760b16687b760a | https://github.com/sonnym/node-elm-loader/blob/e6a6fa4dd8c3352c65f338b6f2760b16687b760a/src/index.js#L87-L116 |
39,957 | joeyespo/gesso.js | gesso/bundler.js | mkdirsInner | function mkdirsInner(dirnames, currentPath, callback) {
// Check for completion and call callback
if (dirnames.length === 0) {
return _callback(callback);
}
// Make next directory
var dirname = dirnames.shift();
currentPath = path.join(currentPath, dirname);
fs.mkdir(currentPath, func... | javascript | function mkdirsInner(dirnames, currentPath, callback) {
// Check for completion and call callback
if (dirnames.length === 0) {
return _callback(callback);
}
// Make next directory
var dirname = dirnames.shift();
currentPath = path.join(currentPath, dirname);
fs.mkdir(currentPath, func... | [
"function",
"mkdirsInner",
"(",
"dirnames",
",",
"currentPath",
",",
"callback",
")",
"{",
"// Check for completion and call callback",
"if",
"(",
"dirnames",
".",
"length",
"===",
"0",
")",
"{",
"return",
"_callback",
"(",
"callback",
")",
";",
"}",
"// Make ne... | Run async mkdir recursively | [
"Run",
"async",
"mkdir",
"recursively"
] | b4858dfc607aab13342474930c174b5b82f98267 | https://github.com/joeyespo/gesso.js/blob/b4858dfc607aab13342474930c174b5b82f98267/gesso/bundler.js#L38-L50 |
39,958 | abrahamjagadeesh/npm-module-stats | lib/walk.js | pushResultsArray | function pushResultsArray(obj, size) {
if (typeof obj === "string" && obj in stack) {
stack[obj]["size"] = size;
return;
}
if (!(obj.module in stack)) {
stack[obj.module] = obj;
}
} | javascript | function pushResultsArray(obj, size) {
if (typeof obj === "string" && obj in stack) {
stack[obj]["size"] = size;
return;
}
if (!(obj.module in stack)) {
stack[obj.module] = obj;
}
} | [
"function",
"pushResultsArray",
"(",
"obj",
",",
"size",
")",
"{",
"if",
"(",
"typeof",
"obj",
"===",
"\"string\"",
"&&",
"obj",
"in",
"stack",
")",
"{",
"stack",
"[",
"obj",
"]",
"[",
"\"size\"",
"]",
"=",
"size",
";",
"return",
";",
"}",
"if",
"(... | Fn to push new object into stack returned by
each Walk function | [
"Fn",
"to",
"push",
"new",
"object",
"into",
"stack",
"returned",
"by",
"each",
"Walk",
"function"
] | 70efd2ddd0d184973acd2918811a46558a71b5f5 | https://github.com/abrahamjagadeesh/npm-module-stats/blob/70efd2ddd0d184973acd2918811a46558a71b5f5/lib/walk.js#L19-L27 |
39,959 | noderaider/repackage | jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/classes.js | ClassBody | function ClassBody(node, print) {
this.push("{");
if (node.body.length === 0) {
print.printInnerComments();
this.push("}");
} else {
this.newline();
this.indent();
print.sequence(node.body);
this.dedent();
this.rightBrace();
}
} | javascript | function ClassBody(node, print) {
this.push("{");
if (node.body.length === 0) {
print.printInnerComments();
this.push("}");
} else {
this.newline();
this.indent();
print.sequence(node.body);
this.dedent();
this.rightBrace();
}
} | [
"function",
"ClassBody",
"(",
"node",
",",
"print",
")",
"{",
"this",
".",
"push",
"(",
"\"{\"",
")",
";",
"if",
"(",
"node",
".",
"body",
".",
"length",
"===",
"0",
")",
"{",
"print",
".",
"printInnerComments",
"(",
")",
";",
"this",
".",
"push",
... | Print ClassBody, collapses empty blocks, prints body. | [
"Print",
"ClassBody",
"collapses",
"empty",
"blocks",
"prints",
"body",
"."
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/npm/babel-core@5.8.38/lib/generation/generators/classes.js#L51-L65 |
39,960 | noderaider/repackage | jspm_packages/system-csp-production.src.js | loadModule | function loadModule(loader, name, options) {
return new Promise(asyncStartLoadPartwayThrough({
step: options.address ? 'fetch' : 'locate',
loader: loader,
moduleName: name,
// allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091
moduleMetadata: options && options.... | javascript | function loadModule(loader, name, options) {
return new Promise(asyncStartLoadPartwayThrough({
step: options.address ? 'fetch' : 'locate',
loader: loader,
moduleName: name,
// allow metadata for import https://bugs.ecmascript.org/show_bug.cgi?id=3091
moduleMetadata: options && options.... | [
"function",
"loadModule",
"(",
"loader",
",",
"name",
",",
"options",
")",
"{",
"return",
"new",
"Promise",
"(",
"asyncStartLoadPartwayThrough",
"(",
"{",
"step",
":",
"options",
".",
"address",
"?",
"'fetch'",
":",
"'locate'",
",",
"loader",
":",
"loader",
... | 15.2.4 15.2.4.1 | [
"15",
".",
"2",
".",
"4",
"15",
".",
"2",
".",
"4",
".",
"1"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L346-L356 |
39,961 | noderaider/repackage | jspm_packages/system-csp-production.src.js | requestLoad | function requestLoad(loader, request, refererName, refererAddress) {
// 15.2.4.2.1 CallNormalize
return new Promise(function(resolve, reject) {
resolve(loader.loaderObj.normalize(request, refererName, refererAddress));
})
// 15.2.4.2.2 GetOrCreateLoad
.then(function(name) {
var load;
... | javascript | function requestLoad(loader, request, refererName, refererAddress) {
// 15.2.4.2.1 CallNormalize
return new Promise(function(resolve, reject) {
resolve(loader.loaderObj.normalize(request, refererName, refererAddress));
})
// 15.2.4.2.2 GetOrCreateLoad
.then(function(name) {
var load;
... | [
"function",
"requestLoad",
"(",
"loader",
",",
"request",
",",
"refererName",
",",
"refererAddress",
")",
"{",
"// 15.2.4.2.1 CallNormalize",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"resolve",
"(",
"loader",
".",
"... | 15.2.4.2 | [
"15",
".",
"2",
".",
"4",
".",
"2"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L359-L389 |
39,962 | noderaider/repackage | jspm_packages/system-csp-production.src.js | asyncStartLoadPartwayThrough | function asyncStartLoadPartwayThrough(stepState) {
return function(resolve, reject) {
var loader = stepState.loader;
var name = stepState.moduleName;
var step = stepState.step;
if (loader.modules[name])
throw new TypeError('"' + name + '" already exists in the module table');
... | javascript | function asyncStartLoadPartwayThrough(stepState) {
return function(resolve, reject) {
var loader = stepState.loader;
var name = stepState.moduleName;
var step = stepState.step;
if (loader.modules[name])
throw new TypeError('"' + name + '" already exists in the module table');
... | [
"function",
"asyncStartLoadPartwayThrough",
"(",
"stepState",
")",
"{",
"return",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"var",
"loader",
"=",
"stepState",
".",
"loader",
";",
"var",
"name",
"=",
"stepState",
".",
"moduleName",
";",
"var",
"ste... | 15.2.4.7 PromiseOfStartLoadPartwayThrough absorbed into calling functions 15.2.4.7.1 | [
"15",
".",
"2",
".",
"4",
".",
"7",
"PromiseOfStartLoadPartwayThrough",
"absorbed",
"into",
"calling",
"functions",
"15",
".",
"2",
".",
"4",
".",
"7",
".",
"1"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L513-L564 |
39,963 | noderaider/repackage | jspm_packages/system-csp-production.src.js | doLink | function doLink(linkSet) {
var error = false;
try {
link(linkSet, function(load, exc) {
linkSetFailed(linkSet, load, exc);
error = true;
});
}
catch(e) {
linkSetFailed(linkSet, null, e);
error = true;
}
return error;
} | javascript | function doLink(linkSet) {
var error = false;
try {
link(linkSet, function(load, exc) {
linkSetFailed(linkSet, load, exc);
error = true;
});
}
catch(e) {
linkSetFailed(linkSet, null, e);
error = true;
}
return error;
} | [
"function",
"doLink",
"(",
"linkSet",
")",
"{",
"var",
"error",
"=",
"false",
";",
"try",
"{",
"link",
"(",
"linkSet",
",",
"function",
"(",
"load",
",",
"exc",
")",
"{",
"linkSetFailed",
"(",
"linkSet",
",",
"load",
",",
"exc",
")",
";",
"error",
... | linking errors can be generic or load-specific this is necessary for debugging info | [
"linking",
"errors",
"can",
"be",
"generic",
"or",
"load",
"-",
"specific",
"this",
"is",
"necessary",
"for",
"debugging",
"info"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L628-L641 |
39,964 | noderaider/repackage | jspm_packages/system-csp-production.src.js | function(name, source, options) {
// check if already defined
if (this._loader.importPromises[name])
throw new TypeError('Module is already loading.');
return createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
step: 'translate',
loader: this._loader,
... | javascript | function(name, source, options) {
// check if already defined
if (this._loader.importPromises[name])
throw new TypeError('Module is already loading.');
return createImportPromise(this, name, new Promise(asyncStartLoadPartwayThrough({
step: 'translate',
loader: this._loader,
... | [
"function",
"(",
"name",
",",
"source",
",",
"options",
")",
"{",
"// check if already defined",
"if",
"(",
"this",
".",
"_loader",
".",
"importPromises",
"[",
"name",
"]",
")",
"throw",
"new",
"TypeError",
"(",
"'Module is already loading.'",
")",
";",
"retur... | 26.3.3.2 | [
"26",
".",
"3",
".",
"3",
".",
"2"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L807-L819 | |
39,965 | noderaider/repackage | jspm_packages/system-csp-production.src.js | function(name) {
var loader = this._loader;
delete loader.importPromises[name];
delete loader.moduleRecords[name];
return loader.modules[name] ? delete loader.modules[name] : false;
} | javascript | function(name) {
var loader = this._loader;
delete loader.importPromises[name];
delete loader.moduleRecords[name];
return loader.modules[name] ? delete loader.modules[name] : false;
} | [
"function",
"(",
"name",
")",
"{",
"var",
"loader",
"=",
"this",
".",
"_loader",
";",
"delete",
"loader",
".",
"importPromises",
"[",
"name",
"]",
";",
"delete",
"loader",
".",
"moduleRecords",
"[",
"name",
"]",
";",
"return",
"loader",
".",
"modules",
... | 26.3.3.3 | [
"26",
".",
"3",
".",
"3",
".",
"3"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L821-L826 | |
39,966 | noderaider/repackage | jspm_packages/system-csp-production.src.js | function(source, options) {
var load = createLoad();
load.address = options && options.address;
var linkSet = createLinkSet(this._loader, load);
var sourcePromise = Promise.resolve(source);
var loader = this._loader;
var p = linkSet.done.then(function() {
return load.module.m... | javascript | function(source, options) {
var load = createLoad();
load.address = options && options.address;
var linkSet = createLinkSet(this._loader, load);
var sourcePromise = Promise.resolve(source);
var loader = this._loader;
var p = linkSet.done.then(function() {
return load.module.m... | [
"function",
"(",
"source",
",",
"options",
")",
"{",
"var",
"load",
"=",
"createLoad",
"(",
")",
";",
"load",
".",
"address",
"=",
"options",
"&&",
"options",
".",
"address",
";",
"var",
"linkSet",
"=",
"createLinkSet",
"(",
"this",
".",
"_loader",
","... | 26.3.3.11 | [
"26",
".",
"3",
".",
"3",
".",
"11"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L881-L892 | |
39,967 | noderaider/repackage | jspm_packages/system-csp-production.src.js | getESModule | function getESModule(exports) {
var esModule = {};
// don't trigger getters/setters in environments that support them
if ((typeof exports == 'object' || typeof exports == 'function') && exports !== __global) {
if (getOwnPropertyDescriptor) {
for (var p in exports) {
// The default property... | javascript | function getESModule(exports) {
var esModule = {};
// don't trigger getters/setters in environments that support them
if ((typeof exports == 'object' || typeof exports == 'function') && exports !== __global) {
if (getOwnPropertyDescriptor) {
for (var p in exports) {
// The default property... | [
"function",
"getESModule",
"(",
"exports",
")",
"{",
"var",
"esModule",
"=",
"{",
"}",
";",
"// don't trigger getters/setters in environments that support them",
"if",
"(",
"(",
"typeof",
"exports",
"==",
"'object'",
"||",
"typeof",
"exports",
"==",
"'function'",
")... | converts any module.exports object into an object ready for SystemJS.newModule | [
"converts",
"any",
"module",
".",
"exports",
"object",
"into",
"an",
"object",
"ready",
"for",
"SystemJS",
".",
"newModule"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L1128-L1149 |
39,968 | noderaider/repackage | jspm_packages/system-csp-production.src.js | getPackageConfigMatch | function getPackageConfigMatch(loader, normalized) {
var pkgName, exactMatch = false, configPath;
for (var i = 0; i < loader.packageConfigPaths.length; i++) {
var packageConfigPath = loader.packageConfigPaths[i];
var p = packageConfigPaths[packageConfigPath] || (packageConfigPaths[packageConfigPath]... | javascript | function getPackageConfigMatch(loader, normalized) {
var pkgName, exactMatch = false, configPath;
for (var i = 0; i < loader.packageConfigPaths.length; i++) {
var packageConfigPath = loader.packageConfigPaths[i];
var p = packageConfigPaths[packageConfigPath] || (packageConfigPaths[packageConfigPath]... | [
"function",
"getPackageConfigMatch",
"(",
"loader",
",",
"normalized",
")",
"{",
"var",
"pkgName",
",",
"exactMatch",
"=",
"false",
",",
"configPath",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"loader",
".",
"packageConfigPaths",
".",
"length",... | most specific match wins | [
"most",
"specific",
"match",
"wins"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L2366-L2388 |
39,969 | noderaider/repackage | jspm_packages/system-csp-production.src.js | combinePluginParts | function combinePluginParts(loader, argumentName, pluginName, defaultExtension) {
if (defaultExtension && argumentName.substr(argumentName.length - 3, 3) == '.js')
argumentName = argumentName.substr(0, argumentName.length - 3);
if (loader.pluginFirst) {
return pluginName + '!' + argumentName;
}... | javascript | function combinePluginParts(loader, argumentName, pluginName, defaultExtension) {
if (defaultExtension && argumentName.substr(argumentName.length - 3, 3) == '.js')
argumentName = argumentName.substr(0, argumentName.length - 3);
if (loader.pluginFirst) {
return pluginName + '!' + argumentName;
}... | [
"function",
"combinePluginParts",
"(",
"loader",
",",
"argumentName",
",",
"pluginName",
",",
"defaultExtension",
")",
"{",
"if",
"(",
"defaultExtension",
"&&",
"argumentName",
".",
"substr",
"(",
"argumentName",
".",
"length",
"-",
"3",
",",
"3",
")",
"==",
... | put name back together after parts have been normalized | [
"put",
"name",
"back",
"together",
"after",
"parts",
"have",
"been",
"normalized"
] | 9f14246db3327abb0c4a5d7a3d55bd7816ebbd40 | https://github.com/noderaider/repackage/blob/9f14246db3327abb0c4a5d7a3d55bd7816ebbd40/jspm_packages/system-csp-production.src.js#L3783-L3793 |
39,970 | chirashijs/chirashi | dist/chirashi.common.js | getElements | function getElements(input) {
if (typeof input === 'string') {
return _getElements(document, input);
}
if (input instanceof window.NodeList || input instanceof window.HTMLCollection) {
return _nodelistToArray(input);
}
if (input instanceof Array) {
if (input['_chrsh-valid']) {
return input... | javascript | function getElements(input) {
if (typeof input === 'string') {
return _getElements(document, input);
}
if (input instanceof window.NodeList || input instanceof window.HTMLCollection) {
return _nodelistToArray(input);
}
if (input instanceof Array) {
if (input['_chrsh-valid']) {
return input... | [
"function",
"getElements",
"(",
"input",
")",
"{",
"if",
"(",
"typeof",
"input",
"===",
"'string'",
")",
"{",
"return",
"_getElements",
"(",
"document",
",",
"input",
")",
";",
"}",
"if",
"(",
"input",
"instanceof",
"window",
".",
"NodeList",
"||",
"inpu... | Get dom element recursively from iterable or selector.
@param {(string|Array|NodeList|HTMLCollection|Window|Node)} input - The iterable, selector or elements.
@return {Array} domElements - The array of dom elements from input.
@example //esnext
import { createElement, append, getElements } from 'chirashi'
const sushi =... | [
"Get",
"dom",
"element",
"recursively",
"from",
"iterable",
"or",
"selector",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L204-L225 |
39,971 | chirashijs/chirashi | dist/chirashi.common.js | forIn | function forIn(object, callback) {
if ((typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== 'object') return;
forEach(Object.keys(object), _forKey.bind(null, object, callback));
return object;
} | javascript | function forIn(object, callback) {
if ((typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== 'object') return;
forEach(Object.keys(object), _forKey.bind(null, object, callback));
return object;
} | [
"function",
"forIn",
"(",
"object",
",",
"callback",
")",
"{",
"if",
"(",
"(",
"typeof",
"object",
"===",
"'undefined'",
"?",
"'undefined'",
":",
"_typeof",
"(",
"object",
")",
")",
"!==",
"'object'",
")",
"return",
";",
"forEach",
"(",
"Object",
".",
... | Callback to apply on element.
@callback forElementsCallback
@param {Window | document | HTMLElement | SVGElement | Text} element
@param {number} index - Index of element in elements.
Iterates over object's keys and apply callback on each one.
@param {Object} object - The iterable.
@param {forInCallback} callback - Th... | [
"Callback",
"to",
"apply",
"on",
"element",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L306-L312 |
39,972 | chirashijs/chirashi | dist/chirashi.common.js | getElement | function getElement(input) {
if (typeof input === 'string') {
return _getElement(document, input);
}
if (input instanceof window.NodeList || input instanceof window.HTMLCollection) {
return input[0];
}
if (input instanceof Array) {
return getElement(input[0]);
}
return isDomElement(input) &... | javascript | function getElement(input) {
if (typeof input === 'string') {
return _getElement(document, input);
}
if (input instanceof window.NodeList || input instanceof window.HTMLCollection) {
return input[0];
}
if (input instanceof Array) {
return getElement(input[0]);
}
return isDomElement(input) &... | [
"function",
"getElement",
"(",
"input",
")",
"{",
"if",
"(",
"typeof",
"input",
"===",
"'string'",
")",
"{",
"return",
"_getElement",
"(",
"document",
",",
"input",
")",
";",
"}",
"if",
"(",
"input",
"instanceof",
"window",
".",
"NodeList",
"||",
"input"... | Get first dom element from iterable or selector.
@param {(string|Array|NodeList|HTMLCollection|Window|Node)} input - The iterable, selector or elements.
@return {(Window|Node|boolean)} element - The dom element from input.
@example //esnext
import { createElement, append, getElement } from 'chirashi'
const sushi = crea... | [
"Get",
"first",
"dom",
"element",
"from",
"iterable",
"or",
"selector",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L368-L382 |
39,973 | chirashijs/chirashi | dist/chirashi.common.js | append | function append(element, nodes) {
element = getElement(element);
if (!element || !element.appendChild) return false;
forEach(nodes, _appendOne.bind(null, element));
return element;
} | javascript | function append(element, nodes) {
element = getElement(element);
if (!element || !element.appendChild) return false;
forEach(nodes, _appendOne.bind(null, element));
return element;
} | [
"function",
"append",
"(",
"element",
",",
"nodes",
")",
"{",
"element",
"=",
"getElement",
"(",
"element",
")",
";",
"if",
"(",
"!",
"element",
"||",
"!",
"element",
".",
"appendChild",
")",
"return",
"false",
";",
"forEach",
"(",
"nodes",
",",
"_appe... | Appends each node to a parent node.
@param {(string|Array|NodeList|HTMLCollection|Node)} element - The parent node. Note that it'll be passed to getElement to ensure there's only one.
@param {(string|Array.<(string|Node)>|Node)} nodes - String, node or array of nodes and/or strings. Each string will be passed to create... | [
"Appends",
"each",
"node",
"to",
"a",
"parent",
"node",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L493-L501 |
39,974 | chirashijs/chirashi | dist/chirashi.common.js | closest | function closest(element, tested) {
var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
element = getElement(element);
if (!element || (typeof limit === 'string' ? element.matches(limit) : element === limit)) {
return false;
}
if (typeof tested === 'string' ? eleme... | javascript | function closest(element, tested) {
var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
element = getElement(element);
if (!element || (typeof limit === 'string' ? element.matches(limit) : element === limit)) {
return false;
}
if (typeof tested === 'string' ? eleme... | [
"function",
"closest",
"(",
"element",
",",
"tested",
")",
"{",
"var",
"limit",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":",
"document",
";",
"element",
"=",
"g... | Get closest element matching the tested selector or tested element traveling up the DOM tree from element to limit.
@param {(string|Array|NodeList|HTMLCollection|Element)} element - First tested element. Note that it'll be passed to getElement to ensure there's only one.
@param {(string|Element)} tested - The selector ... | [
"Get",
"closest",
"element",
"matching",
"the",
"tested",
"selector",
"or",
"tested",
"element",
"traveling",
"up",
"the",
"DOM",
"tree",
"from",
"element",
"to",
"limit",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L614-L628 |
39,975 | chirashijs/chirashi | dist/chirashi.common.js | findOne | function findOne(element, selector) {
return (element = getElement(element)) ? _getElement(element, selector) : null;
} | javascript | function findOne(element, selector) {
return (element = getElement(element)) ? _getElement(element, selector) : null;
} | [
"function",
"findOne",
"(",
"element",
",",
"selector",
")",
"{",
"return",
"(",
"element",
"=",
"getElement",
"(",
"element",
")",
")",
"?",
"_getElement",
"(",
"element",
",",
"selector",
")",
":",
"null",
";",
"}"
] | Find the first element's child matching the selector.
@param {(string|Array|NodeList|HTMLCollection|Element|Document|ParentNode)} element - The parent node. Note that it'll be passed to getElement to ensure there's only one.
@param {string} selector - The selector to match.
@return {(Element|null)} element - The first ... | [
"Find",
"the",
"first",
"element",
"s",
"child",
"matching",
"the",
"selector",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L746-L748 |
39,976 | chirashijs/chirashi | dist/chirashi.common.js | hasClass | function hasClass(element) {
element = getElement(element);
if (!element) return;
var n = arguments.length <= 1 ? 0 : arguments.length - 1;
var found = void 0;
var i = 0;
while (i < n && (found = element.classList.contains((_ref = i++ + 1, arguments.length <= _ref ? undefined : arguments[_ref])))) {
va... | javascript | function hasClass(element) {
element = getElement(element);
if (!element) return;
var n = arguments.length <= 1 ? 0 : arguments.length - 1;
var found = void 0;
var i = 0;
while (i < n && (found = element.classList.contains((_ref = i++ + 1, arguments.length <= _ref ? undefined : arguments[_ref])))) {
va... | [
"function",
"hasClass",
"(",
"element",
")",
"{",
"element",
"=",
"getElement",
"(",
"element",
")",
";",
"if",
"(",
"!",
"element",
")",
"return",
";",
"var",
"n",
"=",
"arguments",
".",
"length",
"<=",
"1",
"?",
"0",
":",
"arguments",
".",
"length"... | Iterates over classes and test if element has each.
@param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements.
@param {...string} classes - Classes to test.
@return {boolean} hasClass - Is true if element has all classes.
@example //esnext
import { createElement, hasClass } f... | [
"Iterates",
"over",
"classes",
"and",
"test",
"if",
"element",
"has",
"each",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L819-L831 |
39,977 | chirashijs/chirashi | dist/chirashi.common.js | removeClass | function removeClass(elements) {
for (var _len = arguments.length, classes = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
classes[_key - 1] = arguments[_key];
}
return _updateClassList(elements, 'remove', classes);
} | javascript | function removeClass(elements) {
for (var _len = arguments.length, classes = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
classes[_key - 1] = arguments[_key];
}
return _updateClassList(elements, 'remove', classes);
} | [
"function",
"removeClass",
"(",
"elements",
")",
"{",
"for",
"(",
"var",
"_len",
"=",
"arguments",
".",
"length",
",",
"classes",
"=",
"Array",
"(",
"_len",
">",
"1",
"?",
"_len",
"-",
"1",
":",
"0",
")",
",",
"_key",
"=",
"1",
";",
"_key",
"<",
... | Iterates over classes and remove it from each element of elements.
@param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements.
@param {...string} classes - Classes to remove.
@return {Array} iterable - The getElements' result for chaining.
@example //esnext
import { createElem... | [
"Iterates",
"over",
"classes",
"and",
"remove",
"it",
"from",
"each",
"element",
"of",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1098-L1104 |
39,978 | chirashijs/chirashi | dist/chirashi.common.js | setData | function setData(elements, dataAttributes) {
var attributes = {};
forIn(dataAttributes, _prefixAttribute.bind(null, attributes));
return setAttr(elements, attributes);
} | javascript | function setData(elements, dataAttributes) {
var attributes = {};
forIn(dataAttributes, _prefixAttribute.bind(null, attributes));
return setAttr(elements, attributes);
} | [
"function",
"setData",
"(",
"elements",
",",
"dataAttributes",
")",
"{",
"var",
"attributes",
"=",
"{",
"}",
";",
"forIn",
"(",
"dataAttributes",
",",
"_prefixAttribute",
".",
"bind",
"(",
"null",
",",
"attributes",
")",
")",
";",
"return",
"setAttr",
"(",... | Iterates over data-attributes as key value pairs and apply on each element of elements.
@param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements.
@param {Object.<string, (number|string)>} dataAttributes - The data-attributes key value pairs
@return {Array} iterable - The get... | [
"Iterates",
"over",
"data",
"-",
"attributes",
"as",
"key",
"value",
"pairs",
"and",
"apply",
"on",
"each",
"element",
"of",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1188-L1194 |
39,979 | chirashijs/chirashi | dist/chirashi.common.js | toggleClass | function toggleClass(elements) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (_typeof(args[0]) === 'object') {
forIn(args[0], _toggleClassesWithForce.bind(null, elements));
} else {
forEach(args, _t... | javascript | function toggleClass(elements) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (_typeof(args[0]) === 'object') {
forIn(args[0], _toggleClassesWithForce.bind(null, elements));
} else {
forEach(args, _t... | [
"function",
"toggleClass",
"(",
"elements",
")",
"{",
"for",
"(",
"var",
"_len",
"=",
"arguments",
".",
"length",
",",
"args",
"=",
"Array",
"(",
"_len",
">",
"1",
"?",
"_len",
"-",
"1",
":",
"0",
")",
",",
"_key",
"=",
"1",
";",
"_key",
"<",
"... | Iterates over classes and toggle it on each element of elements.
@param {(string|Array|NodeList|HTMLCollection|Element)} elements - The iterable, selector or elements.
@param {(string|Array|Object)} classes - Array of classes or string of classes seperated with comma and/or spaces. Or object with keys being the string ... | [
"Iterates",
"over",
"classes",
"and",
"toggle",
"it",
"on",
"each",
"element",
"of",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1284-L1294 |
39,980 | chirashijs/chirashi | dist/chirashi.common.js | on | function on(elements, input) {
elements = _setEvents(elements, 'add', input);
return function (offElements, events) {
_setEvents(offElements || elements, 'remove', events ? defineProperty({}, events, input[events]) : input);
};
} | javascript | function on(elements, input) {
elements = _setEvents(elements, 'add', input);
return function (offElements, events) {
_setEvents(offElements || elements, 'remove', events ? defineProperty({}, events, input[events]) : input);
};
} | [
"function",
"on",
"(",
"elements",
",",
"input",
")",
"{",
"elements",
"=",
"_setEvents",
"(",
"elements",
",",
"'add'",
",",
"input",
")",
";",
"return",
"function",
"(",
"offElements",
",",
"events",
")",
"{",
"_setEvents",
"(",
"offElements",
"||",
"e... | Bind events listener on each element of elements.
@param {(string|Array|NodeList|HTMLCollection|EventTarget)} elements - The iterable, selector or elements.
@param {Object.<string, (eventCallback|EventObject)>} input - An object in which keys are events to bind seperated with coma and/or spaces and values are eventCall... | [
"Bind",
"events",
"listener",
"on",
"each",
"element",
"of",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1396-L1402 |
39,981 | chirashijs/chirashi | dist/chirashi.common.js | delegate | function delegate(selector, input) {
var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.body;
target = getElement(target);
var eventsObj = {};
forIn(input, _wrapOptions.bind(null, selector, target, eventsObj));
var off = on(target, eventsObj);
return function (even... | javascript | function delegate(selector, input) {
var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.body;
target = getElement(target);
var eventsObj = {};
forIn(input, _wrapOptions.bind(null, selector, target, eventsObj));
var off = on(target, eventsObj);
return function (even... | [
"function",
"delegate",
"(",
"selector",
",",
"input",
")",
"{",
"var",
"target",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":",
"document",
".",
"body",
";",
"ta... | Called to remove one or all events listeners of one or all elements.
@callback offCallback
@param {(string|Array|NodeList|HTMLCollection|EventTarget)} [offElements] - The iterable, selector or elements to unbind.
@param {string} [events] - The events to unbind. Must be provided in the same syntax as in input.
Delegat... | [
"Called",
"to",
"remove",
"one",
"or",
"all",
"events",
"listeners",
"of",
"one",
"or",
"all",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1470-L1483 |
39,982 | chirashijs/chirashi | dist/chirashi.common.js | once | function once(elements, input) {
var eachElement = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var eachEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var off = void 0;
var eventsObj = {};
forIn(input, function (events, callback) {
events... | javascript | function once(elements, input) {
var eachElement = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var eachEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var off = void 0;
var eventsObj = {};
forIn(input, function (events, callback) {
events... | [
"function",
"once",
"(",
"elements",
",",
"input",
")",
"{",
"var",
"eachElement",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":",
"false",
";",
"var",
"eachEvent",
... | Called to off one or all events.
@callback offCallback
@param {string} [events] - The events to off. Must be provided in the same syntax as in input.
Bind events listener on each element of elements and unbind after first triggered.
@param {(string|Array|NodeList|HTMLCollection|EventTarget)} elements - The iterable, ... | [
"Called",
"to",
"off",
"one",
"or",
"all",
"events",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1582-L1598 |
39,983 | chirashijs/chirashi | dist/chirashi.common.js | trigger | function trigger(elements, events) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
elements = getElements(elements);
if (!elements.length) return;
options = _extends({}, options, defaults$1);
forEach(_stringToArray(events), _createEvent.bind(null, elements, options)... | javascript | function trigger(elements, events) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
elements = getElements(elements);
if (!elements.length) return;
options = _extends({}, options, defaults$1);
forEach(_stringToArray(events), _createEvent.bind(null, elements, options)... | [
"function",
"trigger",
"(",
"elements",
",",
"events",
")",
"{",
"var",
"options",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":",
"{",
"}",
";",
"elements",
"=",
... | Trigger events on elements with data
@param {(string|Array|NodeList|HTMLCollection|EventTarget)} elements - The iterable, selector or elements.
@param {string} events - The events that should be tiggered seperated with spaces
@param {Object} data - The events' data
@return {Array} iterable - The getElements' result for... | [
"Trigger",
"events",
"on",
"elements",
"with",
"data"
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1667-L1679 |
39,984 | chirashijs/chirashi | dist/chirashi.common.js | clearStyle | function clearStyle(elements) {
var style = {};
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
forEach(props, _resetProp.bind(null, style));
return setStyleProp(elements, style);
} | javascript | function clearStyle(elements) {
var style = {};
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
forEach(props, _resetProp.bind(null, style));
return setStyleProp(elements, style);
} | [
"function",
"clearStyle",
"(",
"elements",
")",
"{",
"var",
"style",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"_len",
"=",
"arguments",
".",
"length",
",",
"props",
"=",
"Array",
"(",
"_len",
">",
"1",
"?",
"_len",
"-",
"1",
":",
"0",
")",
",",
"... | Clear inline style properties from elements.
@param {(string|Array|NodeList|HTMLCollection|HTMLElement)} elements - The iterable, selector or elements.
@param {...string} props - The style properties to clear.
@return {Array} iterable - The getElements' result for chaining.
@example //esnext
import { createElement, set... | [
"Clear",
"inline",
"style",
"properties",
"from",
"elements",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1804-L1814 |
39,985 | chirashijs/chirashi | dist/chirashi.common.js | getHeight | function getHeight(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return _getLength(element, 'Height', offset);
} | javascript | function getHeight(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return _getLength(element, 'Height', offset);
} | [
"function",
"getHeight",
"(",
"element",
")",
"{",
"var",
"offset",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"false",
";",
"return",
"_getLength",
"(",
"eleme... | Get element's height in pixels.
@param {(string|Array|NodeList|HTMLCollection|Element|HTMLElement)} element - The element. Note that it'll be passed to getElement to ensure there's only one.
@param {boolean} [offset=false] - If true height will include scrollbar and borders to size.
@return {number} height - The height... | [
"Get",
"element",
"s",
"height",
"in",
"pixels",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1950-L1954 |
39,986 | chirashijs/chirashi | dist/chirashi.common.js | getWidth | function getWidth(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return _getLength(element, 'Width', offset);
} | javascript | function getWidth(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return _getLength(element, 'Width', offset);
} | [
"function",
"getWidth",
"(",
"element",
")",
"{",
"var",
"offset",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"false",
";",
"return",
"_getLength",
"(",
"elemen... | Get element's width in pixels.
@param {(string|Array|NodeList|HTMLCollection|Element|HTMLElement)} element - The element. Note that it'll be passed to getElement to ensure there's only one.
@param {boolean} [offset=false] - If true width will include scrollbar and borders to size.
@return {number} width - The width in ... | [
"Get",
"element",
"s",
"width",
"in",
"pixels",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L1985-L1989 |
39,987 | chirashijs/chirashi | dist/chirashi.common.js | getSize | function getSize(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return {
width: getWidth(element, offset),
height: getHeight(element, offset)
};
} | javascript | function getSize(element) {
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return {
width: getWidth(element, offset),
height: getHeight(element, offset)
};
} | [
"function",
"getSize",
"(",
"element",
")",
"{",
"var",
"offset",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"false",
";",
"return",
"{",
"width",
":",
"getWi... | Get element's size in pixels.
@param {(string|Array|NodeList|HTMLCollection|Element|HTMLElement)} element - The element. Note that it'll be passed to getElement to ensure there's only one.
@param {boolean} [offset=false] - If true size will include scrollbar and borders.
@return {number} size - The size in pixels.
@exa... | [
"Get",
"element",
"s",
"size",
"in",
"pixels",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L2020-L2027 |
39,988 | chirashijs/chirashi | dist/chirashi.common.js | getStyleProp | function getStyleProp(element) {
var computedStyle = getComputedStyle(element);
if (!computedStyle) return false;
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
return _getOneOrMore(props, _parseProp.bind(n... | javascript | function getStyleProp(element) {
var computedStyle = getComputedStyle(element);
if (!computedStyle) return false;
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
return _getOneOrMore(props, _parseProp.bind(n... | [
"function",
"getStyleProp",
"(",
"element",
")",
"{",
"var",
"computedStyle",
"=",
"getComputedStyle",
"(",
"element",
")",
";",
"if",
"(",
"!",
"computedStyle",
")",
"return",
"false",
";",
"for",
"(",
"var",
"_len",
"=",
"arguments",
".",
"length",
",",
... | Get computed style props of an element. While getComputedStyle returns all properties, getStyleProp returns only needed and convert unitless numeric values or pixels values into numbers.
@param {(string|Array|NodeList|HTMLCollection|Element)} element - The element. Note that it'll be passed to getElement to ensure ther... | [
"Get",
"computed",
"style",
"props",
"of",
"an",
"element",
".",
"While",
"getComputedStyle",
"returns",
"all",
"properties",
"getStyleProp",
"returns",
"only",
"needed",
"and",
"convert",
"unitless",
"numeric",
"values",
"or",
"pixels",
"values",
"into",
"numbers... | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L2051-L2061 |
39,989 | chirashijs/chirashi | dist/chirashi.common.js | offset | function offset(element) {
var screenPos = screenPosition(element);
return screenPos && {
top: screenPos.top + window.scrollY,
left: screenPos.left + window.scrollX
};
} | javascript | function offset(element) {
var screenPos = screenPosition(element);
return screenPos && {
top: screenPos.top + window.scrollY,
left: screenPos.left + window.scrollX
};
} | [
"function",
"offset",
"(",
"element",
")",
"{",
"var",
"screenPos",
"=",
"screenPosition",
"(",
"element",
")",
";",
"return",
"screenPos",
"&&",
"{",
"top",
":",
"screenPos",
".",
"top",
"+",
"window",
".",
"scrollY",
",",
"left",
":",
"screenPos",
".",... | Returns the top and left offset of an element. Offset is relative to web page.
@param {(string|Array|NodeList|HTMLCollection|Element)} element - The element. Note that it'll be passed to getElement to ensure there's only one.
@return {(Object|boolean)} offset - Offset object or false if no element found.
@return {Objec... | [
"Returns",
"the",
"top",
"and",
"left",
"offset",
"of",
"an",
"element",
".",
"Offset",
"is",
"relative",
"to",
"web",
"page",
"."
] | 9efdbccd2f618e1484b0b605e4b7179ddf93fa16 | https://github.com/chirashijs/chirashi/blob/9efdbccd2f618e1484b0b605e4b7179ddf93fa16/dist/chirashi.common.js#L2186-L2193 |
39,990 | socialally/zephyr | lib/zephyr.js | plugin | function plugin(plugins) {
var z, method, conf;
for(z in plugins) {
if(typeof plugins[z] === 'function') {
method = plugins[z];
}else{
method = plugins[z].plugin;
conf = plugins[z].conf;
}
if(opts.field && typeof method[opts.field] === 'function'... | javascript | function plugin(plugins) {
var z, method, conf;
for(z in plugins) {
if(typeof plugins[z] === 'function') {
method = plugins[z];
}else{
method = plugins[z].plugin;
conf = plugins[z].conf;
}
if(opts.field && typeof method[opts.field] === 'function'... | [
"function",
"plugin",
"(",
"plugins",
")",
"{",
"var",
"z",
",",
"method",
",",
"conf",
";",
"for",
"(",
"z",
"in",
"plugins",
")",
"{",
"if",
"(",
"typeof",
"plugins",
"[",
"z",
"]",
"===",
"'function'",
")",
"{",
"method",
"=",
"plugins",
"[",
... | Plugin method.
@param plugins Array of plugin functions. | [
"Plugin",
"method",
"."
] | 47b0bc31b813001bf9e88e023f04ab3616eb0fa9 | https://github.com/socialally/zephyr/blob/47b0bc31b813001bf9e88e023f04ab3616eb0fa9/lib/zephyr.js#L21-L36 |
39,991 | socialally/zephyr | lib/zephyr.js | hook | function hook() {
var comp = hook.proxy.apply(null, arguments);
for(var i = 0;i < hooks.length;i++) {
hooks[i].apply(comp, arguments);
}
return comp;
} | javascript | function hook() {
var comp = hook.proxy.apply(null, arguments);
for(var i = 0;i < hooks.length;i++) {
hooks[i].apply(comp, arguments);
}
return comp;
} | [
"function",
"hook",
"(",
")",
"{",
"var",
"comp",
"=",
"hook",
".",
"proxy",
".",
"apply",
"(",
"null",
",",
"arguments",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"hooks",
".",
"length",
";",
"i",
"++",
")",
"{",
"hooks",
"[... | Invoke constructor hooks by proxying to the main construct
function and invoking registered hook functions in the scope
of the created component. | [
"Invoke",
"constructor",
"hooks",
"by",
"proxying",
"to",
"the",
"main",
"construct",
"function",
"and",
"invoking",
"registered",
"hook",
"functions",
"in",
"the",
"scope",
"of",
"the",
"created",
"component",
"."
] | 47b0bc31b813001bf9e88e023f04ab3616eb0fa9 | https://github.com/socialally/zephyr/blob/47b0bc31b813001bf9e88e023f04ab3616eb0fa9/lib/zephyr.js#L56-L62 |
39,992 | ssbc/graphreduce | traverse.js | widthTraverse | function widthTraverse (graph, reachable, start, depth, hops, iter) {
if(!start)
throw new Error('Graphmitter#traverse: start must be provided')
//var nodes = 1
reachable[start] = reachable[start] == null ? 0 : reachable[start]
var queue = [start] //{key: start, hops: depth}]
iter = iter || function ()... | javascript | function widthTraverse (graph, reachable, start, depth, hops, iter) {
if(!start)
throw new Error('Graphmitter#traverse: start must be provided')
//var nodes = 1
reachable[start] = reachable[start] == null ? 0 : reachable[start]
var queue = [start] //{key: start, hops: depth}]
iter = iter || function ()... | [
"function",
"widthTraverse",
"(",
"graph",
",",
"reachable",
",",
"start",
",",
"depth",
",",
"hops",
",",
"iter",
")",
"{",
"if",
"(",
"!",
"start",
")",
"throw",
"new",
"Error",
"(",
"'Graphmitter#traverse: start must be provided'",
")",
"//var nodes = 1",
"... | mutates `reachable`, btw | [
"mutates",
"reachable",
"btw"
] | a553abbb95a2237e98fcebe91fdcd92cc6cb6ea0 | https://github.com/ssbc/graphreduce/blob/a553abbb95a2237e98fcebe91fdcd92cc6cb6ea0/traverse.js#L33-L64 |
39,993 | ssbc/graphreduce | traverse.js | toArray | function toArray (span, root) {
if(!span[root]) return null
var a = [root]
while(span[root])
a.push(root = span[root])
return a.reverse()
} | javascript | function toArray (span, root) {
if(!span[root]) return null
var a = [root]
while(span[root])
a.push(root = span[root])
return a.reverse()
} | [
"function",
"toArray",
"(",
"span",
",",
"root",
")",
"{",
"if",
"(",
"!",
"span",
"[",
"root",
"]",
")",
"return",
"null",
"var",
"a",
"=",
"[",
"root",
"]",
"while",
"(",
"span",
"[",
"root",
"]",
")",
"a",
".",
"push",
"(",
"root",
"=",
"s... | find the shortest path between two nodes. if there was no path within max hops, return null. convert a spanning tree to an array. | [
"find",
"the",
"shortest",
"path",
"between",
"two",
"nodes",
".",
"if",
"there",
"was",
"no",
"path",
"within",
"max",
"hops",
"return",
"null",
".",
"convert",
"a",
"spanning",
"tree",
"to",
"an",
"array",
"."
] | a553abbb95a2237e98fcebe91fdcd92cc6cb6ea0 | https://github.com/ssbc/graphreduce/blob/a553abbb95a2237e98fcebe91fdcd92cc6cb6ea0/traverse.js#L116-L122 |
39,994 | myelements/myelements.jquery | lib/client/lib/can.view/can.custom.js | function(oldObserved, newObserveSet, onchanged) {
for (var name in newObserveSet) {
bindOrPreventUnbinding(oldObserved, newObserveSet, name, onchanged);
}
} | javascript | function(oldObserved, newObserveSet, onchanged) {
for (var name in newObserveSet) {
bindOrPreventUnbinding(oldObserved, newObserveSet, name, onchanged);
}
} | [
"function",
"(",
"oldObserved",
",",
"newObserveSet",
",",
"onchanged",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"newObserveSet",
")",
"{",
"bindOrPreventUnbinding",
"(",
"oldObserved",
",",
"newObserveSet",
",",
"name",
",",
"onchanged",
")",
";",
"}",
"}... | This will not be optimized. | [
"This",
"will",
"not",
"be",
"optimized",
"."
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/lib/can.view/can.custom.js#L1066-L1070 | |
39,995 | myelements/myelements.jquery | lib/client/lib/can.view/can.custom.js | function(oldObserved, newObserveSet, name, onchanged) {
if (oldObserved[name]) {
// After binding is set up, values
// in `oldObserved` will be unbound. So if a name
// has already be observed, remove from `oldObserved`
// to prevent this.
... | javascript | function(oldObserved, newObserveSet, name, onchanged) {
if (oldObserved[name]) {
// After binding is set up, values
// in `oldObserved` will be unbound. So if a name
// has already be observed, remove from `oldObserved`
// to prevent this.
... | [
"function",
"(",
"oldObserved",
",",
"newObserveSet",
",",
"name",
",",
"onchanged",
")",
"{",
"if",
"(",
"oldObserved",
"[",
"name",
"]",
")",
"{",
"// After binding is set up, values",
"// in `oldObserved` will be unbound. So if a name",
"// has already be observed, remov... | This will be optimized. | [
"This",
"will",
"be",
"optimized",
"."
] | 0123edec30fc70ea494611695b5b2593e4f23745 | https://github.com/myelements/myelements.jquery/blob/0123edec30fc70ea494611695b5b2593e4f23745/lib/client/lib/can.view/can.custom.js#L1072-L1084 | |
39,996 | caleb/broccoli-fast-browserify | index.js | function() {
bundle.browserify.pipeline.get('deps').push(through.obj(function(row, enc, next) {
var file = row.expose ? bundle.browserify._expose[row.id] : row.file;
if (self.cache) {
bundle.browserifyOptions.cache[file] = {
source: ro... | javascript | function() {
bundle.browserify.pipeline.get('deps').push(through.obj(function(row, enc, next) {
var file = row.expose ? bundle.browserify._expose[row.id] : row.file;
if (self.cache) {
bundle.browserifyOptions.cache[file] = {
source: ro... | [
"function",
"(",
")",
"{",
"bundle",
".",
"browserify",
".",
"pipeline",
".",
"get",
"(",
"'deps'",
")",
".",
"push",
"(",
"through",
".",
"obj",
"(",
"function",
"(",
"row",
",",
"enc",
",",
"next",
")",
"{",
"var",
"file",
"=",
"row",
".",
"exp... | Watch dependencies for changes and invalidate the cache when needed | [
"Watch",
"dependencies",
"for",
"changes",
"and",
"invalidate",
"the",
"cache",
"when",
"needed"
] | 01c358827a49ec4f02cb363825a5e2661473c121 | https://github.com/caleb/broccoli-fast-browserify/blob/01c358827a49ec4f02cb363825a5e2661473c121/index.js#L220-L234 | |
39,997 | localvoid/iko | packages/karma-iko/lib/reporter.js | IkoReporter | function IkoReporter(baseReporterDecorator, config, loggerFactory, formatError) {
// extend the base reporter
baseReporterDecorator(this);
const logger = loggerFactory.create("reporter.iko");
const divider = "=".repeat(process.stdout.columns || 80);
let slow = 0;
let totalTime = 0;
let netTime = 0;
... | javascript | function IkoReporter(baseReporterDecorator, config, loggerFactory, formatError) {
// extend the base reporter
baseReporterDecorator(this);
const logger = loggerFactory.create("reporter.iko");
const divider = "=".repeat(process.stdout.columns || 80);
let slow = 0;
let totalTime = 0;
let netTime = 0;
... | [
"function",
"IkoReporter",
"(",
"baseReporterDecorator",
",",
"config",
",",
"loggerFactory",
",",
"formatError",
")",
"{",
"// extend the base reporter",
"baseReporterDecorator",
"(",
"this",
")",
";",
"const",
"logger",
"=",
"loggerFactory",
".",
"create",
"(",
"\... | The IkoReporter.
@param {!object} baseReporterDecorator The karma base reporter.
@param {!object} config The karma config.
@param {!object} loggerFactory The karma logger factory.
@constructor | [
"The",
"IkoReporter",
"."
] | 640cb45fefacfff20da449d74b9de2f4e7baf15e | https://github.com/localvoid/iko/blob/640cb45fefacfff20da449d74b9de2f4e7baf15e/packages/karma-iko/lib/reporter.js#L82-L211 |
39,998 | thehivecorporation/git-command-line | index.js | function(options){
if (!options) {
options = {
cwd: workingDirectory
};
return options;
} else {
workingDirectory = options.cwd;
return options;
}
} | javascript | function(options){
if (!options) {
options = {
cwd: workingDirectory
};
return options;
} else {
workingDirectory = options.cwd;
return options;
}
} | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"options",
")",
"{",
"options",
"=",
"{",
"cwd",
":",
"workingDirectory",
"}",
";",
"return",
"options",
";",
"}",
"else",
"{",
"workingDirectory",
"=",
"options",
".",
"cwd",
";",
"return",
"option... | Prepare options to use the set working directory in the following commands
@param options
@returns {*} | [
"Prepare",
"options",
"to",
"use",
"the",
"set",
"working",
"directory",
"in",
"the",
"following",
"commands"
] | 8af0fb07332696f7f85a4a30b312f3e6b27e2d5d | https://github.com/thehivecorporation/git-command-line/blob/8af0fb07332696f7f85a4a30b312f3e6b27e2d5d/index.js#L341-L352 | |
39,999 | thehivecorporation/git-command-line | index.js | function (command, options) {
var exec = require('child_process').exec;
var defer = Q.defer();
//Prepare the options object to be valid
options = prepareOptions(options);
//Activate-Deactivate command logging execution
printCommandExecution(command, options);
e... | javascript | function (command, options) {
var exec = require('child_process').exec;
var defer = Q.defer();
//Prepare the options object to be valid
options = prepareOptions(options);
//Activate-Deactivate command logging execution
printCommandExecution(command, options);
e... | [
"function",
"(",
"command",
",",
"options",
")",
"{",
"var",
"exec",
"=",
"require",
"(",
"'child_process'",
")",
".",
"exec",
";",
"var",
"defer",
"=",
"Q",
".",
"defer",
"(",
")",
";",
"//Prepare the options object to be valid",
"options",
"=",
"prepareOpt... | Main function to use the command line tools to execute git commands
@param command Command to execute. Do not include 'git ' prefix
@param options Options available in exec command https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
@returns {promise|*|Q.promise} | [
"Main",
"function",
"to",
"use",
"the",
"command",
"line",
"tools",
"to",
"execute",
"git",
"commands"
] | 8af0fb07332696f7f85a4a30b312f3e6b27e2d5d | https://github.com/thehivecorporation/git-command-line/blob/8af0fb07332696f7f85a4a30b312f3e6b27e2d5d/index.js#L380-L402 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.