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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
57,700 | 5long/roil | src/console/simpleyui.js | function(plugin) {
var ns = plugin,
plugins = this._plugins;
if (L.isFunction(plugin)) {
ns = plugin.NS;
if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {
ns = null;
}
}
if ... | javascript | function(plugin) {
var ns = plugin,
plugins = this._plugins;
if (L.isFunction(plugin)) {
ns = plugin.NS;
if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {
ns = null;
}
}
if ... | [
"function",
"(",
"plugin",
")",
"{",
"var",
"ns",
"=",
"plugin",
",",
"plugins",
"=",
"this",
".",
"_plugins",
";",
"if",
"(",
"L",
".",
"isFunction",
"(",
"plugin",
")",
")",
"{",
"ns",
"=",
"plugin",
".",
"NS",
";",
"if",
"(",
"ns",
"&&",
"("... | Unplugs and destroys a plugin already instantiated with the host.
@method _unplug
@private
@param {String | Function} plugin The namespace for the plugin, or a plugin class with the static NS property defined. | [
"Unplugs",
"and",
"destroys",
"a",
"plugin",
"already",
"instantiated",
"with",
"the",
"host",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10236-L10256 | |
57,701 | 5long/roil | src/console/simpleyui.js | function() {
var str = this[UID] + ': not bound to a node',
node = this._node,
attrs, id, className;
if (node) {
attrs = node.attributes;
id = (attrs && attrs.id) ? node.getAttribute('id') : null;
className = (attrs && attrs.className) ? node.... | javascript | function() {
var str = this[UID] + ': not bound to a node',
node = this._node,
attrs, id, className;
if (node) {
attrs = node.attributes;
id = (attrs && attrs.id) ? node.getAttribute('id') : null;
className = (attrs && attrs.className) ? node.... | [
"function",
"(",
")",
"{",
"var",
"str",
"=",
"this",
"[",
"UID",
"]",
"+",
"': not bound to a node'",
",",
"node",
"=",
"this",
".",
"_node",
",",
"attrs",
",",
"id",
",",
"className",
";",
"if",
"(",
"node",
")",
"{",
"attrs",
"=",
"node",
".",
... | The method called when outputting Node instances as strings
@method toString
@return {String} A string representation of the Node instance | [
"The",
"method",
"called",
"when",
"outputting",
"Node",
"instances",
"as",
"strings"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10794-L10817 | |
57,702 | 5long/roil | src/console/simpleyui.js | function(attr) {
var attrConfig = Y_Node.ATTRS[attr],
val;
if (attrConfig && attrConfig.getter) {
val = attrConfig.getter.call(this);
} else if (Y_Node.re_aria.test(attr)) {
val = this._node.getAttribute(attr, 2);
} else {
val = Y_Node.DE... | javascript | function(attr) {
var attrConfig = Y_Node.ATTRS[attr],
val;
if (attrConfig && attrConfig.getter) {
val = attrConfig.getter.call(this);
} else if (Y_Node.re_aria.test(attr)) {
val = this._node.getAttribute(attr, 2);
} else {
val = Y_Node.DE... | [
"function",
"(",
"attr",
")",
"{",
"var",
"attrConfig",
"=",
"Y_Node",
".",
"ATTRS",
"[",
"attr",
"]",
",",
"val",
";",
"if",
"(",
"attrConfig",
"&&",
"attrConfig",
".",
"getter",
")",
"{",
"val",
"=",
"attrConfig",
".",
"getter",
".",
"call",
"(",
... | Helper method for get.
@method _get
@private
@param {String} attr The attribute
@return {any} The current value of the attribute | [
"Helper",
"method",
"for",
"get",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10852-L10865 | |
57,703 | 5long/roil | src/console/simpleyui.js | function(attrMap) {
if (this._setAttrs) { // use Attribute imple
this._setAttrs(attrMap);
} else { // use setters inline
Y.Object.each(attrMap, function(v, n) {
this.set(n, v);
}, this);
}
return this;
} | javascript | function(attrMap) {
if (this._setAttrs) { // use Attribute imple
this._setAttrs(attrMap);
} else { // use setters inline
Y.Object.each(attrMap, function(v, n) {
this.set(n, v);
}, this);
}
return this;
} | [
"function",
"(",
"attrMap",
")",
"{",
"if",
"(",
"this",
".",
"_setAttrs",
")",
"{",
"// use Attribute imple",
"this",
".",
"_setAttrs",
"(",
"attrMap",
")",
";",
"}",
"else",
"{",
"// use setters inline",
"Y",
".",
"Object",
".",
"each",
"(",
"attrMap",
... | Sets multiple attributes.
@method setAttrs
@param {Object} attrMap an object of name/value pairs to set
@chainable | [
"Sets",
"multiple",
"attributes",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10902-L10912 | |
57,704 | 5long/roil | src/console/simpleyui.js | function(attrs) {
var ret = {};
if (this._getAttrs) { // use Attribute imple
this._getAttrs(attrs);
} else { // use setters inline
Y.Array.each(attrs, function(v, n) {
ret[v] = this.get(v);
}, this);
}
return ret;
} | javascript | function(attrs) {
var ret = {};
if (this._getAttrs) { // use Attribute imple
this._getAttrs(attrs);
} else { // use setters inline
Y.Array.each(attrs, function(v, n) {
ret[v] = this.get(v);
}, this);
}
return ret;
} | [
"function",
"(",
"attrs",
")",
"{",
"var",
"ret",
"=",
"{",
"}",
";",
"if",
"(",
"this",
".",
"_getAttrs",
")",
"{",
"// use Attribute imple",
"this",
".",
"_getAttrs",
"(",
"attrs",
")",
";",
"}",
"else",
"{",
"// use setters inline",
"Y",
".",
"Array... | Returns an object containing the values for the requested attributes.
@method getAttrs
@param {Array} attrs an array of attributes to get values
@return {Object} An object with attribute name/value pairs. | [
"Returns",
"an",
"object",
"containing",
"the",
"values",
"for",
"the",
"requested",
"attributes",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10920-L10931 | |
57,705 | 5long/roil | src/console/simpleyui.js | function(doc) {
var node = this._node;
doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];
if (doc.documentElement) {
return Y_DOM.contains(doc.documentElement, node);
}
} | javascript | function(doc) {
var node = this._node;
doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];
if (doc.documentElement) {
return Y_DOM.contains(doc.documentElement, node);
}
} | [
"function",
"(",
"doc",
")",
"{",
"var",
"node",
"=",
"this",
".",
"_node",
";",
"doc",
"=",
"(",
"doc",
")",
"?",
"doc",
".",
"_node",
"||",
"doc",
":",
"node",
"[",
"OWNER_DOCUMENT",
"]",
";",
"if",
"(",
"doc",
".",
"documentElement",
")",
"{",... | Determines whether the node is appended to the document.
@method inDoc
@param {Node|HTMLElement} doc optional An optional document to check against.
Defaults to current document.
@return {Boolean} Whether or not this node is appended to the document. | [
"Determines",
"whether",
"the",
"node",
"is",
"appended",
"to",
"the",
"document",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10965-L10971 | |
57,706 | 5long/roil | src/console/simpleyui.js | function(fn, testSelf) {
return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf));
} | javascript | function(fn, testSelf) {
return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf));
} | [
"function",
"(",
"fn",
",",
"testSelf",
")",
"{",
"return",
"Y",
".",
"one",
"(",
"Y_DOM",
".",
"ancestor",
"(",
"this",
".",
"_node",
",",
"_wrapFn",
"(",
"fn",
")",
",",
"testSelf",
")",
")",
";",
"}"
] | Returns the nearest ancestor that passes the test applied by supplied boolean method.
@method ancestor
@param {String | Function} fn A selector string or boolean method for testing elements.
@param {Boolean} testSelf optional Whether or not to include the element in the scan
If a function is used, it receives the curre... | [
"Returns",
"the",
"nearest",
"ancestor",
"that",
"passes",
"the",
"test",
"applied",
"by",
"supplied",
"boolean",
"method",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L10992-L10994 | |
57,707 | 5long/roil | src/console/simpleyui.js | function(fn, all) {
return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
} | javascript | function(fn, all) {
return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));
} | [
"function",
"(",
"fn",
",",
"all",
")",
"{",
"return",
"Y",
".",
"one",
"(",
"Y_DOM",
".",
"elementByAxis",
"(",
"this",
".",
"_node",
",",
"'previousSibling'",
",",
"_wrapFn",
"(",
"fn",
")",
",",
"all",
")",
")",
";",
"}"
] | Returns the previous matching sibling.
Returns the nearest element node sibling if no method provided.
@method previous
@param {String | Function} fn A selector or boolean method for testing elements.
If a function is used, it receives the current node being tested as the only argument.
@return {Node} Node instance or ... | [
"Returns",
"the",
"previous",
"matching",
"sibling",
".",
"Returns",
"the",
"nearest",
"element",
"node",
"sibling",
"if",
"no",
"method",
"provided",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11004-L11006 | |
57,708 | 5long/roil | src/console/simpleyui.js | function(content, where) {
var node = this._node;
if (content) {
if (typeof where === 'number') { // allow index
where = this._node.childNodes[where];
} else if (where && where._node) { // Node
where = where._node;
}
if (t... | javascript | function(content, where) {
var node = this._node;
if (content) {
if (typeof where === 'number') { // allow index
where = this._node.childNodes[where];
} else if (where && where._node) { // Node
where = where._node;
}
if (t... | [
"function",
"(",
"content",
",",
"where",
")",
"{",
"var",
"node",
"=",
"this",
".",
"_node",
";",
"if",
"(",
"content",
")",
"{",
"if",
"(",
"typeof",
"where",
"===",
"'number'",
")",
"{",
"// allow index",
"where",
"=",
"this",
".",
"_node",
".",
... | Inserts the content before the reference node.
@method insert
@param {String | Y.Node | HTMLElement} content The content to insert
@param {Int | Y.Node | HTMLElement | String} where The position to insert at.
Possible "where" arguments
<dl>
<dt>Y.Node</dt>
<dd>The Node to insert before</dd>
<dt>HTMLElement</dt>
<dd>The... | [
"Inserts",
"the",
"content",
"before",
"the",
"reference",
"node",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11248-L11274 | |
57,709 | 5long/roil | src/console/simpleyui.js | function(content) {
if (content) {
if (content._node) { // map to DOMNode
content = content._node;
} else if (content._nodes) { // convert DOMNodeList to documentFragment
content = Y_DOM._nl2frag(content._nodes);
}
}
Y_DOM.add... | javascript | function(content) {
if (content) {
if (content._node) { // map to DOMNode
content = content._node;
} else if (content._nodes) { // convert DOMNodeList to documentFragment
content = Y_DOM._nl2frag(content._nodes);
}
}
Y_DOM.add... | [
"function",
"(",
"content",
")",
"{",
"if",
"(",
"content",
")",
"{",
"if",
"(",
"content",
".",
"_node",
")",
"{",
"// map to DOMNode",
"content",
"=",
"content",
".",
"_node",
";",
"}",
"else",
"if",
"(",
"content",
".",
"_nodes",
")",
"{",
"// con... | Replaces the node's current content with the content.
@method setContent
@param {String | Y.Node | HTMLElement} content The content to insert
@chainable | [
"Replaces",
"the",
"node",
"s",
"current",
"content",
"with",
"the",
"content",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11302-L11314 | |
57,710 | 5long/roil | src/console/simpleyui.js | function(fn, context) {
var instance = this;
return Y.Array.some(this._nodes, function(node, index) {
node = Y.one(node);
context = context || node;
return fn.call(context, node, index, instance);
});
} | javascript | function(fn, context) {
var instance = this;
return Y.Array.some(this._nodes, function(node, index) {
node = Y.one(node);
context = context || node;
return fn.call(context, node, index, instance);
});
} | [
"function",
"(",
"fn",
",",
"context",
")",
"{",
"var",
"instance",
"=",
"this",
";",
"return",
"Y",
".",
"Array",
".",
"some",
"(",
"this",
".",
"_nodes",
",",
"function",
"(",
"node",
",",
"index",
")",
"{",
"node",
"=",
"Y",
".",
"one",
"(",
... | Executes the function once for each node until a true value is returned.
@method some
@param {Function} fn The function to apply. It receives 3 arguments:
the current node instance, the node's index, and the NodeList instance
@param {Object} context optional An optional context to execute the function from.
Default con... | [
"Executes",
"the",
"function",
"once",
"for",
"each",
"node",
"until",
"a",
"true",
"value",
"is",
"returned",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11586-L11593 | |
57,711 | 5long/roil | src/console/simpleyui.js | function() {
var doc,
nodes = this._nodes,
query = this._query,
root = this._queryRoot;
if (query) {
if (!root) {
if (nodes && nodes[0] && nodes[0].ownerDocument) {
root = nodes[0].ownerDocument;
}
... | javascript | function() {
var doc,
nodes = this._nodes,
query = this._query,
root = this._queryRoot;
if (query) {
if (!root) {
if (nodes && nodes[0] && nodes[0].ownerDocument) {
root = nodes[0].ownerDocument;
}
... | [
"function",
"(",
")",
"{",
"var",
"doc",
",",
"nodes",
"=",
"this",
".",
"_nodes",
",",
"query",
"=",
"this",
".",
"_query",
",",
"root",
"=",
"this",
".",
"_queryRoot",
";",
"if",
"(",
"query",
")",
"{",
"if",
"(",
"!",
"root",
")",
"{",
"if",... | Reruns the initial query, when created using a selector query
@method refresh
@chainable | [
"Reruns",
"the",
"initial",
"query",
"when",
"created",
"using",
"a",
"selector",
"query"
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11676-L11693 | |
57,712 | 5long/roil | src/console/simpleyui.js | function(type, fn, context) {
return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments));
} | javascript | function(type, fn, context) {
return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments));
} | [
"function",
"(",
"type",
",",
"fn",
",",
"context",
")",
"{",
"return",
"Y",
".",
"on",
".",
"apply",
"(",
"Y",
",",
"this",
".",
"_prepEvtArgs",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
")",
";",
"}"
] | Applies an event listener to each Node bound to the NodeList.
@method on
@param {String} type The event being listened for
@param {Function} fn The handler to call when the event fires
@param {Object} context The context to call the handler with.
Default is the NodeList instance.
@return {Object} Returns an event handl... | [
"Applies",
"an",
"event",
"listener",
"to",
"each",
"Node",
"bound",
"to",
"the",
"NodeList",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L11720-L11722 | |
57,713 | 5long/roil | src/console/simpleyui.js | function (s,reviver) {
// Replace certain Unicode characters that are otherwise handled
// incorrectly by some browser implementations.
// NOTE: This modifies the input if such characters are found!
s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);
// Test for any re... | javascript | function (s,reviver) {
// Replace certain Unicode characters that are otherwise handled
// incorrectly by some browser implementations.
// NOTE: This modifies the input if such characters are found!
s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);
// Test for any re... | [
"function",
"(",
"s",
",",
"reviver",
")",
"{",
"// Replace certain Unicode characters that are otherwise handled",
"// incorrectly by some browser implementations.",
"// NOTE: This modifies the input if such characters are found!",
"s",
"=",
"s",
".",
"replace",
"(",
"_UNICODE_EXCEP... | Alias to native browser implementation of the JSON object if available.
@property Native
@type {Object}
@private | [
"Alias",
"to",
"native",
"browser",
"implementation",
"of",
"the",
"JSON",
"object",
"if",
"available",
"."
] | 37b14072a7aea17accc7f4e5e04dedc90a1358de | https://github.com/5long/roil/blob/37b14072a7aea17accc7f4e5e04dedc90a1358de/src/console/simpleyui.js#L13915-L13932 | |
57,714 | rsdoiel/tbone | depreciated/tbone_util.js | function (s) {
return s.replace(re_NewLine, NewLine).replace(re_quot, quot).replace(re_apos, apos).replace(re_acute, acute).replace(re_sbquo, sbquo).replace(re_bdquo, bdquo).replace(re_hellip, hellip).replace(re_dagger, dagger).replace(re_Dagger, Dagger).replace(re_lsquo, lsquo).replace(re_rsquo, rsquo).replace(re_ld... | javascript | function (s) {
return s.replace(re_NewLine, NewLine).replace(re_quot, quot).replace(re_apos, apos).replace(re_acute, acute).replace(re_sbquo, sbquo).replace(re_bdquo, bdquo).replace(re_hellip, hellip).replace(re_dagger, dagger).replace(re_Dagger, Dagger).replace(re_lsquo, lsquo).replace(re_rsquo, rsquo).replace(re_ld... | [
"function",
"(",
"s",
")",
"{",
"return",
"s",
".",
"replace",
"(",
"re_NewLine",
",",
"NewLine",
")",
".",
"replace",
"(",
"re_quot",
",",
"quot",
")",
".",
"replace",
"(",
"re_apos",
",",
"apos",
")",
".",
"replace",
"(",
"re_acute",
",",
"acute",
... | HTML_UTIL 5 entity and utility methods | [
"HTML_UTIL",
"5",
"entity",
"and",
"utility",
"methods"
] | f05d2bba81d40f2b792a247dadce7d1a45342227 | https://github.com/rsdoiel/tbone/blob/f05d2bba81d40f2b792a247dadce7d1a45342227/depreciated/tbone_util.js#L260-L262 | |
57,715 | kchapelier/migl-pool | src/pool.js | function (options) {
poolId++;
return new Pool(
options.name ? options.name + ' (pool #' + poolId + ')' : 'pool #' + poolId,
options.factory,
options.initialize || noop,
options.firstAllocationNumber || 20,
options.allocationNumber || 1
... | javascript | function (options) {
poolId++;
return new Pool(
options.name ? options.name + ' (pool #' + poolId + ')' : 'pool #' + poolId,
options.factory,
options.initialize || noop,
options.firstAllocationNumber || 20,
options.allocationNumber || 1
... | [
"function",
"(",
"options",
")",
"{",
"poolId",
"++",
";",
"return",
"new",
"Pool",
"(",
"options",
".",
"name",
"?",
"options",
".",
"name",
"+",
"' (pool #'",
"+",
"poolId",
"+",
"')'",
":",
"'pool #'",
"+",
"poolId",
",",
"options",
".",
"factory",
... | Create an object pool
@param {Object} options Pool options (name, factory, initialize, firstAllocationNumber, allocationNumber)
@returns {Pool} Instance of the object pool | [
"Create",
"an",
"object",
"pool"
] | d8ee91d577d53df40cae34e9e6efa84abb9d5cfb | https://github.com/kchapelier/migl-pool/blob/d8ee91d577d53df40cae34e9e6efa84abb9d5cfb/src/pool.js#L105-L115 | |
57,716 | AndreasMadsen/immortal | lib/core/streams.js | RelayStream | function RelayStream(option) {
Stream.apply(this, arguments);
this.writable = true;
this.readable = true;
this.store = [];
this.paused = !!option.paused;
this.closed = false;
} | javascript | function RelayStream(option) {
Stream.apply(this, arguments);
this.writable = true;
this.readable = true;
this.store = [];
this.paused = !!option.paused;
this.closed = false;
} | [
"function",
"RelayStream",
"(",
"option",
")",
"{",
"Stream",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"writable",
"=",
"true",
";",
"this",
".",
"readable",
"=",
"true",
";",
"this",
".",
"store",
"=",
"[",
"]",
";",
"th... | This constructor will simply relay data
by purpose this do not support .end or .close | [
"This",
"constructor",
"will",
"simply",
"relay",
"data",
"by",
"purpose",
"this",
"do",
"not",
"support",
".",
"end",
"or",
".",
"close"
] | c1ab5a4287a543fdfd980604a9e9927d663a9ef2 | https://github.com/AndreasMadsen/immortal/blob/c1ab5a4287a543fdfd980604a9e9927d663a9ef2/lib/core/streams.js#L24-L32 |
57,717 | redisjs/jsr-validate | lib/index.js | validate | function validate(cmd, args, info) {
info = info || {};
var conf = info.conf || {}
, authrequired = typeof conf.requirepass === 'string'
, db = info.db
, result;
// handle quit command special case
if(cmd === COMMANDS.QUIT) {
// reply with an object that mimics succesful validation
info.com... | javascript | function validate(cmd, args, info) {
info = info || {};
var conf = info.conf || {}
, authrequired = typeof conf.requirepass === 'string'
, db = info.db
, result;
// handle quit command special case
if(cmd === COMMANDS.QUIT) {
// reply with an object that mimics succesful validation
info.com... | [
"function",
"validate",
"(",
"cmd",
",",
"args",
",",
"info",
")",
"{",
"info",
"=",
"info",
"||",
"{",
"}",
";",
"var",
"conf",
"=",
"info",
".",
"conf",
"||",
"{",
"}",
",",
"authrequired",
"=",
"typeof",
"conf",
".",
"requirepass",
"===",
"'stri... | Performs complete validation for an incoming command.
The command name should be lowercase.
@param cmd The command name.
@param args The command arguments.
@param info The configuration and current database pointer. | [
"Performs",
"complete",
"validation",
"for",
"an",
"incoming",
"command",
"."
] | 2e0dddafb32c019ef9293a35b96cdd78dd8e4ae5 | https://github.com/redisjs/jsr-validate/blob/2e0dddafb32c019ef9293a35b96cdd78dd8e4ae5/lib/index.js#L16-L55 |
57,718 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | indexOf | function indexOf(match) {
var i = matches.length;
while (i--) {
if (matches[i] === match) {
return i;
}
}
return -1;
} | javascript | function indexOf(match) {
var i = matches.length;
while (i--) {
if (matches[i] === match) {
return i;
}
}
return -1;
} | [
"function",
"indexOf",
"(",
"match",
")",
"{",
"var",
"i",
"=",
"matches",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{",
"if",
"(",
"matches",
"[",
"i",
"]",
"===",
"match",
")",
"{",
"return",
"i",
";",
"}",
"}",
"return",
"-",
"1",
... | Returns the index of a specific match object or -1 if it isn't found.
@param {Match} match Text match object.
@return {Number} Index of match or -1 if it isn't found. | [
"Returns",
"the",
"index",
"of",
"a",
"specific",
"match",
"object",
"or",
"-",
"1",
"if",
"it",
"isn",
"t",
"found",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L356-L365 |
57,719 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | filter | function filter(callback) {
var filteredMatches = [];
each(function (match, i) {
if (callback(match, i)) {
filteredMatches.push(match);
}
});
matches = filteredMatches;
/*jshint validthis:true*/
return this;
} | javascript | function filter(callback) {
var filteredMatches = [];
each(function (match, i) {
if (callback(match, i)) {
filteredMatches.push(match);
}
});
matches = filteredMatches;
/*jshint validthis:true*/
return this;
} | [
"function",
"filter",
"(",
"callback",
")",
"{",
"var",
"filteredMatches",
"=",
"[",
"]",
";",
"each",
"(",
"function",
"(",
"match",
",",
"i",
")",
"{",
"if",
"(",
"callback",
"(",
"match",
",",
"i",
")",
")",
"{",
"filteredMatches",
".",
"push",
... | Filters the matches. If the callback returns true it stays if not it gets removed.
@param {Function} callback Callback to execute for each match.
@return {DomTextMatcher} Current DomTextMatcher instance. | [
"Filters",
"the",
"matches",
".",
"If",
"the",
"callback",
"returns",
"true",
"it",
"stays",
"if",
"not",
"it",
"gets",
"removed",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L373-L386 |
57,720 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | each | function each(callback) {
for (var i = 0, l = matches.length; i < l; i++) {
if (callback(matches[i], i) === false) {
break;
}
}
/*jshint validthis:true*/
return this;
} | javascript | function each(callback) {
for (var i = 0, l = matches.length; i < l; i++) {
if (callback(matches[i], i) === false) {
break;
}
}
/*jshint validthis:true*/
return this;
} | [
"function",
"each",
"(",
"callback",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"matches",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"if",
"(",
"callback",
"(",
"matches",
"[",
"i",
"]",
",",
"i",
")",
"==... | Executes the specified callback for each match.
@param {Function} callback Callback to execute for each match.
@return {DomTextMatcher} Current DomTextMatcher instance. | [
"Executes",
"the",
"specified",
"callback",
"for",
"each",
"match",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L394-L403 |
57,721 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | find | function find(regex, data) {
if (text && regex.global) {
while ((m = regex.exec(text))) {
matches.push(createMatch(m, data));
}
}
return this;
} | javascript | function find(regex, data) {
if (text && regex.global) {
while ((m = regex.exec(text))) {
matches.push(createMatch(m, data));
}
}
return this;
} | [
"function",
"find",
"(",
"regex",
",",
"data",
")",
"{",
"if",
"(",
"text",
"&&",
"regex",
".",
"global",
")",
"{",
"while",
"(",
"(",
"m",
"=",
"regex",
".",
"exec",
"(",
"text",
")",
")",
")",
"{",
"matches",
".",
"push",
"(",
"createMatch",
... | Finds the specified regexp and adds them to the matches collection.
@param {RegExp} regex Global regexp to search the current node by.
@param {Object} [data] Optional custom data element for the match.
@return {DomTextMatcher} Current DomTextMatcher instance. | [
"Finds",
"the",
"specified",
"regexp",
"and",
"adds",
"them",
"to",
"the",
"matches",
"collection",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L428-L436 |
57,722 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | unwrap | function unwrap(match) {
var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
i = elements.length;
while (i--) {
unwrapElement(elements[i]);
}
return this;
} | javascript | function unwrap(match) {
var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
i = elements.length;
while (i--) {
unwrapElement(elements[i]);
}
return this;
} | [
"function",
"unwrap",
"(",
"match",
")",
"{",
"var",
"i",
",",
"elements",
"=",
"getWrappersByIndex",
"(",
"match",
"?",
"indexOf",
"(",
"match",
")",
":",
"null",
")",
";",
"i",
"=",
"elements",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{... | Unwraps the specified match object or all matches if unspecified.
@param {Object} [match] Optional match object.
@return {DomTextMatcher} Current DomTextMatcher instance. | [
"Unwraps",
"the",
"specified",
"match",
"object",
"or",
"all",
"matches",
"if",
"unspecified",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L444-L453 |
57,723 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | add | function add(start, length, data) {
matches.push({
start: start,
end: start + length,
text: text.substr(start, length),
data: data
});
return this;
} | javascript | function add(start, length, data) {
matches.push({
start: start,
end: start + length,
text: text.substr(start, length),
data: data
});
return this;
} | [
"function",
"add",
"(",
"start",
",",
"length",
",",
"data",
")",
"{",
"matches",
".",
"push",
"(",
"{",
"start",
":",
"start",
",",
"end",
":",
"start",
"+",
"length",
",",
"text",
":",
"text",
".",
"substr",
"(",
"start",
",",
"length",
")",
",... | Adds match the specified range for example a grammar line.
@param {Number} start Start offset.
@param {Number} length Length of the text.
@param {Object} data Custom data object for match.
@return {DomTextMatcher} Current DomTextMatcher instance. | [
"Adds",
"match",
"the",
"specified",
"range",
"for",
"example",
"a",
"grammar",
"line",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L484-L493 |
57,724 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | rangeFromMatch | function rangeFromMatch(match) {
var wrappers = getWrappersByIndex(indexOf(match));
var rng = editor.dom.createRng();
rng.setStartBefore(wrappers[0]);
rng.setEndAfter(wrappers[wrappers.length - 1]);
return rng;
} | javascript | function rangeFromMatch(match) {
var wrappers = getWrappersByIndex(indexOf(match));
var rng = editor.dom.createRng();
rng.setStartBefore(wrappers[0]);
rng.setEndAfter(wrappers[wrappers.length - 1]);
return rng;
} | [
"function",
"rangeFromMatch",
"(",
"match",
")",
"{",
"var",
"wrappers",
"=",
"getWrappersByIndex",
"(",
"indexOf",
"(",
"match",
")",
")",
";",
"var",
"rng",
"=",
"editor",
".",
"dom",
".",
"createRng",
"(",
")",
";",
"rng",
".",
"setStartBefore",
"(",
... | Returns a DOM range for the specified match.
@param {Object} match Match object to get range for.
@return {DOMRange} DOM Range for the specified match. | [
"Returns",
"a",
"DOM",
"range",
"for",
"the",
"specified",
"match",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L501-L509 |
57,725 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | replace | function replace(match, text) {
var rng = rangeFromMatch(match);
rng.deleteContents();
if (text.length > 0) {
rng.insertNode(editor.dom.doc.createTextNode(text));
}
return rng;
} | javascript | function replace(match, text) {
var rng = rangeFromMatch(match);
rng.deleteContents();
if (text.length > 0) {
rng.insertNode(editor.dom.doc.createTextNode(text));
}
return rng;
} | [
"function",
"replace",
"(",
"match",
",",
"text",
")",
"{",
"var",
"rng",
"=",
"rangeFromMatch",
"(",
"match",
")",
";",
"rng",
".",
"deleteContents",
"(",
")",
";",
"if",
"(",
"text",
".",
"length",
">",
"0",
")",
"{",
"rng",
".",
"insertNode",
"(... | Replaces the specified match with the specified text.
@param {Object} match Match object to replace.
@param {String} text Text to replace the match with.
@return {DOMRange} DOM range produced after the replace. | [
"Replaces",
"the",
"specified",
"match",
"with",
"the",
"specified",
"text",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L518-L528 |
57,726 | adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/spellchecker/plugin.js | markErrors | function markErrors(data) {
var suggestions;
if (data.words) {
hasDictionarySupport = !!data.dictionary;
suggestions = data.words;
} else {
// Fallback to old format
suggestions = data;
}
editor.setProgressState(false);
if (isEmp... | javascript | function markErrors(data) {
var suggestions;
if (data.words) {
hasDictionarySupport = !!data.dictionary;
suggestions = data.words;
} else {
// Fallback to old format
suggestions = data;
}
editor.setProgressState(false);
if (isEmp... | [
"function",
"markErrors",
"(",
"data",
")",
"{",
"var",
"suggestions",
";",
"if",
"(",
"data",
".",
"words",
")",
"{",
"hasDictionarySupport",
"=",
"!",
"!",
"data",
".",
"dictionary",
";",
"suggestions",
"=",
"data",
".",
"words",
";",
"}",
"else",
"{... | Find the specified words and marks them. It will also show suggestions for those words.
@example
editor.plugins.spellchecker.markErrors({
dictionary: true,
words: {
"word1": ["suggestion 1", "Suggestion 2"]
}
});
@param {Object} data Data object containing the words with suggestions. | [
"Find",
"the",
"specified",
"words",
"and",
"marks",
"them",
".",
"It",
"will",
"also",
"show",
"suggestions",
"for",
"those",
"words",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/spellchecker/plugin.js#L1075-L1109 |
57,727 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( filter, context ) {
var element = this,
originalName, name;
context = element.getFilterContext( context );
// Do not process elements with data-cke-processor attribute set to off.
if ( context.off )
return true;
// Filtering if it's the root node.
if ( !element.parent )
filter... | javascript | function( filter, context ) {
var element = this,
originalName, name;
context = element.getFilterContext( context );
// Do not process elements with data-cke-processor attribute set to off.
if ( context.off )
return true;
// Filtering if it's the root node.
if ( !element.parent )
filter... | [
"function",
"(",
"filter",
",",
"context",
")",
"{",
"var",
"element",
"=",
"this",
",",
"originalName",
",",
"name",
";",
"context",
"=",
"element",
".",
"getFilterContext",
"(",
"context",
")",
";",
"// Do not process elements with data-cke-processor attribute set... | Filters this element and its children with the given filter.
@since 4.1
@param {CKEDITOR.htmlParser.filter} filter
@returns {Boolean} The method returns `false` when this element has
been removed or replaced with another. This information means that
{@link #filterChildren} has to repeat the filter on the current
posit... | [
"Filters",
"this",
"element",
"and",
"its",
"children",
"with",
"the",
"given",
"filter",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L160-L254 | |
57,728 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( writer, filter ) {
if ( filter )
this.filter( filter );
var name = this.name,
attribsArray = [],
attributes = this.attributes,
attrName,
attr, i, l;
// Open element tag.
writer.openTag( name, attributes );
// Copy all attributes to an array.
for ( attrName in attribute... | javascript | function( writer, filter ) {
if ( filter )
this.filter( filter );
var name = this.name,
attribsArray = [],
attributes = this.attributes,
attrName,
attr, i, l;
// Open element tag.
writer.openTag( name, attributes );
// Copy all attributes to an array.
for ( attrName in attribute... | [
"function",
"(",
"writer",
",",
"filter",
")",
"{",
"if",
"(",
"filter",
")",
"this",
".",
"filter",
"(",
"filter",
")",
";",
"var",
"name",
"=",
"this",
".",
"name",
",",
"attribsArray",
"=",
"[",
"]",
",",
"attributes",
"=",
"this",
".",
"attribu... | Writes the element HTML to the CKEDITOR.htmlWriter.
@param {CKEDITOR.htmlParser.basicWriter} writer The writer to which HTML will be written.
@param {CKEDITOR.htmlParser.filter} [filter] The filter to be applied to this node.
**Note:** It is unsafe to filter an offline (not appended) node. | [
"Writes",
"the",
"element",
"HTML",
"to",
"the",
"CKEDITOR",
".",
"htmlWriter",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L274-L309 | |
57,729 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function() {
var children = this.children;
for ( var i = children.length; i; )
children[ --i ].insertAfter( this );
this.remove();
} | javascript | function() {
var children = this.children;
for ( var i = children.length; i; )
children[ --i ].insertAfter( this );
this.remove();
} | [
"function",
"(",
")",
"{",
"var",
"children",
"=",
"this",
".",
"children",
";",
"for",
"(",
"var",
"i",
"=",
"children",
".",
"length",
";",
"i",
";",
")",
"children",
"[",
"--",
"i",
"]",
".",
"insertAfter",
"(",
"this",
")",
";",
"this",
".",
... | Replaces this element with its children.
@since 4.1 | [
"Replaces",
"this",
"element",
"with",
"its",
"children",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L324-L331 | |
57,730 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( condition ) {
if ( !condition )
return this.children.length ? this.children[ 0 ] : null;
if ( typeof condition != 'function' )
condition = nameCondition( condition );
for ( var i = 0, l = this.children.length; i < l; ++i ) {
if ( condition( this.children[ i ] ) )
return this.childr... | javascript | function( condition ) {
if ( !condition )
return this.children.length ? this.children[ 0 ] : null;
if ( typeof condition != 'function' )
condition = nameCondition( condition );
for ( var i = 0, l = this.children.length; i < l; ++i ) {
if ( condition( this.children[ i ] ) )
return this.childr... | [
"function",
"(",
"condition",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"return",
"this",
".",
"children",
".",
"length",
"?",
"this",
".",
"children",
"[",
"0",
"]",
":",
"null",
";",
"if",
"(",
"typeof",
"condition",
"!=",
"'function'",
")",
"con... | Gets this element's first child. If `condition` is given, this method returns
the first child which satisfies that condition.
@since 4.3
@param {String/Object/Function} condition Name of a child, a hash of names, or a validator function.
@returns {CKEDITOR.htmlParser.node} | [
"Gets",
"this",
"element",
"s",
"first",
"child",
".",
"If",
"condition",
"is",
"given",
"this",
"method",
"returns",
"the",
"first",
"child",
"which",
"satisfies",
"that",
"condition",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L366-L378 | |
57,731 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( html ) {
var children = this.children = CKEDITOR.htmlParser.fragment.fromHtml( html ).children;
for ( var i = 0, l = children.length; i < l; ++i )
children[ i ].parent = this;
} | javascript | function( html ) {
var children = this.children = CKEDITOR.htmlParser.fragment.fromHtml( html ).children;
for ( var i = 0, l = children.length; i < l; ++i )
children[ i ].parent = this;
} | [
"function",
"(",
"html",
")",
"{",
"var",
"children",
"=",
"this",
".",
"children",
"=",
"CKEDITOR",
".",
"htmlParser",
".",
"fragment",
".",
"fromHtml",
"(",
"html",
")",
".",
"children",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"chil... | Sets this element's inner HTML.
@since 4.3
@param {String} html | [
"Sets",
"this",
"element",
"s",
"inner",
"HTML",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L398-L403 | |
57,732 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( index ) {
var cloneChildren = this.children.splice( index, this.children.length - index ),
clone = this.clone();
for ( var i = 0; i < cloneChildren.length; ++i )
cloneChildren[ i ].parent = clone;
clone.children = cloneChildren;
if ( cloneChildren[ 0 ] )
cloneChildren[ 0 ].previous ... | javascript | function( index ) {
var cloneChildren = this.children.splice( index, this.children.length - index ),
clone = this.clone();
for ( var i = 0; i < cloneChildren.length; ++i )
cloneChildren[ i ].parent = clone;
clone.children = cloneChildren;
if ( cloneChildren[ 0 ] )
cloneChildren[ 0 ].previous ... | [
"function",
"(",
"index",
")",
"{",
"var",
"cloneChildren",
"=",
"this",
".",
"children",
".",
"splice",
"(",
"index",
",",
"this",
".",
"children",
".",
"length",
"-",
"index",
")",
",",
"clone",
"=",
"this",
".",
"clone",
"(",
")",
";",
"for",
"(... | Splits this element at the given index.
@since 4.3
@param {Number} index Index at which the element will be split — `0` means the beginning,
`1` after first child node, etc.
@returns {CKEDITOR.htmlParser.element} The new element following this one. | [
"Splits",
"this",
"element",
"at",
"the",
"given",
"index",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L425-L443 | |
57,733 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/element.js | function( className ) {
var classes = this.attributes[ 'class' ];
if ( !classes )
return;
// We can safely assume that className won't break regexp.
// http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names
classes = CKEDITOR.tools.trim( classes.replace( new RegExp( ... | javascript | function( className ) {
var classes = this.attributes[ 'class' ];
if ( !classes )
return;
// We can safely assume that className won't break regexp.
// http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names
classes = CKEDITOR.tools.trim( classes.replace( new RegExp( ... | [
"function",
"(",
"className",
")",
"{",
"var",
"classes",
"=",
"this",
".",
"attributes",
"[",
"'class'",
"]",
";",
"if",
"(",
"!",
"classes",
")",
"return",
";",
"// We can safely assume that className won't break regexp.",
"// http://stackoverflow.com/questions/448981... | Removes a class name from the list of classes.
@since 4.3
@param {String} className The class name to be removed. | [
"Removes",
"a",
"class",
"name",
"from",
"the",
"list",
"of",
"classes",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/element.js#L466-L480 | |
57,734 | mcccclean/node-gamesprites | lib/formatters.js | function(outname, imagedata) {
var frames = [];
var animations = {};
// first pass: set up frame for each image, ensure an animation array is present
imagedata.forEach(function(im) {
var ox = Math.floor(im.width / 2);
var oy = Math.floor(im.height / 2);
... | javascript | function(outname, imagedata) {
var frames = [];
var animations = {};
// first pass: set up frame for each image, ensure an animation array is present
imagedata.forEach(function(im) {
var ox = Math.floor(im.width / 2);
var oy = Math.floor(im.height / 2);
... | [
"function",
"(",
"outname",
",",
"imagedata",
")",
"{",
"var",
"frames",
"=",
"[",
"]",
";",
"var",
"animations",
"=",
"{",
"}",
";",
"// first pass: set up frame for each image, ensure an animation array is present",
"imagedata",
".",
"forEach",
"(",
"function",
"(... | format for CreateJS framework | [
"format",
"for",
"CreateJS",
"framework"
] | 9c430065cda394c82f8074b7bf6b07ff807c1431 | https://github.com/mcccclean/node-gamesprites/blob/9c430065cda394c82f8074b7bf6b07ff807c1431/lib/formatters.js#L4-L33 | |
57,735 | the-simian/phaser-shim-loader | index.js | phaserShim | function phaserShim(source) {
this.cacheable && this.cacheable();
source = source
.replace(/"object"==typeof exports/, 'false')
.replace(/(var\s+\w+\s*=\s*)Phaser(\s*\|\|\s*\{)/, 'var PIXI = exports.PIXI; $1Phaser$2')
.replace(/typeof module !== 'undefined' && module\.exports/g, "false /* typeof module... | javascript | function phaserShim(source) {
this.cacheable && this.cacheable();
source = source
.replace(/"object"==typeof exports/, 'false')
.replace(/(var\s+\w+\s*=\s*)Phaser(\s*\|\|\s*\{)/, 'var PIXI = exports.PIXI; $1Phaser$2')
.replace(/typeof module !== 'undefined' && module\.exports/g, "false /* typeof module... | [
"function",
"phaserShim",
"(",
"source",
")",
"{",
"this",
".",
"cacheable",
"&&",
"this",
".",
"cacheable",
"(",
")",
";",
"source",
"=",
"source",
".",
"replace",
"(",
"/",
"\"object\"==typeof exports",
"/",
",",
"'false'",
")",
".",
"replace",
"(",
"/... | phaser-webpack-loader | [
"phaser",
"-",
"webpack",
"-",
"loader"
] | ff22b8903de18d6d9eff1765722366892daf929a | https://github.com/the-simian/phaser-shim-loader/blob/ff22b8903de18d6d9eff1765722366892daf929a/index.js#L5-L18 |
57,736 | SilentCicero/ethdeploy-provider-zero-client | index.js | function(providerObject) {
const fixedProviderObject = Object.assign({}, providerObject);
const oldGetAccountsMethod = providerObject.getAccounts;
// fix get accounts
if (typeof fixedProviderObject.getAccounts !== 'undefined') {
fixedProviderObject.getAccounts = function(getAccountsCallback) {
const ... | javascript | function(providerObject) {
const fixedProviderObject = Object.assign({}, providerObject);
const oldGetAccountsMethod = providerObject.getAccounts;
// fix get accounts
if (typeof fixedProviderObject.getAccounts !== 'undefined') {
fixedProviderObject.getAccounts = function(getAccountsCallback) {
const ... | [
"function",
"(",
"providerObject",
")",
"{",
"const",
"fixedProviderObject",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"providerObject",
")",
";",
"const",
"oldGetAccountsMethod",
"=",
"providerObject",
".",
"getAccounts",
";",
"// fix get accounts",
"if",... | fix getAccounts method | [
"fix",
"getAccounts",
"method"
] | d0b777c47cd5fa61fa3cae5055ecb29a16b95f84 | https://github.com/SilentCicero/ethdeploy-provider-zero-client/blob/d0b777c47cd5fa61fa3cae5055ecb29a16b95f84/index.js#L6-L37 | |
57,737 | SilentCicero/ethdeploy-provider-zero-client | index.js | function(accountsError, accountsResult) {
const fixedAccountsResult = accountsResult.slice(0);
// if no error, fixed result
if (!accountsError) {
fixedAccountsResult.map(function(item) {
return String(item.toLowerCase());
});
}
// fire oldd callb... | javascript | function(accountsError, accountsResult) {
const fixedAccountsResult = accountsResult.slice(0);
// if no error, fixed result
if (!accountsError) {
fixedAccountsResult.map(function(item) {
return String(item.toLowerCase());
});
}
// fire oldd callb... | [
"function",
"(",
"accountsError",
",",
"accountsResult",
")",
"{",
"const",
"fixedAccountsResult",
"=",
"accountsResult",
".",
"slice",
"(",
"0",
")",
";",
"// if no error, fixed result",
"if",
"(",
"!",
"accountsError",
")",
"{",
"fixedAccountsResult",
".",
"map"... | build fixed callback with lowercased accounts | [
"build",
"fixed",
"callback",
"with",
"lowercased",
"accounts"
] | d0b777c47cd5fa61fa3cae5055ecb29a16b95f84 | https://github.com/SilentCicero/ethdeploy-provider-zero-client/blob/d0b777c47cd5fa61fa3cae5055ecb29a16b95f84/index.js#L16-L28 | |
57,738 | SilentCicero/ethdeploy-provider-zero-client | index.js | function(rawTx) {
const rawTxMutation = Object.assign({}, rawTx);
// fix rawTx gaslimit
if (typeof rawTxMutation.gas !== 'undefined') {
rawTxMutation.gasLimit = rawTxMutation.gas;
delete rawTxMutation.gas;
}
// fix data by prefixing it with zero
if (typeof rawTxMutation.data !== 'undefined'
... | javascript | function(rawTx) {
const rawTxMutation = Object.assign({}, rawTx);
// fix rawTx gaslimit
if (typeof rawTxMutation.gas !== 'undefined') {
rawTxMutation.gasLimit = rawTxMutation.gas;
delete rawTxMutation.gas;
}
// fix data by prefixing it with zero
if (typeof rawTxMutation.data !== 'undefined'
... | [
"function",
"(",
"rawTx",
")",
"{",
"const",
"rawTxMutation",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"rawTx",
")",
";",
"// fix rawTx gaslimit",
"if",
"(",
"typeof",
"rawTxMutation",
".",
"gas",
"!==",
"'undefined'",
")",
"{",
"rawTxMutation",
"... | fix ethereumjs-tx rawTx object | [
"fix",
"ethereumjs",
"-",
"tx",
"rawTx",
"object"
] | d0b777c47cd5fa61fa3cae5055ecb29a16b95f84 | https://github.com/SilentCicero/ethdeploy-provider-zero-client/blob/d0b777c47cd5fa61fa3cae5055ecb29a16b95f84/index.js#L40-L57 | |
57,739 | SilentCicero/ethdeploy-provider-zero-client | index.js | function(providerObject) {
const fixedProviderObject = Object.assign({}, providerObject);
// object has signTransaction
if (typeof fixedProviderObject.signTransaction !== 'undefined') {
// store old sign transaction method
const oldSignTransactionMethod = fixedProviderObject.signTransaction;
// buil... | javascript | function(providerObject) {
const fixedProviderObject = Object.assign({}, providerObject);
// object has signTransaction
if (typeof fixedProviderObject.signTransaction !== 'undefined') {
// store old sign transaction method
const oldSignTransactionMethod = fixedProviderObject.signTransaction;
// buil... | [
"function",
"(",
"providerObject",
")",
"{",
"const",
"fixedProviderObject",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"providerObject",
")",
";",
"// object has signTransaction",
"if",
"(",
"typeof",
"fixedProviderObject",
".",
"signTransaction",
"!==",
"... | fix signTransaction method with rawTx fix | [
"fix",
"signTransaction",
"method",
"with",
"rawTx",
"fix"
] | d0b777c47cd5fa61fa3cae5055ecb29a16b95f84 | https://github.com/SilentCicero/ethdeploy-provider-zero-client/blob/d0b777c47cd5fa61fa3cae5055ecb29a16b95f84/index.js#L60-L77 | |
57,740 | Qwerios/madlib-xmldom | lib/browser.js | function(xmlString) {
var error, parser, xmlDoc;
if ((typeof Ti !== "undefined" && Ti !== null) && Ti.XML) {
try {
xmlDoc = Ti.XML.parseString(xmlString);
} catch (_error) {
error = _error;
xmlDoc = null;
}
return xmlDoc;
... | javascript | function(xmlString) {
var error, parser, xmlDoc;
if ((typeof Ti !== "undefined" && Ti !== null) && Ti.XML) {
try {
xmlDoc = Ti.XML.parseString(xmlString);
} catch (_error) {
error = _error;
xmlDoc = null;
}
return xmlDoc;
... | [
"function",
"(",
"xmlString",
")",
"{",
"var",
"error",
",",
"parser",
",",
"xmlDoc",
";",
"if",
"(",
"(",
"typeof",
"Ti",
"!==",
"\"undefined\"",
"&&",
"Ti",
"!==",
"null",
")",
"&&",
"Ti",
".",
"XML",
")",
"{",
"try",
"{",
"xmlDoc",
"=",
"Ti",
... | Turns the provided XML string into an XML DOM Document using whatever
native means of doing so is available
@function parse
@param {String} xmlString A valid string containing XML
@return {DOM} An XML DOM Document instance | [
"Turns",
"the",
"provided",
"XML",
"string",
"into",
"an",
"XML",
"DOM",
"Document",
"using",
"whatever",
"native",
"means",
"of",
"doing",
"so",
"is",
"available"
] | e1bed72403519830c1e0255f2faa774ffecbed3d | https://github.com/Qwerios/madlib-xmldom/blob/e1bed72403519830c1e0255f2faa774ffecbed3d/lib/browser.js#L30-L62 | |
57,741 | Qwerios/madlib-xmldom | lib/browser.js | function(xmlNode) {
var noNativeXml, noXMLSerializer;
if ((typeof Ti !== "undefined" && Ti !== null) && Ti.XML) {
return Ti.XML.serializeToString(xmlNode);
} else {
try {
return (new XMLSerializer()).serializeToString(xmlNode);
} catch (_error) {
... | javascript | function(xmlNode) {
var noNativeXml, noXMLSerializer;
if ((typeof Ti !== "undefined" && Ti !== null) && Ti.XML) {
return Ti.XML.serializeToString(xmlNode);
} else {
try {
return (new XMLSerializer()).serializeToString(xmlNode);
} catch (_error) {
... | [
"function",
"(",
"xmlNode",
")",
"{",
"var",
"noNativeXml",
",",
"noXMLSerializer",
";",
"if",
"(",
"(",
"typeof",
"Ti",
"!==",
"\"undefined\"",
"&&",
"Ti",
"!==",
"null",
")",
"&&",
"Ti",
".",
"XML",
")",
"{",
"return",
"Ti",
".",
"XML",
".",
"seria... | Turns the provided XML DOM Node into an XML string using whatever
native means of doing so is available
@function serialize
@param {DOM Node} The XML Node that is to be serialized
@return {String} An XML string representation of the node and its children | [
"Turns",
"the",
"provided",
"XML",
"DOM",
"Node",
"into",
"an",
"XML",
"string",
"using",
"whatever",
"native",
"means",
"of",
"doing",
"so",
"is",
"available"
] | e1bed72403519830c1e0255f2faa774ffecbed3d | https://github.com/Qwerios/madlib-xmldom/blob/e1bed72403519830c1e0255f2faa774ffecbed3d/lib/browser.js#L74-L91 | |
57,742 | nomocas/yamvish | lib/context.js | function(space, type, path, value, index) {
// console.log('context.notifyUpstream : ', space, type, path, value, index);
for (var i = 0, len = space._upstreams.length; i < len; ++i) {
var upstream = space._upstreams[i];
if (!upstream) {
// maybe it's because upstreams length has change so update it
/... | javascript | function(space, type, path, value, index) {
// console.log('context.notifyUpstream : ', space, type, path, value, index);
for (var i = 0, len = space._upstreams.length; i < len; ++i) {
var upstream = space._upstreams[i];
if (!upstream) {
// maybe it's because upstreams length has change so update it
/... | [
"function",
"(",
"space",
",",
"type",
",",
"path",
",",
"value",
",",
"index",
")",
"{",
"// console.log('context.notifyUpstream : ', space, type, path, value, index);",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"space",
".",
"_upstreams",
".",
"length... | notification from root to modification point.
Normaly for internal use. | [
"notification",
"from",
"root",
"to",
"modification",
"point",
".",
"Normaly",
"for",
"internal",
"use",
"."
] | 017a536bb6bafddf1b31c0c7af6f723be58e9f0e | https://github.com/nomocas/yamvish/blob/017a536bb6bafddf1b31c0c7af6f723be58e9f0e/lib/context.js#L433-L446 | |
57,743 | b3nsn0w/murmur-random | index.js | random | function random (seed) {
/**
* Creates a subgenerator from the current one
*
* @param {string} key Key of the subgenerator
* @param {...number} params Parameters affecting the subgenerator's seed
*/
function subgen (key, ...params) {
return random(createSeed([...seed, keygen(key), ...params], s... | javascript | function random (seed) {
/**
* Creates a subgenerator from the current one
*
* @param {string} key Key of the subgenerator
* @param {...number} params Parameters affecting the subgenerator's seed
*/
function subgen (key, ...params) {
return random(createSeed([...seed, keygen(key), ...params], s... | [
"function",
"random",
"(",
"seed",
")",
"{",
"/**\n * Creates a subgenerator from the current one\n *\n * @param {string} key Key of the subgenerator\n * @param {...number} params Parameters affecting the subgenerator's seed\n */",
"function",
"subgen",
"(",
"key",
",",
"...",
"... | Creates a deterministic random generator
@param {...number} seed Raw seed of the random generator | [
"Creates",
"a",
"deterministic",
"random",
"generator"
] | 240977106f74fc20583ef0c4f95aaf862a8b3bdc | https://github.com/b3nsn0w/murmur-random/blob/240977106f74fc20583ef0c4f95aaf862a8b3bdc/index.js#L17-L43 |
57,744 | b3nsn0w/murmur-random | index.js | subgen | function subgen (key, ...params) {
return random(createSeed([...seed, keygen(key), ...params], seed.length))
} | javascript | function subgen (key, ...params) {
return random(createSeed([...seed, keygen(key), ...params], seed.length))
} | [
"function",
"subgen",
"(",
"key",
",",
"...",
"params",
")",
"{",
"return",
"random",
"(",
"createSeed",
"(",
"[",
"...",
"seed",
",",
"keygen",
"(",
"key",
")",
",",
"...",
"params",
"]",
",",
"seed",
".",
"length",
")",
")",
"}"
] | Creates a subgenerator from the current one
@param {string} key Key of the subgenerator
@param {...number} params Parameters affecting the subgenerator's seed | [
"Creates",
"a",
"subgenerator",
"from",
"the",
"current",
"one"
] | 240977106f74fc20583ef0c4f95aaf862a8b3bdc | https://github.com/b3nsn0w/murmur-random/blob/240977106f74fc20583ef0c4f95aaf862a8b3bdc/index.js#L25-L27 |
57,745 | Industryswarm/isnode-mod-data | lib/mongodb/mongodb/lib/operations/mongo_client_ops.js | logout | function logout(mongoClient, dbName, callback) {
mongoClient.topology.logout(dbName, err => {
if (err) return callback(err);
callback(null, true);
});
} | javascript | function logout(mongoClient, dbName, callback) {
mongoClient.topology.logout(dbName, err => {
if (err) return callback(err);
callback(null, true);
});
} | [
"function",
"logout",
"(",
"mongoClient",
",",
"dbName",
",",
"callback",
")",
"{",
"mongoClient",
".",
"topology",
".",
"logout",
"(",
"dbName",
",",
"err",
"=>",
"{",
"if",
"(",
"err",
")",
"return",
"callback",
"(",
"err",
")",
";",
"callback",
"(",... | Logout user from server, fire off on all connections and remove all auth info.
@method
@param {MongoClient} mongoClient The MongoClient instance on which to logout.
@param {object} [options] Optional settings. See MongoClient.prototype.logout for a list of options.
@param {Db~resultCallback} [callback] The command res... | [
"Logout",
"user",
"from",
"server",
"fire",
"off",
"on",
"all",
"connections",
"and",
"remove",
"all",
"auth",
"info",
"."
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb/lib/operations/mongo_client_ops.js#L483-L488 |
57,746 | Industryswarm/isnode-mod-data | lib/mongodb/mongodb/lib/operations/mongo_client_ops.js | validOptions | function validOptions(options) {
const _validOptions = validOptionNames.concat(legacyOptionNames);
for (const name in options) {
if (ignoreOptionNames.indexOf(name) !== -1) {
continue;
}
if (_validOptions.indexOf(name) === -1 && options.validateOptions) {
return new MongoError(`option ${na... | javascript | function validOptions(options) {
const _validOptions = validOptionNames.concat(legacyOptionNames);
for (const name in options) {
if (ignoreOptionNames.indexOf(name) !== -1) {
continue;
}
if (_validOptions.indexOf(name) === -1 && options.validateOptions) {
return new MongoError(`option ${na... | [
"function",
"validOptions",
"(",
"options",
")",
"{",
"const",
"_validOptions",
"=",
"validOptionNames",
".",
"concat",
"(",
"legacyOptionNames",
")",
";",
"for",
"(",
"const",
"name",
"in",
"options",
")",
"{",
"if",
"(",
"ignoreOptionNames",
".",
"indexOf",
... | Validate options object | [
"Validate",
"options",
"object"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb/lib/operations/mongo_client_ops.js#L623-L644 |
57,747 | boljen/node-buffer-to-messages | index.js | Converter | function Converter() {
// Validate arguments
if (arguments.length === 1) {
this._bl = 2;
if (typeof arguments[0] !== "function")
throw new TypeError("Converter requires at least a callback function");
else
this._fx = arguments[0];
} else if (arguments.length >= 2) {
this._bl = arg... | javascript | function Converter() {
// Validate arguments
if (arguments.length === 1) {
this._bl = 2;
if (typeof arguments[0] !== "function")
throw new TypeError("Converter requires at least a callback function");
else
this._fx = arguments[0];
} else if (arguments.length >= 2) {
this._bl = arg... | [
"function",
"Converter",
"(",
")",
"{",
"// Validate arguments",
"if",
"(",
"arguments",
".",
"length",
"===",
"1",
")",
"{",
"this",
".",
"_bl",
"=",
"2",
";",
"if",
"(",
"typeof",
"arguments",
"[",
"0",
"]",
"!==",
"\"function\"",
")",
"throw",
"new"... | Takes in a series of Buffers and calls back whenever a fixed-length
message has been completely processed.
@param {Integer} [prefixLength] - The length in bytes of the size prefix.
This argument is optional. The default length is 2 bytes, but can also be 1
or 4 bytes.
@param {Function} callback - This will be called ... | [
"Takes",
"in",
"a",
"series",
"of",
"Buffers",
"and",
"calls",
"back",
"whenever",
"a",
"fixed",
"-",
"length",
"message",
"has",
"been",
"completely",
"processed",
"."
] | 9362c1677fd284d54040e56de99800a80494522e | https://github.com/boljen/node-buffer-to-messages/blob/9362c1677fd284d54040e56de99800a80494522e/index.js#L15-L43 |
57,748 | open-nata/nata-device | src/actions/ActionFactory.js | getCommonActions | function getCommonActions(device) {
const actions = []
actions.push(new BackAction(device))
actions.push(new HomeAction(device))
actions.push(new MenuAction(device))
actions.push()
return actions
} | javascript | function getCommonActions(device) {
const actions = []
actions.push(new BackAction(device))
actions.push(new HomeAction(device))
actions.push(new MenuAction(device))
actions.push()
return actions
} | [
"function",
"getCommonActions",
"(",
"device",
")",
"{",
"const",
"actions",
"=",
"[",
"]",
"actions",
".",
"push",
"(",
"new",
"BackAction",
"(",
"device",
")",
")",
"actions",
".",
"push",
"(",
"new",
"HomeAction",
"(",
"device",
")",
")",
"actions",
... | back, home, menu actions | [
"back",
"home",
"menu",
"actions"
] | c2c1292fb0f634eab72e6770ee5b835b67186405 | https://github.com/open-nata/nata-device/blob/c2c1292fb0f634eab72e6770ee5b835b67186405/src/actions/ActionFactory.js#L59-L67 |
57,749 | richRemer/twixt-mutation | mutation.js | mutation | function mutation(target, handler) {
target.addEventListener("mutation", function(evt) {
handler.call(this, this, evt.mutations);
});
} | javascript | function mutation(target, handler) {
target.addEventListener("mutation", function(evt) {
handler.call(this, this, evt.mutations);
});
} | [
"function",
"mutation",
"(",
"target",
",",
"handler",
")",
"{",
"target",
".",
"addEventListener",
"(",
"\"mutation\"",
",",
"function",
"(",
"evt",
")",
"{",
"handler",
".",
"call",
"(",
"this",
",",
"this",
",",
"evt",
".",
"mutations",
")",
";",
"}... | Attach mutation event handler.
@param {EventTarget} target
@param {function} handler | [
"Attach",
"mutation",
"event",
"handler",
"."
] | e0b5f3883281888fa21a73a6d190e9d6dfef34e7 | https://github.com/richRemer/twixt-mutation/blob/e0b5f3883281888fa21a73a6d190e9d6dfef34e7/mutation.js#L6-L10 |
57,750 | dennismckinnon/tmsp-server | lib/tmspReader.js | Request | function Request(reqBytes){
var parsed;
var err
try {
parsed = types.Request.decode(reqBytes);
} catch (e) {
err = e;
}
//Check for request errors here
if(err){
this.BadRequest = true;
this.errCode = types.CodeType.EncodingError;
this.errMsg = "The request failed to be decoded"
} ... | javascript | function Request(reqBytes){
var parsed;
var err
try {
parsed = types.Request.decode(reqBytes);
} catch (e) {
err = e;
}
//Check for request errors here
if(err){
this.BadRequest = true;
this.errCode = types.CodeType.EncodingError;
this.errMsg = "The request failed to be decoded"
} ... | [
"function",
"Request",
"(",
"reqBytes",
")",
"{",
"var",
"parsed",
";",
"var",
"err",
"try",
"{",
"parsed",
"=",
"types",
".",
"Request",
".",
"decode",
"(",
"reqBytes",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"err",
"=",
"e",
";",
"}",
"//Ch... | The Request object unlike in http requests is static So this stream is built to return it rather then the standard buffer. this means any consumer of this stream would need to take account of this fact | [
"The",
"Request",
"object",
"unlike",
"in",
"http",
"requests",
"is",
"static",
"So",
"this",
"stream",
"is",
"built",
"to",
"return",
"it",
"rather",
"then",
"the",
"standard",
"buffer",
".",
"this",
"means",
"any",
"consumer",
"of",
"this",
"stream",
"wo... | 24d054c5a3eeacc6552645a2e3a7ed353112b171 | https://github.com/dennismckinnon/tmsp-server/blob/24d054c5a3eeacc6552645a2e3a7ed353112b171/lib/tmspReader.js#L133-L166 |
57,751 | jeremyckahn/bezierizer | dist/jquery.dragon.js | fire | function fire (event, $el, evt) {
var handler = $el.data('dragon-opts')[event];
// Patch the proxied Event Object
evt.target = $el[0];
if (handler) {
handler(evt);
}
$el.trigger(event);
} | javascript | function fire (event, $el, evt) {
var handler = $el.data('dragon-opts')[event];
// Patch the proxied Event Object
evt.target = $el[0];
if (handler) {
handler(evt);
}
$el.trigger(event);
} | [
"function",
"fire",
"(",
"event",
",",
"$el",
",",
"evt",
")",
"{",
"var",
"handler",
"=",
"$el",
".",
"data",
"(",
"'dragon-opts'",
")",
"[",
"event",
"]",
";",
"// Patch the proxied Event Object",
"evt",
".",
"target",
"=",
"$el",
"[",
"0",
"]",
";",... | Yep, you only get to bind one event handler. Much faster this way. | [
"Yep",
"you",
"only",
"get",
"to",
"bind",
"one",
"event",
"handler",
".",
"Much",
"faster",
"this",
"way",
"."
] | f1886b556279875bbb0da5051f7b716727b28768 | https://github.com/jeremyckahn/bezierizer/blob/f1886b556279875bbb0da5051f7b716727b28768/dist/jquery.dragon.js#L209-L218 |
57,752 | mnichols/ankh | lib/component-model.js | ComponentModel | function ComponentModel(key, impl, cfg) {
this.key = key
/**
* @property {Any} impl The implementation to use for `resolve`
* */
this.impl =impl
this._cfg = cfg || {}
/**
* @property {Array} inject The {String} dependencies array a service may declare
* */
this.inject = (this... | javascript | function ComponentModel(key, impl, cfg) {
this.key = key
/**
* @property {Any} impl The implementation to use for `resolve`
* */
this.impl =impl
this._cfg = cfg || {}
/**
* @property {Array} inject The {String} dependencies array a service may declare
* */
this.inject = (this... | [
"function",
"ComponentModel",
"(",
"key",
",",
"impl",
",",
"cfg",
")",
"{",
"this",
".",
"key",
"=",
"key",
"/**\n * @property {Any} impl The implementation to use for `resolve`\n * */",
"this",
".",
"impl",
"=",
"impl",
"this",
".",
"_cfg",
"=",
"cfg",
"... | Describes the model for resolving a service
@class ComponentModel | [
"Describes",
"the",
"model",
"for",
"resolving",
"a",
"service"
] | b5f6eae24b2dece4025b4f11cea7f1560d3b345f | https://github.com/mnichols/ankh/blob/b5f6eae24b2dece4025b4f11cea7f1560d3b345f/lib/component-model.js#L9-L29 |
57,753 | JohnnieFucker/dreamix-admin | lib/modules/monitorLog.js | fetchLogs | function fetchLogs(root, msg, callback) {
const number = msg.number;
const logfile = msg.logfile;
const serverId = msg.serverId;
const filePath = path.join(root, getLogFileName(logfile, serverId));
const endLogs = [];
exec(`tail -n ${number} ${filePath}`, (error, output) => {
const endO... | javascript | function fetchLogs(root, msg, callback) {
const number = msg.number;
const logfile = msg.logfile;
const serverId = msg.serverId;
const filePath = path.join(root, getLogFileName(logfile, serverId));
const endLogs = [];
exec(`tail -n ${number} ${filePath}`, (error, output) => {
const endO... | [
"function",
"fetchLogs",
"(",
"root",
",",
"msg",
",",
"callback",
")",
"{",
"const",
"number",
"=",
"msg",
".",
"number",
";",
"const",
"logfile",
"=",
"msg",
".",
"logfile",
";",
"const",
"serverId",
"=",
"msg",
".",
"serverId",
";",
"const",
"filePa... | get the latest logs | [
"get",
"the",
"latest",
"logs"
] | fc169e2481d5a7456725fb33f7a7907e0776ef79 | https://github.com/JohnnieFucker/dreamix-admin/blob/fc169e2481d5a7456725fb33f7a7907e0776ef79/lib/modules/monitorLog.js#L13-L48 |
57,754 | Wiredcraft/carcass-config | proto/config.js | function(parser) {
return highland.map(function(item) {
if (_.isFunction(parser)) {
return parser(item);
}
if (_.isObject(parser) && (parser.parse != null)) {
return parser.parse(item);
}
return item;
});
} | javascript | function(parser) {
return highland.map(function(item) {
if (_.isFunction(parser)) {
return parser(item);
}
if (_.isObject(parser) && (parser.parse != null)) {
return parser.parse(item);
}
return item;
});
} | [
"function",
"(",
"parser",
")",
"{",
"return",
"highland",
".",
"map",
"(",
"function",
"(",
"item",
")",
"{",
"if",
"(",
"_",
".",
"isFunction",
"(",
"parser",
")",
")",
"{",
"return",
"parser",
"(",
"item",
")",
";",
"}",
"if",
"(",
"_",
".",
... | Builder; returns a function which can be used to map a stream with a
given parser.
@param {Function|Object} parser can be either a function or an object, in
which case the parser.parse() will be used.
@return {Function} curried map().
@private | [
"Builder",
";",
"returns",
"a",
"function",
"which",
"can",
"be",
"used",
"to",
"map",
"a",
"stream",
"with",
"a",
"given",
"parser",
"."
] | bb1dce284acfb40d2c23a989fe7b5ee4e2221bab | https://github.com/Wiredcraft/carcass-config/blob/bb1dce284acfb40d2c23a989fe7b5ee4e2221bab/proto/config.js#L45-L55 | |
57,755 | Wiredcraft/carcass-config | proto/config.js | function(done) {
var p, parser, stream, _i, _len;
parser = this.parser();
stream = highland(this.source());
if (_.isArray(parser)) {
for (_i = 0, _len = parser.length; _i < _len; _i++) {
p = parser[_i];
stream = this._mapWith(p)(stream).flatten().compact();
}
} else {
... | javascript | function(done) {
var p, parser, stream, _i, _len;
parser = this.parser();
stream = highland(this.source());
if (_.isArray(parser)) {
for (_i = 0, _len = parser.length; _i < _len; _i++) {
p = parser[_i];
stream = this._mapWith(p)(stream).flatten().compact();
}
} else {
... | [
"function",
"(",
"done",
")",
"{",
"var",
"p",
",",
"parser",
",",
"stream",
",",
"_i",
",",
"_len",
";",
"parser",
"=",
"this",
".",
"parser",
"(",
")",
";",
"stream",
"=",
"highland",
"(",
"this",
".",
"source",
"(",
")",
")",
";",
"if",
"(",... | Loads all the sources and parses with a given parser, and merges the
results together.
Bad results (false, null, undefined) are skipped.
@param {Function|null} done the callback, if provided, will be called
with the result, and if not provided, the stream will be returned.
@return {this|stream} depends on whether a ... | [
"Loads",
"all",
"the",
"sources",
"and",
"parses",
"with",
"a",
"given",
"parser",
"and",
"merges",
"the",
"results",
"together",
"."
] | bb1dce284acfb40d2c23a989fe7b5ee4e2221bab | https://github.com/Wiredcraft/carcass-config/blob/bb1dce284acfb40d2c23a989fe7b5ee4e2221bab/proto/config.js#L70-L88 | |
57,756 | LOKE/loke-config | lib/merge-into.js | mergeInto | function mergeInto(target, source) {
var a = target;
var b = source;
if (a && b) {
for (var key in b) {
if (!(key in a)) {
continue;
}
if (typeof b[key] === 'object' && !Array.isArray(b[key]) && b[key] !== null) {
mergeInto(a[key], b[key]);
} else {
a[key] = b[... | javascript | function mergeInto(target, source) {
var a = target;
var b = source;
if (a && b) {
for (var key in b) {
if (!(key in a)) {
continue;
}
if (typeof b[key] === 'object' && !Array.isArray(b[key]) && b[key] !== null) {
mergeInto(a[key], b[key]);
} else {
a[key] = b[... | [
"function",
"mergeInto",
"(",
"target",
",",
"source",
")",
"{",
"var",
"a",
"=",
"target",
";",
"var",
"b",
"=",
"source",
";",
"if",
"(",
"a",
"&&",
"b",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"b",
")",
"{",
"if",
"(",
"!",
"(",
"key",
... | Merges properties from source into target.
target will be modified as a result of this function.
@param {Object} target The target object to merge the source into.
Source values will override those in the target object.
@param {Object} source The source object to get override values from.
@return {Object} The... | [
"Merges",
"properties",
"from",
"source",
"into",
"target",
".",
"target",
"will",
"be",
"modified",
"as",
"a",
"result",
"of",
"this",
"function",
"."
] | 84c207b2724c919bc6dde5efd7e7328591908cce | https://github.com/LOKE/loke-config/blob/84c207b2724c919bc6dde5efd7e7328591908cce/lib/merge-into.js#L12-L29 |
57,757 | epii-io/epii-node-render | kernel/assist.js | tryWatch | function tryWatch(target, callback) {
if (!target) {
return logger.halt('invalid watch target')
}
if (!callback || typeof callback !== 'function') {
return logger.halt('invalid watch callback')
}
return fs.watch(
target, { persistent: true, recursive: true},
function (e, file) {
// todo... | javascript | function tryWatch(target, callback) {
if (!target) {
return logger.halt('invalid watch target')
}
if (!callback || typeof callback !== 'function') {
return logger.halt('invalid watch callback')
}
return fs.watch(
target, { persistent: true, recursive: true},
function (e, file) {
// todo... | [
"function",
"tryWatch",
"(",
"target",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"target",
")",
"{",
"return",
"logger",
".",
"halt",
"(",
"'invalid watch target'",
")",
"}",
"if",
"(",
"!",
"callback",
"||",
"typeof",
"callback",
"!==",
"'function'",
"... | try to watch with custom callback
@param {String} target
@param {Function} callback
@return {Object} fs.Watcher | [
"try",
"to",
"watch",
"with",
"custom",
"callback"
] | e8afa57066251e173b3a6455d47218c95f30f563 | https://github.com/epii-io/epii-node-render/blob/e8afa57066251e173b3a6455d47218c95f30f563/kernel/assist.js#L30-L45 |
57,758 | epii-io/epii-node-render | kernel/assist.js | getBabelConfig | function getBabelConfig(env) {
var babelrcPath = path.join(__dirname, '.babelrc')
var babelrc = JSON.parse(fs.readFileSync(babelrcPath))
babelrc.presets = resolve(
babelrc.presets.map(preset => 'babel-preset-' + preset)
)
if (!babelrc.plugins) babelrc.plugins = []
return babelrc
} | javascript | function getBabelConfig(env) {
var babelrcPath = path.join(__dirname, '.babelrc')
var babelrc = JSON.parse(fs.readFileSync(babelrcPath))
babelrc.presets = resolve(
babelrc.presets.map(preset => 'babel-preset-' + preset)
)
if (!babelrc.plugins) babelrc.plugins = []
return babelrc
} | [
"function",
"getBabelConfig",
"(",
"env",
")",
"{",
"var",
"babelrcPath",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'.babelrc'",
")",
"var",
"babelrc",
"=",
"JSON",
".",
"parse",
"(",
"fs",
".",
"readFileSync",
"(",
"babelrcPath",
")",
")",
"babe... | get babel config
@param {String} env
@return {Object} babel config | [
"get",
"babel",
"config"
] | e8afa57066251e173b3a6455d47218c95f30f563 | https://github.com/epii-io/epii-node-render/blob/e8afa57066251e173b3a6455d47218c95f30f563/kernel/assist.js#L53-L61 |
57,759 | tniedbala/jxh | lib/renderUtility.js | isNested | function isNested(obj) {
if (getType(obj)==='object') {
for (let tag in obj) {
if (tag != TEXT && !ATTRTAG.test(tag)) {
return true;
}
}
}
} | javascript | function isNested(obj) {
if (getType(obj)==='object') {
for (let tag in obj) {
if (tag != TEXT && !ATTRTAG.test(tag)) {
return true;
}
}
}
} | [
"function",
"isNested",
"(",
"obj",
")",
"{",
"if",
"(",
"getType",
"(",
"obj",
")",
"===",
"'object'",
")",
"{",
"for",
"(",
"let",
"tag",
"in",
"obj",
")",
"{",
"if",
"(",
"tag",
"!=",
"TEXT",
"&&",
"!",
"ATTRTAG",
".",
"test",
"(",
"tag",
")... | test if object contains nested elements | [
"test",
"if",
"object",
"contains",
"nested",
"elements"
] | 83d699b126c5c7099ffea1f86ccacf5ec50ee6a9 | https://github.com/tniedbala/jxh/blob/83d699b126c5c7099ffea1f86ccacf5ec50ee6a9/lib/renderUtility.js#L83-L91 |
57,760 | tniedbala/jxh | lib/renderUtility.js | getAttributes | function getAttributes(obj) {
let attrString = '';
let attrArray = Object.keys(obj);
for (let tag of attrArray) {
if (tag != ATTR && ATTRTAG.test(tag)) {
attrString += ` ${tag.replace('_', '')}="${obj[tag]}"`;
}
}
if (ATTR in obj) {
attrString += ' ' + obj[ATTR];
... | javascript | function getAttributes(obj) {
let attrString = '';
let attrArray = Object.keys(obj);
for (let tag of attrArray) {
if (tag != ATTR && ATTRTAG.test(tag)) {
attrString += ` ${tag.replace('_', '')}="${obj[tag]}"`;
}
}
if (ATTR in obj) {
attrString += ' ' + obj[ATTR];
... | [
"function",
"getAttributes",
"(",
"obj",
")",
"{",
"let",
"attrString",
"=",
"''",
";",
"let",
"attrArray",
"=",
"Object",
".",
"keys",
"(",
"obj",
")",
";",
"for",
"(",
"let",
"tag",
"of",
"attrArray",
")",
"{",
"if",
"(",
"tag",
"!=",
"ATTR",
"&&... | return attribute string | [
"return",
"attribute",
"string"
] | 83d699b126c5c7099ffea1f86ccacf5ec50ee6a9 | https://github.com/tniedbala/jxh/blob/83d699b126c5c7099ffea1f86ccacf5ec50ee6a9/lib/renderUtility.js#L93-L105 |
57,761 | tniedbala/jxh | lib/renderUtility.js | getType | function getType(obj) {
let typeStr = typeof(obj);
if (obj) {
return Array.isArray(obj) ? 'array' : typeStr;
} else {
switch (typeStr) {
case 'number':
return obj === 0 ? 'number' : 'NaN';
case 'object':
return 'null';
defau... | javascript | function getType(obj) {
let typeStr = typeof(obj);
if (obj) {
return Array.isArray(obj) ? 'array' : typeStr;
} else {
switch (typeStr) {
case 'number':
return obj === 0 ? 'number' : 'NaN';
case 'object':
return 'null';
defau... | [
"function",
"getType",
"(",
"obj",
")",
"{",
"let",
"typeStr",
"=",
"typeof",
"(",
"obj",
")",
";",
"if",
"(",
"obj",
")",
"{",
"return",
"Array",
".",
"isArray",
"(",
"obj",
")",
"?",
"'array'",
":",
"typeStr",
";",
"}",
"else",
"{",
"switch",
"... | returns type of obj, specifying array, NaN & null values | [
"returns",
"type",
"of",
"obj",
"specifying",
"array",
"NaN",
"&",
"null",
"values"
] | 83d699b126c5c7099ffea1f86ccacf5ec50ee6a9 | https://github.com/tniedbala/jxh/blob/83d699b126c5c7099ffea1f86ccacf5ec50ee6a9/lib/renderUtility.js#L115-L129 |
57,762 | henrytao-me/grunt-express-middleware | lib/util.js | injectWatcher | function injectWatcher(handler) {
return function(module, filename) {
fs.watchFile(filename, watcher);
handler(module, filename);
};
} | javascript | function injectWatcher(handler) {
return function(module, filename) {
fs.watchFile(filename, watcher);
handler(module, filename);
};
} | [
"function",
"injectWatcher",
"(",
"handler",
")",
"{",
"return",
"function",
"(",
"module",
",",
"filename",
")",
"{",
"fs",
".",
"watchFile",
"(",
"filename",
",",
"watcher",
")",
";",
"handler",
"(",
"module",
",",
"filename",
")",
";",
"}",
";",
"}"... | hijack each module extension handler, and watch the file | [
"hijack",
"each",
"module",
"extension",
"handler",
"and",
"watch",
"the",
"file"
] | 26a902c60a4569dc65bf544ad91bd63d30f58c04 | https://github.com/henrytao-me/grunt-express-middleware/blob/26a902c60a4569dc65bf544ad91bd63d30f58c04/lib/util.js#L26-L31 |
57,763 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/scriptloader.js | loadNext | function loadNext() {
var script;
if ( ( script = pending[ 0 ] ) )
this.load( script.scriptUrl, script.callback, CKEDITOR, 0 );
} | javascript | function loadNext() {
var script;
if ( ( script = pending[ 0 ] ) )
this.load( script.scriptUrl, script.callback, CKEDITOR, 0 );
} | [
"function",
"loadNext",
"(",
")",
"{",
"var",
"script",
";",
"if",
"(",
"(",
"script",
"=",
"pending",
"[",
"0",
"]",
")",
")",
"this",
".",
"load",
"(",
"script",
".",
"scriptUrl",
",",
"script",
".",
"callback",
",",
"CKEDITOR",
",",
"0",
")",
... | Loads the very first script from queue and removes it. | [
"Loads",
"the",
"very",
"first",
"script",
"from",
"queue",
"and",
"removes",
"it",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/scriptloader.js#L173-L178 |
57,764 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/scriptloader.js | callbackWrapper | function callbackWrapper() {
callback && callback.apply( this, arguments );
// Removed the just loaded script from the queue.
pending.shift();
loadNext.call( that );
} | javascript | function callbackWrapper() {
callback && callback.apply( this, arguments );
// Removed the just loaded script from the queue.
pending.shift();
loadNext.call( that );
} | [
"function",
"callbackWrapper",
"(",
")",
"{",
"callback",
"&&",
"callback",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"// Removed the just loaded script from the queue.",
"pending",
".",
"shift",
"(",
")",
";",
"loadNext",
".",
"call",
"(",
"that",
... | This callback calls the standard callback for the script and loads the very next script from pending list. | [
"This",
"callback",
"calls",
"the",
"standard",
"callback",
"for",
"the",
"script",
"and",
"loads",
"the",
"very",
"next",
"script",
"from",
"pending",
"list",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/scriptloader.js#L185-L192 |
57,765 | darrencruse/sugarlisp-core | lexer.js | Lexer | function Lexer(sourcetext, filename, options) {
options = options || {};
this.options = options || {};
this.dialects = []; // the "stack" dialects are pushed/popped from
if(filename) {
this.filename = filename;
this.fileext = utils.getFileExt(filename, "sugar");
}
this.set_source_text(sourcetext);
} | javascript | function Lexer(sourcetext, filename, options) {
options = options || {};
this.options = options || {};
this.dialects = []; // the "stack" dialects are pushed/popped from
if(filename) {
this.filename = filename;
this.fileext = utils.getFileExt(filename, "sugar");
}
this.set_source_text(sourcetext);
} | [
"function",
"Lexer",
"(",
"sourcetext",
",",
"filename",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"dialects",
"=",
"[",
"]",
";",
"// the \"sta... | A Lexer for the source text we are scanning
note: Lexer has been done as a javacript prototypal
class with instances that hold all state for a
given source file as it's being read and transpiled.
This is in contrast to the other sugarlisp modules
which are pretty much stateless collections of
functions. The main exc... | [
"A",
"Lexer",
"for",
"the",
"source",
"text",
"we",
"are",
"scanning"
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L33-L42 |
57,766 | darrencruse/sugarlisp-core | lexer.js | regexes_for_category | function regexes_for_category(lexer, category) {
var REs = [];
var done = false;
for(var i = 0; !done && i < lexer.dialects.length; i++) {
var dialect = lexer.dialects[i];
if(dialect.lextab) {
var categoryentry = dialect.lextab.find(function(lextabentry) {
return lextabentry.category == cat... | javascript | function regexes_for_category(lexer, category) {
var REs = [];
var done = false;
for(var i = 0; !done && i < lexer.dialects.length; i++) {
var dialect = lexer.dialects[i];
if(dialect.lextab) {
var categoryentry = dialect.lextab.find(function(lextabentry) {
return lextabentry.category == cat... | [
"function",
"regexes_for_category",
"(",
"lexer",
",",
"category",
")",
"{",
"var",
"REs",
"=",
"[",
"]",
";",
"var",
"done",
"=",
"false",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"!",
"done",
"&&",
"i",
"<",
"lexer",
".",
"dialects",
".",
"l... | utility function accumulates all the regular expressions
for a given token category and returns them in an array | [
"utility",
"function",
"accumulates",
"all",
"the",
"regular",
"expressions",
"for",
"a",
"given",
"token",
"category",
"and",
"returns",
"them",
"in",
"an",
"array"
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L585-L604 |
57,767 | darrencruse/sugarlisp-core | lexer.js | oncharincategory | function oncharincategory(lexer, lookahead, categoryREs) {
var c = lexer.peek_char(lookahead);
return categoryREs.find(function(re) {
// because we're matching a single char...
re.lastIndex = 0; // make sure we start from the start
return re.test(c);
});
} | javascript | function oncharincategory(lexer, lookahead, categoryREs) {
var c = lexer.peek_char(lookahead);
return categoryREs.find(function(re) {
// because we're matching a single char...
re.lastIndex = 0; // make sure we start from the start
return re.test(c);
});
} | [
"function",
"oncharincategory",
"(",
"lexer",
",",
"lookahead",
",",
"categoryREs",
")",
"{",
"var",
"c",
"=",
"lexer",
".",
"peek_char",
"(",
"lookahead",
")",
";",
"return",
"categoryREs",
".",
"find",
"(",
"function",
"(",
"re",
")",
"{",
"// because we... | is the source sitting on a char matching a specified token category? | [
"is",
"the",
"source",
"sitting",
"on",
"a",
"char",
"matching",
"a",
"specified",
"token",
"category?"
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L609-L616 |
57,768 | darrencruse/sugarlisp-core | lexer.js | next_lextab_token | function next_lextab_token(lexer) {
var token;
if(lexer.eos()) {
return undefined;
}
// skip leading whitespace or comments...
lexer.skip_filler();
var previouslyPeeked = lexer.getPeekedToken();
if(previouslyPeeked) {
return previouslyPeeked;
}
lexer.mark_token_start();
trace(lexer.mess... | javascript | function next_lextab_token(lexer) {
var token;
if(lexer.eos()) {
return undefined;
}
// skip leading whitespace or comments...
lexer.skip_filler();
var previouslyPeeked = lexer.getPeekedToken();
if(previouslyPeeked) {
return previouslyPeeked;
}
lexer.mark_token_start();
trace(lexer.mess... | [
"function",
"next_lextab_token",
"(",
"lexer",
")",
"{",
"var",
"token",
";",
"if",
"(",
"lexer",
".",
"eos",
"(",
")",
")",
"{",
"return",
"undefined",
";",
"}",
"// skip leading whitespace or comments...",
"lexer",
".",
"skip_filler",
"(",
")",
";",
"var",... | Get the next token under the current source position according
to the lextab entries of the current dialects. | [
"Get",
"the",
"next",
"token",
"under",
"the",
"current",
"source",
"position",
"according",
"to",
"the",
"lextab",
"entries",
"of",
"the",
"current",
"dialects",
"."
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L830-L873 |
57,769 | darrencruse/sugarlisp-core | lexer.js | match_in_lextabs | function match_in_lextabs(lexer, options) {
options = options || {};
var token;
var replaced = {};
// for each dialect's lextab...
for(var d = 0; !token && d < lexer.dialects.length; d++) {
var dialect = lexer.dialects[d];
if(!dialect.lextab) {
continue; // no lextab for the dialect so move on
... | javascript | function match_in_lextabs(lexer, options) {
options = options || {};
var token;
var replaced = {};
// for each dialect's lextab...
for(var d = 0; !token && d < lexer.dialects.length; d++) {
var dialect = lexer.dialects[d];
if(!dialect.lextab) {
continue; // no lextab for the dialect so move on
... | [
"function",
"match_in_lextabs",
"(",
"lexer",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"token",
";",
"var",
"replaced",
"=",
"{",
"}",
";",
"// for each dialect's lextab...",
"for",
"(",
"var",
"d",
"=",
"0",
";",
... | Helper function returns a token for the source text
under the current position based on the nearest match
in the active dialect's lextabs.
You can optionally omit specified token categories from consideration
("options.omit"), or include only specified token categories for
consideration ("options.include").
You can a... | [
"Helper",
"function",
"returns",
"a",
"token",
"for",
"the",
"source",
"text",
"under",
"the",
"current",
"position",
"based",
"on",
"the",
"nearest",
"match",
"in",
"the",
"active",
"dialect",
"s",
"lextabs",
"."
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L887-L954 |
57,770 | darrencruse/sugarlisp-core | lexer.js | formatTokenDump | function formatTokenDump(tokens, formatter, resultPrefix, resultSuffix) {
var tokensSexpStr = "";
var currentLine = -999;
tokens.forEach(function(token, index) {
// skip the wrapping () it's annoying in the dump
if(!((index === 0 && token.text === "(") ||
(index === tokens.length-1 && token.text =... | javascript | function formatTokenDump(tokens, formatter, resultPrefix, resultSuffix) {
var tokensSexpStr = "";
var currentLine = -999;
tokens.forEach(function(token, index) {
// skip the wrapping () it's annoying in the dump
if(!((index === 0 && token.text === "(") ||
(index === tokens.length-1 && token.text =... | [
"function",
"formatTokenDump",
"(",
"tokens",
",",
"formatter",
",",
"resultPrefix",
",",
"resultSuffix",
")",
"{",
"var",
"tokensSexpStr",
"=",
"\"\"",
";",
"var",
"currentLine",
"=",
"-",
"999",
";",
"tokens",
".",
"forEach",
"(",
"function",
"(",
"token",... | format the token dump into a string
note: we put all the tokens from a line on a line to make this easier
to match up with the original source when debugging problems.
@tokens = an array of tokens
@formatter = a function which takes a token and returns a string.
@resultPrefix = optional string to prepend to the resul... | [
"format",
"the",
"token",
"dump",
"into",
"a",
"string"
] | c6ff983ebc3d60268054d6fe046db4aff6c5f78c | https://github.com/darrencruse/sugarlisp-core/blob/c6ff983ebc3d60268054d6fe046db4aff6c5f78c/lexer.js#L1214-L1234 |
57,771 | faiton/benchmark | lib/suite.js | Suite | function Suite(name, fn){
if (! (this instanceof Suite))
return new Suite(name, fn);
return this.initialize(name, fn);
} | javascript | function Suite(name, fn){
if (! (this instanceof Suite))
return new Suite(name, fn);
return this.initialize(name, fn);
} | [
"function",
"Suite",
"(",
"name",
",",
"fn",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Suite",
")",
")",
"return",
"new",
"Suite",
"(",
"name",
",",
"fn",
")",
";",
"return",
"this",
".",
"initialize",
"(",
"name",
",",
"fn",
")",
";"... | Suite constructor.
@constructor
@param {String} name
@param {Function} fn
@return {Suite}
@api public | [
"Suite",
"constructor",
"."
] | 678a10b69002c2b4a656527fbe457448ff402f40 | https://github.com/faiton/benchmark/blob/678a10b69002c2b4a656527fbe457448ff402f40/lib/suite.js#L33-L38 |
57,772 | ojj11/morphic | destructure.js | generateNamedFieldExtractors | function generateNamedFieldExtractors(input) {
var names = input.filter(function(matcher, index, array) {
// has a name?
return matcher.name;
});
// has duplicates?
names.forEach(function(matcher, index, array) {
var isDuplicate = array.slice(0, index).some(function(previousMatcher) {
return p... | javascript | function generateNamedFieldExtractors(input) {
var names = input.filter(function(matcher, index, array) {
// has a name?
return matcher.name;
});
// has duplicates?
names.forEach(function(matcher, index, array) {
var isDuplicate = array.slice(0, index).some(function(previousMatcher) {
return p... | [
"function",
"generateNamedFieldExtractors",
"(",
"input",
")",
"{",
"var",
"names",
"=",
"input",
".",
"filter",
"(",
"function",
"(",
"matcher",
",",
"index",
",",
"array",
")",
"{",
"// has a name?",
"return",
"matcher",
".",
"name",
";",
"}",
")",
";",
... | this will flatten the input into a list of named field extractors, should be run over output of generateMatchers | [
"this",
"will",
"flatten",
"the",
"input",
"into",
"a",
"list",
"of",
"named",
"field",
"extractors",
"should",
"be",
"run",
"over",
"output",
"of",
"generateMatchers"
] | 1ec6fd2f299e50866b9165c2545c430519f522ef | https://github.com/ojj11/morphic/blob/1ec6fd2f299e50866b9165c2545c430519f522ef/destructure.js#L44-L59 |
57,773 | ojj11/morphic | destructure.js | extractNamedFields | function extractNamedFields(fields, input) {
var output = Object.create(null);
fields.forEach(function(field) {
var subObject = input;
for (var i = 0; i < field.path.length; i += 1) {
if (subObject == undefined) {
throw new Error("Unreachable: matched input will always have fields");
}
... | javascript | function extractNamedFields(fields, input) {
var output = Object.create(null);
fields.forEach(function(field) {
var subObject = input;
for (var i = 0; i < field.path.length; i += 1) {
if (subObject == undefined) {
throw new Error("Unreachable: matched input will always have fields");
}
... | [
"function",
"extractNamedFields",
"(",
"fields",
",",
"input",
")",
"{",
"var",
"output",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"fields",
".",
"forEach",
"(",
"function",
"(",
"field",
")",
"{",
"var",
"subObject",
"=",
"input",
";",
"fo... | extract out the named fields from an input | [
"extract",
"out",
"the",
"named",
"fields",
"from",
"an",
"input"
] | 1ec6fd2f299e50866b9165c2545c430519f522ef | https://github.com/ojj11/morphic/blob/1ec6fd2f299e50866b9165c2545c430519f522ef/destructure.js#L62-L85 |
57,774 | nomocas/yamvish | lib/parsers/html-to-template.js | rawContent | function rawContent(tagName, string, templ, innerTemplate) {
var index = string.indexOf('</' + tagName + '>'),
raw;
if (index === -1)
throw new Error(tagName + ' tag badly closed.');
if (index) { // more than 0
raw = string.substring(0, index);
if (tagName === 'templ') // produce local api-like handler
{
... | javascript | function rawContent(tagName, string, templ, innerTemplate) {
var index = string.indexOf('</' + tagName + '>'),
raw;
if (index === -1)
throw new Error(tagName + ' tag badly closed.');
if (index) { // more than 0
raw = string.substring(0, index);
if (tagName === 'templ') // produce local api-like handler
{
... | [
"function",
"rawContent",
"(",
"tagName",
",",
"string",
",",
"templ",
",",
"innerTemplate",
")",
"{",
"var",
"index",
"=",
"string",
".",
"indexOf",
"(",
"'</'",
"+",
"tagName",
"+",
"'>'",
")",
",",
"raw",
";",
"if",
"(",
"index",
"===",
"-",
"1",
... | raw inner content of tag | [
"raw",
"inner",
"content",
"of",
"tag"
] | 017a536bb6bafddf1b31c0c7af6f723be58e9f0e | https://github.com/nomocas/yamvish/blob/017a536bb6bafddf1b31c0c7af6f723be58e9f0e/lib/parsers/html-to-template.js#L21-L35 |
57,775 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(markupList) {
("production" !== "development" ? invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' +
'thread. Make sure `window` and `document` are available globally ' +
'before requiring React when unit testing or use ' +
... | javascript | function(markupList) {
("production" !== "development" ? invariant(
ExecutionEnvironment.canUseDOM,
'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' +
'thread. Make sure `window` and `document` are available globally ' +
'before requiring React when unit testing or use ' +
... | [
"function",
"(",
"markupList",
")",
"{",
"(",
"\"production\"",
"!==",
"\"development\"",
"?",
"invariant",
"(",
"ExecutionEnvironment",
".",
"canUseDOM",
",",
"'dangerouslyRenderMarkup(...): Cannot render markup in a worker '",
"+",
"'thread. Make sure `window` and `document` ar... | Renders markup into an array of nodes. The markup is expected to render
into a list of root nodes. Also, the length of `resultList` and
`markupList` should be the same.
@param {array<string>} markupList List of markup strings to render.
@return {array<DOMElement>} List of rendered nodes.
@internal | [
"Renders",
"markup",
"into",
"an",
"array",
"of",
"nodes",
".",
"The",
"markup",
"is",
"expected",
"to",
"render",
"into",
"a",
"list",
"of",
"root",
"nodes",
".",
"Also",
"the",
"length",
"of",
"resultList",
"and",
"markupList",
"should",
"be",
"the",
"... | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L2168-L2265 | |
57,776 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | recomputePluginOrdering | function recomputePluginOrdering() {
if (!EventPluginOrder) {
// Wait until an `EventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var PluginModule = namesToPlugins[pluginName];
var pluginIndex = EventPluginOrder.indexOf(pluginName);
("production" !== "developmen... | javascript | function recomputePluginOrdering() {
if (!EventPluginOrder) {
// Wait until an `EventPluginOrder` is injected.
return;
}
for (var pluginName in namesToPlugins) {
var PluginModule = namesToPlugins[pluginName];
var pluginIndex = EventPluginOrder.indexOf(pluginName);
("production" !== "developmen... | [
"function",
"recomputePluginOrdering",
"(",
")",
"{",
"if",
"(",
"!",
"EventPluginOrder",
")",
"{",
"// Wait until an `EventPluginOrder` is injected.",
"return",
";",
"}",
"for",
"(",
"var",
"pluginName",
"in",
"namesToPlugins",
")",
"{",
"var",
"PluginModule",
"=",... | Recomputes the plugin list using the injected plugins and plugin ordering.
@private | [
"Recomputes",
"the",
"plugin",
"list",
"using",
"the",
"injected",
"plugins",
"and",
"plugin",
"ordering",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L2947-L2989 |
57,777 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | publishEventForPlugin | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
("production" !== "development" ? invariant(
!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName),
'EventPluginHub: More than one plugin attempted to publish the same ' +
'event name, `%s`.',
eventName
) : i... | javascript | function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
("production" !== "development" ? invariant(
!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName),
'EventPluginHub: More than one plugin attempted to publish the same ' +
'event name, `%s`.',
eventName
) : i... | [
"function",
"publishEventForPlugin",
"(",
"dispatchConfig",
",",
"PluginModule",
",",
"eventName",
")",
"{",
"(",
"\"production\"",
"!==",
"\"development\"",
"?",
"invariant",
"(",
"!",
"EventPluginRegistry",
".",
"eventNameDispatchConfigs",
".",
"hasOwnProperty",
"(",
... | Publishes an event so that it can be dispatched by the supplied plugin.
@param {object} dispatchConfig Dispatch configuration for the event.
@param {object} PluginModule Plugin publishing the event.
@return {boolean} True if the event was successfully published.
@private | [
"Publishes",
"an",
"event",
"so",
"that",
"it",
"can",
"be",
"dispatched",
"by",
"the",
"supplied",
"plugin",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L2999-L3030 |
57,778 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(spec) {
var Constructor = function(props, context) {
// This constructor is overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if ("production" !== "development") {
("production" !== "development" ? warning(
this instanceof Constructor... | javascript | function(spec) {
var Constructor = function(props, context) {
// This constructor is overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if ("production" !== "development") {
("production" !== "development" ? warning(
this instanceof Constructor... | [
"function",
"(",
"spec",
")",
"{",
"var",
"Constructor",
"=",
"function",
"(",
"props",
",",
"context",
")",
"{",
"// This constructor is overridden by mocks. The argument is used",
"// by mocks to assert on what gets mounted.",
"if",
"(",
"\"production\"",
"!==",
"\"develo... | Creates a composite component class given a class specification.
@param {object} spec Class specification (which must define `render`).
@return {function} Component constructor function.
@public | [
"Creates",
"a",
"composite",
"component",
"class",
"given",
"a",
"class",
"specification",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L5818-L5922 | |
57,779 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(propTypes, props, location) {
// TODO: Stop validating prop types here and only use the element
// validation.
var componentName = this.getName();
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
try {
// This is intentionall... | javascript | function(propTypes, props, location) {
// TODO: Stop validating prop types here and only use the element
// validation.
var componentName = this.getName();
for (var propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error;
try {
// This is intentionall... | [
"function",
"(",
"propTypes",
",",
"props",
",",
"location",
")",
"{",
"// TODO: Stop validating prop types here and only use the element",
"// validation.",
"var",
"componentName",
"=",
"this",
".",
"getName",
"(",
")",
";",
"for",
"(",
"var",
"propName",
"in",
"pr... | Assert that the props are valid
@param {object} propTypes Map of prop name to a ReactPropType
@param {object} props
@param {string} location e.g. "prop", "context", "child context"
@private | [
"Assert",
"that",
"the",
"props",
"are",
"valid"
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L6643-L6690 | |
57,780 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | warnForPropsMutation | function warnForPropsMutation(propName, element) {
var type = element.type;
var elementName = typeof type === 'string' ? type : type.displayName;
var ownerName = element._owner ?
element._owner.getPublicInstance().constructor.displayName : null;
var warningKey = propName + '|' + elementName + '|' + ownerNa... | javascript | function warnForPropsMutation(propName, element) {
var type = element.type;
var elementName = typeof type === 'string' ? type : type.displayName;
var ownerName = element._owner ?
element._owner.getPublicInstance().constructor.displayName : null;
var warningKey = propName + '|' + elementName + '|' + ownerNa... | [
"function",
"warnForPropsMutation",
"(",
"propName",
",",
"element",
")",
"{",
"var",
"type",
"=",
"element",
".",
"type",
";",
"var",
"elementName",
"=",
"typeof",
"type",
"===",
"'string'",
"?",
"type",
":",
"type",
".",
"displayName",
";",
"var",
"owner... | Warn about mutating props when setting `propName` on `element`.
@param {string} propName The string key within props that was set
@param {ReactElement} element | [
"Warn",
"about",
"mutating",
"props",
"when",
"setting",
"propName",
"on",
"element",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L10417-L10447 |
57,781 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(object) {
if ("production" !== "development") {
if (typeof object !== 'object' || !object || Array.isArray(object)) {
("production" !== "development" ? warning(
false,
'React.addons.createFragment only accepts a single object.',
object
) : null);
... | javascript | function(object) {
if ("production" !== "development") {
if (typeof object !== 'object' || !object || Array.isArray(object)) {
("production" !== "development" ? warning(
false,
'React.addons.createFragment only accepts a single object.',
object
) : null);
... | [
"function",
"(",
"object",
")",
"{",
"if",
"(",
"\"production\"",
"!==",
"\"development\"",
")",
"{",
"if",
"(",
"typeof",
"object",
"!==",
"'object'",
"||",
"!",
"object",
"||",
"Array",
".",
"isArray",
"(",
"object",
")",
")",
"{",
"(",
"\"production\"... | Wrap a keyed object in an opaque proxy that warns you if you access any of its properties. | [
"Wrap",
"a",
"keyed",
"object",
"in",
"an",
"opaque",
"proxy",
"that",
"warns",
"you",
"if",
"you",
"access",
"any",
"of",
"its",
"properties",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L11065-L11102 | |
57,782 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (Strictly speaking, unmounting won't cause a
// render but we still don't expect to be in a render call here.)
... | javascript | function(container) {
// Various parts of our code (such as ReactCompositeComponent's
// _renderValidatedComponent) assume that calls to render aren't nested;
// verify that that's the case. (Strictly speaking, unmounting won't cause a
// render but we still don't expect to be in a render call here.)
... | [
"function",
"(",
"container",
")",
"{",
"// Various parts of our code (such as ReactCompositeComponent's",
"// _renderValidatedComponent) assume that calls to render aren't nested;",
"// verify that that's the case. (Strictly speaking, unmounting won't cause a",
"// render but we still don't expect ... | Unmounts and destroys the React component rendered in the `container`.
@param {DOMElement} container DOM element containing a React component.
@return {boolean} True if a component was found in and unmounted from
`container` | [
"Unmounts",
"and",
"destroys",
"the",
"React",
"component",
"rendered",
"in",
"the",
"container",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L12362-L12396 | |
57,783 | srouse/cssmodeler | example/dist/csssystem/styleguide/cmod_styleguide.js | function(objName, fnName, func) {
if ("production" !== "development") {
var measuredFunc = null;
var wrapper = function() {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
}
return measur... | javascript | function(objName, fnName, func) {
if ("production" !== "development") {
var measuredFunc = null;
var wrapper = function() {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
}
return measur... | [
"function",
"(",
"objName",
",",
"fnName",
",",
"func",
")",
"{",
"if",
"(",
"\"production\"",
"!==",
"\"development\"",
")",
"{",
"var",
"measuredFunc",
"=",
"null",
";",
"var",
"wrapper",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"ReactPerf",
".",
"... | Use this to wrap methods you want to measure. Zero overhead in production.
@param {string} objName
@param {string} fnName
@param {function} func
@return {function} | [
"Use",
"this",
"to",
"wrap",
"methods",
"you",
"want",
"to",
"measure",
".",
"Zero",
"overhead",
"in",
"production",
"."
] | 8682a44736d21877a3237b222587acc2b43924c9 | https://github.com/srouse/cssmodeler/blob/8682a44736d21877a3237b222587acc2b43924c9/example/dist/csssystem/styleguide/cmod_styleguide.js#L13423-L13439 | |
57,784 | phated/grunt-enyo | tasks/init/enyo/root/enyo/source/kernel/Object.js | function() {
var acc = arguments.callee.caller;
var nom = ((acc ? acc.nom : "") || "(instance method)") + ":";
enyo.logging.log("log", [nom].concat(enyo.cloneArray(arguments)));
} | javascript | function() {
var acc = arguments.callee.caller;
var nom = ((acc ? acc.nom : "") || "(instance method)") + ":";
enyo.logging.log("log", [nom].concat(enyo.cloneArray(arguments)));
} | [
"function",
"(",
")",
"{",
"var",
"acc",
"=",
"arguments",
".",
"callee",
".",
"caller",
";",
"var",
"nom",
"=",
"(",
"(",
"acc",
"?",
"acc",
".",
"nom",
":",
"\"\"",
")",
"||",
"\"(instance method)\"",
")",
"+",
"\":\"",
";",
"enyo",
".",
"logging... | Sends a log message to the console, prepended with the name of the kind
and method from which _log_ was invoked. Multiple arguments are coerced
to String and joined with spaces.
enyo.kind({
name: "MyObject",
kind: enyo.Object,
hello: function() {
this.log("says", "hi");
shows in the console: MyObject.hello: says hi
}... | [
"Sends",
"a",
"log",
"message",
"to",
"the",
"console",
"prepended",
"with",
"the",
"name",
"of",
"the",
"kind",
"and",
"method",
"from",
"which",
"_log_",
"was",
"invoked",
".",
"Multiple",
"arguments",
"are",
"coerced",
"to",
"String",
"and",
"joined",
"... | d2990ee4cd85eea8db4108c43086c6d8c3c90c30 | https://github.com/phated/grunt-enyo/blob/d2990ee4cd85eea8db4108c43086c6d8c3c90c30/tasks/init/enyo/root/enyo/source/kernel/Object.js#L77-L81 | |
57,785 | melvincarvalho/rdf-shell | lib/mv.js | mv | function mv (sourceURI, destURI, callback) {
if (!sourceURI) {
callback(new Error('source URI is required'))
}
if (!destURI) {
callback(new Error('dest URI is required'))
}
util.get(sourceURI, function (err, val, uri) {
util.put(destURI, val, function (err, ret, uri) {
if (!err) {
ut... | javascript | function mv (sourceURI, destURI, callback) {
if (!sourceURI) {
callback(new Error('source URI is required'))
}
if (!destURI) {
callback(new Error('dest URI is required'))
}
util.get(sourceURI, function (err, val, uri) {
util.put(destURI, val, function (err, ret, uri) {
if (!err) {
ut... | [
"function",
"mv",
"(",
"sourceURI",
",",
"destURI",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"sourceURI",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"'source URI is required'",
")",
")",
"}",
"if",
"(",
"!",
"destURI",
")",
"{",
"callback",
"(",... | Move rdf from a source to a destination.
@param {string} sourceURI The source URI
@param {string} destURI The dest URI
@param {function} callback Callback with result | [
"Move",
"rdf",
"from",
"a",
"source",
"to",
"a",
"destination",
"."
] | bf2015f6f333855e69a18ce3ec9e917bbddfb425 | https://github.com/melvincarvalho/rdf-shell/blob/bf2015f6f333855e69a18ce3ec9e917bbddfb425/lib/mv.js#L11-L33 |
57,786 | kaliumxyz/euphoria-connection | examples/userlist/index.js | update | function update() {
connection = new Connection(room)
// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
connection.on('ready', _ => {
connection.on('snapshot-event', event => {
// get every listener including bots and lurkers
userLis... | javascript | function update() {
connection = new Connection(room)
// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
connection.on('ready', _ => {
connection.on('snapshot-event', event => {
// get every listener including bots and lurkers
userLis... | [
"function",
"update",
"(",
")",
"{",
"connection",
"=",
"new",
"Connection",
"(",
"room",
")",
"// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server",
"connection",
".",
"on",
"(",
"'ready'",
",",
"_",
"... | Update the userList global with new data from the targeted euphoria room. We use the snapshot even send on a new connect to update the userlist. | [
"Update",
"the",
"userList",
"global",
"with",
"new",
"data",
"from",
"the",
"targeted",
"euphoria",
"room",
".",
"We",
"use",
"the",
"snapshot",
"even",
"send",
"on",
"a",
"new",
"connect",
"to",
"update",
"the",
"userlist",
"."
] | 936cc92117f78d2c8f9560d80b1c416e672c8c42 | https://github.com/kaliumxyz/euphoria-connection/blob/936cc92117f78d2c8f9560d80b1c416e672c8c42/examples/userlist/index.js#L25-L36 |
57,787 | kaliumxyz/euphoria-connection | examples/userlist/index.js | render | function render(list) {
const blank = new Array(process.stdout.rows).fill('\n')
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
list.forEach( user => {
console.log(`${chalk.hsl(color(user.name),100,50)(user.name)}: ${user.id}`)
})
} | javascript | function render(list) {
const blank = new Array(process.stdout.rows).fill('\n')
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
list.forEach( user => {
console.log(`${chalk.hsl(color(user.name),100,50)(user.name)}: ${user.id}`)
})
} | [
"function",
"render",
"(",
"list",
")",
"{",
"const",
"blank",
"=",
"new",
"Array",
"(",
"process",
".",
"stdout",
".",
"rows",
")",
".",
"fill",
"(",
"'\\n'",
")",
"console",
".",
"log",
"(",
"blank",
")",
"readline",
".",
"cursorTo",
"(",
"process"... | Render our list, replace the old console content with our newer content and place the relevant data in the relevant places.
@param {Array} list | [
"Render",
"our",
"list",
"replace",
"the",
"old",
"console",
"content",
"with",
"our",
"newer",
"content",
"and",
"place",
"the",
"relevant",
"data",
"in",
"the",
"relevant",
"places",
"."
] | 936cc92117f78d2c8f9560d80b1c416e672c8c42 | https://github.com/kaliumxyz/euphoria-connection/blob/936cc92117f78d2c8f9560d80b1c416e672c8c42/examples/userlist/index.js#L48-L58 |
57,788 | oskarhagberg/gbgcity | lib/waterflow.js | getMeasureStations | function getMeasureStations(latitude, longitude, params, callback) {
if(!latitude || !longitude) {
callback(new Error("WaterFlow.getMeasureStations: latitude and longitude required"));
return;
}
params = params || {};
params.latitude = latitude;
params.longitude = longitude;
core.cal... | javascript | function getMeasureStations(latitude, longitude, params, callback) {
if(!latitude || !longitude) {
callback(new Error("WaterFlow.getMeasureStations: latitude and longitude required"));
return;
}
params = params || {};
params.latitude = latitude;
params.longitude = longitude;
core.cal... | [
"function",
"getMeasureStations",
"(",
"latitude",
",",
"longitude",
",",
"params",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"latitude",
"||",
"!",
"longitude",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"WaterFlow.getMeasureStations: latitude and longitu... | Returns a list of all available measure stations producing water level data.
@memberof module:gbgcity/WaterFlow
@param {String|Number} latitude The latitude of the location around which to explore.
@param {String|Number} longitude The longitude of the location around which to explore.
@param {Object} [params] An objec... | [
"Returns",
"a",
"list",
"of",
"all",
"available",
"measure",
"stations",
"producing",
"water",
"level",
"data",
"."
] | d2de903b2fba83cc953ae218905380fef080cb2d | https://github.com/oskarhagberg/gbgcity/blob/d2de903b2fba83cc953ae218905380fef080cb2d/lib/waterflow.js#L24-L33 |
57,789 | oskarhagberg/gbgcity | lib/waterflow.js | getWaterLevel | function getWaterLevel(stationId, startDate, endDate, params, callback) {
if(!stationId) {
callback(new Error("WaterFlow.getWaterLevel: stationId required"));
return;
}
params = params || {};
params.stationid = stationId;
if(!startDate && !endDate) {
startDate = new Date();
s... | javascript | function getWaterLevel(stationId, startDate, endDate, params, callback) {
if(!stationId) {
callback(new Error("WaterFlow.getWaterLevel: stationId required"));
return;
}
params = params || {};
params.stationid = stationId;
if(!startDate && !endDate) {
startDate = new Date();
s... | [
"function",
"getWaterLevel",
"(",
"stationId",
",",
"startDate",
",",
"endDate",
",",
"params",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"stationId",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"WaterFlow.getWaterLevel: stationId required\"",
")",
")",
... | Returns a list of water level measuring points given a sertain station and time interval.
@memberof module:gbgcity/WaterFlow
@param {String} stationId
@param {String} [startDate]
@param {String} [endData]
@param {Function} callback The function to call with results, function({Error} error, {Object} results)/
@see http... | [
"Returns",
"a",
"list",
"of",
"water",
"level",
"measuring",
"points",
"given",
"a",
"sertain",
"station",
"and",
"time",
"interval",
"."
] | d2de903b2fba83cc953ae218905380fef080cb2d | https://github.com/oskarhagberg/gbgcity/blob/d2de903b2fba83cc953ae218905380fef080cb2d/lib/waterflow.js#L45-L62 |
57,790 | danielwerthen/funcis | lib/listener.js | matches | function matches(url, command) {
var cap;
if (cap = commandReg.exec(url)) return cap[1] === command;
} | javascript | function matches(url, command) {
var cap;
if (cap = commandReg.exec(url)) return cap[1] === command;
} | [
"function",
"matches",
"(",
"url",
",",
"command",
")",
"{",
"var",
"cap",
";",
"if",
"(",
"cap",
"=",
"commandReg",
".",
"exec",
"(",
"url",
")",
")",
"return",
"cap",
"[",
"1",
"]",
"===",
"command",
";",
"}"
] | Ugliness to support escaped backslashes in windows | [
"Ugliness",
"to",
"support",
"escaped",
"backslashes",
"in",
"windows"
] | 9482ea954e6684e6803c824b4105eac735d83812 | https://github.com/danielwerthen/funcis/blob/9482ea954e6684e6803c824b4105eac735d83812/lib/listener.js#L13-L16 |
57,791 | laconbass/mocha-pending | index.js | Pending | function Pending(runner) {
runner.on('start', function(){
console.log('* ')
console.log('*********************');
console.log('*** Pending tests ***');
console.log('*********************');
console.log('* ')
});
var scope = [];
runner.on('pending', function(test){
var current = [test]... | javascript | function Pending(runner) {
runner.on('start', function(){
console.log('* ')
console.log('*********************');
console.log('*** Pending tests ***');
console.log('*********************');
console.log('* ')
});
var scope = [];
runner.on('pending', function(test){
var current = [test]... | [
"function",
"Pending",
"(",
"runner",
")",
"{",
"runner",
".",
"on",
"(",
"'start'",
",",
"function",
"(",
")",
"{",
"console",
".",
"log",
"(",
"'* '",
")",
"console",
".",
"log",
"(",
"'*********************'",
")",
";",
"console",
".",
"log",
"(",
... | Initialize a new `Pending` test reporter.
@param {Runner} runner
@api public | [
"Initialize",
"a",
"new",
"Pending",
"test",
"reporter",
"."
] | df0e5ee270cee86596a755ceb1900a83b2fa6e41 | https://github.com/laconbass/mocha-pending/blob/df0e5ee270cee86596a755ceb1900a83b2fa6e41/index.js#L14-L46 |
57,792 | rsdoiel/stn | stn.js | function (d, use_UTC) {
if (typeof d === "string") {
if (d.match(/[0-9][0-9][0-9][0-9][\s]*-[0-1][0-9]-[\s]*[0-3][0-9]/)) {
return d.replace(/\s+/, "");
}
d = new Date(d);
} else if (typeof d === "number") {
d = new Date(d);
} else if (typeof d !== "object" &&
typeof d.getFullYear !== "functio... | javascript | function (d, use_UTC) {
if (typeof d === "string") {
if (d.match(/[0-9][0-9][0-9][0-9][\s]*-[0-1][0-9]-[\s]*[0-3][0-9]/)) {
return d.replace(/\s+/, "");
}
d = new Date(d);
} else if (typeof d === "number") {
d = new Date(d);
} else if (typeof d !== "object" &&
typeof d.getFullYear !== "functio... | [
"function",
"(",
"d",
",",
"use_UTC",
")",
"{",
"if",
"(",
"typeof",
"d",
"===",
"\"string\"",
")",
"{",
"if",
"(",
"d",
".",
"match",
"(",
"/",
"[0-9][0-9][0-9][0-9][\\s]*-[0-1][0-9]-[\\s]*[0-3][0-9]",
"/",
")",
")",
"{",
"return",
"d",
".",
"replace",
... | Format a date as YYYY-MM-DD @param Date object @return string in YYYY-MM-DD format | [
"Format",
"a",
"date",
"as",
"YYYY",
"-",
"MM",
"-",
"DD"
] | dffbe22a4a672f262e4c9151edf75fa7e077b8f4 | https://github.com/rsdoiel/stn/blob/dffbe22a4a672f262e4c9151edf75fa7e077b8f4/stn.js#L17-L41 | |
57,793 | rsdoiel/stn | stn.js | function (options) {
var ky,
default_keys = [
"normalize_date",
"hours",
"save_parse",
"tags",
"map"
],
defaults = {},
map = {};
default_keys.forEach(function (ky) {
defaults[ky] = true;
});
this.defaults = defaults;
this.map = false;
this.parse_tree = {};
this.msgs = ... | javascript | function (options) {
var ky,
default_keys = [
"normalize_date",
"hours",
"save_parse",
"tags",
"map"
],
defaults = {},
map = {};
default_keys.forEach(function (ky) {
defaults[ky] = true;
});
this.defaults = defaults;
this.map = false;
this.parse_tree = {};
this.msgs = ... | [
"function",
"(",
"options",
")",
"{",
"var",
"ky",
",",
"default_keys",
"=",
"[",
"\"normalize_date\"",
",",
"\"hours\"",
",",
"\"save_parse\"",
",",
"\"tags\"",
",",
"\"map\"",
"]",
",",
"defaults",
"=",
"{",
"}",
",",
"map",
"=",
"{",
"}",
";",
"defa... | reset - clear the parse tree sets save_parse to true, sets normalize_date to true sets tags to true sets map ot false @param options - a set of options to override the defaults with on reset. | [
"reset",
"-",
"clear",
"the",
"parse",
"tree",
"sets",
"save_parse",
"to",
"true",
"sets",
"normalize_date",
"to",
"true",
"sets",
"tags",
"to",
"true",
"sets",
"map",
"ot",
"false"
] | dffbe22a4a672f262e4c9151edf75fa7e077b8f4 | https://github.com/rsdoiel/stn/blob/dffbe22a4a672f262e4c9151edf75fa7e077b8f4/stn.js#L66-L99 | |
57,794 | rsdoiel/stn | stn.js | function (msg) {
var i = this.msgs.length;
this.msgs.push('ERROR: ' + msg);
if ((i + 1) !== this.msgs.length) {
return false;
}
return true;
} | javascript | function (msg) {
var i = this.msgs.length;
this.msgs.push('ERROR: ' + msg);
if ((i + 1) !== this.msgs.length) {
return false;
}
return true;
} | [
"function",
"(",
"msg",
")",
"{",
"var",
"i",
"=",
"this",
".",
"msgs",
".",
"length",
";",
"this",
".",
"msgs",
".",
"push",
"(",
"'ERROR: '",
"+",
"msg",
")",
";",
"if",
"(",
"(",
"i",
"+",
"1",
")",
"!==",
"this",
".",
"msgs",
".",
"length... | error - collect parse errors into the msgs array.
@param msg - the message to the collection of messages.
@return true on successful add, false otherwise | [
"error",
"-",
"collect",
"parse",
"errors",
"into",
"the",
"msgs",
"array",
"."
] | dffbe22a4a672f262e4c9151edf75fa7e077b8f4 | https://github.com/rsdoiel/stn/blob/dffbe22a4a672f262e4c9151edf75fa7e077b8f4/stn.js#L120-L128 | |
57,795 | rsdoiel/stn | stn.js | function (no_clear) {
var result;
if (this.msgs === undefined) {
this.msgs = [];
}
result = this.msgs.join("\n");
// set optional default i needed
if (no_clear !== undefined) {
no_clear = false;
}
if (no_clear === true) {
return result;
}
// Clear the messages
this.msgs = [];
retu... | javascript | function (no_clear) {
var result;
if (this.msgs === undefined) {
this.msgs = [];
}
result = this.msgs.join("\n");
// set optional default i needed
if (no_clear !== undefined) {
no_clear = false;
}
if (no_clear === true) {
return result;
}
// Clear the messages
this.msgs = [];
retu... | [
"function",
"(",
"no_clear",
")",
"{",
"var",
"result",
";",
"if",
"(",
"this",
".",
"msgs",
"===",
"undefined",
")",
"{",
"this",
".",
"msgs",
"=",
"[",
"]",
";",
"}",
"result",
"=",
"this",
".",
"msgs",
".",
"join",
"(",
"\"\\n\"",
")",
";",
... | messages - return the msgs array as a single string delimited
by new lines.
@param no_clear (optional, defaults to false)
@return string representing in messages | [
"messages",
"-",
"return",
"the",
"msgs",
"array",
"as",
"a",
"single",
"string",
"delimited",
"by",
"new",
"lines",
"."
] | dffbe22a4a672f262e4c9151edf75fa7e077b8f4 | https://github.com/rsdoiel/stn/blob/dffbe22a4a672f262e4c9151edf75fa7e077b8f4/stn.js#L148-L168 | |
57,796 | rsdoiel/stn | stn.js | function () {
var self = this,
dates = Object.keys(this.parse_tree),
lines = [];
dates.sort();
dates.forEach(function (dy, i) {
var times = Object.keys(self.parse_tree[dy]);
lines.push(dy);
times.sort();
times.forEach(function (tm) {
var tags = "", maps = "", notes = "", rec;
rec... | javascript | function () {
var self = this,
dates = Object.keys(this.parse_tree),
lines = [];
dates.sort();
dates.forEach(function (dy, i) {
var times = Object.keys(self.parse_tree[dy]);
lines.push(dy);
times.sort();
times.forEach(function (tm) {
var tags = "", maps = "", notes = "", rec;
rec... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"dates",
"=",
"Object",
".",
"keys",
"(",
"this",
".",
"parse_tree",
")",
",",
"lines",
"=",
"[",
"]",
";",
"dates",
".",
"sort",
"(",
")",
";",
"dates",
".",
"forEach",
"(",
"function",... | Render parse tree as string. | [
"Render",
"parse",
"tree",
"as",
"string",
"."
] | dffbe22a4a672f262e4c9151edf75fa7e077b8f4 | https://github.com/rsdoiel/stn/blob/dffbe22a4a672f262e4c9151edf75fa7e077b8f4/stn.js#L365-L409 | |
57,797 | Aratramba/text-file-register | index.js | addFiles | function addFiles(pattern, cb){
glob(pattern, function(err, files){
if(err) throw err;
async.each(files, readFile, function(err){
if(err) throw err;
if(cb) cb();
});
});
} | javascript | function addFiles(pattern, cb){
glob(pattern, function(err, files){
if(err) throw err;
async.each(files, readFile, function(err){
if(err) throw err;
if(cb) cb();
});
});
} | [
"function",
"addFiles",
"(",
"pattern",
",",
"cb",
")",
"{",
"glob",
"(",
"pattern",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"if",
"(",
"err",
")",
"throw",
"err",
";",
"async",
".",
"each",
"(",
"files",
",",
"readFile",
",",
"functio... | Add files to register | [
"Add",
"files",
"to",
"register"
] | 061249f90b08a300ec3647db167957d27a51ccdd | https://github.com/Aratramba/text-file-register/blob/061249f90b08a300ec3647db167957d27a51ccdd/index.js#L32-L41 |
57,798 | camshaft/anvil-cli | lib/local.js | find | function find(source, fn) {
glob('**', {cwd: source, dot: true}, function(err, files) {
fn(err, files);
});
} | javascript | function find(source, fn) {
glob('**', {cwd: source, dot: true}, function(err, files) {
fn(err, files);
});
} | [
"function",
"find",
"(",
"source",
",",
"fn",
")",
"{",
"glob",
"(",
"'**'",
",",
"{",
"cwd",
":",
"source",
",",
"dot",
":",
"true",
"}",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"fn",
"(",
"err",
",",
"files",
")",
";",
"}",
")"... | Glob source dir
@param {String} source
@param {Function} fn | [
"Glob",
"source",
"dir"
] | 5930e2165698c5577a0bcfa471dd521089acfb78 | https://github.com/camshaft/anvil-cli/blob/5930e2165698c5577a0bcfa471dd521089acfb78/lib/local.js#L106-L110 |
57,799 | camshaft/anvil-cli | lib/local.js | filterIgnored | function filterIgnored(files, ignore, fn) {
fn(null, files.filter(function(file) {
// TODO make more robust
return !~ignore.indexOf(file) && !~ignore.indexOf(file + '/');
}));
} | javascript | function filterIgnored(files, ignore, fn) {
fn(null, files.filter(function(file) {
// TODO make more robust
return !~ignore.indexOf(file) && !~ignore.indexOf(file + '/');
}));
} | [
"function",
"filterIgnored",
"(",
"files",
",",
"ignore",
",",
"fn",
")",
"{",
"fn",
"(",
"null",
",",
"files",
".",
"filter",
"(",
"function",
"(",
"file",
")",
"{",
"// TODO make more robust",
"return",
"!",
"~",
"ignore",
".",
"indexOf",
"(",
"file",
... | Filter ignored files
@param {Array} files
@param {Array} ignore | [
"Filter",
"ignored",
"files"
] | 5930e2165698c5577a0bcfa471dd521089acfb78 | https://github.com/camshaft/anvil-cli/blob/5930e2165698c5577a0bcfa471dd521089acfb78/lib/local.js#L132-L137 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.