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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
46,100 | clns/node-http-range | lib/content-range.js | ContentRange | function ContentRange(unit, range, length) {
this.unit = unit;
this.range = range;
this.length = length;
if (this.range.high && this.length && this.length <= this.range.high) {
throw new Error('Length is less than or equal to the range');
}
} | javascript | function ContentRange(unit, range, length) {
this.unit = unit;
this.range = range;
this.length = length;
if (this.range.high && this.length && this.length <= this.range.high) {
throw new Error('Length is less than or equal to the range');
}
} | [
"function",
"ContentRange",
"(",
"unit",
",",
"range",
",",
"length",
")",
"{",
"this",
".",
"unit",
"=",
"unit",
";",
"this",
".",
"range",
"=",
"range",
";",
"this",
".",
"length",
"=",
"length",
";",
"if",
"(",
"this",
".",
"range",
".",
"high",... | Content-Range HTTP Header class.
@param {String} unit Usually "bytes", but can be any token; http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.12
@param {RangeSpec|String|'*'} range A RangeSpec instance, a string like '0-49' or '*' if unknown
@param {Number|'*'} length The total length of the full entity-body... | [
"Content",
"-",
"Range",
"HTTP",
"Header",
"class",
"."
] | 0a16a5cdcc7d30ea14712054e683852c524d51de | https://github.com/clns/node-http-range/blob/0a16a5cdcc7d30ea14712054e683852c524d51de/lib/content-range.js#L13-L20 |
46,101 | wojtkowiak/meteor-desktop-localstorage | plugins/localstorage/localstorage.js | load | function load() {
Desktop.fetch('localStorage', 'getAll').then((storage) => {
Meteor._localStorage.storage = storage;
}).catch(() => {
retries += 1;
if (retries < 5) {
load();
} else {
console.error('failed to load localStorage contents');
}
})... | javascript | function load() {
Desktop.fetch('localStorage', 'getAll').then((storage) => {
Meteor._localStorage.storage = storage;
}).catch(() => {
retries += 1;
if (retries < 5) {
load();
} else {
console.error('failed to load localStorage contents');
}
})... | [
"function",
"load",
"(",
")",
"{",
"Desktop",
".",
"fetch",
"(",
"'localStorage'",
",",
"'getAll'",
")",
".",
"then",
"(",
"(",
"storage",
")",
"=>",
"{",
"Meteor",
".",
"_localStorage",
".",
"storage",
"=",
"storage",
";",
"}",
")",
".",
"catch",
"(... | Fetches local storage data from the meteor-desktop-localstorage plugin.
Retries 5 times, then fails. | [
"Fetches",
"local",
"storage",
"data",
"from",
"the",
"meteor",
"-",
"desktop",
"-",
"localstorage",
"plugin",
".",
"Retries",
"5",
"times",
"then",
"fails",
"."
] | 1a4ffb47aca5ae302ebf47ec1e060b5c1a8066e1 | https://github.com/wojtkowiak/meteor-desktop-localstorage/blob/1a4ffb47aca5ae302ebf47ec1e060b5c1a8066e1/plugins/localstorage/localstorage.js#L8-L19 |
46,102 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/lighting-rot.js | LightingROT | function LightingROT(game, settings) {
settings = settings || {};
this.game = game;
this.lightingMap = new RL.Array2d();
this.lightingMap.set = this.lightingMap.set.bind(this.lightingMap);
this.checkVisible = this.checkVisible.bind(this);
this._fov = new ROT.FOV.PreciseS... | javascript | function LightingROT(game, settings) {
settings = settings || {};
this.game = game;
this.lightingMap = new RL.Array2d();
this.lightingMap.set = this.lightingMap.set.bind(this.lightingMap);
this.checkVisible = this.checkVisible.bind(this);
this._fov = new ROT.FOV.PreciseS... | [
"function",
"LightingROT",
"(",
"game",
",",
"settings",
")",
"{",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"this",
".",
"game",
"=",
"game",
";",
"this",
".",
"lightingMap",
"=",
"new",
"RL",
".",
"Array2d",
"(",
")",
";",
"this",
".",
"l... | Represents lighting in the game map. requires ROT.js
Manages position of lights.
Calculates illumination of map tiles.
@class LightingROT
@constructor
@param {Game} game - Game instance this obj is attached to.
@param {Object} [settings] - LightingROT settings object.
@param {Number} [settings.range] - Maximum range fo... | [
"Represents",
"lighting",
"in",
"the",
"game",
"map",
".",
"requires",
"ROT",
".",
"js",
"Manages",
"position",
"of",
"lights",
".",
"Calculates",
"illumination",
"of",
"map",
"tiles",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/lighting-rot.js#L16-L37 |
46,103 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/lighting-rot.js | function(x, y, tileData){
var light = this.ambientLight;
var lighting = this.get(x, y);
var overlay = function(c1, c2){
var out = c1.slice();
for (var i = 0; i < 3; i++) {
var a = c1[i],
b = c2[i];
... | javascript | function(x, y, tileData){
var light = this.ambientLight;
var lighting = this.get(x, y);
var overlay = function(c1, c2){
var out = c1.slice();
for (var i = 0; i < 3; i++) {
var a = c1[i],
b = c2[i];
... | [
"function",
"(",
"x",
",",
"y",
",",
"tileData",
")",
"{",
"var",
"light",
"=",
"this",
".",
"ambientLight",
";",
"var",
"lighting",
"=",
"this",
".",
"get",
"(",
"x",
",",
"y",
")",
";",
"var",
"overlay",
"=",
"function",
"(",
"c1",
",",
"c2",
... | Shades tileData using lighting.
@method shadeTile
@param {Number} x - The x map coordinate to shade.
@param {Number} y - The y map coordinate to shade.
@param {TileData} tileData - The `TileData` object to shade.
@return {TileData} | [
"Shades",
"tileData",
"using",
"lighting",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/lighting-rot.js#L121-L155 | |
46,104 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/lighting-rot.js | function(x, y, r, g, b){
this._lighting.setLight(x, y, [r, g, b]);
this._dirty = true;
} | javascript | function(x, y, r, g, b){
this._lighting.setLight(x, y, [r, g, b]);
this._dirty = true;
} | [
"function",
"(",
"x",
",",
"y",
",",
"r",
",",
"g",
",",
"b",
")",
"{",
"this",
".",
"_lighting",
".",
"setLight",
"(",
"x",
",",
"y",
",",
"[",
"r",
",",
"g",
",",
"b",
"]",
")",
";",
"this",
".",
"_dirty",
"=",
"true",
";",
"}"
] | Set a light position and color
@method set
@param {Number} x - The map coordinate position to set lightin on the x axis.
@param {Number} y - The map coordinate position to set lightin on the y axis.
@param {Number} r - Red.
@param {Number} g - Green.
@param {Number} b - Blue. | [
"Set",
"a",
"light",
"position",
"and",
"color"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/lighting-rot.js#L176-L179 | |
46,105 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/lighting-rot.js | function(x, y){
var tile = this.game.map.get(x, y);
if(!tile){
return 0;
}
if(tile.lightingReflectivity){
return tile.lightingReflectivity;
}
if(tile.blocksLos){
return this.defaultWallReflectivity... | javascript | function(x, y){
var tile = this.game.map.get(x, y);
if(!tile){
return 0;
}
if(tile.lightingReflectivity){
return tile.lightingReflectivity;
}
if(tile.blocksLos){
return this.defaultWallReflectivity... | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"var",
"tile",
"=",
"this",
".",
"game",
".",
"map",
".",
"get",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"!",
"tile",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"tile",
".",
"lightingReflectivity"... | Returns the reflectivity value of a tile
@method getTileReflectivity
@param {Number} x - Map tile x coord.
@param {Number} y - Map tile y coord. | [
"Returns",
"the",
"reflectivity",
"value",
"of",
"a",
"tile"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/lighting-rot.js#L197-L213 | |
46,106 | danieldkim/charlotte | lib/charlotte.js | function(next) {
if (!inNativeApp) return next(null, false, null, null, null);
if (resourceIsBinary(filePath)) {
var fullPath = shared.removeUrlMultislashes(fileFullPathRoot + '/' + filePath),
xhr;
xhr = new XMLHttpRequest();
xhr.open("... | javascript | function(next) {
if (!inNativeApp) return next(null, false, null, null, null);
if (resourceIsBinary(filePath)) {
var fullPath = shared.removeUrlMultislashes(fileFullPathRoot + '/' + filePath),
xhr;
xhr = new XMLHttpRequest();
xhr.open("... | [
"function",
"(",
"next",
")",
"{",
"if",
"(",
"!",
"inNativeApp",
")",
"return",
"next",
"(",
"null",
",",
"false",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"if",
"(",
"resourceIsBinary",
"(",
"filePath",
")",
")",
"{",
"var",
"fullPath",
"... | try to retrieve from cache seed | [
"try",
"to",
"retrieve",
"from",
"cache",
"seed"
] | b4f0afddd6660194b09026513aeeb1c851913044 | https://github.com/danieldkim/charlotte/blob/b4f0afddd6660194b09026513aeeb1c851913044/lib/charlotte.js#L543-L563 | |
46,107 | danieldkim/charlotte | lib/charlotte.js | function(foundInCacheSeed, fullPath, data, compiled, next) {
if (foundInCacheSeed) {
debugLog("Found resource in cache seed: " + cacheUrl)
if (data) {
async.waterfall([
function(next) {
if (url.match(/\.css$/)) {
... | javascript | function(foundInCacheSeed, fullPath, data, compiled, next) {
if (foundInCacheSeed) {
debugLog("Found resource in cache seed: " + cacheUrl)
if (data) {
async.waterfall([
function(next) {
if (url.match(/\.css$/)) {
... | [
"function",
"(",
"foundInCacheSeed",
",",
"fullPath",
",",
"data",
",",
"compiled",
",",
"next",
")",
"{",
"if",
"(",
"foundInCacheSeed",
")",
"{",
"debugLog",
"(",
"\"Found resource in cache seed: \"",
"+",
"cacheUrl",
")",
"if",
"(",
"data",
")",
"{",
"asy... | get from server or write to cache if necessary | [
"get",
"from",
"server",
"or",
"write",
"to",
"cache",
"if",
"necessary"
] | b4f0afddd6660194b09026513aeeb1c851913044 | https://github.com/danieldkim/charlotte/blob/b4f0afddd6660194b09026513aeeb1c851913044/lib/charlotte.js#L566-L591 | |
46,108 | flowgrammable/uint-js | uint.js | UInt | function UInt(args) {
// Assign default valus
this._value = null;
this._bytes = null;
this._bits = null;
this._isHex = false;
// Set constraints if present
if(args && (isNatural(args.bits) || isNatural(args.bytes))) {
// Set the size if either is used
this._bits = args.bits || 0;
... | javascript | function UInt(args) {
// Assign default valus
this._value = null;
this._bytes = null;
this._bits = null;
this._isHex = false;
// Set constraints if present
if(args && (isNatural(args.bits) || isNatural(args.bytes))) {
// Set the size if either is used
this._bits = args.bits || 0;
... | [
"function",
"UInt",
"(",
"args",
")",
"{",
"// Assign default valus\r",
"this",
".",
"_value",
"=",
"null",
";",
"this",
".",
"_bytes",
"=",
"null",
";",
"this",
".",
"_bits",
"=",
"null",
";",
"this",
".",
"_isHex",
"=",
"false",
";",
"// Set constraint... | FIXME old version memoizes 'HEX' if used to set | [
"FIXME",
"old",
"version",
"memoizes",
"HEX",
"if",
"used",
"to",
"set"
] | f9e13967708f47cdd0c3389c2d3c8bc04a98d5dc | https://github.com/flowgrammable/uint-js/blob/f9e13967708f47cdd0c3389c2d3c8bc04a98d5dc/uint.js#L183-L243 |
46,109 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | reduceRight | function reduceRight(collection, callback, accumulator, thisArg) {
if (!collection) {
return accumulator;
}
var length = collection.length,
noaccum = arguments.length < 3;
if(thisArg) {
callback = iteratorBind(callback, thisArg);
}
if (length === length >>> 0) {
if (l... | javascript | function reduceRight(collection, callback, accumulator, thisArg) {
if (!collection) {
return accumulator;
}
var length = collection.length,
noaccum = arguments.length < 3;
if(thisArg) {
callback = iteratorBind(callback, thisArg);
}
if (length === length >>> 0) {
if (l... | [
"function",
"reduceRight",
"(",
"collection",
",",
"callback",
",",
"accumulator",
",",
"thisArg",
")",
"{",
"if",
"(",
"!",
"collection",
")",
"{",
"return",
"accumulator",
";",
"}",
"var",
"length",
"=",
"collection",
".",
"length",
",",
"noaccum",
"=",
... | The right-associative version of `_.reduce`.
@static
@memberOf _
@alias foldr
@category Collections
@param {Array|Object} collection The collection to iterate over.
@param {Function} callback The function called per iteration.
@param {Mixed} [accumulator] Initial value of the accumulator.
@param {Mixed} [thisArg] The ... | [
"The",
"right",
"-",
"associative",
"version",
"of",
"_",
".",
"reduce",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L839-L872 |
46,110 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | toArray | function toArray(collection) {
if (!collection) {
return [];
}
if (toString.call(collection.toArray) == funcClass) {
return collection.toArray();
}
var length = collection.length;
if (length === length >>> 0) {
return slice.call(collection);
}
return values(collection);... | javascript | function toArray(collection) {
if (!collection) {
return [];
}
if (toString.call(collection.toArray) == funcClass) {
return collection.toArray();
}
var length = collection.length;
if (length === length >>> 0) {
return slice.call(collection);
}
return values(collection);... | [
"function",
"toArray",
"(",
"collection",
")",
"{",
"if",
"(",
"!",
"collection",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"toString",
".",
"call",
"(",
"collection",
".",
"toArray",
")",
"==",
"funcClass",
")",
"{",
"return",
"collection",
... | Converts the `collection`, into an array. Useful for converting the
`arguments` object.
@static
@memberOf _
@category Collections
@param {Array|Object} collection The collection to convert.
@returns {Array} Returns the new converted array.
@example
(function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
/... | [
"Converts",
"the",
"collection",
"into",
"an",
"array",
".",
"Useful",
"for",
"converting",
"the",
"arguments",
"object",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L933-L945 |
46,111 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | initial | function initial(array, n, guard) {
if (!array) {
return [];
}
return slice.call(array, 0, -((n == undefined || guard) ? 1 : n));
} | javascript | function initial(array, n, guard) {
if (!array) {
return [];
}
return slice.call(array, 0, -((n == undefined || guard) ? 1 : n));
} | [
"function",
"initial",
"(",
"array",
",",
"n",
",",
"guard",
")",
"{",
"if",
"(",
"!",
"array",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"slice",
".",
"call",
"(",
"array",
",",
"0",
",",
"-",
"(",
"(",
"n",
"==",
"undefined",
"||",
... | Gets all but the last value of `array`. Pass `n` to exclude the last `n`
values from the result.
@static
@memberOf _
@category Arrays
@param {Array} array The array to query.
@param {Number} [n] The number of elements to return.
@param {Object} [guard] Internally used to allow this method to work with
others like `_.m... | [
"Gets",
"all",
"but",
"the",
"last",
"value",
"of",
"array",
".",
"Pass",
"n",
"to",
"exclude",
"the",
"last",
"n",
"values",
"from",
"the",
"result",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1186-L1191 |
46,112 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | intersection | function intersection(array) {
var result = [];
if (!array) {
return result;
}
var value,
index = -1,
length = array.length,
others = slice.call(arguments, 1);
while (++index < length) {
value = array[index];
if (indexOf(result, value) < 0 &&
ever... | javascript | function intersection(array) {
var result = [];
if (!array) {
return result;
}
var value,
index = -1,
length = array.length,
others = slice.call(arguments, 1);
while (++index < length) {
value = array[index];
if (indexOf(result, value) < 0 &&
ever... | [
"function",
"intersection",
"(",
"array",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"array",
")",
"{",
"return",
"result",
";",
"}",
"var",
"value",
",",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
".",
"length",
","... | Computes the intersection of all the passed-in arrays.
@static
@memberOf _
@category Arrays
@param {Array} [array1, array2, ...] Arrays to process.
@returns {Array} Returns a new array of unique values, in order, that are
present in **all** of the arrays.
@example
_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
/... | [
"Computes",
"the",
"intersection",
"of",
"all",
"the",
"passed",
"-",
"in",
"arrays",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1207-L1225 |
46,113 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | last | function last(array, n, guard) {
if (array) {
var length = array.length;
return (n == undefined || guard) ? array[length - 1] : slice.call(array, -n || length);
}
} | javascript | function last(array, n, guard) {
if (array) {
var length = array.length;
return (n == undefined || guard) ? array[length - 1] : slice.call(array, -n || length);
}
} | [
"function",
"last",
"(",
"array",
",",
"n",
",",
"guard",
")",
"{",
"if",
"(",
"array",
")",
"{",
"var",
"length",
"=",
"array",
".",
"length",
";",
"return",
"(",
"n",
"==",
"undefined",
"||",
"guard",
")",
"?",
"array",
"[",
"length",
"-",
"1",... | Gets the last value of the `array`. Pass `n` to return the lasy `n` values
of the `array`.
@static
@memberOf _
@category Arrays
@param {Array} array The array to query.
@param {Number} [n] The number of elements to return.
@param {Object} [guard] Internally used to allow this method to work with
others like `_.map` wi... | [
"Gets",
"the",
"last",
"value",
"of",
"the",
"array",
".",
"Pass",
"n",
"to",
"return",
"the",
"lasy",
"n",
"values",
"of",
"the",
"array",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1245-L1250 |
46,114 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | union | function union() {
var index = -1,
result = [],
flattened = concat.apply(result, arguments),
length = flattened.length;
while (++index < length) {
if (indexOf(result, flattened[index]) < 0) {
result.push(flattened[index]);
}
}
return result;
} | javascript | function union() {
var index = -1,
result = [],
flattened = concat.apply(result, arguments),
length = flattened.length;
while (++index < length) {
if (indexOf(result, flattened[index]) < 0) {
result.push(flattened[index]);
}
}
return result;
} | [
"function",
"union",
"(",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"result",
"=",
"[",
"]",
",",
"flattened",
"=",
"concat",
".",
"apply",
"(",
"result",
",",
"arguments",
")",
",",
"length",
"=",
"flattened",
".",
"length",
";",
"while",
"(",... | Computes the union of the passed-in arrays.
@static
@memberOf _
@category Arrays
@param {Array} [array1, array2, ...] Arrays to process.
@returns {Array} Returns a new array of unique values, in order, that are
present in one or more of the arrays.
@example
_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
// => [1, 2, 3,... | [
"Computes",
"the",
"union",
"of",
"the",
"passed",
"-",
"in",
"arrays",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1635-L1647 |
46,115 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | bind | function bind(func, thisArg) {
var methodName,
isFunc = toString.call(func) == funcClass;
// juggle arguments
if (!isFunc) {
methodName = thisArg;
thisArg = func;
}
// use if `Function#bind` is faster
else if (nativeBind) {
return nativeBind.call.apply(nativeBind, argu... | javascript | function bind(func, thisArg) {
var methodName,
isFunc = toString.call(func) == funcClass;
// juggle arguments
if (!isFunc) {
methodName = thisArg;
thisArg = func;
}
// use if `Function#bind` is faster
else if (nativeBind) {
return nativeBind.call.apply(nativeBind, argu... | [
"function",
"bind",
"(",
"func",
",",
"thisArg",
")",
"{",
"var",
"methodName",
",",
"isFunc",
"=",
"toString",
".",
"call",
"(",
"func",
")",
"==",
"funcClass",
";",
"// juggle arguments",
"if",
"(",
"!",
"isFunc",
")",
"{",
"methodName",
"=",
"thisArg"... | Creates a new function that, when called, invokes `func` with the `this`
binding of `thisArg` and prepends any additional `bind` arguments to those
passed to the bound function. Lazy defined methods may be bound by passing
the object they are bound to as `func` and the method name as `thisArg`.
@static
@memberOf _
@ca... | [
"Creates",
"a",
"new",
"function",
"that",
"when",
"called",
"invokes",
"func",
"with",
"the",
"this",
"binding",
"of",
"thisArg",
"and",
"prepends",
"any",
"additional",
"bind",
"arguments",
"to",
"those",
"passed",
"to",
"the",
"bound",
"function",
".",
"L... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1851-L1897 |
46,116 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | bindAll | function bindAll(object) {
var funcs = arguments,
index = 1;
if (funcs.length == 1) {
index = 0;
funcs = functions(object);
}
for (var length = funcs.length; index < length; index++) {
object[funcs[index]] = bind(object[funcs[index]], object);
}
return object;
} | javascript | function bindAll(object) {
var funcs = arguments,
index = 1;
if (funcs.length == 1) {
index = 0;
funcs = functions(object);
}
for (var length = funcs.length; index < length; index++) {
object[funcs[index]] = bind(object[funcs[index]], object);
}
return object;
} | [
"function",
"bindAll",
"(",
"object",
")",
"{",
"var",
"funcs",
"=",
"arguments",
",",
"index",
"=",
"1",
";",
"if",
"(",
"funcs",
".",
"length",
"==",
"1",
")",
"{",
"index",
"=",
"0",
";",
"funcs",
"=",
"functions",
"(",
"object",
")",
";",
"}"... | Binds methods on `object` to `object`, overwriting the existing method.
If no method names are provided, all the function properties of `object`
will be bound.
@static
@memberOf _
@category Functions
@param {Object} object The object to bind and assign the bound methods to.
@param {String} [methodName1, methodName2, .... | [
"Binds",
"methods",
"on",
"object",
"to",
"object",
"overwriting",
"the",
"existing",
"method",
".",
"If",
"no",
"method",
"names",
"are",
"provided",
"all",
"the",
"function",
"properties",
"of",
"object",
"will",
"be",
"bound",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1922-L1934 |
46,117 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | debounce | function debounce(func, wait, immediate) {
var args,
result,
thisArg,
timeoutId;
function delayed() {
timeoutId = undefined;
if (!immediate) {
func.apply(thisArg, args);
}
}
return function() {
var isImmediate = immediate && !timeoutId;
arg... | javascript | function debounce(func, wait, immediate) {
var args,
result,
thisArg,
timeoutId;
function delayed() {
timeoutId = undefined;
if (!immediate) {
func.apply(thisArg, args);
}
}
return function() {
var isImmediate = immediate && !timeoutId;
arg... | [
"function",
"debounce",
"(",
"func",
",",
"wait",
",",
"immediate",
")",
"{",
"var",
"args",
",",
"result",
",",
"thisArg",
",",
"timeoutId",
";",
"function",
"delayed",
"(",
")",
"{",
"timeoutId",
"=",
"undefined",
";",
"if",
"(",
"!",
"immediate",
")... | Creates a new function that will delay the execution of `func` until after
`wait` milliseconds have elapsed since the last time it was invoked. Pass
`true` for `immediate` to cause debounce to invoke `func` on the leading,
instead of the trailing, edge of the `wait` timeout. Subsequent calls to
the debounced function w... | [
"Creates",
"a",
"new",
"function",
"that",
"will",
"delay",
"the",
"execution",
"of",
"func",
"until",
"after",
"wait",
"milliseconds",
"have",
"elapsed",
"since",
"the",
"last",
"time",
"it",
"was",
"invoked",
".",
"Pass",
"true",
"for",
"immediate",
"to",
... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L1987-L2013 |
46,118 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | memoize | function memoize(func, resolver) {
var cache = {};
return function() {
var prop = resolver ? resolver.apply(this, arguments) : arguments[0];
return hasOwnProperty.call(cache, prop)
? cache[prop]
: (cache[prop] = func.apply(this, arguments));
};
} | javascript | function memoize(func, resolver) {
var cache = {};
return function() {
var prop = resolver ? resolver.apply(this, arguments) : arguments[0];
return hasOwnProperty.call(cache, prop)
? cache[prop]
: (cache[prop] = func.apply(this, arguments));
};
} | [
"function",
"memoize",
"(",
"func",
",",
"resolver",
")",
"{",
"var",
"cache",
"=",
"{",
"}",
";",
"return",
"function",
"(",
")",
"{",
"var",
"prop",
"=",
"resolver",
"?",
"resolver",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
":",
"arguments... | Creates a new function that memoizes the result of `func`. If `resolver` is
passed, it will be used to determine the cache key for storing the result
based on the arguments passed to the memoized function. By default, the first
argument passed to the memoized function is used as the cache key.
@static
@memberOf _
@cat... | [
"Creates",
"a",
"new",
"function",
"that",
"memoizes",
"the",
"result",
"of",
"func",
".",
"If",
"resolver",
"is",
"passed",
"it",
"will",
"be",
"used",
"to",
"determine",
"the",
"cache",
"key",
"for",
"storing",
"the",
"result",
"based",
"on",
"the",
"a... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2075-L2083 |
46,119 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | once | function once(func) {
var result,
ran = false;
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
return result;
};
} | javascript | function once(func) {
var result,
ran = false;
return function() {
if (ran) {
return result;
}
ran = true;
result = func.apply(this, arguments);
return result;
};
} | [
"function",
"once",
"(",
"func",
")",
"{",
"var",
"result",
",",
"ran",
"=",
"false",
";",
"return",
"function",
"(",
")",
"{",
"if",
"(",
"ran",
")",
"{",
"return",
"result",
";",
"}",
"ran",
"=",
"true",
";",
"result",
"=",
"func",
".",
"apply"... | Creates a new function that is restricted to one execution. Repeat calls to
the function will return the value of the first call.
@static
@memberOf _
@category Functions
@param {Function} func The function to restrict.
@returns {Function} Returns the new restricted function.
@example
var initialize = _.once(createApp... | [
"Creates",
"a",
"new",
"function",
"that",
"is",
"restricted",
"to",
"one",
"execution",
".",
"Repeat",
"calls",
"to",
"the",
"function",
"will",
"return",
"the",
"value",
"of",
"the",
"first",
"call",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2101-L2113 |
46,120 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | throttle | function throttle(func, wait) {
var args,
result,
thisArg,
timeoutId,
lastCalled = 0;
function trailingCall() {
lastCalled = new Date;
timeoutId = undefined;
func.apply(thisArg, args);
}
return function() {
var now = new Date,
remain = ... | javascript | function throttle(func, wait) {
var args,
result,
thisArg,
timeoutId,
lastCalled = 0;
function trailingCall() {
lastCalled = new Date;
timeoutId = undefined;
func.apply(thisArg, args);
}
return function() {
var now = new Date,
remain = ... | [
"function",
"throttle",
"(",
"func",
",",
"wait",
")",
"{",
"var",
"args",
",",
"result",
",",
"thisArg",
",",
"timeoutId",
",",
"lastCalled",
"=",
"0",
";",
"function",
"trailingCall",
"(",
")",
"{",
"lastCalled",
"=",
"new",
"Date",
";",
"timeoutId",
... | Creates a new function that, when executed, will only call the `func`
function at most once per every `wait` milliseconds. If the throttled
function is invoked more than once during the `wait` timeout, `func` will
also be called on the trailing edge of the timeout. Subsequent calls to the
throttled function will return... | [
"Creates",
"a",
"new",
"function",
"that",
"when",
"executed",
"will",
"only",
"call",
"the",
"func",
"function",
"at",
"most",
"once",
"per",
"every",
"wait",
"milliseconds",
".",
"If",
"the",
"throttled",
"function",
"is",
"invoked",
"more",
"than",
"once"... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2170-L2199 |
46,121 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | wrap | function wrap(func, wrapper) {
return function() {
var args = [func];
if (arguments.length) {
push.apply(args, arguments);
}
return wrapper.apply(this, args);
};
} | javascript | function wrap(func, wrapper) {
return function() {
var args = [func];
if (arguments.length) {
push.apply(args, arguments);
}
return wrapper.apply(this, args);
};
} | [
"function",
"wrap",
"(",
"func",
",",
"wrapper",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"func",
"]",
";",
"if",
"(",
"arguments",
".",
"length",
")",
"{",
"push",
".",
"apply",
"(",
"args",
",",
"arguments",
")",
... | Create a new function that passes the `func` function to the `wrapper`
function as its first argument. Additional arguments are appended to those
passed to the `wrapper` function.
@static
@memberOf _
@category Functions
@param {Function} func The function to wrap.
@param {Function} wrapper The wrapper function.
@param... | [
"Create",
"a",
"new",
"function",
"that",
"passes",
"the",
"func",
"function",
"to",
"the",
"wrapper",
"function",
"as",
"its",
"first",
"argument",
".",
"Additional",
"arguments",
"are",
"appended",
"to",
"those",
"passed",
"to",
"the",
"wrapper",
"function",... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2222-L2230 |
46,122 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | pick | function pick(object) {
var prop,
index = 0,
props = concat.apply(ArrayProto, arguments),
length = props.length,
result = {};
// start `index` at `1` to skip `object`
while (++index < length) {
prop = props[index];
if (prop in object) {
result[prop] = obj... | javascript | function pick(object) {
var prop,
index = 0,
props = concat.apply(ArrayProto, arguments),
length = props.length,
result = {};
// start `index` at `1` to skip `object`
while (++index < length) {
prop = props[index];
if (prop in object) {
result[prop] = obj... | [
"function",
"pick",
"(",
"object",
")",
"{",
"var",
"prop",
",",
"index",
"=",
"0",
",",
"props",
"=",
"concat",
".",
"apply",
"(",
"ArrayProto",
",",
"arguments",
")",
",",
"length",
"=",
"props",
".",
"length",
",",
"result",
"=",
"{",
"}",
";",
... | Creates an object composed of the specified properties. Property names may
be specified as individual arguments or as arrays of property names.
@static
@memberOf _
@category Objects
@param {Object} object The object to pluck.
@param {Object} [prop1, prop2, ...] The properties to pick.
@returns {Object} Returns an obje... | [
"Creates",
"an",
"object",
"composed",
"of",
"the",
"specified",
"properties",
".",
"Property",
"names",
"may",
"be",
"specified",
"as",
"individual",
"arguments",
"or",
"as",
"arrays",
"of",
"property",
"names",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2895-L2910 |
46,123 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | size | function size(value) {
var className = toString.call(value);
return className == arrayClass || className == stringClass
? value.length
: keys(value).length;
} | javascript | function size(value) {
var className = toString.call(value);
return className == arrayClass || className == stringClass
? value.length
: keys(value).length;
} | [
"function",
"size",
"(",
"value",
")",
"{",
"var",
"className",
"=",
"toString",
".",
"call",
"(",
"value",
")",
";",
"return",
"className",
"==",
"arrayClass",
"||",
"className",
"==",
"stringClass",
"?",
"value",
".",
"length",
":",
"keys",
"(",
"value... | Gets the size of `value` by returning `value.length` if `value` is a string
or array, or the number of own enumerable properties if `value` is an object.
@deprecated
@static
@memberOf _
@category Objects
@param {Array|Object|String} value The value to inspect.
@returns {Number} Returns `value.length` if `value` is a s... | [
"Gets",
"the",
"size",
"of",
"value",
"by",
"returning",
"value",
".",
"length",
"if",
"value",
"is",
"a",
"string",
"or",
"array",
"or",
"the",
"number",
"of",
"own",
"enumerable",
"properties",
"if",
"value",
"is",
"an",
"object",
"."
] | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L2934-L2939 |
46,124 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | result | function result(object, property) {
// based on Backbone's private `getValue` function
// https://github.com/documentcloud/backbone/blob/0.9.9/backbone.js#L1419-1424
if (!object) {
return null;
}
var value = object[property];
return toString.call(value) == funcClass ? object[property]() : ... | javascript | function result(object, property) {
// based on Backbone's private `getValue` function
// https://github.com/documentcloud/backbone/blob/0.9.9/backbone.js#L1419-1424
if (!object) {
return null;
}
var value = object[property];
return toString.call(value) == funcClass ? object[property]() : ... | [
"function",
"result",
"(",
"object",
",",
"property",
")",
"{",
"// based on Backbone's private `getValue` function",
"// https://github.com/documentcloud/backbone/blob/0.9.9/backbone.js#L1419-1424",
"if",
"(",
"!",
"object",
")",
"{",
"return",
"null",
";",
"}",
"var",
"va... | Resolves the value of `property` on `object`. If `property` is a function
it will be invoked and its result returned, else the property value is
returned. If `object` is falsey, then `null` is returned.
@deprecated
@static
@memberOf _
@category Utilities
@param {Object} object The object to inspect.
@param {String} pr... | [
"Resolves",
"the",
"value",
"of",
"property",
"on",
"object",
".",
"If",
"property",
"is",
"a",
"function",
"it",
"will",
"be",
"invoked",
"and",
"its",
"result",
"returned",
"else",
"the",
"property",
"value",
"is",
"returned",
".",
"If",
"object",
"is",
... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L3084-L3092 |
46,125 | kmalakoff/backbone-modelref | vendor/optional/lodash-0.3.2.js | template | function template(text, data, options) {
options || (options = {});
var result,
defaults = lodash.templateSettings,
escapeDelimiter = options.escape,
evaluateDelimiter = options.evaluate,
interpolateDelimiter = options.interpolate,
variable = options.variable;
// us... | javascript | function template(text, data, options) {
options || (options = {});
var result,
defaults = lodash.templateSettings,
escapeDelimiter = options.escape,
evaluateDelimiter = options.evaluate,
interpolateDelimiter = options.interpolate,
variable = options.variable;
// us... | [
"function",
"template",
"(",
"text",
",",
"data",
",",
"options",
")",
"{",
"options",
"||",
"(",
"options",
"=",
"{",
"}",
")",
";",
"var",
"result",
",",
"defaults",
"=",
"lodash",
".",
"templateSettings",
",",
"escapeDelimiter",
"=",
"options",
".",
... | A micro-templating method, similar to John Resig's implementation.
Lo-Dash templating handles arbitrary delimiters, preserves whitespace, and
correctly escapes quotes within interpolated code.
@static
@memberOf _
@category Utilities
@param {String} text The template text.
@param {Obect} data The data object used to po... | [
"A",
"micro",
"-",
"templating",
"method",
"similar",
"to",
"John",
"Resig",
"s",
"implementation",
".",
"Lo",
"-",
"Dash",
"templating",
"handles",
"arbitrary",
"delimiters",
"preserves",
"whitespace",
"and",
"correctly",
"escapes",
"quotes",
"within",
"interpola... | efdd402c676554991ff1d4cdc10818fca8f87187 | https://github.com/kmalakoff/backbone-modelref/blob/efdd402c676554991ff1d4cdc10818fca8f87187/vendor/optional/lodash-0.3.2.js#L3145-L3214 |
46,126 | Mithgol/FGHI-URL | index.js | FidonetURL | function FidonetURL(initialString){
if(!( this instanceof FidonetURL )){
return new FidonetURL(initialString);
}
parseFundamentalSections.call(this, initialString);
parseOptionalPart.call(this);
parseRequiredPart.call(this);
} | javascript | function FidonetURL(initialString){
if(!( this instanceof FidonetURL )){
return new FidonetURL(initialString);
}
parseFundamentalSections.call(this, initialString);
parseOptionalPart.call(this);
parseRequiredPart.call(this);
} | [
"function",
"FidonetURL",
"(",
"initialString",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"FidonetURL",
")",
")",
"{",
"return",
"new",
"FidonetURL",
"(",
"initialString",
")",
";",
"}",
"parseFundamentalSections",
".",
"call",
"(",
"this",
",",
... | The FGHI URL object's constructor takes a string | [
"The",
"FGHI",
"URL",
"object",
"s",
"constructor",
"takes",
"a",
"string"
] | 8a4d2dbb4efb5ed26c0a3e25170746b90932ccae | https://github.com/Mithgol/FGHI-URL/blob/8a4d2dbb4efb5ed26c0a3e25170746b90932ccae/index.js#L333-L341 |
46,127 | glenjamin/checkers | mocha.js | checking | function checking(desc, args, body, n, options) {
if (typeof n === 'undefined') {
n = 1000;
options = {};
}
if (typeof options === 'undefined' && typeof n !== 'number') {
options = n;
n = 1000;
}
it(desc, function() {
checkers.forAll(args, body).check(n, optio... | javascript | function checking(desc, args, body, n, options) {
if (typeof n === 'undefined') {
n = 1000;
options = {};
}
if (typeof options === 'undefined' && typeof n !== 'number') {
options = n;
n = 1000;
}
it(desc, function() {
checkers.forAll(args, body).check(n, optio... | [
"function",
"checking",
"(",
"desc",
",",
"args",
",",
"body",
",",
"n",
",",
"options",
")",
"{",
"if",
"(",
"typeof",
"n",
"===",
"'undefined'",
")",
"{",
"n",
"=",
"1000",
";",
"options",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"typeof",
"options"... | Generate a mocha example
@param {string} desc The example description
@param {array} args List of generators to pass to body
@param {function} body Function to check, should return true or false
@param {number} n The number of iterations to check (optional)
@param {object} options Additiona... | [
"Generate",
"a",
"mocha",
"example"
] | fdbe549ae138564343f139ae35c0602d83674fd0 | https://github.com/glenjamin/checkers/blob/fdbe549ae138564343f139ae35c0602d83674fd0/mocha.js#L19-L31 |
46,128 | THEjoezack/BoxPusher | public/rot.js/rot.js | function(str, maxWidth) {
var result = [];
/* first tokenization pass - split texts and color formatting commands */
var offset = 0;
str.replace(this.RE_COLORS, function(match, type, name, index) {
/* string before */
var part = str.substring(offset, index);
if (part.length) {
result.push({
t... | javascript | function(str, maxWidth) {
var result = [];
/* first tokenization pass - split texts and color formatting commands */
var offset = 0;
str.replace(this.RE_COLORS, function(match, type, name, index) {
/* string before */
var part = str.substring(offset, index);
if (part.length) {
result.push({
t... | [
"function",
"(",
"str",
",",
"maxWidth",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"/* first tokenization pass - split texts and color formatting commands */",
"var",
"offset",
"=",
"0",
";",
"str",
".",
"replace",
"(",
"this",
".",
"RE_COLORS",
",",
"funct... | Convert string to a series of a formatting commands | [
"Convert",
"string",
"to",
"a",
"series",
"of",
"a",
"formatting",
"commands"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/rot.js/rot.js#L401-L436 | |
46,129 | THEjoezack/BoxPusher | public/rot.js/rot.js | function(color1, color2) {
var result = color1.slice();
for (var i=0;i<3;i++) {
for (var j=1;j<arguments.length;j++) {
result[i] += arguments[j][i];
}
}
return result;
} | javascript | function(color1, color2) {
var result = color1.slice();
for (var i=0;i<3;i++) {
for (var j=1;j<arguments.length;j++) {
result[i] += arguments[j][i];
}
}
return result;
} | [
"function",
"(",
"color1",
",",
"color2",
")",
"{",
"var",
"result",
"=",
"color1",
".",
"slice",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"1",
";",
"j",
"... | Add two or more colors
@param {number[]} color1
@param {number[]} color2
@returns {number[]} | [
"Add",
"two",
"or",
"more",
"colors"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/rot.js/rot.js#L4483-L4491 | |
46,130 | THEjoezack/BoxPusher | public/rot.js/rot.js | function(color1, color2) {
for (var i=0;i<3;i++) {
for (var j=1;j<arguments.length;j++) {
color1[i] += arguments[j][i];
}
}
return color1;
} | javascript | function(color1, color2) {
for (var i=0;i<3;i++) {
for (var j=1;j<arguments.length;j++) {
color1[i] += arguments[j][i];
}
}
return color1;
} | [
"function",
"(",
"color1",
",",
"color2",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"var",
"j",
"=",
"1",
";",
"j",
"<",
"arguments",
".",
"length",
";",
"j",
"++",
")",
"{",
"co... | Add two or more colors, MODIFIES FIRST ARGUMENT
@param {number[]} color1
@param {number[]} color2
@returns {number[]} | [
"Add",
"two",
"or",
"more",
"colors",
"MODIFIES",
"FIRST",
"ARGUMENT"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/rot.js/rot.js#L4499-L4506 | |
46,131 | THEjoezack/BoxPusher | public/rot.js/rot.js | function(color, diff) {
if (!(diff instanceof Array)) { diff = ROT.RNG.getNormal(0, diff); }
var result = color.slice();
for (var i=0;i<3;i++) {
result[i] += (diff instanceof Array ? Math.round(ROT.RNG.getNormal(0, diff[i])) : diff);
}
return result;
} | javascript | function(color, diff) {
if (!(diff instanceof Array)) { diff = ROT.RNG.getNormal(0, diff); }
var result = color.slice();
for (var i=0;i<3;i++) {
result[i] += (diff instanceof Array ? Math.round(ROT.RNG.getNormal(0, diff[i])) : diff);
}
return result;
} | [
"function",
"(",
"color",
",",
"diff",
")",
"{",
"if",
"(",
"!",
"(",
"diff",
"instanceof",
"Array",
")",
")",
"{",
"diff",
"=",
"ROT",
".",
"RNG",
".",
"getNormal",
"(",
"0",
",",
"diff",
")",
";",
"}",
"var",
"result",
"=",
"color",
".",
"sli... | Create a new random color based on this one
@param {number[]} color
@param {number[]} diff Set of standard deviations
@returns {number[]} | [
"Create",
"a",
"new",
"random",
"color",
"based",
"on",
"this",
"one"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/rot.js/rot.js#L4580-L4587 | |
46,132 | THEjoezack/BoxPusher | public/rot.js/rot.js | function(color) {
var l = color[2];
if (color[1] == 0) {
l = Math.round(l*255);
return [l, l, l];
} else {
function hue2rgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1/6) return p + (q - p) * 6 * t;
if (t < 1/2) return q;
if (t < 2/3) return p + (q - p) * (2/3 - t) * 6... | javascript | function(color) {
var l = color[2];
if (color[1] == 0) {
l = Math.round(l*255);
return [l, l, l];
} else {
function hue2rgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1/6) return p + (q - p) * 6 * t;
if (t < 1/2) return q;
if (t < 2/3) return p + (q - p) * (2/3 - t) * 6... | [
"function",
"(",
"color",
")",
"{",
"var",
"l",
"=",
"color",
"[",
"2",
"]",
";",
"if",
"(",
"color",
"[",
"1",
"]",
"==",
"0",
")",
"{",
"l",
"=",
"Math",
".",
"round",
"(",
"l",
"*",
"255",
")",
";",
"return",
"[",
"l",
",",
"l",
",",
... | Converts an HSL color value to RGB. Expects 0..1 inputs, produces 0..255 outputs.
@param {number[]} color
@returns {number[]} | [
"Converts",
"an",
"HSL",
"color",
"value",
"to",
"RGB",
".",
"Expects",
"0",
"..",
"1",
"inputs",
"produces",
"0",
"..",
"255",
"outputs",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/rot.js/rot.js#L4623-L4647 | |
46,133 | io-monad/misspellings | src/misspellings.js | dict | function dict(options = {}) {
if (options.lowerCase) {
return dictCache[0] || (dictCache[0] = require("../dict/lc-dictionary.json"));
} else {
return dictCache[1] || (dictCache[1] = require("../dict/dictionary.json"));
}
} | javascript | function dict(options = {}) {
if (options.lowerCase) {
return dictCache[0] || (dictCache[0] = require("../dict/lc-dictionary.json"));
} else {
return dictCache[1] || (dictCache[1] = require("../dict/dictionary.json"));
}
} | [
"function",
"dict",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"options",
".",
"lowerCase",
")",
"{",
"return",
"dictCache",
"[",
"0",
"]",
"||",
"(",
"dictCache",
"[",
"0",
"]",
"=",
"require",
"(",
"\"../dict/lc-dictionary.json\"",
")",
")",... | Getter for the dictionary of misspellings.
This getter lazy-loads the dictionary file and caches it internally.
@param {Object} [options] Options.
@param {Boolean} [options.lowerCase=false]
If `true`, returns a dictionary with all keys in lower-case.
@return {Object} Dictionary object.
The key is misspelled word, an... | [
"Getter",
"for",
"the",
"dictionary",
"of",
"misspellings",
"."
] | 9281c7400348f69ba86af0567571d210253e246a | https://github.com/io-monad/misspellings/blob/9281c7400348f69ba86af0567571d210253e246a/src/misspellings.js#L45-L51 |
46,134 | io-monad/misspellings | src/misspellings.js | correctWordsFor | function correctWordsFor(word, options = {}) {
word = String(word || "");
const found = (options.caseSensitive ?
dict()[word] :
dict({ lowerCase: true })[word.toLowerCase()]
);
return found ? found.split(",") : [];
} | javascript | function correctWordsFor(word, options = {}) {
word = String(word || "");
const found = (options.caseSensitive ?
dict()[word] :
dict({ lowerCase: true })[word.toLowerCase()]
);
return found ? found.split(",") : [];
} | [
"function",
"correctWordsFor",
"(",
"word",
",",
"options",
"=",
"{",
"}",
")",
"{",
"word",
"=",
"String",
"(",
"word",
"||",
"\"\"",
")",
";",
"const",
"found",
"=",
"(",
"options",
".",
"caseSensitive",
"?",
"dict",
"(",
")",
"[",
"word",
"]",
"... | Get correct words from misspelling.
It is case-insensitive by default.
Set `caseSensitive` to `true` if you need.
@param {string} word Misspelled word.
@param {Object} options Options.
@param {Boolean} [options.caseSensitive=false]
If `true`, do case-sensitive search.
@return {string[]} An array of correct words.
... | [
"Get",
"correct",
"words",
"from",
"misspelling",
"."
] | 9281c7400348f69ba86af0567571d210253e246a | https://github.com/io-monad/misspellings/blob/9281c7400348f69ba86af0567571d210253e246a/src/misspellings.js#L91-L98 |
46,135 | io-monad/misspellings | src/misspellings.js | correct | function correct(str, options, callback) {
if (typeof options === "function") {
callback = options;
options = {};
}
const {caseSensitive, overrideCases} = options || {};
str = String(str || "");
const dic = dict({ lowerCase: true });
const re = regexp(caseSensitive ? "g" : "ig");
return str.repl... | javascript | function correct(str, options, callback) {
if (typeof options === "function") {
callback = options;
options = {};
}
const {caseSensitive, overrideCases} = options || {};
str = String(str || "");
const dic = dict({ lowerCase: true });
const re = regexp(caseSensitive ? "g" : "ig");
return str.repl... | [
"function",
"correct",
"(",
"str",
",",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"\"function\"",
")",
"{",
"callback",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"const",
"{",
"caseSensitive",
",",
"ove... | Correct all misspellings in a string.
It is case-insensitive by default, but it tries to keep cases
(upper to upper, lower to lower) after misspellings corrected.
You can skip options and call in `correct(str, callback)` form.
@param {string} str A target string.
@param {Object} [options] Options.
@param {Boolean}... | [
"Correct",
"all",
"misspellings",
"in",
"a",
"string",
"."
] | 9281c7400348f69ba86af0567571d210253e246a | https://github.com/io-monad/misspellings/blob/9281c7400348f69ba86af0567571d210253e246a/src/misspellings.js#L120-L150 |
46,136 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/renderer.js | Renderer | function Renderer(game, width, height, tileSize, canvasClassName) {
this.layers = [];
this.game = game;
this.canvas = document.createElement('canvas');
this.ctx = this.canvas.getContext('2d');
this.canvas.className = canvasClassName || 'renderer';
this.buffer = this.canva... | javascript | function Renderer(game, width, height, tileSize, canvasClassName) {
this.layers = [];
this.game = game;
this.canvas = document.createElement('canvas');
this.ctx = this.canvas.getContext('2d');
this.canvas.className = canvasClassName || 'renderer';
this.buffer = this.canva... | [
"function",
"Renderer",
"(",
"game",
",",
"width",
",",
"height",
",",
"tileSize",
",",
"canvasClassName",
")",
"{",
"this",
".",
"layers",
"=",
"[",
"]",
";",
"this",
".",
"game",
"=",
"game",
";",
"this",
".",
"canvas",
"=",
"document",
".",
"creat... | Renders the current game state using html5 canvas.
@class Renderer
@constructor
@param {Game} game - Game instance this obj is attached to.
@param {Number} width - Width of the map view in tiles.
@param {Number} height - Height of the map view in tiles.
@param {Number} tileSize - Width and height of tiles when drawn.
@... | [
"Renders",
"the",
"current",
"game",
"state",
"using",
"html5",
"canvas",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer.js#L14-L25 |
46,137 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/renderer.js | function(x, y, tileData, ctx) {
ctx = ctx || this.bufferCtx;
var originalX = x,
originalY = y;
x -= this.originX;
y -= this.originY;
if(tileData.bgColor){
ctx.fillStyle = tileData.bgColor;
ctx.fillRect(
... | javascript | function(x, y, tileData, ctx) {
ctx = ctx || this.bufferCtx;
var originalX = x,
originalY = y;
x -= this.originX;
y -= this.originY;
if(tileData.bgColor){
ctx.fillStyle = tileData.bgColor;
ctx.fillRect(
... | [
"function",
"(",
"x",
",",
"y",
",",
"tileData",
",",
"ctx",
")",
"{",
"ctx",
"=",
"ctx",
"||",
"this",
".",
"bufferCtx",
";",
"var",
"originalX",
"=",
"x",
",",
"originalY",
"=",
"y",
";",
"x",
"-=",
"this",
".",
"originX",
";",
"y",
"-=",
"th... | Draws a single tile to the map view.
@method drawTileToCanvas
@param {Number} x - Map tile coord on the x axis.
@param {Number} y - Map tile coord on the y axis.
@param {Object} tileData - Object containing tile draw settings.
@param {Object} [tileData.char] - The character to draw.
@param {Object} [tileData.color] - T... | [
"Draws",
"a",
"single",
"tile",
"to",
"the",
"map",
"view",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer.js#L274-L366 | |
46,138 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/renderer.js | function(x, y){
var pos = this.canvas.getBoundingClientRect(),
mx = x - pos.left,
my = y - pos.top;
return this.pixelToTileCoords(mx, my);
} | javascript | function(x, y){
var pos = this.canvas.getBoundingClientRect(),
mx = x - pos.left,
my = y - pos.top;
return this.pixelToTileCoords(mx, my);
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"var",
"pos",
"=",
"this",
".",
"canvas",
".",
"getBoundingClientRect",
"(",
")",
",",
"mx",
"=",
"x",
"-",
"pos",
".",
"left",
",",
"my",
"=",
"y",
"-",
"pos",
".",
"top",
";",
"return",
"this",
".",
... | Converts mouse pixel coords to map tile coords. Mouse pixel coords must be relative to the current window.
@method mouseToTileCoords
@param {Number} x - Mouse pixel x coord.
@param {Number} y - Mouse pixel y coord.
@return {Object|False} {x: 0, y: 0} | [
"Converts",
"mouse",
"pixel",
"coords",
"to",
"map",
"tile",
"coords",
".",
"Mouse",
"pixel",
"coords",
"must",
"be",
"relative",
"to",
"the",
"current",
"window",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer.js#L375-L380 | |
46,139 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/renderer.js | function(x, y){
return {
x: Math.floor(x / this.tileSize) + this.originX,
y: Math.floor(y / this.tileSize) + this.originY
};
} | javascript | function(x, y){
return {
x: Math.floor(x / this.tileSize) + this.originX,
y: Math.floor(y / this.tileSize) + this.originY
};
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"return",
"{",
"x",
":",
"Math",
".",
"floor",
"(",
"x",
"/",
"this",
".",
"tileSize",
")",
"+",
"this",
".",
"originX",
",",
"y",
":",
"Math",
".",
"floor",
"(",
"y",
"/",
"this",
".",
"tileSize",
")... | Converts map view pixel coords to map tile coords. Map view pixel coords are relative to the top left of the canvas element.
@method pixelToTileCoords
@param {Number} x - Map view pixel x coord.
@param {Number} y - Map view pixel y coord.
@return {Object|False} {x: 0, y: 0} | [
"Converts",
"map",
"view",
"pixel",
"coords",
"to",
"map",
"tile",
"coords",
".",
"Map",
"view",
"pixel",
"coords",
"are",
"relative",
"to",
"the",
"top",
"left",
"of",
"the",
"canvas",
"element",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer.js#L389-L394 | |
46,140 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/renderer.js | function(color, ctx){
ctx = ctx || this.bufferCtx;
ctx.fillStyle = color || this.bgColor;
ctx.fillRect(
0,
0,
this.canvas.width,
this.canvas.height
);
} | javascript | function(color, ctx){
ctx = ctx || this.bufferCtx;
ctx.fillStyle = color || this.bgColor;
ctx.fillRect(
0,
0,
this.canvas.width,
this.canvas.height
);
} | [
"function",
"(",
"color",
",",
"ctx",
")",
"{",
"ctx",
"=",
"ctx",
"||",
"this",
".",
"bufferCtx",
";",
"ctx",
".",
"fillStyle",
"=",
"color",
"||",
"this",
".",
"bgColor",
";",
"ctx",
".",
"fillRect",
"(",
"0",
",",
"0",
",",
"this",
".",
"canva... | Fills the canvas with a given color.
@method fillBg
@param {String} [color=this.bgColor]
@param {CanvasRenderingContext2D} [ctx=this.bufferCtx] | [
"Fills",
"the",
"canvas",
"with",
"a",
"given",
"color",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer.js#L414-L423 | |
46,141 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(width, height) {
this.width = width;
this.height = height;
for (var i = 0; i < this.width; i++) {
if(!this.data){
this.data = [];
}
if(this.data[i] === void 0){
this.data[i] = [];
... | javascript | function(width, height) {
this.width = width;
this.height = height;
for (var i = 0; i < this.width; i++) {
if(!this.data){
this.data = [];
}
if(this.data[i] === void 0){
this.data[i] = [];
... | [
"function",
"(",
"width",
",",
"height",
")",
"{",
"this",
".",
"width",
"=",
"width",
";",
"this",
".",
"height",
"=",
"height",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"width",
";",
"i",
"++",
")",
"{",
"if",
"(",... | Updates the size of this Array2d without destroying data.
@method setSize
@param {Number} width - The new width.
@param {Number} height - The new height. | [
"Updates",
"the",
"size",
"of",
"this",
"Array2d",
"without",
"destroying",
"data",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L61-L73 | |
46,142 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(x, y, settings) {
settings = settings || {};
var filter = settings.filter !== void 0 ? settings.filter : false,
withCoords = settings.withCoords !== void 0 ? settings.withCoords : false,
withDiagonals = settings.w... | javascript | function(x, y, settings) {
settings = settings || {};
var filter = settings.filter !== void 0 ? settings.filter : false,
withCoords = settings.withCoords !== void 0 ? settings.withCoords : false,
withDiagonals = settings.w... | [
"function",
"(",
"x",
",",
"y",
",",
"settings",
")",
"{",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"var",
"filter",
"=",
"settings",
".",
"filter",
"!==",
"void",
"0",
"?",
"settings",
".",
"filter",
":",
"false",
",",
"withCoords",
"=",
... | Retrieves an array of values of adjacent coords.
@method getAdjacent
@param {Number} x - Map tile x coord to get adjacent values of.
@param {Number} y - Map tile y coord to get adjacent values of.
@param {Object} [settings] -
@param {Bool} [settings.withCoords=false] - If true the returned array will include the coords... | [
"Retrieves",
"an",
"array",
"of",
"values",
"of",
"adjacent",
"coords",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L124-L192 | |
46,143 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(x, y, settings) {
settings = settings || {};
var radius = settings.radius || 1,
filter = settings.filter || false,
withCoords = settings.withCoords || false,
includeTarget = settings.incl... | javascript | function(x, y, settings) {
settings = settings || {};
var radius = settings.radius || 1,
filter = settings.filter || false,
withCoords = settings.withCoords || false,
includeTarget = settings.incl... | [
"function",
"(",
"x",
",",
"y",
",",
"settings",
")",
"{",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"var",
"radius",
"=",
"settings",
".",
"radius",
"||",
"1",
",",
"filter",
"=",
"settings",
".",
"filter",
"||",
"false",
",",
"withCoords",
... | Retrieves an array of values of coords within a given radius.
@method getWithinSquareRadius
@param {Number} x - Map tile x coord at the center of the radius.
@param {Number} y - Map tile x coord at the center of the radius.
@param {Object} [settings] -
@param {Number} [settings.radius=1] - Radius of the area to retriev... | [
"Retrieves",
"an",
"array",
"of",
"values",
"of",
"coords",
"within",
"a",
"given",
"radius",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L206-L256 | |
46,144 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(x0, y0, x1, y1, condition, withCoords) {
withCoords = withCoords || false;
condition = condition || false;
var output = [],
dx = Math.abs(x1 - x0),
dy = Math.abs(y1 - y0),
sx = (x0 < x1) ? 1 : -1,
sy = (y0 < y1)... | javascript | function(x0, y0, x1, y1, condition, withCoords) {
withCoords = withCoords || false;
condition = condition || false;
var output = [],
dx = Math.abs(x1 - x0),
dy = Math.abs(y1 - y0),
sx = (x0 < x1) ? 1 : -1,
sy = (y0 < y1)... | [
"function",
"(",
"x0",
",",
"y0",
",",
"x1",
",",
"y1",
",",
"condition",
",",
"withCoords",
")",
"{",
"withCoords",
"=",
"withCoords",
"||",
"false",
";",
"condition",
"=",
"condition",
"||",
"false",
";",
"var",
"output",
"=",
"[",
"]",
",",
"dx",
... | Retrieves an array of values of coords along a line starting at point 0 and crossing point 1 until it hits the edge of the 2d array or a coord value returning true when passed to the condtion function.
@method getLineThrough
@param {Number} x0 - Map tile x coord of start.
@param {Number} y0 - Map tile y coord of start.... | [
"Retrieves",
"an",
"array",
"of",
"values",
"of",
"coords",
"along",
"a",
"line",
"starting",
"at",
"point",
"0",
"and",
"crossing",
"point",
"1",
"until",
"it",
"hits",
"the",
"edge",
"of",
"the",
"2d",
"array",
"or",
"a",
"coord",
"value",
"returning",... | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L269-L311 | |
46,145 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(startX, startY, settings) {
settings = settings || {};
var maxRadius = settings.maxRadius || 1,
filter = settings.filter || false,
withCoords = settings.withCoords || false;
var currentDistance = 1,
result... | javascript | function(startX, startY, settings) {
settings = settings || {};
var maxRadius = settings.maxRadius || 1,
filter = settings.filter || false,
withCoords = settings.withCoords || false;
var currentDistance = 1,
result... | [
"function",
"(",
"startX",
",",
"startY",
",",
"settings",
")",
"{",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"var",
"maxRadius",
"=",
"settings",
".",
"maxRadius",
"||",
"1",
",",
"filter",
"=",
"settings",
".",
"filter",
"||",
"false",
",",
... | Retrieves an array of the nearest coord values meeting checked requirements. If multiple coord values were matched at the same nearest distance, the returned array will contain multiple matched coord values.
Used for projecting path of ranged attacks, pushed entities, ect.
@method getNearest
@param {Number} tileX - Map... | [
"Retrieves",
"an",
"array",
"of",
"the",
"nearest",
"coord",
"values",
"meeting",
"checked",
"requirements",
".",
"If",
"multiple",
"coord",
"values",
"were",
"matched",
"at",
"the",
"same",
"nearest",
"distance",
"the",
"returned",
"array",
"will",
"contain",
... | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L325-L406 | |
46,146 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(filter, withCoords){
withCoords = withCoords || false;
var output = [];
for (var x = 0; x < this.width; x++) {
for (var y = 0; y < this.height; y++) {
var val = this.get(x, y);
if(filter(val, x, y)){
... | javascript | function(filter, withCoords){
withCoords = withCoords || false;
var output = [];
for (var x = 0; x < this.width; x++) {
for (var y = 0; y < this.height; y++) {
var val = this.get(x, y);
if(filter(val, x, y)){
... | [
"function",
"(",
"filter",
",",
"withCoords",
")",
"{",
"withCoords",
"=",
"withCoords",
"||",
"false",
";",
"var",
"output",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"x",
"=",
"0",
";",
"x",
"<",
"this",
".",
"width",
";",
"x",
"++",
")",
"{",
"... | Retrieves an array of the filtered values.
@method filter
@param {Function} filter - A function to determine if a value is to be included in results (returns true). (function(value, x, y){ return true;})
@param {Bool} [withCoords=false] - If true the returned array will include the coords of each value ([{x: 0, y: 0, v... | [
"Retrieves",
"an",
"array",
"of",
"the",
"filtered",
"values",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L415-L435 | |
46,147 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(){
var newArray = new Array2d(this.width, this.height);
for(var x = this.width - 1; x >= 0; x--){
for(var y = this.height - 1; y >= 0; y--){
var val = this.get(x, y);
if(val !== void 0){
newArray.set(x, y, v... | javascript | function(){
var newArray = new Array2d(this.width, this.height);
for(var x = this.width - 1; x >= 0; x--){
for(var y = this.height - 1; y >= 0; y--){
var val = this.get(x, y);
if(val !== void 0){
newArray.set(x, y, v... | [
"function",
"(",
")",
"{",
"var",
"newArray",
"=",
"new",
"Array2d",
"(",
"this",
".",
"width",
",",
"this",
".",
"height",
")",
";",
"for",
"(",
"var",
"x",
"=",
"this",
".",
"width",
"-",
"1",
";",
"x",
">=",
"0",
";",
"x",
"--",
")",
"{",
... | Creates a copy of this Array2d. Shallow copies values.
@method copy
@return {Array2d} | [
"Creates",
"a",
"copy",
"of",
"this",
"Array2d",
".",
"Shallow",
"copies",
"values",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L442-L453 | |
46,148 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/array-2d.js | function(func, context){
for(var x = this.width - 1; x >= 0; x--){
for(var y = this.height - 1; y >= 0; y--){
var val = this.get(x, y);
if(context){
func.call(context, val, x, y);
} else {
... | javascript | function(func, context){
for(var x = this.width - 1; x >= 0; x--){
for(var y = this.height - 1; y >= 0; y--){
var val = this.get(x, y);
if(context){
func.call(context, val, x, y);
} else {
... | [
"function",
"(",
"func",
",",
"context",
")",
"{",
"for",
"(",
"var",
"x",
"=",
"this",
".",
"width",
"-",
"1",
";",
"x",
">=",
"0",
";",
"x",
"--",
")",
"{",
"for",
"(",
"var",
"y",
"=",
"this",
".",
"height",
"-",
"1",
";",
"y",
">=",
"... | Loops over each coord value.
@method each
@param {Function} func - A function to call on each coord value. (function(value, x, y){})
@param {Object} [context] - Context to call the function with (func.call(context, val, x, y))
@return {Array2d} | [
"Loops",
"over",
"each",
"coord",
"value",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/array-2d.js#L462-L473 | |
46,149 | SilentCicero/solidity-to-abi | src/index.js | buildInputsArray | function buildInputsArray(rawInputsString) {
let returnArray = []; // eslint-disable-line
const rawMethodInputs = rawInputsString.split(',');
// no inputs
if (typeof rawMethodInputs === 'undefined' || rawMethodInputs.length === 0) {
return [];
}
rawMethodInputs.forEach((rawMethodInput) => {
const ... | javascript | function buildInputsArray(rawInputsString) {
let returnArray = []; // eslint-disable-line
const rawMethodInputs = rawInputsString.split(',');
// no inputs
if (typeof rawMethodInputs === 'undefined' || rawMethodInputs.length === 0) {
return [];
}
rawMethodInputs.forEach((rawMethodInput) => {
const ... | [
"function",
"buildInputsArray",
"(",
"rawInputsString",
")",
"{",
"let",
"returnArray",
"=",
"[",
"]",
";",
"// eslint-disable-line",
"const",
"rawMethodInputs",
"=",
"rawInputsString",
".",
"split",
"(",
"','",
")",
";",
"// no inputs",
"if",
"(",
"typeof",
"ra... | build inputs or outputs array from raw inputs string | [
"build",
"inputs",
"or",
"outputs",
"array",
"from",
"raw",
"inputs",
"string"
] | 2d97d2c53a90f670ced1e010684897d9d46eb9d2 | https://github.com/SilentCicero/solidity-to-abi/blob/2d97d2c53a90f670ced1e010684897d9d46eb9d2/src/index.js#L2-L26 |
46,150 | SilentCicero/solidity-to-abi | src/index.js | solidityToABI | function solidityToABI(methodInterface) {
// count open and clsoed
const methodABIObject = {};
// not a string
if (typeof methodInterface !== 'string') {
throw new Error(`Method interface must be a string, currently ${typeof methodInterface}`);
}
// empty string
if (methodInterface.length === 0) {
... | javascript | function solidityToABI(methodInterface) {
// count open and clsoed
const methodABIObject = {};
// not a string
if (typeof methodInterface !== 'string') {
throw new Error(`Method interface must be a string, currently ${typeof methodInterface}`);
}
// empty string
if (methodInterface.length === 0) {
... | [
"function",
"solidityToABI",
"(",
"methodInterface",
")",
"{",
"// count open and clsoed",
"const",
"methodABIObject",
"=",
"{",
"}",
";",
"// not a string",
"if",
"(",
"typeof",
"methodInterface",
"!==",
"'string'",
")",
"{",
"throw",
"new",
"Error",
"(",
"`",
... | parse a solidity method interface | [
"parse",
"a",
"solidity",
"method",
"interface"
] | 2d97d2c53a90f670ced1e010684897d9d46eb9d2 | https://github.com/SilentCicero/solidity-to-abi/blob/2d97d2c53a90f670ced1e010684897d9d46eb9d2/src/index.js#L29-L91 |
46,151 | paglias/KnockoutApp | build/knockout.app.js | function(obj){
if(ko.isWriteableObservable(obj)) return ko.observable(obj());
if(obj === null || typeof obj !== 'object') return obj;
var temp = obj.constructor();
for (var key in obj) {
temp[key] = Utils.cloneObjKnockout(obj[key]);
}
return temp;
} | javascript | function(obj){
if(ko.isWriteableObservable(obj)) return ko.observable(obj());
if(obj === null || typeof obj !== 'object') return obj;
var temp = obj.constructor();
for (var key in obj) {
temp[key] = Utils.cloneObjKnockout(obj[key]);
}
return temp;
} | [
"function",
"(",
"obj",
")",
"{",
"if",
"(",
"ko",
".",
"isWriteableObservable",
"(",
"obj",
")",
")",
"return",
"ko",
".",
"observable",
"(",
"obj",
"(",
")",
")",
";",
"if",
"(",
"obj",
"===",
"null",
"||",
"typeof",
"obj",
"!==",
"'object'",
")"... | Used to clone an object with Knockout observable properties | [
"Used",
"to",
"clone",
"an",
"object",
"with",
"Knockout",
"observable",
"properties"
] | 7010bc4508c2ec05154c966519325a3f61add3e5 | https://github.com/paglias/KnockoutApp/blob/7010bc4508c2ec05154c966519325a3f61add3e5/build/knockout.app.js#L76-L86 | |
46,152 | paglias/KnockoutApp | build/knockout.app.js | function(_options){
var self = this, //model
options = _options || {},
success = options.success; //custom success function passed in _options
options.success = function(data){
delete data[self.idAttribute];
var defaults = Utils.cloneObjKnockout(self.defaults);
s... | javascript | function(_options){
var self = this, //model
options = _options || {},
success = options.success; //custom success function passed in _options
options.success = function(data){
delete data[self.idAttribute];
var defaults = Utils.cloneObjKnockout(self.defaults);
s... | [
"function",
"(",
"_options",
")",
"{",
"var",
"self",
"=",
"this",
",",
"//model",
"options",
"=",
"_options",
"||",
"{",
"}",
",",
"success",
"=",
"options",
".",
"success",
";",
"//custom success function passed in _options",
"options",
".",
"success",
"=",
... | Fetch the model on the server and replace its attributes with the one fetched Options for the sync method can be passed as an object | [
"Fetch",
"the",
"model",
"on",
"the",
"server",
"and",
"replace",
"its",
"attributes",
"with",
"the",
"one",
"fetched",
"Options",
"for",
"the",
"sync",
"method",
"can",
"be",
"passed",
"as",
"an",
"object"
] | 7010bc4508c2ec05154c966519325a3f61add3e5 | https://github.com/paglias/KnockoutApp/blob/7010bc4508c2ec05154c966519325a3f61add3e5/build/knockout.app.js#L204-L217 | |
46,153 | paglias/KnockoutApp | build/knockout.app.js | function(model_s, create, options){
var toAdd = model_s instanceof Array ? model_s : [model_s],
self = this;
ko.utils.arrayForEach(toAdd, function(attributes){
var model;
if(attributes instanceof Model){
model = attributes;
model.collection = self;
}els... | javascript | function(model_s, create, options){
var toAdd = model_s instanceof Array ? model_s : [model_s],
self = this;
ko.utils.arrayForEach(toAdd, function(attributes){
var model;
if(attributes instanceof Model){
model = attributes;
model.collection = self;
}els... | [
"function",
"(",
"model_s",
",",
"create",
",",
"options",
")",
"{",
"var",
"toAdd",
"=",
"model_s",
"instanceof",
"Array",
"?",
"model_s",
":",
"[",
"model_s",
"]",
",",
"self",
"=",
"this",
";",
"ko",
".",
"utils",
".",
"arrayForEach",
"(",
"toAdd",
... | Add one or more models to collection and optionally create them on the server setting the 'create' parameter to 'true' It will also add a reference to the collection on each model | [
"Add",
"one",
"or",
"more",
"models",
"to",
"collection",
"and",
"optionally",
"create",
"them",
"on",
"the",
"server",
"setting",
"the",
"create",
"parameter",
"to",
"true",
"It",
"will",
"also",
"add",
"a",
"reference",
"to",
"the",
"collection",
"on",
"... | 7010bc4508c2ec05154c966519325a3f61add3e5 | https://github.com/paglias/KnockoutApp/blob/7010bc4508c2ec05154c966519325a3f61add3e5/build/knockout.app.js#L304-L319 | |
46,154 | paglias/KnockoutApp | build/knockout.app.js | function(_options){
var self = this, //collection
options = _options || {},
success = options.success; //custom success function passed in _options
options.success = function(data){
var toAdd = [];
for(var model in data){
toAdd.push(data[model]);
}
... | javascript | function(_options){
var self = this, //collection
options = _options || {},
success = options.success; //custom success function passed in _options
options.success = function(data){
var toAdd = [];
for(var model in data){
toAdd.push(data[model]);
}
... | [
"function",
"(",
"_options",
")",
"{",
"var",
"self",
"=",
"this",
",",
"//collection",
"options",
"=",
"_options",
"||",
"{",
"}",
",",
"success",
"=",
"options",
".",
"success",
";",
"//custom success function passed in _options",
"options",
".",
"success",
... | Fetch models from server and add them to the collection. Options for the sync method can be passed as an object | [
"Fetch",
"models",
"from",
"server",
"and",
"add",
"them",
"to",
"the",
"collection",
".",
"Options",
"for",
"the",
"sync",
"method",
"can",
"be",
"passed",
"as",
"an",
"object"
] | 7010bc4508c2ec05154c966519325a3f61add3e5 | https://github.com/paglias/KnockoutApp/blob/7010bc4508c2ec05154c966519325a3f61add3e5/build/knockout.app.js#L332-L350 | |
46,155 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/tile.js | Tile | function Tile(game, type, x, y) {
this.game = game;
this.x = x;
this.y = y;
this.type = type;
var typeData = Tile.Types[type];
RL.Util.merge(this, typeData);
this.id = tileId++;
if(this.init){
this.init(game, type, x, y);
}
} | javascript | function Tile(game, type, x, y) {
this.game = game;
this.x = x;
this.y = y;
this.type = type;
var typeData = Tile.Types[type];
RL.Util.merge(this, typeData);
this.id = tileId++;
if(this.init){
this.init(game, type, x, y);
}
} | [
"function",
"Tile",
"(",
"game",
",",
"type",
",",
"x",
",",
"y",
")",
"{",
"this",
".",
"game",
"=",
"game",
";",
"this",
".",
"x",
"=",
"x",
";",
"this",
".",
"y",
"=",
"y",
";",
"this",
".",
"type",
"=",
"type",
";",
"var",
"typeData",
"... | Represents a tile in the game map.
@class Tile
@constructor
@uses TileDraw
@param {Object} game - Game instance this obj is attached to.
@param {String} type - Type of tile. When created this object is merged with the value of Tile.Types[type].
@param {Number} x - The map tile coordinate position of this tile on the x ... | [
"Represents",
"a",
"tile",
"in",
"the",
"game",
"map",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/tile.js#L16-L30 |
46,156 | jlmorgan/lodash-transpose | src/transpose.js | baseTranspose | function baseTranspose(matrix) {
return map(head(matrix), function (column, index) {
return map(matrix, function (row) {
return row[index];
});
});
} | javascript | function baseTranspose(matrix) {
return map(head(matrix), function (column, index) {
return map(matrix, function (row) {
return row[index];
});
});
} | [
"function",
"baseTranspose",
"(",
"matrix",
")",
"{",
"return",
"map",
"(",
"head",
"(",
"matrix",
")",
",",
"function",
"(",
"column",
",",
"index",
")",
"{",
"return",
"map",
"(",
"matrix",
",",
"function",
"(",
"row",
")",
"{",
"return",
"row",
"[... | Base matrix transpose. Turns an n by m matrix into m by n.
@private
@param {Array} matrix - Two-dimensional array (n by m).
@returns {Array} Returns m by n matrix. | [
"Base",
"matrix",
"transpose",
".",
"Turns",
"an",
"n",
"by",
"m",
"matrix",
"into",
"m",
"by",
"n",
"."
] | 2cb7573293431f109796cf2c3f619bd83545b1a3 | https://github.com/jlmorgan/lodash-transpose/blob/2cb7573293431f109796cf2c3f619bd83545b1a3/src/transpose.js#L16-L22 |
46,157 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(game, targets, settings){
this.game = game;
settings = settings || {};
this.typeSortPriority = settings.typeSortPriority || [].concat(this.typeSortPriority);
var width = settings.mapWidth || this.game.map.width;
var height = settings.mapWidth || this.game.map.width;
... | javascript | function(game, targets, settings){
this.game = game;
settings = settings || {};
this.typeSortPriority = settings.typeSortPriority || [].concat(this.typeSortPriority);
var width = settings.mapWidth || this.game.map.width;
var height = settings.mapWidth || this.game.map.width;
... | [
"function",
"(",
"game",
",",
"targets",
",",
"settings",
")",
"{",
"this",
".",
"game",
"=",
"game",
";",
"settings",
"=",
"settings",
"||",
"{",
"}",
";",
"this",
".",
"typeSortPriority",
"=",
"settings",
".",
"typeSortPriority",
"||",
"[",
"]",
".",... | Manages a list of valid targets and which is currently selected.
@class ValidTargets
@constructor
@param {Game} game - Game instance this obj is attached to.
@param {Array} [targets=Array] An Array of valid target objects to select from (intended to be in the format `validTargetsFinder.getValidTargets()` returns).
@par... | [
"Manages",
"a",
"list",
"of",
"valid",
"targets",
"and",
"which",
"is",
"currently",
"selected",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L16-L30 | |
46,158 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(targets){
targets = targets || [];
this.targets = targets;
this.map.reset();
for(var i = targets.length - 1; i >= 0; i--){
var target = targets[i];
this.map.add(target.x, target.y, target);
}
} | javascript | function(targets){
targets = targets || [];
this.targets = targets;
this.map.reset();
for(var i = targets.length - 1; i >= 0; i--){
var target = targets[i];
this.map.add(target.x, target.y, target);
}
} | [
"function",
"(",
"targets",
")",
"{",
"targets",
"=",
"targets",
"||",
"[",
"]",
";",
"this",
".",
"targets",
"=",
"targets",
";",
"this",
".",
"map",
".",
"reset",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"targets",
".",
"length",
"-",
"1",
... | Sets the targets, replacing currently set ones.
@method setTargets
@param {Array} targets | [
"Sets",
"the",
"targets",
"replacing",
"currently",
"set",
"ones",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L78-L86 | |
46,159 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(target){
var index = this.targets.indexOf(target);
if(index !== -1){
this.current = target;
return true;
}
return false;
} | javascript | function(target){
var index = this.targets.indexOf(target);
if(index !== -1){
this.current = target;
return true;
}
return false;
} | [
"function",
"(",
"target",
")",
"{",
"var",
"index",
"=",
"this",
".",
"targets",
".",
"indexOf",
"(",
"target",
")",
";",
"if",
"(",
"index",
"!==",
"-",
"1",
")",
"{",
"this",
".",
"current",
"=",
"target",
";",
"return",
"true",
";",
"}",
"ret... | Sets the currently selected target object.
@method setCurrent
@param {Object} target
@return {Bool} If target was found in `this.targets`. (only set if found). | [
"Sets",
"the",
"currently",
"selected",
"target",
"object",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L94-L101 | |
46,160 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(autoset){
autoset = autoset !== void 0 ? autoset : true;
if(autoset && !this.current && this.targets.length){
this.sort();
this.setCurrent(this.targets[0]);
}
return this.current;
} | javascript | function(autoset){
autoset = autoset !== void 0 ? autoset : true;
if(autoset && !this.current && this.targets.length){
this.sort();
this.setCurrent(this.targets[0]);
}
return this.current;
} | [
"function",
"(",
"autoset",
")",
"{",
"autoset",
"=",
"autoset",
"!==",
"void",
"0",
"?",
"autoset",
":",
"true",
";",
"if",
"(",
"autoset",
"&&",
"!",
"this",
".",
"current",
"&&",
"this",
".",
"targets",
".",
"length",
")",
"{",
"this",
".",
"sor... | Gets the currently selected target object.
@method getCurrent
@param {Bool} [autoset=true] - If no target is set to current autoset the first.
@return {Object} | [
"Gets",
"the",
"currently",
"selected",
"target",
"object",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L109-L117 | |
46,161 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(){
if(!this.current){
return this.getCurrent();
}
var index = this.targets.indexOf(this.current);
if(index === 0){
index = this.targets.length - 1;
} else {
index--;
}
this.setCu... | javascript | function(){
if(!this.current){
return this.getCurrent();
}
var index = this.targets.indexOf(this.current);
if(index === 0){
index = this.targets.length - 1;
} else {
index--;
}
this.setCu... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"current",
")",
"{",
"return",
"this",
".",
"getCurrent",
"(",
")",
";",
"}",
"var",
"index",
"=",
"this",
".",
"targets",
".",
"indexOf",
"(",
"this",
".",
"current",
")",
";",
"if",
"(",
... | Sets the object before the currently selected object to be the selected object.
@method prev
@return {Object} The new currently selected object. | [
"Sets",
"the",
"object",
"before",
"the",
"currently",
"selected",
"object",
"to",
"be",
"the",
"selected",
"object",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L144-L158 | |
46,162 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(obj){
for(var i = this.typeSortPriority.length - 1; i >= 0; i--){
var type = this.typeSortPriority[i];
if(obj instanceof type){
return i;
}
}
} | javascript | function(obj){
for(var i = this.typeSortPriority.length - 1; i >= 0; i--){
var type = this.typeSortPriority[i];
if(obj instanceof type){
return i;
}
}
} | [
"function",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"this",
".",
"typeSortPriority",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"var",
"type",
"=",
"this",
".",
"typeSortPriority",
"[",
"i",
"]",
";",
"if... | Gets the sort priority of an object based on its type using 'this.typeSortPriority'.
@method getTypeSortPriority
@param {Object} obj
@return {Number} | [
"Gets",
"the",
"sort",
"priority",
"of",
"an",
"object",
"based",
"on",
"its",
"type",
"using",
"this",
".",
"typeSortPriority",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L166-L173 | |
46,163 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(){
var _this = this;
this.targets.sort(function(a, b){
var aTypeSortPriority = _this.getTypeSortPriority(a.value);
var bTypeSortPriority = _this.getTypeSortPriority(b.value);
if(aTypeSortPriority === bTypeSortPriority){
... | javascript | function(){
var _this = this;
this.targets.sort(function(a, b){
var aTypeSortPriority = _this.getTypeSortPriority(a.value);
var bTypeSortPriority = _this.getTypeSortPriority(b.value);
if(aTypeSortPriority === bTypeSortPriority){
... | [
"function",
"(",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"this",
".",
"targets",
".",
"sort",
"(",
"function",
"(",
"a",
",",
"b",
")",
"{",
"var",
"aTypeSortPriority",
"=",
"_this",
".",
"getTypeSortPriority",
"(",
"a",
".",
"value",
")",
";",
... | Sorts `this.targets` by `this.typeSortPriority` then by range.
@method sort
@return {Number} | [
"Sorts",
"this",
".",
"targets",
"by",
"this",
".",
"typeSortPriority",
"then",
"by",
"range",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L179-L196 | |
46,164 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/valid-targets.js | function(value){
for(var i = this.targets.length - 1; i >= 0; i--){
var target = this.targets[i];
if(target.value === value){
return target;
}
}
} | javascript | function(value){
for(var i = this.targets.length - 1; i >= 0; i--){
var target = this.targets[i];
if(target.value === value){
return target;
}
}
} | [
"function",
"(",
"value",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"this",
".",
"targets",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"var",
"target",
"=",
"this",
".",
"targets",
"[",
"i",
"]",
";",
"if",
"(",
"t... | Finds a target object by its value.
@method getTargetByValue
@param {Object} value
@return {Object} | [
"Finds",
"a",
"target",
"object",
"by",
"its",
"value",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets.js#L204-L211 | |
46,165 | djett41/node-feedjett | lib/parser.js | parseTitle | function parseTitle (node, nodeType, feedType) {
return utils.stripHtml(utils.get(node.title));
} | javascript | function parseTitle (node, nodeType, feedType) {
return utils.stripHtml(utils.get(node.title));
} | [
"function",
"parseTitle",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"return",
"utils",
".",
"stripHtml",
"(",
"utils",
".",
"get",
"(",
"node",
".",
"title",
")",
")",
";",
"}"
] | Parses the title of a meta or item node and strips HTML
@param node
@param nodeType
@param feedType
@returns {string} | [
"Parses",
"the",
"title",
"of",
"a",
"meta",
"or",
"item",
"node",
"and",
"strips",
"HTML"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L86-L88 |
46,166 | djett41/node-feedjett | lib/parser.js | parseDescription | function parseDescription (node, nodeType, feedType) {
var propOrder = nodeType === 'item' ?
['description', 'summary', 'itunes:summary', 'content:encoded', 'content'] :
['description', 'subtitle', 'itunes:summary'];
return utils.stripHtml(utils.getFirstFoundPropValue(node, propOrder));
} | javascript | function parseDescription (node, nodeType, feedType) {
var propOrder = nodeType === 'item' ?
['description', 'summary', 'itunes:summary', 'content:encoded', 'content'] :
['description', 'subtitle', 'itunes:summary'];
return utils.stripHtml(utils.getFirstFoundPropValue(node, propOrder));
} | [
"function",
"parseDescription",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"propOrder",
"=",
"nodeType",
"===",
"'item'",
"?",
"[",
"'description'",
",",
"'summary'",
",",
"'itunes:summary'",
",",
"'content:encoded'",
",",
"'content'",
"]",
... | Parses the description of a meta or item node and strips HTML
- description
- highest priority and quantity in RSS feeds for both meta and item nodes.
- rarely found in ATOM feeds, commonly found in RSS feeds
- subtitle
- highest priority and quantity in ATOM feeds for meta nodes
- rarely found in RSS feeds
- summary
... | [
"Parses",
"the",
"description",
"of",
"a",
"meta",
"or",
"item",
"node",
"and",
"strips",
"HTML"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L119-L125 |
46,167 | djett41/node-feedjett | lib/parser.js | parseXmlUrl | function parseXmlUrl (node, nodeType, feedType) {
var getLink = function (linkNode) {
var link;
utils.parse(linkNode, function (linkEl) {
var linkAttr = linkEl['@'];
if (linkAttr.href && linkAttr.rel === 'self') {
link = linkAttr.href;
return;
}
}, this, true);
ret... | javascript | function parseXmlUrl (node, nodeType, feedType) {
var getLink = function (linkNode) {
var link;
utils.parse(linkNode, function (linkEl) {
var linkAttr = linkEl['@'];
if (linkAttr.href && linkAttr.rel === 'self') {
link = linkAttr.href;
return;
}
}, this, true);
ret... | [
"function",
"parseXmlUrl",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"getLink",
"=",
"function",
"(",
"linkNode",
")",
"{",
"var",
"link",
";",
"utils",
".",
"parse",
"(",
"linkNode",
",",
"function",
"(",
"linkEl",
")",
"{",
"var... | Parses the xmlUrl of a meta node.
- link
- highest priority and quantity in RSS and ATOM feeds for both meta and item nodes.
- atom:link
- next highest priority and quantity in RSS feeds for meta nodes.
- rarely found in ATOM feeds or item nodes if ever.
- atom10:link
- next highest priority in RSS feeds for meta node... | [
"Parses",
"the",
"xmlUrl",
"of",
"a",
"meta",
"node",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L205-L222 |
46,168 | djett41/node-feedjett | lib/parser.js | parseOrigLink | function parseOrigLink (node, nodeType, feedType) {
var origLink;
if (origLink = utils.getFirstFoundPropValue(node, ['feedburner:origlink', 'pheedo:origlink'])) {
return origLink;
} else {
utils.parse(node.link, function (linkEl) {
var linkAttr = linkEl['@'];
if (linkAttr.href && linkAttr.re... | javascript | function parseOrigLink (node, nodeType, feedType) {
var origLink;
if (origLink = utils.getFirstFoundPropValue(node, ['feedburner:origlink', 'pheedo:origlink'])) {
return origLink;
} else {
utils.parse(node.link, function (linkEl) {
var linkAttr = linkEl['@'];
if (linkAttr.href && linkAttr.re... | [
"function",
"parseOrigLink",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"origLink",
";",
"if",
"(",
"origLink",
"=",
"utils",
".",
"getFirstFoundPropValue",
"(",
"node",
",",
"[",
"'feedburner:origlink'",
",",
"'pheedo:origlink'",
"]",
")"... | Parses the origLink for item nodes.
@param node
@param nodeType
@param feedType | [
"Parses",
"the",
"origLink",
"for",
"item",
"nodes",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L232-L249 |
46,169 | djett41/node-feedjett | lib/parser.js | parseAuthor | function parseAuthor (node, nodeType, feedType) {
var authorNode = node.author,
author;
//Both meta and item have author property as top priority and share parsing logic.
if (authorNode && (author = utils.get(authorNode))) {
author = addressparser(author)[0];
return author.name || author.address;
... | javascript | function parseAuthor (node, nodeType, feedType) {
var authorNode = node.author,
author;
//Both meta and item have author property as top priority and share parsing logic.
if (authorNode && (author = utils.get(authorNode))) {
author = addressparser(author)[0];
return author.name || author.address;
... | [
"function",
"parseAuthor",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"authorNode",
"=",
"node",
".",
"author",
",",
"author",
";",
"//Both meta and item have author property as top priority and share parsing logic.",
"if",
"(",
"authorNode",
"&&",
... | Parses the author for meta and item nodes
- author
- highest priority in ATOM and RSS feeds for both meta and item nodes
- more commonly found in ATOM feeds than RSS feeds
- managingeditor
- next highest priority for RSS feeds in meta nodes
- more commonly found in RSS feeds and rarely found in ATOM feeds if ever
- ge... | [
"Parses",
"the",
"author",
"for",
"meta",
"and",
"item",
"nodes"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L288-L314 |
46,170 | djett41/node-feedjett | lib/parser.js | parseLanguage | function parseLanguage (node, nodeType, feedType) {
return utils.get(node.language) || utils.getAttr(node, 'xml:lang') || utils.get(node['dc:language']);
} | javascript | function parseLanguage (node, nodeType, feedType) {
return utils.get(node.language) || utils.getAttr(node, 'xml:lang') || utils.get(node['dc:language']);
} | [
"function",
"parseLanguage",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"return",
"utils",
".",
"get",
"(",
"node",
".",
"language",
")",
"||",
"utils",
".",
"getAttr",
"(",
"node",
",",
"'xml:lang'",
")",
"||",
"utils",
".",
"get",
"(",
... | Parses the language for meta nodes
- language
- highest priority for RSS feeds
- commonly found in RSS feeds and rarely in ATOM feeds if ever
- xml:lang
- highest priority for ATOM feeds
- more commonly found in ATOM feeds and rarely found in RSS feeds if ever
- dc:language
- next highest priority for RSS feeds
- more... | [
"Parses",
"the",
"language",
"for",
"meta",
"nodes"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L335-L337 |
46,171 | djett41/node-feedjett | lib/parser.js | parseUpdateInfo | function parseUpdateInfo (node, nodeType, feedType) {
var updateInfo = {}, temp;
if (temp = utils.get(node['sy:updatefrequency'])) {
updateInfo.frequency = temp;
}
if (temp = utils.get(node['sy:updateperiod'])) {
updateInfo.period = temp;
}
if (temp = utils.get(node['sy:updatebase'])) {
updateI... | javascript | function parseUpdateInfo (node, nodeType, feedType) {
var updateInfo = {}, temp;
if (temp = utils.get(node['sy:updatefrequency'])) {
updateInfo.frequency = temp;
}
if (temp = utils.get(node['sy:updateperiod'])) {
updateInfo.period = temp;
}
if (temp = utils.get(node['sy:updatebase'])) {
updateI... | [
"function",
"parseUpdateInfo",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"updateInfo",
"=",
"{",
"}",
",",
"temp",
";",
"if",
"(",
"temp",
"=",
"utils",
".",
"get",
"(",
"node",
"[",
"'sy:updatefrequency'",
"]",
")",
")",
"{",
"... | Parses the common meta properties used to determine when to update or get a new feed
@param node
@param nodeType
@param feedType
@returns {{}} | [
"Parses",
"the",
"common",
"meta",
"properties",
"used",
"to",
"determine",
"when",
"to",
"update",
"or",
"get",
"a",
"new",
"feed"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L391-L408 |
46,172 | djett41/node-feedjett | lib/parser.js | parseImage | function parseImage (node, nodeType, feedType) {
var image, mediaGroup, mediaContent;
if (node.image && (image = utils.get(utils.get(node.image, 'url') || node.image))) {
return image;
} else if (nodeType === 'meta') {
return utils.getAttr(node['itunes:image'], 'href') || utils.getAttr(node['media:thumbn... | javascript | function parseImage (node, nodeType, feedType) {
var image, mediaGroup, mediaContent;
if (node.image && (image = utils.get(utils.get(node.image, 'url') || node.image))) {
return image;
} else if (nodeType === 'meta') {
return utils.getAttr(node['itunes:image'], 'href') || utils.getAttr(node['media:thumbn... | [
"function",
"parseImage",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"image",
",",
"mediaGroup",
",",
"mediaContent",
";",
"if",
"(",
"node",
".",
"image",
"&&",
"(",
"image",
"=",
"utils",
".",
"get",
"(",
"utils",
".",
"get",
"... | Parses the image of a meta or item node.
- image
- highest priority for RSS feeds in both meta nd item nodes
- most frequent in meta nodes, less frequent in item nodes
- itunes:image
- second most frequent in RSS feeds for meta nodes
- less frequent and lesser priority than media:thumbnail in RSS feeds for item nodes
... | [
"Parses",
"the",
"image",
"of",
"a",
"meta",
"or",
"item",
"node",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L472-L500 |
46,173 | djett41/node-feedjett | lib/parser.js | parseCloud | function parseCloud (node, nodeType, feedType) {
var cloud,
temp = utils.getAttr(node.cloud) || {};
if (Object.keys(temp).length) {
cloud = temp;
cloud.type = 'rsscloud';
} else {
utils.parse(node.link, function (link) {
var attr = utils.getAttr(link);
if (attr && attr.href && attr.... | javascript | function parseCloud (node, nodeType, feedType) {
var cloud,
temp = utils.getAttr(node.cloud) || {};
if (Object.keys(temp).length) {
cloud = temp;
cloud.type = 'rsscloud';
} else {
utils.parse(node.link, function (link) {
var attr = utils.getAttr(link);
if (attr && attr.href && attr.... | [
"function",
"parseCloud",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"cloud",
",",
"temp",
"=",
"utils",
".",
"getAttr",
"(",
"node",
".",
"cloud",
")",
"||",
"{",
"}",
";",
"if",
"(",
"Object",
".",
"keys",
"(",
"temp",
")",
... | Parses the cloud of a meta node.
- cloud
- highest priority for RSS feeds
- rarely found in ATOM feeds if ever
- link (rel=hub)
- mostly found in ATOM feeds and rarely in RSS
@param node
@param nodeType
@param feedType | [
"Parses",
"the",
"cloud",
"of",
"a",
"meta",
"node",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L516-L534 |
46,174 | djett41/node-feedjett | lib/parser.js | parseCategories | function parseCategories (node, nodeType, feedType) {
var categoryMap = {};
var setCategory = function (category, attrProp) {
if (!category) {
return;
} else if (attrProp) {
category = utils.getAttr(category, attrProp);
}
if (!categoryMap[category]) {
categoryMap[category] = true... | javascript | function parseCategories (node, nodeType, feedType) {
var categoryMap = {};
var setCategory = function (category, attrProp) {
if (!category) {
return;
} else if (attrProp) {
category = utils.getAttr(category, attrProp);
}
if (!categoryMap[category]) {
categoryMap[category] = true... | [
"function",
"parseCategories",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"categoryMap",
"=",
"{",
"}",
";",
"var",
"setCategory",
"=",
"function",
"(",
"category",
",",
"attrProp",
")",
"{",
"if",
"(",
"!",
"category",
")",
"{",
"... | Parses and aggregates an Array of categories for an item or meta node. The following node properties are parsed in
order of most frequently available. Categories for a specific node are uniquely identified and cached by value,
then mapped to an array of categories
category, dc:subject, link, itunes:category, media:c... | [
"Parses",
"and",
"aggregates",
"an",
"Array",
"of",
"categories",
"for",
"an",
"item",
"or",
"meta",
"node",
".",
"The",
"following",
"node",
"properties",
"are",
"parsed",
"in",
"order",
"of",
"most",
"frequently",
"available",
".",
"Categories",
"for",
"a"... | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L549-L597 |
46,175 | djett41/node-feedjett | lib/parser.js | parseComments | function parseComments (node, nodeType, feedType) {
var comments = utils.get(node.comments);
if (!comments && feedType === 'atom') {
utils.parse(node.link, function (link) {
var linkAttr = link['@'];
if (linkAttr && linkAttr.rel === 'replies' && linkAttr.href) {
comments = linkAttr.href;
... | javascript | function parseComments (node, nodeType, feedType) {
var comments = utils.get(node.comments);
if (!comments && feedType === 'atom') {
utils.parse(node.link, function (link) {
var linkAttr = link['@'];
if (linkAttr && linkAttr.rel === 'replies' && linkAttr.href) {
comments = linkAttr.href;
... | [
"function",
"parseComments",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"comments",
"=",
"utils",
".",
"get",
"(",
"node",
".",
"comments",
")",
";",
"if",
"(",
"!",
"comments",
"&&",
"feedType",
"===",
"'atom'",
")",
"{",
"utils",... | Parses comments for item nodes
- comments
- highest priority for RSS and ATOM feeds
- link (rel=replies)
- fallback for comments sometimes found in ATOM feeds
@param node
@param nodeType
@param feedType
@returns {*} | [
"Parses",
"comments",
"for",
"item",
"nodes"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L613-L631 |
46,176 | djett41/node-feedjett | lib/parser.js | parseEnclosures | function parseEnclosures (node, nodeType, feedType) {
var enclosuresMap = {};
['media:content', 'enclosure', 'link', 'enc:enclosure'].forEach(function (key) {
if (!node[key]) {
return;
}
utils.parse(node[key], function (enc) {
var enclosure,
encAttr = enc['@'];
if (!encAtt... | javascript | function parseEnclosures (node, nodeType, feedType) {
var enclosuresMap = {};
['media:content', 'enclosure', 'link', 'enc:enclosure'].forEach(function (key) {
if (!node[key]) {
return;
}
utils.parse(node[key], function (enc) {
var enclosure,
encAttr = enc['@'];
if (!encAtt... | [
"function",
"parseEnclosures",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"enclosuresMap",
"=",
"{",
"}",
";",
"[",
"'media:content'",
",",
"'enclosure'",
",",
"'link'",
",",
"'enc:enclosure'",
"]",
".",
"forEach",
"(",
"function",
"(",
... | Parses and aggregates an Array of enclosures for an item node. The following node properties are parsed in
order of most frequently available. enclosures for a specific node are uniquely identified and cached by url,
then mapped to an array of enclosures
media:content, enclosure, link, enc:enclosure
@param node
@pa... | [
"Parses",
"and",
"aggregates",
"an",
"Array",
"of",
"enclosures",
"for",
"an",
"item",
"node",
".",
"The",
"following",
"node",
"properties",
"are",
"parsed",
"in",
"order",
"of",
"most",
"frequently",
"available",
".",
"enclosures",
"for",
"a",
"specific",
... | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L683-L727 |
46,177 | djett41/node-feedjett | lib/parser.js | parseSource | function parseSource (node, nodeType, feedType) {
var source = {},
sourceNode = node.source,
temp;
if (!sourceNode) {
return;
}
if (temp = (feedType === 'atom' && utils.get(sourceNode.title)) || utils.get(sourceNode)) {
source.title = temp;
}
if (temp = (feedType === 'atom' && utils.ge... | javascript | function parseSource (node, nodeType, feedType) {
var source = {},
sourceNode = node.source,
temp;
if (!sourceNode) {
return;
}
if (temp = (feedType === 'atom' && utils.get(sourceNode.title)) || utils.get(sourceNode)) {
source.title = temp;
}
if (temp = (feedType === 'atom' && utils.ge... | [
"function",
"parseSource",
"(",
"node",
",",
"nodeType",
",",
"feedType",
")",
"{",
"var",
"source",
"=",
"{",
"}",
",",
"sourceNode",
"=",
"node",
".",
"source",
",",
"temp",
";",
"if",
"(",
"!",
"sourceNode",
")",
"{",
"return",
";",
"}",
"if",
"... | Parse the source of an item node
@param node
@param nodeType
@param feedType | [
"Parse",
"the",
"source",
"of",
"an",
"item",
"node"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/parser.js#L756-L773 |
46,178 | djett41/node-feedjett | lib/utils.js | get | function get(obj, subkey) {
if (!obj) { return; }
if (Array.isArray(obj)) {
obj = obj[0];
}
return obj[subkey || '#'];
} | javascript | function get(obj, subkey) {
if (!obj) { return; }
if (Array.isArray(obj)) {
obj = obj[0];
}
return obj[subkey || '#'];
} | [
"function",
"get",
"(",
"obj",
",",
"subkey",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"{",
"return",
";",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"obj",
")",
")",
"{",
"obj",
"=",
"obj",
"[",
"0",
"]",
";",
"}",
"return",
"obj",
"[",
"s... | Utility function to test for and extract a subkey.
var obj = { '#': 'foo', 'bar': 'baz' };
get(obj);
// => 'foo'
get(obj, 'bar');
// => 'baz'
@param {Object} obj
@param {String} [subkey="#"] By default, use the '#' key, but you may pass any key you like
@return {*} Returns the value of the selected key or 'null' if... | [
"Utility",
"function",
"to",
"test",
"for",
"and",
"extract",
"a",
"subkey",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L38-L45 |
46,179 | djett41/node-feedjett | lib/utils.js | getAttr | function getAttr(obj, attr) {
if (!obj) { return; }
if (Array.isArray(obj)) {
obj = obj[0];
}
return (attr && obj['@']) ? obj['@'][attr] : obj['@'];
} | javascript | function getAttr(obj, attr) {
if (!obj) { return; }
if (Array.isArray(obj)) {
obj = obj[0];
}
return (attr && obj['@']) ? obj['@'][attr] : obj['@'];
} | [
"function",
"getAttr",
"(",
"obj",
",",
"attr",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"{",
"return",
";",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"obj",
")",
")",
"{",
"obj",
"=",
"obj",
"[",
"0",
"]",
";",
"}",
"return",
"(",
"attr",
... | Fetches a specific attribute or the whole attribute for an object
@param obj
@param attr
@returns {*} | [
"Fetches",
"a",
"specific",
"attribute",
"or",
"the",
"whole",
"attribute",
"for",
"an",
"object"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L56-L64 |
46,180 | djett41/node-feedjett | lib/utils.js | parse | function parse (el, parseFn, context, canBreak) {
if (!el) { return; }
if (!Array.isArray(el)) {
parseFn.call(context, el);
} else if (canBreak) {
el.some(parseFn, context);
} else {
el.forEach(parseFn, context);
}
} | javascript | function parse (el, parseFn, context, canBreak) {
if (!el) { return; }
if (!Array.isArray(el)) {
parseFn.call(context, el);
} else if (canBreak) {
el.some(parseFn, context);
} else {
el.forEach(parseFn, context);
}
} | [
"function",
"parse",
"(",
"el",
",",
"parseFn",
",",
"context",
",",
"canBreak",
")",
"{",
"if",
"(",
"!",
"el",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"el",
")",
")",
"{",
"parseFn",
".",
"call",
"(",
"cont... | Invokes a callback with a specified context.
If the el is an array, the callback will be called for each item in the array
@param el
@param parseFn
@param context | [
"Invokes",
"a",
"callback",
"with",
"a",
"specified",
"context",
".",
"If",
"the",
"el",
"is",
"an",
"array",
"the",
"callback",
"will",
"be",
"called",
"for",
"each",
"item",
"in",
"the",
"array"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L124-L134 |
46,181 | djett41/node-feedjett | lib/utils.js | strArrayToObj | function strArrayToObj (array) {
return array && array.reduce(function(o, v) {
o[v] = true;
return o;
}, {});
} | javascript | function strArrayToObj (array) {
return array && array.reduce(function(o, v) {
o[v] = true;
return o;
}, {});
} | [
"function",
"strArrayToObj",
"(",
"array",
")",
"{",
"return",
"array",
"&&",
"array",
".",
"reduce",
"(",
"function",
"(",
"o",
",",
"v",
")",
"{",
"o",
"[",
"v",
"]",
"=",
"true",
";",
"return",
"o",
";",
"}",
",",
"{",
"}",
")",
";",
"}"
] | Converts a String array to object. Used for whitelisting and blacklisting feed properties
@param array
@returns {*} | [
"Converts",
"a",
"String",
"array",
"to",
"object",
".",
"Used",
"for",
"whitelisting",
"and",
"blacklisting",
"feed",
"properties"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L144-L149 |
46,182 | djett41/node-feedjett | lib/utils.js | createOpenTag | function createOpenTag (tagName, attrs) {
var attrString = Object.keys(attrs).map(function (key) {
return ' ' + key + '="' + attrs[key] + '"';
}).join('');
return '<' + tagName + attrString + '>';
} | javascript | function createOpenTag (tagName, attrs) {
var attrString = Object.keys(attrs).map(function (key) {
return ' ' + key + '="' + attrs[key] + '"';
}).join('');
return '<' + tagName + attrString + '>';
} | [
"function",
"createOpenTag",
"(",
"tagName",
",",
"attrs",
")",
"{",
"var",
"attrString",
"=",
"Object",
".",
"keys",
"(",
"attrs",
")",
".",
"map",
"(",
"function",
"(",
"key",
")",
"{",
"return",
"' '",
"+",
"key",
"+",
"'=\"'",
"+",
"attrs",
"[",
... | Creates an opening XML tag based on tagName and attributes
@param tagName
@param attrs
@returns {string} | [
"Creates",
"an",
"opening",
"XML",
"tag",
"based",
"on",
"tagName",
"and",
"attributes"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L194-L200 |
46,183 | djett41/node-feedjett | lib/utils.js | getStandardTimeOffset | function getStandardTimeOffset(date) {
var jan = new Date(date.getFullYear(), 0, 1);
var jul = new Date(date.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
} | javascript | function getStandardTimeOffset(date) {
var jan = new Date(date.getFullYear(), 0, 1);
var jul = new Date(date.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
} | [
"function",
"getStandardTimeOffset",
"(",
"date",
")",
"{",
"var",
"jan",
"=",
"new",
"Date",
"(",
"date",
".",
"getFullYear",
"(",
")",
",",
"0",
",",
"1",
")",
";",
"var",
"jul",
"=",
"new",
"Date",
"(",
"date",
".",
"getFullYear",
"(",
")",
",",... | Returns the standard time timezone offset regardless of whether the current time is on standard or daylight saving time.
@param node
@param nodeType
@param feedType | [
"Returns",
"the",
"standard",
"time",
"timezone",
"offset",
"regardless",
"of",
"whether",
"the",
"current",
"time",
"is",
"on",
"standard",
"or",
"daylight",
"saving",
"time",
"."
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L222-L226 |
46,184 | djett41/node-feedjett | lib/utils.js | fixInvalidDate | function fixInvalidDate(dateString) {
if (!dateString) {
return;
}
//Convert invalid dates' timezones to GMT using timezoneMap
dateString = dateString.replace(/BST?/i, function (match) {
return timezoneMap[match];
});
//Some dates come in as ET, CT etc.. and some don't have the correct offset.
/... | javascript | function fixInvalidDate(dateString) {
if (!dateString) {
return;
}
//Convert invalid dates' timezones to GMT using timezoneMap
dateString = dateString.replace(/BST?/i, function (match) {
return timezoneMap[match];
});
//Some dates come in as ET, CT etc.. and some don't have the correct offset.
/... | [
"function",
"fixInvalidDate",
"(",
"dateString",
")",
"{",
"if",
"(",
"!",
"dateString",
")",
"{",
"return",
";",
"}",
"//Convert invalid dates' timezones to GMT using timezoneMap",
"dateString",
"=",
"dateString",
".",
"replace",
"(",
"/",
"BST?",
"/",
"i",
",",
... | Attempts to fix invalid dates coming in from different feeds
@param dateString
@returns {Date} | [
"Attempts",
"to",
"fix",
"invalid",
"dates",
"coming",
"in",
"from",
"different",
"feeds"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L246-L264 |
46,185 | djett41/node-feedjett | lib/utils.js | getDate | function getDate (dateString) {
var date = new Date(dateString);
if (Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime())) {
return date;
}
//try to fix invalid date
date = fixInvalidDate(dateString);
//if date still isn't valid there's not more we can do..
if (!isNaN(... | javascript | function getDate (dateString) {
var date = new Date(dateString);
if (Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime())) {
return date;
}
//try to fix invalid date
date = fixInvalidDate(dateString);
//if date still isn't valid there's not more we can do..
if (!isNaN(... | [
"function",
"getDate",
"(",
"dateString",
")",
"{",
"var",
"date",
"=",
"new",
"Date",
"(",
"dateString",
")",
";",
"if",
"(",
"Object",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"date",
")",
"===",
"'[object Date]'",
"&&",
"!",
"isNaN",
"("... | Parses a date string to a date
@param dateString | [
"Parses",
"a",
"date",
"string",
"to",
"a",
"date"
] | b205aca7a4f72ee04e6ebbe0591fc8eb9078e073 | https://github.com/djett41/node-feedjett/blob/b205aca7a4f72ee04e6ebbe0591fc8eb9078e073/lib/utils.js#L272-L286 |
46,186 | sergeyt/fetch-stream | src/parser.js | makeConcat | function makeConcat(chunkType) {
switch (chunkType) {
case BUFFER:
return (a, b) => Buffer.concat([a, b]);
default:
return (a, b) => {
// console.log('[%d, %d]', a.length, b.length);
const t = new Uint8Array(a.length + b.length);
t.set(a);
t.set(b, a.length);
// console.log('%d: %s', t.length, new... | javascript | function makeConcat(chunkType) {
switch (chunkType) {
case BUFFER:
return (a, b) => Buffer.concat([a, b]);
default:
return (a, b) => {
// console.log('[%d, %d]', a.length, b.length);
const t = new Uint8Array(a.length + b.length);
t.set(a);
t.set(b, a.length);
// console.log('%d: %s', t.length, new... | [
"function",
"makeConcat",
"(",
"chunkType",
")",
"{",
"switch",
"(",
"chunkType",
")",
"{",
"case",
"BUFFER",
":",
"return",
"(",
"a",
",",
"b",
")",
"=>",
"Buffer",
".",
"concat",
"(",
"[",
"a",
",",
"b",
"]",
")",
";",
"default",
":",
"return",
... | Makes function to concat two byte chunks.
@param {Boolean} [chunkType] Specifies type of input chunks.
@return {Function} The function to concat two byte chunks. | [
"Makes",
"function",
"to",
"concat",
"two",
"byte",
"chunks",
"."
] | eab91c059ce3b1d172fd44890769c761bb4b7aa3 | https://github.com/sergeyt/fetch-stream/blob/eab91c059ce3b1d172fd44890769c761bb4b7aa3/src/parser.js#L47-L61 |
46,187 | jlengstorf/responsive-lazyload.js | source/scripts/responsive-lazyload.js | isElementVisible | function isElementVisible(el) {
/*
* Checks if element (or an ancestor) is hidden via style properties.
* See https://stackoverflow.com/a/21696585/463471
*/
const isCurrentlyVisible = el.offsetParent !== null;
// Check if any part of the element is vertically within the viewport.
const position = el.g... | javascript | function isElementVisible(el) {
/*
* Checks if element (or an ancestor) is hidden via style properties.
* See https://stackoverflow.com/a/21696585/463471
*/
const isCurrentlyVisible = el.offsetParent !== null;
// Check if any part of the element is vertically within the viewport.
const position = el.g... | [
"function",
"isElementVisible",
"(",
"el",
")",
"{",
"/*\n * Checks if element (or an ancestor) is hidden via style properties.\n * See https://stackoverflow.com/a/21696585/463471\n */",
"const",
"isCurrentlyVisible",
"=",
"el",
".",
"offsetParent",
"!==",
"null",
";",
"// Chec... | Check if an element is visible at all in the viewport.
It would be cool to use an IntersectionObserver here, but browser support
isn’t there yet: http://caniuse.com/#feat=intersectionobserver
@param {Element} el the element to check
@return {Boolean} `true` if the element is visible at all; `false` if not | [
"Check",
"if",
"an",
"element",
"is",
"visible",
"at",
"all",
"in",
"the",
"viewport",
"."
] | d375eedd6bf48b1cfa54b301fd77f59198c2ab73 | https://github.com/jlengstorf/responsive-lazyload.js/blob/d375eedd6bf48b1cfa54b301fd77f59198c2ab73/source/scripts/responsive-lazyload.js#L10-L27 |
46,188 | Lanfei/websocket-lib | lib/frame.js | Receiver | function Receiver() {
stream.Duplex.call(this, {
readableObjectMode: true
});
this._buffer = null;
this._frame = new Frame();
this._state = WAITING_FOR_HEADER;
} | javascript | function Receiver() {
stream.Duplex.call(this, {
readableObjectMode: true
});
this._buffer = null;
this._frame = new Frame();
this._state = WAITING_FOR_HEADER;
} | [
"function",
"Receiver",
"(",
")",
"{",
"stream",
".",
"Duplex",
".",
"call",
"(",
"this",
",",
"{",
"readableObjectMode",
":",
"true",
"}",
")",
";",
"this",
".",
"_buffer",
"=",
"null",
";",
"this",
".",
"_frame",
"=",
"new",
"Frame",
"(",
")",
";... | WebSocket Frame Receiver
@constructor
@extends stream.Duplex | [
"WebSocket",
"Frame",
"Receiver"
] | d39f704490fb91b1e2897712b280c0e5ac79e123 | https://github.com/Lanfei/websocket-lib/blob/d39f704490fb91b1e2897712b280c0e5ac79e123/lib/frame.js#L174-L182 |
46,189 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/mouse.js | function(e){
if(e.type === 'mousemove' && this.onHover){
this.onHover(e.clientX, e.clientY);
}
else if(e.type === 'mouseenter' && this.onHover){
this.onHover(e.clientX, e.clientY);
}
else if(e.type === 'mouseleave' && this.onHov... | javascript | function(e){
if(e.type === 'mousemove' && this.onHover){
this.onHover(e.clientX, e.clientY);
}
else if(e.type === 'mouseenter' && this.onHover){
this.onHover(e.clientX, e.clientY);
}
else if(e.type === 'mouseleave' && this.onHov... | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"type",
"===",
"'mousemove'",
"&&",
"this",
".",
"onHover",
")",
"{",
"this",
".",
"onHover",
"(",
"e",
".",
"clientX",
",",
"e",
".",
"clientY",
")",
";",
"}",
"else",
"if",
"(",
"e",
".",
... | Hander for mouse events
@method handleEvent
@param {Event} e - mouse event | [
"Hander",
"for",
"mouse",
"events"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mouse.js#L48-L61 | |
46,190 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/mouse.js | function(e) {
if(this.onHover){
var coords = this.game.renderer.mouseToTileCoords(e.clientX, e.clientY);
this.onHover(coords);
}
} | javascript | function(e) {
if(this.onHover){
var coords = this.game.renderer.mouseToTileCoords(e.clientX, e.clientY);
this.onHover(coords);
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"this",
".",
"onHover",
")",
"{",
"var",
"coords",
"=",
"this",
".",
"game",
".",
"renderer",
".",
"mouseToTileCoords",
"(",
"e",
".",
"clientX",
",",
"e",
".",
"clientY",
")",
";",
"this",
".",
"onHover",... | Hander for mouse move events
@method mouseMove
@param {Event} e - mouse event | [
"Hander",
"for",
"mouse",
"move",
"events"
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mouse.js#L68-L73 | |
46,191 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/mouse.js | function(element){
if(this._boundElement){
this.stopListening();
}
element.addEventListener('mousemove', this);
element.addEventListener('mouseenter', this);
element.addEventListener('mouseleave', this);
element.addEventListener('c... | javascript | function(element){
if(this._boundElement){
this.stopListening();
}
element.addEventListener('mousemove', this);
element.addEventListener('mouseenter', this);
element.addEventListener('mouseleave', this);
element.addEventListener('c... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"this",
".",
"_boundElement",
")",
"{",
"this",
".",
"stopListening",
"(",
")",
";",
"}",
"element",
".",
"addEventListener",
"(",
"'mousemove'",
",",
"this",
")",
";",
"element",
".",
"addEventListener",
... | Binds event listener for mouse events.
@method startListening
@param {HTMLElement} element - The dom element being rendered to. | [
"Binds",
"event",
"listener",
"for",
"mouse",
"events",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mouse.js#L80-L91 | |
46,192 | THEjoezack/BoxPusher | public/js-roguelike-skeleton/src/mouse.js | function(){
if(!this._boundElement){
return false;
}
var el = this._boundElement;
el.removeEventListener('mousemove', this);
el.removeEventListener('mouseenter', this);
el.removeEventListener('mouseleave', this);
el.remo... | javascript | function(){
if(!this._boundElement){
return false;
}
var el = this._boundElement;
el.removeEventListener('mousemove', this);
el.removeEventListener('mouseenter', this);
el.removeEventListener('mouseleave', this);
el.remo... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_boundElement",
")",
"{",
"return",
"false",
";",
"}",
"var",
"el",
"=",
"this",
".",
"_boundElement",
";",
"el",
".",
"removeEventListener",
"(",
"'mousemove'",
",",
"this",
")",
";",
"el",
".... | Unbinds event listener for mouse events.
@method stopListening | [
"Unbinds",
"event",
"listener",
"for",
"mouse",
"events",
"."
] | ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5 | https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mouse.js#L97-L106 | |
46,193 | bjorg/jDoc | src/jdoc.js | function(array, json) {
var i;
if (typeof json === 'object' && typeof json.length === 'number') {
for (i = 0; i < json.length; ++i) {
array.push(json[i]);
}
} else {
array.push(json);
}
} | javascript | function(array, json) {
var i;
if (typeof json === 'object' && typeof json.length === 'number') {
for (i = 0; i < json.length; ++i) {
array.push(json[i]);
}
} else {
array.push(json);
}
} | [
"function",
"(",
"array",
",",
"json",
")",
"{",
"var",
"i",
";",
"if",
"(",
"typeof",
"json",
"===",
"'object'",
"&&",
"typeof",
"json",
".",
"length",
"===",
"'number'",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"json",
".",
"length",... | private jDoc functions | [
"private",
"jDoc",
"functions"
] | 14ace8ae07320e180a1445f25881d31b0c477540 | https://github.com/bjorg/jDoc/blob/14ace8ae07320e180a1445f25881d31b0c477540/src/jdoc.js#L87-L96 | |
46,194 | jonjomckay/jjgraph | javascript/examples/grapheditor/www/js/Editor.js | function(sender, evt)
{
var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
var model = graph.getModel();
var cells = [];
for (var i = 0; i < cand.length; i++)
{
if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
{
cells.pus... | javascript | function(sender, evt)
{
var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
var model = graph.getModel();
var cells = [];
for (var i = 0; i < cand.length; i++)
{
if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
{
cells.pus... | [
"function",
"(",
"sender",
",",
"evt",
")",
"{",
"var",
"cand",
"=",
"graph",
".",
"getSelectionCellsForChanges",
"(",
"evt",
".",
"getProperty",
"(",
"'edit'",
")",
".",
"changes",
")",
";",
"var",
"model",
"=",
"graph",
".",
"getModel",
"(",
")",
";"... | Keeps the selection in sync with the history | [
"Keeps",
"the",
"selection",
"in",
"sync",
"with",
"the",
"history"
] | f041596ea8cb33e7a47e8c029008f13b31a92469 | https://github.com/jonjomckay/jjgraph/blob/f041596ea8cb33e7a47e8c029008f13b31a92469/javascript/examples/grapheditor/www/js/Editor.js#L596-L611 | |
46,195 | sethvincent/read-directory | transform.js | end | function end (next) {
filenames(dir, obj).forEach(function (filename) {
sm.emit('file', filename)
})
next()
} | javascript | function end (next) {
filenames(dir, obj).forEach(function (filename) {
sm.emit('file', filename)
})
next()
} | [
"function",
"end",
"(",
"next",
")",
"{",
"filenames",
"(",
"dir",
",",
"obj",
")",
".",
"forEach",
"(",
"function",
"(",
"filename",
")",
"{",
"sm",
".",
"emit",
"(",
"'file'",
",",
"filename",
")",
"}",
")",
"next",
"(",
")",
"}"
] | Make sure all files are watched | [
"Make",
"sure",
"all",
"files",
"are",
"watched"
] | e154975071f1dd68ecd4ccb4b329aa00dc1b056e | https://github.com/sethvincent/read-directory/blob/e154975071f1dd68ecd4ccb4b329aa00dc1b056e/transform.js#L33-L38 |
46,196 | nickzuber/needle | src/BitArray/bitArray.js | function(n){
if(typeof n === 'number'){
return n;
}
if(typeof n !== 'string'){
n = JSON.stringify(n)
}
var res = 0;
n.split("").map(function(bit){
res += bit.charCodeAt(0);
});
return res;
} | javascript | function(n){
if(typeof n === 'number'){
return n;
}
if(typeof n !== 'string'){
n = JSON.stringify(n)
}
var res = 0;
n.split("").map(function(bit){
res += bit.charCodeAt(0);
});
return res;
} | [
"function",
"(",
"n",
")",
"{",
"if",
"(",
"typeof",
"n",
"===",
"'number'",
")",
"{",
"return",
"n",
";",
"}",
"if",
"(",
"typeof",
"n",
"!==",
"'string'",
")",
"{",
"n",
"=",
"JSON",
".",
"stringify",
"(",
"n",
")",
"}",
"var",
"res",
"=",
... | Transforms input into a number.
@param {*} input to become a number
@return {number} number version of input | [
"Transforms",
"input",
"into",
"a",
"number",
"."
] | 9565b3c193b93d67ffed39d430eba395a7bb5531 | https://github.com/nickzuber/needle/blob/9565b3c193b93d67ffed39d430eba395a7bb5531/src/BitArray/bitArray.js#L26-L38 | |
46,197 | nickzuber/needle | src/BitArray/bitArray.js | function(size){
this.data = [];
if(typeof size === 'undefined'){
return; // Empty instance of a bit array
}
if(typeof size !== 'number'){
size = shred(size);
}
for(var i=0; i<Math.ceil(size/INTEGER_SIZE); ++i){
this.data.push(0);
}
} | javascript | function(size){
this.data = [];
if(typeof size === 'undefined'){
return; // Empty instance of a bit array
}
if(typeof size !== 'number'){
size = shred(size);
}
for(var i=0; i<Math.ceil(size/INTEGER_SIZE); ++i){
this.data.push(0);
}
} | [
"function",
"(",
"size",
")",
"{",
"this",
".",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"typeof",
"size",
"===",
"'undefined'",
")",
"{",
"return",
";",
"// Empty instance of a bit array",
"}",
"if",
"(",
"typeof",
"size",
"!==",
"'number'",
")",
"{",
"... | Instantiates a bit array with given size.
@param {number} [size = 0] the size of the bit array
@return {void} | [
"Instantiates",
"a",
"bit",
"array",
"with",
"given",
"size",
"."
] | 9565b3c193b93d67ffed39d430eba395a7bb5531 | https://github.com/nickzuber/needle/blob/9565b3c193b93d67ffed39d430eba395a7bb5531/src/BitArray/bitArray.js#L50-L61 | |
46,198 | juttle/juttle-elastic-adapter | lib/query.js | bridge_fetch | function bridge_fetch(size) {
var bridge_time = new JuttleMoment(last_seen_timestamp);
var time_filter = {term: {}};
time_filter.term[timeField] = bridge_time.valueOf();
var body = make_body(filter, null, null, direction, time_filter, size, timeField);
body.from = bridge_offset... | javascript | function bridge_fetch(size) {
var bridge_time = new JuttleMoment(last_seen_timestamp);
var time_filter = {term: {}};
time_filter.term[timeField] = bridge_time.valueOf();
var body = make_body(filter, null, null, direction, time_filter, size, timeField);
body.from = bridge_offset... | [
"function",
"bridge_fetch",
"(",
"size",
")",
"{",
"var",
"bridge_time",
"=",
"new",
"JuttleMoment",
"(",
"last_seen_timestamp",
")",
";",
"var",
"time_filter",
"=",
"{",
"term",
":",
"{",
"}",
"}",
";",
"time_filter",
".",
"term",
"[",
"timeField",
"]",
... | if more than fetchSize events have the same timestamp, we do a "bridge fetch" which pages through all the points with that timestamp | [
"if",
"more",
"than",
"fetchSize",
"events",
"have",
"the",
"same",
"timestamp",
"we",
"do",
"a",
"bridge",
"fetch",
"which",
"pages",
"through",
"all",
"the",
"points",
"with",
"that",
"timestamp"
] | 7b3b1c46943381230bc7dde33874a738a0a50cbe | https://github.com/juttle/juttle-elastic-adapter/blob/7b3b1c46943381230bc7dde33874a738a0a50cbe/lib/query.js#L109-L137 |
46,199 | juttle/juttle-elastic-adapter | lib/query.js | drop_last_time_stamp_and_maybe_bridge_fetch | function drop_last_time_stamp_and_maybe_bridge_fetch(processed, size) {
if (processed.eof) { return processed; }
var last = _.last(processed.points);
last_seen_timestamp = last && last.time;
var non_simultaneous_points = processed.points.filter(function(pt) {
return pt.time ... | javascript | function drop_last_time_stamp_and_maybe_bridge_fetch(processed, size) {
if (processed.eof) { return processed; }
var last = _.last(processed.points);
last_seen_timestamp = last && last.time;
var non_simultaneous_points = processed.points.filter(function(pt) {
return pt.time ... | [
"function",
"drop_last_time_stamp_and_maybe_bridge_fetch",
"(",
"processed",
",",
"size",
")",
"{",
"if",
"(",
"processed",
".",
"eof",
")",
"{",
"return",
"processed",
";",
"}",
"var",
"last",
"=",
"_",
".",
"last",
"(",
"processed",
".",
"points",
")",
"... | takes the output of points_and_eof_from_es_result and removes the points with the last timestamp, triggering a bridge fetch if all the points are simultaneous. This makes sure the next query, which starts at the last timestamp, won't return any duplicates | [
"takes",
"the",
"output",
"of",
"points_and_eof_from_es_result",
"and",
"removes",
"the",
"points",
"with",
"the",
"last",
"timestamp",
"triggering",
"a",
"bridge",
"fetch",
"if",
"all",
"the",
"points",
"are",
"simultaneous",
".",
"This",
"makes",
"sure",
"the"... | 7b3b1c46943381230bc7dde33874a738a0a50cbe | https://github.com/juttle/juttle-elastic-adapter/blob/7b3b1c46943381230bc7dde33874a738a0a50cbe/lib/query.js#L143-L162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.