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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55,900 | joekarl/fastsync | fastsync.js | makeChainedCallback | function makeChainedCallback(i, fns, results, cb) {
return function(err, result) {
if (err) {
return cb(err);
}
results[i] = result;
if (fns[i + 1]) {
return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb));
} el... | javascript | function makeChainedCallback(i, fns, results, cb) {
return function(err, result) {
if (err) {
return cb(err);
}
results[i] = result;
if (fns[i + 1]) {
return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb));
} el... | [
"function",
"makeChainedCallback",
"(",
"i",
",",
"fns",
",",
"results",
",",
"cb",
")",
"{",
"return",
"function",
"(",
"err",
",",
"result",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"cb",
"(",
"err",
")",
";",
"}",
"results",
"[",
"i",
"... | Create a function that will call the next function in a chain
when finished | [
"Create",
"a",
"function",
"that",
"will",
"call",
"the",
"next",
"function",
"in",
"a",
"chain",
"when",
"finished"
] | b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4 | https://github.com/joekarl/fastsync/blob/b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4/fastsync.js#L142-L154 |
55,901 | joekarl/fastsync | fastsync.js | makeCountNCallback | function makeCountNCallback(n, cb) {
var count = 0,
results = [],
error;
return function(index, err, result) {
results[index] = result;
if (!error && err) {
error = err;
return cb(err);
}
if (!error &... | javascript | function makeCountNCallback(n, cb) {
var count = 0,
results = [],
error;
return function(index, err, result) {
results[index] = result;
if (!error && err) {
error = err;
return cb(err);
}
if (!error &... | [
"function",
"makeCountNCallback",
"(",
"n",
",",
"cb",
")",
"{",
"var",
"count",
"=",
"0",
",",
"results",
"=",
"[",
"]",
",",
"error",
";",
"return",
"function",
"(",
"index",
",",
"err",
",",
"result",
")",
"{",
"results",
"[",
"index",
"]",
"=",... | Create a function that will call a callback after n function calls | [
"Create",
"a",
"function",
"that",
"will",
"call",
"a",
"callback",
"after",
"n",
"function",
"calls"
] | b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4 | https://github.com/joekarl/fastsync/blob/b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4/fastsync.js#L159-L173 |
55,902 | walling/logentries-query-stream | index.js | logentriesRawStream | function logentriesRawStream(pathname, query={}) {
query = Object.assign({}, query);
// If query format is not defined, we set it by default to JSON.
if (!query.format) {
query.format = 'json';
}
// Text format is default in Logentries, in this case we remove the parameter.
if (query.f... | javascript | function logentriesRawStream(pathname, query={}) {
query = Object.assign({}, query);
// If query format is not defined, we set it by default to JSON.
if (!query.format) {
query.format = 'json';
}
// Text format is default in Logentries, in this case we remove the parameter.
if (query.f... | [
"function",
"logentriesRawStream",
"(",
"pathname",
",",
"query",
"=",
"{",
"}",
")",
"{",
"query",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"query",
")",
";",
"// If query format is not defined, we set it by default to JSON.",
"if",
"(",
"!",
"query",
... | Query and stream raw logs from Logentries. This is not returning an object stream. If you want JSON objects, use the `logentriesJsonStream` function. | [
"Query",
"and",
"stream",
"raw",
"logs",
"from",
"Logentries",
".",
"This",
"is",
"not",
"returning",
"an",
"object",
"stream",
".",
"If",
"you",
"want",
"JSON",
"objects",
"use",
"the",
"logentriesJsonStream",
"function",
"."
] | 59035ebc0acaf269ca5230e56116d535c2d88d7a | https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L10-L44 |
55,903 | walling/logentries-query-stream | index.js | logentriesJsonStream | function logentriesJsonStream(pathname, query={}) {
query = Object.assign({}, query);
// Force query format to JSON.
query.format = 'json';
// Parse each array entry from raw stream and emit JSON objects.
return pump(logentriesRawStream(pathname, query), JSONStream.parse('*'));
} | javascript | function logentriesJsonStream(pathname, query={}) {
query = Object.assign({}, query);
// Force query format to JSON.
query.format = 'json';
// Parse each array entry from raw stream and emit JSON objects.
return pump(logentriesRawStream(pathname, query), JSONStream.parse('*'));
} | [
"function",
"logentriesJsonStream",
"(",
"pathname",
",",
"query",
"=",
"{",
"}",
")",
"{",
"query",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"query",
")",
";",
"// Force query format to JSON.",
"query",
".",
"format",
"=",
"'json'",
";",
"// Pars... | Query and stream logs from Logentries. This returns a readable object stream emitting log record JSON objects. | [
"Query",
"and",
"stream",
"logs",
"from",
"Logentries",
".",
"This",
"returns",
"a",
"readable",
"object",
"stream",
"emitting",
"log",
"record",
"JSON",
"objects",
"."
] | 59035ebc0acaf269ca5230e56116d535c2d88d7a | https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L48-L56 |
55,904 | walling/logentries-query-stream | index.js | logentriesConnect | function logentriesConnect(options={}) {
// Define path to access specific account, log set and log.
let pathname = '/' + encodeURIComponent(options.account) +
'/hosts/' + encodeURIComponent(options.logset) +
'/' + encodeURIComponent(options.log) + '/';
// ... | javascript | function logentriesConnect(options={}) {
// Define path to access specific account, log set and log.
let pathname = '/' + encodeURIComponent(options.account) +
'/hosts/' + encodeURIComponent(options.logset) +
'/' + encodeURIComponent(options.log) + '/';
// ... | [
"function",
"logentriesConnect",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"// Define path to access specific account, log set and log.",
"let",
"pathname",
"=",
"'/'",
"+",
"encodeURIComponent",
"(",
"options",
".",
"account",
")",
"+",
"'/hosts/'",
"+",
"encodeURICom... | Setup connection to a specific account and log. Returns query function. | [
"Setup",
"connection",
"to",
"a",
"specific",
"account",
"and",
"log",
".",
"Returns",
"query",
"function",
"."
] | 59035ebc0acaf269ca5230e56116d535c2d88d7a | https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L59-L73 |
55,905 | Qwerios/madlib-generic-cache | lib/index.js | CacheModule | function CacheModule(settings, cacheName, serviceHandler, serviceCallName) {
if (serviceCallName == null) {
serviceCallName = "call";
}
settings.init("cacheModules", {
expiration: {
"default": 1800000
}
});
this.settings = settings;
... | javascript | function CacheModule(settings, cacheName, serviceHandler, serviceCallName) {
if (serviceCallName == null) {
serviceCallName = "call";
}
settings.init("cacheModules", {
expiration: {
"default": 1800000
}
});
this.settings = settings;
... | [
"function",
"CacheModule",
"(",
"settings",
",",
"cacheName",
",",
"serviceHandler",
",",
"serviceCallName",
")",
"{",
"if",
"(",
"serviceCallName",
"==",
"null",
")",
"{",
"serviceCallName",
"=",
"\"call\"",
";",
"}",
"settings",
".",
"init",
"(",
"\"cacheMod... | The class constructor.
@function constructor
@params {Object} settings A madlib-settings instance
@params {String} cacheName The name of the cache. Used to retrieve expiration settings and logging purposes
@params {Function} serviceHandler The 'service' instance providing the data for... | [
"The",
"class",
"constructor",
"."
] | 0d2d00d727abab421a5ae4fd91ca162ad3d0d126 | https://github.com/Qwerios/madlib-generic-cache/blob/0d2d00d727abab421a5ae4fd91ca162ad3d0d126/lib/index.js#L36-L53 |
55,906 | Industryswarm/isnode-mod-data | lib/mongodb/mongodb/lib/operations/db_ops.js | addUser | function addUser(db, username, password, options, callback) {
const Db = require('../db');
// Did the user destroy the topology
if (db.serverConfig && db.serverConfig.isDestroyed())
return callback(new MongoError('topology was destroyed'));
// Attempt to execute auth command
executeAuthCreateUserCommand(... | javascript | function addUser(db, username, password, options, callback) {
const Db = require('../db');
// Did the user destroy the topology
if (db.serverConfig && db.serverConfig.isDestroyed())
return callback(new MongoError('topology was destroyed'));
// Attempt to execute auth command
executeAuthCreateUserCommand(... | [
"function",
"addUser",
"(",
"db",
",",
"username",
",",
"password",
",",
"options",
",",
"callback",
")",
"{",
"const",
"Db",
"=",
"require",
"(",
"'../db'",
")",
";",
"// Did the user destroy the topology",
"if",
"(",
"db",
".",
"serverConfig",
"&&",
"db",
... | Add a user to the database.
@method
@param {Db} db The Db instance on which to add a user.
@param {string} username The username.
@param {string} password The password.
@param {object} [options] Optional settings. See Db.prototype.addUser for a list of options.
@param {Db~resultCallback} [callback] The command result c... | [
"Add",
"a",
"user",
"to",
"the",
"database",
"."
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb/lib/operations/db_ops.js#L66-L124 |
55,907 | ojj11/morphic | morphic.js | morphic | function morphic(options) {
var optionsIn = options || {};
var Matcher = optionsIn.matcherCore || defaultMatcher
var matcher = new Matcher(optionsIn);
var generateMatchers = optionsIn.generateMatchers || defaultGenerateMatchers;
var generateNamedFieldExtractors = optionsIn.generateNamedFieldExtractors || defa... | javascript | function morphic(options) {
var optionsIn = options || {};
var Matcher = optionsIn.matcherCore || defaultMatcher
var matcher = new Matcher(optionsIn);
var generateMatchers = optionsIn.generateMatchers || defaultGenerateMatchers;
var generateNamedFieldExtractors = optionsIn.generateNamedFieldExtractors || defa... | [
"function",
"morphic",
"(",
"options",
")",
"{",
"var",
"optionsIn",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"Matcher",
"=",
"optionsIn",
".",
"matcherCore",
"||",
"defaultMatcher",
"var",
"matcher",
"=",
"new",
"Matcher",
"(",
"optionsIn",
")",
";",
... | This class is essentially syntactic sugar around the core matcher found in matcher.js | [
"This",
"class",
"is",
"essentially",
"syntactic",
"sugar",
"around",
"the",
"core",
"matcher",
"found",
"in",
"matcher",
".",
"js"
] | 1ec6fd2f299e50866b9165c2545c430519f522ef | https://github.com/ojj11/morphic/blob/1ec6fd2f299e50866b9165c2545c430519f522ef/morphic.js#L43-L79 |
55,908 | gmalysa/flux-link | lib/flux-link.js | LoopChain | function LoopChain(cond, fns) {
if (fns instanceof Array)
Chain.apply(this, fns);
else
Chain.apply(this, slice.call(arguments, 1));
this.cond = this.wrap(cond);
this.name = '(anonymous loop chain)';
} | javascript | function LoopChain(cond, fns) {
if (fns instanceof Array)
Chain.apply(this, fns);
else
Chain.apply(this, slice.call(arguments, 1));
this.cond = this.wrap(cond);
this.name = '(anonymous loop chain)';
} | [
"function",
"LoopChain",
"(",
"cond",
",",
"fns",
")",
"{",
"if",
"(",
"fns",
"instanceof",
"Array",
")",
"Chain",
".",
"apply",
"(",
"this",
",",
"fns",
")",
";",
"else",
"Chain",
".",
"apply",
"(",
"this",
",",
"slice",
".",
"call",
"(",
"argumen... | A Loop Chain will iterate over its functions until the condition function specified returns
false, standardizing and simplifying the implementation for something that could already be
done with standard serial Chains.
@param cond Conditional function that is evaluated with an environment and an after
@param fns/varargs... | [
"A",
"Loop",
"Chain",
"will",
"iterate",
"over",
"its",
"functions",
"until",
"the",
"condition",
"function",
"specified",
"returns",
"false",
"standardizing",
"and",
"simplifying",
"the",
"implementation",
"for",
"something",
"that",
"could",
"already",
"be",
"do... | 567ac39a1f4a74f85465a58fb6fd96d64b1b765f | https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L344-L352 |
55,909 | gmalysa/flux-link | lib/flux-link.js | Branch | function Branch(cond, t, f) {
this.cond = this.wrap(cond);
this.if_true = this.wrap(t);
this.if_false = this.wrap(f);
this.name = '(Unnamed Branch)';
} | javascript | function Branch(cond, t, f) {
this.cond = this.wrap(cond);
this.if_true = this.wrap(t);
this.if_false = this.wrap(f);
this.name = '(Unnamed Branch)';
} | [
"function",
"Branch",
"(",
"cond",
",",
"t",
",",
"f",
")",
"{",
"this",
".",
"cond",
"=",
"this",
".",
"wrap",
"(",
"cond",
")",
";",
"this",
".",
"if_true",
"=",
"this",
".",
"wrap",
"(",
"t",
")",
";",
"this",
".",
"if_false",
"=",
"this",
... | A branch is used to simplify multipath management when constructing Chains.
It works just like a normal Chain, except that it calls the asynchronous
decision function and uses it to select between the A and B alternatives,
which are most useful when given as Chains.
@param cond Condition function to use as the branch d... | [
"A",
"branch",
"is",
"used",
"to",
"simplify",
"multipath",
"management",
"when",
"constructing",
"Chains",
".",
"It",
"works",
"just",
"like",
"a",
"normal",
"Chain",
"except",
"that",
"it",
"calls",
"the",
"asynchronous",
"decision",
"function",
"and",
"uses... | 567ac39a1f4a74f85465a58fb6fd96d64b1b765f | https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L526-L531 |
55,910 | gmalysa/flux-link | lib/flux-link.js | __chain_inner | function __chain_inner(result) {
var args = slice.call(arguments, 1);
nextTick(function() {
try {
if (result) {
var params = that.handle_args(env, that.if_true, args);
params.unshift(env, after);
env._fm.$push_call(helpers.fname(that.if_true, that.if_true.fn.name));
that.if_true.fn.apply(... | javascript | function __chain_inner(result) {
var args = slice.call(arguments, 1);
nextTick(function() {
try {
if (result) {
var params = that.handle_args(env, that.if_true, args);
params.unshift(env, after);
env._fm.$push_call(helpers.fname(that.if_true, that.if_true.fn.name));
that.if_true.fn.apply(... | [
"function",
"__chain_inner",
"(",
"result",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"nextTick",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"result",
")",
"{",
"var",
"params",
"=",
"that... | This closure handles the response from the condition function | [
"This",
"closure",
"handles",
"the",
"response",
"from",
"the",
"condition",
"function"
] | 567ac39a1f4a74f85465a58fb6fd96d64b1b765f | https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L584-L605 |
55,911 | hal313/html-amend | src/html-amend.js | replaceWith | function replaceWith(input, regex, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', 'replaceWith');
verifyParameterIsDefined(regex, 'regex', 'replaceWith');
return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(... | javascript | function replaceWith(input, regex, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', 'replaceWith');
verifyParameterIsDefined(regex, 'regex', 'replaceWith');
return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(... | [
"function",
"replaceWith",
"(",
"input",
",",
"regex",
",",
"content",
")",
"{",
"// Sanity check",
"verifyParameterIsDefined",
"(",
"input",
",",
"'input'",
",",
"'replaceWith'",
")",
";",
"verifyParameterIsDefined",
"(",
"regex",
",",
"'regex'",
",",
"'replaceWi... | Replaces content specified by a regular expression with specified content.
@param {String|Function} input the input to replace
@param {String|RegExp|Function} regEx the regular expression (or string) to replace within the input
@param {String|Function} [content] the content to replace
@return {String} a String which h... | [
"Replaces",
"content",
"specified",
"by",
"a",
"regular",
"expression",
"with",
"specified",
"content",
"."
] | a96d1c347a3842cfa5d08870bc383d7925b8a894 | https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L134-L140 |
55,912 | hal313/html-amend | src/html-amend.js | afterElementOpen | function afterElementOpen(input, element, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', 'afterElementOpen');
verifyParameterIsDefined(element, 'element', 'afterElementOpen');
return insertAfter(normalizeValue(input), normalizeRegExp(`<${normalizeVal... | javascript | function afterElementOpen(input, element, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', 'afterElementOpen');
verifyParameterIsDefined(element, 'element', 'afterElementOpen');
return insertAfter(normalizeValue(input), normalizeRegExp(`<${normalizeVal... | [
"function",
"afterElementOpen",
"(",
"input",
",",
"element",
",",
"content",
")",
"{",
"// Sanity check",
"verifyParameterIsDefined",
"(",
"input",
",",
"'input'",
",",
"'afterElementOpen'",
")",
";",
"verifyParameterIsDefined",
"(",
"element",
",",
"'element'",
",... | Inserts content into the input string after the first occurrence of the element has been opened.
@param {String|Function} input the input to replace
@param {String|Function} element the element to insert after
@param {String|Function} [content] the content to insert within the input string
@return {String} a String wh... | [
"Inserts",
"content",
"into",
"the",
"input",
"string",
"after",
"the",
"first",
"occurrence",
"of",
"the",
"element",
"has",
"been",
"opened",
"."
] | a96d1c347a3842cfa5d08870bc383d7925b8a894 | https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L150-L156 |
55,913 | hal313/html-amend | src/html-amend.js | beforeElementClose | function beforeElementClose(input, element, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', beforeElementClose.name);
verifyParameterIsDefined(element, 'element', beforeElementClose.name);
return insertBefore(normalizeValue(input), normalizeRegExp(`<\... | javascript | function beforeElementClose(input, element, content) {
// Sanity check
verifyParameterIsDefined(input, 'input', beforeElementClose.name);
verifyParameterIsDefined(element, 'element', beforeElementClose.name);
return insertBefore(normalizeValue(input), normalizeRegExp(`<\... | [
"function",
"beforeElementClose",
"(",
"input",
",",
"element",
",",
"content",
")",
"{",
"// Sanity check",
"verifyParameterIsDefined",
"(",
"input",
",",
"'input'",
",",
"beforeElementClose",
".",
"name",
")",
";",
"verifyParameterIsDefined",
"(",
"element",
",",
... | Inserts content into the input string before the first occurrence of the element close tag.
@param {String|Function} input the input to replace
@param {String|Function} element the element to insert before close
@param {String|Function} content the content to replace within the input string
@return {String} a String w... | [
"Inserts",
"content",
"into",
"the",
"input",
"string",
"before",
"the",
"first",
"occurrence",
"of",
"the",
"element",
"close",
"tag",
"."
] | a96d1c347a3842cfa5d08870bc383d7925b8a894 | https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L166-L172 |
55,914 | hal313/html-amend | src/html-amend.js | insertComment | function insertComment(input, element, comment) {
// Sanity check
verifyParameterIsDefined(input, 'input', insertComment.name);
verifyParameterIsDefined(element, 'element', insertComment.name);
return insertAfter(normalizeValue(input), normalizeRegExp(`<\/${normalizeValu... | javascript | function insertComment(input, element, comment) {
// Sanity check
verifyParameterIsDefined(input, 'input', insertComment.name);
verifyParameterIsDefined(element, 'element', insertComment.name);
return insertAfter(normalizeValue(input), normalizeRegExp(`<\/${normalizeValu... | [
"function",
"insertComment",
"(",
"input",
",",
"element",
",",
"comment",
")",
"{",
"// Sanity check",
"verifyParameterIsDefined",
"(",
"input",
",",
"'input'",
",",
"insertComment",
".",
"name",
")",
";",
"verifyParameterIsDefined",
"(",
"element",
",",
"'elemen... | Inserts an HTML comment into the input string after the first occurrence of the element close tag.
@param {String|Function} input the input to replace
@param {String|Function} element the element to add the comment after
@param {String|Function} [content] the comment to add.
@return {String} a String which has the com... | [
"Inserts",
"an",
"HTML",
"comment",
"into",
"the",
"input",
"string",
"after",
"the",
"first",
"occurrence",
"of",
"the",
"element",
"close",
"tag",
"."
] | a96d1c347a3842cfa5d08870bc383d7925b8a894 | https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L182-L188 |
55,915 | hal313/html-amend | src/html-amend.js | insertAttribute | function insertAttribute(input, element, attributeName, attributeValue) {
// Sanity check
verifyParameterIsDefined(input, 'input', insertAttribute.name);
verifyParameterIsDefined(element, 'element', insertAttribute.name);
verifyParameterIsDefined(attributeName, 'attribute... | javascript | function insertAttribute(input, element, attributeName, attributeValue) {
// Sanity check
verifyParameterIsDefined(input, 'input', insertAttribute.name);
verifyParameterIsDefined(element, 'element', insertAttribute.name);
verifyParameterIsDefined(attributeName, 'attribute... | [
"function",
"insertAttribute",
"(",
"input",
",",
"element",
",",
"attributeName",
",",
"attributeValue",
")",
"{",
"// Sanity check",
"verifyParameterIsDefined",
"(",
"input",
",",
"'input'",
",",
"insertAttribute",
".",
"name",
")",
";",
"verifyParameterIsDefined",
... | Inserts an attribute into the input string within the first occurrence of the element open tag.
@param {String|Function} input the input string
@param {String|Function} element the element tag to modify
@param {String|Function} attributeName the attribute name to add
@param {String|Function} [attributeValue] the attri... | [
"Inserts",
"an",
"attribute",
"into",
"the",
"input",
"string",
"within",
"the",
"first",
"occurrence",
"of",
"the",
"element",
"open",
"tag",
"."
] | a96d1c347a3842cfa5d08870bc383d7925b8a894 | https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L199-L206 |
55,916 | shinout/Struct.js | lib/Struct.js | function(keyname) {
const _ = Struct.PriProp(keyname);
if (_.__proto__) {
_.__proto__ = Struct.prototype;
}
else {
Object.keys(Struct.prototype).forEach(function(p) {
Object.defineProperty(_, p, {
value : Struct.prototype[p],
writable : false
});
}, this);
}
var cl... | javascript | function(keyname) {
const _ = Struct.PriProp(keyname);
if (_.__proto__) {
_.__proto__ = Struct.prototype;
}
else {
Object.keys(Struct.prototype).forEach(function(p) {
Object.defineProperty(_, p, {
value : Struct.prototype[p],
writable : false
});
}, this);
}
var cl... | [
"function",
"(",
"keyname",
")",
"{",
"const",
"_",
"=",
"Struct",
".",
"PriProp",
"(",
"keyname",
")",
";",
"if",
"(",
"_",
".",
"__proto__",
")",
"{",
"_",
".",
"__proto__",
"=",
"Struct",
".",
"prototype",
";",
"}",
"else",
"{",
"Object",
".",
... | Struct.js v0.0.1
Copyright 2011, SHIN Suzuki | [
"Struct",
".",
"js",
"v0",
".",
"0",
".",
"1"
] | 55aff5edcb956d85dcb0b55c8fdfe423aa34f53c | https://github.com/shinout/Struct.js/blob/55aff5edcb956d85dcb0b55c8fdfe423aa34f53c/lib/Struct.js#L8-L73 | |
55,917 | ianmuninio/jmodel | lib/model.js | Model | function Model(collectionName, attributes, values) {
this.collectionName = collectionName;
this.idAttribute = Model.getId(attributes);
this.attributes = attributeValidator.validate(attributes);
this.values = { };
this.virtuals = { };
// initially add the null value from all attributes
for (... | javascript | function Model(collectionName, attributes, values) {
this.collectionName = collectionName;
this.idAttribute = Model.getId(attributes);
this.attributes = attributeValidator.validate(attributes);
this.values = { };
this.virtuals = { };
// initially add the null value from all attributes
for (... | [
"function",
"Model",
"(",
"collectionName",
",",
"attributes",
",",
"values",
")",
"{",
"this",
".",
"collectionName",
"=",
"collectionName",
";",
"this",
".",
"idAttribute",
"=",
"Model",
".",
"getId",
"(",
"attributes",
")",
";",
"this",
".",
"attributes",... | An entity is a lightweight persistence domain object.
@param {String} collectionName
@param {Object} attributes
@param {Object} values
@returns {Model} | [
"An",
"entity",
"is",
"a",
"lightweight",
"persistence",
"domain",
"object",
"."
] | c118bfc46596f59445604acc43b01ad2b04c31ef | https://github.com/ianmuninio/jmodel/blob/c118bfc46596f59445604acc43b01ad2b04c31ef/lib/model.js#L17-L37 |
55,918 | queckezz/list | lib/drop.js | drop | function drop (n, array) {
return (n < array.length)
? slice(n, array.length, array)
: []
} | javascript | function drop (n, array) {
return (n < array.length)
? slice(n, array.length, array)
: []
} | [
"function",
"drop",
"(",
"n",
",",
"array",
")",
"{",
"return",
"(",
"n",
"<",
"array",
".",
"length",
")",
"?",
"slice",
"(",
"n",
",",
"array",
".",
"length",
",",
"array",
")",
":",
"[",
"]",
"}"
] | Slice `n` items from `array` returning the sliced
elements as a new array.
@param {Int} n How many elements to drop
@param {Array} array Array to drop from
@return {Array} New Array with the dropped items | [
"Slice",
"n",
"items",
"from",
"array",
"returning",
"the",
"sliced",
"elements",
"as",
"a",
"new",
"array",
"."
] | a26130020b447a1aa136f0fed3283821490f7da4 | https://github.com/queckezz/list/blob/a26130020b447a1aa136f0fed3283821490f7da4/lib/drop.js#L13-L17 |
55,919 | Pocketbrain/native-ads-web-ad-library | src/ads/fetchAds.js | _getRequiredAdCountForAdUnit | function _getRequiredAdCountForAdUnit(adUnit) {
var adContainers = page.getAdContainers(adUnit);
if (!adContainers.length) {
return 0;
}
var numberOfAdsToInsert = 0;
for (var i = 0; i < adContainers.length; i++) {
var adContainer = adContainers[i];
numberOfAdsToInsert += ad... | javascript | function _getRequiredAdCountForAdUnit(adUnit) {
var adContainers = page.getAdContainers(adUnit);
if (!adContainers.length) {
return 0;
}
var numberOfAdsToInsert = 0;
for (var i = 0; i < adContainers.length; i++) {
var adContainer = adContainers[i];
numberOfAdsToInsert += ad... | [
"function",
"_getRequiredAdCountForAdUnit",
"(",
"adUnit",
")",
"{",
"var",
"adContainers",
"=",
"page",
".",
"getAdContainers",
"(",
"adUnit",
")",
";",
"if",
"(",
"!",
"adContainers",
".",
"length",
")",
"{",
"return",
"0",
";",
"}",
"var",
"numberOfAdsToI... | Get the number of ads this unit needs to place all the ads on the page
@param adUnit The ad unit to get the required number of ads for
@returns {number} the number of required ads
@private | [
"Get",
"the",
"number",
"of",
"ads",
"this",
"unit",
"needs",
"to",
"place",
"all",
"the",
"ads",
"on",
"the",
"page"
] | aafee1c42e0569ee77f334fc2c4eb71eb146957e | https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L17-L31 |
55,920 | Pocketbrain/native-ads-web-ad-library | src/ads/fetchAds.js | _buildImageFields | function _buildImageFields(data){
var newUnits = [];
for (var i = 0, len = data.length; i < len; i++){
adUnit = data[i];
// todo: create adUnit object to encapsulate this logic
if ('images' in adUnit){
if ('banner' in adUnit.images){
adUnit.campaign_banner_url = adUnit.images.banner.ur... | javascript | function _buildImageFields(data){
var newUnits = [];
for (var i = 0, len = data.length; i < len; i++){
adUnit = data[i];
// todo: create adUnit object to encapsulate this logic
if ('images' in adUnit){
if ('banner' in adUnit.images){
adUnit.campaign_banner_url = adUnit.images.banner.ur... | [
"function",
"_buildImageFields",
"(",
"data",
")",
"{",
"var",
"newUnits",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"data",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"adUnit",
"=",
"data",
"[",... | Fills some image fields with JSON data
@param data The data coming from the server
@returns processed data
@private | [
"Fills",
"some",
"image",
"fields",
"with",
"JSON",
"data"
] | aafee1c42e0569ee77f334fc2c4eb71eb146957e | https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L39-L63 |
55,921 | Pocketbrain/native-ads-web-ad-library | src/ads/fetchAds.js | requestAds | function requestAds(adUnit, callback) {
var limit = _getRequiredAdCountForAdUnit(adUnit);
var token = page.getToken();
var imageType = adUnit.imageType;
if (typeof imageType == 'undefined'){
imageType = "hq_icon";
}
var requestQuery = {
"output": "json",
"placement_key": ad... | javascript | function requestAds(adUnit, callback) {
var limit = _getRequiredAdCountForAdUnit(adUnit);
var token = page.getToken();
var imageType = adUnit.imageType;
if (typeof imageType == 'undefined'){
imageType = "hq_icon";
}
var requestQuery = {
"output": "json",
"placement_key": ad... | [
"function",
"requestAds",
"(",
"adUnit",
",",
"callback",
")",
"{",
"var",
"limit",
"=",
"_getRequiredAdCountForAdUnit",
"(",
"adUnit",
")",
";",
"var",
"token",
"=",
"page",
".",
"getToken",
"(",
")",
";",
"var",
"imageType",
"=",
"adUnit",
".",
"imageTyp... | Request ads from the offerEngine
@param adUnit - The ad Unit that is requesting ads
@param callback - The callback to execute containing the ads | [
"Request",
"ads",
"from",
"the",
"offerEngine"
] | aafee1c42e0569ee77f334fc2c4eb71eb146957e | https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L70-L109 |
55,922 | FinalDevStudio/fi-security | lib/index.js | clean | function clean(method) {
for (let m of methods) {
if (new RegExp(m, 'i').test(method)) {
return m;
}
}
throw new Error(`Invalid method name: ${method}`);
} | javascript | function clean(method) {
for (let m of methods) {
if (new RegExp(m, 'i').test(method)) {
return m;
}
}
throw new Error(`Invalid method name: ${method}`);
} | [
"function",
"clean",
"(",
"method",
")",
"{",
"for",
"(",
"let",
"m",
"of",
"methods",
")",
"{",
"if",
"(",
"new",
"RegExp",
"(",
"m",
",",
"'i'",
")",
".",
"test",
"(",
"method",
")",
")",
"{",
"return",
"m",
";",
"}",
"}",
"throw",
"new",
"... | Returns a clean, lower-case method name.
@param {String} method The method to check and clean.
@returns {String} The clean method name. | [
"Returns",
"a",
"clean",
"lower",
"-",
"case",
"method",
"name",
"."
] | 4673865a2e618138012bc89b1ba7160eb632ab5a | https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L41-L49 |
55,923 | FinalDevStudio/fi-security | lib/index.js | middleware | function middleware(req, res, next) {
req.security.csrf.exclude = true;
next();
} | javascript | function middleware(req, res, next) {
req.security.csrf.exclude = true;
next();
} | [
"function",
"middleware",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"req",
".",
"security",
".",
"csrf",
".",
"exclude",
"=",
"true",
";",
"next",
"(",
")",
";",
"}"
] | Default exclusion middleware.
@type {ExpressMiddlware}
@param {Object} req Express' request object.
@param {Object} res Express' response object.
@param {Function} next Express' next middleware callback. | [
"Default",
"exclusion",
"middleware",
"."
] | 4673865a2e618138012bc89b1ba7160eb632ab5a | https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L60-L63 |
55,924 | FinalDevStudio/fi-security | lib/index.js | onEachExcludedRoute | function onEachExcludedRoute(app, route) {
const normalized = normalize(route);
debug(`Excluding ${(normalized.method || 'all').toUpperCase()} ${normalized.path} from CSRF check...`);
const router = app.route(normalized.path);
if (is.array(normalized.method) && normalized.method.length) {
for (let i = 0,... | javascript | function onEachExcludedRoute(app, route) {
const normalized = normalize(route);
debug(`Excluding ${(normalized.method || 'all').toUpperCase()} ${normalized.path} from CSRF check...`);
const router = app.route(normalized.path);
if (is.array(normalized.method) && normalized.method.length) {
for (let i = 0,... | [
"function",
"onEachExcludedRoute",
"(",
"app",
",",
"route",
")",
"{",
"const",
"normalized",
"=",
"normalize",
"(",
"route",
")",
";",
"debug",
"(",
"`",
"${",
"(",
"normalized",
".",
"method",
"||",
"'all'",
")",
".",
"toUpperCase",
"(",
")",
"}",
"$... | Processes each excluded route.
@param {ExpressApplication} app Your express application instance.
@param {Object} route The route object to process. | [
"Processes",
"each",
"excluded",
"route",
"."
] | 4673865a2e618138012bc89b1ba7160eb632ab5a | https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L110-L130 |
55,925 | MaiaVictor/dattata | Geometries.js | block | function block(w, h, d){
return function(cons, nil){
for (var z=-d; z<=d; ++z)
for (var y=-h; y<=h; ++y)
for (var x=-w; x<=w; ++x)
nil = cons(x, y, z),
nil = cons(x, y, z);
return nil;
};
} | javascript | function block(w, h, d){
return function(cons, nil){
for (var z=-d; z<=d; ++z)
for (var y=-h; y<=h; ++y)
for (var x=-w; x<=w; ++x)
nil = cons(x, y, z),
nil = cons(x, y, z);
return nil;
};
} | [
"function",
"block",
"(",
"w",
",",
"h",
",",
"d",
")",
"{",
"return",
"function",
"(",
"cons",
",",
"nil",
")",
"{",
"for",
"(",
"var",
"z",
"=",
"-",
"d",
";",
"z",
"<=",
"d",
";",
"++",
"z",
")",
"for",
"(",
"var",
"y",
"=",
"-",
"h",
... | Number, Number, Number -> AtomsCList | [
"Number",
"Number",
"Number",
"-",
">",
"AtomsCList"
] | 890d83b89b7193ce8863bb9ac9b296b3510e8db9 | https://github.com/MaiaVictor/dattata/blob/890d83b89b7193ce8863bb9ac9b296b3510e8db9/Geometries.js#L53-L62 |
55,926 | MaiaVictor/dattata | Geometries.js | sphereVoxels | function sphereVoxels(cx, cy, cz, r, col){
return function(cons, nil){
sphere(cx, cy, cz, r)(function(x, y, z, res){
return cons(x, y, z, col, res);
}, nil);
};
} | javascript | function sphereVoxels(cx, cy, cz, r, col){
return function(cons, nil){
sphere(cx, cy, cz, r)(function(x, y, z, res){
return cons(x, y, z, col, res);
}, nil);
};
} | [
"function",
"sphereVoxels",
"(",
"cx",
",",
"cy",
",",
"cz",
",",
"r",
",",
"col",
")",
"{",
"return",
"function",
"(",
"cons",
",",
"nil",
")",
"{",
"sphere",
"(",
"cx",
",",
"cy",
",",
"cz",
",",
"r",
")",
"(",
"function",
"(",
"x",
",",
"y... | Number, Number, Number, Number, RGBA8 -> Voxels | [
"Number",
"Number",
"Number",
"Number",
"RGBA8",
"-",
">",
"Voxels"
] | 890d83b89b7193ce8863bb9ac9b296b3510e8db9 | https://github.com/MaiaVictor/dattata/blob/890d83b89b7193ce8863bb9ac9b296b3510e8db9/Geometries.js#L66-L72 |
55,927 | wigy/chronicles_of_grunt | tasks/info.js | dumpFiles | function dumpFiles(title, fn) {
var matches = fn();
if (matches.length) {
log.info("");
log.info((title + ":")['green']);
for (var i = 0; i < matches.length; i++) {
if (matches[i].src === matches[i].dst) {
... | javascript | function dumpFiles(title, fn) {
var matches = fn();
if (matches.length) {
log.info("");
log.info((title + ":")['green']);
for (var i = 0; i < matches.length; i++) {
if (matches[i].src === matches[i].dst) {
... | [
"function",
"dumpFiles",
"(",
"title",
",",
"fn",
")",
"{",
"var",
"matches",
"=",
"fn",
"(",
")",
";",
"if",
"(",
"matches",
".",
"length",
")",
"{",
"log",
".",
"info",
"(",
"\"\"",
")",
";",
"log",
".",
"info",
"(",
"(",
"title",
"+",
"\":\"... | List files returned by the given listing function on screen. | [
"List",
"files",
"returned",
"by",
"the",
"given",
"listing",
"function",
"on",
"screen",
"."
] | c5f089a6f391a0ca625fcb81ef51907713471bb3 | https://github.com/wigy/chronicles_of_grunt/blob/c5f089a6f391a0ca625fcb81ef51907713471bb3/tasks/info.js#L33-L46 |
55,928 | sydneystockholm/blog.md | lib/loaders/fs.js | FileSystemLoader | function FileSystemLoader(dir, options) {
this.dir = dir.replace(/\/$/, '');
this.options = options || (options = {});
this.posts = [];
this.files = {};
this.ignore = {};
var self = this;
(options.ignore || FileSystemLoader.ignore).forEach(function (file) {
self.ignore[file] = true;
... | javascript | function FileSystemLoader(dir, options) {
this.dir = dir.replace(/\/$/, '');
this.options = options || (options = {});
this.posts = [];
this.files = {};
this.ignore = {};
var self = this;
(options.ignore || FileSystemLoader.ignore).forEach(function (file) {
self.ignore[file] = true;
... | [
"function",
"FileSystemLoader",
"(",
"dir",
",",
"options",
")",
"{",
"this",
".",
"dir",
"=",
"dir",
".",
"replace",
"(",
"/",
"\\/$",
"/",
",",
"''",
")",
";",
"this",
".",
"options",
"=",
"options",
"||",
"(",
"options",
"=",
"{",
"}",
")",
";... | Create a new file system loader.
@param {String} dir - the folder containing blog posts
@param {Object} options (optional) | [
"Create",
"a",
"new",
"file",
"system",
"loader",
"."
] | 0b145fa1620cbe8b7296eb242241ee93223db9f9 | https://github.com/sydneystockholm/blog.md/blob/0b145fa1620cbe8b7296eb242241ee93223db9f9/lib/loaders/fs.js#L22-L35 |
55,929 | cameronwp/endpoint | lib/Endpoint.js | Endpoint | function Endpoint() {
var self = this;
const subscriptions = {};
const ps = new Pubsub();
this._publish = ps.publish;
this._subscribe = ps.subscribe;
this.active = false;
this.connections = [];
/**
* Publishes a new connection.
* @function _newConnection
* @private
* @param {string} sID soc... | javascript | function Endpoint() {
var self = this;
const subscriptions = {};
const ps = new Pubsub();
this._publish = ps.publish;
this._subscribe = ps.subscribe;
this.active = false;
this.connections = [];
/**
* Publishes a new connection.
* @function _newConnection
* @private
* @param {string} sID soc... | [
"function",
"Endpoint",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"const",
"subscriptions",
"=",
"{",
"}",
";",
"const",
"ps",
"=",
"new",
"Pubsub",
"(",
")",
";",
"this",
".",
"_publish",
"=",
"ps",
".",
"publish",
";",
"this",
".",
"_subscr... | Message response callback.
@callback messageResponse
@param {any} response
Base class for handling socket.io connections.
@class Endpoint | [
"Message",
"response",
"callback",
"."
] | 6163756360080aa7e984660f1cede7e4ab627da5 | https://github.com/cameronwp/endpoint/blob/6163756360080aa7e984660f1cede7e4ab627da5/lib/Endpoint.js#L27-L96 |
55,930 | christophercrouzet/pillr | lib/queue.js | find | function find(queue, name) {
const out = queue.findIndex(e => e.name === name);
if (out === -1) {
throw new Error(`${name}: Could not find this function`);
}
return out;
} | javascript | function find(queue, name) {
const out = queue.findIndex(e => e.name === name);
if (out === -1) {
throw new Error(`${name}: Could not find this function`);
}
return out;
} | [
"function",
"find",
"(",
"queue",
",",
"name",
")",
"{",
"const",
"out",
"=",
"queue",
".",
"findIndex",
"(",
"e",
"=>",
"e",
".",
"name",
"===",
"name",
")",
";",
"if",
"(",
"out",
"===",
"-",
"1",
")",
"{",
"throw",
"new",
"Error",
"(",
"`",
... | Find the index of a function. | [
"Find",
"the",
"index",
"of",
"a",
"function",
"."
] | 411ccd344a03478776c4e8d2e2f9bdc45dc8ee45 | https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/queue.js#L13-L20 |
55,931 | christophercrouzet/pillr | lib/queue.js | insert | function insert(queue, index, fns, mode = InsertMode.REGULAR) {
fns.forEach(({ fn, name }) => {
if (queue.findIndex(e => e.name === name) !== -1) {
throw new Error(`${name}: A function is already queued with this name`);
} else if (typeof fn !== 'function') {
throw new Error(`${name}: Not a valid ... | javascript | function insert(queue, index, fns, mode = InsertMode.REGULAR) {
fns.forEach(({ fn, name }) => {
if (queue.findIndex(e => e.name === name) !== -1) {
throw new Error(`${name}: A function is already queued with this name`);
} else if (typeof fn !== 'function') {
throw new Error(`${name}: Not a valid ... | [
"function",
"insert",
"(",
"queue",
",",
"index",
",",
"fns",
",",
"mode",
"=",
"InsertMode",
".",
"REGULAR",
")",
"{",
"fns",
".",
"forEach",
"(",
"(",
"{",
"fn",
",",
"name",
"}",
")",
"=>",
"{",
"if",
"(",
"queue",
".",
"findIndex",
"(",
"e",
... | Insert a bunch of functions into a queue at a given index. | [
"Insert",
"a",
"bunch",
"of",
"functions",
"into",
"a",
"queue",
"at",
"a",
"given",
"index",
"."
] | 411ccd344a03478776c4e8d2e2f9bdc45dc8ee45 | https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/queue.js#L24-L35 |
55,932 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | addElement | function addElement( element, target, moveCurrent ) {
target = target || currentNode || root;
// Current element might be mangled by fix body below,
// save it for restore later.
var savedCurrent = currentNode;
// Ignore any element that has already been added.
if ( element.previous === undefined ) ... | javascript | function addElement( element, target, moveCurrent ) {
target = target || currentNode || root;
// Current element might be mangled by fix body below,
// save it for restore later.
var savedCurrent = currentNode;
// Ignore any element that has already been added.
if ( element.previous === undefined ) ... | [
"function",
"addElement",
"(",
"element",
",",
"target",
",",
"moveCurrent",
")",
"{",
"target",
"=",
"target",
"||",
"currentNode",
"||",
"root",
";",
"// Current element might be mangled by fix body below,",
"// save it for restore later.",
"var",
"savedCurrent",
"=",
... | Beside of simply append specified element to target, this function also takes care of other dirty lifts like forcing block in body, trimming spaces at the block boundaries etc. @param {Element} element The element to be added as the last child of {@link target}. @param {Element} target The parent element to relieve t... | [
"Beside",
"of",
"simply",
"append",
"specified",
"element",
"to",
"target",
"this",
"function",
"also",
"takes",
"care",
"of",
"other",
"dirty",
"lifts",
"like",
"forcing",
"block",
"in",
"body",
"trimming",
"spaces",
"at",
"the",
"block",
"boundaries",
"etc",... | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L171-L208 |
55,933 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | checkAutoParagraphing | function checkAutoParagraphing( parent, node ) {
// Check for parent that can contain block.
if ( ( parent == root || parent.name == 'body' ) && fixingBlock &&
( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) {
var name, realName;
if ( node.attributes && ( realName = node.attributes... | javascript | function checkAutoParagraphing( parent, node ) {
// Check for parent that can contain block.
if ( ( parent == root || parent.name == 'body' ) && fixingBlock &&
( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) {
var name, realName;
if ( node.attributes && ( realName = node.attributes... | [
"function",
"checkAutoParagraphing",
"(",
"parent",
",",
"node",
")",
"{",
"// Check for parent that can contain block.",
"if",
"(",
"(",
"parent",
"==",
"root",
"||",
"parent",
".",
"name",
"==",
"'body'",
")",
"&&",
"fixingBlock",
"&&",
"(",
"!",
"parent",
"... | Auto paragraphing should happen when inline content enters the root element. | [
"Auto",
"paragraphing",
"should",
"happen",
"when",
"inline",
"content",
"enters",
"the",
"root",
"element",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L211-L229 |
55,934 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | possiblySibling | function possiblySibling( tag1, tag2 ) {
if ( tag1 in CKEDITOR.dtd.$listItem || tag1 in CKEDITOR.dtd.$tableContent )
return tag1 == tag2 || tag1 == 'dt' && tag2 == 'dd' || tag1 == 'dd' && tag2 == 'dt';
return false;
} | javascript | function possiblySibling( tag1, tag2 ) {
if ( tag1 in CKEDITOR.dtd.$listItem || tag1 in CKEDITOR.dtd.$tableContent )
return tag1 == tag2 || tag1 == 'dt' && tag2 == 'dd' || tag1 == 'dd' && tag2 == 'dt';
return false;
} | [
"function",
"possiblySibling",
"(",
"tag1",
",",
"tag2",
")",
"{",
"if",
"(",
"tag1",
"in",
"CKEDITOR",
".",
"dtd",
".",
"$listItem",
"||",
"tag1",
"in",
"CKEDITOR",
".",
"dtd",
".",
"$tableContent",
")",
"return",
"tag1",
"==",
"tag2",
"||",
"tag1",
"... | Judge whether two element tag names are likely the siblings from the same structural element. | [
"Judge",
"whether",
"two",
"element",
"tag",
"names",
"are",
"likely",
"the",
"siblings",
"from",
"the",
"same",
"structural",
"element",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L233-L239 |
55,935 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | function( filter, context ) {
context = this.getFilterContext( context );
// Apply the root filter.
filter.onRoot( context, this );
this.filterChildren( filter, false, context );
} | javascript | function( filter, context ) {
context = this.getFilterContext( context );
// Apply the root filter.
filter.onRoot( context, this );
this.filterChildren( filter, false, context );
} | [
"function",
"(",
"filter",
",",
"context",
")",
"{",
"context",
"=",
"this",
".",
"getFilterContext",
"(",
"context",
")",
";",
"// Apply the root filter.",
"filter",
".",
"onRoot",
"(",
"context",
",",
"this",
")",
";",
"this",
".",
"filterChildren",
"(",
... | Filter this fragment's content with given filter.
@since 4.1
@param {CKEDITOR.htmlParser.filter} filter | [
"Filter",
"this",
"fragment",
"s",
"content",
"with",
"given",
"filter",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L513-L520 | |
55,936 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | function( filter, filterRoot, context ) {
// If this element's children were already filtered
// by current filter, don't filter them 2nd time.
// This situation may occur when filtering bottom-up
// (filterChildren() called manually in element's filter),
// or in unpredictable edge cases when filter
... | javascript | function( filter, filterRoot, context ) {
// If this element's children were already filtered
// by current filter, don't filter them 2nd time.
// This situation may occur when filtering bottom-up
// (filterChildren() called manually in element's filter),
// or in unpredictable edge cases when filter
... | [
"function",
"(",
"filter",
",",
"filterRoot",
",",
"context",
")",
"{",
"// If this element's children were already filtered",
"// by current filter, don't filter them 2nd time.",
"// This situation may occur when filtering bottom-up",
"// (filterChildren() called manually in element's filte... | Filter this fragment's children with given filter.
Element's children may only be filtered once by one
instance of filter.
@since 4.1
@param {CKEDITOR.htmlParser.filter} filter
@param {Boolean} [filterRoot] Whether to apply the "root" filter rule specified in the `filter`. | [
"Filter",
"this",
"fragment",
"s",
"children",
"with",
"given",
"filter",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L532-L557 | |
55,937 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/htmlparser/fragment.js | function( writer, filter, filterRoot ) {
var context = this.getFilterContext();
// Filtering root if enforced.
if ( filterRoot && !this.parent && filter )
filter.onRoot( context, this );
if ( filter )
this.filterChildren( filter, false, context );
for ( var i = 0, children = this.children, l =... | javascript | function( writer, filter, filterRoot ) {
var context = this.getFilterContext();
// Filtering root if enforced.
if ( filterRoot && !this.parent && filter )
filter.onRoot( context, this );
if ( filter )
this.filterChildren( filter, false, context );
for ( var i = 0, children = this.children, l =... | [
"function",
"(",
"writer",
",",
"filter",
",",
"filterRoot",
")",
"{",
"var",
"context",
"=",
"this",
".",
"getFilterContext",
"(",
")",
";",
"// Filtering root if enforced.",
"if",
"(",
"filterRoot",
"&&",
"!",
"this",
".",
"parent",
"&&",
"filter",
")",
... | Write and filtering the child nodes of this fragment.
@param {CKEDITOR.htmlParser.basicWriter} writer The writer to which write the HTML.
@param {CKEDITOR.htmlParser.filter} [filter] The filter to use when writing the HTML.
@param {Boolean} [filterRoot] Whether to apply the "root" filter rule specified in the `filter`... | [
"Write",
"and",
"filtering",
"the",
"child",
"nodes",
"of",
"this",
"fragment",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L584-L596 | |
55,938 | yoshuawuyts/myth-request | index.js | mr | function mr(bundler) {
var prevError = null
var pending = null
var buffer = null
build()
// bundler.on('update', update)
return handler
/**
* Build the CSS and pass it to `buffer`.
*
* @api private
*/
function build() {
const p = pending = new Emitter()
buffer = bundler.toString()
... | javascript | function mr(bundler) {
var prevError = null
var pending = null
var buffer = null
build()
// bundler.on('update', update)
return handler
/**
* Build the CSS and pass it to `buffer`.
*
* @api private
*/
function build() {
const p = pending = new Emitter()
buffer = bundler.toString()
... | [
"function",
"mr",
"(",
"bundler",
")",
"{",
"var",
"prevError",
"=",
"null",
"var",
"pending",
"=",
"null",
"var",
"buffer",
"=",
"null",
"build",
"(",
")",
"// bundler.on('update', update)",
"return",
"handler",
"/**\n * Build the CSS and pass it to `buffer`.\n *... | Respond myth in an http request.
@param {Function} bundler
@return {Function}
@api public | [
"Respond",
"myth",
"in",
"an",
"http",
"request",
"."
] | 0c70a49e2b8abbfcd6fd0a3735a18064d952992b | https://github.com/yoshuawuyts/myth-request/blob/0c70a49e2b8abbfcd6fd0a3735a18064d952992b/index.js#L12-L61 |
55,939 | yoshuawuyts/myth-request | index.js | build | function build() {
const p = pending = new Emitter()
buffer = bundler.toString()
if (p !== pending) return
pending.emit('ready', null, pending = false)
} | javascript | function build() {
const p = pending = new Emitter()
buffer = bundler.toString()
if (p !== pending) return
pending.emit('ready', null, pending = false)
} | [
"function",
"build",
"(",
")",
"{",
"const",
"p",
"=",
"pending",
"=",
"new",
"Emitter",
"(",
")",
"buffer",
"=",
"bundler",
".",
"toString",
"(",
")",
"if",
"(",
"p",
"!==",
"pending",
")",
"return",
"pending",
".",
"emit",
"(",
"'ready'",
",",
"n... | Build the CSS and pass it to `buffer`.
@api private | [
"Build",
"the",
"CSS",
"and",
"pass",
"it",
"to",
"buffer",
"."
] | 0c70a49e2b8abbfcd6fd0a3735a18064d952992b | https://github.com/yoshuawuyts/myth-request/blob/0c70a49e2b8abbfcd6fd0a3735a18064d952992b/index.js#L26-L32 |
55,940 | adriancmiranda/dotcfg | dist/dotcfg.amd.js | deletePropertyAt | function deletePropertyAt(object, prop) {
if (object == null) { return object; }
var value = object[prop];
delete object[prop];
return value;
} | javascript | function deletePropertyAt(object, prop) {
if (object == null) { return object; }
var value = object[prop];
delete object[prop];
return value;
} | [
"function",
"deletePropertyAt",
"(",
"object",
",",
"prop",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"object",
";",
"}",
"var",
"value",
"=",
"object",
"[",
"prop",
"]",
";",
"delete",
"object",
"[",
"prop",
"]",
";",
"return"... | Removes a property from an object; if no more references to the same property
are held, it is eventually released automatically.
@param {Object} object
@param {String} prop | [
"Removes",
"a",
"property",
"from",
"an",
"object",
";",
"if",
"no",
"more",
"references",
"to",
"the",
"same",
"property",
"are",
"held",
"it",
"is",
"eventually",
"released",
"automatically",
"."
] | ef6cca524621c4bffd0b0c95c62f7330070c26eb | https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L455-L460 |
55,941 | adriancmiranda/dotcfg | dist/dotcfg.amd.js | DotCfg | function DotCfg(namespace, scope, strategy) {
if (instanceOf(DotCfg, this)) {
if (exotic(namespace)) {
strategy = scope;
scope = namespace;
namespace = undefined;
}
if (primitive(scope)) {
scope = env;
}
if (string(namespace)) {
scope[namespace] = scope[namespace] || {};
scope =... | javascript | function DotCfg(namespace, scope, strategy) {
if (instanceOf(DotCfg, this)) {
if (exotic(namespace)) {
strategy = scope;
scope = namespace;
namespace = undefined;
}
if (primitive(scope)) {
scope = env;
}
if (string(namespace)) {
scope[namespace] = scope[namespace] || {};
scope =... | [
"function",
"DotCfg",
"(",
"namespace",
",",
"scope",
",",
"strategy",
")",
"{",
"if",
"(",
"instanceOf",
"(",
"DotCfg",
",",
"this",
")",
")",
"{",
"if",
"(",
"exotic",
"(",
"namespace",
")",
")",
"{",
"strategy",
"=",
"scope",
";",
"scope",
"=",
... | Create a instance of `DotCfg`.
@param namespace: A string containing a qualified name to identify objects from.
@param scope: A object that have system-wide relevance.
@param strategy: A function that configures the input values. | [
"Create",
"a",
"instance",
"of",
"DotCfg",
"."
] | ef6cca524621c4bffd0b0c95c62f7330070c26eb | https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L639-L660 |
55,942 | adriancmiranda/dotcfg | dist/dotcfg.amd.js | set | function set(notation, value, strategy) {
var this$1 = this;
var fn = !undef(value) && callable(strategy) ? strategy : this.strategy;
if (object(notation)) {
var context;
for (var key in notation) {
if (ownProperty(notation, key)) {
context = write(this$1.scope, key, notation[key], fn);
... | javascript | function set(notation, value, strategy) {
var this$1 = this;
var fn = !undef(value) && callable(strategy) ? strategy : this.strategy;
if (object(notation)) {
var context;
for (var key in notation) {
if (ownProperty(notation, key)) {
context = write(this$1.scope, key, notation[key], fn);
... | [
"function",
"set",
"(",
"notation",
",",
"value",
",",
"strategy",
")",
"{",
"var",
"this$1",
"=",
"this",
";",
"var",
"fn",
"=",
"!",
"undef",
"(",
"value",
")",
"&&",
"callable",
"(",
"strategy",
")",
"?",
"strategy",
":",
"this",
".",
"strategy",
... | Write in scope.
@param notation: A object path.
@param value: Arguments for the object.
@param strategy: Arguments for the object.
@returns DotCfg | [
"Write",
"in",
"scope",
"."
] | ef6cca524621c4bffd0b0c95c62f7330070c26eb | https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L703-L718 |
55,943 | adriancmiranda/dotcfg | dist/dotcfg.amd.js | get | function get(notation, defaultValue) {
var value = read(this.scope, notation);
return undef(value) ? defaultValue : value;
} | javascript | function get(notation, defaultValue) {
var value = read(this.scope, notation);
return undef(value) ? defaultValue : value;
} | [
"function",
"get",
"(",
"notation",
",",
"defaultValue",
")",
"{",
"var",
"value",
"=",
"read",
"(",
"this",
".",
"scope",
",",
"notation",
")",
";",
"return",
"undef",
"(",
"value",
")",
"?",
"defaultValue",
":",
"value",
";",
"}"
] | Read scope notation.
@param notation: A object path.
@param defaultValue: A fallback value.
@returns any | [
"Read",
"scope",
"notation",
"."
] | ef6cca524621c4bffd0b0c95c62f7330070c26eb | https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L726-L729 |
55,944 | mar10/grunt-yabs | tasks/yabs.js | makeArrayOpt | function makeArrayOpt(opts, name) {
if( !Array.isArray(opts[name]) ) {
opts[name] = [ opts[name] ];
}
return opts[name];
} | javascript | function makeArrayOpt(opts, name) {
if( !Array.isArray(opts[name]) ) {
opts[name] = [ opts[name] ];
}
return opts[name];
} | [
"function",
"makeArrayOpt",
"(",
"opts",
",",
"name",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"opts",
"[",
"name",
"]",
")",
")",
"{",
"opts",
"[",
"name",
"]",
"=",
"[",
"opts",
"[",
"name",
"]",
"]",
";",
"}",
"return",
"opts"... | Convert opts.name to an array if not already. | [
"Convert",
"opts",
".",
"name",
"to",
"an",
"array",
"if",
"not",
"already",
"."
] | 050741679227fc6342fdef17966f04989e34c244 | https://github.com/mar10/grunt-yabs/blob/050741679227fc6342fdef17966f04989e34c244/tasks/yabs.js#L124-L129 |
55,945 | jonschlinkert/rethrow | index.js | rethrow | function rethrow(options) {
var opts = lazy.extend({before: 3, after: 3}, options);
return function (err, filename, lineno, str, expr) {
if (!(err instanceof Error)) throw err;
lineno = lineno >> 0;
var lines = str.split('\n');
var before = Math.max(lineno - (+opts.before), 0);
var after = Math... | javascript | function rethrow(options) {
var opts = lazy.extend({before: 3, after: 3}, options);
return function (err, filename, lineno, str, expr) {
if (!(err instanceof Error)) throw err;
lineno = lineno >> 0;
var lines = str.split('\n');
var before = Math.max(lineno - (+opts.before), 0);
var after = Math... | [
"function",
"rethrow",
"(",
"options",
")",
"{",
"var",
"opts",
"=",
"lazy",
".",
"extend",
"(",
"{",
"before",
":",
"3",
",",
"after",
":",
"3",
"}",
",",
"options",
")",
";",
"return",
"function",
"(",
"err",
",",
"filename",
",",
"lineno",
",",
... | Re-throw the given `err` in context to the offending
template expression in `filename` at the given `lineno`.
@param {Error} `err` Error object
@param {String} `filename` The file path of the template
@param {String} `lineno` The line number of the expression causing the error.
@param {String} `str` Template string
@a... | [
"Re",
"-",
"throw",
"the",
"given",
"err",
"in",
"context",
"to",
"the",
"offending",
"template",
"expression",
"in",
"filename",
"at",
"the",
"given",
"lineno",
"."
] | 2ab061ed114e7ab076f76b39fae749146d8c4a3c | https://github.com/jonschlinkert/rethrow/blob/2ab061ed114e7ab076f76b39fae749146d8c4a3c/index.js#L28-L63 |
55,946 | mamboer/cssutil | pather.js | processRelativePath | function processRelativePath(cssPath, importCssPath, importCssText) {
cssPath = cssPath.split('\\');
importCssPath = importCssPath.split('/');
var isSibling = importCssPath.length == 1;
return importCssText.replace(reg, function(css, before, imgPath, after) {
if (/^http\S/.te... | javascript | function processRelativePath(cssPath, importCssPath, importCssText) {
cssPath = cssPath.split('\\');
importCssPath = importCssPath.split('/');
var isSibling = importCssPath.length == 1;
return importCssText.replace(reg, function(css, before, imgPath, after) {
if (/^http\S/.te... | [
"function",
"processRelativePath",
"(",
"cssPath",
",",
"importCssPath",
",",
"importCssText",
")",
"{",
"cssPath",
"=",
"cssPath",
".",
"split",
"(",
"'\\\\'",
")",
";",
"importCssPath",
"=",
"importCssPath",
".",
"split",
"(",
"'/'",
")",
";",
"var",
"isSi... | process relative image pathes in specified imported css
@param {String} cssPath css absolute file path
@param {String} importCssPath relative imported css file path
@param {String} importCssText contents of the imported css file | [
"process",
"relative",
"image",
"pathes",
"in",
"specified",
"imported",
"css"
] | 430cc26bea5cdb195411b5b4d1db3c4c4d817246 | https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L10-L22 |
55,947 | mamboer/cssutil | pather.js | getRelativePath | function getRelativePath(cssPath, importCssPath, imgPath) {
var count1 = 0,
count2 = 0,
result = '';
importCssPath = getFilePath(cssPath, importCssPath);
imgPath = getFilePath(importCssPath, imgPath);
for (var i = 0, length = cssPath.length; i < length; i++) {
... | javascript | function getRelativePath(cssPath, importCssPath, imgPath) {
var count1 = 0,
count2 = 0,
result = '';
importCssPath = getFilePath(cssPath, importCssPath);
imgPath = getFilePath(importCssPath, imgPath);
for (var i = 0, length = cssPath.length; i < length; i++) {
... | [
"function",
"getRelativePath",
"(",
"cssPath",
",",
"importCssPath",
",",
"imgPath",
")",
"{",
"var",
"count1",
"=",
"0",
",",
"count2",
"=",
"0",
",",
"result",
"=",
"''",
";",
"importCssPath",
"=",
"getFilePath",
"(",
"cssPath",
",",
"importCssPath",
")"... | get images' relative path after css merging
@param {String} cssPath css absolute file path
@param {String} importCssPath relative imported css file path
@param {String} imgPath raw image relative path | [
"get",
"images",
"relative",
"path",
"after",
"css",
"merging"
] | 430cc26bea5cdb195411b5b4d1db3c4c4d817246 | https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L29-L48 |
55,948 | mamboer/cssutil | pather.js | getFilePath | function getFilePath(basePath, relativePath) {
var count = 0,
array1, array2;
for (var i = 0, length = relativePath.length; i < length; i++) {
if (relativePath[i] == '..') {
count++;
}
}
array1 = basePath.slice(0, basePath.length - 1 - ... | javascript | function getFilePath(basePath, relativePath) {
var count = 0,
array1, array2;
for (var i = 0, length = relativePath.length; i < length; i++) {
if (relativePath[i] == '..') {
count++;
}
}
array1 = basePath.slice(0, basePath.length - 1 - ... | [
"function",
"getFilePath",
"(",
"basePath",
",",
"relativePath",
")",
"{",
"var",
"count",
"=",
"0",
",",
"array1",
",",
"array2",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"length",
"=",
"relativePath",
".",
"length",
";",
"i",
"<",
"length",
";",... | get relative file path basing on its containing file path and its relative path
@param {String} basePath containing file path
@param {String} relative path | [
"get",
"relative",
"file",
"path",
"basing",
"on",
"its",
"containing",
"file",
"path",
"and",
"its",
"relative",
"path"
] | 430cc26bea5cdb195411b5b4d1db3c4c4d817246 | https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L54-L65 |
55,949 | byu-oit/sans-server | bin/util.js | copy | function copy(obj, map) {
if (map.has(obj)) {
return map.get(obj);
} else if (Array.isArray(obj)) {
const result = [];
map.set(obj, result);
obj.forEach(item => {
result.push(copy(item, map));
});
return result;
} else if (typeof obj === 'object' &... | javascript | function copy(obj, map) {
if (map.has(obj)) {
return map.get(obj);
} else if (Array.isArray(obj)) {
const result = [];
map.set(obj, result);
obj.forEach(item => {
result.push(copy(item, map));
});
return result;
} else if (typeof obj === 'object' &... | [
"function",
"copy",
"(",
"obj",
",",
"map",
")",
"{",
"if",
"(",
"map",
".",
"has",
"(",
"obj",
")",
")",
"{",
"return",
"map",
".",
"get",
"(",
"obj",
")",
";",
"}",
"else",
"if",
"(",
"Array",
".",
"isArray",
"(",
"obj",
")",
")",
"{",
"c... | Perform a deep copy of a value.
@param {*} obj
@param {WeakMap} [map]
@returns {*} | [
"Perform",
"a",
"deep",
"copy",
"of",
"a",
"value",
"."
] | 022bcf7b47321e6e8aa20467cd96a6a84a457ec8 | https://github.com/byu-oit/sans-server/blob/022bcf7b47321e6e8aa20467cd96a6a84a457ec8/bin/util.js#L73-L93 |
55,950 | kuhnza/node-tubesio | examples/javascript/beatport-charts.js | parseSearchResults | function parseSearchResults(err, body) {
if (err) { return tubesio.finish(err); }
var result = [];
jsdom.env({
html: body,
scripts: [
'http://code.jquery.com/jquery-1.5.min.js'
]
}, function (err, window) {
if (err) { return tubesio.finish(err); }
v... | javascript | function parseSearchResults(err, body) {
if (err) { return tubesio.finish(err); }
var result = [];
jsdom.env({
html: body,
scripts: [
'http://code.jquery.com/jquery-1.5.min.js'
]
}, function (err, window) {
if (err) { return tubesio.finish(err); }
v... | [
"function",
"parseSearchResults",
"(",
"err",
",",
"body",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"tubesio",
".",
"finish",
"(",
"err",
")",
";",
"}",
"var",
"result",
"=",
"[",
"]",
";",
"jsdom",
".",
"env",
"(",
"{",
"html",
":",
"body... | Parses search results into an array. | [
"Parses",
"search",
"results",
"into",
"an",
"array",
"."
] | 198d005de764480485fe038d1832ccb0f6e0596e | https://github.com/kuhnza/node-tubesio/blob/198d005de764480485fe038d1832ccb0f6e0596e/examples/javascript/beatport-charts.js#L18-L51 |
55,951 | snowyu/inherits-ex.js | src/inherits.js | inherits | function inherits(ctor, superCtor, staticInherit) {
var v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor);
var mixinCtor = ctor.mixinCtor_;
if (mixinCtor && v === mixinCtor) {
ctor = mixinCtor;
v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor);
}
var ... | javascript | function inherits(ctor, superCtor, staticInherit) {
var v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor);
var mixinCtor = ctor.mixinCtor_;
if (mixinCtor && v === mixinCtor) {
ctor = mixinCtor;
v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor);
}
var ... | [
"function",
"inherits",
"(",
"ctor",
",",
"superCtor",
",",
"staticInherit",
")",
"{",
"var",
"v",
"=",
"(",
"ctor",
".",
"hasOwnProperty",
"(",
"'super_'",
")",
"&&",
"ctor",
".",
"super_",
")",
"||",
"getPrototypeOf",
"(",
"ctor",
")",
";",
"var",
"m... | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using... | [
"Inherit",
"the",
"prototype",
"methods",
"from",
"one",
"constructor",
"into",
"another",
"."
] | 09f10e8400bd2b16943ec0dea01d0d9b79abea74 | https://github.com/snowyu/inherits-ex.js/blob/09f10e8400bd2b16943ec0dea01d0d9b79abea74/src/inherits.js#L22-L42 |
55,952 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( text ) {
if ( this.$.text != null )
this.$.text += text;
else
this.append( new CKEDITOR.dom.text( text ) );
} | javascript | function( text ) {
if ( this.$.text != null )
this.$.text += text;
else
this.append( new CKEDITOR.dom.text( text ) );
} | [
"function",
"(",
"text",
")",
"{",
"if",
"(",
"this",
".",
"$",
".",
"text",
"!=",
"null",
")",
"this",
".",
"$",
".",
"text",
"+=",
"text",
";",
"else",
"this",
".",
"append",
"(",
"new",
"CKEDITOR",
".",
"dom",
".",
"text",
"(",
"text",
")",
... | Append text to this element.
var p = new CKEDITOR.dom.element( 'p' );
p.appendText( 'This is' );
p.appendText( ' some text' );
// Result: '<p>This is some text</p>'
@param {String} text The text to be appended.
@returns {CKEDITOR.dom.node} The appended node. | [
"Append",
"text",
"to",
"this",
"element",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L248-L253 | |
55,953 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( parent ) {
var range = new CKEDITOR.dom.range( this.getDocument() );
// We'll be extracting part of this element, so let's use our
// range to get the correct piece.
range.setStartAfter( this );
range.setEndAfter( parent );
// Extract it.
var docFrag = range.extractContents();
// Mo... | javascript | function( parent ) {
var range = new CKEDITOR.dom.range( this.getDocument() );
// We'll be extracting part of this element, so let's use our
// range to get the correct piece.
range.setStartAfter( this );
range.setEndAfter( parent );
// Extract it.
var docFrag = range.extractContents();
// Mo... | [
"function",
"(",
"parent",
")",
"{",
"var",
"range",
"=",
"new",
"CKEDITOR",
".",
"dom",
".",
"range",
"(",
"this",
".",
"getDocument",
"(",
")",
")",
";",
"// We'll be extracting part of this element, so let's use our",
"// range to get the correct piece.",
"range",
... | Breaks one of the ancestor element in the element position, moving
this element between the broken parts.
// Before breaking:
// <b>This <i>is some<span /> sample</i> test text</b>
// If "element" is <span /> and "parent" is <i>:
// <b>This <i>is some</i><span /><i> sample</i> test text</b>
element.breakParent( pare... | [
"Breaks",
"one",
"of",
"the",
"ancestor",
"element",
"in",
"the",
"element",
"position",
"moving",
"this",
"element",
"between",
"the",
"broken",
"parts",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L298-L314 | |
55,954 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function() {
// http://help.dottoro.com/ljvmcrrn.php
var rect = CKEDITOR.tools.extend( {}, this.$.getBoundingClientRect() );
!rect.width && ( rect.width = rect.right - rect.left );
!rect.height && ( rect.height = rect.bottom - rect.top );
return rect;
} | javascript | function() {
// http://help.dottoro.com/ljvmcrrn.php
var rect = CKEDITOR.tools.extend( {}, this.$.getBoundingClientRect() );
!rect.width && ( rect.width = rect.right - rect.left );
!rect.height && ( rect.height = rect.bottom - rect.top );
return rect;
} | [
"function",
"(",
")",
"{",
"// http://help.dottoro.com/ljvmcrrn.php",
"var",
"rect",
"=",
"CKEDITOR",
".",
"tools",
".",
"extend",
"(",
"{",
"}",
",",
"this",
".",
"$",
".",
"getBoundingClientRect",
"(",
")",
")",
";",
"!",
"rect",
".",
"width",
"&&",
"(... | Retrieve the bounding rectangle of the current element, in pixels,
relative to the upper-left corner of the browser's client area.
@returns {Object} The dimensions of the DOM element including
`left`, `top`, `right`, `bottom`, `width` and `height`. | [
"Retrieve",
"the",
"bounding",
"rectangle",
"of",
"the",
"current",
"element",
"in",
"pixels",
"relative",
"to",
"the",
"upper",
"-",
"left",
"corner",
"of",
"the",
"browser",
"s",
"client",
"area",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L399-L407 | |
55,955 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( otherElement ) {
// do shallow clones, but with IDs
var thisEl = this.clone( 0, 1 ),
otherEl = otherElement.clone( 0, 1 );
// Remove distractions.
thisEl.removeAttributes( [ '_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name' ] );
otherEl.removeAttributes( [ '_mo... | javascript | function( otherElement ) {
// do shallow clones, but with IDs
var thisEl = this.clone( 0, 1 ),
otherEl = otherElement.clone( 0, 1 );
// Remove distractions.
thisEl.removeAttributes( [ '_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name' ] );
otherEl.removeAttributes( [ '_mo... | [
"function",
"(",
"otherElement",
")",
"{",
"// do shallow clones, but with IDs",
"var",
"thisEl",
"=",
"this",
".",
"clone",
"(",
"0",
",",
"1",
")",
",",
"otherEl",
"=",
"otherElement",
".",
"clone",
"(",
"0",
",",
"1",
")",
";",
"// Remove distractions.",
... | Compare this element's inner html, tag name, attributes, etc. with other one.
See [W3C's DOM Level 3 spec - node#isEqualNode](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode)
for more details.
@param {CKEDITOR.dom.element} otherElement Element to compare.
@returns {Boolean} | [
"Compare",
"this",
"element",
"s",
"inner",
"html",
"tag",
"name",
"attributes",
"etc",
".",
"with",
"other",
"one",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L843-L874 | |
55,956 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function() {
// CSS unselectable.
this.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'none' ) );
// For IE/Opera which doesn't support for the above CSS style,
// the unselectable="on" attribute only specifies the selection
// process cannot start in the element itself, and it doesn't inheri... | javascript | function() {
// CSS unselectable.
this.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'none' ) );
// For IE/Opera which doesn't support for the above CSS style,
// the unselectable="on" attribute only specifies the selection
// process cannot start in the element itself, and it doesn't inheri... | [
"function",
"(",
")",
"{",
"// CSS unselectable.",
"this",
".",
"setStyles",
"(",
"CKEDITOR",
".",
"tools",
".",
"cssVendorPrefix",
"(",
"'user-select'",
",",
"'none'",
")",
")",
";",
"// For IE/Opera which doesn't support for the above CSS style,",
"// the unselectable=\... | Makes the element and its children unselectable.
var element = CKEDITOR.document.getById( 'myElement' );
element.unselectable();
@method | [
"Makes",
"the",
"element",
"and",
"its",
"children",
"unselectable",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1351-L1369 | |
55,957 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( alignToTop ) {
var parent = this.getParent();
if ( !parent )
return;
// Scroll the element into parent container from the inner out.
do {
// Check ancestors that overflows.
var overflowed =
parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth ||
parent.$.clien... | javascript | function( alignToTop ) {
var parent = this.getParent();
if ( !parent )
return;
// Scroll the element into parent container from the inner out.
do {
// Check ancestors that overflows.
var overflowed =
parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth ||
parent.$.clien... | [
"function",
"(",
"alignToTop",
")",
"{",
"var",
"parent",
"=",
"this",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"!",
"parent",
")",
"return",
";",
"// Scroll the element into parent container from the inner out.",
"do",
"{",
"// Check ancestors that overflows.",
... | Make any page element visible inside the browser viewport.
@param {Boolean} [alignToTop=false] | [
"Make",
"any",
"page",
"element",
"visible",
"inside",
"the",
"browser",
"viewport",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1488-L1517 | |
55,958 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | scrollBy | function scrollBy( x, y ) {
// Webkit doesn't support "scrollTop/scrollLeft"
// on documentElement/body element.
if ( /body|html/.test( parent.getName() ) )
parent.getWindow().$.scrollBy( x, y );
else {
parent.$.scrollLeft += x;
parent.$.scrollTop += y;
}
} | javascript | function scrollBy( x, y ) {
// Webkit doesn't support "scrollTop/scrollLeft"
// on documentElement/body element.
if ( /body|html/.test( parent.getName() ) )
parent.getWindow().$.scrollBy( x, y );
else {
parent.$.scrollLeft += x;
parent.$.scrollTop += y;
}
} | [
"function",
"scrollBy",
"(",
"x",
",",
"y",
")",
"{",
"// Webkit doesn't support \"scrollTop/scrollLeft\"",
"// on documentElement/body element.",
"if",
"(",
"/",
"body|html",
"/",
".",
"test",
"(",
"parent",
".",
"getName",
"(",
")",
")",
")",
"parent",
".",
"g... | Scroll the parent by the specified amount. | [
"Scroll",
"the",
"parent",
"by",
"the",
"specified",
"amount",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1540-L1549 |
55,959 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | screenPos | function screenPos( element, refWin ) {
var pos = { x: 0, y: 0 };
if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) {
var box = element.$.getBoundingClientRect();
pos.x = box.left, pos.y = box.top;
}
var win = element.getWindow();
if ( !win.equals( refWin ) ) {
var outerPos = scr... | javascript | function screenPos( element, refWin ) {
var pos = { x: 0, y: 0 };
if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) {
var box = element.$.getBoundingClientRect();
pos.x = box.left, pos.y = box.top;
}
var win = element.getWindow();
if ( !win.equals( refWin ) ) {
var outerPos = scr... | [
"function",
"screenPos",
"(",
"element",
",",
"refWin",
")",
"{",
"var",
"pos",
"=",
"{",
"x",
":",
"0",
",",
"y",
":",
"0",
"}",
";",
"if",
"(",
"!",
"(",
"element",
".",
"is",
"(",
"isQuirks",
"?",
"'body'",
":",
"'html'",
")",
")",
")",
"{... | Figure out the element position relative to the specified window. | [
"Figure",
"out",
"the",
"element",
"position",
"relative",
"to",
"the",
"specified",
"window",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1552-L1567 |
55,960 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( selector ) {
var removeTmpId = createTmpId( this ),
list = new CKEDITOR.dom.nodeList(
this.$.querySelectorAll( getContextualizedSelector( this, selector ) )
);
removeTmpId();
return list;
} | javascript | function( selector ) {
var removeTmpId = createTmpId( this ),
list = new CKEDITOR.dom.nodeList(
this.$.querySelectorAll( getContextualizedSelector( this, selector ) )
);
removeTmpId();
return list;
} | [
"function",
"(",
"selector",
")",
"{",
"var",
"removeTmpId",
"=",
"createTmpId",
"(",
"this",
")",
",",
"list",
"=",
"new",
"CKEDITOR",
".",
"dom",
".",
"nodeList",
"(",
"this",
".",
"$",
".",
"querySelectorAll",
"(",
"getContextualizedSelector",
"(",
"thi... | Returns list of elements within this element that match specified `selector`.
**Notes:**
* Not available in IE7.
* Returned list is not a live collection (like a result of native `querySelectorAll`).
* Unlike native `querySelectorAll` this method ensures selector contextualization. This is:
HTML: '<body><div><i>foo... | [
"Returns",
"list",
"of",
"elements",
"within",
"this",
"element",
"that",
"match",
"specified",
"selector",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1882-L1891 | |
55,961 | skerit/alchemy-styleboost | public/ckeditor/4.4dev/core/dom/element.js | function( selector ) {
var removeTmpId = createTmpId( this ),
found = this.$.querySelector( getContextualizedSelector( this, selector ) );
removeTmpId();
return found ? new CKEDITOR.dom.element( found ) : null;
} | javascript | function( selector ) {
var removeTmpId = createTmpId( this ),
found = this.$.querySelector( getContextualizedSelector( this, selector ) );
removeTmpId();
return found ? new CKEDITOR.dom.element( found ) : null;
} | [
"function",
"(",
"selector",
")",
"{",
"var",
"removeTmpId",
"=",
"createTmpId",
"(",
"this",
")",
",",
"found",
"=",
"this",
".",
"$",
".",
"querySelector",
"(",
"getContextualizedSelector",
"(",
"this",
",",
"selector",
")",
")",
";",
"removeTmpId",
"(",... | Returns first element within this element that matches specified `selector`.
**Notes:**
* Not available in IE7.
* Unlike native `querySelectorAll` this method ensures selector contextualization. This is:
HTML: '<body><div><i>foo</i></div></body>'
Native: div.querySelector( 'body i' ) // -> <i>foo</i>
Method: di... | [
"Returns",
"first",
"element",
"within",
"this",
"element",
"that",
"matches",
"specified",
"selector",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1910-L1917 | |
55,962 | Mindfor/gulp-bundle-file | index.js | pushTo | function pushTo(array) {
return map(function (file, cb) {
array.push(file);
cb(null, file);
});
} | javascript | function pushTo(array) {
return map(function (file, cb) {
array.push(file);
cb(null, file);
});
} | [
"function",
"pushTo",
"(",
"array",
")",
"{",
"return",
"map",
"(",
"function",
"(",
"file",
",",
"cb",
")",
"{",
"array",
".",
"push",
"(",
"file",
")",
";",
"cb",
"(",
"null",
",",
"file",
")",
";",
"}",
")",
";",
"}"
] | pushes files from pipe to array | [
"pushes",
"files",
"from",
"pipe",
"to",
"array"
] | c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6 | https://github.com/Mindfor/gulp-bundle-file/blob/c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6/index.js#L14-L19 |
55,963 | Mindfor/gulp-bundle-file | index.js | processBundleFile | function processBundleFile(file, bundleExt, variables, bundleHandler, errorCallback) {
// get bundle files
var lines = file.contents.toString().split('\n');
var resultFilePaths = [];
lines.forEach(function (line) {
var filePath = getFilePathFromLine(file, line, variables);
if (filePath)
resultFilePaths.push(... | javascript | function processBundleFile(file, bundleExt, variables, bundleHandler, errorCallback) {
// get bundle files
var lines = file.contents.toString().split('\n');
var resultFilePaths = [];
lines.forEach(function (line) {
var filePath = getFilePathFromLine(file, line, variables);
if (filePath)
resultFilePaths.push(... | [
"function",
"processBundleFile",
"(",
"file",
",",
"bundleExt",
",",
"variables",
",",
"bundleHandler",
",",
"errorCallback",
")",
"{",
"// get bundle files",
"var",
"lines",
"=",
"file",
".",
"contents",
".",
"toString",
"(",
")",
".",
"split",
"(",
"'\\n'",
... | creates new pipe for files from bundle | [
"creates",
"new",
"pipe",
"for",
"files",
"from",
"bundle"
] | c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6 | https://github.com/Mindfor/gulp-bundle-file/blob/c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6/index.js#L35-L57 |
55,964 | Mindfor/gulp-bundle-file | index.js | getFilePathFromLine | function getFilePathFromLine(bundleFile, line, variables) {
// handle variables
var varRegex = /@{([^}]+)}/;
var match;
while (match = line.match(varRegex)) {
var varName = match[1];
if (!variables || typeof (variables[varName]) === 'undefined')
throw new gutil.PluginError(pluginName, bundleFile.path + ': va... | javascript | function getFilePathFromLine(bundleFile, line, variables) {
// handle variables
var varRegex = /@{([^}]+)}/;
var match;
while (match = line.match(varRegex)) {
var varName = match[1];
if (!variables || typeof (variables[varName]) === 'undefined')
throw new gutil.PluginError(pluginName, bundleFile.path + ': va... | [
"function",
"getFilePathFromLine",
"(",
"bundleFile",
",",
"line",
",",
"variables",
")",
"{",
"// handle variables",
"var",
"varRegex",
"=",
"/",
"@{([^}]+)}",
"/",
";",
"var",
"match",
";",
"while",
"(",
"match",
"=",
"line",
".",
"match",
"(",
"varRegex",... | parses file path from line in bundle file | [
"parses",
"file",
"path",
"from",
"line",
"in",
"bundle",
"file"
] | c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6 | https://github.com/Mindfor/gulp-bundle-file/blob/c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6/index.js#L60-L92 |
55,965 | Mindfor/gulp-bundle-file | index.js | recursiveBundle | function recursiveBundle(bundleExt, variables, errorCallback) {
return through2.obj(function (file, enc, cb) {
if (!checkFile(file, cb))
return;
// standart file push to callback
if (path.extname(file.path).toLowerCase() != bundleExt)
return cb(null, file);
// bundle file should be parsed
processBund... | javascript | function recursiveBundle(bundleExt, variables, errorCallback) {
return through2.obj(function (file, enc, cb) {
if (!checkFile(file, cb))
return;
// standart file push to callback
if (path.extname(file.path).toLowerCase() != bundleExt)
return cb(null, file);
// bundle file should be parsed
processBund... | [
"function",
"recursiveBundle",
"(",
"bundleExt",
",",
"variables",
",",
"errorCallback",
")",
"{",
"return",
"through2",
".",
"obj",
"(",
"function",
"(",
"file",
",",
"enc",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"checkFile",
"(",
"file",
",",
"cb",
")"... | recursively processes files and unwraps bundle files | [
"recursively",
"processes",
"files",
"and",
"unwraps",
"bundle",
"files"
] | c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6 | https://github.com/Mindfor/gulp-bundle-file/blob/c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6/index.js#L95-L109 |
55,966 | Mindfor/gulp-bundle-file | index.js | function (variables, bundleHandler) {
// handle if bundleHandler specified in first argument
if (!bundleHandler && typeof (variables) === 'function') {
bundleHandler = variables;
variables = null;
}
return through2.obj(function (file, enc, cb) {
if (!checkFile(file, cb))
return;
var ext = path... | javascript | function (variables, bundleHandler) {
// handle if bundleHandler specified in first argument
if (!bundleHandler && typeof (variables) === 'function') {
bundleHandler = variables;
variables = null;
}
return through2.obj(function (file, enc, cb) {
if (!checkFile(file, cb))
return;
var ext = path... | [
"function",
"(",
"variables",
",",
"bundleHandler",
")",
"{",
"// handle if bundleHandler specified in first argument",
"if",
"(",
"!",
"bundleHandler",
"&&",
"typeof",
"(",
"variables",
")",
"===",
"'function'",
")",
"{",
"bundleHandler",
"=",
"variables",
";",
"va... | concatenates files from bundle and replaces bundle file in current pipe first parameter is function that handles source stream for each bundle | [
"concatenates",
"files",
"from",
"bundle",
"and",
"replaces",
"bundle",
"file",
"in",
"current",
"pipe",
"first",
"parameter",
"is",
"function",
"that",
"handles",
"source",
"stream",
"for",
"each",
"bundle"
] | c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6 | https://github.com/Mindfor/gulp-bundle-file/blob/c4d8a80d869c528d3d7e51d0b9944dbb1bcfecf6/index.js#L127-L149 | |
55,967 | uugolab/sycle | lib/errors/dispatch-error.js | DispatchError | function DispatchError(message) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = 'DispatchError';
this.message = message;
} | javascript | function DispatchError(message) {
Error.call(this);
Error.captureStackTrace(this, arguments.callee);
this.name = 'DispatchError';
this.message = message;
} | [
"function",
"DispatchError",
"(",
"message",
")",
"{",
"Error",
".",
"call",
"(",
"this",
")",
";",
"Error",
".",
"captureStackTrace",
"(",
"this",
",",
"arguments",
".",
"callee",
")",
";",
"this",
".",
"name",
"=",
"'DispatchError'",
";",
"this",
".",
... | `DispatchError` error.
@api private | [
"DispatchError",
"error",
"."
] | 90902246537860adee22664a584c66d72826b5bb | https://github.com/uugolab/sycle/blob/90902246537860adee22664a584c66d72826b5bb/lib/errors/dispatch-error.js#L6-L11 |
55,968 | tunnckoCore/kind-error | index.js | delegateOptional | function delegateOptional (self) {
if (hasOwn(self, 'actual') && hasOwn(self, 'expected')) {
var kindOf = tryRequire('kind-of-extra', 'kind-error')
delegate(self, {
orig: {
actual: self.actual,
expected: self.expected
},
type: {
actual: kindOf(self.actual),
ex... | javascript | function delegateOptional (self) {
if (hasOwn(self, 'actual') && hasOwn(self, 'expected')) {
var kindOf = tryRequire('kind-of-extra', 'kind-error')
delegate(self, {
orig: {
actual: self.actual,
expected: self.expected
},
type: {
actual: kindOf(self.actual),
ex... | [
"function",
"delegateOptional",
"(",
"self",
")",
"{",
"if",
"(",
"hasOwn",
"(",
"self",
",",
"'actual'",
")",
"&&",
"hasOwn",
"(",
"self",
",",
"'expected'",
")",
")",
"{",
"var",
"kindOf",
"=",
"tryRequire",
"(",
"'kind-of-extra'",
",",
"'kind-error'",
... | > Delegate additional optional properties to the `KindError` class.
If `actual` and `expected` properties given in `options` object.
@param {Object} `self`
@return {Object} | [
">",
"Delegate",
"additional",
"optional",
"properties",
"to",
"the",
"KindError",
"class",
".",
"If",
"actual",
"and",
"expected",
"properties",
"given",
"in",
"options",
"object",
"."
] | 3ab0e42a4bc6d42d8b7803027419e4f68e332027 | https://github.com/tunnckoCore/kind-error/blob/3ab0e42a4bc6d42d8b7803027419e4f68e332027/index.js#L72-L94 |
55,969 | tunnckoCore/kind-error | index.js | messageFormat | function messageFormat (type, inspect) {
var msg = this.detailed
? 'expect %s `%s`, but %s `%s` given'
: 'expect `%s`, but `%s` given'
return this.detailed
? util.format(msg, type.expected, inspect.expected, type.actual, inspect.actual)
: util.format(msg, type.expected, type.actual)
} | javascript | function messageFormat (type, inspect) {
var msg = this.detailed
? 'expect %s `%s`, but %s `%s` given'
: 'expect `%s`, but `%s` given'
return this.detailed
? util.format(msg, type.expected, inspect.expected, type.actual, inspect.actual)
: util.format(msg, type.expected, type.actual)
} | [
"function",
"messageFormat",
"(",
"type",
",",
"inspect",
")",
"{",
"var",
"msg",
"=",
"this",
".",
"detailed",
"?",
"'expect %s `%s`, but %s `%s` given'",
":",
"'expect `%s`, but `%s` given'",
"return",
"this",
".",
"detailed",
"?",
"util",
".",
"format",
"(",
... | > Default message formatting function.
@param {Object} `type`
@param {Object} `inspect`
@return {String} | [
">",
"Default",
"message",
"formatting",
"function",
"."
] | 3ab0e42a4bc6d42d8b7803027419e4f68e332027 | https://github.com/tunnckoCore/kind-error/blob/3ab0e42a4bc6d42d8b7803027419e4f68e332027/index.js#L124-L131 |
55,970 | wilmoore/regexp-map.js | index.js | remap | function remap (map, str) {
str = string.call(str) === '[object String]' ? str : ''
for (var key in map) {
if (str.match(new RegExp(key, 'i'))) return map[key]
}
return ''
} | javascript | function remap (map, str) {
str = string.call(str) === '[object String]' ? str : ''
for (var key in map) {
if (str.match(new RegExp(key, 'i'))) return map[key]
}
return ''
} | [
"function",
"remap",
"(",
"map",
",",
"str",
")",
"{",
"str",
"=",
"string",
".",
"call",
"(",
"str",
")",
"===",
"'[object String]'",
"?",
"str",
":",
"''",
"for",
"(",
"var",
"key",
"in",
"map",
")",
"{",
"if",
"(",
"str",
".",
"match",
"(",
... | Curried function which takes a map of `RegExp` string keys which when successfully matched given string, resolves to mapped value.
@param {Object.<string, string>} map
Map of `RegExp` strings which when matched against string successfully, resolves to mapped value.
@param {String} str
String to search.
@return {Stri... | [
"Curried",
"function",
"which",
"takes",
"a",
"map",
"of",
"RegExp",
"string",
"keys",
"which",
"when",
"successfully",
"matched",
"given",
"string",
"resolves",
"to",
"mapped",
"value",
"."
] | 2d40aad44c4cd36a2e6af0070534c599d00f7109 | https://github.com/wilmoore/regexp-map.js/blob/2d40aad44c4cd36a2e6af0070534c599d00f7109/index.js#L29-L37 |
55,971 | danigb/music.operator | index.js | add | function add (a, b) {
var fifths = a[0] + b[0]
var octaves = a[1] === null || b[1] === null ? null : a[1] + b[1]
return [fifths, octaves]
} | javascript | function add (a, b) {
var fifths = a[0] + b[0]
var octaves = a[1] === null || b[1] === null ? null : a[1] + b[1]
return [fifths, octaves]
} | [
"function",
"add",
"(",
"a",
",",
"b",
")",
"{",
"var",
"fifths",
"=",
"a",
"[",
"0",
"]",
"+",
"b",
"[",
"0",
"]",
"var",
"octaves",
"=",
"a",
"[",
"1",
"]",
"===",
"null",
"||",
"b",
"[",
"1",
"]",
"===",
"null",
"?",
"null",
":",
"a",
... | Add two pitches. Can be used to tranpose pitches.
@param {Array} first - first pitch
@param {Array} second - second pitch
@return {Array} both pitches added
@example
operator.add([3, 0, 0], [4, 0, 0]) // => [0, 0, 1] | [
"Add",
"two",
"pitches",
".",
"Can",
"be",
"used",
"to",
"tranpose",
"pitches",
"."
] | 5da2c1528ba704dea0ca10065fda4b91aadc8b0d | https://github.com/danigb/music.operator/blob/5da2c1528ba704dea0ca10065fda4b91aadc8b0d/index.js#L178-L182 |
55,972 | danigb/music.operator | index.js | subtract | function subtract (a, b) {
var fifths = b[0] - a[0]
var octaves = a[1] !== null && b[1] !== null ? b[1] - a[1] : null
return [fifths, octaves]
} | javascript | function subtract (a, b) {
var fifths = b[0] - a[0]
var octaves = a[1] !== null && b[1] !== null ? b[1] - a[1] : null
return [fifths, octaves]
} | [
"function",
"subtract",
"(",
"a",
",",
"b",
")",
"{",
"var",
"fifths",
"=",
"b",
"[",
"0",
"]",
"-",
"a",
"[",
"0",
"]",
"var",
"octaves",
"=",
"a",
"[",
"1",
"]",
"!==",
"null",
"&&",
"b",
"[",
"1",
"]",
"!==",
"null",
"?",
"b",
"[",
"1"... | Subtract two pitches or intervals. Can be used to find the distance between pitches.
@name subtract
@function
@param {Array} a - one pitch or interval in [pitch-array](https://github.com/danigb/pitch-array) format
@param {Array} b - the other pitch or interval in [pitch-array](https://github.com/danigb/pitch-array) fo... | [
"Subtract",
"two",
"pitches",
"or",
"intervals",
".",
"Can",
"be",
"used",
"to",
"find",
"the",
"distance",
"between",
"pitches",
"."
] | 5da2c1528ba704dea0ca10065fda4b91aadc8b0d | https://github.com/danigb/music.operator/blob/5da2c1528ba704dea0ca10065fda4b91aadc8b0d/index.js#L205-L209 |
55,973 | queckezz/list | lib/nth.js | nth | function nth (n, array) {
return n < 0 ? array[array.length + n] : array[n]
} | javascript | function nth (n, array) {
return n < 0 ? array[array.length + n] : array[n]
} | [
"function",
"nth",
"(",
"n",
",",
"array",
")",
"{",
"return",
"n",
"<",
"0",
"?",
"array",
"[",
"array",
".",
"length",
"+",
"n",
"]",
":",
"array",
"[",
"n",
"]",
"}"
] | Returns the `n`th element in the given `array`.
@param {Int} n Index
@param {Array} array Array to operate on
@return {Any} `n`th element | [
"Returns",
"the",
"n",
"th",
"element",
"in",
"the",
"given",
"array",
"."
] | a26130020b447a1aa136f0fed3283821490f7da4 | https://github.com/queckezz/list/blob/a26130020b447a1aa136f0fed3283821490f7da4/lib/nth.js#L11-L13 |
55,974 | YahooArchive/mojito-cli-jslint | lib/lintifier.js | scanErr | function scanErr(err, pathname) {
log.debug(err);
if ('ENOENT' === err.code) {
callback(pathname + ' does not exist.');
} else {
callback('Unexpected error.');
}
// cli does process.exit() in callback, but unit tests don't.
callback = function () {};
} | javascript | function scanErr(err, pathname) {
log.debug(err);
if ('ENOENT' === err.code) {
callback(pathname + ' does not exist.');
} else {
callback('Unexpected error.');
}
// cli does process.exit() in callback, but unit tests don't.
callback = function () {};
} | [
"function",
"scanErr",
"(",
"err",
",",
"pathname",
")",
"{",
"log",
".",
"debug",
"(",
"err",
")",
";",
"if",
"(",
"'ENOENT'",
"===",
"err",
".",
"code",
")",
"{",
"callback",
"(",
"pathname",
"+",
"' does not exist.'",
")",
";",
"}",
"else",
"{",
... | scanfs error callback | [
"scanfs",
"error",
"callback"
] | cc6f90352534689a9e8c524c4cce825215bb5186 | https://github.com/YahooArchive/mojito-cli-jslint/blob/cc6f90352534689a9e8c524c4cce825215bb5186/lib/lintifier.js#L21-L31 |
55,975 | gropox/golos-addons | golos.js | getCurrentServerTimeAndBlock | async function getCurrentServerTimeAndBlock() {
await retrieveDynGlobProps();
if(props.time) {
lastCommitedBlock = props.last_irreversible_block_num;
trace("lastCommitedBlock = " + lastCommitedBlock + ", headBlock = " + props.head_block_number);
return {
time : Date.parse(pr... | javascript | async function getCurrentServerTimeAndBlock() {
await retrieveDynGlobProps();
if(props.time) {
lastCommitedBlock = props.last_irreversible_block_num;
trace("lastCommitedBlock = " + lastCommitedBlock + ", headBlock = " + props.head_block_number);
return {
time : Date.parse(pr... | [
"async",
"function",
"getCurrentServerTimeAndBlock",
"(",
")",
"{",
"await",
"retrieveDynGlobProps",
"(",
")",
";",
"if",
"(",
"props",
".",
"time",
")",
"{",
"lastCommitedBlock",
"=",
"props",
".",
"last_irreversible_block_num",
";",
"trace",
"(",
"\"lastCommited... | time in milliseconds | [
"time",
"in",
"milliseconds"
] | 14b132e7aa89d82db12cf2614faaddbec7e1cb9f | https://github.com/gropox/golos-addons/blob/14b132e7aa89d82db12cf2614faaddbec7e1cb9f/golos.js#L37-L49 |
55,976 | guileen/node-formconv | scheme.js | filter | function filter(obj) {
var result = {}, fieldDefine, value;
for(var field in options) {
fieldDefine = options[field];
value = obj[field];
if(!fieldDefine.private && value !== undefined) {
result[field] = value;
}
}
return result;
} | javascript | function filter(obj) {
var result = {}, fieldDefine, value;
for(var field in options) {
fieldDefine = options[field];
value = obj[field];
if(!fieldDefine.private && value !== undefined) {
result[field] = value;
}
}
return result;
} | [
"function",
"filter",
"(",
"obj",
")",
"{",
"var",
"result",
"=",
"{",
"}",
",",
"fieldDefine",
",",
"value",
";",
"for",
"(",
"var",
"field",
"in",
"options",
")",
"{",
"fieldDefine",
"=",
"options",
"[",
"field",
"]",
";",
"value",
"=",
"obj",
"[... | filter private fields | [
"filter",
"private",
"fields"
] | b2eb725a4fd5643540c59c8ce27a78a8a8c91335 | https://github.com/guileen/node-formconv/blob/b2eb725a4fd5643540c59c8ce27a78a8a8c91335/scheme.js#L124-L134 |
55,977 | hpcloud/hpcloud-js | lib/objectstorage/container.js | Container | function Container(name, token, url) {
this._name = name;
this._url = url;
this._token = token;
this.isNew = false;
} | javascript | function Container(name, token, url) {
this._name = name;
this._url = url;
this._token = token;
this.isNew = false;
} | [
"function",
"Container",
"(",
"name",
",",
"token",
",",
"url",
")",
"{",
"this",
".",
"_name",
"=",
"name",
";",
"this",
".",
"_url",
"=",
"url",
";",
"this",
".",
"_token",
"=",
"token",
";",
"this",
".",
"isNew",
"=",
"false",
";",
"}"
] | Create a new container.
When a new container is created, no check is done against the server
to ensure that the container exists. Thus, it is possible to have a
local container object that does not point to a legitimate
server-side container.
@class Container
@constructor
@param {String} name The name of the contain... | [
"Create",
"a",
"new",
"container",
"."
] | c457ea3ee6a21e361d1af0af70d64622b6910208 | https://github.com/hpcloud/hpcloud-js/blob/c457ea3ee6a21e361d1af0af70d64622b6910208/lib/objectstorage/container.js#L58-L63 |
55,978 | ForbesLindesay-Unmaintained/sauce-test | lib/wait-for-job-to-finish.js | waitForJobToFinish | function waitForJobToFinish(driver, options) {
return new Promise(function (resolve, reject) {
var start = Date.now();
var timingOut = false;
function check() {
var checkedForExceptions;
if (options.allowExceptions) {
checkedForExceptions = Promise.resolve(null);
} else {
... | javascript | function waitForJobToFinish(driver, options) {
return new Promise(function (resolve, reject) {
var start = Date.now();
var timingOut = false;
function check() {
var checkedForExceptions;
if (options.allowExceptions) {
checkedForExceptions = Promise.resolve(null);
} else {
... | [
"function",
"waitForJobToFinish",
"(",
"driver",
",",
"options",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"var",
"start",
"=",
"Date",
".",
"now",
"(",
")",
";",
"var",
"timingOut",
"=",
"false",
"... | Wait for a driver that has a running job to finish its job
@option {Boolean} allowExceptions Set to `true` to skip the check for `window.onerror`
@option {String|Function} testComplete A function to test if the job is complete
@option {String} timeout The timeout (gets passed to ms)
@param... | [
"Wait",
"for",
"a",
"driver",
"that",
"has",
"a",
"running",
"job",
"to",
"finish",
"its",
"job"
] | 7c671b3321dc63aefc00c1c8d49e943ead2e7f5e | https://github.com/ForbesLindesay-Unmaintained/sauce-test/blob/7c671b3321dc63aefc00c1c8d49e943ead2e7f5e/lib/wait-for-job-to-finish.js#L20-L62 |
55,979 | Tjatse/range | index.js | Range | function Range(){
if (!(this instanceof Range)) {
return new Range();
}
// maximize int.
var max = Math.pow(2, 32) - 1;
// default options.
this.options = {
min: -max,
max: max,
res: {
range : /^[\s\d\-~,]+$/,
blank : /\s+/g,
number : /^\-?\d+$/,
min2num: /^~\-?\d+... | javascript | function Range(){
if (!(this instanceof Range)) {
return new Range();
}
// maximize int.
var max = Math.pow(2, 32) - 1;
// default options.
this.options = {
min: -max,
max: max,
res: {
range : /^[\s\d\-~,]+$/,
blank : /\s+/g,
number : /^\-?\d+$/,
min2num: /^~\-?\d+... | [
"function",
"Range",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Range",
")",
")",
"{",
"return",
"new",
"Range",
"(",
")",
";",
"}",
"// maximize int.",
"var",
"max",
"=",
"Math",
".",
"pow",
"(",
"2",
",",
"32",
")",
"-",
"1",
... | Range parser.
@returns {Range}
@constructor | [
"Range",
"parser",
"."
] | ad806642189ca7df22f8b0d16432a3ca68e071c7 | https://github.com/Tjatse/range/blob/ad806642189ca7df22f8b0d16432a3ca68e071c7/index.js#L11-L33 |
55,980 | Tjatse/range | index.js | function(s, opts){
var r = s.split('~').map(function(d){
return parseFloat(d);
});
// number at position 1 must greater than position 0.
if (r[0] > r[1]) {
return r.reverse();
}
return r;
} | javascript | function(s, opts){
var r = s.split('~').map(function(d){
return parseFloat(d);
});
// number at position 1 must greater than position 0.
if (r[0] > r[1]) {
return r.reverse();
}
return r;
} | [
"function",
"(",
"s",
",",
"opts",
")",
"{",
"var",
"r",
"=",
"s",
".",
"split",
"(",
"'~'",
")",
".",
"map",
"(",
"function",
"(",
"d",
")",
"{",
"return",
"parseFloat",
"(",
"d",
")",
";",
"}",
")",
";",
"// number at position 1 must greater than p... | String like `1~2`, `5~8`, it means a range from a specific number to another.
@param {String} s
@param {Object} opts
@returns {*} | [
"String",
"like",
"1~2",
"5~8",
"it",
"means",
"a",
"range",
"from",
"a",
"specific",
"number",
"to",
"another",
"."
] | ad806642189ca7df22f8b0d16432a3ca68e071c7 | https://github.com/Tjatse/range/blob/ad806642189ca7df22f8b0d16432a3ca68e071c7/index.js#L146-L155 | |
55,981 | jkroso/rename-variables | index.js | rename | function rename(node, it, to){
switch (node.type) {
case 'VariableDeclaration':
return node.declarations.forEach(function(dec){
if (dec.id.name == it) dec.id.name = to
if (dec.init) rename(dec.init, it, to)
})
case 'FunctionDeclaration':
if (node.id.name == it) node.id.name =... | javascript | function rename(node, it, to){
switch (node.type) {
case 'VariableDeclaration':
return node.declarations.forEach(function(dec){
if (dec.id.name == it) dec.id.name = to
if (dec.init) rename(dec.init, it, to)
})
case 'FunctionDeclaration':
if (node.id.name == it) node.id.name =... | [
"function",
"rename",
"(",
"node",
",",
"it",
",",
"to",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"'VariableDeclaration'",
":",
"return",
"node",
".",
"declarations",
".",
"forEach",
"(",
"function",
"(",
"dec",
")",
"{",
"if",
... | rename all references to `it` in or below `nodes`'s
scope to `to`
@param {AST} node
@param {String} it
@param {String} to | [
"rename",
"all",
"references",
"to",
"it",
"in",
"or",
"below",
"nodes",
"s",
"scope",
"to",
"to"
] | b1ade439b857367f27f7b85bd1b024a6b01bc4be | https://github.com/jkroso/rename-variables/blob/b1ade439b857367f27f7b85bd1b024a6b01bc4be/index.js#L14-L39 |
55,982 | jkroso/rename-variables | index.js | freshVars | function freshVars(node){
switch (node.type) {
case 'VariableDeclaration':
return node.declarations.map(function(n){ return n.id })
case 'FunctionExpression': return [] // early exit
case 'FunctionDeclaration':
return [node.id]
}
return children(node)
.map(freshVars)
.reduce(concat... | javascript | function freshVars(node){
switch (node.type) {
case 'VariableDeclaration':
return node.declarations.map(function(n){ return n.id })
case 'FunctionExpression': return [] // early exit
case 'FunctionDeclaration':
return [node.id]
}
return children(node)
.map(freshVars)
.reduce(concat... | [
"function",
"freshVars",
"(",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"'VariableDeclaration'",
":",
"return",
"node",
".",
"declarations",
".",
"map",
"(",
"function",
"(",
"n",
")",
"{",
"return",
"n",
".",
"id",
"}",
... | get all declared variables within `node`'s scope
@param {AST} node
@return {Array} | [
"get",
"all",
"declared",
"variables",
"within",
"node",
"s",
"scope"
] | b1ade439b857367f27f7b85bd1b024a6b01bc4be | https://github.com/jkroso/rename-variables/blob/b1ade439b857367f27f7b85bd1b024a6b01bc4be/index.js#L48-L59 |
55,983 | kfranqueiro/node-irssi-log-parser | Parser.js | function (filename) {
var resume = filename === true; // should only ever be set by resume calls
var fd = this._fd = resume ? this._fd : fs.openSync(filename, 'r');
var buffer = new Buffer(4096);
var bytesRead;
var current = '';
var remainder = resume ? this._remainder : '';
while (!this._paused && (byte... | javascript | function (filename) {
var resume = filename === true; // should only ever be set by resume calls
var fd = this._fd = resume ? this._fd : fs.openSync(filename, 'r');
var buffer = new Buffer(4096);
var bytesRead;
var current = '';
var remainder = resume ? this._remainder : '';
while (!this._paused && (byte... | [
"function",
"(",
"filename",
")",
"{",
"var",
"resume",
"=",
"filename",
"===",
"true",
";",
"// should only ever be set by resume calls",
"var",
"fd",
"=",
"this",
".",
"_fd",
"=",
"resume",
"?",
"this",
".",
"_fd",
":",
"fs",
".",
"openSync",
"(",
"filen... | Parses the given log file.
@param {string} filename File to parse | [
"Parses",
"the",
"given",
"log",
"file",
"."
] | 7088868462a636b2473b2b0efdb3c1002c26b43c | https://github.com/kfranqueiro/node-irssi-log-parser/blob/7088868462a636b2473b2b0efdb3c1002c26b43c/Parser.js#L301-L323 | |
55,984 | llucbrell/audrey2 | index.js | init | function init(){
//modules load
terminal.colors.default= chalk.white.bold;
terminal.default="";
//set the colors of the terminal
checkUserColors(terminal.colors);
bool=true;
//to control the view properties and colors
properties= Object.getOwnPropertyNames(terminal);
colors=Object.getOwnPropertyNames(terminal.colors);
... | javascript | function init(){
//modules load
terminal.colors.default= chalk.white.bold;
terminal.default="";
//set the colors of the terminal
checkUserColors(terminal.colors);
bool=true;
//to control the view properties and colors
properties= Object.getOwnPropertyNames(terminal);
colors=Object.getOwnPropertyNames(terminal.colors);
... | [
"function",
"init",
"(",
")",
"{",
"//modules load",
"terminal",
".",
"colors",
".",
"default",
"=",
"chalk",
".",
"white",
".",
"bold",
";",
"terminal",
".",
"default",
"=",
"\"\"",
";",
"//set the colors of the terminal",
"checkUserColors",
"(",
"terminal",
... | to reinit the audrey view when is updated | [
"to",
"reinit",
"the",
"audrey",
"view",
"when",
"is",
"updated"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L154-L164 |
55,985 | llucbrell/audrey2 | index.js | fertilise | function fertilise(objectName, value, color, blockPos){
if(!blockPos) throw new Error("incorrect call to fertilise method");
var name= objectName.slice(2);
terminal[name]=value;
terminal.colors[name]=color;
setOnBlock(objectName, blockPos);
checkUserColors(terminal.colors);
init();
} | javascript | function fertilise(objectName, value, color, blockPos){
if(!blockPos) throw new Error("incorrect call to fertilise method");
var name= objectName.slice(2);
terminal[name]=value;
terminal.colors[name]=color;
setOnBlock(objectName, blockPos);
checkUserColors(terminal.colors);
init();
} | [
"function",
"fertilise",
"(",
"objectName",
",",
"value",
",",
"color",
",",
"blockPos",
")",
"{",
"if",
"(",
"!",
"blockPos",
")",
"throw",
"new",
"Error",
"(",
"\"incorrect call to fertilise method\"",
")",
";",
"var",
"name",
"=",
"objectName",
".",
"slic... | by name, value,color block | [
"by",
"name",
"value",
"color",
"block"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L203-L211 |
55,986 | llucbrell/audrey2 | index.js | checkUserColors | function checkUserColors(colorUser){
if(terminal.colors){
for(var name in colorUser){
colorUser[name]= setUserColor(colorUser[name]);
}
}
else{
throw new Error("There is no colors object defined");
}
} | javascript | function checkUserColors(colorUser){
if(terminal.colors){
for(var name in colorUser){
colorUser[name]= setUserColor(colorUser[name]);
}
}
else{
throw new Error("There is no colors object defined");
}
} | [
"function",
"checkUserColors",
"(",
"colorUser",
")",
"{",
"if",
"(",
"terminal",
".",
"colors",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"colorUser",
")",
"{",
"colorUser",
"[",
"name",
"]",
"=",
"setUserColor",
"(",
"colorUser",
"[",
"name",
"]",
"... | FUNCTIONS FOR THE CLI RESPONSE.. check if there is defined object colors if not, throw error | [
"FUNCTIONS",
"FOR",
"THE",
"CLI",
"RESPONSE",
"..",
"check",
"if",
"there",
"is",
"defined",
"object",
"colors",
"if",
"not",
"throw",
"error"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L215-L224 |
55,987 | llucbrell/audrey2 | index.js | setOnBlock | function setOnBlock(objectName, blockPos){
switch(blockPos){//check where to add in the structure
case 'header':
terminal.header.push(objectName);
break;
case 'body':
terminal.body.push(objectName);
break;
case 'footer':
terminal.footer.push(objectName);
break;
}
} | javascript | function setOnBlock(objectName, blockPos){
switch(blockPos){//check where to add in the structure
case 'header':
terminal.header.push(objectName);
break;
case 'body':
terminal.body.push(objectName);
break;
case 'footer':
terminal.footer.push(objectName);
break;
}
} | [
"function",
"setOnBlock",
"(",
"objectName",
",",
"blockPos",
")",
"{",
"switch",
"(",
"blockPos",
")",
"{",
"//check where to add in the structure",
"case",
"'header'",
":",
"terminal",
".",
"header",
".",
"push",
"(",
"objectName",
")",
";",
"break",
";",
"c... | adds new object to list of print | [
"adds",
"new",
"object",
"to",
"list",
"of",
"print"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L226-L238 |
55,988 | llucbrell/audrey2 | index.js | checkColors | function checkColors(name){
var colors=Object.getOwnPropertyNames(terminal.colors);
var bul=false; // boolean to control if its defined the property
for(var i=0; i<colors.length; i++){//iterate over prop names
if(colors[i] === name){//if it is
bul=true;
}
}
if(bul!==true){//if its finded the s... | javascript | function checkColors(name){
var colors=Object.getOwnPropertyNames(terminal.colors);
var bul=false; // boolean to control if its defined the property
for(var i=0; i<colors.length; i++){//iterate over prop names
if(colors[i] === name){//if it is
bul=true;
}
}
if(bul!==true){//if its finded the s... | [
"function",
"checkColors",
"(",
"name",
")",
"{",
"var",
"colors",
"=",
"Object",
".",
"getOwnPropertyNames",
"(",
"terminal",
".",
"colors",
")",
";",
"var",
"bul",
"=",
"false",
";",
"// boolean to control if its defined the property",
"for",
"(",
"var",
"i",
... | checks the colors in printBrand | [
"checks",
"the",
"colors",
"in",
"printBrand"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L269-L282 |
55,989 | llucbrell/audrey2 | index.js | checkProperties | function checkProperties(name){
var bul=false; // boolean to control if its defined the property
for(var i=0; i<properties.length; i++){//iterate over prop names
if(properties[i] === name){//if it is
bul=true;
}
}
if(bul!==true){// it isn't finded the statement of the tag
throw new Error('Not... | javascript | function checkProperties(name){
var bul=false; // boolean to control if its defined the property
for(var i=0; i<properties.length; i++){//iterate over prop names
if(properties[i] === name){//if it is
bul=true;
}
}
if(bul!==true){// it isn't finded the statement of the tag
throw new Error('Not... | [
"function",
"checkProperties",
"(",
"name",
")",
"{",
"var",
"bul",
"=",
"false",
";",
"// boolean to control if its defined the property",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"properties",
".",
"length",
";",
"i",
"++",
")",
"{",
"//iterate ove... | control if the view has the correct properties if not throw error | [
"control",
"if",
"the",
"view",
"has",
"the",
"correct",
"properties",
"if",
"not",
"throw",
"error"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L470-L481 |
55,990 | llucbrell/audrey2 | index.js | aError | function aError(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.error(terminal.symbolProgress+" Error: "+errorObject.message)+ " " +terminal.colors.aux(errorObject.aux));
... | javascript | function aError(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.error(terminal.symbolProgress+" Error: "+errorObject.message)+ " " +terminal.colors.aux(errorObject.aux));
... | [
"function",
"aError",
"(",
"errorObject",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"symbolProgress",
")",
"terminal",
".",
"symbolProgress",
"=",
"\"? \"",
";",
"if",
"(",
"errorObject",
".",
"aux",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"colors",
... | FUNCTIONS FOR PRINTING ON SCREEN print error message for debug | [
"FUNCTIONS",
"FOR",
"PRINTING",
"ON",
"SCREEN",
"print",
"error",
"message",
"for",
"debug"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L486-L497 |
55,991 | llucbrell/audrey2 | index.js | aSuccess | function aSuccess(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.success(terminal.symbolProgress+" Success: "+errorObject.message) +" " +terminal.colors.aux(errorObject.aux));... | javascript | function aSuccess(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.success(terminal.symbolProgress+" Success: "+errorObject.message) +" " +terminal.colors.aux(errorObject.aux));... | [
"function",
"aSuccess",
"(",
"errorObject",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"symbolProgress",
")",
"terminal",
".",
"symbolProgress",
"=",
"\"? \"",
";",
"if",
"(",
"errorObject",
".",
"aux",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"colors"... | print success error for debug | [
"print",
"success",
"error",
"for",
"debug"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L499-L510 |
55,992 | llucbrell/audrey2 | index.js | aWarning | function aWarning(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.warning(terminal.symbolProgress+" Warning: "+errorObject.message)+" " +terminal.colors.aux(errorObject.aux));... | javascript | function aWarning(errorObject){
if(!terminal.symbolProgress) terminal.symbolProgress="? ";
if(errorObject.aux){
if(!terminal.colors.aux) terminal.colors.aux= chalk.white;
console.log(terminal.colors.warning(terminal.symbolProgress+" Warning: "+errorObject.message)+" " +terminal.colors.aux(errorObject.aux));... | [
"function",
"aWarning",
"(",
"errorObject",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"symbolProgress",
")",
"terminal",
".",
"symbolProgress",
"=",
"\"? \"",
";",
"if",
"(",
"errorObject",
".",
"aux",
")",
"{",
"if",
"(",
"!",
"terminal",
".",
"colors"... | print warning error for debug | [
"print",
"warning",
"error",
"for",
"debug"
] | eb683b25a6b1b05a9f832e85707fb7274542a1e5 | https://github.com/llucbrell/audrey2/blob/eb683b25a6b1b05a9f832e85707fb7274542a1e5/index.js#L512-L523 |
55,993 | transomjs/transom-scaffold | lib/scaffoldHandler.js | addStaticAssetRoute | function addStaticAssetRoute(server, scaffold) {
assert(scaffold.path, `TransomScaffold staticRoute requires "path" to be specified.`);
const contentFolder = scaffold.folder || path.sep;
const serveStatic = scaffold.serveStatic || restify.plugins.serveStatic;
const defaultAsset = scaffo... | javascript | function addStaticAssetRoute(server, scaffold) {
assert(scaffold.path, `TransomScaffold staticRoute requires "path" to be specified.`);
const contentFolder = scaffold.folder || path.sep;
const serveStatic = scaffold.serveStatic || restify.plugins.serveStatic;
const defaultAsset = scaffo... | [
"function",
"addStaticAssetRoute",
"(",
"server",
",",
"scaffold",
")",
"{",
"assert",
"(",
"scaffold",
".",
"path",
",",
"`",
"`",
")",
";",
"const",
"contentFolder",
"=",
"scaffold",
".",
"folder",
"||",
"path",
".",
"sep",
";",
"const",
"serveStatic",
... | Add a GET route to the server to handle static assets.
@param {*} server - Restify server instance
@param {*} scaffold - Object from the staticRoutes array. | [
"Add",
"a",
"GET",
"route",
"to",
"the",
"server",
"to",
"handle",
"static",
"assets",
"."
] | 07550492282f972438b9af4d52c0befa4ba3b454 | https://github.com/transomjs/transom-scaffold/blob/07550492282f972438b9af4d52c0befa4ba3b454/lib/scaffoldHandler.js#L15-L36 |
55,994 | transomjs/transom-scaffold | lib/scaffoldHandler.js | addRedirectRoute | function addRedirectRoute(server, scaffold) {
assert(scaffold.path && scaffold.target, `TransomScaffold redirectRoute requires 'path' and 'target' to be specified.`);
server.get(scaffold.path, function (req, res, next) {
res.redirect(scaffold.target, next);
});
} | javascript | function addRedirectRoute(server, scaffold) {
assert(scaffold.path && scaffold.target, `TransomScaffold redirectRoute requires 'path' and 'target' to be specified.`);
server.get(scaffold.path, function (req, res, next) {
res.redirect(scaffold.target, next);
});
} | [
"function",
"addRedirectRoute",
"(",
"server",
",",
"scaffold",
")",
"{",
"assert",
"(",
"scaffold",
".",
"path",
"&&",
"scaffold",
".",
"target",
",",
"`",
"`",
")",
";",
"server",
".",
"get",
"(",
"scaffold",
".",
"path",
",",
"function",
"(",
"req",... | Add a GET route that redirects to another URI.
@param {*} server - Restify server instance
@param {*} scaffold - Object from the redirectRoutes array. | [
"Add",
"a",
"GET",
"route",
"that",
"redirects",
"to",
"another",
"URI",
"."
] | 07550492282f972438b9af4d52c0befa4ba3b454 | https://github.com/transomjs/transom-scaffold/blob/07550492282f972438b9af4d52c0befa4ba3b454/lib/scaffoldHandler.js#L44-L50 |
55,995 | transomjs/transom-scaffold | lib/scaffoldHandler.js | addTemplateRoute | function addTemplateRoute(server, scaffold) {
server.get(scaffold.path, function (req, res, next) {
const transomTemplate = server.registry.get(scaffold.templateHandler);
const contentType = scaffold.contentType || 'text/html';
const p = new Promise(function (resolve, reject... | javascript | function addTemplateRoute(server, scaffold) {
server.get(scaffold.path, function (req, res, next) {
const transomTemplate = server.registry.get(scaffold.templateHandler);
const contentType = scaffold.contentType || 'text/html';
const p = new Promise(function (resolve, reject... | [
"function",
"addTemplateRoute",
"(",
"server",
",",
"scaffold",
")",
"{",
"server",
".",
"get",
"(",
"scaffold",
".",
"path",
",",
"function",
"(",
"req",
",",
"res",
",",
"next",
")",
"{",
"const",
"transomTemplate",
"=",
"server",
".",
"registry",
".",... | Add a GET route that is handled with a template.
@param {*} server - Restify server instance
@param {*} scaffold | [
"Add",
"a",
"GET",
"route",
"that",
"is",
"handled",
"with",
"a",
"template",
"."
] | 07550492282f972438b9af4d52c0befa4ba3b454 | https://github.com/transomjs/transom-scaffold/blob/07550492282f972438b9af4d52c0befa4ba3b454/lib/scaffoldHandler.js#L58-L78 |
55,996 | joelahoover/nomv | index.js | resolveNodeSkel | function resolveNodeSkel(index, nodeName) {
var idx = +graph.nameToIndex[nodeName];
argh = [idx, +index]
if(Number.isNaN(idx)) {
throw "Unable to get index for node '" + nodeName + "'. (Is the node name misspelled?)";
}
if(index !== undefined && idx > +index) {
throw "Unable to get index... | javascript | function resolveNodeSkel(index, nodeName) {
var idx = +graph.nameToIndex[nodeName];
argh = [idx, +index]
if(Number.isNaN(idx)) {
throw "Unable to get index for node '" + nodeName + "'. (Is the node name misspelled?)";
}
if(index !== undefined && idx > +index) {
throw "Unable to get index... | [
"function",
"resolveNodeSkel",
"(",
"index",
",",
"nodeName",
")",
"{",
"var",
"idx",
"=",
"+",
"graph",
".",
"nameToIndex",
"[",
"nodeName",
"]",
";",
"argh",
"=",
"[",
"idx",
",",
"+",
"index",
"]",
"if",
"(",
"Number",
".",
"isNaN",
"(",
"idx",
... | Helper function to lookup a node | [
"Helper",
"function",
"to",
"lookup",
"a",
"node"
] | 69a1a86882f500d52839f544538014460709ba9e | https://github.com/joelahoover/nomv/blob/69a1a86882f500d52839f544538014460709ba9e/index.js#L585-L598 |
55,997 | joelahoover/nomv | index.js | resolveValueOrNodeSkel | function resolveValueOrNodeSkel(index, val, valDefault) {
switch (typeof(val)) {
case "string":
return resolveNodeSkel(index, val);
case "undefined":
if (valDefault === undefined) {
throw "Unable to get value'" + val + "'";
}
return () => valDefault;
defau... | javascript | function resolveValueOrNodeSkel(index, val, valDefault) {
switch (typeof(val)) {
case "string":
return resolveNodeSkel(index, val);
case "undefined":
if (valDefault === undefined) {
throw "Unable to get value'" + val + "'";
}
return () => valDefault;
defau... | [
"function",
"resolveValueOrNodeSkel",
"(",
"index",
",",
"val",
",",
"valDefault",
")",
"{",
"switch",
"(",
"typeof",
"(",
"val",
")",
")",
"{",
"case",
"\"string\"",
":",
"return",
"resolveNodeSkel",
"(",
"index",
",",
"val",
")",
";",
"case",
"\"undefine... | Helper function for getting either a value or data from another node, or return the default | [
"Helper",
"function",
"for",
"getting",
"either",
"a",
"value",
"or",
"data",
"from",
"another",
"node",
"or",
"return",
"the",
"default"
] | 69a1a86882f500d52839f544538014460709ba9e | https://github.com/joelahoover/nomv/blob/69a1a86882f500d52839f544538014460709ba9e/index.js#L602-L614 |
55,998 | joelahoover/nomv | index.js | initialize | function initialize() {
var scene = ds = exports.ds = {
"time": 0,
"song": null,
"graph": null,
"shaders": {},
"textures": {},
"texturesToLoad": 0,
"audio": { "loaded": false, "playing": false },
"isLoaded": function() {
return this.graph !== null && this.texturesToLoad === 0 && ... | javascript | function initialize() {
var scene = ds = exports.ds = {
"time": 0,
"song": null,
"graph": null,
"shaders": {},
"textures": {},
"texturesToLoad": 0,
"audio": { "loaded": false, "playing": false },
"isLoaded": function() {
return this.graph !== null && this.texturesToLoad === 0 && ... | [
"function",
"initialize",
"(",
")",
"{",
"var",
"scene",
"=",
"ds",
"=",
"exports",
".",
"ds",
"=",
"{",
"\"time\"",
":",
"0",
",",
"\"song\"",
":",
"null",
",",
"\"graph\"",
":",
"null",
",",
"\"shaders\"",
":",
"{",
"}",
",",
"\"textures\"",
":",
... | Scene object for debugging | [
"Scene",
"object",
"for",
"debugging"
] | 69a1a86882f500d52839f544538014460709ba9e | https://github.com/joelahoover/nomv/blob/69a1a86882f500d52839f544538014460709ba9e/index.js#L876-L898 |
55,999 | dimitrievski/sumov | lib/index.js | sumObjectValues | function sumObjectValues(object, depth, level = 1) {
let sum = 0;
for (const i in object) {
const value = object[i];
if (isNumber(value)) {
sum += parseFloat(value);
} else if (isObject(value) && (depth < 1 || depth > level)) {
sum += sumObjectValues(value, depth,... | javascript | function sumObjectValues(object, depth, level = 1) {
let sum = 0;
for (const i in object) {
const value = object[i];
if (isNumber(value)) {
sum += parseFloat(value);
} else if (isObject(value) && (depth < 1 || depth > level)) {
sum += sumObjectValues(value, depth,... | [
"function",
"sumObjectValues",
"(",
"object",
",",
"depth",
",",
"level",
"=",
"1",
")",
"{",
"let",
"sum",
"=",
"0",
";",
"for",
"(",
"const",
"i",
"in",
"object",
")",
"{",
"const",
"value",
"=",
"object",
"[",
"i",
"]",
";",
"if",
"(",
"isNumb... | Recursive function that computes the sum
of all numeric values in an object
@param {Object} object
@param {Integer} depth
@param {Integer} level
@returns {Number} | [
"Recursive",
"function",
"that",
"computes",
"the",
"sum",
"of",
"all",
"numeric",
"values",
"in",
"an",
"object"
] | bdbdae19305f9c7e86c2a9124b64d664c0893fab | https://github.com/dimitrievski/sumov/blob/bdbdae19305f9c7e86c2a9124b64d664c0893fab/lib/index.js#L37-L49 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.