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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
37,800 | lammas/tree-traversal | tree-traversal.js | traverseDepthFirst | function traverseDepthFirst(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
userdataAccessor: function(node, userdata) { return userdata; },
onNode: function(node, callback, userdata) { callback(); },
onComplete: function(rootNode) {},
userdata: ... | javascript | function traverseDepthFirst(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
userdataAccessor: function(node, userdata) { return userdata; },
onNode: function(node, callback, userdata) { callback(); },
onComplete: function(rootNode) {},
userdata: ... | [
"function",
"traverseDepthFirst",
"(",
"rootNode",
",",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"{",
"subnodesAccessor",
":",
"function",
"(",
"node",
")",
"{",
"return",
"node",
".",
"subnodes",
";",
"}",
",",
"userdataAccessor",
":",
"function"... | Asynchronously traverses the tree depth first. | [
"Asynchronously",
"traverses",
"the",
"tree",
"depth",
"first",
"."
] | ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47 | https://github.com/lammas/tree-traversal/blob/ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47/tree-traversal.js#L90-L126 |
37,801 | lammas/tree-traversal | tree-traversal.js | traverseDepthFirstSync | function traverseDepthFirstSync(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
userdataAccessor: function(node, userdata) { return userdata; },
onNode: function(node, userdata) {},
userdata: null
}, options);
var stack = [];
stack.push([rootN... | javascript | function traverseDepthFirstSync(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
userdataAccessor: function(node, userdata) { return userdata; },
onNode: function(node, userdata) {},
userdata: null
}, options);
var stack = [];
stack.push([rootN... | [
"function",
"traverseDepthFirstSync",
"(",
"rootNode",
",",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"{",
"subnodesAccessor",
":",
"function",
"(",
"node",
")",
"{",
"return",
"node",
".",
"subnodes",
";",
"}",
",",
"userdataAccessor",
":",
"funct... | Synchronously traverses the tree depth first. | [
"Synchronously",
"traverses",
"the",
"tree",
"depth",
"first",
"."
] | ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47 | https://github.com/lammas/tree-traversal/blob/ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47/tree-traversal.js#L131-L154 |
37,802 | lammas/tree-traversal | tree-traversal.js | traverseRecursive | function traverseRecursive(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
onNode: function(node, callback, userdata) {},
onComplete: function(rootNode) {},
userdata: null
}, options);
(function visitNode(node, callback) {
var subnodes = opt... | javascript | function traverseRecursive(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
onNode: function(node, callback, userdata) {},
onComplete: function(rootNode) {},
userdata: null
}, options);
(function visitNode(node, callback) {
var subnodes = opt... | [
"function",
"traverseRecursive",
"(",
"rootNode",
",",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"{",
"subnodesAccessor",
":",
"function",
"(",
"node",
")",
"{",
"return",
"node",
".",
"subnodes",
";",
"}",
",",
"onNode",
":",
"function",
"(",
... | Asynchronously traverses the tree recursively. | [
"Asynchronously",
"traverses",
"the",
"tree",
"recursively",
"."
] | ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47 | https://github.com/lammas/tree-traversal/blob/ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47/tree-traversal.js#L160-L183 |
37,803 | lammas/tree-traversal | tree-traversal.js | traverseRecursiveSync | function traverseRecursiveSync(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
onNode: function(node, userdata) {},
userdata: null
}, options);
(function visitNode(node) {
var subnodes = options.subnodesAccessor(node);
for (var i=0; i<subnod... | javascript | function traverseRecursiveSync(rootNode, options) {
options = extend({
subnodesAccessor: function(node) { return node.subnodes; },
onNode: function(node, userdata) {},
userdata: null
}, options);
(function visitNode(node) {
var subnodes = options.subnodesAccessor(node);
for (var i=0; i<subnod... | [
"function",
"traverseRecursiveSync",
"(",
"rootNode",
",",
"options",
")",
"{",
"options",
"=",
"extend",
"(",
"{",
"subnodesAccessor",
":",
"function",
"(",
"node",
")",
"{",
"return",
"node",
".",
"subnodes",
";",
"}",
",",
"onNode",
":",
"function",
"("... | Synchronously traverses the tree recursively. | [
"Synchronously",
"traverses",
"the",
"tree",
"recursively",
"."
] | ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47 | https://github.com/lammas/tree-traversal/blob/ca02a2a4308eb6cff27b0dd030fd8ccfb36b6e47/tree-traversal.js#L188-L204 |
37,804 | dalekjs/dalek-reporter-junit | index.js | Reporter | function Reporter (opts) {
this.events = opts.events;
this.config = opts.config;
this.testCount = 0;
this.testIdx = -1;
this.variationCount = -1;
this.data = {};
this.data.tests = [];
this.browser = null;
var defaultReportFolder = 'report';
this.dest = this.config.get('junit-reporter') && this.conf... | javascript | function Reporter (opts) {
this.events = opts.events;
this.config = opts.config;
this.testCount = 0;
this.testIdx = -1;
this.variationCount = -1;
this.data = {};
this.data.tests = [];
this.browser = null;
var defaultReportFolder = 'report';
this.dest = this.config.get('junit-reporter') && this.conf... | [
"function",
"Reporter",
"(",
"opts",
")",
"{",
"this",
".",
"events",
"=",
"opts",
".",
"events",
";",
"this",
".",
"config",
"=",
"opts",
".",
"config",
";",
"this",
".",
"testCount",
"=",
"0",
";",
"this",
".",
"testIdx",
"=",
"-",
"1",
";",
"t... | The jUnit reporter can produce a jUnit compatible file with the results of your testrun,
this reporter enables you to use daleks testresults within a CI environment like Jenkins.
The reporter can be installed with the following command:
```bash
$ npm install dalek-reporter-junit --save-dev
```
The file will follow t... | [
"The",
"jUnit",
"reporter",
"can",
"produce",
"a",
"jUnit",
"compatible",
"file",
"with",
"the",
"results",
"of",
"your",
"testrun",
"this",
"reporter",
"enables",
"you",
"to",
"use",
"daleks",
"testresults",
"within",
"a",
"CI",
"environment",
"like",
"Jenkin... | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L95-L120 |
37,805 | dalekjs/dalek-reporter-junit | index.js | function (name) {
this.testCount = 0;
this.testIdx++;
this.xml[0].children.push({
name: 'testsuite',
children: [],
attrs: {
name: name + ' [' + this.browser + ']',
}
});
return this;
} | javascript | function (name) {
this.testCount = 0;
this.testIdx++;
this.xml[0].children.push({
name: 'testsuite',
children: [],
attrs: {
name: name + ' [' + this.browser + ']',
}
});
return this;
} | [
"function",
"(",
"name",
")",
"{",
"this",
".",
"testCount",
"=",
"0",
";",
"this",
".",
"testIdx",
"++",
";",
"this",
".",
"xml",
"[",
"0",
"]",
".",
"children",
".",
"push",
"(",
"{",
"name",
":",
"'testsuite'",
",",
"children",
":",
"[",
"]",
... | Generates XML skeleton for testsuites
@method testsuiteStarted
@param {string} name Testsuite name
@chainable | [
"Generates",
"XML",
"skeleton",
"for",
"testsuites"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L175-L186 | |
37,806 | dalekjs/dalek-reporter-junit | index.js | function (data) {
if (! data.success) {
//var timestamp = Math.round(new Date().getTime() / 1000);
this.xml[0].children[this.testIdx].children[this.testCount].children.push({
name: 'failure',
attrs: {
name: data.type,
message: (data.message ? data.message : 'Expected... | javascript | function (data) {
if (! data.success) {
//var timestamp = Math.round(new Date().getTime() / 1000);
this.xml[0].children[this.testIdx].children[this.testCount].children.push({
name: 'failure',
attrs: {
name: data.type,
message: (data.message ? data.message : 'Expected... | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"!",
"data",
".",
"success",
")",
"{",
"//var timestamp = Math.round(new Date().getTime() / 1000);",
"this",
".",
"xml",
"[",
"0",
"]",
".",
"children",
"[",
"this",
".",
"testIdx",
"]",
".",
"children",
"[",
"... | Generates XML skeleton for an assertion
@method assertion
@param {object} data Event data
@chainable | [
"Generates",
"XML",
"skeleton",
"for",
"an",
"assertion"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L208-L227 | |
37,807 | dalekjs/dalek-reporter-junit | index.js | function (data) {
this.variationCount = -1;
this.xml[0].children[this.testIdx].children.push({
name: 'testcase',
children: [],
attrs: {
classname: this.xml[0].children[this.testIdx].attrs.name,
name: data.name
}
});
return this;
} | javascript | function (data) {
this.variationCount = -1;
this.xml[0].children[this.testIdx].children.push({
name: 'testcase',
children: [],
attrs: {
classname: this.xml[0].children[this.testIdx].attrs.name,
name: data.name
}
});
return this;
} | [
"function",
"(",
"data",
")",
"{",
"this",
".",
"variationCount",
"=",
"-",
"1",
";",
"this",
".",
"xml",
"[",
"0",
"]",
".",
"children",
"[",
"this",
".",
"testIdx",
"]",
".",
"children",
".",
"push",
"(",
"{",
"name",
":",
"'testcase'",
",",
"c... | Generates XML skeleton for a testcase
@method testStarted
@param {object} data Event data
@chainable | [
"Generates",
"XML",
"skeleton",
"for",
"a",
"testcase"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L237-L249 | |
37,808 | dalekjs/dalek-reporter-junit | index.js | function () {
//var timestamp = Math.round(new Date().getTime() / 1000);
if (this._checkNodeAttributes(this.testIdx, this.testCount)) {
this.xml[0].children[this.testIdx].children[this.testCount].attrs = {};
}
//this.xml[0].children[this.testIdx].children[this.testCount].attrs.end = timestamp;
... | javascript | function () {
//var timestamp = Math.round(new Date().getTime() / 1000);
if (this._checkNodeAttributes(this.testIdx, this.testCount)) {
this.xml[0].children[this.testIdx].children[this.testCount].attrs = {};
}
//this.xml[0].children[this.testIdx].children[this.testCount].attrs.end = timestamp;
... | [
"function",
"(",
")",
"{",
"//var timestamp = Math.round(new Date().getTime() / 1000);",
"if",
"(",
"this",
".",
"_checkNodeAttributes",
"(",
"this",
".",
"testIdx",
",",
"this",
".",
"testCount",
")",
")",
"{",
"this",
".",
"xml",
"[",
"0",
"]",
".",
"childre... | Finishes XML skeleton for a testcase
@method testFinished
@param {object} data Event data
@chainable | [
"Finishes",
"XML",
"skeleton",
"for",
"a",
"testcase"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L259-L278 | |
37,809 | dalekjs/dalek-reporter-junit | index.js | function (data) {
this.data.elapsedTime = data.elapsedTime;
this.data.status = data.status;
this.data.assertions = data.assertions;
this.data.assertionsFailed = data.assertionsFailed;
this.data.assertionsPassed = data.assertionsPassed;
var contents = jsonxml(this.xml, {escape: true, removeIlleg... | javascript | function (data) {
this.data.elapsedTime = data.elapsedTime;
this.data.status = data.status;
this.data.assertions = data.assertions;
this.data.assertionsFailed = data.assertionsFailed;
this.data.assertionsPassed = data.assertionsPassed;
var contents = jsonxml(this.xml, {escape: true, removeIlleg... | [
"function",
"(",
"data",
")",
"{",
"this",
".",
"data",
".",
"elapsedTime",
"=",
"data",
".",
"elapsedTime",
";",
"this",
".",
"data",
".",
"status",
"=",
"data",
".",
"status",
";",
"this",
".",
"data",
".",
"assertions",
"=",
"data",
".",
"assertio... | Finishes XML and writes file to the file system
@method runnerFinished
@param {object} data Event data
@chainable | [
"Finishes",
"XML",
"and",
"writes",
"file",
"to",
"the",
"file",
"system"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L288-L304 | |
37,810 | dalekjs/dalek-reporter-junit | index.js | function (path) {
var pathSep = require('path').sep;
var dirs = path.split(pathSep);
var root = '';
while (dirs.length > 0) {
var dir = dirs.shift();
if (dir === '') {
root = pathSep;
}
if (!fs.existsSync(root + dir)) {
fs.mkdirSync(root + dir);
}
roo... | javascript | function (path) {
var pathSep = require('path').sep;
var dirs = path.split(pathSep);
var root = '';
while (dirs.length > 0) {
var dir = dirs.shift();
if (dir === '') {
root = pathSep;
}
if (!fs.existsSync(root + dir)) {
fs.mkdirSync(root + dir);
}
roo... | [
"function",
"(",
"path",
")",
"{",
"var",
"pathSep",
"=",
"require",
"(",
"'path'",
")",
".",
"sep",
";",
"var",
"dirs",
"=",
"path",
".",
"split",
"(",
"pathSep",
")",
";",
"var",
"root",
"=",
"''",
";",
"while",
"(",
"dirs",
".",
"length",
">",... | Helper method to generate deeper nested directory structures
@method _recursiveMakeDirSync
@param {string} path PAth to create | [
"Helper",
"method",
"to",
"generate",
"deeper",
"nested",
"directory",
"structures"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L313-L328 | |
37,811 | dalekjs/dalek-reporter-junit | index.js | function (testIdx, testCount, variationCount) {
if (variationCount === undefined) {
return typeof this.xml[0].children[testIdx].children[testCount].attrs === 'undefined';
}
return typeof this.xml[0].children[testIdx].children[testCount].children[variationCount].attrs === 'undefined';
} | javascript | function (testIdx, testCount, variationCount) {
if (variationCount === undefined) {
return typeof this.xml[0].children[testIdx].children[testCount].attrs === 'undefined';
}
return typeof this.xml[0].children[testIdx].children[testCount].children[variationCount].attrs === 'undefined';
} | [
"function",
"(",
"testIdx",
",",
"testCount",
",",
"variationCount",
")",
"{",
"if",
"(",
"variationCount",
"===",
"undefined",
")",
"{",
"return",
"typeof",
"this",
".",
"xml",
"[",
"0",
"]",
".",
"children",
"[",
"testIdx",
"]",
".",
"children",
"[",
... | Helper method to check if attributes should be set to an empty object literal
@method _checkNodeAttributes
@param {string} testIdx Id of the test node
@param {string} testCount Id of the child node
@param {string} variationCount Id of the testCount child node | [
"Helper",
"method",
"to",
"check",
"if",
"attributes",
"should",
"be",
"set",
"to",
"an",
"empty",
"object",
"literal"
] | af67e4716ad02b911f450d0a0333e0e7d92752df | https://github.com/dalekjs/dalek-reporter-junit/blob/af67e4716ad02b911f450d0a0333e0e7d92752df/index.js#L339-L345 | |
37,812 | folktale/control.async | lib/core.js | resolveFuture | function resolveFuture(reject, resolve) {
state = STARTED
return future.fork( function(error) { state = REJECTED
value = error
invokePending('rejected', error)
return reject(er... | javascript | function resolveFuture(reject, resolve) {
state = STARTED
return future.fork( function(error) { state = REJECTED
value = error
invokePending('rejected', error)
return reject(er... | [
"function",
"resolveFuture",
"(",
"reject",
",",
"resolve",
")",
"{",
"state",
"=",
"STARTED",
"return",
"future",
".",
"fork",
"(",
"function",
"(",
"error",
")",
"{",
"state",
"=",
"REJECTED",
"value",
"=",
"error",
"invokePending",
"(",
"'rejected'",
",... | Resolves the future, places the machine in a resolved state, and invokes all pending operations. | [
"Resolves",
"the",
"future",
"places",
"the",
"machine",
"in",
"a",
"resolved",
"state",
"and",
"invokes",
"all",
"pending",
"operations",
"."
] | 83f4d2a16cb3d2739ee58ae69372deb53fc38835 | https://github.com/folktale/control.async/blob/83f4d2a16cb3d2739ee58ae69372deb53fc38835/lib/core.js#L92-L102 |
37,813 | folktale/control.async | lib/core.js | invokePending | function invokePending(kind, data) {
var xs = pending
pending.length = 0
for (var i = 0; i < xs.length; ++i) xs[i][kind](value) } | javascript | function invokePending(kind, data) {
var xs = pending
pending.length = 0
for (var i = 0; i < xs.length; ++i) xs[i][kind](value) } | [
"function",
"invokePending",
"(",
"kind",
",",
"data",
")",
"{",
"var",
"xs",
"=",
"pending",
"pending",
".",
"length",
"=",
"0",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"xs",
".",
"length",
";",
"++",
"i",
")",
"xs",
"[",
"i",
"]",
... | Invokes all pending operations. | [
"Invokes",
"all",
"pending",
"operations",
"."
] | 83f4d2a16cb3d2739ee58ae69372deb53fc38835 | https://github.com/folktale/control.async/blob/83f4d2a16cb3d2739ee58ae69372deb53fc38835/lib/core.js#L105-L108 |
37,814 | dsfields/elv | lib/index.js | function (val) {
return (!behavior.enableUndefined || typeof val !== 'undefined')
&& (!behavior.enableNull || val !== null)
&& (!behavior.enableFalse || val !== false)
&& (!behavior.enableNaN || !Number.isNaN(val));
} | javascript | function (val) {
return (!behavior.enableUndefined || typeof val !== 'undefined')
&& (!behavior.enableNull || val !== null)
&& (!behavior.enableFalse || val !== false)
&& (!behavior.enableNaN || !Number.isNaN(val));
} | [
"function",
"(",
"val",
")",
"{",
"return",
"(",
"!",
"behavior",
".",
"enableUndefined",
"||",
"typeof",
"val",
"!==",
"'undefined'",
")",
"&&",
"(",
"!",
"behavior",
".",
"enableNull",
"||",
"val",
"!==",
"null",
")",
"&&",
"(",
"!",
"behavior",
".",... | Checks if the provided value is defined.
@method
@param {*} val - The value on which to perform an existential check.
@returns {boolean} | [
"Checks",
"if",
"the",
"provided",
"value",
"is",
"defined",
"."
] | c603170c645b6ad0c2df6d7f8ba572bf77821ede | https://github.com/dsfields/elv/blob/c603170c645b6ad0c2df6d7f8ba572bf77821ede/lib/index.js#L21-L26 | |
37,815 | cgiffard/SteamShovel | lib/instrumentor.js | function (node) {
// Does this node have a body? If so we can replace its contents.
if (node.body && node.body.length) {
node.body =
[].slice.call(node.body, 0)
.reduce(function(body, node) {
if (!~allowedPrepend.indexOf(node.type))
return body.concat(node);
id++;
sourceM... | javascript | function (node) {
// Does this node have a body? If so we can replace its contents.
if (node.body && node.body.length) {
node.body =
[].slice.call(node.body, 0)
.reduce(function(body, node) {
if (!~allowedPrepend.indexOf(node.type))
return body.concat(node);
id++;
sourceM... | [
"function",
"(",
"node",
")",
"{",
"// Does this node have a body? If so we can replace its contents.",
"if",
"(",
"node",
".",
"body",
"&&",
"node",
".",
"body",
".",
"length",
")",
"{",
"node",
".",
"body",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
... | Leave is where we replace the actual nodes. | [
"Leave",
"is",
"where",
"we",
"replace",
"the",
"actual",
"nodes",
"."
] | 7c9a4baf4e1f9390b352742ab26a6900c78b6e25 | https://github.com/cgiffard/SteamShovel/blob/7c9a4baf4e1f9390b352742ab26a6900c78b6e25/lib/instrumentor.js#L102-L138 | |
37,816 | OriR/interpolate-loader-options-webpack-plugin | index.js | interpolatedOptions | function interpolatedOptions(options, context, source, hierarchy = '') {
Object.keys(options).forEach((key) => {
if (typeof options[key] === 'object') {
interpolatedOptions(options[key], context, source, `${hierarchy}.${key}`);
}
else if (typeof opti... | javascript | function interpolatedOptions(options, context, source, hierarchy = '') {
Object.keys(options).forEach((key) => {
if (typeof options[key] === 'object') {
interpolatedOptions(options[key], context, source, `${hierarchy}.${key}`);
}
else if (typeof opti... | [
"function",
"interpolatedOptions",
"(",
"options",
",",
"context",
",",
"source",
",",
"hierarchy",
"=",
"''",
")",
"{",
"Object",
".",
"keys",
"(",
"options",
")",
".",
"forEach",
"(",
"(",
"key",
")",
"=>",
"{",
"if",
"(",
"typeof",
"options",
"[",
... | Interpolating all the string values in the options object. | [
"Interpolating",
"all",
"the",
"string",
"values",
"in",
"the",
"options",
"object",
"."
] | 8b8f6e315f7d606a4fbcf4f473e75c4e26d287df | https://github.com/OriR/interpolate-loader-options-webpack-plugin/blob/8b8f6e315f7d606a4fbcf4f473e75c4e26d287df/index.js#L38-L48 |
37,817 | impromptu/impromptu | lib/exec.js | Executable | function Executable(log, command) {
/** @type {string} */
this.command = command
/** @type {Array.<function(Error, Buffer, Buffer)>} */
this.callbacks = []
/** @type {Arguments} */
this.results = null
var startTime = Date.now()
child_process.exec(this.command, function() {
var timeDiff = `${Date.... | javascript | function Executable(log, command) {
/** @type {string} */
this.command = command
/** @type {Array.<function(Error, Buffer, Buffer)>} */
this.callbacks = []
/** @type {Arguments} */
this.results = null
var startTime = Date.now()
child_process.exec(this.command, function() {
var timeDiff = `${Date.... | [
"function",
"Executable",
"(",
"log",
",",
"command",
")",
"{",
"/** @type {string} */",
"this",
".",
"command",
"=",
"command",
"/** @type {Array.<function(Error, Buffer, Buffer)>} */",
"this",
".",
"callbacks",
"=",
"[",
"]",
"/** @type {Arguments} */",
"this",
".",
... | A memoized executable command. The first time the command is run, the results are stored.
Callbacks are tracked while the command is running to avoid race conditions.
@constructor
@param {Log} log A logging instance.
@param {string} command The command to execute. | [
"A",
"memoized",
"executable",
"command",
".",
"The",
"first",
"time",
"the",
"command",
"is",
"run",
"the",
"results",
"are",
"stored",
".",
"Callbacks",
"are",
"tracked",
"while",
"the",
"command",
"is",
"running",
"to",
"avoid",
"race",
"conditions",
"."
... | 829798eda62771d6a6ed971d87eef7a461932704 | https://github.com/impromptu/impromptu/blob/829798eda62771d6a6ed971d87eef7a461932704/lib/exec.js#L23-L45 |
37,818 | impromptu/impromptu | lib/exec.js | execute | function execute(log, command, opt_callback) {
if (!registry[command]) {
registry[command] = new Executable(log, command)
}
var executable = registry[command]
if (opt_callback) executable.addCallback(opt_callback)
} | javascript | function execute(log, command, opt_callback) {
if (!registry[command]) {
registry[command] = new Executable(log, command)
}
var executable = registry[command]
if (opt_callback) executable.addCallback(opt_callback)
} | [
"function",
"execute",
"(",
"log",
",",
"command",
",",
"opt_callback",
")",
"{",
"if",
"(",
"!",
"registry",
"[",
"command",
"]",
")",
"{",
"registry",
"[",
"command",
"]",
"=",
"new",
"Executable",
"(",
"log",
",",
"command",
")",
"}",
"var",
"exec... | Executes a memoized command and triggers the callback on a result.
@param {Log} log
@param {string} command
@param {function(Error, Buffer, Buffer)=} opt_callback | [
"Executes",
"a",
"memoized",
"command",
"and",
"triggers",
"the",
"callback",
"on",
"a",
"result",
"."
] | 829798eda62771d6a6ed971d87eef7a461932704 | https://github.com/impromptu/impromptu/blob/829798eda62771d6a6ed971d87eef7a461932704/lib/exec.js#L65-L72 |
37,819 | typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation | template/copy/script/navigation/enhancednav.js | deserializeNavState | function deserializeNavState()
{
var navID = $('.navigation .nav-accordion-menu').data('nav-id');
if (sessionStorage)
{
var checkboxMap = sessionStorage.getItem(navID + '-accordion-state');
// If there is no data in session storage then create an empty map.
if (checkbox... | javascript | function deserializeNavState()
{
var navID = $('.navigation .nav-accordion-menu').data('nav-id');
if (sessionStorage)
{
var checkboxMap = sessionStorage.getItem(navID + '-accordion-state');
// If there is no data in session storage then create an empty map.
if (checkbox... | [
"function",
"deserializeNavState",
"(",
")",
"{",
"var",
"navID",
"=",
"$",
"(",
"'.navigation .nav-accordion-menu'",
")",
".",
"data",
"(",
"'nav-id'",
")",
";",
"if",
"(",
"sessionStorage",
")",
"{",
"var",
"checkboxMap",
"=",
"sessionStorage",
".",
"getItem... | Deserializes navigation accordion state from session storage. | [
"Deserializes",
"navigation",
"accordion",
"state",
"from",
"session",
"storage",
"."
] | db25fb3e570fbae97bedf06fe4daf4d51e4c788b | https://github.com/typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation/blob/db25fb3e570fbae97bedf06fe4daf4d51e4c788b/template/copy/script/navigation/enhancednav.js#L27-L56 |
37,820 | typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation | template/copy/script/navigation/enhancednav.js | hideNavContextMenu | function hideNavContextMenu(event)
{
var contextMenuButton = $('#context-menu');
var popupmenu = $('#contextpopup .mdl-menu__container');
// If an event is defined then make sure it isn't targeting the context menu.
if (event)
{
// Picked element is not the menu
if (!... | javascript | function hideNavContextMenu(event)
{
var contextMenuButton = $('#context-menu');
var popupmenu = $('#contextpopup .mdl-menu__container');
// If an event is defined then make sure it isn't targeting the context menu.
if (event)
{
// Picked element is not the menu
if (!... | [
"function",
"hideNavContextMenu",
"(",
"event",
")",
"{",
"var",
"contextMenuButton",
"=",
"$",
"(",
"'#context-menu'",
")",
";",
"var",
"popupmenu",
"=",
"$",
"(",
"'#contextpopup .mdl-menu__container'",
")",
";",
"// If an event is defined then make sure it isn't target... | Hides the nav context menu if visible. If an event is supplied it is checked against any existing context menu
and is ignored if the context menu is within the parent hierarchy.
@param {object|undefined} event - Optional event | [
"Hides",
"the",
"nav",
"context",
"menu",
"if",
"visible",
".",
"If",
"an",
"event",
"is",
"supplied",
"it",
"is",
"checked",
"against",
"any",
"existing",
"context",
"menu",
"and",
"is",
"ignored",
"if",
"the",
"context",
"menu",
"is",
"within",
"the",
... | db25fb3e570fbae97bedf06fe4daf4d51e4c788b | https://github.com/typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation/blob/db25fb3e570fbae97bedf06fe4daf4d51e4c788b/template/copy/script/navigation/enhancednav.js#L64-L84 |
37,821 | typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation | template/copy/script/navigation/enhancednav.js | onNavContextClick | function onNavContextClick(event)
{
// Hides any existing nav context menu.
hideNavContextMenu(event);
var target = $(this);
var packageLink = target.data('package-link');
var packageType = target.data('package-type') || '...';
// Create proper name for package type.
swit... | javascript | function onNavContextClick(event)
{
// Hides any existing nav context menu.
hideNavContextMenu(event);
var target = $(this);
var packageLink = target.data('package-link');
var packageType = target.data('package-type') || '...';
// Create proper name for package type.
swit... | [
"function",
"onNavContextClick",
"(",
"event",
")",
"{",
"// Hides any existing nav context menu.",
"hideNavContextMenu",
"(",
"event",
")",
";",
"var",
"target",
"=",
"$",
"(",
"this",
")",
";",
"var",
"packageLink",
"=",
"target",
".",
"data",
"(",
"'package-l... | Shows the nav context menu
@param {object} event - jQuery mouse event | [
"Shows",
"the",
"nav",
"context",
"menu"
] | db25fb3e570fbae97bedf06fe4daf4d51e4c788b | https://github.com/typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation/blob/db25fb3e570fbae97bedf06fe4daf4d51e4c788b/template/copy/script/navigation/enhancednav.js#L91-L193 |
37,822 | typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation | template/copy/script/navigation/enhancednav.js | serializeNavState | function serializeNavState()
{
var checkboxMap = {};
$('.navigation .nav-accordion-menu').find('input[type="checkbox"]').each(function()
{
checkboxMap[$(this).attr('name')] = $(this).is(':checked');
});
var navID = $('.navigation .nav-accordion-menu').data('nav-id');
i... | javascript | function serializeNavState()
{
var checkboxMap = {};
$('.navigation .nav-accordion-menu').find('input[type="checkbox"]').each(function()
{
checkboxMap[$(this).attr('name')] = $(this).is(':checked');
});
var navID = $('.navigation .nav-accordion-menu').data('nav-id');
i... | [
"function",
"serializeNavState",
"(",
")",
"{",
"var",
"checkboxMap",
"=",
"{",
"}",
";",
"$",
"(",
"'.navigation .nav-accordion-menu'",
")",
".",
"find",
"(",
"'input[type=\"checkbox\"]'",
")",
".",
"each",
"(",
"function",
"(",
")",
"{",
"checkboxMap",
"[",
... | Serializes to session storage the navigation menu accordion state. | [
"Serializes",
"to",
"session",
"storage",
"the",
"navigation",
"menu",
"accordion",
"state",
"."
] | db25fb3e570fbae97bedf06fe4daf4d51e4c788b | https://github.com/typhonjs-node-esdoc/esdoc-plugin-enhanced-navigation/blob/db25fb3e570fbae97bedf06fe4daf4d51e4c788b/template/copy/script/navigation/enhancednav.js#L219-L231 |
37,823 | mattdesl/webgl-compile-shader | index.js | compile | function compile(gl, vertSource, fragSource, attribs, verbose) {
var log = "";
var vert = loadShader(gl, gl.VERTEX_SHADER, vertSource, verbose);
var frag = loadShader(gl, gl.FRAGMENT_SHADER, fragSource, verbose);
var vertShader = vert.shader;
var fragShader = frag.shader;
log += vert.log + "\... | javascript | function compile(gl, vertSource, fragSource, attribs, verbose) {
var log = "";
var vert = loadShader(gl, gl.VERTEX_SHADER, vertSource, verbose);
var frag = loadShader(gl, gl.FRAGMENT_SHADER, fragSource, verbose);
var vertShader = vert.shader;
var fragShader = frag.shader;
log += vert.log + "\... | [
"function",
"compile",
"(",
"gl",
",",
"vertSource",
",",
"fragSource",
",",
"attribs",
",",
"verbose",
")",
"{",
"var",
"log",
"=",
"\"\"",
";",
"var",
"vert",
"=",
"loadShader",
"(",
"gl",
",",
"gl",
".",
"VERTEX_SHADER",
",",
"vertSource",
",",
"ver... | Compiles the shaders, throwing an error if the program was invalid. | [
"Compiles",
"the",
"shaders",
"throwing",
"an",
"error",
"if",
"the",
"program",
"was",
"invalid",
"."
] | 0d8f658c19f4e4414504b4304314ca3b8286433e | https://github.com/mattdesl/webgl-compile-shader/blob/0d8f658c19f4e4414504b4304314ca3b8286433e/index.js#L20-L70 |
37,824 | byron-dupreez/aws-core-utils | kms-utils.js | encrypt | function encrypt(kms, params, logger) {
logger = logger || console;
const startMs = Date.now();
return kms.encrypt(params).promise().then(
result => {
if (logger.traceEnabled) logger.trace(`KMS encrypt success took ${Date.now() - startMs} ms`);
return result;
},
err => {
logger.error... | javascript | function encrypt(kms, params, logger) {
logger = logger || console;
const startMs = Date.now();
return kms.encrypt(params).promise().then(
result => {
if (logger.traceEnabled) logger.trace(`KMS encrypt success took ${Date.now() - startMs} ms`);
return result;
},
err => {
logger.error... | [
"function",
"encrypt",
"(",
"kms",
",",
"params",
",",
"logger",
")",
"{",
"logger",
"=",
"logger",
"||",
"console",
";",
"const",
"startMs",
"=",
"Date",
".",
"now",
"(",
")",
";",
"return",
"kms",
".",
"encrypt",
"(",
"params",
")",
".",
"promise",... | Encrypts the plaintext within the given KMS parameters using the given AWS.KMS instance & returns the KMS result.
@param {AWS.KMS} kms - an AWS.KMS instance to use
@param {KMSEncryptParams} params - the KMS encrypt parameters to use
@param {Logger|console|undefined} [logger] - an optional logger to use (defaults to con... | [
"Encrypts",
"the",
"plaintext",
"within",
"the",
"given",
"KMS",
"parameters",
"using",
"the",
"given",
"AWS",
".",
"KMS",
"instance",
"&",
"returns",
"the",
"KMS",
"result",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/kms-utils.js#L22-L35 |
37,825 | byron-dupreez/aws-core-utils | kms-utils.js | encryptKey | function encryptKey(kms, keyId, plaintext, logger) {
const params = {KeyId: keyId, Plaintext: plaintext};
return encrypt(kms, params, logger).then(result => result.CiphertextBlob && result.CiphertextBlob.toString('base64'));
} | javascript | function encryptKey(kms, keyId, plaintext, logger) {
const params = {KeyId: keyId, Plaintext: plaintext};
return encrypt(kms, params, logger).then(result => result.CiphertextBlob && result.CiphertextBlob.toString('base64'));
} | [
"function",
"encryptKey",
"(",
"kms",
",",
"keyId",
",",
"plaintext",
",",
"logger",
")",
"{",
"const",
"params",
"=",
"{",
"KeyId",
":",
"keyId",
",",
"Plaintext",
":",
"plaintext",
"}",
";",
"return",
"encrypt",
"(",
"kms",
",",
"params",
",",
"logge... | Encrypts the given plaintext using the given AWS.KMS instance & returns the encrypted ciphertext.
@param {AWS.KMS} kms - an AWS.KMS instance to use
@param {string} keyId - the identifier of the CMK to use for encryption. You can use the key ID or Amazon Resource Name (ARN) of the CMK, or the name or ARN of an alias tha... | [
"Encrypts",
"the",
"given",
"plaintext",
"using",
"the",
"given",
"AWS",
".",
"KMS",
"instance",
"&",
"returns",
"the",
"encrypted",
"ciphertext",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/kms-utils.js#L67-L70 |
37,826 | byron-dupreez/aws-core-utils | kms-utils.js | decryptKey | function decryptKey(kms, ciphertextBase64, logger) {
const params = {CiphertextBlob: new Buffer(ciphertextBase64, 'base64')};
return decrypt(kms, params, logger).then(result => result.Plaintext && result.Plaintext.toString('utf8'));
} | javascript | function decryptKey(kms, ciphertextBase64, logger) {
const params = {CiphertextBlob: new Buffer(ciphertextBase64, 'base64')};
return decrypt(kms, params, logger).then(result => result.Plaintext && result.Plaintext.toString('utf8'));
} | [
"function",
"decryptKey",
"(",
"kms",
",",
"ciphertextBase64",
",",
"logger",
")",
"{",
"const",
"params",
"=",
"{",
"CiphertextBlob",
":",
"new",
"Buffer",
"(",
"ciphertextBase64",
",",
"'base64'",
")",
"}",
";",
"return",
"decrypt",
"(",
"kms",
",",
"par... | Decrypts the given ciphertext in base 64 using the given AWS.KMS instance & returns the decrypted plaintext.
@param {AWS.KMS} kms - an AWS.KMS instance to use
@param {string} ciphertextBase64 - the encrypted ciphertext in base 64 encoding
@param {Logger|console|undefined} [logger] - an optional logger to use (defaults ... | [
"Decrypts",
"the",
"given",
"ciphertext",
"in",
"base",
"64",
"using",
"the",
"given",
"AWS",
".",
"KMS",
"instance",
"&",
"returns",
"the",
"decrypted",
"plaintext",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/kms-utils.js#L79-L82 |
37,827 | zerobias/humint | index.js | genericLog | function genericLog(logger, moduletag, logLevel='info'){
const isDebug = logLevel==='debug'
const level = isDebug
? 'info'
: logLevel
const levelLogger = logger[level]
const active = isDebug
? enabled(moduletag)
: true
/**
* tagged Logger
* @function taggedLog
* @param {...string} ta... | javascript | function genericLog(logger, moduletag, logLevel='info'){
const isDebug = logLevel==='debug'
const level = isDebug
? 'info'
: logLevel
const levelLogger = logger[level]
const active = isDebug
? enabled(moduletag)
: true
/**
* tagged Logger
* @function taggedLog
* @param {...string} ta... | [
"function",
"genericLog",
"(",
"logger",
",",
"moduletag",
",",
"logLevel",
"=",
"'info'",
")",
"{",
"const",
"isDebug",
"=",
"logLevel",
"===",
"'debug'",
"const",
"level",
"=",
"isDebug",
"?",
"'info'",
":",
"logLevel",
"const",
"levelLogger",
"=",
"logger... | Allow to select log level
@function genericLog
@param {LoggerInstance} logger Winston logger instance
@param {string} moduletag Module tag name
@param {string} logLevel Log level | [
"Allow",
"to",
"select",
"log",
"level"
] | e4074de0a6e972b651a3d38c722cb5d28a24a548 | https://github.com/zerobias/humint/blob/e4074de0a6e972b651a3d38c722cb5d28a24a548/index.js#L77-L151 |
37,828 | zerobias/humint | index.js | mapLog | function mapLog(...tags) {
/**
* Array logge Prinst every value on separated line
* @function printArray
* @param {Array} message Printed list
* @returns {Array}
*/
function printArray(message) {
if (active) {
arrayCheck(message)
const tag = normalizeDefaults(tags)... | javascript | function mapLog(...tags) {
/**
* Array logge Prinst every value on separated line
* @function printArray
* @param {Array} message Printed list
* @returns {Array}
*/
function printArray(message) {
if (active) {
arrayCheck(message)
const tag = normalizeDefaults(tags)... | [
"function",
"mapLog",
"(",
"...",
"tags",
")",
"{",
"/**\n * Array logge Prinst every value on separated line\n * @function printArray\n * @param {Array} message Printed list\n * @returns {Array}\n */",
"function",
"printArray",
"(",
"message",
")",
"{",
"if",
"(",
... | Array logge Prinst every value on separated line
@function mapLog
@param {...string} tags Optional message tags | [
"Array",
"logge",
"Prinst",
"every",
"value",
"on",
"separated",
"line"
] | e4074de0a6e972b651a3d38c722cb5d28a24a548 | https://github.com/zerobias/humint/blob/e4074de0a6e972b651a3d38c722cb5d28a24a548/index.js#L115-L148 |
37,829 | zerobias/humint | index.js | Logger | function Logger(moduletag) {
const trimmedModule = trim(moduletag)
winston.loggers.add(trimmedModule, {
console: {
colorize: true,
label : trimmedModule
}
})
const logger = winston.loggers.get(trimmedModule)
const defs = genericLog(logger, trimmedModule)
defs.warn = genericLog(logger, ... | javascript | function Logger(moduletag) {
const trimmedModule = trim(moduletag)
winston.loggers.add(trimmedModule, {
console: {
colorize: true,
label : trimmedModule
}
})
const logger = winston.loggers.get(trimmedModule)
const defs = genericLog(logger, trimmedModule)
defs.warn = genericLog(logger, ... | [
"function",
"Logger",
"(",
"moduletag",
")",
"{",
"const",
"trimmedModule",
"=",
"trim",
"(",
"moduletag",
")",
"winston",
".",
"loggers",
".",
"add",
"(",
"trimmedModule",
",",
"{",
"console",
":",
"{",
"colorize",
":",
"true",
",",
"label",
":",
"trimm... | Logging function based on winston library
@function Logger
@param {string} moduletag Name of apps module | [
"Logging",
"function",
"based",
"on",
"winston",
"library"
] | e4074de0a6e972b651a3d38c722cb5d28a24a548 | https://github.com/zerobias/humint/blob/e4074de0a6e972b651a3d38c722cb5d28a24a548/index.js#L157-L172 |
37,830 | byron-dupreez/aws-core-utils | lambdas.js | getInvokedFunctionArnFunctionName | function getInvokedFunctionArnFunctionName(awsContext) {
const invokedFunctionArn = awsContext && awsContext.invokedFunctionArn;
const resources = getArnResources(invokedFunctionArn);
return resources.resource;
} | javascript | function getInvokedFunctionArnFunctionName(awsContext) {
const invokedFunctionArn = awsContext && awsContext.invokedFunctionArn;
const resources = getArnResources(invokedFunctionArn);
return resources.resource;
} | [
"function",
"getInvokedFunctionArnFunctionName",
"(",
"awsContext",
")",
"{",
"const",
"invokedFunctionArn",
"=",
"awsContext",
"&&",
"awsContext",
".",
"invokedFunctionArn",
";",
"const",
"resources",
"=",
"getArnResources",
"(",
"invokedFunctionArn",
")",
";",
"return... | Extracts and returns the function name from the given AWS context's invokedFunctionArn.
@param {AWSContext} awsContext - the AWS context
@returns {string} the extracted function name | [
"Extracts",
"and",
"returns",
"the",
"function",
"name",
"from",
"the",
"given",
"AWS",
"context",
"s",
"invokedFunctionArn",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/lambdas.js#L59-L63 |
37,831 | CodeMan99/wotblitz.js | wotblitz.js | function(search, type, limit, fields) {
if (!search) return Promise.reject(new Error('wotblitz.account.list: search is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/account/list/'
}, {
fields: fields ? fields.toString() : '',
limit: limit,
search: search,
type: type
});
} | javascript | function(search, type, limit, fields) {
if (!search) return Promise.reject(new Error('wotblitz.account.list: search is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/account/list/'
}, {
fields: fields ? fields.toString() : '',
limit: limit,
search: search,
type: type
});
} | [
"function",
"(",
"search",
",",
"type",
",",
"limit",
",",
"fields",
")",
"{",
"if",
"(",
"!",
"search",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.account.list: search is required'",
")",
")",
";",
"return",
"request",
"... | Search for a player.
@param {string} search value to match usernames
@param {string} [type] how to match, "startswith" or "exact"
@param {number} [limit] maximum number of entries to match
@param {string|string[]} [fields] response selection
@returns {Promise<Object[]> resolves to an array of matching accounts | [
"Search",
"for",
"a",
"player",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L158-L170 | |
37,832 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, expires_at) {
if (!access_token) return Promise.reject(new Error('wotblitz.auth.prolongate: access_token is required'));
return request({
hostname: hosts.wot,
path: '/wot/auth/prolongate/'
}, {
access_token: access_token,
expires_at: expires_at || 14 * 24 * 60 * 60 // 14 days i... | javascript | function(access_token, expires_at) {
if (!access_token) return Promise.reject(new Error('wotblitz.auth.prolongate: access_token is required'));
return request({
hostname: hosts.wot,
path: '/wot/auth/prolongate/'
}, {
access_token: access_token,
expires_at: expires_at || 14 * 24 * 60 * 60 // 14 days i... | [
"function",
"(",
"access_token",
",",
"expires_at",
")",
"{",
"if",
"(",
"!",
"access_token",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.auth.prolongate: access_token is required'",
")",
")",
";",
"return",
"request",
"(",
"{",... | Access token extension
@param {string} access_token user's authentication string
@param {number} [expires_at] date or time span of expiration (default: 14 days)
@returns {Promise<Object>} resolves to the new token and related information | [
"Access",
"token",
"extension"
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L264-L274 | |
37,833 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, message_id, filters, fields) {
if (!access_token) return Promise.reject(new Error('wotblitz.clanmessages.messages: access_token is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/messages/'
}, Object.assign({
access_token: access_token,
message_id:... | javascript | function(access_token, message_id, filters, fields) {
if (!access_token) return Promise.reject(new Error('wotblitz.clanmessages.messages: access_token is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/messages/'
}, Object.assign({
access_token: access_token,
message_id:... | [
"function",
"(",
"access_token",
",",
"message_id",
",",
"filters",
",",
"fields",
")",
"{",
"if",
"(",
"!",
"access_token",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.clanmessages.messages: access_token is required'",
")",
")",
... | The text and meta data of all conversation.
@param {string} access_token user's authentication string
@param {number} [message_id] a specific message
@param {Object} [filters] options
@param {number} [filters.page_no] which page
@param {number} [filters.limit] how many per page
@param {string|string[]} [filters.order_... | [
"The",
"text",
"and",
"meta",
"data",
"of",
"all",
"conversation",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L311-L324 | |
37,834 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, title, text, type, importance, expires_at) {
if (!expires_at) return Promise.reject(new Error('wotblitz.clanmessages.create: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/create/'
}, {
access_token: access_token,
expires_at: exp... | javascript | function(access_token, title, text, type, importance, expires_at) {
if (!expires_at) return Promise.reject(new Error('wotblitz.clanmessages.create: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/create/'
}, {
access_token: access_token,
expires_at: exp... | [
"function",
"(",
"access_token",
",",
"title",
",",
"text",
",",
"type",
",",
"importance",
",",
"expires_at",
")",
"{",
"if",
"(",
"!",
"expires_at",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.clanmessages.create: all argume... | Post a new message.
@param {string} access_token user's authentication string
@param {string} title message topic
@param {string} text message body
@param {string} type message category, values "general", "training", "meeting", or "battle"
@param {string} importance values "important" or "standard"
@param {string} exp... | [
"Post",
"a",
"new",
"message",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L336-L350 | |
37,835 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, message_id) {
if (!message_id) return Promise.reject(new Error('wotblitz.clanmessages.delete: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/delete/'
}, {
access_token: access_token,
message_id: message_id
});
} | javascript | function(access_token, message_id) {
if (!message_id) return Promise.reject(new Error('wotblitz.clanmessages.delete: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/delete/'
}, {
access_token: access_token,
message_id: message_id
});
} | [
"function",
"(",
"access_token",
",",
"message_id",
")",
"{",
"if",
"(",
"!",
"message_id",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.clanmessages.delete: all arguments are required'",
")",
")",
";",
"return",
"request",
"(",
... | Remove a message.
@param {string} access_token user's authentication string
@param {number} message_id exactly this message
@returns {Promise<Object>} resolves to an empty object | [
"Remove",
"a",
"message",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L358-L368 | |
37,836 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, message_id, action) {
if (!action) return Promise.reject(new Error('wotblitz.clanmessages.like: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/like/'
}, {
access_token,
action: action,
message_id: message_id
});
} | javascript | function(access_token, message_id, action) {
if (!action) return Promise.reject(new Error('wotblitz.clanmessages.like: all arguments are required'));
return request({
hostname: hosts.wotb,
path: '/wotb/clanmessages/like/'
}, {
access_token,
action: action,
message_id: message_id
});
} | [
"function",
"(",
"access_token",
",",
"message_id",
",",
"action",
")",
"{",
"if",
"(",
"!",
"action",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.clanmessages.like: all arguments are required'",
")",
")",
";",
"return",
"reques... | Set like value on a message.
@param {string} access_token user's authentication string
@param {number} message_id exactly this message
@param {string} action literally "add" or "remove"
@returns {Promise<Object>} resolves to an empty object | [
"Set",
"like",
"value",
"on",
"a",
"message",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L377-L388 | |
37,837 | CodeMan99/wotblitz.js | wotblitz.js | function(access_token, message_id, fields) {
if (!access_token) return Promise.reject(new Error('wotblitz.clanmessages.likes: access_token is required'));
if (!message_id) return Promise.reject(new Error('wotblitz.clanmessages.likes: message_id is required'));
return request({
hostname: hosts.wotb,
path: '... | javascript | function(access_token, message_id, fields) {
if (!access_token) return Promise.reject(new Error('wotblitz.clanmessages.likes: access_token is required'));
if (!message_id) return Promise.reject(new Error('wotblitz.clanmessages.likes: message_id is required'));
return request({
hostname: hosts.wotb,
path: '... | [
"function",
"(",
"access_token",
",",
"message_id",
",",
"fields",
")",
"{",
"if",
"(",
"!",
"access_token",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.clanmessages.likes: access_token is required'",
")",
")",
";",
"if",
"(",
... | All likes on a message.
@params {string} access_token user's authentication string
@params {number} message_id exactly this message
@params {string|string[]} [fields] response selection
@returns {Promise<Object[]>} resolves to list of by whom and when a like was added | [
"All",
"likes",
"on",
"a",
"message",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L397-L409 | |
37,838 | CodeMan99/wotblitz.js | wotblitz.js | function(search, page_no, limit, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/clans/list/'
}, {
search: search,
page_no: page_no,
limit: limit,
fields: fields ? fields.toString() : ''
});
} | javascript | function(search, page_no, limit, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/clans/list/'
}, {
search: search,
page_no: page_no,
limit: limit,
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"search",
",",
"page_no",
",",
"limit",
",",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/clans/list/'",
"}",
",",
"{",
"search",
":",
"search",
",",
"page_no",
":"... | List of clans with minimal details.
@param {string} [search] filter by clan name or tag
@param {number} [page_no] which page to return, starting at 1
@param {number} [limit] max count of entries
@param {string|string[]} [fields] response selection
@returns {Promise<Object[]>} resolves to a list of short clan descripti... | [
"List",
"of",
"clans",
"with",
"minimal",
"details",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L451-L461 | |
37,839 | CodeMan99/wotblitz.js | wotblitz.js | function(fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/clans/glossary/'
}, {
fields: fields ? fields.toString() : ''
});
} | javascript | function(fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/clans/glossary/'
}, {
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/clans/glossary/'",
"}",
",",
"{",
"fields",
":",
"fields",
"?",
"fields",
".",
"toString",
"(",
")",
":",
"''",
"}",
... | Meta information about clans.
@param {string|string[]} [fields] response selection
@returns {Promise<Object>} resolves to clan terminology definitions | [
"Meta",
"information",
"about",
"clans",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L508-L515 | |
37,840 | CodeMan99/wotblitz.js | wotblitz.js | function(tank_id, nation, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/vehicles/'
}, {
tank_id: tank_id ? tank_id.toString() : '',
nation: nation ? nation.toString() : '',
fields: fields ? fields.toString() : ''
});
} | javascript | function(tank_id, nation, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/vehicles/'
}, {
tank_id: tank_id ? tank_id.toString() : '',
nation: nation ? nation.toString() : '',
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"tank_id",
",",
"nation",
",",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/encyclopedia/vehicles/'",
"}",
",",
"{",
"tank_id",
":",
"tank_id",
"?",
"tank_id",
".",
"... | List of vehicle information
@param {number|number[]} [tank_id] limit to this vehicle id(s) only
@param {string|string[]} [nation] limit to vehicle in this tech tree(s)
@param {string|string[]} [fields] response selection
@returns {Promise<Object>} resolves to description of requested vehicles | [
"List",
"of",
"vehicle",
"information"
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L527-L536 | |
37,841 | CodeMan99/wotblitz.js | wotblitz.js | function(tank_id, profile_id, modules, fields) {
if (!tank_id) return Promise.reject(new Error('wotblitz.encyclopedia.vehicleprofile: tank_id is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/vehicleprofile/'
}, Object.assign({
tank_id: tank_id,
fields: fields ? fields.... | javascript | function(tank_id, profile_id, modules, fields) {
if (!tank_id) return Promise.reject(new Error('wotblitz.encyclopedia.vehicleprofile: tank_id is required'));
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/vehicleprofile/'
}, Object.assign({
tank_id: tank_id,
fields: fields ? fields.... | [
"function",
"(",
"tank_id",
",",
"profile_id",
",",
"modules",
",",
"fields",
")",
"{",
"if",
"(",
"!",
"tank_id",
")",
"return",
"Promise",
".",
"reject",
"(",
"new",
"Error",
"(",
"'wotblitz.encyclopedia.vehicleprofile: tank_id is required'",
")",
")",
";",
... | Characteristics with different vehicle modules installed.
@param {string} tank_id vehicle to select
@param {string} [profile_id] shorthand returned by the "vehicleprofiles" route
@param {Object} [modules] specify modules individually (overrides profile_id)
@param {number} [modules.engine_id] which engine module to sel... | [
"Characteristics",
"with",
"different",
"vehicle",
"modules",
"installed",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L550-L562 | |
37,842 | CodeMan99/wotblitz.js | wotblitz.js | function(module_id, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/modules/'
}, {
module_id: module_id ? module_id.toString() : '',
fields: fields ? fields.toString() : ''
});
} | javascript | function(module_id, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/modules/'
}, {
module_id: module_id ? module_id.toString() : '',
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"module_id",
",",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/encyclopedia/modules/'",
"}",
",",
"{",
"module_id",
":",
"module_id",
"?",
"module_id",
".",
"toString",
... | Information on any engine, suspension, gun, or turret.
@params {number|number[]} [module_id] id of any vehicle's module
@params {string|string[]} [fields] response selection
@returns {Promise<Object>} resolves to description of each module | [
"Information",
"on",
"any",
"engine",
"suspension",
"gun",
"or",
"turret",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L570-L578 | |
37,843 | CodeMan99/wotblitz.js | wotblitz.js | function(tank_id, provision_id, type, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/provisions/'
}, {
tank_id: tank_id ? tank_id.toString() : '',
provision_id: provision_id ? provision_id.toString() : '',
type: type,
fields: fields ? fields.toString() : ''
});
} | javascript | function(tank_id, provision_id, type, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/provisions/'
}, {
tank_id: tank_id ? tank_id.toString() : '',
provision_id: provision_id ? provision_id.toString() : '',
type: type,
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"tank_id",
",",
"provision_id",
",",
"type",
",",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/encyclopedia/provisions/'",
"}",
",",
"{",
"tank_id",
":",
"tank_id",
"?"... | Available equipment and provisions.
@param {number|number[]} [tank_id] select provisions for the given tank(s)
@param {number|number[]} [provision_id] item id
@param {string} [type] provision type, value "optionalDevice" or "equipment"
@param {string|string[]} [fields] response selection
@returns {Promise<Object>} res... | [
"Available",
"equipment",
"and",
"provisions",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L588-L598 | |
37,844 | CodeMan99/wotblitz.js | wotblitz.js | function(skill_id, vehicle_type, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/crewskills/'
}, {
skill_id: skill_id ? skill_id.toString() : '',
vehicle_type: vehicle_type ? vehicle_type.toString() : '',
fields: fields ? fields.toString() : ''
});
} | javascript | function(skill_id, vehicle_type, fields) {
return request({
hostname: hosts.wotb,
path: '/wotb/encyclopedia/crewskills/'
}, {
skill_id: skill_id ? skill_id.toString() : '',
vehicle_type: vehicle_type ? vehicle_type.toString() : '',
fields: fields ? fields.toString() : ''
});
} | [
"function",
"(",
"skill_id",
",",
"vehicle_type",
",",
"fields",
")",
"{",
"return",
"request",
"(",
"{",
"hostname",
":",
"hosts",
".",
"wotb",
",",
"path",
":",
"'/wotb/encyclopedia/crewskills/'",
"}",
",",
"{",
"skill_id",
":",
"skill_id",
"?",
"skill_id"... | Description of crew skills.
@params {string|string[]} [skill_id] name of skill(s) to request
@params {string|string[]} [vehicle_type] select skill category
@params {string|string[]} [fields] response selection
@returns {Promise<Object>} resolves to the description | [
"Description",
"of",
"crew",
"skills",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L635-L644 | |
37,845 | CodeMan99/wotblitz.js | wotblitz.js | function(options, fields) {
options = Object.assign({
search: null,
status: null,
page_no: null,
limit: null
}, options, {
fields: fields ? fields.toString() : ''
});
if (Array.isArray(options.status)) options.status = options.status.toString();
return request({
hostname: hosts.wotb,
pa... | javascript | function(options, fields) {
options = Object.assign({
search: null,
status: null,
page_no: null,
limit: null
}, options, {
fields: fields ? fields.toString() : ''
});
if (Array.isArray(options.status)) options.status = options.status.toString();
return request({
hostname: hosts.wotb,
pa... | [
"function",
"(",
"options",
",",
"fields",
")",
"{",
"options",
"=",
"Object",
".",
"assign",
"(",
"{",
"search",
":",
"null",
",",
"status",
":",
"null",
",",
"page_no",
":",
"null",
",",
"limit",
":",
"null",
"}",
",",
"options",
",",
"{",
"field... | List of all tournaments.
@param {Object} [options]
@param {string} [options.search]
@param {string|string[]} [options.status]
@param {number} [options.page_no]
@param {number} [options.limit]
@param {string|string[]} [fields] response selection
@returns {Promise<Object>} | [
"List",
"of",
"all",
"tournaments",
"."
] | d4a56e4523704418029e2b9846410b31a8d69478 | https://github.com/CodeMan99/wotblitz.js/blob/d4a56e4523704418029e2b9846410b31a8d69478/wotblitz.js#L749-L765 | |
37,846 | d5/deep-defaults | lib/index.js | _deepDefaults | function _deepDefaults(dest, src) {
if(_.isUndefined(dest) || _.isNull(dest) || !_.isPlainObject(dest)) { return dest; }
_.each(src, function(v, k) {
if(_.isUndefined(dest[k])) {
dest[k] = v;
} else if(_.isPlainObject(v)) {
_deepDefaults(dest[k], v);
}
});
... | javascript | function _deepDefaults(dest, src) {
if(_.isUndefined(dest) || _.isNull(dest) || !_.isPlainObject(dest)) { return dest; }
_.each(src, function(v, k) {
if(_.isUndefined(dest[k])) {
dest[k] = v;
} else if(_.isPlainObject(v)) {
_deepDefaults(dest[k], v);
}
});
... | [
"function",
"_deepDefaults",
"(",
"dest",
",",
"src",
")",
"{",
"if",
"(",
"_",
".",
"isUndefined",
"(",
"dest",
")",
"||",
"_",
".",
"isNull",
"(",
"dest",
")",
"||",
"!",
"_",
".",
"isPlainObject",
"(",
"dest",
")",
")",
"{",
"return",
"dest",
... | Recursively assigns own enumerable properties of the source object to the destination object for all destination properties that resolve to undefined.
@param {Object} dest destination object; this object is modified.
@param {Object} src source object that has the defaults
@returns {Object} destination object | [
"Recursively",
"assigns",
"own",
"enumerable",
"properties",
"of",
"the",
"source",
"object",
"to",
"the",
"destination",
"object",
"for",
"all",
"destination",
"properties",
"that",
"resolve",
"to",
"undefined",
"."
] | 321d0e2231aa807d54e7f95d75c22048a806923f | https://github.com/d5/deep-defaults/blob/321d0e2231aa807d54e7f95d75c22048a806923f/lib/index.js#L11-L23 |
37,847 | evanshortiss/browser-local-storage | lib/LocalStorage.js | genStorageKey | function genStorageKey (ns, key) {
return (ns === '') ? ns.concat(key) : ns.concat('.').concat(key);
} | javascript | function genStorageKey (ns, key) {
return (ns === '') ? ns.concat(key) : ns.concat('.').concat(key);
} | [
"function",
"genStorageKey",
"(",
"ns",
",",
"key",
")",
"{",
"return",
"(",
"ns",
"===",
"''",
")",
"?",
"ns",
".",
"concat",
"(",
"key",
")",
":",
"ns",
".",
"concat",
"(",
"'.'",
")",
".",
"concat",
"(",
"key",
")",
";",
"}"
] | Generate a period separated storage key
@param {String} ns Namespace being used
@param {String} key Actual key of the data
@return {String} The generated namespaced key
@api private | [
"Generate",
"a",
"period",
"separated",
"storage",
"key"
] | c1266354837ab71a04bad2ba40554474aa6381f9 | https://github.com/evanshortiss/browser-local-storage/blob/c1266354837ab71a04bad2ba40554474aa6381f9/lib/LocalStorage.js#L45-L47 |
37,848 | evanshortiss/browser-local-storage | lib/LocalStorage.js | LocalStorage | function LocalStorage (params) {
events.EventEmitter.call(this);
if (!params || typeof params === 'string') {
params = {
ns: params || ''
};
}
this.ns = params.ns || '';
if (typeof this.ns !== 'string') {
throw new Error('Namespace must be a string.');
}
this.preSave = params.preSave... | javascript | function LocalStorage (params) {
events.EventEmitter.call(this);
if (!params || typeof params === 'string') {
params = {
ns: params || ''
};
}
this.ns = params.ns || '';
if (typeof this.ns !== 'string') {
throw new Error('Namespace must be a string.');
}
this.preSave = params.preSave... | [
"function",
"LocalStorage",
"(",
"params",
")",
"{",
"events",
".",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"if",
"(",
"!",
"params",
"||",
"typeof",
"params",
"===",
"'string'",
")",
"{",
"params",
"=",
"{",
"ns",
":",
"params",
"||",
"'... | Class used to provide a wrapper over localStorage
@param {String} [ns] Optional namespace for the adpater. | [
"Class",
"used",
"to",
"provide",
"a",
"wrapper",
"over",
"localStorage"
] | c1266354837ab71a04bad2ba40554474aa6381f9 | https://github.com/evanshortiss/browser-local-storage/blob/c1266354837ab71a04bad2ba40554474aa6381f9/lib/LocalStorage.js#L63-L90 |
37,849 | scott-wyatt/sails-stripe | templates/Invoiceitem.template.js | function (invoiceitem, cb) {
Invoiceitem.findOrCreate(invoiceitem.id, invoiceitem)
.exec(function (err, foundInvoiceitem){
if (err) return cb(err);
if (foundInvoiceitem.lastStripeEvent > invoiceitem.lastStripeEvent) return cb(null, foundInvoiceitem);
if (foundInvoiceitem.lastStripeEvent == ... | javascript | function (invoiceitem, cb) {
Invoiceitem.findOrCreate(invoiceitem.id, invoiceitem)
.exec(function (err, foundInvoiceitem){
if (err) return cb(err);
if (foundInvoiceitem.lastStripeEvent > invoiceitem.lastStripeEvent) return cb(null, foundInvoiceitem);
if (foundInvoiceitem.lastStripeEvent == ... | [
"function",
"(",
"invoiceitem",
",",
"cb",
")",
"{",
"Invoiceitem",
".",
"findOrCreate",
"(",
"invoiceitem",
".",
"id",
",",
"invoiceitem",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundInvoiceitem",
")",
"{",
"if",
"(",
"err",
")",
"return",... | Stripe Webhook invoiceitem.updated | [
"Stripe",
"Webhook",
"invoiceitem",
".",
"updated"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Invoiceitem.template.js#L90-L106 | |
37,850 | scott-wyatt/sails-stripe | templates/Invoiceitem.template.js | function (invoiceitem, cb) {
Invoiceitem.destroy(invoiceitem.id)
.exec(function (err, destroyedInvoiceitems){
if (err) return cb(err);
if (!destroyedInvoiceitems) return cb(null, null);
Invoiceitem.afterStripeInvoiceitemDeleted(destroyedInvoiceitems[0], function(err, invoiceitem){
c... | javascript | function (invoiceitem, cb) {
Invoiceitem.destroy(invoiceitem.id)
.exec(function (err, destroyedInvoiceitems){
if (err) return cb(err);
if (!destroyedInvoiceitems) return cb(null, null);
Invoiceitem.afterStripeInvoiceitemDeleted(destroyedInvoiceitems[0], function(err, invoiceitem){
c... | [
"function",
"(",
"invoiceitem",
",",
"cb",
")",
"{",
"Invoiceitem",
".",
"destroy",
"(",
"invoiceitem",
".",
"id",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"destroyedInvoiceitems",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"err",... | Stripe Webhook invoiceitem.deleted | [
"Stripe",
"Webhook",
"invoiceitem",
".",
"deleted"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Invoiceitem.template.js#L114-L124 | |
37,851 | om-mani-padme-hum/ezobjects-mysql | index.js | validateTableConfig | function validateTableConfig(obj) {
/** If configuration has missing or invalid 'tableName' configuration, throw error */
if ( typeof obj.tableName !== `string` || !obj.tableName.match(/^[a-z_]+$/) )
throw new Error(`ezobjects.validateTableConfig(): Configuration has missing or invalid 'tableName', must be st... | javascript | function validateTableConfig(obj) {
/** If configuration has missing or invalid 'tableName' configuration, throw error */
if ( typeof obj.tableName !== `string` || !obj.tableName.match(/^[a-z_]+$/) )
throw new Error(`ezobjects.validateTableConfig(): Configuration has missing or invalid 'tableName', must be st... | [
"function",
"validateTableConfig",
"(",
"obj",
")",
"{",
"/** If configuration has missing or invalid 'tableName' configuration, throw error */",
"if",
"(",
"typeof",
"obj",
".",
"tableName",
"!==",
"`",
"`",
"||",
"!",
"obj",
".",
"tableName",
".",
"match",
"(",
"/",... | Validate configuration for a creating MySQL table based on class configuration | [
"Validate",
"configuration",
"for",
"a",
"creating",
"MySQL",
"table",
"based",
"on",
"class",
"configuration"
] | 6c73476af9d2855e7c4d7b56176da3f57f1ae37b | https://github.com/om-mani-padme-hum/ezobjects-mysql/blob/6c73476af9d2855e7c4d7b56176da3f57f1ae37b/index.js#L415-L421 |
37,852 | elb-min-uhh/markdown-elearnjs | assets/elearnjs/extensions/quiz/assets/js/quiz.js | ev_canvas | function ev_canvas(ev) {
if(!root.is('.blocked')) {
if(ev.layerX || ev.layerX == 0) { // Firefox
ev._x = ev.layerX;
ev._y = ev.layerY;
} else if(ev.offsetX || ev.offsetX == 0) { // Opera
ev._x = ev.offsetX;
ev._y = ev.offset... | javascript | function ev_canvas(ev) {
if(!root.is('.blocked')) {
if(ev.layerX || ev.layerX == 0) { // Firefox
ev._x = ev.layerX;
ev._y = ev.layerY;
} else if(ev.offsetX || ev.offsetX == 0) { // Opera
ev._x = ev.offsetX;
ev._y = ev.offset... | [
"function",
"ev_canvas",
"(",
"ev",
")",
"{",
"if",
"(",
"!",
"root",
".",
"is",
"(",
"'.blocked'",
")",
")",
"{",
"if",
"(",
"ev",
".",
"layerX",
"||",
"ev",
".",
"layerX",
"==",
"0",
")",
"{",
"// Firefox",
"ev",
".",
"_x",
"=",
"ev",
".",
... | The general-purpose event handler. This function just determines the mouse position relative to the canvas element. | [
"The",
"general",
"-",
"purpose",
"event",
"handler",
".",
"This",
"function",
"just",
"determines",
"the",
"mouse",
"position",
"relative",
"to",
"the",
"canvas",
"element",
"."
] | a09bcc497c3c50dd565b7f440fa1f7b62074d679 | https://github.com/elb-min-uhh/markdown-elearnjs/blob/a09bcc497c3c50dd565b7f440fa1f7b62074d679/assets/elearnjs/extensions/quiz/assets/js/quiz.js#L2207-L2223 |
37,853 | scott-wyatt/sails-stripe | templates/Coupon.template.js | function (coupon, cb) {
Coupon.findOrCreate(coupon.id, coupon)
.exec(function (err, foundCoupon){
if (err) return cb(err);
if (foundCoupon.lastStripeEvent > coupon.lastStripeEvent) return cb(null, foundCoupon);
if (foundCoupon.lastStripeEvent == coupon.lastStripeEvent) return Coupon.afterSt... | javascript | function (coupon, cb) {
Coupon.findOrCreate(coupon.id, coupon)
.exec(function (err, foundCoupon){
if (err) return cb(err);
if (foundCoupon.lastStripeEvent > coupon.lastStripeEvent) return cb(null, foundCoupon);
if (foundCoupon.lastStripeEvent == coupon.lastStripeEvent) return Coupon.afterSt... | [
"function",
"(",
"coupon",
",",
"cb",
")",
"{",
"Coupon",
".",
"findOrCreate",
"(",
"coupon",
".",
"id",
",",
"coupon",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundCoupon",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"err",
... | Stripe Webhook coupon.created | [
"Stripe",
"Webhook",
"coupon",
".",
"created"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Coupon.template.js#L75-L90 | |
37,854 | scott-wyatt/sails-stripe | templates/Coupon.template.js | function (coupon, cb) {
Coupon.destroy(coupon.id)
.exec(function (err, destroyedCoupons){
if (err) return cb(err);
if(!destroyedCoupons) return cb(null, null);
Coupon.afterStripeCouponDeleted(destroyedCoupons[0], function(err, coupon){
cb(null, coupon);
});
});
} | javascript | function (coupon, cb) {
Coupon.destroy(coupon.id)
.exec(function (err, destroyedCoupons){
if (err) return cb(err);
if(!destroyedCoupons) return cb(null, null);
Coupon.afterStripeCouponDeleted(destroyedCoupons[0], function(err, coupon){
cb(null, coupon);
});
});
} | [
"function",
"(",
"coupon",
",",
"cb",
")",
"{",
"Coupon",
".",
"destroy",
"(",
"coupon",
".",
"id",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"destroyedCoupons",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"err",
")",
";",
"if... | Stripe Webhook coupon.deleted | [
"Stripe",
"Webhook",
"coupon",
".",
"deleted"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Coupon.template.js#L98-L108 | |
37,855 | scott-wyatt/sails-stripe | templates/Stripeaccount.template.js | function (account, cb) {
Stripeaccount.findOrCreate(account.id, account)
.exec(function (err, foundAccount){
if (err) return cb(err);
Stripeaccount.update(foundAccount.id, account)
.exec(function(err, updatedAccounts){
if (err) return cb(err);
cb(null, updatedAccounts[0]);
... | javascript | function (account, cb) {
Stripeaccount.findOrCreate(account.id, account)
.exec(function (err, foundAccount){
if (err) return cb(err);
Stripeaccount.update(foundAccount.id, account)
.exec(function(err, updatedAccounts){
if (err) return cb(err);
cb(null, updatedAccounts[0]);
... | [
"function",
"(",
"account",
",",
"cb",
")",
"{",
"Stripeaccount",
".",
"findOrCreate",
"(",
"account",
".",
"id",
",",
"account",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundAccount",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"("... | Stripe Webhook account.updated | [
"Stripe",
"Webhook",
"account",
".",
"updated"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Stripeaccount.template.js#L98-L109 | |
37,856 | mojaie/kiwiii | src/component/tree.js | checkboxValues | function checkboxValues(selection) {
return selection.select('.body')
.selectAll('input:checked').data().map(d => d.id);
} | javascript | function checkboxValues(selection) {
return selection.select('.body')
.selectAll('input:checked').data().map(d => d.id);
} | [
"function",
"checkboxValues",
"(",
"selection",
")",
"{",
"return",
"selection",
".",
"select",
"(",
"'.body'",
")",
".",
"selectAll",
"(",
"'input:checked'",
")",
".",
"data",
"(",
")",
".",
"map",
"(",
"d",
"=>",
"d",
".",
"id",
")",
";",
"}"
] | Return an array of ids that are checked
@param {d3.selection} selection - selection of node content | [
"Return",
"an",
"array",
"of",
"ids",
"that",
"are",
"checked"
] | 30d75685b1ab388b5f1467c753cacd090971ceba | https://github.com/mojaie/kiwiii/blob/30d75685b1ab388b5f1467c753cacd090971ceba/src/component/tree.js#L132-L135 |
37,857 | xbtsw/makejs | lib/make.js | addDepsToRequiredTargets | function addDepsToRequiredTargets(target, parents){
if (parents.have(target)){
callback(new Error("Circular dependencies detected"));
return;
}
requiredTargets.add(target);
parents.add(target);
for(var deps in makeInst.targets[target].dependsOn.hash){
... | javascript | function addDepsToRequiredTargets(target, parents){
if (parents.have(target)){
callback(new Error("Circular dependencies detected"));
return;
}
requiredTargets.add(target);
parents.add(target);
for(var deps in makeInst.targets[target].dependsOn.hash){
... | [
"function",
"addDepsToRequiredTargets",
"(",
"target",
",",
"parents",
")",
"{",
"if",
"(",
"parents",
".",
"have",
"(",
"target",
")",
")",
"{",
"callback",
"(",
"new",
"Error",
"(",
"\"Circular dependencies detected\"",
")",
")",
";",
"return",
";",
"}",
... | find all the required targets | [
"find",
"all",
"the",
"required",
"targets"
] | f43a52310bb1df625a5bf3ed9ea0b1654d638eb6 | https://github.com/xbtsw/makejs/blob/f43a52310bb1df625a5bf3ed9ea0b1654d638eb6/lib/make.js#L126-L136 |
37,858 | jsantell/mock-s3 | lib/mpu.js | MPU | function MPU (ops) {
File.call(this, ops);
this._parts = {};
this._bufferParts = [];
this._data.UploadId = makeUploadId();
} | javascript | function MPU (ops) {
File.call(this, ops);
this._parts = {};
this._bufferParts = [];
this._data.UploadId = makeUploadId();
} | [
"function",
"MPU",
"(",
"ops",
")",
"{",
"File",
".",
"call",
"(",
"this",
",",
"ops",
")",
";",
"this",
".",
"_parts",
"=",
"{",
"}",
";",
"this",
".",
"_bufferParts",
"=",
"[",
"]",
";",
"this",
".",
"_data",
".",
"UploadId",
"=",
"makeUploadId... | Creates a new file for mock-s3.
@class | [
"Creates",
"a",
"new",
"file",
"for",
"mock",
"-",
"s3",
"."
] | d02e3b0558cc60c7887232b69df41e2b0fe09147 | https://github.com/jsantell/mock-s3/blob/d02e3b0558cc60c7887232b69df41e2b0fe09147/lib/mpu.js#L10-L15 |
37,859 | jamiebuilds/backbone.storage | dist/backbone.storage.js | find | function find(model) {
var _this = this;
var forceFetch = arguments[1] === undefined ? false : arguments[1];
var record = this.records.get(model);
if (record && !forceFetch) {
return Promise.resolve(record);
} else {
model = this._ensureModel(model);
return Promise... | javascript | function find(model) {
var _this = this;
var forceFetch = arguments[1] === undefined ? false : arguments[1];
var record = this.records.get(model);
if (record && !forceFetch) {
return Promise.resolve(record);
} else {
model = this._ensureModel(model);
return Promise... | [
"function",
"find",
"(",
"model",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"forceFetch",
"=",
"arguments",
"[",
"1",
"]",
"===",
"undefined",
"?",
"false",
":",
"arguments",
"[",
"1",
"]",
";",
"var",
"record",
"=",
"this",
".",
"records",
... | Find a specific model from the store or fetch it from the server and insert
it into the store.
@public
@instance
@method find
@memberOf Storage
@param {Number|String|Object|Backbone.Model} model - The model to find.
@param {Boolean} forceFetch - Force fetch model from server.
@returns {Promise} - A promise that will r... | [
"Find",
"a",
"specific",
"model",
"from",
"the",
"store",
"or",
"fetch",
"it",
"from",
"the",
"server",
"and",
"insert",
"it",
"into",
"the",
"store",
"."
] | db8169a07b54f30baa4a8c3963c8cbefe2dd47c9 | https://github.com/jamiebuilds/backbone.storage/blob/db8169a07b54f30baa4a8c3963c8cbefe2dd47c9/dist/backbone.storage.js#L45-L58 |
37,860 | jamiebuilds/backbone.storage | dist/backbone.storage.js | findAll | function findAll() {
var _this = this;
var options = arguments[0] === undefined ? {} : arguments[0];
var forceFetch = arguments[1] === undefined ? false : arguments[1];
if (this._hasSynced && !forceFetch) {
return Promise.resolve(this.records);
} else {
return Promise.resol... | javascript | function findAll() {
var _this = this;
var options = arguments[0] === undefined ? {} : arguments[0];
var forceFetch = arguments[1] === undefined ? false : arguments[1];
if (this._hasSynced && !forceFetch) {
return Promise.resolve(this.records);
} else {
return Promise.resol... | [
"function",
"findAll",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"options",
"=",
"arguments",
"[",
"0",
"]",
"===",
"undefined",
"?",
"{",
"}",
":",
"arguments",
"[",
"0",
"]",
";",
"var",
"forceFetch",
"=",
"arguments",
"[",
"1",
"]"... | Find all the models in the store or fetch them from the server if they
haven't been fetched before.
@public
@instance
@method findAll
@memberOf Storage
@param {Object} options - Options to pass to collection fetch. Also allows
setting parameters on collection.
@param {Boolean} forceFetch - Force fetch model from serve... | [
"Find",
"all",
"the",
"models",
"in",
"the",
"store",
"or",
"fetch",
"them",
"from",
"the",
"server",
"if",
"they",
"haven",
"t",
"been",
"fetched",
"before",
"."
] | db8169a07b54f30baa4a8c3963c8cbefe2dd47c9 | https://github.com/jamiebuilds/backbone.storage/blob/db8169a07b54f30baa4a8c3963c8cbefe2dd47c9/dist/backbone.storage.js#L73-L84 |
37,861 | jamiebuilds/backbone.storage | dist/backbone.storage.js | save | function save(model) {
var _this = this;
var record = this.records.get(model);
model = record || this._ensureModel(model);
return Promise.resolve(model.save()).then(function () {
if (!record) {
_this.insert(model);
}
return model;
});
} | javascript | function save(model) {
var _this = this;
var record = this.records.get(model);
model = record || this._ensureModel(model);
return Promise.resolve(model.save()).then(function () {
if (!record) {
_this.insert(model);
}
return model;
});
} | [
"function",
"save",
"(",
"model",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"var",
"record",
"=",
"this",
".",
"records",
".",
"get",
"(",
"model",
")",
";",
"model",
"=",
"record",
"||",
"this",
".",
"_ensureModel",
"(",
"model",
")",
";",
"retu... | Save a model to the server.
@public
@instance
@method save
@memberOf Storage
@param {Number|String|Object|Backbone.Model} model - The model to save
@returns {Promise} - A promise that will resolve to the saved model. | [
"Save",
"a",
"model",
"to",
"the",
"server",
"."
] | db8169a07b54f30baa4a8c3963c8cbefe2dd47c9 | https://github.com/jamiebuilds/backbone.storage/blob/db8169a07b54f30baa4a8c3963c8cbefe2dd47c9/dist/backbone.storage.js#L96-L106 |
37,862 | jamiebuilds/backbone.storage | dist/backbone.storage.js | insert | function insert(model) {
model = this.records.add(model, { merge: true });
return Promise.resolve(model);
} | javascript | function insert(model) {
model = this.records.add(model, { merge: true });
return Promise.resolve(model);
} | [
"function",
"insert",
"(",
"model",
")",
"{",
"model",
"=",
"this",
".",
"records",
".",
"add",
"(",
"model",
",",
"{",
"merge",
":",
"true",
"}",
")",
";",
"return",
"Promise",
".",
"resolve",
"(",
"model",
")",
";",
"}"
] | Insert a model into the store.
@public
@instance
@method insert
@memberOf Storage
@params {Object|Backbone.Model} - The model to add.
@returns {Promise} - A promise that will resolve to the added model. | [
"Insert",
"a",
"model",
"into",
"the",
"store",
"."
] | db8169a07b54f30baa4a8c3963c8cbefe2dd47c9 | https://github.com/jamiebuilds/backbone.storage/blob/db8169a07b54f30baa4a8c3963c8cbefe2dd47c9/dist/backbone.storage.js#L118-L121 |
37,863 | jamiebuilds/backbone.storage | dist/backbone.storage.js | _ensureModel | function _ensureModel(model) {
if (model instanceof this.model) {
return model;
} else if (typeof model === "object") {
return new this.model(model);
} else {
return new this.model({ id: model });
}
} | javascript | function _ensureModel(model) {
if (model instanceof this.model) {
return model;
} else if (typeof model === "object") {
return new this.model(model);
} else {
return new this.model({ id: model });
}
} | [
"function",
"_ensureModel",
"(",
"model",
")",
"{",
"if",
"(",
"model",
"instanceof",
"this",
".",
"model",
")",
"{",
"return",
"model",
";",
"}",
"else",
"if",
"(",
"typeof",
"model",
"===",
"\"object\"",
")",
"{",
"return",
"new",
"this",
".",
"model... | Ensure that we have a real model from an id, object, or model.
@private
@instance
@method _ensureModel
@memberOf Storage
@params {Number|String|Object|Backbone.Model} - An id, object, or model.
@returns {Backbone.Model} - The model. | [
"Ensure",
"that",
"we",
"have",
"a",
"real",
"model",
"from",
"an",
"id",
"object",
"or",
"model",
"."
] | db8169a07b54f30baa4a8c3963c8cbefe2dd47c9 | https://github.com/jamiebuilds/backbone.storage/blob/db8169a07b54f30baa4a8c3963c8cbefe2dd47c9/dist/backbone.storage.js#L133-L141 |
37,864 | impromptu/impromptu | lib/Prompt.js | function(input, callback) {
// Handle non-function `input`.
if (!_.isFunction(input)) {
callback(null, input)
return
}
// Handle asynchronous `input` function.
if (input.length) {
input(callback)
return
}
// Handle synchronous `input` function.
var results = null
var err = null
try... | javascript | function(input, callback) {
// Handle non-function `input`.
if (!_.isFunction(input)) {
callback(null, input)
return
}
// Handle asynchronous `input` function.
if (input.length) {
input(callback)
return
}
// Handle synchronous `input` function.
var results = null
var err = null
try... | [
"function",
"(",
"input",
",",
"callback",
")",
"{",
"// Handle non-function `input`.",
"if",
"(",
"!",
"_",
".",
"isFunction",
"(",
"input",
")",
")",
"{",
"callback",
"(",
"null",
",",
"input",
")",
"return",
"}",
"// Handle asynchronous `input` function.",
... | Allows any input to be treated asynchronously. | [
"Allows",
"any",
"input",
"to",
"be",
"treated",
"asynchronously",
"."
] | 829798eda62771d6a6ed971d87eef7a461932704 | https://github.com/impromptu/impromptu/blob/829798eda62771d6a6ed971d87eef7a461932704/lib/Prompt.js#L21-L44 | |
37,865 | XOP/sass-vars-to-js | src/index.js | sassVars | function sassVars (filePath) {
const declarations = collectDeclarations(filePath);
let variables = {};
if (!declarations.length) {
message('Warning: Zero declarations found');
return;
}
declarations.forEach(function (declaration) {
const parsedDeclaration = parseDeclaration... | javascript | function sassVars (filePath) {
const declarations = collectDeclarations(filePath);
let variables = {};
if (!declarations.length) {
message('Warning: Zero declarations found');
return;
}
declarations.forEach(function (declaration) {
const parsedDeclaration = parseDeclaration... | [
"function",
"sassVars",
"(",
"filePath",
")",
"{",
"const",
"declarations",
"=",
"collectDeclarations",
"(",
"filePath",
")",
";",
"let",
"variables",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"declarations",
".",
"length",
")",
"{",
"message",
"(",
"'Warning: Z... | Takes file.scss as an argument
Returns parsed variables hash-map
@param filePath
@returns {{}} | [
"Takes",
"file",
".",
"scss",
"as",
"an",
"argument",
"Returns",
"parsed",
"variables",
"hash",
"-",
"map"
] | 87ad8588701a9c2e69ace75931947d11698f25f0 | https://github.com/XOP/sass-vars-to-js/blob/87ad8588701a9c2e69ace75931947d11698f25f0/src/index.js#L13-L54 |
37,866 | fnogatz/node-swtparser | lib/from-data-view.js | getOrderedPlayers | function getOrderedPlayers (tnmt) {
var res = []
for (var i = 0; i < tnmt.players.length; i++) {
res[tnmt.players[i].positionInSWT] = tnmt.players[i]['2020']
}
return res
} | javascript | function getOrderedPlayers (tnmt) {
var res = []
for (var i = 0; i < tnmt.players.length; i++) {
res[tnmt.players[i].positionInSWT] = tnmt.players[i]['2020']
}
return res
} | [
"function",
"getOrderedPlayers",
"(",
"tnmt",
")",
"{",
"var",
"res",
"=",
"[",
"]",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"tnmt",
".",
"players",
".",
"length",
";",
"i",
"++",
")",
"{",
"res",
"[",
"tnmt",
".",
"players",
"[",
"i",... | Takes a tournament and returns the players in order of
their occurences within the SWT.
@param {Object} tournament object after parsing process
@return {Array} of players | [
"Takes",
"a",
"tournament",
"and",
"returns",
"the",
"players",
"in",
"order",
"of",
"their",
"occurences",
"within",
"the",
"SWT",
"."
] | 4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3 | https://github.com/fnogatz/node-swtparser/blob/4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3/lib/from-data-view.js#L261-L267 |
37,867 | fnogatz/node-swtparser | lib/from-data-view.js | getOrderedTeams | function getOrderedTeams (tnmt) {
var res = []
for (var i = 0; i < tnmt.teams.length; i++) {
res[tnmt.teams[i].positionInSWT] = tnmt.teams[i]['1018']
}
return res
} | javascript | function getOrderedTeams (tnmt) {
var res = []
for (var i = 0; i < tnmt.teams.length; i++) {
res[tnmt.teams[i].positionInSWT] = tnmt.teams[i]['1018']
}
return res
} | [
"function",
"getOrderedTeams",
"(",
"tnmt",
")",
"{",
"var",
"res",
"=",
"[",
"]",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"tnmt",
".",
"teams",
".",
"length",
";",
"i",
"++",
")",
"{",
"res",
"[",
"tnmt",
".",
"teams",
"[",
"i",
"]"... | Takes a tournament and returns the teams in order of
their occurences within the SWT.
@param {Object} tournament object after parsing process
@return {Array} of teams | [
"Takes",
"a",
"tournament",
"and",
"returns",
"the",
"teams",
"in",
"order",
"of",
"their",
"occurences",
"within",
"the",
"SWT",
"."
] | 4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3 | https://github.com/fnogatz/node-swtparser/blob/4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3/lib/from-data-view.js#L276-L282 |
37,868 | fnogatz/node-swtparser | lib/from-data-view.js | playerPairingFilter | function playerPairingFilter (tnmt) {
return function (pairing) {
// board number too high?
if (tnmt.general[35] && pairing[4006] > tnmt.general[34]) { return false }
// no color set?
if (pairing[4000] === '4000-0') { return false }
return true
}
} | javascript | function playerPairingFilter (tnmt) {
return function (pairing) {
// board number too high?
if (tnmt.general[35] && pairing[4006] > tnmt.general[34]) { return false }
// no color set?
if (pairing[4000] === '4000-0') { return false }
return true
}
} | [
"function",
"playerPairingFilter",
"(",
"tnmt",
")",
"{",
"return",
"function",
"(",
"pairing",
")",
"{",
"// board number too high?",
"if",
"(",
"tnmt",
".",
"general",
"[",
"35",
"]",
"&&",
"pairing",
"[",
"4006",
"]",
">",
"tnmt",
".",
"general",
"[",
... | Filter function to remove dummy player pairings.
@param {Object} pairing
@return {Boolean} true -> valid pairing | [
"Filter",
"function",
"to",
"remove",
"dummy",
"player",
"pairings",
"."
] | 4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3 | https://github.com/fnogatz/node-swtparser/blob/4a109dcfef19ca5ca01fa7b4256ee57a2a3c1dd3/lib/from-data-view.js#L289-L299 |
37,869 | nwtjs/nwt | src/io/js/io.js | NWTIO | function NWTIO(args) {
this.req = new XMLHttpRequest();
this.config = {};
this.url = args[0];
// Data to send as
this.ioData = '';
var chainableSetters = ['success', 'failure', 'serialize'],
i,
setter,
mythis = this,
// Returns the setter function
getSetter = function (setter) {
return function (v... | javascript | function NWTIO(args) {
this.req = new XMLHttpRequest();
this.config = {};
this.url = args[0];
// Data to send as
this.ioData = '';
var chainableSetters = ['success', 'failure', 'serialize'],
i,
setter,
mythis = this,
// Returns the setter function
getSetter = function (setter) {
return function (v... | [
"function",
"NWTIO",
"(",
"args",
")",
"{",
"this",
".",
"req",
"=",
"new",
"XMLHttpRequest",
"(",
")",
";",
"this",
".",
"config",
"=",
"{",
"}",
";",
"this",
".",
"url",
"=",
"args",
"[",
"0",
"]",
";",
"// Data to send as",
"this",
".",
"ioData"... | Provides ajax communication methods
The folllowing methods are chainable
success - success handler
failure - failure handler
serialize - serialize a form, selector, array, or object to send
@constructor | [
"Provides",
"ajax",
"communication",
"methods",
"The",
"folllowing",
"methods",
"are",
"chainable",
"success",
"-",
"success",
"handler",
"failure",
"-",
"failure",
"handler",
"serialize",
"-",
"serialize",
"a",
"form",
"selector",
"array",
"or",
"object",
"to",
... | 49991293e621846e435992b764265abb13a7346b | https://github.com/nwtjs/nwt/blob/49991293e621846e435992b764265abb13a7346b/src/io/js/io.js#L32-L56 |
37,870 | nwtjs/nwt | src/io/js/io.js | function() {
var mythis = this;
this.req.onload = function() {
if (mythis.config.success) {
var response = new NWTIOResponse(mythis.req);
mythis.config.success(response);
}
};
this.req.onerror = function() {
if (mythis.config.failure) {
var response = new NWTIOResponse(mythis.req);
mythis.config.... | javascript | function() {
var mythis = this;
this.req.onload = function() {
if (mythis.config.success) {
var response = new NWTIOResponse(mythis.req);
mythis.config.success(response);
}
};
this.req.onerror = function() {
if (mythis.config.failure) {
var response = new NWTIOResponse(mythis.req);
mythis.config.... | [
"function",
"(",
")",
"{",
"var",
"mythis",
"=",
"this",
";",
"this",
".",
"req",
".",
"onload",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"mythis",
".",
"config",
".",
"success",
")",
"{",
"var",
"response",
"=",
"new",
"NWTIOResponse",
"(",
"myt... | Runs the IO call
@param string Type of call | [
"Runs",
"the",
"IO",
"call"
] | 49991293e621846e435992b764265abb13a7346b | https://github.com/nwtjs/nwt/blob/49991293e621846e435992b764265abb13a7346b/src/io/js/io.js#L63-L81 | |
37,871 | nwtjs/nwt | src/io/js/io.js | function(data, method) {
var urlencodedForm = true;
if (typeof data == 'string') {
this.ioData = data;
} else if (typeof data == 'object' && data._node) {
if (data.getAttribute('enctype')) {
urlencodedForm = false;
}
this.ioData = new FormData(data._node);
}
var req = this.req,
method = method... | javascript | function(data, method) {
var urlencodedForm = true;
if (typeof data == 'string') {
this.ioData = data;
} else if (typeof data == 'object' && data._node) {
if (data.getAttribute('enctype')) {
urlencodedForm = false;
}
this.ioData = new FormData(data._node);
}
var req = this.req,
method = method... | [
"function",
"(",
"data",
",",
"method",
")",
"{",
"var",
"urlencodedForm",
"=",
"true",
";",
"if",
"(",
"typeof",
"data",
"==",
"'string'",
")",
"{",
"this",
".",
"ioData",
"=",
"data",
";",
"}",
"else",
"if",
"(",
"typeof",
"data",
"==",
"'object'",... | Runs IO POST
We also use post for PUT or DELETE requests | [
"Runs",
"IO",
"POST",
"We",
"also",
"use",
"post",
"for",
"PUT",
"or",
"DELETE",
"requests"
] | 49991293e621846e435992b764265abb13a7346b | https://github.com/nwtjs/nwt/blob/49991293e621846e435992b764265abb13a7346b/src/io/js/io.js#L88-L115 | |
37,872 | nwtjs/nwt | src/io/js/io.js | function(data) {
// Strip out the old query string and append the new one
if (data) {
this.url = this.url.split('?', 1)[0] + '?' + data;
}
this.req.open('GET', this.url);
return this._run();
} | javascript | function(data) {
// Strip out the old query string and append the new one
if (data) {
this.url = this.url.split('?', 1)[0] + '?' + data;
}
this.req.open('GET', this.url);
return this._run();
} | [
"function",
"(",
"data",
")",
"{",
"// Strip out the old query string and append the new one",
"if",
"(",
"data",
")",
"{",
"this",
".",
"url",
"=",
"this",
".",
"url",
".",
"split",
"(",
"'?'",
",",
"1",
")",
"[",
"0",
"]",
"+",
"'?'",
"+",
"data",
";... | Runs IO GET
@param string We update the URL if we receive data to GET here | [
"Runs",
"IO",
"GET"
] | 49991293e621846e435992b764265abb13a7346b | https://github.com/nwtjs/nwt/blob/49991293e621846e435992b764265abb13a7346b/src/io/js/io.js#L122-L131 | |
37,873 | cludden/mycro | hooks/models.js | function(fn) {
asyncjs.each(modelNames, function(name, _fn) {
// get model definition
var modelDefinition = modelDefinitions[name];
modelDefinition.__name = name;
// get connection info
var connectionInfo = lib.findConnection(m... | javascript | function(fn) {
asyncjs.each(modelNames, function(name, _fn) {
// get model definition
var modelDefinition = modelDefinitions[name];
modelDefinition.__name = name;
// get connection info
var connectionInfo = lib.findConnection(m... | [
"function",
"(",
"fn",
")",
"{",
"asyncjs",
".",
"each",
"(",
"modelNames",
",",
"function",
"(",
"name",
",",
"_fn",
")",
"{",
"// get model definition",
"var",
"modelDefinition",
"=",
"modelDefinitions",
"[",
"name",
"]",
";",
"modelDefinition",
".",
"__na... | hand model definitions to the appropriate adapter for construction | [
"hand",
"model",
"definitions",
"to",
"the",
"appropriate",
"adapter",
"for",
"construction"
] | 762e6ba0f38f37497eefb933252edc2c16bfb40b | https://github.com/cludden/mycro/blob/762e6ba0f38f37497eefb933252edc2c16bfb40b/hooks/models.js#L33-L75 | |
37,874 | cludden/mycro | hooks/models.js | function(err, model) {
if (err) {
return _fn(err);
}
if (!model) {
return _fn('No model (' + name + ') returned from `adapter.registerModel`');
}
mycro.models[name] = model... | javascript | function(err, model) {
if (err) {
return _fn(err);
}
if (!model) {
return _fn('No model (' + name + ') returned from `adapter.registerModel`');
}
mycro.models[name] = model... | [
"function",
"(",
"err",
",",
"model",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"_fn",
"(",
"err",
")",
";",
"}",
"if",
"(",
"!",
"model",
")",
"{",
"return",
"_fn",
"(",
"'No model ('",
"+",
"name",
"+",
"') returned from `adapter.registerModel`... | hand off to adapter | [
"hand",
"off",
"to",
"adapter"
] | 762e6ba0f38f37497eefb933252edc2c16bfb40b | https://github.com/cludden/mycro/blob/762e6ba0f38f37497eefb933252edc2c16bfb40b/hooks/models.js#L57-L66 | |
37,875 | scienceai/graph-rdfa-processor | src/rdfa-processor.js | function(baseURI) {
var hash = baseURI.indexOf("#");
if (hash>=0) {
baseURI = baseURI.substring(0,hash);
}
if (options && options.baseURIMap) {
baseURI = options.baseURIMap(baseURI);
}
return baseURI;
} | javascript | function(baseURI) {
var hash = baseURI.indexOf("#");
if (hash>=0) {
baseURI = baseURI.substring(0,hash);
}
if (options && options.baseURIMap) {
baseURI = options.baseURIMap(baseURI);
}
return baseURI;
} | [
"function",
"(",
"baseURI",
")",
"{",
"var",
"hash",
"=",
"baseURI",
".",
"indexOf",
"(",
"\"#\"",
")",
";",
"if",
"(",
"hash",
">=",
"0",
")",
"{",
"baseURI",
"=",
"baseURI",
".",
"substring",
"(",
"0",
",",
"hash",
")",
";",
"}",
"if",
"(",
"... | Fix for Firefox that includes the hash in the base URI | [
"Fix",
"for",
"Firefox",
"that",
"includes",
"the",
"hash",
"in",
"the",
"base",
"URI"
] | 39e00b3d498b2081524843717b287dfaa946c261 | https://github.com/scienceai/graph-rdfa-processor/blob/39e00b3d498b2081524843717b287dfaa946c261/src/rdfa-processor.js#L289-L298 | |
37,876 | scott-wyatt/sails-stripe | templates/Subscription.template.js | function (subscription, cb) {
Subscription.findOrCreate(subscription.id, subscription)
.exec(function (err, foundSubscription){
if (err) return cb(err);
if (foundSubscription.lastStripeEvent > subscription.lastStripeEvent) return cb(null, foundSubscription);
if (foundSubscription.lastStripe... | javascript | function (subscription, cb) {
Subscription.findOrCreate(subscription.id, subscription)
.exec(function (err, foundSubscription){
if (err) return cb(err);
if (foundSubscription.lastStripeEvent > subscription.lastStripeEvent) return cb(null, foundSubscription);
if (foundSubscription.lastStripe... | [
"function",
"(",
"subscription",
",",
"cb",
")",
"{",
"Subscription",
".",
"findOrCreate",
"(",
"subscription",
".",
"id",
",",
"subscription",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundSubscription",
")",
"{",
"if",
"(",
"err",
")",
"ret... | Stripe Webhook customer.subscription.updated | [
"Stripe",
"Webhook",
"customer",
".",
"subscription",
".",
"updated"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Subscription.template.js#L126-L142 | |
37,877 | scott-wyatt/sails-stripe | templates/Subscription.template.js | function (subscription, cb) {
Subscription.destroy(subscription.id)
.exec(function (err, destroyedSubscriptions){
if (err) return cb(err);
if (!destroyedSubscriptions) return cb(null, subscription);
Subscription.afterStripeCustomerSubscriptionDeleted(destroyedSubscriptions[0], function(err,... | javascript | function (subscription, cb) {
Subscription.destroy(subscription.id)
.exec(function (err, destroyedSubscriptions){
if (err) return cb(err);
if (!destroyedSubscriptions) return cb(null, subscription);
Subscription.afterStripeCustomerSubscriptionDeleted(destroyedSubscriptions[0], function(err,... | [
"function",
"(",
"subscription",
",",
"cb",
")",
"{",
"Subscription",
".",
"destroy",
"(",
"subscription",
".",
"id",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"destroyedSubscriptions",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"e... | Stripe Webhook customer.subscription.deleted | [
"Stripe",
"Webhook",
"customer",
".",
"subscription",
".",
"deleted"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Subscription.template.js#L150-L160 | |
37,878 | ChrisWren/mdlint | index.js | fetchRepoREADME | function fetchRepoREADME (repo) {
request({
uri: 'https://api.github.com/repos/' + repo + '/readme',
headers: _.extend(headers, {
// Get raw README content
'Accept': 'application/vnd.github.VERSION.raw'
})
},
function (error, response, body) {
if (!error && response.statusCode === 200... | javascript | function fetchRepoREADME (repo) {
request({
uri: 'https://api.github.com/repos/' + repo + '/readme',
headers: _.extend(headers, {
// Get raw README content
'Accept': 'application/vnd.github.VERSION.raw'
})
},
function (error, response, body) {
if (!error && response.statusCode === 200... | [
"function",
"fetchRepoREADME",
"(",
"repo",
")",
"{",
"request",
"(",
"{",
"uri",
":",
"'https://api.github.com/repos/'",
"+",
"repo",
"+",
"'/readme'",
",",
"headers",
":",
"_",
".",
"extend",
"(",
"headers",
",",
"{",
"// Get raw README content",
"'Accept'",
... | Fetches a README from GitHub
@param {String} repo URL of repo to fetch | [
"Fetches",
"a",
"README",
"from",
"GitHub"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L162-L183 |
37,879 | ChrisWren/mdlint | index.js | lintMarkdown | function lintMarkdown (body, file) {
var codeBlocks = parseMarkdown(body);
didLogFileBreak = false;
var failedCodeBlocks = _.reject(_.compact(codeBlocks), function (codeBlock) {
return validateCodeBlock(codeBlock, file);
});
numFilesToParse--;
if (failedCodeBlocks.length === 0) {
if (program.ver... | javascript | function lintMarkdown (body, file) {
var codeBlocks = parseMarkdown(body);
didLogFileBreak = false;
var failedCodeBlocks = _.reject(_.compact(codeBlocks), function (codeBlock) {
return validateCodeBlock(codeBlock, file);
});
numFilesToParse--;
if (failedCodeBlocks.length === 0) {
if (program.ver... | [
"function",
"lintMarkdown",
"(",
"body",
",",
"file",
")",
"{",
"var",
"codeBlocks",
"=",
"parseMarkdown",
"(",
"body",
")",
";",
"didLogFileBreak",
"=",
"false",
";",
"var",
"failedCodeBlocks",
"=",
"_",
".",
"reject",
"(",
"_",
".",
"compact",
"(",
"co... | Parses the JavaScript code blocks from the markdown file
@param {String} body Body of markdown file
@param {String} file Filename | [
"Parses",
"the",
"JavaScript",
"code",
"blocks",
"from",
"the",
"markdown",
"file"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L226-L252 |
37,880 | ChrisWren/mdlint | index.js | logFileBreak | function logFileBreak (text) {
if (numFailedFiles % 2 === 0) {
console.log(text.yellow.inverse);
} else {
console.log(text.blue.inverse);
}
} | javascript | function logFileBreak (text) {
if (numFailedFiles % 2 === 0) {
console.log(text.yellow.inverse);
} else {
console.log(text.blue.inverse);
}
} | [
"function",
"logFileBreak",
"(",
"text",
")",
"{",
"if",
"(",
"numFailedFiles",
"%",
"2",
"===",
"0",
")",
"{",
"console",
".",
"log",
"(",
"text",
".",
"yellow",
".",
"inverse",
")",
";",
"}",
"else",
"{",
"console",
".",
"log",
"(",
"text",
".",
... | Logs a break between files for readability
@param {String} text Text to log | [
"Logs",
"a",
"break",
"between",
"files",
"for",
"readability"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L258-L264 |
37,881 | ChrisWren/mdlint | index.js | validateCodeBlock | function validateCodeBlock (codeBlock, file) {
var lang = codeBlock.lang;
var code = codeBlock.code;
if (lang === 'json') {
try {
JSON.parse(code);
} catch (e) {
console.log(e);
console.log(code);
return false;
}
return true;
} else if (lang === 'js' || lang === 'javascr... | javascript | function validateCodeBlock (codeBlock, file) {
var lang = codeBlock.lang;
var code = codeBlock.code;
if (lang === 'json') {
try {
JSON.parse(code);
} catch (e) {
console.log(e);
console.log(code);
return false;
}
return true;
} else if (lang === 'js' || lang === 'javascr... | [
"function",
"validateCodeBlock",
"(",
"codeBlock",
",",
"file",
")",
"{",
"var",
"lang",
"=",
"codeBlock",
".",
"lang",
";",
"var",
"code",
"=",
"codeBlock",
".",
"code",
";",
"if",
"(",
"lang",
"===",
"'json'",
")",
"{",
"try",
"{",
"JSON",
".",
"pa... | Validates that code blocks are valid JavaScript
@param {Object} code A block of code from the markdown file containg the lang and code
@param {String} file Name of file currently being validated | [
"Validates",
"that",
"code",
"blocks",
"are",
"valid",
"JavaScript"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L271-L315 |
37,882 | ChrisWren/mdlint | index.js | getAuthToken | function getAuthToken () {
console.log('You have hit the rate limit for unauthenticated requests, please log in to raise your rate limit:\n'.red);
program.prompt('GitHub Username: ', function (user) {
console.log('\nAfter entering your password, hit return' + ' twice.\n'.green);
var authProcess = spawn('c... | javascript | function getAuthToken () {
console.log('You have hit the rate limit for unauthenticated requests, please log in to raise your rate limit:\n'.red);
program.prompt('GitHub Username: ', function (user) {
console.log('\nAfter entering your password, hit return' + ' twice.\n'.green);
var authProcess = spawn('c... | [
"function",
"getAuthToken",
"(",
")",
"{",
"console",
".",
"log",
"(",
"'You have hit the rate limit for unauthenticated requests, please log in to raise your rate limit:\\n'",
".",
"red",
")",
";",
"program",
".",
"prompt",
"(",
"'GitHub Username: '",
",",
"function",
"(",... | Retrieves an auth token so that the user can exceed the uauthenticated rate limit | [
"Retrieves",
"an",
"auth",
"token",
"so",
"that",
"the",
"user",
"can",
"exceed",
"the",
"uauthenticated",
"rate",
"limit"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L320-L350 |
37,883 | ChrisWren/mdlint | index.js | preprocessCode | function preprocessCode (code) {
// Remove starting comments
while (code.indexOf('//') === 0) {
code = code.slice(code.indexOf('\n'));
}
// Starts with an object literal
if (code.indexOf('{') === 0) {
code = 'var json = ' + code;
// Starts with an object property
} else if (code.indexOf(':') !=... | javascript | function preprocessCode (code) {
// Remove starting comments
while (code.indexOf('//') === 0) {
code = code.slice(code.indexOf('\n'));
}
// Starts with an object literal
if (code.indexOf('{') === 0) {
code = 'var json = ' + code;
// Starts with an object property
} else if (code.indexOf(':') !=... | [
"function",
"preprocessCode",
"(",
"code",
")",
"{",
"// Remove starting comments",
"while",
"(",
"code",
".",
"indexOf",
"(",
"'//'",
")",
"===",
"0",
")",
"{",
"code",
"=",
"code",
".",
"slice",
"(",
"code",
".",
"indexOf",
"(",
"'\\n'",
")",
")",
";... | Preprocesses the code block and re-formats it to allow for partial code
@param {String} code A block of code from the markdown file
@return {String} Processed code transformed from partial code | [
"Preprocesses",
"the",
"code",
"block",
"and",
"re",
"-",
"formats",
"it",
"to",
"allow",
"for",
"partial",
"code"
] | 15acc4b044f102644cba907699e793aecd053ab7 | https://github.com/ChrisWren/mdlint/blob/15acc4b044f102644cba907699e793aecd053ab7/index.js#L357-L381 |
37,884 | tprobinson/node-simple-dockerode | lib/processExec.js | processExec | function processExec(opts, createOpts, execOpts, callback) {
this.execRaw(createOpts, (createErr, exec) => {
if( createErr ) { callback(createErr); return }
exec.start(execOpts, (execErr, stream) => {
if( execErr ) { callback(execErr); return }
if( 'live' in opts && opts.live ) {
// If the user wants li... | javascript | function processExec(opts, createOpts, execOpts, callback) {
this.execRaw(createOpts, (createErr, exec) => {
if( createErr ) { callback(createErr); return }
exec.start(execOpts, (execErr, stream) => {
if( execErr ) { callback(execErr); return }
if( 'live' in opts && opts.live ) {
// If the user wants li... | [
"function",
"processExec",
"(",
"opts",
",",
"createOpts",
",",
"execOpts",
",",
"callback",
")",
"{",
"this",
".",
"execRaw",
"(",
"createOpts",
",",
"(",
"createErr",
",",
"exec",
")",
"=>",
"{",
"if",
"(",
"createErr",
")",
"{",
"callback",
"(",
"cr... | A version of exec that wraps Dockerode's, reducing the stream handling for most use cases.
@param {Array<string>} Cmd The command to execute, in exec array form.
@param {Object} opts Object of options.
@param {boolean} opts.stdout True/false, if true, user will receive a stdout key with the output
@param {boolean} opts... | [
"A",
"version",
"of",
"exec",
"that",
"wraps",
"Dockerode",
"s",
"reducing",
"the",
"stream",
"handling",
"for",
"most",
"use",
"cases",
"."
] | b201490ac82859d560e5a687fee7a8410700a87a | https://github.com/tprobinson/node-simple-dockerode/blob/b201490ac82859d560e5a687fee7a8410700a87a/lib/processExec.js#L17-L103 |
37,885 | brandonheyer/mazejs | js/foundation/foundation.forms.js | function() {
// Internal reference.
var _self = this;
// Loop through our hidden element collection.
_self.hidden.each( function( i ) {
// Cache this element.
var $elem = $( this ),
_tmp = _self.tmp[ i ]; // Get the stored 'style' value for this element.... | javascript | function() {
// Internal reference.
var _self = this;
// Loop through our hidden element collection.
_self.hidden.each( function( i ) {
// Cache this element.
var $elem = $( this ),
_tmp = _self.tmp[ i ]; // Get the stored 'style' value for this element.... | [
"function",
"(",
")",
"{",
"// Internal reference.",
"var",
"_self",
"=",
"this",
";",
"// Loop through our hidden element collection.",
"_self",
".",
"hidden",
".",
"each",
"(",
"function",
"(",
"i",
")",
"{",
"// Cache this element.",
"var",
"$elem",
"=",
"$",
... | end adjust
Resets the elements previous state.
@method reset | [
"end",
"adjust",
"Resets",
"the",
"elements",
"previous",
"state",
"."
] | 5efffc0279eeb061a71ba243313d165c16300fe6 | https://github.com/brandonheyer/mazejs/blob/5efffc0279eeb061a71ba243313d165c16300fe6/js/foundation/foundation.forms.js#L396-L419 | |
37,886 | scott-wyatt/sails-stripe | templates/Transfer.template.js | function (transfer, cb) {
Transfer.findOrCreate(transfer.id, transfer)
.exec(function (err, foundTransfer){
if (err) return cb(err);
if (foundTransfer.lastStripeEvent > transfer.lastStripeEvent) return cb(null, foundTransfer);
if (foundTransfer.lastStripeEvent == transfer.lastStripeEvent) r... | javascript | function (transfer, cb) {
Transfer.findOrCreate(transfer.id, transfer)
.exec(function (err, foundTransfer){
if (err) return cb(err);
if (foundTransfer.lastStripeEvent > transfer.lastStripeEvent) return cb(null, foundTransfer);
if (foundTransfer.lastStripeEvent == transfer.lastStripeEvent) r... | [
"function",
"(",
"transfer",
",",
"cb",
")",
"{",
"Transfer",
".",
"findOrCreate",
"(",
"transfer",
".",
"id",
",",
"transfer",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundTransfer",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",... | Stripe Webhook transfer.created | [
"Stripe",
"Webhook",
"transfer",
".",
"created"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Transfer.template.js#L102-L118 | |
37,887 | nfroidure/jsarch | src/jsarch.js | initJSArch | async function initJSArch({ CONFIG, EOL, glob, fs, parser, log = noop }) {
return jsArch;
/**
* Compile an run a template
* @param {Object} options
* Options (destructured)
* @param {Object} options.cwd
* Current working directory
* @param {Object} options.patterns
* Patterns to look fil... | javascript | async function initJSArch({ CONFIG, EOL, glob, fs, parser, log = noop }) {
return jsArch;
/**
* Compile an run a template
* @param {Object} options
* Options (destructured)
* @param {Object} options.cwd
* Current working directory
* @param {Object} options.patterns
* Patterns to look fil... | [
"async",
"function",
"initJSArch",
"(",
"{",
"CONFIG",
",",
"EOL",
",",
"glob",
",",
"fs",
",",
"parser",
",",
"log",
"=",
"noop",
"}",
")",
"{",
"return",
"jsArch",
";",
"/**\n * Compile an run a template\n * @param {Object} options\n * Options (destructured)... | Declare jsArch in the dependency injection system
@param {Object} services
Services (provided by the dependency injector)
@param {Object} services.CONFIG
The JSArch config
@param {Object} services.EOL
The OS EOL chars
@param {Object} services.glob
Globbing service
@param {Object} services.fs
File system servi... | [
"Declare",
"jsArch",
"in",
"the",
"dependency",
"injection",
"system"
] | df23251b90d64794d733d4fdebfbb31a03b9fe1c | https://github.com/nfroidure/jsarch/blob/df23251b90d64794d733d4fdebfbb31a03b9fe1c/src/jsarch.js#L102-L198 |
37,888 | byron-dupreez/aws-core-utils | dynamodb-doc-client-utils.js | getItem | function getItem(tableName, key, opts, desc, context) {
try {
const params = {
TableName: tableName,
Key: key
};
if (opts) merge(opts, params, mergeOpts);
if (context.traceEnabled) context.trace(`Loading ${desc} from ${tableName} using params (${JSON.stringify(params)})`);
return con... | javascript | function getItem(tableName, key, opts, desc, context) {
try {
const params = {
TableName: tableName,
Key: key
};
if (opts) merge(opts, params, mergeOpts);
if (context.traceEnabled) context.trace(`Loading ${desc} from ${tableName} using params (${JSON.stringify(params)})`);
return con... | [
"function",
"getItem",
"(",
"tableName",
",",
"key",
",",
"opts",
",",
"desc",
",",
"context",
")",
"{",
"try",
"{",
"const",
"params",
"=",
"{",
"TableName",
":",
"tableName",
",",
"Key",
":",
"key",
"}",
";",
"if",
"(",
"opts",
")",
"merge",
"(",... | Gets the item with the given key from the named DynamoDB table.
@param {string} tableName - the name of the DynamoDB table from which to load
@param {K} key - the key of the item to get
@param {DynamoGetOpts|undefined} [opts] - optional DynamoDB `get` parameter options to use
@param {string} desc - a description of the... | [
"Gets",
"the",
"item",
"with",
"the",
"given",
"key",
"from",
"the",
"named",
"DynamoDB",
"table",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/dynamodb-doc-client-utils.js#L33-L60 |
37,889 | byron-dupreez/aws-core-utils | dynamodb-doc-client-utils.js | updateProjectionExpression | function updateProjectionExpression(opts, expressions) {
if (!expressions || !Array.isArray(expressions) || expressions.length <= 0) return opts;
if (!opts) opts = {};
const projectionExpressions = opts.ProjectionExpression ?
opts.ProjectionExpression.split(',').filter(isNotBlank).map(trim) : [];
expressi... | javascript | function updateProjectionExpression(opts, expressions) {
if (!expressions || !Array.isArray(expressions) || expressions.length <= 0) return opts;
if (!opts) opts = {};
const projectionExpressions = opts.ProjectionExpression ?
opts.ProjectionExpression.split(',').filter(isNotBlank).map(trim) : [];
expressi... | [
"function",
"updateProjectionExpression",
"(",
"opts",
",",
"expressions",
")",
"{",
"if",
"(",
"!",
"expressions",
"||",
"!",
"Array",
".",
"isArray",
"(",
"expressions",
")",
"||",
"expressions",
".",
"length",
"<=",
"0",
")",
"return",
"opts",
";",
"if"... | Updates the ProjectionExpression property of the given opts with the given extra expressions.
@param {DynamoGetOpts|DynamoQueryOpts|Object|undefined} opts - the options to update
@param {string[]} expressions - the expressions to add
@return {DynamoGetOpts|DynamoQueryOpts|Object} the updated options | [
"Updates",
"the",
"ProjectionExpression",
"property",
"of",
"the",
"given",
"opts",
"with",
"the",
"given",
"extra",
"expressions",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/dynamodb-doc-client-utils.js#L68-L84 |
37,890 | byron-dupreez/aws-core-utils | dynamodb-doc-client-utils.js | updateExpressionAttributeNames | function updateExpressionAttributeNames(opts, expressionAttributeNames) {
if (!expressionAttributeNames || typeof expressionAttributeNames !== 'object') return opts;
if (!opts) opts = {};
if (!opts.ExpressionAttributeNames) opts.ExpressionAttributeNames = {};
const keys = Object.getOwnPropertyNames(expressionA... | javascript | function updateExpressionAttributeNames(opts, expressionAttributeNames) {
if (!expressionAttributeNames || typeof expressionAttributeNames !== 'object') return opts;
if (!opts) opts = {};
if (!opts.ExpressionAttributeNames) opts.ExpressionAttributeNames = {};
const keys = Object.getOwnPropertyNames(expressionA... | [
"function",
"updateExpressionAttributeNames",
"(",
"opts",
",",
"expressionAttributeNames",
")",
"{",
"if",
"(",
"!",
"expressionAttributeNames",
"||",
"typeof",
"expressionAttributeNames",
"!==",
"'object'",
")",
"return",
"opts",
";",
"if",
"(",
"!",
"opts",
")",
... | Updates the ExpressionAttributeNames map of the given opts with the given map of extra expression attribute names.
@param {DynamoGetOpts|DynamoQueryOpts|Object|undefined} opts - the options to update
@param {Object.<string, string>} expressionAttributeNames - the map of extra expression attribute names to add
@return {... | [
"Updates",
"the",
"ExpressionAttributeNames",
"map",
"of",
"the",
"given",
"opts",
"with",
"the",
"given",
"map",
"of",
"extra",
"expression",
"attribute",
"names",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/dynamodb-doc-client-utils.js#L92-L103 |
37,891 | byron-dupreez/aws-core-utils | dynamodb-doc-client-utils.js | updateExpressionAttributeValues | function updateExpressionAttributeValues(opts, expressionAttributeValues) {
if (!expressionAttributeValues || typeof expressionAttributeValues !== 'object') return opts;
if (!opts) opts = {};
if (!opts.ExpressionAttributeValues) opts.ExpressionAttributeValues = {};
const keys = Object.getOwnPropertyNames(expre... | javascript | function updateExpressionAttributeValues(opts, expressionAttributeValues) {
if (!expressionAttributeValues || typeof expressionAttributeValues !== 'object') return opts;
if (!opts) opts = {};
if (!opts.ExpressionAttributeValues) opts.ExpressionAttributeValues = {};
const keys = Object.getOwnPropertyNames(expre... | [
"function",
"updateExpressionAttributeValues",
"(",
"opts",
",",
"expressionAttributeValues",
")",
"{",
"if",
"(",
"!",
"expressionAttributeValues",
"||",
"typeof",
"expressionAttributeValues",
"!==",
"'object'",
")",
"return",
"opts",
";",
"if",
"(",
"!",
"opts",
"... | Updates the ExpressionAttributeValues map of the given opts with the given map of extra expression attribute names.
@param {DynamoQueryOpts|Object|undefined} opts - the options to update
@param {Object.<string, string>} expressionAttributeValues - the map of extra expression attribute names to add
@return {DynamoQueryO... | [
"Updates",
"the",
"ExpressionAttributeValues",
"map",
"of",
"the",
"given",
"opts",
"with",
"the",
"given",
"map",
"of",
"extra",
"expression",
"attribute",
"names",
"."
] | 2530155b5afc102f61658b28183a16027ecae86a | https://github.com/byron-dupreez/aws-core-utils/blob/2530155b5afc102f61658b28183a16027ecae86a/dynamodb-doc-client-utils.js#L111-L122 |
37,892 | scott-wyatt/sails-stripe | templates/Card.template.js | function (card, cb) {
Card.findOrCreate(card.id, card)
.exec(function (err, foundCard){
if (err) return cb(err);
if (foundCard.lastStripeEvent > card.lastStripeEvent) return cb(null, foundCard);
if (foundCard.lastStripeEvent == card.lastStripeEvent) return Card.afterStripeCustomerCardUpdate... | javascript | function (card, cb) {
Card.findOrCreate(card.id, card)
.exec(function (err, foundCard){
if (err) return cb(err);
if (foundCard.lastStripeEvent > card.lastStripeEvent) return cb(null, foundCard);
if (foundCard.lastStripeEvent == card.lastStripeEvent) return Card.afterStripeCustomerCardUpdate... | [
"function",
"(",
"card",
",",
"cb",
")",
"{",
"Card",
".",
"findOrCreate",
"(",
"card",
".",
"id",
",",
"card",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"foundCard",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"err",
")",
"... | Stripe Webhook customer.card.updated | [
"Stripe",
"Webhook",
"customer",
".",
"card",
".",
"updated"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Card.template.js#L111-L127 | |
37,893 | scott-wyatt/sails-stripe | templates/Card.template.js | function (card, cb) {
Card.destroy(card.id)
.exec(function (err, destroyedCards){
if (err) return cb(err);
if (!destroyedCards) return cb(null, null);
Card.afterStripeCustomerCardDeleted(destroyedCards[0], function(err, card){
cb(null, card);
});
});
} | javascript | function (card, cb) {
Card.destroy(card.id)
.exec(function (err, destroyedCards){
if (err) return cb(err);
if (!destroyedCards) return cb(null, null);
Card.afterStripeCustomerCardDeleted(destroyedCards[0], function(err, card){
cb(null, card);
});
});
} | [
"function",
"(",
"card",
",",
"cb",
")",
"{",
"Card",
".",
"destroy",
"(",
"card",
".",
"id",
")",
".",
"exec",
"(",
"function",
"(",
"err",
",",
"destroyedCards",
")",
"{",
"if",
"(",
"err",
")",
"return",
"cb",
"(",
"err",
")",
";",
"if",
"("... | Stripe Webhook customer.card.deleted | [
"Stripe",
"Webhook",
"customer",
".",
"card",
".",
"deleted"
] | 0766bc04a6893a07c842170f37b37200d6771425 | https://github.com/scott-wyatt/sails-stripe/blob/0766bc04a6893a07c842170f37b37200d6771425/templates/Card.template.js#L135-L145 | |
37,894 | contactlab/ikonograph | demo/svgxuse.js | getOrigin | function getOrigin(loc) {
var a;
if (loc.protocol !== undefined) {
a = loc;
} else {
a = document.createElement("a");
a.href = loc;
}
return a.protocol.replace(/:/g, "") + a.host;
... | javascript | function getOrigin(loc) {
var a;
if (loc.protocol !== undefined) {
a = loc;
} else {
a = document.createElement("a");
a.href = loc;
}
return a.protocol.replace(/:/g, "") + a.host;
... | [
"function",
"getOrigin",
"(",
"loc",
")",
"{",
"var",
"a",
";",
"if",
"(",
"loc",
".",
"protocol",
"!==",
"undefined",
")",
"{",
"a",
"=",
"loc",
";",
"}",
"else",
"{",
"a",
"=",
"document",
".",
"createElement",
"(",
"\"a\"",
")",
";",
"a",
".",... | In IE 9, cross origin requests can only be sent using XDomainRequest. XDomainRequest would fail if CORS headers are not set. Therefore, XDomainRequest should only be used with cross origin requests. | [
"In",
"IE",
"9",
"cross",
"origin",
"requests",
"can",
"only",
"be",
"sent",
"using",
"XDomainRequest",
".",
"XDomainRequest",
"would",
"fail",
"if",
"CORS",
"headers",
"are",
"not",
"set",
".",
"Therefore",
"XDomainRequest",
"should",
"only",
"be",
"used",
... | f95a8fa571d3143aa6ad3542b21681a04f5d235e | https://github.com/contactlab/ikonograph/blob/f95a8fa571d3143aa6ad3542b21681a04f5d235e/demo/svgxuse.js#L53-L62 |
37,895 | Fizzadar/selected.js | selected/selected.js | function(ev) {
var regex = new RegExp(searchBox.value, 'i'),
targets = optionsList.querySelectorAll('li');
for (var i=0; i<targets.length; i++) {
var target = targets[i];
// With multiple active options are never shown in the options list, with s... | javascript | function(ev) {
var regex = new RegExp(searchBox.value, 'i'),
targets = optionsList.querySelectorAll('li');
for (var i=0; i<targets.length; i++) {
var target = targets[i];
// With multiple active options are never shown in the options list, with s... | [
"function",
"(",
"ev",
")",
"{",
"var",
"regex",
"=",
"new",
"RegExp",
"(",
"searchBox",
".",
"value",
",",
"'i'",
")",
",",
"targets",
"=",
"optionsList",
".",
"querySelectorAll",
"(",
"'li'",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
... | Filter options list by searchbox results | [
"Filter",
"options",
"list",
"by",
"searchbox",
"results"
] | 0fd1c02ddf0b9e7f1796a88744b3fc8be811bfb3 | https://github.com/Fizzadar/selected.js/blob/0fd1c02ddf0b9e7f1796a88744b3fc8be811bfb3/selected/selected.js#L70-L91 | |
37,896 | Fizzadar/selected.js | selected/selected.js | function(option, selected) {
var item = document.createElement('li');
item.textContent = option.textContent;
var activate = function() {
// If multiple we just remove this option from the list
if (multiple) {
item.style.display = '... | javascript | function(option, selected) {
var item = document.createElement('li');
item.textContent = option.textContent;
var activate = function() {
// If multiple we just remove this option from the list
if (multiple) {
item.style.display = '... | [
"function",
"(",
"option",
",",
"selected",
")",
"{",
"var",
"item",
"=",
"document",
".",
"createElement",
"(",
"'li'",
")",
";",
"item",
".",
"textContent",
"=",
"option",
".",
"textContent",
";",
"var",
"activate",
"=",
"function",
"(",
")",
"{",
"/... | Create "deselected" option this is here because we _always_ have a full list of items in the optionList basically this means when we deselect something, it will always return to the original list position, rather than appending to the end | [
"Create",
"deselected",
"option",
"this",
"is",
"here",
"because",
"we",
"_always_",
"have",
"a",
"full",
"list",
"of",
"items",
"in",
"the",
"optionList",
"basically",
"this",
"means",
"when",
"we",
"deselect",
"something",
"it",
"will",
"always",
"return",
... | 0fd1c02ddf0b9e7f1796a88744b3fc8be811bfb3 | https://github.com/Fizzadar/selected.js/blob/0fd1c02ddf0b9e7f1796a88744b3fc8be811bfb3/selected/selected.js#L98-L130 | |
37,897 | daffl/connect-injector | lib/connect-injector.js | function () {
var self = this;
if (typeof this._isIntercepted === 'undefined') {
// Got through all injector objects
each(res.injectors, function (obj) {
if (obj.when(req, res)) {
self._isIntercepted = true;
obj.active = true;
}
... | javascript | function () {
var self = this;
if (typeof this._isIntercepted === 'undefined') {
// Got through all injector objects
each(res.injectors, function (obj) {
if (obj.when(req, res)) {
self._isIntercepted = true;
obj.active = true;
}
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"typeof",
"this",
".",
"_isIntercepted",
"===",
"'undefined'",
")",
"{",
"// Got through all injector objects",
"each",
"(",
"res",
".",
"injectors",
",",
"function",
"(",
"obj",
")",
"... | Checks if this response should be intercepted | [
"Checks",
"if",
"this",
"response",
"should",
"be",
"intercepted"
] | a23b7c93b60464ca43273c58cba2c07b890124f0 | https://github.com/daffl/connect-injector/blob/a23b7c93b60464ca43273c58cba2c07b890124f0/lib/connect-injector.js#L42-L59 | |
37,898 | daffl/connect-injector | lib/connect-injector.js | function(status, reasonPhrase, headers) {
var self = this;
each(headers || reasonPhrase, function(value, name) {
self.setHeader(name, value);
});
return this._super(status, typeof reasonPhrase === 'string' ? reasonPhrase : undefined);
} | javascript | function(status, reasonPhrase, headers) {
var self = this;
each(headers || reasonPhrase, function(value, name) {
self.setHeader(name, value);
});
return this._super(status, typeof reasonPhrase === 'string' ? reasonPhrase : undefined);
} | [
"function",
"(",
"status",
",",
"reasonPhrase",
",",
"headers",
")",
"{",
"var",
"self",
"=",
"this",
";",
"each",
"(",
"headers",
"||",
"reasonPhrase",
",",
"function",
"(",
"value",
",",
"name",
")",
"{",
"self",
".",
"setHeader",
"(",
"name",
",",
... | Overwrite writeHead since it can also set the headers and we need to override the transfer-encoding | [
"Overwrite",
"writeHead",
"since",
"it",
"can",
"also",
"set",
"the",
"headers",
"and",
"we",
"need",
"to",
"override",
"the",
"transfer",
"-",
"encoding"
] | a23b7c93b60464ca43273c58cba2c07b890124f0 | https://github.com/daffl/connect-injector/blob/a23b7c93b60464ca43273c58cba2c07b890124f0/lib/connect-injector.js#L74-L82 | |
37,899 | daffl/connect-injector | lib/connect-injector.js | function (chunk, encoding) {
if (this._interceptCheck()) {
if(!this._interceptBuffer) {
debug('initializing _interceptBuffer');
this._interceptBuffer = new WritableStream();
}
return this._interceptBuffer.write(chunk, encoding);
}
return th... | javascript | function (chunk, encoding) {
if (this._interceptCheck()) {
if(!this._interceptBuffer) {
debug('initializing _interceptBuffer');
this._interceptBuffer = new WritableStream();
}
return this._interceptBuffer.write(chunk, encoding);
}
return th... | [
"function",
"(",
"chunk",
",",
"encoding",
")",
"{",
"if",
"(",
"this",
".",
"_interceptCheck",
"(",
")",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_interceptBuffer",
")",
"{",
"debug",
"(",
"'initializing _interceptBuffer'",
")",
";",
"this",
".",
"_inter... | Write into the buffer if this request is intercepted | [
"Write",
"into",
"the",
"buffer",
"if",
"this",
"request",
"is",
"intercepted"
] | a23b7c93b60464ca43273c58cba2c07b890124f0 | https://github.com/daffl/connect-injector/blob/a23b7c93b60464ca43273c58cba2c07b890124f0/lib/connect-injector.js#L85-L96 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.