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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
41,500 | chad-autry/hex-grid-map-3D | jsdoc-template/publish.js | linkToSrc | function linkToSrc(shortPath, lineNumber) {
var splitPath = shortPath.split("/");
return '<a href="{{srcroot}}' + shortPath+'">' + splitPath[splitPath.length - 1] + '</a>, <a href="{{srcroot}}' + shortPath+'#L'+lineNumber+'">' + lineNumber + '</a>';
} | javascript | function linkToSrc(shortPath, lineNumber) {
var splitPath = shortPath.split("/");
return '<a href="{{srcroot}}' + shortPath+'">' + splitPath[splitPath.length - 1] + '</a>, <a href="{{srcroot}}' + shortPath+'#L'+lineNumber+'">' + lineNumber + '</a>';
} | [
"function",
"linkToSrc",
"(",
"shortPath",
",",
"lineNumber",
")",
"{",
"var",
"splitPath",
"=",
"shortPath",
".",
"split",
"(",
"\"/\"",
")",
";",
"return",
"'<a href=\"{{srcroot}}'",
"+",
"shortPath",
"+",
"'\">'",
"+",
"splitPath",
"[",
"splitPath",
".",
... | Create links to the src relative to the external source url
Adds a link to the line number according to github's format
Since JSDoc seems incapable of accept external parameters, inject a value which will be replaced in Angular | [
"Create",
"links",
"to",
"the",
"src",
"relative",
"to",
"the",
"external",
"source",
"url",
"Adds",
"a",
"link",
"to",
"the",
"line",
"number",
"according",
"to",
"github",
"s",
"format",
"Since",
"JSDoc",
"seems",
"incapable",
"of",
"accept",
"external",
... | 4c80bcb2580b2ba573df257b40082de97e8938e8 | https://github.com/chad-autry/hex-grid-map-3D/blob/4c80bcb2580b2ba573df257b40082de97e8938e8/jsdoc-template/publish.js#L393-L397 |
41,501 | alawatthe/MathLib | build/commonjs/SVG.js | function (circle, options, redraw) {
if (typeof options === "undefined") { options = {}; }
if (typeof redraw === "undefined") { redraw = false; }
var screen = this.screen, prop, opts, svgCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
svgCircle... | javascript | function (circle, options, redraw) {
if (typeof options === "undefined") { options = {}; }
if (typeof redraw === "undefined") { redraw = false; }
var screen = this.screen, prop, opts, svgCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
svgCircle... | [
"function",
"(",
"circle",
",",
"options",
",",
"redraw",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"\"undefined\"",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"typeof",
"redraw",
"===",
"\"undefined\"",
")",
"{",
"redraw",
"=",
... | Draws a circle on the screen.
@param {Circle} circle The circle to be drawn
@param {drawingOptions} options Optional drawing options
@param {boolean} redraw Indicates if the current draw call is happening during a redraw
@return {Screen} Returns the screen | [
"Draws",
"a",
"circle",
"on",
"the",
"screen",
"."
] | 43dbd35263da672bd2ca41f93dc447b60da9bdac | https://github.com/alawatthe/MathLib/blob/43dbd35263da672bd2ca41f93dc447b60da9bdac/build/commonjs/SVG.js#L32-L62 | |
41,502 | wbyoung/azul | lib/relations/has_many_prefetch.js | function(instances) {
var queryKey = this.foreignKey;
var pks = _.map(instances, this.primaryKey);
if (instances.length === 1) { pks = pks[0]; }
else { queryKey += '$in'; }
var where = _.object([[queryKey, pks]]);
return this._relatedModel.objects.where(where);
} | javascript | function(instances) {
var queryKey = this.foreignKey;
var pks = _.map(instances, this.primaryKey);
if (instances.length === 1) { pks = pks[0]; }
else { queryKey += '$in'; }
var where = _.object([[queryKey, pks]]);
return this._relatedModel.objects.where(where);
} | [
"function",
"(",
"instances",
")",
"{",
"var",
"queryKey",
"=",
"this",
".",
"foreignKey",
";",
"var",
"pks",
"=",
"_",
".",
"map",
"(",
"instances",
",",
"this",
".",
"primaryKey",
")",
";",
"if",
"(",
"instances",
".",
"length",
"===",
"1",
")",
... | Generate the prefetch query.
Subclasses can override this.
@method
@protected
@see {@link HasMany#_prefetch} | [
"Generate",
"the",
"prefetch",
"query",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many_prefetch.js#L47-L56 | |
41,503 | alawatthe/MathLib | build/MathLib.js | function (options) {
var convertedOptions = {};
if ('fillColor' in options) {
convertedOptions.fillStyle = MathLib.colorConvert(options.fillColor);
} else if ('color' in options) {
convertedOptions.fillStyle = MathLib.colorConvert(options.color);
... | javascript | function (options) {
var convertedOptions = {};
if ('fillColor' in options) {
convertedOptions.fillStyle = MathLib.colorConvert(options.fillColor);
} else if ('color' in options) {
convertedOptions.fillStyle = MathLib.colorConvert(options.color);
... | [
"function",
"(",
"options",
")",
"{",
"var",
"convertedOptions",
"=",
"{",
"}",
";",
"if",
"(",
"'fillColor'",
"in",
"options",
")",
"{",
"convertedOptions",
".",
"fillStyle",
"=",
"MathLib",
".",
"colorConvert",
"(",
"options",
".",
"fillColor",
")",
";",... | Converts the options to the Canvas options format
@param {drawingOptions} options The drawing options
@return {canvasDrawingOptions} The converted options | [
"Converts",
"the",
"options",
"to",
"the",
"Canvas",
"options",
"format"
] | 43dbd35263da672bd2ca41f93dc447b60da9bdac | https://github.com/alawatthe/MathLib/blob/43dbd35263da672bd2ca41f93dc447b60da9bdac/build/MathLib.js#L4325-L4349 | |
41,504 | alawatthe/MathLib | build/MathLib.js | function (line, options, redraw) {
if (typeof options === "undefined") { options = {}; }
if (typeof redraw === "undefined") { redraw = false; }
var screen = this.screen, points, ctx = this.ctx, prop, opts;
ctx.save();
ctx.lineWidth = (options.lineWidth || 4) ... | javascript | function (line, options, redraw) {
if (typeof options === "undefined") { options = {}; }
if (typeof redraw === "undefined") { redraw = false; }
var screen = this.screen, points, ctx = this.ctx, prop, opts;
ctx.save();
ctx.lineWidth = (options.lineWidth || 4) ... | [
"function",
"(",
"line",
",",
"options",
",",
"redraw",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"\"undefined\"",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"typeof",
"redraw",
"===",
"\"undefined\"",
")",
"{",
"redraw",
"=",
"f... | Draws a line on the screen.
@param {Line} line The line to be drawn
@param {drawingOptions} options Optional drawing options
@param {boolean} redraw Indicates if the current draw call is happening during a redraw
@return {Screen} Returns the screen | [
"Draws",
"a",
"line",
"on",
"the",
"screen",
"."
] | 43dbd35263da672bd2ca41f93dc447b60da9bdac | https://github.com/alawatthe/MathLib/blob/43dbd35263da672bd2ca41f93dc447b60da9bdac/build/MathLib.js#L4358-L4407 | |
41,505 | alawatthe/MathLib | build/MathLib.js | function (x) {
if (x.length === 2) {
return new THREE.Vector2(x[0], x[1]);
} else if (x.length === 3) {
return new THREE.Vector3(x[0], x[1], x[2]);
}
} | javascript | function (x) {
if (x.length === 2) {
return new THREE.Vector2(x[0], x[1]);
} else if (x.length === 3) {
return new THREE.Vector3(x[0], x[1], x[2]);
}
} | [
"function",
"(",
"x",
")",
"{",
"if",
"(",
"x",
".",
"length",
"===",
"2",
")",
"{",
"return",
"new",
"THREE",
".",
"Vector2",
"(",
"x",
"[",
"0",
"]",
",",
"x",
"[",
"1",
"]",
")",
";",
"}",
"else",
"if",
"(",
"x",
".",
"length",
"===",
... | A function converting arrays to THREE.js vectors | [
"A",
"function",
"converting",
"arrays",
"to",
"THREE",
".",
"js",
"vectors"
] | 43dbd35263da672bd2ca41f93dc447b60da9bdac | https://github.com/alawatthe/MathLib/blob/43dbd35263da672bd2ca41f93dc447b60da9bdac/build/MathLib.js#L5912-L5918 | |
41,506 | bigeasy/udt | index.js | sooner | function sooner (property) {
return function (a, b) {
if (a[property][0] < b[property][0]) return true;
if (a[property][0] > b[property][0]) return false;
return a[property][1] < b[property][1];
}
} | javascript | function sooner (property) {
return function (a, b) {
if (a[property][0] < b[property][0]) return true;
if (a[property][0] > b[property][0]) return false;
return a[property][1] < b[property][1];
}
} | [
"function",
"sooner",
"(",
"property",
")",
"{",
"return",
"function",
"(",
"a",
",",
"b",
")",
"{",
"if",
"(",
"a",
"[",
"property",
"]",
"[",
"0",
"]",
"<",
"b",
"[",
"property",
"]",
"[",
"0",
"]",
")",
"return",
"true",
";",
"if",
"(",
"a... | Comparison operator generator for high-resolution time for use with heap. | [
"Comparison",
"operator",
"generator",
"for",
"high",
"-",
"resolution",
"time",
"for",
"use",
"with",
"heap",
"."
] | 54e8be61ba263a762cf7db5d4202fbd964c324f5 | https://github.com/bigeasy/udt/blob/54e8be61ba263a762cf7db5d4202fbd964c324f5/index.js#L120-L126 |
41,507 | bigeasy/udt | index.js | EndPoint | function EndPoint (local) {
this.listeners = 0;
this.dgram = dgram.createSocket('udp4');
this.dgram.on('message', EndPoint.prototype.receive.bind(this));
this.dgram.bind(local.port, local.address);
this.local = this.dgram.address();
this.packet = new Buffer(2048);
this.sockets = {};
} | javascript | function EndPoint (local) {
this.listeners = 0;
this.dgram = dgram.createSocket('udp4');
this.dgram.on('message', EndPoint.prototype.receive.bind(this));
this.dgram.bind(local.port, local.address);
this.local = this.dgram.address();
this.packet = new Buffer(2048);
this.sockets = {};
} | [
"function",
"EndPoint",
"(",
"local",
")",
"{",
"this",
".",
"listeners",
"=",
"0",
";",
"this",
".",
"dgram",
"=",
"dgram",
".",
"createSocket",
"(",
"'udp4'",
")",
";",
"this",
".",
"dgram",
".",
"on",
"(",
"'message'",
",",
"EndPoint",
".",
"proto... | Wrapper around an underlying UDP datagram socket. | [
"Wrapper",
"around",
"an",
"underlying",
"UDP",
"datagram",
"socket",
"."
] | 54e8be61ba263a762cf7db5d4202fbd964c324f5 | https://github.com/bigeasy/udt/blob/54e8be61ba263a762cf7db5d4202fbd964c324f5/index.js#L221-L229 |
41,508 | bigeasy/udt | index.js | lookupEndPoint | function lookupEndPoint (local) {
// No interfaces bound by the desired port. Note that this would also work for
// zero, which indicates an ephemeral binding, but we check for that case
// explicitly before calling this function.
if (!endPoints[local.port]) return null;
// Read datagram socket from cache.
... | javascript | function lookupEndPoint (local) {
// No interfaces bound by the desired port. Note that this would also work for
// zero, which indicates an ephemeral binding, but we check for that case
// explicitly before calling this function.
if (!endPoints[local.port]) return null;
// Read datagram socket from cache.
... | [
"function",
"lookupEndPoint",
"(",
"local",
")",
"{",
"// No interfaces bound by the desired port. Note that this would also work for",
"// zero, which indicates an ephemeral binding, but we check for that case",
"// explicitly before calling this function.",
"if",
"(",
"!",
"endPoints",
"... | Look up an UDP datagram socket in the cache of bound UDP datagram sockets by the user specified port and address. | [
"Look",
"up",
"an",
"UDP",
"datagram",
"socket",
"in",
"the",
"cache",
"of",
"bound",
"UDP",
"datagram",
"sockets",
"by",
"the",
"user",
"specified",
"port",
"and",
"address",
"."
] | 54e8be61ba263a762cf7db5d4202fbd964c324f5 | https://github.com/bigeasy/udt/blob/54e8be61ba263a762cf7db5d4202fbd964c324f5/index.js#L571-L594 |
41,509 | bigeasy/udt | index.js | peerResolved | function peerResolved (ip, addressType) {
// Possible cancelation during DNS lookup.
if (!socket._connecting) return;
socket._peer = { address: ip || '127.0.0.1', port: options.port };
// Generate random bytes used to set randomized socket properties.
// `crypto.randomBytes` calls OpenSSL `RAND_by... | javascript | function peerResolved (ip, addressType) {
// Possible cancelation during DNS lookup.
if (!socket._connecting) return;
socket._peer = { address: ip || '127.0.0.1', port: options.port };
// Generate random bytes used to set randomized socket properties.
// `crypto.randomBytes` calls OpenSSL `RAND_by... | [
"function",
"peerResolved",
"(",
"ip",
",",
"addressType",
")",
"{",
"// Possible cancelation during DNS lookup.",
"if",
"(",
"!",
"socket",
".",
"_connecting",
")",
"return",
";",
"socket",
".",
"_peer",
"=",
"{",
"address",
":",
"ip",
"||",
"'127.0.0.1'",
",... | Record the DNS resolved IP address. | [
"Record",
"the",
"DNS",
"resolved",
"IP",
"address",
"."
] | 54e8be61ba263a762cf7db5d4202fbd964c324f5 | https://github.com/bigeasy/udt/blob/54e8be61ba263a762cf7db5d4202fbd964c324f5/index.js#L675-L687 |
41,510 | bigeasy/udt | index.js | randomzied | function randomzied (buffer) {
// Randomly generated randomness.
socket._sequence = buffer.readUInt32BE(0) % MAX_SEQ_NO;
// The end point sends a packet on our behalf.
socket._endPoint.shakeHands(socket);
} | javascript | function randomzied (buffer) {
// Randomly generated randomness.
socket._sequence = buffer.readUInt32BE(0) % MAX_SEQ_NO;
// The end point sends a packet on our behalf.
socket._endPoint.shakeHands(socket);
} | [
"function",
"randomzied",
"(",
"buffer",
")",
"{",
"// Randomly generated randomness.",
"socket",
".",
"_sequence",
"=",
"buffer",
".",
"readUInt32BE",
"(",
"0",
")",
"%",
"MAX_SEQ_NO",
";",
"// The end point sends a packet on our behalf.",
"socket",
".",
"_endPoint",
... | Initialize the randomized socket properies. | [
"Initialize",
"the",
"randomized",
"socket",
"properies",
"."
] | 54e8be61ba263a762cf7db5d4202fbd964c324f5 | https://github.com/bigeasy/udt/blob/54e8be61ba263a762cf7db5d4202fbd964c324f5/index.js#L690-L696 |
41,511 | fat/haunt | examples/comment-on-diff.js | findOnLine | function findOnLine(find, patch, cb) {
if (find.test(patch)) {
var lineNum = 0
patch.split('\n').forEach(function(line) {
var range = /\@\@ \-\d+,\d+ \+(\d+),\d+ \@\@/g.exec(line)
if (range) {
lineNum = Number(range[1]) - 1
} else if (line.substr(0... | javascript | function findOnLine(find, patch, cb) {
if (find.test(patch)) {
var lineNum = 0
patch.split('\n').forEach(function(line) {
var range = /\@\@ \-\d+,\d+ \+(\d+),\d+ \@\@/g.exec(line)
if (range) {
lineNum = Number(range[1]) - 1
} else if (line.substr(0... | [
"function",
"findOnLine",
"(",
"find",
",",
"patch",
",",
"cb",
")",
"{",
"if",
"(",
"find",
".",
"test",
"(",
"patch",
")",
")",
"{",
"var",
"lineNum",
"=",
"0",
"patch",
".",
"split",
"(",
"'\\n'",
")",
".",
"forEach",
"(",
"function",
"(",
"li... | find stuff in a diff and return the line number | [
"find",
"stuff",
"in",
"a",
"diff",
"and",
"return",
"the",
"line",
"number"
] | e7a0f30032f0afec56652dc9ded06b29f0d61509 | https://github.com/fat/haunt/blob/e7a0f30032f0afec56652dc9ded06b29f0d61509/examples/comment-on-diff.js#L28-L43 |
41,512 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | addDerivedInfoForFile | function addDerivedInfoForFile(fileCoverage) {
var statementMap = fileCoverage.statementMap,
statements = fileCoverage.s,
lineMap;
if (!fileCoverage.l) {
fileCoverage.l = lineMap = {};
Object.keys(statements).forEach(function (st) {
var line = statementMap[st].start.line,
... | javascript | function addDerivedInfoForFile(fileCoverage) {
var statementMap = fileCoverage.statementMap,
statements = fileCoverage.s,
lineMap;
if (!fileCoverage.l) {
fileCoverage.l = lineMap = {};
Object.keys(statements).forEach(function (st) {
var line = statementMap[st].start.line,
... | [
"function",
"addDerivedInfoForFile",
"(",
"fileCoverage",
")",
"{",
"var",
"statementMap",
"=",
"fileCoverage",
".",
"statementMap",
",",
"statements",
"=",
"fileCoverage",
".",
"s",
",",
"lineMap",
";",
"if",
"(",
"!",
"fileCoverage",
".",
"l",
")",
"{",
"f... | adds line coverage information to a file coverage object, reverse-engineering
it from statement coverage. The object passed in is updated in place.
Note that if line coverage information is already present in the object,
it is not recomputed.
@method addDerivedInfoForFile
@static
@param {Object} fileCoverage the cove... | [
"adds",
"line",
"coverage",
"information",
"to",
"a",
"file",
"coverage",
"object",
"reverse",
"-",
"engineering",
"it",
"from",
"statement",
"coverage",
".",
"The",
"object",
"passed",
"in",
"is",
"updated",
"in",
"place",
"."
] | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L50-L67 |
41,513 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | addDerivedInfo | function addDerivedInfo(coverage) {
Object.keys(coverage).forEach(function (k) {
addDerivedInfoForFile(coverage[k]);
});
} | javascript | function addDerivedInfo(coverage) {
Object.keys(coverage).forEach(function (k) {
addDerivedInfoForFile(coverage[k]);
});
} | [
"function",
"addDerivedInfo",
"(",
"coverage",
")",
"{",
"Object",
".",
"keys",
"(",
"coverage",
")",
".",
"forEach",
"(",
"function",
"(",
"k",
")",
"{",
"addDerivedInfoForFile",
"(",
"coverage",
"[",
"k",
"]",
")",
";",
"}",
")",
";",
"}"
] | adds line coverage information to all file coverage objects.
@method addDerivedInfo
@static
@param {Object} coverage the coverage object | [
"adds",
"line",
"coverage",
"information",
"to",
"all",
"file",
"coverage",
"objects",
"."
] | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L75-L79 |
41,514 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | removeDerivedInfo | function removeDerivedInfo(coverage) {
Object.keys(coverage).forEach(function (k) {
delete coverage[k].l;
});
} | javascript | function removeDerivedInfo(coverage) {
Object.keys(coverage).forEach(function (k) {
delete coverage[k].l;
});
} | [
"function",
"removeDerivedInfo",
"(",
"coverage",
")",
"{",
"Object",
".",
"keys",
"(",
"coverage",
")",
".",
"forEach",
"(",
"function",
"(",
"k",
")",
"{",
"delete",
"coverage",
"[",
"k",
"]",
".",
"l",
";",
"}",
")",
";",
"}"
] | removes line coverage information from all file coverage objects
@method removeDerivedInfo
@static
@param {Object} coverage the coverage object | [
"removes",
"line",
"coverage",
"information",
"from",
"all",
"file",
"coverage",
"objects"
] | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L86-L90 |
41,515 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | mergeSummaryObjects | function mergeSummaryObjects() {
var ret = blankSummary(),
args = Array.prototype.slice.call(arguments),
keys = ['lines', 'statements', 'branches', 'functions'],
increment = function (obj) {
if (obj) {
keys.forEach(function (key) {
ret[key].total += obj[key].total;
... | javascript | function mergeSummaryObjects() {
var ret = blankSummary(),
args = Array.prototype.slice.call(arguments),
keys = ['lines', 'statements', 'branches', 'functions'],
increment = function (obj) {
if (obj) {
keys.forEach(function (key) {
ret[key].total += obj[key].total;
... | [
"function",
"mergeSummaryObjects",
"(",
")",
"{",
"var",
"ret",
"=",
"blankSummary",
"(",
")",
",",
"args",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
",",
"keys",
"=",
"[",
"'lines'",
",",
"'statements'",
",",
"'... | merges multiple summary metrics objects by summing up the `totals` and
`covered` fields and recomputing the percentages. This function is generic
and can accept any number of arguments.
@method mergeSummaryObjects
@static
@param {Object} summary... multiple summary metrics objects
@return {Object} the merged summary m... | [
"merges",
"multiple",
"summary",
"metrics",
"objects",
"by",
"summing",
"up",
"the",
"totals",
"and",
"covered",
"fields",
"and",
"recomputing",
"the",
"percentages",
".",
"This",
"function",
"is",
"generic",
"and",
"can",
"accept",
"any",
"number",
"of",
"arg... | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L262-L283 |
41,516 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | summarizeCoverage | function summarizeCoverage(coverage) {
var fileSummary = [];
Object.keys(coverage).forEach(function (key) {
fileSummary.push(summarizeFileCoverage(coverage[key]));
});
return mergeSummaryObjects.apply(null, fileSummary);
} | javascript | function summarizeCoverage(coverage) {
var fileSummary = [];
Object.keys(coverage).forEach(function (key) {
fileSummary.push(summarizeFileCoverage(coverage[key]));
});
return mergeSummaryObjects.apply(null, fileSummary);
} | [
"function",
"summarizeCoverage",
"(",
"coverage",
")",
"{",
"var",
"fileSummary",
"=",
"[",
"]",
";",
"Object",
".",
"keys",
"(",
"coverage",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"fileSummary",
".",
"push",
"(",
"summarizeFileCoverag... | returns the coverage summary for a single coverage object. This is
wrapper over `summarizeFileCoverage` and `mergeSummaryObjects` for
the common case of a single coverage object
@method summarizeCoverage
@static
@param {Object} coverage the coverage object
@return {Object} summary coverage metrics across all files in ... | [
"returns",
"the",
"coverage",
"summary",
"for",
"a",
"single",
"coverage",
"object",
".",
"This",
"is",
"wrapper",
"over",
"summarizeFileCoverage",
"and",
"mergeSummaryObjects",
"for",
"the",
"common",
"case",
"of",
"a",
"single",
"coverage",
"object"
] | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L293-L299 |
41,517 | lithiumtech/karma-threshold-reporter | istanbul-utils.js | toYUICoverage | function toYUICoverage(coverage) {
var ret = {};
addDerivedInfo(coverage);
Object.keys(coverage).forEach(function (k) {
var fileCoverage = coverage[k],
lines = fileCoverage.l,
functions = fileCoverage.f,
fnMap = fileCoverage.fnMap,
o;
o = ret[k] = {
lin... | javascript | function toYUICoverage(coverage) {
var ret = {};
addDerivedInfo(coverage);
Object.keys(coverage).forEach(function (k) {
var fileCoverage = coverage[k],
lines = fileCoverage.l,
functions = fileCoverage.f,
fnMap = fileCoverage.fnMap,
o;
o = ret[k] = {
lin... | [
"function",
"toYUICoverage",
"(",
"coverage",
")",
"{",
"var",
"ret",
"=",
"{",
"}",
";",
"addDerivedInfo",
"(",
"coverage",
")",
";",
"Object",
".",
"keys",
"(",
"coverage",
")",
".",
"forEach",
"(",
"function",
"(",
"k",
")",
"{",
"var",
"fileCoverag... | makes the coverage object generated by this library yuitest_coverage compatible.
Note that this transformation is lossy since the returned object will not have
statement and branch coverage.
@method toYUICoverage
@static
@param {Object} coverage The `istanbul` coverage object
@return {Object} a coverage object in `yui... | [
"makes",
"the",
"coverage",
"object",
"generated",
"by",
"this",
"library",
"yuitest_coverage",
"compatible",
".",
"Note",
"that",
"this",
"transformation",
"is",
"lossy",
"since",
"the",
"returned",
"object",
"will",
"not",
"have",
"statement",
"and",
"branch",
... | fe78c5227819ed1c58eeb5f6b776b64338ab2525 | https://github.com/lithiumtech/karma-threshold-reporter/blob/fe78c5227819ed1c58eeb5f6b776b64338ab2525/istanbul-utils.js#L311-L348 |
41,518 | scijs/nrrd-js | nrrd.js | parseField | function parseField(identifier, descriptor) {
switch(identifier) {
// Literal (uninterpreted) fields
case 'content':
case 'number':
case 'sampleUnits':
break;
// Integers
case 'dimension':
case 'blockSize':
case 'lineSkip':
case 'byteSkip':
case 'spaceDimension':
... | javascript | function parseField(identifier, descriptor) {
switch(identifier) {
// Literal (uninterpreted) fields
case 'content':
case 'number':
case 'sampleUnits':
break;
// Integers
case 'dimension':
case 'blockSize':
case 'lineSkip':
case 'byteSkip':
case 'spaceDimension':
... | [
"function",
"parseField",
"(",
"identifier",
",",
"descriptor",
")",
"{",
"switch",
"(",
"identifier",
")",
"{",
"// Literal (uninterpreted) fields",
"case",
"'content'",
":",
"case",
"'number'",
":",
"case",
"'sampleUnits'",
":",
"break",
";",
"// Integers",
"cas... | Parses and normalizes NRRD fields, assumes the field names are already lower case. | [
"Parses",
"and",
"normalizes",
"NRRD",
"fields",
"assumes",
"the",
"field",
"names",
"are",
"already",
"lower",
"case",
"."
] | fc106cd9e911b6e8ab096cc61ece5dcb5ac69c40 | https://github.com/scijs/nrrd-js/blob/fc106cd9e911b6e8ab096cc61ece5dcb5ac69c40/nrrd.js#L475-L550 |
41,519 | wbyoung/azul | lib/relations/belongs_to.js | function(instance) {
var result = this._related(instance);
if (result === undefined) {
throw new Error(util.format('The relation "%s" has not yet been ' +
'loaded.', this._name));
}
return result;
} | javascript | function(instance) {
var result = this._related(instance);
if (result === undefined) {
throw new Error(util.format('The relation "%s" has not yet been ' +
'loaded.', this._name));
}
return result;
} | [
"function",
"(",
"instance",
")",
"{",
"var",
"result",
"=",
"this",
".",
"_related",
"(",
"instance",
")",
";",
"if",
"(",
"result",
"===",
"undefined",
")",
"{",
"throw",
"new",
"Error",
"(",
"util",
".",
"format",
"(",
"'The relation \"%s\" has not yet ... | The item property for this relation.
This property allows access to the cached object that has been fetched
for a specific model in a given relation. Before the cache has been
filled, accessing this property will throw an exception.
It is accessible on an individual model via `<singular>` and via
`get<Singular>`. For... | [
"The",
"item",
"property",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/belongs_to.js#L125-L132 | |
41,520 | wbyoung/azul | lib/relations/belongs_to.js | function(instance) {
var cacheName = this._itemObjectsQueryCacheKey;
if (!instance[cacheName]) {
var where = _.object([
[this.primaryKey, instance.getAttribute(this.foreignKeyAttr)],
]);
var cacheResult = _.bind(this.associateFetchedObjects, this, instance);
instance[cacheName] =... | javascript | function(instance) {
var cacheName = this._itemObjectsQueryCacheKey;
if (!instance[cacheName]) {
var where = _.object([
[this.primaryKey, instance.getAttribute(this.foreignKeyAttr)],
]);
var cacheResult = _.bind(this.associateFetchedObjects, this, instance);
instance[cacheName] =... | [
"function",
"(",
"instance",
")",
"{",
"var",
"cacheName",
"=",
"this",
".",
"_itemObjectsQueryCacheKey",
";",
"if",
"(",
"!",
"instance",
"[",
"cacheName",
"]",
")",
"{",
"var",
"where",
"=",
"_",
".",
"object",
"(",
"[",
"[",
"this",
".",
"primaryKey... | The objects query property for this relation.
This property allows you access to a query which you can use to fetch the
object for a relation on a given model and/or to configure the query to
build a new query with more restrictive conditions.
When you fetch the object, the result will be cached and accessible via
th... | [
"The",
"objects",
"query",
"property",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/belongs_to.js#L214-L226 | |
41,521 | wbyoung/azul | lib/relations/belongs_to.js | function(instance) {
var self = this;
var result = Promise.bind();
var fk = instance.getAttribute(this.foreignKeyAttr);
if (fk) {
result = result.then(function() {
return self.objectsQuery(instance).execute();
})
.then(function(result) {
self.validateFetchedObjects(inst... | javascript | function(instance) {
var self = this;
var result = Promise.bind();
var fk = instance.getAttribute(this.foreignKeyAttr);
if (fk) {
result = result.then(function() {
return self.objectsQuery(instance).execute();
})
.then(function(result) {
self.validateFetchedObjects(inst... | [
"function",
"(",
"instance",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"result",
"=",
"Promise",
".",
"bind",
"(",
")",
";",
"var",
"fk",
"=",
"instance",
".",
"getAttribute",
"(",
"this",
".",
"foreignKeyAttr",
")",
";",
"if",
"(",
"fk",
"... | Fetch the related object. If there is no foreign key defined on the
instance, this method will not actually query the database.
@method
@protected
@param {Model} instance The model instance on which to operate.
@see {@link BaseRelation#methods} | [
"Fetch",
"the",
"related",
"object",
".",
"If",
"there",
"is",
"no",
"foreign",
"key",
"defined",
"on",
"the",
"instance",
"this",
"method",
"will",
"not",
"actually",
"query",
"the",
"database",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/belongs_to.js#L278-L298 | |
41,522 | wbyoung/azul | lib/relations/belongs_to.js | function(instance, objects) {
var foreignKeyAttr = this.foreignKeyAttr;
var fk = instance.getAttribute(foreignKeyAttr);
if (fk && objects.length === 0) {
var relatedModel = this._relatedModel;
var relatedClass = relatedModel.__identity__;
var relatedName = relatedClass.__name__;
thro... | javascript | function(instance, objects) {
var foreignKeyAttr = this.foreignKeyAttr;
var fk = instance.getAttribute(foreignKeyAttr);
if (fk && objects.length === 0) {
var relatedModel = this._relatedModel;
var relatedClass = relatedModel.__identity__;
var relatedName = relatedClass.__name__;
thro... | [
"function",
"(",
"instance",
",",
"objects",
")",
"{",
"var",
"foreignKeyAttr",
"=",
"this",
".",
"foreignKeyAttr",
";",
"var",
"fk",
"=",
"instance",
".",
"getAttribute",
"(",
"foreignKeyAttr",
")",
";",
"if",
"(",
"fk",
"&&",
"objects",
".",
"length",
... | Validate fetched objects, ensuring that exactly one object was obtained
when the foreign key is set.
@method
@protected
@param {Model} instance The model instance on which to operate. | [
"Validate",
"fetched",
"objects",
"ensuring",
"that",
"exactly",
"one",
"object",
"was",
"obtained",
"when",
"the",
"foreign",
"key",
"is",
"set",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/belongs_to.js#L308-L318 | |
41,523 | fat/haunt | lib/pull-request.js | attachCommentsToFile | function attachCommentsToFile(files, comments) {
return files.filter(function(file) {
return file.comments = comments.filter(function(comment) {
if (file.filename === comment.path) {
return comment.reply = attachCommentReply.call(this, comment);
}
}.bind(this)... | javascript | function attachCommentsToFile(files, comments) {
return files.filter(function(file) {
return file.comments = comments.filter(function(comment) {
if (file.filename === comment.path) {
return comment.reply = attachCommentReply.call(this, comment);
}
}.bind(this)... | [
"function",
"attachCommentsToFile",
"(",
"files",
",",
"comments",
")",
"{",
"return",
"files",
".",
"filter",
"(",
"function",
"(",
"file",
")",
"{",
"return",
"file",
".",
"comments",
"=",
"comments",
".",
"filter",
"(",
"function",
"(",
"comment",
")",
... | attach review comments to the related file | [
"attach",
"review",
"comments",
"to",
"the",
"related",
"file"
] | e7a0f30032f0afec56652dc9ded06b29f0d61509 | https://github.com/fat/haunt/blob/e7a0f30032f0afec56652dc9ded06b29f0d61509/lib/pull-request.js#L108-L116 |
41,524 | fat/haunt | lib/pull-request.js | attachCommentReply | function attachCommentReply(comment) {
return function reply(body, callback) {
github.replyToReviewComment(this.repo.data.owner.login, this.repo.data.name, this.data.number, comment.id, body, callback);
}.bind(this);
} | javascript | function attachCommentReply(comment) {
return function reply(body, callback) {
github.replyToReviewComment(this.repo.data.owner.login, this.repo.data.name, this.data.number, comment.id, body, callback);
}.bind(this);
} | [
"function",
"attachCommentReply",
"(",
"comment",
")",
"{",
"return",
"function",
"reply",
"(",
"body",
",",
"callback",
")",
"{",
"github",
".",
"replyToReviewComment",
"(",
"this",
".",
"repo",
".",
"data",
".",
"owner",
".",
"login",
",",
"this",
".",
... | reply to a comment on a diff | [
"reply",
"to",
"a",
"comment",
"on",
"a",
"diff"
] | e7a0f30032f0afec56652dc9ded06b29f0d61509 | https://github.com/fat/haunt/blob/e7a0f30032f0afec56652dc9ded06b29f0d61509/lib/pull-request.js#L119-L123 |
41,525 | wbyoung/azul | lib/relations/has_many_through.js | function(message) {
return override(function() {
if (!this._isToMany) {
var modelName = this._modelClass.__identity__.__name__;
var relationName = this._name;
throw new Error(util.format('%s for non many-to-many through relation ' +
'%s#%s.', message, modelName, relationName));
}
... | javascript | function(message) {
return override(function() {
if (!this._isToMany) {
var modelName = this._modelClass.__identity__.__name__;
var relationName = this._name;
throw new Error(util.format('%s for non many-to-many through relation ' +
'%s#%s.', message, modelName, relationName));
}
... | [
"function",
"(",
"message",
")",
"{",
"return",
"override",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_isToMany",
")",
"{",
"var",
"modelName",
"=",
"this",
".",
"_modelClass",
".",
"__identity__",
".",
"__name__",
";",
"var",
"rela... | A convenience function for creating a through-only method override that will
throw an exception if this is not a through relation configured as a simple
many-to-many.
@function HasMany~manyToManyOnly
@param {String} message The error message prefix.
@return {Function} The method.
@see {@link HasMany~throughOverride} | [
"A",
"convenience",
"function",
"for",
"creating",
"a",
"through",
"-",
"only",
"method",
"override",
"that",
"will",
"throw",
"an",
"exception",
"if",
"this",
"is",
"not",
"a",
"through",
"relation",
"configured",
"as",
"a",
"simple",
"many",
"-",
"to",
"... | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many_through.js#L38-L48 | |
41,526 | wbyoung/azul | lib/relations/has_many.js | function(name) {
var before = 'before' + _.capitalize(name);
var after = 'after' + _.capitalize(name);
return function() {
this[before].apply(this, arguments);
this._super.apply(this, arguments);
this[after].apply(this, arguments);
};
} | javascript | function(name) {
var before = 'before' + _.capitalize(name);
var after = 'after' + _.capitalize(name);
return function() {
this[before].apply(this, arguments);
this._super.apply(this, arguments);
this[after].apply(this, arguments);
};
} | [
"function",
"(",
"name",
")",
"{",
"var",
"before",
"=",
"'before'",
"+",
"_",
".",
"capitalize",
"(",
"name",
")",
";",
"var",
"after",
"=",
"'after'",
"+",
"_",
".",
"capitalize",
"(",
"name",
")",
";",
"return",
"function",
"(",
")",
"{",
"this"... | Notify of changes around a call to super.
@function HasMany~notify
@private
@param {String} name The suffix of the before/after methods to call.
@return {Function} A method that will call before & after methods. | [
"Notify",
"of",
"changes",
"around",
"a",
"call",
"to",
"super",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L77-L85 | |
41,527 | wbyoung/azul | lib/relations/has_many.js | function(instance) {
var args = _.rest(arguments);
var objects = _.flatten(args);
this.beforeAddingObjects(instance, objects);
this.associateObjects(instance, objects);
return Actionable.create(instance.save.bind(instance));
} | javascript | function(instance) {
var args = _.rest(arguments);
var objects = _.flatten(args);
this.beforeAddingObjects(instance, objects);
this.associateObjects(instance, objects);
return Actionable.create(instance.save.bind(instance));
} | [
"function",
"(",
"instance",
")",
"{",
"var",
"args",
"=",
"_",
".",
"rest",
"(",
"arguments",
")",
";",
"var",
"objects",
"=",
"_",
".",
"flatten",
"(",
"args",
")",
";",
"this",
".",
"beforeAddingObjects",
"(",
"instance",
",",
"objects",
")",
";",... | The add objects method for this relation.
This method invalidates the {@link HasMany#objectsQuery} cache and adds
the related objects to the {@link HasMany#collection} (if loaded).
It is accessible on an individual model via `add<Singular>` and
`add<Plural>`. For instance a user that has many articles would cause thi... | [
"The",
"add",
"objects",
"method",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L147-L153 | |
41,528 | wbyoung/azul | lib/relations/has_many.js | function(instance, objects) {
var self = this;
var after = this.afterAddingObjects.bind(this, instance, objects);
return self._updateForeignKeys(instance, objects, instance.id).tap(after);
} | javascript | function(instance, objects) {
var self = this;
var after = this.afterAddingObjects.bind(this, instance, objects);
return self._updateForeignKeys(instance, objects, instance.id).tap(after);
} | [
"function",
"(",
"instance",
",",
"objects",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"after",
"=",
"this",
".",
"afterAddingObjects",
".",
"bind",
"(",
"this",
",",
"instance",
",",
"objects",
")",
";",
"return",
"self",
".",
"_updateForeignKey... | Perform the necessary updates to add objects for this relation.
This method invalidates the {@link HasMany#objectsQuery}.
Mixins can override {@link HasMany#executeAdd} to change the way updates
are performed when related objects are added. This is the default
implementation.
@method
@protected
@param {Model} instan... | [
"Perform",
"the",
"necessary",
"updates",
"to",
"add",
"objects",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L169-L173 | |
41,529 | wbyoung/azul | lib/relations/has_many.js | function(instance) {
var args = _.rest(arguments);
var objects = _.flatten(args);
this.beforeRemovingObjects(instance, objects);
this.disassociateObjects(instance, objects);
return Actionable.create(instance.save.bind(instance));
} | javascript | function(instance) {
var args = _.rest(arguments);
var objects = _.flatten(args);
this.beforeRemovingObjects(instance, objects);
this.disassociateObjects(instance, objects);
return Actionable.create(instance.save.bind(instance));
} | [
"function",
"(",
"instance",
")",
"{",
"var",
"args",
"=",
"_",
".",
"rest",
"(",
"arguments",
")",
";",
"var",
"objects",
"=",
"_",
".",
"flatten",
"(",
"args",
")",
";",
"this",
".",
"beforeRemovingObjects",
"(",
"instance",
",",
"objects",
")",
";... | The remove objects method for this relation.
This method invalidates the {@link HasMany#objectsQuery} cache and removes
the related objects from the {@link HasMany#collection} (if loaded).
It is accessible on an individual model via `remove<Singular>` and
`remove<Plural>`. For instance a user that has many articles w... | [
"The",
"remove",
"objects",
"method",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L199-L205 | |
41,530 | wbyoung/azul | lib/relations/has_many.js | function(instance, objects) {
var self = this;
var after = this.afterRemovingObjects.bind(this, instance, objects);
var removable = _.filter(objects, 'persisted');
return self._updateForeignKeys(instance, removable, undefined).tap(after);
} | javascript | function(instance, objects) {
var self = this;
var after = this.afterRemovingObjects.bind(this, instance, objects);
var removable = _.filter(objects, 'persisted');
return self._updateForeignKeys(instance, removable, undefined).tap(after);
} | [
"function",
"(",
"instance",
",",
"objects",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"after",
"=",
"this",
".",
"afterRemovingObjects",
".",
"bind",
"(",
"this",
",",
"instance",
",",
"objects",
")",
";",
"var",
"removable",
"=",
"_",
".",
... | Perform the necessary updates to remove objects for this relation.
This method invalidates the {@link HasMany#objectsQuery}.
Mixins can override {@link HasMany#executeRemove} to change the way
updates are performed when related objects are removed. This is the
default implementation.
@method
@protected
@param {Model... | [
"Perform",
"the",
"necessary",
"updates",
"to",
"remove",
"objects",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L221-L226 | |
41,531 | wbyoung/azul | lib/relations/has_many.js | function(instance) {
var updates = _.object([[this.foreignKey, undefined]]);
var query = this.objectsQuery(instance).update(updates);
var after = this.afterClearingObjects.bind(this, instance);
return query.execute().tap(after);
} | javascript | function(instance) {
var updates = _.object([[this.foreignKey, undefined]]);
var query = this.objectsQuery(instance).update(updates);
var after = this.afterClearingObjects.bind(this, instance);
return query.execute().tap(after);
} | [
"function",
"(",
"instance",
")",
"{",
"var",
"updates",
"=",
"_",
".",
"object",
"(",
"[",
"[",
"this",
".",
"foreignKey",
",",
"undefined",
"]",
"]",
")",
";",
"var",
"query",
"=",
"this",
".",
"objectsQuery",
"(",
"instance",
")",
".",
"update",
... | Perform the necessary updates to clear objects for this relation.
This method invalidates the {@link HasMany#objectsQuery}.
Mixins can override {@link HasMany#executeClear} to change the way clears
are performed when related objects are cleared. This is the default
implementation.
@method
@protected
@param {Model} i... | [
"Perform",
"the",
"necessary",
"updates",
"to",
"clear",
"objects",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_many.js#L268-L273 | |
41,532 | wbyoung/azul | lib/query/mixins/bound_helpers.js | function(association, name) {
var context = this._relationCallContext;
var through = association.indexOf('.') !== -1 ?
util.format(' through %s', association) : '';
return _.extend(new Error(util.format(
'No relation %j found for `%s` on %s query%s.',
name, context, this._model.__identity_... | javascript | function(association, name) {
var context = this._relationCallContext;
var through = association.indexOf('.') !== -1 ?
util.format(' through %s', association) : '';
return _.extend(new Error(util.format(
'No relation %j found for `%s` on %s query%s.',
name, context, this._model.__identity_... | [
"function",
"(",
"association",
",",
"name",
")",
"{",
"var",
"context",
"=",
"this",
".",
"_relationCallContext",
";",
"var",
"through",
"=",
"association",
".",
"indexOf",
"(",
"'.'",
")",
"!==",
"-",
"1",
"?",
"util",
".",
"format",
"(",
"' through %s... | Create an error for a missing relation during relation iteration.
@param {String} association Relation key path.
@param {String} name The name that caused the error.
@return {Error} The error object. | [
"Create",
"an",
"error",
"for",
"a",
"missing",
"relation",
"during",
"relation",
"iteration",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/query/mixins/bound_helpers.js#L94-L104 | |
41,533 | wbyoung/azul | lib/query/mixins/bound_core.js | function(orig) {
this._super(orig);
this._priorModel = orig._priorModel;
this._model = orig._model;
this._modelTable = orig._modelTable;
this._arrayTransform = orig._arrayTransform;
this._modelTransform = orig._modelTransform;
} | javascript | function(orig) {
this._super(orig);
this._priorModel = orig._priorModel;
this._model = orig._model;
this._modelTable = orig._modelTable;
this._arrayTransform = orig._arrayTransform;
this._modelTransform = orig._modelTransform;
} | [
"function",
"(",
"orig",
")",
"{",
"this",
".",
"_super",
"(",
"orig",
")",
";",
"this",
".",
"_priorModel",
"=",
"orig",
".",
"_priorModel",
";",
"this",
".",
"_model",
"=",
"orig",
".",
"_model",
";",
"this",
".",
"_modelTable",
"=",
"orig",
".",
... | Duplication implementation.
@method
@protected
@see {@link BaseQuery#_take} | [
"Duplication",
"implementation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/query/mixins/bound_core.js#L20-L27 | |
41,534 | wbyoung/azul | lib/query/mixins/bound_core.js | function() {
var model = this._model;
var arrayTransform = function(result) { // jscs:ignore jsDoc
return result.rows;
};
var modelTransform = function(rows) { // jscs:ignore jsDoc
return rows.map(model.load.bind(model));
};
var dup = this._dup()
.transform(arrayTransform)
... | javascript | function() {
var model = this._model;
var arrayTransform = function(result) { // jscs:ignore jsDoc
return result.rows;
};
var modelTransform = function(rows) { // jscs:ignore jsDoc
return rows.map(model.load.bind(model));
};
var dup = this._dup()
.transform(arrayTransform)
... | [
"function",
"(",
")",
"{",
"var",
"model",
"=",
"this",
".",
"_model",
";",
"var",
"arrayTransform",
"=",
"function",
"(",
"result",
")",
"{",
"// jscs:ignore jsDoc",
"return",
"result",
".",
"rows",
";",
"}",
";",
"var",
"modelTransform",
"=",
"function",... | Enable automatic conversion of the query results to model instances.
@method
@public
@return {ChainedQuery} The newly configured query. | [
"Enable",
"automatic",
"conversion",
"of",
"the",
"query",
"results",
"to",
"model",
"instances",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/query/mixins/bound_core.js#L36-L53 | |
41,535 | wbyoung/azul | lib/query/mixins/bound_core.js | function() {
var dup = this._dup();
dup = dup.transform(dup._modelTransform);
dup._model = dup._priorModel;
dup._priorModel = undefined;
return dup;
} | javascript | function() {
var dup = this._dup();
dup = dup.transform(dup._modelTransform);
dup._model = dup._priorModel;
dup._priorModel = undefined;
return dup;
} | [
"function",
"(",
")",
"{",
"var",
"dup",
"=",
"this",
".",
"_dup",
"(",
")",
";",
"dup",
"=",
"dup",
".",
"transform",
"(",
"dup",
".",
"_modelTransform",
")",
";",
"dup",
".",
"_model",
"=",
"dup",
".",
"_priorModel",
";",
"dup",
".",
"_priorModel... | Reverse the effects of an unbind.
@method
@public
@return {ChainedQuery} The newly configured query. | [
"Reverse",
"the",
"effects",
"of",
"an",
"unbind",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/query/mixins/bound_core.js#L81-L87 | |
41,536 | wbyoung/azul | lib/cli/actions.js | function(action, azulfile, options, strings) {
var db = Database.create(azulfile[env]);
var migrator = db.migrator(path.resolve(options.migrations));
var message = '';
var batches = '';
return migrator[action]()
.tap(function(migrations) {
batches = _(migrations).pluck('batch').unique().join(', ');
}... | javascript | function(action, azulfile, options, strings) {
var db = Database.create(azulfile[env]);
var migrator = db.migrator(path.resolve(options.migrations));
var message = '';
var batches = '';
return migrator[action]()
.tap(function(migrations) {
batches = _(migrations).pluck('batch').unique().join(', ');
}... | [
"function",
"(",
"action",
",",
"azulfile",
",",
"options",
",",
"strings",
")",
"{",
"var",
"db",
"=",
"Database",
".",
"create",
"(",
"azulfile",
"[",
"env",
"]",
")",
";",
"var",
"migrator",
"=",
"db",
".",
"migrator",
"(",
"path",
".",
"resolve",... | Run the migrator.
@private
@function runMigrator
@param {String} action Either `migrate` or `rollback`.
@param {Object} azulfile Configuration object.
@param {Object} options
@param {String} options.migrations
@param {Object} strings The output format strings to use.
@return {Promise} | [
"Run",
"the",
"migrator",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/cli/actions.js#L23-L49 | |
41,537 | Synerzip/loopback-connector-sqlite | lib/sqlite3db.js | function(sqlite3, dbSettings) {
if (!(this instanceof SQLiteDB)) {
return new SQLiteDB(sqlite3, dbSettings);
}
this.constructor.super_.call(this, NAME, dbSettings);
this.name = NAME;
this.settings = dbSettings;
this.sqlite3 = sqlite3;
this.debug = dbSettings.debug;
this.current_order = [];
this.... | javascript | function(sqlite3, dbSettings) {
if (!(this instanceof SQLiteDB)) {
return new SQLiteDB(sqlite3, dbSettings);
}
this.constructor.super_.call(this, NAME, dbSettings);
this.name = NAME;
this.settings = dbSettings;
this.sqlite3 = sqlite3;
this.debug = dbSettings.debug;
this.current_order = [];
this.... | [
"function",
"(",
"sqlite3",
",",
"dbSettings",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"SQLiteDB",
")",
")",
"{",
"return",
"new",
"SQLiteDB",
"(",
"sqlite3",
",",
"dbSettings",
")",
";",
"}",
"this",
".",
"constructor",
".",
"super_",
"."... | Constructor for SQLite connector
@param {Object} settings The settings object
@param {DataSource} dataSource The data source
instance
@constructor | [
"Constructor",
"for",
"SQLite",
"connector"
] | 78b8ffb50396311565e93d17b2f0686ec2326190 | https://github.com/Synerzip/loopback-connector-sqlite/blob/78b8ffb50396311565e93d17b2f0686ec2326190/lib/sqlite3db.js#L45-L62 | |
41,538 | pulseshift/ui5-cache-buster | index.js | _getUi5AppHash | function _getUi5AppHash(sResolvedModulePath, sPreloadPath, oOptions) {
// read relevant resources for hash generation
const oPreloadFileContent = fs.readFileSync(sPreloadPath, 'utf8')
// some resources will be requested additionally to 'Component-preload.js'
// fortunately they 'should' be listed in manifest.j... | javascript | function _getUi5AppHash(sResolvedModulePath, sPreloadPath, oOptions) {
// read relevant resources for hash generation
const oPreloadFileContent = fs.readFileSync(sPreloadPath, 'utf8')
// some resources will be requested additionally to 'Component-preload.js'
// fortunately they 'should' be listed in manifest.j... | [
"function",
"_getUi5AppHash",
"(",
"sResolvedModulePath",
",",
"sPreloadPath",
",",
"oOptions",
")",
"{",
"// read relevant resources for hash generation",
"const",
"oPreloadFileContent",
"=",
"fs",
".",
"readFileSync",
"(",
"sPreloadPath",
",",
"'utf8'",
")",
"// some re... | Generate hash for UI5 app component.
@param {string} [sResolvedModulePath] Module path.
@param {string} [sPreloadPath] Path to Component-preload.js.
@param {Object} [oOptions] Cach buster options.
@param {Object} [oOptions.hash] Hash generation options.
@param {string} [oOptions.HASH_TYPE] Hash type.
@param {string} [o... | [
"Generate",
"hash",
"for",
"UI5",
"app",
"component",
"."
] | 55147d25bed7754fee2de69269f78c61079e1167 | https://github.com/pulseshift/ui5-cache-buster/blob/55147d25bed7754fee2de69269f78c61079e1167/index.js#L269-L306 |
41,539 | pulseshift/ui5-cache-buster | index.js | _getUi5LibHash | function _getUi5LibHash(sResolvedModulePath, sLibPreloadPath, oOptions) {
// read relevant resources for hash generation
const oLibPreloadFileContent = fs.readFileSync(sLibPreloadPath, 'utf8')
// generate hash based on resource contents of the library
const aBufferList = [oLibPreloadFileContent].map(
oCont... | javascript | function _getUi5LibHash(sResolvedModulePath, sLibPreloadPath, oOptions) {
// read relevant resources for hash generation
const oLibPreloadFileContent = fs.readFileSync(sLibPreloadPath, 'utf8')
// generate hash based on resource contents of the library
const aBufferList = [oLibPreloadFileContent].map(
oCont... | [
"function",
"_getUi5LibHash",
"(",
"sResolvedModulePath",
",",
"sLibPreloadPath",
",",
"oOptions",
")",
"{",
"// read relevant resources for hash generation",
"const",
"oLibPreloadFileContent",
"=",
"fs",
".",
"readFileSync",
"(",
"sLibPreloadPath",
",",
"'utf8'",
")",
"/... | Generate hash for UI5 control library.
@param {string} [sResolvedModulePath] Module path.
@param {string} [sLibPreloadPath] Path to library-preload.js.
@param {Object} [oOptions] Cach buster options.
@param {Object} [oOptions.hash] Hash generation options.
@param {string} [oOptions.HASH_TYPE] Hash type.
@param {string}... | [
"Generate",
"hash",
"for",
"UI5",
"control",
"library",
"."
] | 55147d25bed7754fee2de69269f78c61079e1167 | https://github.com/pulseshift/ui5-cache-buster/blob/55147d25bed7754fee2de69269f78c61079e1167/index.js#L319-L330 |
41,540 | pulseshift/ui5-cache-buster | index.js | _getThemeRootHash | function _getThemeRootHash(sThemeRootPath, sThemeName, oOptions) {
// read relevant resources for hash generation
const aAssetContents = _readAllFiles(sThemeRootPath)
// generate hash based on library CSS files in theme root
const aBufferList = aAssetContents.map(oContent => new Buffer(oContent))
const sNewH... | javascript | function _getThemeRootHash(sThemeRootPath, sThemeName, oOptions) {
// read relevant resources for hash generation
const aAssetContents = _readAllFiles(sThemeRootPath)
// generate hash based on library CSS files in theme root
const aBufferList = aAssetContents.map(oContent => new Buffer(oContent))
const sNewH... | [
"function",
"_getThemeRootHash",
"(",
"sThemeRootPath",
",",
"sThemeName",
",",
"oOptions",
")",
"{",
"// read relevant resources for hash generation",
"const",
"aAssetContents",
"=",
"_readAllFiles",
"(",
"sThemeRootPath",
")",
"// generate hash based on library CSS files in the... | Generate hash for theme roots directory.
@param {string} [sThemeRootPath] Theme root path.
@param {string} [sThemeName] Theme name.
@param {Object} [oOptions] Cach buster options.
@param {Object} [oOptions.hash] Hash generation options.
@param {string} [oOptions.HASH_TYPE] Hash type.
@param {string} [oOptions.DIGEST_TY... | [
"Generate",
"hash",
"for",
"theme",
"roots",
"directory",
"."
] | 55147d25bed7754fee2de69269f78c61079e1167 | https://github.com/pulseshift/ui5-cache-buster/blob/55147d25bed7754fee2de69269f78c61079e1167/index.js#L364-L373 |
41,541 | pulseshift/ui5-cache-buster | index.js | _readAllFiles | function _readAllFiles(sDir = '', aWhitelist = []) {
// read all files in current directory
const aFiles = fs.readdirSync(sDir)
// loop at all files
const aContents = aFiles.reduce((aContents, sFileName) => {
// get file stats
const oFile = fs.statSync(`${sDir}/${sFileName}`)
if (oFile.isDirectory(... | javascript | function _readAllFiles(sDir = '', aWhitelist = []) {
// read all files in current directory
const aFiles = fs.readdirSync(sDir)
// loop at all files
const aContents = aFiles.reduce((aContents, sFileName) => {
// get file stats
const oFile = fs.statSync(`${sDir}/${sFileName}`)
if (oFile.isDirectory(... | [
"function",
"_readAllFiles",
"(",
"sDir",
"=",
"''",
",",
"aWhitelist",
"=",
"[",
"]",
")",
"{",
"// read all files in current directory",
"const",
"aFiles",
"=",
"fs",
".",
"readdirSync",
"(",
"sDir",
")",
"// loop at all files",
"const",
"aContents",
"=",
"aFi... | Helper function to read directories recursively.
@param {string} [sDir] Directory.
@param {Array.string} [aWhitelist] List of file names as whitelist.
@returns {Array.string} List of read file contents. | [
"Helper",
"function",
"to",
"read",
"directories",
"recursively",
"."
] | 55147d25bed7754fee2de69269f78c61079e1167 | https://github.com/pulseshift/ui5-cache-buster/blob/55147d25bed7754fee2de69269f78c61079e1167/index.js#L381-L401 |
41,542 | pulseshift/ui5-cache-buster | index.js | _createHash | function _createHash(aBufferList, { HASH_TYPE, DIGEST_TYPE, MAX_LENGTH }) {
// very important to sort buffer list before creating hash!!
const aSortedBufferList = (aBufferList || []).sort()
// create and return hash
return aSortedBufferList.length > 0
? loaderUtils
.getHashDigest(
Buffer.... | javascript | function _createHash(aBufferList, { HASH_TYPE, DIGEST_TYPE, MAX_LENGTH }) {
// very important to sort buffer list before creating hash!!
const aSortedBufferList = (aBufferList || []).sort()
// create and return hash
return aSortedBufferList.length > 0
? loaderUtils
.getHashDigest(
Buffer.... | [
"function",
"_createHash",
"(",
"aBufferList",
",",
"{",
"HASH_TYPE",
",",
"DIGEST_TYPE",
",",
"MAX_LENGTH",
"}",
")",
"{",
"// very important to sort buffer list before creating hash!!",
"const",
"aSortedBufferList",
"=",
"(",
"aBufferList",
"||",
"[",
"]",
")",
".",... | Generate hash by binary content.
@param {Array.Buffer} [aBufferList] Buffer list with binary content.
@param {Object} [oOptions] Cach buster options.
@param {Object} [oOptions.hash] Hash generation options.
@param {string} [oOptions.HASH_TYPE] Hash type.
@param {string} [oOptions.DIGEST_TYPE] Digest type.
@param {numbe... | [
"Generate",
"hash",
"by",
"binary",
"content",
"."
] | 55147d25bed7754fee2de69269f78c61079e1167 | https://github.com/pulseshift/ui5-cache-buster/blob/55147d25bed7754fee2de69269f78c61079e1167/index.js#L413-L429 |
41,543 | fullstackio/cq | packages/cq/dist/index.js | lineNumberOfCharacterIndex | function lineNumberOfCharacterIndex(code, idx) {
var everythingUpUntilTheIndex = code.substring(0, idx);
// computer science!
return everythingUpUntilTheIndex.split("\n").length;
} | javascript | function lineNumberOfCharacterIndex(code, idx) {
var everythingUpUntilTheIndex = code.substring(0, idx);
// computer science!
return everythingUpUntilTheIndex.split("\n").length;
} | [
"function",
"lineNumberOfCharacterIndex",
"(",
"code",
",",
"idx",
")",
"{",
"var",
"everythingUpUntilTheIndex",
"=",
"code",
".",
"substring",
"(",
"0",
",",
"idx",
")",
";",
"// computer science!",
"return",
"everythingUpUntilTheIndex",
".",
"split",
"(",
"\"\\n... | given character index idx in code, returns the 1-indexed line number | [
"given",
"character",
"index",
"idx",
"in",
"code",
"returns",
"the",
"1",
"-",
"indexed",
"line",
"number"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/cq/dist/index.js#L503-L507 |
41,544 | wbyoung/azul | lib/database.js | function(name, properties) {
var className = _.capitalize(_.camelCase(name));
var known = this._modelClasses;
var model = known[className];
if (!model) {
model = known[className] =
this.Model.extend({}, { __name__: className });
}
return model.reopen(properties);
} | javascript | function(name, properties) {
var className = _.capitalize(_.camelCase(name));
var known = this._modelClasses;
var model = known[className];
if (!model) {
model = known[className] =
this.Model.extend({}, { __name__: className });
}
return model.reopen(properties);
} | [
"function",
"(",
"name",
",",
"properties",
")",
"{",
"var",
"className",
"=",
"_",
".",
"capitalize",
"(",
"_",
".",
"camelCase",
"(",
"name",
")",
")",
";",
"var",
"known",
"=",
"this",
".",
"_modelClasses",
";",
"var",
"model",
"=",
"known",
"[",
... | Create a new model class or retrieve an existing class.
This is the preferred way of creating new model classes as it also stores
the model class by name, allowing you to use strings in certain places to
refer to classes (i.e. when defining relationships).
@param {String} name The name for the class
@param {Object} [... | [
"Create",
"a",
"new",
"model",
"class",
"or",
"retrieve",
"an",
"existing",
"class",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/database.js#L96-L105 | |
41,545 | jwir3/gulp-ssh-deploy | src/index.js | function() {
var self = this;
if (!self.mHighlightedText) {
gulpUtil.log(gulpUtil.colors.yellow('Warning:'), self.mMessage, "You will not be able to deploy.");
} else {
gulpUtil.log(gulpUtil.colors.yellow('Warning:'), self.mMessage,
gulpUtil.colors.cyan(self.mHighlightedText),... | javascript | function() {
var self = this;
if (!self.mHighlightedText) {
gulpUtil.log(gulpUtil.colors.yellow('Warning:'), self.mMessage, "You will not be able to deploy.");
} else {
gulpUtil.log(gulpUtil.colors.yellow('Warning:'), self.mMessage,
gulpUtil.colors.cyan(self.mHighlightedText),... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"mHighlightedText",
")",
"{",
"gulpUtil",
".",
"log",
"(",
"gulpUtil",
".",
"colors",
".",
"yellow",
"(",
"'Warning:'",
")",
",",
"self",
".",
"mMessage",
",",
... | Print this exception to the gulp log, with some color highlighting. | [
"Print",
"this",
"exception",
"to",
"the",
"gulp",
"log",
"with",
"some",
"color",
"highlighting",
"."
] | d16f99fe93215b3fdf28796daf1d326154899866 | https://github.com/jwir3/gulp-ssh-deploy/blob/d16f99fe93215b3fdf28796daf1d326154899866/src/index.js#L20-L29 | |
41,546 | jwir3/gulp-ssh-deploy | src/index.js | function() {
var self = this;
if (!self.mPackageJson) {
self.mPackageJson = jetpack.read(this.mOptions.package_json_file_path, 'json');
}
return self.mPackageJson;
} | javascript | function() {
var self = this;
if (!self.mPackageJson) {
self.mPackageJson = jetpack.read(this.mOptions.package_json_file_path, 'json');
}
return self.mPackageJson;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"mPackageJson",
")",
"{",
"self",
".",
"mPackageJson",
"=",
"jetpack",
".",
"read",
"(",
"this",
".",
"mOptions",
".",
"package_json_file_path",
",",
"'json'",
")"... | Retrieve the package.json file, as a JSON object.
@return {object} The object containing the contents of the package.json file
specified in the options structure. | [
"Retrieve",
"the",
"package",
".",
"json",
"file",
"as",
"a",
"JSON",
"object",
"."
] | d16f99fe93215b3fdf28796daf1d326154899866 | https://github.com/jwir3/gulp-ssh-deploy/blob/d16f99fe93215b3fdf28796daf1d326154899866/src/index.js#L124-L131 | |
41,547 | wbyoung/azul | lib/relations/base.js | function(baseTable, joinTable) {
var jk = [baseTable, this.joinKeyAttr].join('.');
var ik = [joinTable, this.inverseKeyAttr].join('.');
var parts = [jk, ik];
// for readability, we like to keep the foreign key first in the join
// condition, so if the join key is the primary key, swap the order of ... | javascript | function(baseTable, joinTable) {
var jk = [baseTable, this.joinKeyAttr].join('.');
var ik = [joinTable, this.inverseKeyAttr].join('.');
var parts = [jk, ik];
// for readability, we like to keep the foreign key first in the join
// condition, so if the join key is the primary key, swap the order of ... | [
"function",
"(",
"baseTable",
",",
"joinTable",
")",
"{",
"var",
"jk",
"=",
"[",
"baseTable",
",",
"this",
".",
"joinKeyAttr",
"]",
".",
"join",
"(",
"'.'",
")",
";",
"var",
"ik",
"=",
"[",
"joinTable",
",",
"this",
".",
"inverseKeyAttr",
"]",
".",
... | Join support for a relation.
This method joins a table, `baseTable` to `joinTable` using
{@link BaseRelation#joinKey} as the attribute on the `baseTable` and
{@link BaseRelation#inverseKey} as the attribute on `joinTable`.
It also ensures that the foreign key will come first in the resulting
condition (for readabilit... | [
"Join",
"support",
"for",
"a",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/base.js#L223-L236 | |
41,548 | jpommerening/node-lazystream | lib/lazystream.js | beforeFirstCall | function beforeFirstCall(instance, method, callback) {
instance[method] = function() {
delete instance[method];
callback.apply(this, arguments);
return this[method].apply(this, arguments);
};
} | javascript | function beforeFirstCall(instance, method, callback) {
instance[method] = function() {
delete instance[method];
callback.apply(this, arguments);
return this[method].apply(this, arguments);
};
} | [
"function",
"beforeFirstCall",
"(",
"instance",
",",
"method",
",",
"callback",
")",
"{",
"instance",
"[",
"method",
"]",
"=",
"function",
"(",
")",
"{",
"delete",
"instance",
"[",
"method",
"]",
";",
"callback",
".",
"apply",
"(",
"this",
",",
"argument... | Patch the given method of instance so that the callback is executed once, before the actual method is called the first time. | [
"Patch",
"the",
"given",
"method",
"of",
"instance",
"so",
"that",
"the",
"callback",
"is",
"executed",
"once",
"before",
"the",
"actual",
"method",
"is",
"called",
"the",
"first",
"time",
"."
] | f1f047c1957c75d39da6d4c21bb1d5196427d6c6 | https://github.com/jpommerening/node-lazystream/blob/f1f047c1957c75d39da6d4c21bb1d5196427d6c6/lib/lazystream.js#L15-L21 |
41,549 | wbyoung/azul | lib/cli/index.js | function(env, action) {
if (!env.modulePath) {
console.log(chalk.red('Local azul not found in'),
chalk.magenta(tildify(env.cwd)));
console.log(chalk.red('Try running: npm install azul'));
process.exit(1);
}
if (!env.configPath && action.azulfile) {
console.log(chalk.red('No azulfile found')... | javascript | function(env, action) {
if (!env.modulePath) {
console.log(chalk.red('Local azul not found in'),
chalk.magenta(tildify(env.cwd)));
console.log(chalk.red('Try running: npm install azul'));
process.exit(1);
}
if (!env.configPath && action.azulfile) {
console.log(chalk.red('No azulfile found')... | [
"function",
"(",
"env",
",",
"action",
")",
"{",
"if",
"(",
"!",
"env",
".",
"modulePath",
")",
"{",
"console",
".",
"log",
"(",
"chalk",
".",
"red",
"(",
"'Local azul not found in'",
")",
",",
"chalk",
".",
"magenta",
"(",
"tildify",
"(",
"env",
"."... | Verify the Liftoff environment and exit the program if we are not in a
suitable environment to operate.
@private
@function cli.verifyEnvironment
@param {Object} env The liftoff environment. | [
"Verify",
"the",
"Liftoff",
"environment",
"and",
"exit",
"the",
"program",
"if",
"we",
"are",
"not",
"in",
"a",
"suitable",
"environment",
"to",
"operate",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/cli/index.js#L47-L59 | |
41,550 | wbyoung/azul | lib/cli/index.js | function(program) {
return program
.version(require('../../package.json').version)
.usage('[options] command')
.option('--cwd <cwd>', 'change the current working directory')
.option('--azulfile <azulfile>', 'use a specific config file')
.option('--require <require>', 'require external ... | javascript | function(program) {
return program
.version(require('../../package.json').version)
.usage('[options] command')
.option('--cwd <cwd>', 'change the current working directory')
.option('--azulfile <azulfile>', 'use a specific config file')
.option('--require <require>', 'require external ... | [
"function",
"(",
"program",
")",
"{",
"return",
"program",
".",
"version",
"(",
"require",
"(",
"'../../package.json'",
")",
".",
"version",
")",
".",
"usage",
"(",
"'[options] command'",
")",
".",
"option",
"(",
"'--cwd <cwd>'",
",",
"'change the current workin... | Setup program.
@private
@function | [
"Setup",
"program",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/cli/index.js#L76-L84 | |
41,551 | wbyoung/azul | lib/cli/index.js | function(details) {
return function() {
var args = _.toArray(arguments);
var options = _.last(args);
action.options = options;
action.name = options.name();
action.args = args;
action = _.defaults(action, details, { azulfile: true });
};
} | javascript | function(details) {
return function() {
var args = _.toArray(arguments);
var options = _.last(args);
action.options = options;
action.name = options.name();
action.args = args;
action = _.defaults(action, details, { azulfile: true });
};
} | [
"function",
"(",
"details",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"args",
"=",
"_",
".",
"toArray",
"(",
"arguments",
")",
";",
"var",
"options",
"=",
"_",
".",
"last",
"(",
"args",
")",
";",
"action",
".",
"options",
"=",
"options"... | We need capture the requested action & execute it after checking that all
required values are set on env. this allows the cli to still run things
like help when azul is not installed locally or is missing a configuration
file.
@function cli~capture
@private | [
"We",
"need",
"capture",
"the",
"requested",
"action",
"&",
"execute",
"it",
"after",
"checking",
"that",
"all",
"required",
"values",
"are",
"set",
"on",
"env",
".",
"this",
"allows",
"the",
"cli",
"to",
"still",
"run",
"things",
"like",
"help",
"when",
... | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/cli/index.js#L160-L169 | |
41,552 | fullstackio/cq | packages/react-cq-demo/src/jquery.highlight-within-textarea.js | function(instance) {
let type = typeof instance;
if (!instance) {
return "falsey";
} else if (Array.isArray(instance)) {
if (
instance.length === 2 &&
typeof instance[0] === "number" &&
typeof instance[1] === "number"
) {
return "range";
... | javascript | function(instance) {
let type = typeof instance;
if (!instance) {
return "falsey";
} else if (Array.isArray(instance)) {
if (
instance.length === 2 &&
typeof instance[0] === "number" &&
typeof instance[1] === "number"
) {
return "range";
... | [
"function",
"(",
"instance",
")",
"{",
"let",
"type",
"=",
"typeof",
"instance",
";",
"if",
"(",
"!",
"instance",
")",
"{",
"return",
"\"falsey\"",
";",
"}",
"else",
"if",
"(",
"Array",
".",
"isArray",
"(",
"instance",
")",
")",
"{",
"if",
"(",
"in... | returns identifier strings that aren't necessarily "real" JavaScript types | [
"returns",
"identifier",
"strings",
"that",
"aren",
"t",
"necessarily",
"real",
"JavaScript",
"types"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/react-cq-demo/src/jquery.highlight-within-textarea.js#L33-L58 | |
41,553 | fullstackio/cq | packages/react-cq-demo/src/jquery.highlight-within-textarea.js | function() {
let ua = window.navigator.userAgent.toLowerCase();
if (ua.indexOf("firefox") !== -1) {
return "firefox";
} else if (!!ua.match(/msie|trident\/7|edge/)) {
return "ie";
} else if (
!!ua.match(/ipad|iphone|ipod/) &&
ua.indexOf("windows phone") === -1
... | javascript | function() {
let ua = window.navigator.userAgent.toLowerCase();
if (ua.indexOf("firefox") !== -1) {
return "firefox";
} else if (!!ua.match(/msie|trident\/7|edge/)) {
return "ie";
} else if (
!!ua.match(/ipad|iphone|ipod/) &&
ua.indexOf("windows phone") === -1
... | [
"function",
"(",
")",
"{",
"let",
"ua",
"=",
"window",
".",
"navigator",
".",
"userAgent",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"ua",
".",
"indexOf",
"(",
"\"firefox\"",
")",
"!==",
"-",
"1",
")",
"{",
"return",
"\"firefox\"",
";",
"}",
"e... | browser sniffing sucks, but there are browser-specific quirks to handle that are not a matter of feature detection | [
"browser",
"sniffing",
"sucks",
"but",
"there",
"are",
"browser",
"-",
"specific",
"quirks",
"to",
"handle",
"that",
"are",
"not",
"a",
"matter",
"of",
"feature",
"detection"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/react-cq-demo/src/jquery.highlight-within-textarea.js#L98-L113 | |
41,554 | fullstackio/cq | packages/react-cq-demo/src/jquery.highlight-within-textarea.js | function() {
// take padding and border pixels from highlights div
let padding = this.$highlights.css([
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
]);
let border = this.$highlights.css([
"border-top-width",
"border-right-width... | javascript | function() {
// take padding and border pixels from highlights div
let padding = this.$highlights.css([
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
]);
let border = this.$highlights.css([
"border-top-width",
"border-right-width... | [
"function",
"(",
")",
"{",
"// take padding and border pixels from highlights div",
"let",
"padding",
"=",
"this",
".",
"$highlights",
".",
"css",
"(",
"[",
"\"padding-top\"",
",",
"\"padding-right\"",
",",
"\"padding-bottom\"",
",",
"\"padding-left\"",
"]",
")",
";",... | Firefox doesn't show text that scrolls into the padding of a textarea, so rearrange a couple box models to make highlights behave the same way | [
"Firefox",
"doesn",
"t",
"show",
"text",
"that",
"scrolls",
"into",
"the",
"padding",
"of",
"a",
"textarea",
"so",
"rearrange",
"a",
"couple",
"box",
"models",
"to",
"make",
"highlights",
"behave",
"the",
"same",
"way"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/react-cq-demo/src/jquery.highlight-within-textarea.js#L117-L151 | |
41,555 | fullstackio/cq | packages/remark-cq/index.js | locateCodeImport | function locateCodeImport(value, fromIndex) {
var index = value.indexOf(C_NEWLINE, fromIndex);
if (value.charAt(index + 1) !== "<" && value.charAt(index + 2) !== "<") {
return;
}
return index;
} | javascript | function locateCodeImport(value, fromIndex) {
var index = value.indexOf(C_NEWLINE, fromIndex);
if (value.charAt(index + 1) !== "<" && value.charAt(index + 2) !== "<") {
return;
}
return index;
} | [
"function",
"locateCodeImport",
"(",
"value",
",",
"fromIndex",
")",
"{",
"var",
"index",
"=",
"value",
".",
"indexOf",
"(",
"C_NEWLINE",
",",
"fromIndex",
")",
";",
"if",
"(",
"value",
".",
"charAt",
"(",
"index",
"+",
"1",
")",
"!==",
"\"<\"",
"&&",
... | Find a possible Code Imports
@example
locateCodeImport('foo \n<<[my-file.js](my-file.js)'); // 4
@param {string} value - Value to search.
@param {number} fromIndex - Index to start searching at.
@return {number} - Location of possible mention sequence. | [
"Find",
"a",
"possible",
"Code",
"Imports"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/remark-cq/index.js#L54-L62 |
41,556 | fullstackio/cq | packages/remark-cq/index.js | codeImportBlock | function codeImportBlock(eat, value, silent) {
var index = -1;
var length = value.length + 1;
var subvalue = EMPTY;
var character;
var marker;
var markerCount;
var queue;
// eat initial spacing
while (++index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !... | javascript | function codeImportBlock(eat, value, silent) {
var index = -1;
var length = value.length + 1;
var subvalue = EMPTY;
var character;
var marker;
var markerCount;
var queue;
// eat initial spacing
while (++index < length) {
character = value.charAt(index);
if (character !== C_TAB && character !... | [
"function",
"codeImportBlock",
"(",
"eat",
",",
"value",
",",
"silent",
")",
"{",
"var",
"index",
"=",
"-",
"1",
";",
"var",
"length",
"=",
"value",
".",
"length",
"+",
"1",
";",
"var",
"subvalue",
"=",
"EMPTY",
";",
"var",
"character",
";",
"var",
... | Tokenize a code import
@example
codeImportBlock(eat, '\n<<[my-file.js](my-file.js)');
@property {Function} locator - Mention locator.
@param {function(string)} eat - Eater.
@param {string} value - Rest of content.
@param {boolean?} [silent] - Whether this is a dry run.
@return {Node?|boolean} - `delete` node. | [
"Tokenize",
"a",
"code",
"import"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/remark-cq/index.js#L77-L173 |
41,557 | fullstackio/cq | packages/remark-cq/index.js | tokenizeBlockInlineAttributeList | function tokenizeBlockInlineAttributeList(eat, value, silent) {
var self = this;
var index = -1;
var length = value.length + 1;
var subvalue = EMPTY;
var character;
var marker;
var markerCount;
var queue;
// eat initial spacing
while (++index < length) {
character = value.charAt(index);
if... | javascript | function tokenizeBlockInlineAttributeList(eat, value, silent) {
var self = this;
var index = -1;
var length = value.length + 1;
var subvalue = EMPTY;
var character;
var marker;
var markerCount;
var queue;
// eat initial spacing
while (++index < length) {
character = value.charAt(index);
if... | [
"function",
"tokenizeBlockInlineAttributeList",
"(",
"eat",
",",
"value",
",",
"silent",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"index",
"=",
"-",
"1",
";",
"var",
"length",
"=",
"value",
".",
"length",
"+",
"1",
";",
"var",
"subvalue",
"=",... | Tokenise a block inline attribute list
@example
tokenizeBlockInlineAttributeList(eat, '{lang=javascript}');
@param {function(string)} eat - Eater.
@param {string} value - Rest of content.
@param {boolean?} [silent] - Whether this is a dry run.
@return {Node?|boolean} - `thematicBreak` node. | [
"Tokenise",
"a",
"block",
"inline",
"attribute",
"list"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/remark-cq/index.js#L232-L333 |
41,558 | fullstackio/cq | packages/cq/dist/engines/util.js | rangeExtents | function rangeExtents(ranges) {
var start = Number.MAX_VALUE;
var end = Number.MIN_VALUE;
ranges.map(function (_ref) {
var rs = _ref.start,
re = _ref.end;
start = Math.min(start, rs);
end = Math.max(end, re);
});
return { start: start, end: end };
} | javascript | function rangeExtents(ranges) {
var start = Number.MAX_VALUE;
var end = Number.MIN_VALUE;
ranges.map(function (_ref) {
var rs = _ref.start,
re = _ref.end;
start = Math.min(start, rs);
end = Math.max(end, re);
});
return { start: start, end: end };
} | [
"function",
"rangeExtents",
"(",
"ranges",
")",
"{",
"var",
"start",
"=",
"Number",
".",
"MAX_VALUE",
";",
"var",
"end",
"=",
"Number",
".",
"MIN_VALUE",
";",
"ranges",
".",
"map",
"(",
"function",
"(",
"_ref",
")",
"{",
"var",
"rs",
"=",
"_ref",
"."... | cq Engine Util
Utility functions | [
"cq",
"Engine",
"Util"
] | a9425c677b558f92f73a15d38ad39ac1d2deb189 | https://github.com/fullstackio/cq/blob/a9425c677b558f92f73a15d38ad39ac1d2deb189/packages/cq/dist/engines/util.js#L14-L25 |
41,559 | alawatthe/MathLib | build/es6/Functn.js | function (f, a, b, fa, fc, fb, options) {
var h = b - a, c = (a + b) / 2, fd = f((a + c) / 2), fe = f((c + b) / 2), Q1 = (h / 6) * (fa + 4 * fc + fb), Q2 = (h / 12) * (fa + 4 * fd + 2 * fc + 4 * fe + fb), Q = Q2 + (Q2 - Q1) / 15;
options.calls = options.calls + 2;
// Infinite or Not-a-Number function valu... | javascript | function (f, a, b, fa, fc, fb, options) {
var h = b - a, c = (a + b) / 2, fd = f((a + c) / 2), fe = f((c + b) / 2), Q1 = (h / 6) * (fa + 4 * fc + fb), Q2 = (h / 12) * (fa + 4 * fd + 2 * fc + 4 * fe + fb), Q = Q2 + (Q2 - Q1) / 15;
options.calls = options.calls + 2;
// Infinite or Not-a-Number function valu... | [
"function",
"(",
"f",
",",
"a",
",",
"b",
",",
"fa",
",",
"fc",
",",
"fb",
",",
"options",
")",
"{",
"var",
"h",
"=",
"b",
"-",
"a",
",",
"c",
"=",
"(",
"a",
"+",
"b",
")",
"/",
"2",
",",
"fd",
"=",
"f",
"(",
"(",
"a",
"+",
"c",
")"... | Recursive function for the quad method | [
"Recursive",
"function",
"for",
"the",
"quad",
"method"
] | 43dbd35263da672bd2ca41f93dc447b60da9bdac | https://github.com/alawatthe/MathLib/blob/43dbd35263da672bd2ca41f93dc447b60da9bdac/build/es6/Functn.js#L1120-L1150 | |
41,560 | wbyoung/azul | lib/relations/has_one.js | function() {
this._super.apply(this, arguments);
if (this._options.through) {
this._options.through = inflection.singularize(this._options.through);
}
} | javascript | function() {
this._super.apply(this, arguments);
if (this._options.through) {
this._options.through = inflection.singularize(this._options.through);
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"_super",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"if",
"(",
"this",
".",
"_options",
".",
"through",
")",
"{",
"this",
".",
"_options",
".",
"through",
"=",
"inflection",
".",
"singularize",
"("... | Create a HasOne relation.
@protected
@constructor HasOne
@see {@link Database#hasOne} | [
"Create",
"a",
"HasOne",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_one.js#L51-L57 | |
41,561 | wbyoung/azul | lib/relations/has_one.js | function(instance, value) {
var collection = this._getCollectionCache(instance);
var current = collection && collection[0];
if (current) { this.removeObjects(instance, current); }
if (value) { this.addObjects(instance, value); }
} | javascript | function(instance, value) {
var collection = this._getCollectionCache(instance);
var current = collection && collection[0];
if (current) { this.removeObjects(instance, current); }
if (value) { this.addObjects(instance, value); }
} | [
"function",
"(",
"instance",
",",
"value",
")",
"{",
"var",
"collection",
"=",
"this",
".",
"_getCollectionCache",
"(",
"instance",
")",
";",
"var",
"current",
"=",
"collection",
"&&",
"collection",
"[",
"0",
"]",
";",
"if",
"(",
"current",
")",
"{",
"... | The item property setter for this relation.
This property allows altering the associated object of a specific model in
a given relation.
It is accessible on an individual model via assignment with `<singular>`
and via `set<Singular>`. For instance, a user that has one blog would
cause this method to get triggered via... | [
"The",
"item",
"property",
"setter",
"for",
"this",
"relation",
"."
] | 860197318f9a1ca79970b2d053351e44e810b1ef | https://github.com/wbyoung/azul/blob/860197318f9a1ca79970b2d053351e44e810b1ef/lib/relations/has_one.js#L99-L104 | |
41,562 | DFFR-NT/dffrnt.route | lib/routes.js | AddDocuments | function AddDocuments () {
// Create Helpdoc Route
HLP .all("/", ReqHandle.Valid(true), GetHelp);
API .use('/docs', HLP);
} | javascript | function AddDocuments () {
// Create Helpdoc Route
HLP .all("/", ReqHandle.Valid(true), GetHelp);
API .use('/docs', HLP);
} | [
"function",
"AddDocuments",
"(",
")",
"{",
"// Create Helpdoc Route",
"HLP",
".",
"all",
"(",
"\"/\"",
",",
"ReqHandle",
".",
"Valid",
"(",
"true",
")",
",",
"GetHelp",
")",
";",
"API",
".",
"use",
"(",
"'/docs'",
",",
"HLP",
")",
";",
"}"
] | Endpoints for when API documentation is requested or during API errors | [
"Endpoints",
"for",
"when",
"API",
"documentation",
"is",
"requested",
"or",
"during",
"API",
"errors"
] | 3b0ff9510de0e458a373e9c0e260d5ed6ff8b249 | https://github.com/DFFR-NT/dffrnt.route/blob/3b0ff9510de0e458a373e9c0e260d5ed6ff8b249/lib/routes.js#L655-L659 |
41,563 | bigeasy/procession | splitter.js | Splitter | function Splitter (queue, splits) {
this._shifter = queue.shifter()
this._map = {}
this._array = []
for (var key in splits) {
var queue = new Procession
var split = {
selector: splits[key],
queue: queue,
shifter: queue.shifter()
}
this.... | javascript | function Splitter (queue, splits) {
this._shifter = queue.shifter()
this._map = {}
this._array = []
for (var key in splits) {
var queue = new Procession
var split = {
selector: splits[key],
queue: queue,
shifter: queue.shifter()
}
this.... | [
"function",
"Splitter",
"(",
"queue",
",",
"splits",
")",
"{",
"this",
".",
"_shifter",
"=",
"queue",
".",
"shifter",
"(",
")",
"this",
".",
"_map",
"=",
"{",
"}",
"this",
".",
"_array",
"=",
"[",
"]",
"for",
"(",
"var",
"key",
"in",
"splits",
")... | Create a splitter that will split the given queue. | [
"Create",
"a",
"splitter",
"that",
"will",
"split",
"the",
"given",
"queue",
"."
] | c8ea48a72a55cbe8b9b153e23ffcef9902e67038 | https://github.com/bigeasy/procession/blob/c8ea48a72a55cbe8b9b153e23ffcef9902e67038/splitter.js#L10-L24 |
41,564 | LeisureLink/magicbus | lib/subscriber.js | Subscriber | function Subscriber(consumer, eventDispatcher, logger, events) {
assert.object(consumer, 'consumer');
assert.object(eventDispatcher, 'eventDispatcher');
assert.object(logger, 'logger');
assert.object(events, 'events');
/**
* Internal message handler, passes message to event dispatcher
*
* @private
... | javascript | function Subscriber(consumer, eventDispatcher, logger, events) {
assert.object(consumer, 'consumer');
assert.object(eventDispatcher, 'eventDispatcher');
assert.object(logger, 'logger');
assert.object(events, 'events');
/**
* Internal message handler, passes message to event dispatcher
*
* @private
... | [
"function",
"Subscriber",
"(",
"consumer",
",",
"eventDispatcher",
",",
"logger",
",",
"events",
")",
"{",
"assert",
".",
"object",
"(",
"consumer",
",",
"'consumer'",
")",
";",
"assert",
".",
"object",
"(",
"eventDispatcher",
",",
"'eventDispatcher'",
")",
... | Handles consumption of event messages from the bus
@public
@constructor
@param {Object} consumer - instance of the {@link Consumer} class
@param {Object} eventDispatcher - instance of the {@link EventDispatcher} class
@param {Object} logger - the logger
@param {EventEmitter} events - the event emitter for unhandled ex... | [
"Handles",
"consumption",
"of",
"event",
"messages",
"from",
"the",
"bus"
] | 0370c38ebb8c7917cfd3894263d734aefc2d3d29 | https://github.com/LeisureLink/magicbus/blob/0370c38ebb8c7917cfd3894263d734aefc2d3d29/lib/subscriber.js#L16-L142 |
41,565 | whitfin/dep-validate | lib/dep-validate.js | format | function format(results) {
if (_isFormatted(results)) {
return results;
}
var dependencyErrors = results.dependencies || [];
var devDependencyErrors = results.devDependencies || [];
var formattedErrors = { };
formattedErrors.dependencies = dependencyErrors.length
? _formatErrors('Dependencies', d... | javascript | function format(results) {
if (_isFormatted(results)) {
return results;
}
var dependencyErrors = results.dependencies || [];
var devDependencyErrors = results.devDependencies || [];
var formattedErrors = { };
formattedErrors.dependencies = dependencyErrors.length
? _formatErrors('Dependencies', d... | [
"function",
"format",
"(",
"results",
")",
"{",
"if",
"(",
"_isFormatted",
"(",
"results",
")",
")",
"{",
"return",
"results",
";",
"}",
"var",
"dependencyErrors",
"=",
"results",
".",
"dependencies",
"||",
"[",
"]",
";",
"var",
"devDependencyErrors",
"=",... | Formats an Object of results.
The Object should be of the same form as the result of
calling #validate, as the formatter expects the values
to be piped straight through.
@param results our Object containing validation results.
@returns {{dependencies: Array, devDependencies: Array}}. | [
"Formats",
"an",
"Object",
"of",
"results",
"."
] | 2f334d1c0a6e9f93429ce34ca165e28c1c072c1b | https://github.com/whitfin/dep-validate/blob/2f334d1c0a6e9f93429ce34ca165e28c1c072c1b/lib/dep-validate.js#L62-L81 |
41,566 | whitfin/dep-validate | lib/dep-validate.js | hasErrors | function hasErrors(results) {
return (results.dependencies && results.dependencies.length) ||
(results.devDependencies && results.devDependencies.length)
} | javascript | function hasErrors(results) {
return (results.dependencies && results.dependencies.length) ||
(results.devDependencies && results.devDependencies.length)
} | [
"function",
"hasErrors",
"(",
"results",
")",
"{",
"return",
"(",
"results",
".",
"dependencies",
"&&",
"results",
".",
"dependencies",
".",
"length",
")",
"||",
"(",
"results",
".",
"devDependencies",
"&&",
"results",
".",
"devDependencies",
".",
"length",
... | Detects if a results Object contains any errors.
@param results our Object containing validation results.
@returns true if errors are contained in the results. | [
"Detects",
"if",
"a",
"results",
"Object",
"contains",
"any",
"errors",
"."
] | 2f334d1c0a6e9f93429ce34ca165e28c1c072c1b | https://github.com/whitfin/dep-validate/blob/2f334d1c0a6e9f93429ce34ca165e28c1c072c1b/lib/dep-validate.js#L89-L92 |
41,567 | whitfin/dep-validate | lib/dep-validate.js | gulp | function gulp(opts) {
opts = opts || {};
var failOnError = opts['failOnError'] || false;
var interimFiles = [];
var failedValidations = [];
return Through(
function (file) {
interimFiles.push(file.path);
this.queue(file);
},
function () {
var baseFile = opts.packageFile;
... | javascript | function gulp(opts) {
opts = opts || {};
var failOnError = opts['failOnError'] || false;
var interimFiles = [];
var failedValidations = [];
return Through(
function (file) {
interimFiles.push(file.path);
this.queue(file);
},
function () {
var baseFile = opts.packageFile;
... | [
"function",
"gulp",
"(",
"opts",
")",
"{",
"opts",
"=",
"opts",
"||",
"{",
"}",
";",
"var",
"failOnError",
"=",
"opts",
"[",
"'failOnError'",
"]",
"||",
"false",
";",
"var",
"interimFiles",
"=",
"[",
"]",
";",
"var",
"failedValidations",
"=",
"[",
"]... | Returns a Transform Stream for use with Gulp.
@param opts an options Object (see README.md).
@returns a Stream instance for Gulp use. | [
"Returns",
"a",
"Transform",
"Stream",
"for",
"use",
"with",
"Gulp",
"."
] | 2f334d1c0a6e9f93429ce34ca165e28c1c072c1b | https://github.com/whitfin/dep-validate/blob/2f334d1c0a6e9f93429ce34ca165e28c1c072c1b/lib/dep-validate.js#L100-L135 |
41,568 | whitfin/dep-validate | lib/dep-validate.js | log | function log(results, stream) {
stream = stream || process.stdout;
if (results instanceof Error) {
results = results.meta;
}
if (!_isFormatted(results)) {
results = format(results);
}
stream.write(_join(results));
} | javascript | function log(results, stream) {
stream = stream || process.stdout;
if (results instanceof Error) {
results = results.meta;
}
if (!_isFormatted(results)) {
results = format(results);
}
stream.write(_join(results));
} | [
"function",
"log",
"(",
"results",
",",
"stream",
")",
"{",
"stream",
"=",
"stream",
"||",
"process",
".",
"stdout",
";",
"if",
"(",
"results",
"instanceof",
"Error",
")",
"{",
"results",
"=",
"results",
".",
"meta",
";",
"}",
"if",
"(",
"!",
"_isFor... | Logs a results Object out to a given write stream.
The stream defaults to `process.stdout`, and results
will be formatted on-demand if needed.
@param results our Object containing validation results.
@param stream a write stream to write the log to. | [
"Logs",
"a",
"results",
"Object",
"out",
"to",
"a",
"given",
"write",
"stream",
"."
] | 2f334d1c0a6e9f93429ce34ca165e28c1c072c1b | https://github.com/whitfin/dep-validate/blob/2f334d1c0a6e9f93429ce34ca165e28c1c072c1b/lib/dep-validate.js#L146-L158 |
41,569 | ofidj/fidj | .todo/miapp.tools.array.js | removeKeyFromList | function removeKeyFromList(list, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | javascript | function removeKeyFromList(list, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | [
"function",
"removeKeyFromList",
"(",
"list",
",",
"key",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"[",
"key",
"]",
... | Remove from list the last object having the same key attribute as value
@param list Array of objects having key attribute comparable to value
@param {string} key
@param value
@return {*} Array of deleted item or false | [
"Remove",
"from",
"list",
"the",
"last",
"object",
"having",
"the",
"same",
"key",
"attribute",
"as",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L146-L153 |
41,570 | ofidj/fidj | .todo/miapp.tools.array.js | replaceKeyFromList | function replaceKeyFromList(list, key, value, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list.splice(i, 1, object); // remove from array and replace by the new object
}
}
return false;
} | javascript | function replaceKeyFromList(list, key, value, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list.splice(i, 1, object); // remove from array and replace by the new object
}
}
return false;
} | [
"function",
"replaceKeyFromList",
"(",
"list",
",",
"key",
",",
"value",
",",
"object",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"... | Replace in list the last object having the same key attribute as value
@param list Array of objects having key attribute comparable to value
@param {string} key
@param value
@param object New object replacing the old one
@return {*} Array of replaced item or false | [
"Replace",
"in",
"list",
"the",
"last",
"object",
"having",
"the",
"same",
"key",
"attribute",
"as",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L164-L171 |
41,571 | ofidj/fidj | .todo/miapp.tools.array.js | addKeyToList | function addKeyToList(list, key, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == object[key]) {
return false;
}
}
list.push(object);
return true;
} | javascript | function addKeyToList(list, key, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == object[key]) {
return false;
}
}
list.push(object);
return true;
} | [
"function",
"addKeyToList",
"(",
"list",
",",
"key",
",",
"object",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"[",
"key",
"]",
"=... | Add in list the argument object if none has the same key attribute
@param list Array of objects having key attribute
@param {string} key
@param object New object to add
@return {boolean} True if added or false if already exists in list | [
"Add",
"in",
"list",
"the",
"argument",
"object",
"if",
"none",
"has",
"the",
"same",
"key",
"attribute"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L181-L189 |
41,572 | ofidj/fidj | .todo/miapp.tools.array.js | getKeyFromList | function getKeyFromList(list, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list[i];
}
}
return false;
} | javascript | function getKeyFromList(list, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i][key] == value) {
return list[i];
}
}
return false;
} | [
"function",
"getKeyFromList",
"(",
"list",
",",
"key",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"[",
"key",
"]",
"... | Check if one object in list has the same key attribute as value and return it
@param list Array of objects having key attribute comparable to value
@param {string} key
@param value
@return {*} Object if exists or false if none exists in list | [
"Check",
"if",
"one",
"object",
"in",
"list",
"has",
"the",
"same",
"key",
"attribute",
"as",
"value",
"and",
"return",
"it"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L199-L206 |
41,573 | ofidj/fidj | .todo/miapp.tools.array.js | removeSubKeyFromList | function removeSubKeyFromList(list, sub, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | javascript | function removeSubKeyFromList(list, sub, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | [
"function",
"removeSubKeyFromList",
"(",
"list",
",",
"sub",
",",
"key",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"a4p",
".",
"isDefined",
"(... | Remove from list the last object having the same sub.key attribute as value
@param list Array of objects having sub.key attribute comparable to value
@param {string} sub
@param {string} key
@param value
@return {*} Array of deleted item or false | [
"Remove",
"from",
"list",
"the",
"last",
"object",
"having",
"the",
"same",
"sub",
".",
"key",
"attribute",
"as",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L217-L224 |
41,574 | ofidj/fidj | .todo/miapp.tools.array.js | replaceSubKeyFromList | function replaceSubKeyFromList(list, sub, key, value, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list.splice(i, 1, object); // remove from array and replace by the new object
}
}
return false;
} | javascript | function replaceSubKeyFromList(list, sub, key, value, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list.splice(i, 1, object); // remove from array and replace by the new object
}
}
return false;
} | [
"function",
"replaceSubKeyFromList",
"(",
"list",
",",
"sub",
",",
"key",
",",
"value",
",",
"object",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"a4p",
".",... | Replace in list the last object having the same sub.key attribute as value
@param list Array of objects having sub.key attribute comparable to value
@param {string} sub
@param {string} key
@param value
@param object New object replacing the old one
@return {*} Array of replaced item or false | [
"Replace",
"in",
"list",
"the",
"last",
"object",
"having",
"the",
"same",
"sub",
".",
"key",
"attribute",
"as",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L236-L243 |
41,575 | ofidj/fidj | .todo/miapp.tools.array.js | addSubKeyToList | function addSubKeyToList(list, sub, key, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == object[sub][key])) {
return false;
}
}
list.push(object);
return true;
} | javascript | function addSubKeyToList(list, sub, key, object) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == object[sub][key])) {
return false;
}
}
list.push(object);
return true;
} | [
"function",
"addSubKeyToList",
"(",
"list",
",",
"sub",
",",
"key",
",",
"object",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"a4p",
".",
"isDefined",
"(",
... | Add in list the argument object if none has the same sub.key attribute
@param list Array of objects having sub.key attribute
@param {string} sub
@param {string} key
@param object New object to add
@return {boolean} True if added or false if already exists in list | [
"Add",
"in",
"list",
"the",
"argument",
"object",
"if",
"none",
"has",
"the",
"same",
"sub",
".",
"key",
"attribute"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L254-L262 |
41,576 | ofidj/fidj | .todo/miapp.tools.array.js | getSubKeyFromList | function getSubKeyFromList(list, sub, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list[i];
}
}
return false;
} | javascript | function getSubKeyFromList(list, sub, key, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
return list[i];
}
}
return false;
} | [
"function",
"getSubKeyFromList",
"(",
"list",
",",
"sub",
",",
"key",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"a4p",
".",
"isDefined",
"(",
... | Check if one object in list has the same sub.key attribute as value and return it
@param list Array of objects having sub.key attribute comparable to value
@param {string} sub
@param {string} key
@param value
@return {*} Object if exists or false if none exists in list | [
"Check",
"if",
"one",
"object",
"in",
"list",
"has",
"the",
"same",
"sub",
".",
"key",
"attribute",
"as",
"value",
"and",
"return",
"it"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L273-L280 |
41,577 | ofidj/fidj | .todo/miapp.tools.array.js | removeValueFromList | function removeValueFromList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | javascript | function removeValueFromList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return list.splice(i, 1); // remove from array
}
}
return false;
} | [
"function",
"removeValueFromList",
"(",
"list",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"==",
"value",
")",
"{",
"r... | Remove from list the last object being equal to value
@param list Array of objects comparable to value
@param value
@return {*} Array of deleted item or false | [
"Remove",
"from",
"list",
"the",
"last",
"object",
"being",
"equal",
"to",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L289-L296 |
41,578 | ofidj/fidj | .todo/miapp.tools.array.js | replaceValueFromList | function replaceValueFromList(list, oldValue, newValue) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == oldValue) {
return list.splice(i, 1, newValue); // remove from array and replace by the new object
}
}
return false;
} | javascript | function replaceValueFromList(list, oldValue, newValue) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == oldValue) {
return list.splice(i, 1, newValue); // remove from array and replace by the new object
}
}
return false;
} | [
"function",
"replaceValueFromList",
"(",
"list",
",",
"oldValue",
",",
"newValue",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"==",
"o... | Replace in list the last object being equal to oldValue.
Beware, this can insert duplicates in the list !
@param list Array of objects comparable to oldValue
@param oldValue
@param newValue New object replacing the old one
@return {*} Array of replaced item or false | [
"Replace",
"in",
"list",
"the",
"last",
"object",
"being",
"equal",
"to",
"oldValue",
".",
"Beware",
"this",
"can",
"insert",
"duplicates",
"in",
"the",
"list",
"!"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L307-L314 |
41,579 | ofidj/fidj | .todo/miapp.tools.array.js | addValueToList | function addValueToList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return false;
}
}
list.push(value);
return true;
} | javascript | function addValueToList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return false;
}
}
list.push(value);
return true;
} | [
"function",
"addValueToList",
"(",
"list",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"==",
"value",
")",
"{",
"return... | Add in list the value if none equals value
@param list Array of objects comparable to value
@param value New value to add
@return {boolean} True if added or false if already exists in list | [
"Add",
"in",
"list",
"the",
"value",
"if",
"none",
"equals",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L323-L331 |
41,580 | ofidj/fidj | .todo/miapp.tools.array.js | isValueInList | function isValueInList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return true;
}
}
return false;
} | javascript | function isValueInList(list, value) {
for (var i = list.length - 1; i >= 0; i--) {
if (list[i] == value) {
return true;
}
}
return false;
} | [
"function",
"isValueInList",
"(",
"list",
",",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"list",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"list",
"[",
"i",
"]",
"==",
"value",
")",
"{",
"return"... | Check if one value in list has the same value
@param list Array of objects comparable to value
@param value
@return {boolean} True if exists or false if none exists in list | [
"Check",
"if",
"one",
"value",
"in",
"list",
"has",
"the",
"same",
"value"
] | e57ebece54ee68211d43802a8e0feeef098d3e36 | https://github.com/ofidj/fidj/blob/e57ebece54ee68211d43802a8e0feeef098d3e36/.todo/miapp.tools.array.js#L340-L347 |
41,581 | urturn/urturn-expression-api | lib/expression-api/PublicCollection.js | function(oldItem, newItem) {
if(data.operations) {
for(var i = 0; i < data.operations.length; i++) {
var operation = data.operations[i];
if(newItem && newItem[operation.field] !== undefined || oldItem && oldItem[operation.field] !== undefined) {
opsToolbox[operation.operati... | javascript | function(oldItem, newItem) {
if(data.operations) {
for(var i = 0; i < data.operations.length; i++) {
var operation = data.operations[i];
if(newItem && newItem[operation.field] !== undefined || oldItem && oldItem[operation.field] !== undefined) {
opsToolbox[operation.operati... | [
"function",
"(",
"oldItem",
",",
"newItem",
")",
"{",
"if",
"(",
"data",
".",
"operations",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"operations",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"operation",
"=",
... | PRIVATE Methods Recompute the operations results | [
"PRIVATE",
"Methods",
"Recompute",
"the",
"operations",
"results"
] | 009a272ee670dbbe5eefb5c070ed827dd778bb07 | https://github.com/urturn/urturn-expression-api/blob/009a272ee670dbbe5eefb5c070ed827dd778bb07/lib/expression-api/PublicCollection.js#L289-L298 | |
41,582 | jonschlinkert/lookup-deps | index.js | Lookup | function Lookup(options) {
this.options = options || {};
this.cwd = this.options.cwd || process.cwd();
this.limit = this.options.limit || 25;
this.versions = {};
this.history = {};
this.parents = {};
this.cache = {};
this._paths = [];
this.init(options);
} | javascript | function Lookup(options) {
this.options = options || {};
this.cwd = this.options.cwd || process.cwd();
this.limit = this.options.limit || 25;
this.versions = {};
this.history = {};
this.parents = {};
this.cache = {};
this._paths = [];
this.init(options);
} | [
"function",
"Lookup",
"(",
"options",
")",
"{",
"this",
".",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"cwd",
"=",
"this",
".",
"options",
".",
"cwd",
"||",
"process",
".",
"cwd",
"(",
")",
";",
"this",
".",
"limit",
"=",
"this... | Create a new instance of `Lookup`.
```js
var Lookup = require('lookup-deps');
var deps = new Lookup();
```
@param {Object} `config` Optionally pass a default config object instead of `package.json`
For now there is no reason to do this.
@param {Object} `options`
@api public | [
"Create",
"a",
"new",
"instance",
"of",
"Lookup",
"."
] | fd9ca05abdaf543b954bfb170896ac6a4bf3fe07 | https://github.com/jonschlinkert/lookup-deps/blob/fd9ca05abdaf543b954bfb170896ac6a4bf3fe07/index.js#L46-L56 |
41,583 | Mammut-FE/nejm | src/util/dispatcher/dsp/group.js | function(_node){
var _module;
_node = _node._$getParent();
while(!!_node){
_module = _node._$getData().module;
if (_t2._$isModule(_module)){
return _module._$getExportData();
}
_node = _node._$getPare... | javascript | function(_node){
var _module;
_node = _node._$getParent();
while(!!_node){
_module = _node._$getData().module;
if (_t2._$isModule(_module)){
return _module._$getExportData();
}
_node = _node._$getPare... | [
"function",
"(",
"_node",
")",
"{",
"var",
"_module",
";",
"_node",
"=",
"_node",
".",
"_$getParent",
"(",
")",
";",
"while",
"(",
"!",
"!",
"_node",
")",
"{",
"_module",
"=",
"_node",
".",
"_$getData",
"(",
")",
".",
"module",
";",
"if",
"(",
"_... | get nearest parent export data | [
"get",
"nearest",
"parent",
"export",
"data"
] | dfc09ac66a8d67620a7aea65e34d8a179976b3fb | https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/dispatcher/dsp/group.js#L203-L214 | |
41,584 | Mammut-FE/nejm | src/util/dispatcher/dsp/group.js | function (module, config) {
var ret = {
url: (config.root||'')+module,
version: (config.ver||_o)[module]
};
// convert xxx.html to xxx_ver.html
if (!!config.mode&&!!ret.version){
ret.url = ret.url.replace(
... | javascript | function (module, config) {
var ret = {
url: (config.root||'')+module,
version: (config.ver||_o)[module]
};
// convert xxx.html to xxx_ver.html
if (!!config.mode&&!!ret.version){
ret.url = ret.url.replace(
... | [
"function",
"(",
"module",
",",
"config",
")",
"{",
"var",
"ret",
"=",
"{",
"url",
":",
"(",
"config",
".",
"root",
"||",
"''",
")",
"+",
"module",
",",
"version",
":",
"(",
"config",
".",
"ver",
"||",
"_o",
")",
"[",
"module",
"]",
"}",
";",
... | parse module url config - ver,root,mode | [
"parse",
"module",
"url",
"config",
"-",
"ver",
"root",
"mode"
] | dfc09ac66a8d67620a7aea65e34d8a179976b3fb | https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/dispatcher/dsp/group.js#L217-L231 | |
41,585 | zazuko/trifid-core | plugins/locals.js | locals | function locals (router) {
router.use((req, res, next) => {
absoluteUrl.attach(req)
// requested resource
res.locals.iri = req.iri
// requested resource parsed into URL object
res.locals.url = url.parse(res.locals.iri)
// dummy translation
res.locals.t = res.locals.t || ((x) => {
... | javascript | function locals (router) {
router.use((req, res, next) => {
absoluteUrl.attach(req)
// requested resource
res.locals.iri = req.iri
// requested resource parsed into URL object
res.locals.url = url.parse(res.locals.iri)
// dummy translation
res.locals.t = res.locals.t || ((x) => {
... | [
"function",
"locals",
"(",
"router",
")",
"{",
"router",
".",
"use",
"(",
"(",
"req",
",",
"res",
",",
"next",
")",
"=>",
"{",
"absoluteUrl",
".",
"attach",
"(",
"req",
")",
"// requested resource",
"res",
".",
"locals",
".",
"iri",
"=",
"req",
".",
... | Adds router and request locals variables
@param router | [
"Adds",
"router",
"and",
"request",
"locals",
"variables"
] | 47068ef508971f562e35768d829e15699ce3e19c | https://github.com/zazuko/trifid-core/blob/47068ef508971f562e35768d829e15699ce3e19c/plugins/locals.js#L8-L25 |
41,586 | jmjuanes/stattic | index.js | function (res, errorCode, errorMessage) {
res.writeHead(errorCode, {"Content-Type": "text/html"});
//Read the local error file
return fs.readFile(options.error, "utf8", function (error, content) {
//Check the error
if (error) {
return res.end("<" + "h1>Error</h1><p>" + errorMessa... | javascript | function (res, errorCode, errorMessage) {
res.writeHead(errorCode, {"Content-Type": "text/html"});
//Read the local error file
return fs.readFile(options.error, "utf8", function (error, content) {
//Check the error
if (error) {
return res.end("<" + "h1>Error</h1><p>" + errorMessa... | [
"function",
"(",
"res",
",",
"errorCode",
",",
"errorMessage",
")",
"{",
"res",
".",
"writeHead",
"(",
"errorCode",
",",
"{",
"\"Content-Type\"",
":",
"\"text/html\"",
"}",
")",
";",
"//Read the local error file",
"return",
"fs",
".",
"readFile",
"(",
"options... | Display an error page | [
"Display",
"an",
"error",
"page"
] | b7930953f235690f1458de0b95c0c759aa9da7f3 | https://github.com/jmjuanes/stattic/blob/b7930953f235690f1458de0b95c0c759aa9da7f3/index.js#L113-L133 | |
41,587 | veo-labs/openveo-api | lib/controllers/SocketController.js | SocketController | function SocketController(namespace) {
SocketController.super_.call(this);
Object.defineProperties(this, {
/**
* Socket's namespace associated to the controller.
*
* @property namespace
* @type SocketNamespace
* @final
*/
namespace: {value: namespace},
/**
* An emit... | javascript | function SocketController(namespace) {
SocketController.super_.call(this);
Object.defineProperties(this, {
/**
* Socket's namespace associated to the controller.
*
* @property namespace
* @type SocketNamespace
* @final
*/
namespace: {value: namespace},
/**
* An emit... | [
"function",
"SocketController",
"(",
"namespace",
")",
"{",
"SocketController",
".",
"super_",
".",
"call",
"(",
"this",
")",
";",
"Object",
".",
"defineProperties",
"(",
"this",
",",
"{",
"/**\n * Socket's namespace associated to the controller.\n *\n * @prop... | Defines base controller for all controllers which need to handle socket messages.
A SocketController is associated to a namespace to be able to emit a message to the
whole socket namespace.
A SocketController is also associated to an emitter to emit socket's clients' messages to pilots.
// Implement a SocketControll... | [
"Defines",
"base",
"controller",
"for",
"all",
"controllers",
"which",
"need",
"to",
"handle",
"socket",
"messages",
"."
] | 493a811e9a5ba4d3e14910facaa7452caba1ab38 | https://github.com/veo-labs/openveo-api/blob/493a811e9a5ba4d3e14910facaa7452caba1ab38/lib/controllers/SocketController.js#L34-L58 |
41,588 | Bartvds/ministyle | lib/flow.js | toggle | function toggle(main, alt) {
var mw = core.base();
mw.enabled = true;
mw.main = main;
mw.alt = (alt || common.plain());
mw.active = mw.main;
mw.swap = function () {
mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
};
mw.error = function (str) {
str = String(str);
if (mw.enabled && mw.ac... | javascript | function toggle(main, alt) {
var mw = core.base();
mw.enabled = true;
mw.main = main;
mw.alt = (alt || common.plain());
mw.active = mw.main;
mw.swap = function () {
mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
};
mw.error = function (str) {
str = String(str);
if (mw.enabled && mw.ac... | [
"function",
"toggle",
"(",
"main",
",",
"alt",
")",
"{",
"var",
"mw",
"=",
"core",
".",
"base",
"(",
")",
";",
"mw",
".",
"enabled",
"=",
"true",
";",
"mw",
".",
"main",
"=",
"main",
";",
"mw",
".",
"alt",
"=",
"(",
"alt",
"||",
"common",
"."... | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - toggle flow | [
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"... | 92681e81d4c93faddd4e5d1d6edf44990b3a9e68 | https://github.com/Bartvds/ministyle/blob/92681e81d4c93faddd4e5d1d6edf44990b3a9e68/lib/flow.js#L50-L113 |
41,589 | atsid/circuits-js | js/NativeXhrDataProvider.js | function (url) {
var ret = true, xhr;
try {
// try the lowest footprint synchronous request to specific url.
xhr = new XMLHttpRequest();
xhr.open("HEAD", url, false);
xhr.send();
} catch (e) {
ret... | javascript | function (url) {
var ret = true, xhr;
try {
// try the lowest footprint synchronous request to specific url.
xhr = new XMLHttpRequest();
xhr.open("HEAD", url, false);
xhr.send();
} catch (e) {
ret... | [
"function",
"(",
"url",
")",
"{",
"var",
"ret",
"=",
"true",
",",
"xhr",
";",
"try",
"{",
"// try the lowest footprint synchronous request to specific url.\r",
"xhr",
"=",
"new",
"XMLHttpRequest",
"(",
")",
";",
"xhr",
".",
"open",
"(",
"\"HEAD\"",
",",
"url",... | test - do a network test with a synchronous call.
@param url to test. | [
"test",
"-",
"do",
"a",
"network",
"test",
"with",
"a",
"synchronous",
"call",
"."
] | f1fa5e98d406b3b9f577dd8995782c7115d6b346 | https://github.com/atsid/circuits-js/blob/f1fa5e98d406b3b9f577dd8995782c7115d6b346/js/NativeXhrDataProvider.js#L38-L49 | |
41,590 | atsid/circuits-js | js/NativeXhrDataProvider.js | function (params) {
var xhr = new XMLHttpRequest(),
async = typeof (params.asynchronous) === "boolean" ? params.asynchronous : this.asynchronous,
readystatechange = function () {
if (params.onreadystatechange) {
params.onread... | javascript | function (params) {
var xhr = new XMLHttpRequest(),
async = typeof (params.asynchronous) === "boolean" ? params.asynchronous : this.asynchronous,
readystatechange = function () {
if (params.onreadystatechange) {
params.onread... | [
"function",
"(",
"params",
")",
"{",
"var",
"xhr",
"=",
"new",
"XMLHttpRequest",
"(",
")",
",",
"async",
"=",
"typeof",
"(",
"params",
".",
"asynchronous",
")",
"===",
"\"boolean\"",
"?",
"params",
".",
"asynchronous",
":",
"this",
".",
"asynchronous",
"... | Perform the actual XMLHttpRequest call, interpreting the params as necessary.
Although this method accepts the bulk of the parameters that can be set on XMLHttpRequest 2,
only a few are passed through from the upstream calls.
@param params - object of the form:
{
onprogress {function}
onloadstart {function}
onabort {f... | [
"Perform",
"the",
"actual",
"XMLHttpRequest",
"call",
"interpreting",
"the",
"params",
"as",
"necessary",
".",
"Although",
"this",
"method",
"accepts",
"the",
"bulk",
"of",
"the",
"parameters",
"that",
"can",
"be",
"set",
"on",
"XMLHttpRequest",
"2",
"only",
"... | f1fa5e98d406b3b9f577dd8995782c7115d6b346 | https://github.com/atsid/circuits-js/blob/f1fa5e98d406b3b9f577dd8995782c7115d6b346/js/NativeXhrDataProvider.js#L183-L263 | |
41,591 | chip-js/observations-js | src/observer.js | function(value) {
if (!this.context) return;
if (this.setter === false) return;
if (!this.setter) {
try {
this.setter = typeof this.expression === 'string'
? expressions.parseSetter(this.expression, this.observations.globals, this.observations.formatters)
: false;
} c... | javascript | function(value) {
if (!this.context) return;
if (this.setter === false) return;
if (!this.setter) {
try {
this.setter = typeof this.expression === 'string'
? expressions.parseSetter(this.expression, this.observations.globals, this.observations.formatters)
: false;
} c... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"!",
"this",
".",
"context",
")",
"return",
";",
"if",
"(",
"this",
".",
"setter",
"===",
"false",
")",
"return",
";",
"if",
"(",
"!",
"this",
".",
"setter",
")",
"{",
"try",
"{",
"this",
".",
"set... | Sets the value of this expression | [
"Sets",
"the",
"value",
"of",
"this",
"expression"
] | a48b32a648089bc86b502712d78cd0b3f8317d50 | https://github.com/chip-js/observations-js/blob/a48b32a648089bc86b502712d78cd0b3f8317d50/src/observer.js#L77-L102 | |
41,592 | chip-js/observations-js | src/observer.js | function() {
var value = this.get();
// Don't call the callback if `skipNextSync` was called on the observer
if (this.skip || !this.callback) {
this.skip = false;
if (this.getChangeRecords) {
// Store an immutable version of the value, allowing for arrays and objects to change instance... | javascript | function() {
var value = this.get();
// Don't call the callback if `skipNextSync` was called on the observer
if (this.skip || !this.callback) {
this.skip = false;
if (this.getChangeRecords) {
// Store an immutable version of the value, allowing for arrays and objects to change instance... | [
"function",
"(",
")",
"{",
"var",
"value",
"=",
"this",
".",
"get",
"(",
")",
";",
"// Don't call the callback if `skipNextSync` was called on the observer",
"if",
"(",
"this",
".",
"skip",
"||",
"!",
"this",
".",
"callback",
")",
"{",
"this",
".",
"skip",
"... | Syncs this observer now, calling the callback immediately if there have been changes | [
"Syncs",
"this",
"observer",
"now",
"calling",
"the",
"callback",
"immediately",
"if",
"there",
"have",
"been",
"changes"
] | a48b32a648089bc86b502712d78cd0b3f8317d50 | https://github.com/chip-js/observations-js/blob/a48b32a648089bc86b502712d78cd0b3f8317d50/src/observer.js#L112-L176 | |
41,593 | Mammut-FE/nejm | src/util/focus/platform/focus.js | function(_clazz,_event){
var _element = _v._$getElement(_event);
if (!_element.value)
_e._$delClassName(_element,_clazz);
} | javascript | function(_clazz,_event){
var _element = _v._$getElement(_event);
if (!_element.value)
_e._$delClassName(_element,_clazz);
} | [
"function",
"(",
"_clazz",
",",
"_event",
")",
"{",
"var",
"_element",
"=",
"_v",
".",
"_$getElement",
"(",
"_event",
")",
";",
"if",
"(",
"!",
"_element",
".",
"value",
")",
"_e",
".",
"_$delClassName",
"(",
"_element",
",",
"_clazz",
")",
";",
"}"
... | do blur check | [
"do",
"blur",
"check"
] | dfc09ac66a8d67620a7aea65e34d8a179976b3fb | https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/focus/platform/focus.js#L21-L25 | |
41,594 | Mammut-FE/nejm | src/util/ajax/rest.js | function(_headers,_key,_default){
var _value = _headers[_key]||
_headers[_key.toLowerCase()];
if (!_value){
_value = _default;
_headers[_key] = _value;
}
return _value;
} | javascript | function(_headers,_key,_default){
var _value = _headers[_key]||
_headers[_key.toLowerCase()];
if (!_value){
_value = _default;
_headers[_key] = _value;
}
return _value;
} | [
"function",
"(",
"_headers",
",",
"_key",
",",
"_default",
")",
"{",
"var",
"_value",
"=",
"_headers",
"[",
"_key",
"]",
"||",
"_headers",
"[",
"_key",
".",
"toLowerCase",
"(",
")",
"]",
";",
"if",
"(",
"!",
"_value",
")",
"{",
"_value",
"=",
"_def... | check default headers | [
"check",
"default",
"headers"
] | dfc09ac66a8d67620a7aea65e34d8a179976b3fb | https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/ajax/rest.js#L132-L140 | |
41,595 | Mammut-FE/nejm | src/util/ajax/rest.js | function(_data,_key,_map){
if (_u._$isArray(_data)){
_map[_key] = JSON.stringify(_data);
}
} | javascript | function(_data,_key,_map){
if (_u._$isArray(_data)){
_map[_key] = JSON.stringify(_data);
}
} | [
"function",
"(",
"_data",
",",
"_key",
",",
"_map",
")",
"{",
"if",
"(",
"_u",
".",
"_$isArray",
"(",
"_data",
")",
")",
"{",
"_map",
"[",
"_key",
"]",
"=",
"JSON",
".",
"stringify",
"(",
"_data",
")",
";",
"}",
"}"
] | pre convert array | [
"pre",
"convert",
"array"
] | dfc09ac66a8d67620a7aea65e34d8a179976b3fb | https://github.com/Mammut-FE/nejm/blob/dfc09ac66a8d67620a7aea65e34d8a179976b3fb/src/util/ajax/rest.js#L142-L146 | |
41,596 | urturn/urturn-expression-api | lib/modules/antiscroll.costum.js | Antiscroll | function Antiscroll (el, opts) {
this.el = $(el);
this.options = opts || {};
// CUSTOM
// this.x = (false !== this.options.x) || this.options.forceHorizontal;
this.x = false; // Always hide horizontal scroll
this.y = (false !== this.options.y) || this.options.forceVertical;
th... | javascript | function Antiscroll (el, opts) {
this.el = $(el);
this.options = opts || {};
// CUSTOM
// this.x = (false !== this.options.x) || this.options.forceHorizontal;
this.x = false; // Always hide horizontal scroll
this.y = (false !== this.options.y) || this.options.forceVertical;
th... | [
"function",
"Antiscroll",
"(",
"el",
",",
"opts",
")",
"{",
"this",
".",
"el",
"=",
"$",
"(",
"el",
")",
";",
"this",
".",
"options",
"=",
"opts",
"||",
"{",
"}",
";",
"// CUSTOM",
"// this.x = (false !== this.options.x) || this.options.forceHorizontal;",
"thi... | Antiscroll pane constructor.
@param {Element|jQuery} main pane
@parma {Object} options
@api public | [
"Antiscroll",
"pane",
"constructor",
"."
] | 009a272ee670dbbe5eefb5c070ed827dd778bb07 | https://github.com/urturn/urturn-expression-api/blob/009a272ee670dbbe5eefb5c070ed827dd778bb07/lib/modules/antiscroll.costum.js#L46-L73 |
41,597 | urturn/urturn-expression-api | lib/modules/antiscroll.costum.js | Scrollbar | function Scrollbar (pane) {
this.pane = pane;
this.pane.el.append(this.el);
this.innerEl = this.pane.inner.get(0);
this.dragging = false;
this.enter = false;
this.shown = false;
// hovering
this.pane.el.mouseenter($.proxy(this, 'mouseenter'));
this.pane.el.mousele... | javascript | function Scrollbar (pane) {
this.pane = pane;
this.pane.el.append(this.el);
this.innerEl = this.pane.inner.get(0);
this.dragging = false;
this.enter = false;
this.shown = false;
// hovering
this.pane.el.mouseenter($.proxy(this, 'mouseenter'));
this.pane.el.mousele... | [
"function",
"Scrollbar",
"(",
"pane",
")",
"{",
"this",
".",
"pane",
"=",
"pane",
";",
"this",
".",
"pane",
".",
"el",
".",
"append",
"(",
"this",
".",
"el",
")",
";",
"this",
".",
"innerEl",
"=",
"this",
".",
"pane",
".",
"inner",
".",
"get",
... | Scrollbar constructor.
@param {Element|jQuery} element
@api public | [
"Scrollbar",
"constructor",
"."
] | 009a272ee670dbbe5eefb5c070ed827dd778bb07 | https://github.com/urturn/urturn-expression-api/blob/009a272ee670dbbe5eefb5c070ed827dd778bb07/lib/modules/antiscroll.costum.js#L149-L182 |
41,598 | urturn/urturn-expression-api | lib/modules/antiscroll.costum.js | inherits | function inherits (ctorA, ctorB) {
function f() {}
f.prototype = ctorB.prototype;
ctorA.prototype = new f();
} | javascript | function inherits (ctorA, ctorB) {
function f() {}
f.prototype = ctorB.prototype;
ctorA.prototype = new f();
} | [
"function",
"inherits",
"(",
"ctorA",
",",
"ctorB",
")",
"{",
"function",
"f",
"(",
")",
"{",
"}",
"f",
".",
"prototype",
"=",
"ctorB",
".",
"prototype",
";",
"ctorA",
".",
"prototype",
"=",
"new",
"f",
"(",
")",
";",
"}"
] | Cross-browser inheritance.
@param {Function} constructor
@param {Function} constructor we inherit from
@api private | [
"Cross",
"-",
"browser",
"inheritance",
"."
] | 009a272ee670dbbe5eefb5c070ed827dd778bb07 | https://github.com/urturn/urturn-expression-api/blob/009a272ee670dbbe5eefb5c070ed827dd778bb07/lib/modules/antiscroll.costum.js#L461-L465 |
41,599 | emeryrose/coalescent | lib/middleware/router.js | Router | function Router(socket, options) {
stream.Transform.call(this, { objectMode: true });
this.options = merge(Object.create(Router.DEFAULTS), options || {});
this.socket = socket;
} | javascript | function Router(socket, options) {
stream.Transform.call(this, { objectMode: true });
this.options = merge(Object.create(Router.DEFAULTS), options || {});
this.socket = socket;
} | [
"function",
"Router",
"(",
"socket",
",",
"options",
")",
"{",
"stream",
".",
"Transform",
".",
"call",
"(",
"this",
",",
"{",
"objectMode",
":",
"true",
"}",
")",
";",
"this",
".",
"options",
"=",
"merge",
"(",
"Object",
".",
"create",
"(",
"Router"... | Routes messages parsed with courier to defined handlers by `type`
@constructor
@param {object} socket
@param {object} options | [
"Routes",
"messages",
"parsed",
"with",
"courier",
"to",
"defined",
"handlers",
"by",
"type"
] | 5e722d4e1c16b9a9e959b281f6bb07713c60c46a | https://github.com/emeryrose/coalescent/blob/5e722d4e1c16b9a9e959b281f6bb07713c60c46a/lib/middleware/router.js#L23-L28 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.