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,000
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/multi-object-manager.js
function(x, y, settings){ settings = settings || {}; if(settings.filter){ var filter = settings.filter; settings.filter = function(objects){ return objects.filter(filter); }; } var results = this.map.getA...
javascript
function(x, y, settings){ settings = settings || {}; if(settings.filter){ var filter = settings.filter; settings.filter = function(objects){ return objects.filter(filter); }; } var results = this.map.getA...
[ "function", "(", "x", ",", "y", ",", "settings", ")", "{", "settings", "=", "settings", "||", "{", "}", ";", "if", "(", "settings", ".", "filter", ")", "{", "var", "filter", "=", "settings", ".", "filter", ";", "settings", ".", "filter", "=", "func...
Same as `this.map.getAdjacent`, but merges all results into on flat array. @method getAdjacent @param {Number} x - Map tile x coord. @param {Number} y - Map tile y coord; @param {Object} [settings] @return {Array}
[ "Same", "as", "this", ".", "map", ".", "getAdjacent", "but", "merges", "all", "results", "into", "on", "flat", "array", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/multi-object-manager.js#L224-L236
46,001
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/player.js
Player
function Player(game) { this.game = game; this.fov = new RL.FovROT(game); // modify fov to set tiles as explored this.fov.setMapTileVisible = function(x, y, range, visibility){ RL.FovROT.prototype.setMapTileVisible.call(this, x, y, range, visibility); if(visibili...
javascript
function Player(game) { this.game = game; this.fov = new RL.FovROT(game); // modify fov to set tiles as explored this.fov.setMapTileVisible = function(x, y, range, visibility){ RL.FovROT.prototype.setMapTileVisible.call(this, x, y, range, visibility); if(visibili...
[ "function", "Player", "(", "game", ")", "{", "this", ".", "game", "=", "game", ";", "this", ".", "fov", "=", "new", "RL", ".", "FovROT", "(", "game", ")", ";", "// modify fov to set tiles as explored", "this", ".", "fov", ".", "setMapTileVisible", "=", "...
Represents the player. Very similar to Entity Handles functionality triggered by keyboard and mouse Input @class Player @constructor @uses TileDraw @param {Game} game - game instance this obj is attached to
[ "Represents", "the", "player", ".", "Very", "similar", "to", "Entity", "Handles", "functionality", "triggered", "by", "keyboard", "and", "mouse", "Input" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/player.js#L13-L31
46,002
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/player.js
function(){ var x = this.x, y = this.y, fieldRange = this.fovFieldRange, direction = this.fovDirection, maxViewDistance = this.fovMaxViewDistance; this.fov.update(x, y, fieldRange, direction, maxViewDistance, this); }
javascript
function(){ var x = this.x, y = this.y, fieldRange = this.fovFieldRange, direction = this.fovDirection, maxViewDistance = this.fovMaxViewDistance; this.fov.update(x, y, fieldRange, direction, maxViewDistance, this); }
[ "function", "(", ")", "{", "var", "x", "=", "this", ".", "x", ",", "y", "=", "this", ".", "y", ",", "fieldRange", "=", "this", ".", "fovFieldRange", ",", "direction", "=", "this", ".", "fovDirection", ",", "maxViewDistance", "=", "this", ".", "fovMax...
Updates this.fov @method updateFov
[ "Updates", "this", ".", "fov" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/player.js#L144-L151
46,003
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/player.js
function(action) { // if the action is a direction if(RL.Util.DIRECTIONS_4.indexOf(action) !== -1){ var offsetCoord = RL.Util.getOffsetCoordsFromDirection(action), moveToX = this.x + offsetCoord.x, moveToY = this.y + offsetCoord.y; ...
javascript
function(action) { // if the action is a direction if(RL.Util.DIRECTIONS_4.indexOf(action) !== -1){ var offsetCoord = RL.Util.getOffsetCoordsFromDirection(action), moveToX = this.x + offsetCoord.x, moveToY = this.y + offsetCoord.y; ...
[ "function", "(", "action", ")", "{", "// if the action is a direction", "if", "(", "RL", ".", "Util", ".", "DIRECTIONS_4", ".", "indexOf", "(", "action", ")", "!==", "-", "1", ")", "{", "var", "offsetCoord", "=", "RL", ".", "Util", ".", "getOffsetCoordsFro...
Called when user key is pressed with action of key pressed as an arg. @method update @param {String} action - action bound to key pressed by user @return {Bool} true if action was taken.
[ "Called", "when", "user", "key", "is", "pressed", "with", "action", "of", "key", "pressed", "as", "an", "arg", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/player.js#L181-L196
46,004
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/player.js
function(x, y){ if(this.canMoveTo(x, y)){ this.moveTo(x, y); return true; } else { // entity occupying target tile (if any) var targetTileEnt = this.game.entityManager.get(x, y); // if already occupied ...
javascript
function(x, y){ if(this.canMoveTo(x, y)){ this.moveTo(x, y); return true; } else { // entity occupying target tile (if any) var targetTileEnt = this.game.entityManager.get(x, y); // if already occupied ...
[ "function", "(", "x", ",", "y", ")", "{", "if", "(", "this", ".", "canMoveTo", "(", "x", ",", "y", ")", ")", "{", "this", ".", "moveTo", "(", "x", ",", "y", ")", ";", "return", "true", ";", "}", "else", "{", "// entity occupying target tile (if any...
Move action. @method move @param {Number} x - Map tile cood to move to. @param {Number} y - Map tile cood to move to. @return {Bool} true if action was taken.
[ "Move", "action", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/player.js#L205-L223
46,005
jonjomckay/jjgraph
javascript/examples/grapheditor/www/js/EditorUi.js
function(cells, asText) { graph.getModel().beginUpdate(); try { // Applies only basic text styles if (asText) { var edge = graph.getModel().isEdge(cell); var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle; var textStyles = ['fontSize', 'fontFamily', 'fontColor']; ...
javascript
function(cells, asText) { graph.getModel().beginUpdate(); try { // Applies only basic text styles if (asText) { var edge = graph.getModel().isEdge(cell); var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle; var textStyles = ['fontSize', 'fontFamily', 'fontColor']; ...
[ "function", "(", "cells", ",", "asText", ")", "{", "graph", ".", "getModel", "(", ")", ".", "beginUpdate", "(", ")", ";", "try", "{", "// Applies only basic text styles", "if", "(", "asText", ")", "{", "var", "edge", "=", "graph", ".", "getModel", "(", ...
Implements a global current style for edges and vertices that is applied to new cells
[ "Implements", "a", "global", "current", "style", "for", "edges", "and", "vertices", "that", "is", "applied", "to", "new", "cells" ]
f041596ea8cb33e7a47e8c029008f13b31a92469
https://github.com/jonjomckay/jjgraph/blob/f041596ea8cb33e7a47e8c029008f13b31a92469/javascript/examples/grapheditor/www/js/EditorUi.js#L500-L594
46,006
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/fov-rot.js
function(direction){ var coord = RL.Util.getOffsetCoordsFromDirection(direction); return [coord.x, coord.y]; }
javascript
function(direction){ var coord = RL.Util.getOffsetCoordsFromDirection(direction); return [coord.x, coord.y]; }
[ "function", "(", "direction", ")", "{", "var", "coord", "=", "RL", ".", "Util", ".", "getOffsetCoordsFromDirection", "(", "direction", ")", ";", "return", "[", "coord", ".", "x", ",", "coord", ".", "y", "]", ";", "}" ]
Converts a string direction to an rot direction @method directionStringToArray @param {String} direction - Direction of fov (used as default) (not used for fieldRange 360) valid directions: ['up', 'down', 'left', 'right', 'up_left', 'up_right', 'down_left', 'down_right']. @return {Array} [x, y]
[ "Converts", "a", "string", "direction", "to", "an", "rot", "direction" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/fov-rot.js#L89-L92
46,007
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/fov-rot.js
function(x, y, fieldRange, direction, maxViewDistance, entity){ if(fieldRange === void 0){ fieldRange = this.fieldRange; } if(direction === void 0){ direction = this.direction; } if(fieldRange !== 360 && typeof direction === ...
javascript
function(x, y, fieldRange, direction, maxViewDistance, entity){ if(fieldRange === void 0){ fieldRange = this.fieldRange; } if(direction === void 0){ direction = this.direction; } if(fieldRange !== 360 && typeof direction === ...
[ "function", "(", "x", ",", "y", ",", "fieldRange", ",", "direction", ",", "maxViewDistance", ",", "entity", ")", "{", "if", "(", "fieldRange", "===", "void", "0", ")", "{", "fieldRange", "=", "this", ".", "fieldRange", ";", "}", "if", "(", "direction",...
Calculates the fovROT data relative to given coords. @method update @param {Number} x - The map coordinate position to calculate FovROT from on the x axis. @param {Number} y - The map coordinate position to calculate FovROT from on the y axis. @param {Number} [fieldRange = this.fieldRange || 360] - Field Range of view ...
[ "Calculates", "the", "fovROT", "data", "relative", "to", "given", "coords", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/fov-rot.js#L104-L143
46,008
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/fov-rot.js
function(x, y, range, visibility){ this.fovMap.set(x, y, visibility); if(visibility){ var tile = this.game.map.get(x, y); if(tile){ var key = x + ',' + y; // check for duplicates if(this.visibleTileKeys.i...
javascript
function(x, y, range, visibility){ this.fovMap.set(x, y, visibility); if(visibility){ var tile = this.game.map.get(x, y); if(tile){ var key = x + ',' + y; // check for duplicates if(this.visibleTileKeys.i...
[ "function", "(", "x", ",", "y", ",", "range", ",", "visibility", ")", "{", "this", ".", "fovMap", ".", "set", "(", "x", ",", "y", ",", "visibility", ")", ";", "if", "(", "visibility", ")", "{", "var", "tile", "=", "this", ".", "game", ".", "map...
Sets the visibility of a checked map tile @method setMapTileVisible @param {Number} x - The map coord position to set. @param {Number} y - The map coord position to set. @param {Number} range - The distance from this fov origin. @param {Number} visibility - The visibility of this tile coord.
[ "Sets", "the", "visibility", "of", "a", "checked", "map", "tile" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/fov-rot.js#L177-L195
46,009
THEjoezack/BoxPusher
public/js-roguelike-skeleton/manual-src/task.js
function(files, metalsmith, done){ var yuiDocsData = require('../docs/data.json'); var makeUrl = function(docClass, method){ var out = '/docs/classes/' + docClass + '.html'; if(method){ out += '#method_' + method; } ...
javascript
function(files, metalsmith, done){ var yuiDocsData = require('../docs/data.json'); var makeUrl = function(docClass, method){ var out = '/docs/classes/' + docClass + '.html'; if(method){ out += '#method_' + method; } ...
[ "function", "(", "files", ",", "metalsmith", ",", "done", ")", "{", "var", "yuiDocsData", "=", "require", "(", "'../docs/data.json'", ")", ";", "var", "makeUrl", "=", "function", "(", "docClass", ",", "method", ")", "{", "var", "out", "=", "'/docs/classes/...
sets yui docs data to pages with "docs_class" set
[ "sets", "yui", "docs", "data", "to", "pages", "with", "docs_class", "set" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/manual-src/task.js#L64-L107
46,010
jacoborus/deep-json
index.js
function (file) { var folder = path.dirname(file) + '/' + path.basename( file, '.json' ); return fs.existsSync(folder) && isDir(folder) ? folder : false; }
javascript
function (file) { var folder = path.dirname(file) + '/' + path.basename( file, '.json' ); return fs.existsSync(folder) && isDir(folder) ? folder : false; }
[ "function", "(", "file", ")", "{", "var", "folder", "=", "path", ".", "dirname", "(", "file", ")", "+", "'/'", "+", "path", ".", "basename", "(", "file", ",", "'.json'", ")", ";", "return", "fs", ".", "existsSync", "(", "folder", ")", "&&", "isDir"...
return path of folder with same name as .json file if exists
[ "return", "path", "of", "folder", "with", "same", "name", "as", ".", "json", "file", "if", "exists" ]
d41f35cc67b21b87c39da42d264bbdcf891ec93c
https://github.com/jacoborus/deep-json/blob/d41f35cc67b21b87c39da42d264bbdcf891ec93c/index.js#L13-L16
46,011
jacoborus/deep-json
index.js
function (parent) { var elems = fs.readdirSync( parent ), d = { files : [], folders : [] }; // get files and folders paths elems.forEach( function (elem) { var el = parent + '/' + elem; if (!isDir( el )) { d.files.push( el ); } else if (!fs.existsSync( el + '.json')) { // add folder only if ha...
javascript
function (parent) { var elems = fs.readdirSync( parent ), d = { files : [], folders : [] }; // get files and folders paths elems.forEach( function (elem) { var el = parent + '/' + elem; if (!isDir( el )) { d.files.push( el ); } else if (!fs.existsSync( el + '.json')) { // add folder only if ha...
[ "function", "(", "parent", ")", "{", "var", "elems", "=", "fs", ".", "readdirSync", "(", "parent", ")", ",", "d", "=", "{", "files", ":", "[", "]", ",", "folders", ":", "[", "]", "}", ";", "// get files and folders paths", "elems", ".", "forEach", "(...
get the paths of files and folders inside a folder
[ "get", "the", "paths", "of", "files", "and", "folders", "inside", "a", "folder" ]
d41f35cc67b21b87c39da42d264bbdcf891ec93c
https://github.com/jacoborus/deep-json/blob/d41f35cc67b21b87c39da42d264bbdcf891ec93c/index.js#L19-L38
46,012
jacoborus/deep-json
index.js
function (file) { var config = require( file ), namesake = getNamesake( file ); return namesake ? extend( config, getData.folder( namesake )) : config; }
javascript
function (file) { var config = require( file ), namesake = getNamesake( file ); return namesake ? extend( config, getData.folder( namesake )) : config; }
[ "function", "(", "file", ")", "{", "var", "config", "=", "require", "(", "file", ")", ",", "namesake", "=", "getNamesake", "(", "file", ")", ";", "return", "namesake", "?", "extend", "(", "config", ",", "getData", ".", "folder", "(", "namesake", ")", ...
get file data and extend it with folder data of folder with same name
[ "get", "file", "data", "and", "extend", "it", "with", "folder", "data", "of", "folder", "with", "same", "name" ]
d41f35cc67b21b87c39da42d264bbdcf891ec93c
https://github.com/jacoborus/deep-json/blob/d41f35cc67b21b87c39da42d264bbdcf891ec93c/index.js#L44-L49
46,013
jacoborus/deep-json
index.js
function (folder) { var elems = getFolderElements( folder ), result = {}; // files elems.files.forEach( function (route) { // get object name var fileName = path.basename( route, '.json' ); // assign object data from file result[ fileName ] = getData.file( route ); }); // no namesake folders ...
javascript
function (folder) { var elems = getFolderElements( folder ), result = {}; // files elems.files.forEach( function (route) { // get object name var fileName = path.basename( route, '.json' ); // assign object data from file result[ fileName ] = getData.file( route ); }); // no namesake folders ...
[ "function", "(", "folder", ")", "{", "var", "elems", "=", "getFolderElements", "(", "folder", ")", ",", "result", "=", "{", "}", ";", "// files", "elems", ".", "files", ".", "forEach", "(", "function", "(", "route", ")", "{", "// get object name", "var",...
get data from folders and files inside a folder
[ "get", "data", "from", "folders", "and", "files", "inside", "a", "folder" ]
d41f35cc67b21b87c39da42d264bbdcf891ec93c
https://github.com/jacoborus/deep-json/blob/d41f35cc67b21b87c39da42d264bbdcf891ec93c/index.js#L52-L73
46,014
commenthol/debug-level
src/browser.js
Log
function Log (name, opts) { if (!(this instanceof Log)) return new Log(name, opts) const _storage = storage() Object.assign(options, inspectOpts(_storage), inspectNamespaces(_storage) ) options.colors = options.colors === false ? false : supportsColors() LogBase.call(this, name, Object.assign({}, o...
javascript
function Log (name, opts) { if (!(this instanceof Log)) return new Log(name, opts) const _storage = storage() Object.assign(options, inspectOpts(_storage), inspectNamespaces(_storage) ) options.colors = options.colors === false ? false : supportsColors() LogBase.call(this, name, Object.assign({}, o...
[ "function", "Log", "(", "name", ",", "opts", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Log", ")", ")", "return", "new", "Log", "(", "name", ",", "opts", ")", "const", "_storage", "=", "storage", "(", ")", "Object", ".", "assign", "(", ...
creates a new logger for the browser @constructor @param {String} name - namespace of Logger
[ "creates", "a", "new", "logger", "for", "the", "browser" ]
e310fe5452984d898adfb8f924ac6f9021b05457
https://github.com/commenthol/debug-level/blob/e310fe5452984d898adfb8f924ac6f9021b05457/src/browser.js#L82-L96
46,015
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/object-manager.js
ObjectManager
function ObjectManager(game, ObjectConstructor, width, height) { this.game = game; this.ObjectConstructor = ObjectConstructor; this.objects = []; this.map = new RL.Array2d(width, height); }
javascript
function ObjectManager(game, ObjectConstructor, width, height) { this.game = game; this.ObjectConstructor = ObjectConstructor; this.objects = []; this.map = new RL.Array2d(width, height); }
[ "function", "ObjectManager", "(", "game", ",", "ObjectConstructor", ",", "width", ",", "height", ")", "{", "this", ".", "game", "=", "game", ";", "this", ".", "ObjectConstructor", "=", "ObjectConstructor", ";", "this", ".", "objects", "=", "[", "]", ";", ...
Manages a list of all objects and their tile positions. Handles adding, removing, moving objects within the game. @class ObjectManager @constructor @param {Game} game - Game instance this `ObjectManager` is attached to. @param {Object} ObjectConstructor - Object constructor used to create new objects with `this.add()`....
[ "Manages", "a", "list", "of", "all", "objects", "and", "their", "tile", "positions", ".", "Handles", "adding", "removing", "moving", "objects", "within", "the", "game", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/object-manager.js#L14-L19
46,016
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/object-manager.js
function(x, y, obj) { if(typeof obj === 'string'){ obj = this.makeNewObjectFromType(obj); } var existing = this.get(x, y); if(existing){ this.remove(existing); } obj.game = this.game; obj.x = x; ...
javascript
function(x, y, obj) { if(typeof obj === 'string'){ obj = this.makeNewObjectFromType(obj); } var existing = this.get(x, y); if(existing){ this.remove(existing); } obj.game = this.game; obj.x = x; ...
[ "function", "(", "x", ",", "y", ",", "obj", ")", "{", "if", "(", "typeof", "obj", "===", "'string'", ")", "{", "obj", "=", "this", ".", "makeNewObjectFromType", "(", "obj", ")", ";", "}", "var", "existing", "=", "this", ".", "get", "(", "x", ",",...
Adds an object to the manager at given map tile coord. If an object is already at this map tile coord it is removed from the manager completely. @method add @param {Number} x - The tile map coord x. @param {Number} y - The tile map coord y. @param {Object|String} obj - The Object being set at given coords. If obj is a ...
[ "Adds", "an", "object", "to", "the", "manager", "at", "given", "map", "tile", "coord", ".", "If", "an", "object", "is", "already", "at", "this", "map", "tile", "coord", "it", "is", "removed", "from", "the", "manager", "completely", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/object-manager.js#L65-L82
46,017
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/object-manager.js
function(object) { this.map.remove(object.x, object.y); var index = this.objects.indexOf(object); this.objects.splice(index, 1); if(object.onRemove){ object.onRemove(); } }
javascript
function(object) { this.map.remove(object.x, object.y); var index = this.objects.indexOf(object); this.objects.splice(index, 1); if(object.onRemove){ object.onRemove(); } }
[ "function", "(", "object", ")", "{", "this", ".", "map", ".", "remove", "(", "object", ".", "x", ",", "object", ".", "y", ")", ";", "var", "index", "=", "this", ".", "objects", ".", "indexOf", "(", "object", ")", ";", "this", ".", "objects", ".",...
Removes an object from the manager. @method remove @param {Object} object - The objectity to be removed.
[ "Removes", "an", "object", "from", "the", "manager", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/object-manager.js#L89-L96
46,018
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/object-manager.js
function(x, y, object) { var existing = this.get(object.x, object.y); if(existing !== object){ throw new Error({error: 'Attempting to move object not in correct position in Object manager', x: x, y: y, object: object}); } if(this.objects.indexOf(object) =...
javascript
function(x, y, object) { var existing = this.get(object.x, object.y); if(existing !== object){ throw new Error({error: 'Attempting to move object not in correct position in Object manager', x: x, y: y, object: object}); } if(this.objects.indexOf(object) =...
[ "function", "(", "x", ",", "y", ",", "object", ")", "{", "var", "existing", "=", "this", ".", "get", "(", "object", ".", "x", ",", "object", ".", "y", ")", ";", "if", "(", "existing", "!==", "object", ")", "{", "throw", "new", "Error", "(", "{"...
Changes the position of an object already added to this objectManager. @method move @param {Number} x - The destination tile map coord x. @param {Number} y - The destination tile map coord y. @param {Obj} object - The objectity to be removed.
[ "Changes", "the", "position", "of", "an", "object", "already", "added", "to", "this", "objectManager", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/object-manager.js#L105-L118
46,019
nodeca/plurals-cldr
support/generate.js
toSingleRule
function toSingleRule(str) { return str // replace modulus with shortcuts .replace(/([nivwft]) % (\d+)/g, '$1$2') // replace ranges .replace(/([nivwft]\d*) (=|\!=) (\d+[.,][.,\d]+)/g, function (match, v, cond, range) { // range = 5,8,9 (simple set) if (range.indexOf('..') < 0 && range.ind...
javascript
function toSingleRule(str) { return str // replace modulus with shortcuts .replace(/([nivwft]) % (\d+)/g, '$1$2') // replace ranges .replace(/([nivwft]\d*) (=|\!=) (\d+[.,][.,\d]+)/g, function (match, v, cond, range) { // range = 5,8,9 (simple set) if (range.indexOf('..') < 0 && range.ind...
[ "function", "toSingleRule", "(", "str", ")", "{", "return", "str", "// replace modulus with shortcuts", ".", "replace", "(", "/", "([nivwft]) % (\\d+)", "/", "g", ",", "'$1$2'", ")", "// replace ranges", ".", "replace", "(", "/", "([nivwft]\\d*) (=|\\!=) (\\d+[.,][.,\...
Create equation for single form rule
[ "Create", "equation", "for", "single", "form", "rule" ]
d93a4f130d0610605ff76761ef8e6abd4271639d
https://github.com/nodeca/plurals-cldr/blob/d93a4f130d0610605ff76761ef8e6abd4271639d/support/generate.js#L92-L133
46,020
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(game, settings){ this.game = game; settings = settings || {}; this.x = settings.x || this.x; this.y = settings.y || this.y; this.limitToFov = setting...
javascript
function(game, settings){ this.game = game; settings = settings || {}; this.x = settings.x || this.x; this.y = settings.y || this.y; this.limitToFov = setting...
[ "function", "(", "game", ",", "settings", ")", "{", "this", ".", "game", "=", "game", ";", "settings", "=", "settings", "||", "{", "}", ";", "this", ".", "x", "=", "settings", ".", "x", "||", "this", ".", "x", ";", "this", ".", "y", "=", "setti...
Gets a list of valid targets filtered by provided criteria. @class ValidTargetsFinder @constructor @param {Game} game @param {Object} settings @param {Number} settings.x - The x map tile coord to use as the origin of the attack. @param {Number} settings.y ...
[ "Gets", "a", "list", "of", "valid", "targets", "filtered", "by", "provided", "criteria", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L21-L36
46,021
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(){ var tiles = this.getValidTargetTiles(); var result = []; for (var i = 0; i < tiles.length; i++) { var tile = tiles[i]; var targets = this.getValidTargetsAtPosition(tile.x, tile.y); result = result.concat(targets); ...
javascript
function(){ var tiles = this.getValidTargetTiles(); var result = []; for (var i = 0; i < tiles.length; i++) { var tile = tiles[i]; var targets = this.getValidTargetsAtPosition(tile.x, tile.y); result = result.concat(targets); ...
[ "function", "(", ")", "{", "var", "tiles", "=", "this", ".", "getValidTargetTiles", "(", ")", ";", "var", "result", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "tiles", ".", "length", ";", "i", "++", ")", "{", "var", ...
Gets all valid targets. @method getValidTargets @return {Array}
[ "Gets", "all", "valid", "targets", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L125-L137
46,022
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(){ var tiles = []; if(this.limitToFov){ var fovTiles = this.limitToFov.visibleTiles; for (var i = 0; i < fovTiles.length; i++) { var fovTile = fovTiles[i]; // if no max range, if there is a max range check it ...
javascript
function(){ var tiles = []; if(this.limitToFov){ var fovTiles = this.limitToFov.visibleTiles; for (var i = 0; i < fovTiles.length; i++) { var fovTile = fovTiles[i]; // if no max range, if there is a max range check it ...
[ "function", "(", ")", "{", "var", "tiles", "=", "[", "]", ";", "if", "(", "this", ".", "limitToFov", ")", "{", "var", "fovTiles", "=", "this", ".", "limitToFov", ".", "visibleTiles", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "fovTiles...
Get tile coords a valid target may be on. Only checking range and fov, not objects on the tile. @method getValidTargetTiles @return {Array} of Tile objects
[ "Get", "tile", "coords", "a", "valid", "target", "may", "be", "on", ".", "Only", "checking", "range", "and", "fov", "not", "objects", "on", "the", "tile", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L144-L184
46,023
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(x, y){ var objects = this.game.getObjectsAtPostion(x, y); var range = RL.Util.getDistance(this.x, this.y, x, y); var _this = this; var filtered = objects.filter(function(target){ return _this.checkValidTarget(target); }); ...
javascript
function(x, y){ var objects = this.game.getObjectsAtPostion(x, y); var range = RL.Util.getDistance(this.x, this.y, x, y); var _this = this; var filtered = objects.filter(function(target){ return _this.checkValidTarget(target); }); ...
[ "function", "(", "x", ",", "y", ")", "{", "var", "objects", "=", "this", ".", "game", ".", "getObjectsAtPostion", "(", "x", ",", "y", ")", ";", "var", "range", "=", "RL", ".", "Util", ".", "getDistance", "(", "this", ".", "x", ",", "this", ".", ...
Get valid target objects on a tile coord. @method getValidTargetsAtPosition @param {Number} x - Map tile coord to get valid target objects from. @param {Number} y - Map tile coord to get valid target objects from. @return {Array} mixed objects
[ "Get", "valid", "target", "objects", "on", "a", "tile", "coord", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L193-L204
46,024
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(target, x, y, range){ x = x || target.x; y = y || target.y; range = range || RL.Util.getDistance(this.x, this.y, x, y); return { x: x, y: y, range: range, value: target }; }
javascript
function(target, x, y, range){ x = x || target.x; y = y || target.y; range = range || RL.Util.getDistance(this.x, this.y, x, y); return { x: x, y: y, range: range, value: target }; }
[ "function", "(", "target", ",", "x", ",", "y", ",", "range", ")", "{", "x", "=", "x", "||", "target", ".", "x", ";", "y", "=", "y", "||", "target", ".", "y", ";", "range", "=", "range", "||", "RL", ".", "Util", ".", "getDistance", "(", "this"...
Wraps a target object in a container object with x, y, range @method prepareTargetObject @param {Object} target @param {Number} [x=target.x] @param {Number} [y=target.y] @param {Number} [range] range from `this.x`, `this.y` to x,y @return {Object} result result object ` return { x: x, // target x tile coord y: y, // ta...
[ "Wraps", "a", "target", "object", "in", "a", "container", "object", "with", "x", "y", "range" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L227-L237
46,025
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(target){ // skip valid type check if value evaluating to false or empty array. if(!this.validTypes || !this.validTypes.length){ return true; } for(var i = this.validTypes.length - 1; i >= 0; i--){ var type = this.validTypes[i]; ...
javascript
function(target){ // skip valid type check if value evaluating to false or empty array. if(!this.validTypes || !this.validTypes.length){ return true; } for(var i = this.validTypes.length - 1; i >= 0; i--){ var type = this.validTypes[i]; ...
[ "function", "(", "target", ")", "{", "// skip valid type check if value evaluating to false or empty array.", "if", "(", "!", "this", ".", "validTypes", "||", "!", "this", ".", "validTypes", ".", "length", ")", "{", "return", "true", ";", "}", "for", "(", "var",...
Checks if a target object is an instance of a type in `this.validTypes`. @method checkValidType @param {Object} target - The target to be checked. @return {Bool} `true` if valid.
[ "Checks", "if", "a", "target", "object", "is", "an", "instance", "of", "a", "type", "in", "this", ".", "validTypes", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L245-L260
46,026
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/valid-targets-finder.js
function(target){ if(this.exclude){ if(target === this.exclude){ return false; } // if exclude is array and target is in it if(Object.isArray(this.exclude) && this.exclude.indexOf(target) !== -1){ return ...
javascript
function(target){ if(this.exclude){ if(target === this.exclude){ return false; } // if exclude is array and target is in it if(Object.isArray(this.exclude) && this.exclude.indexOf(target) !== -1){ return ...
[ "function", "(", "target", ")", "{", "if", "(", "this", ".", "exclude", ")", "{", "if", "(", "target", "===", "this", ".", "exclude", ")", "{", "return", "false", ";", "}", "// if exclude is array and target is in it", "if", "(", "Object", ".", "isArray", ...
Checks if an object is a valid target for this action. @method checkValidTarget @param {Object} target - The target to be checked. @return {Bool} `true` if valid.
[ "Checks", "if", "an", "object", "is", "a", "valid", "target", "for", "this", "action", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/valid-targets-finder.js#L268-L286
46,027
wilmoore/uuid-regexp.js
index.js
re
function re (opts) { opts = opts || {} return new RegExp( format('\\b(?:%s)\\b', regexp.versioned.source + (opts.nil ? '|' + regexp.nil.source : '')), 'i' + (opts.flags || '') ) }
javascript
function re (opts) { opts = opts || {} return new RegExp( format('\\b(?:%s)\\b', regexp.versioned.source + (opts.nil ? '|' + regexp.nil.source : '')), 'i' + (opts.flags || '') ) }
[ "function", "re", "(", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", "return", "new", "RegExp", "(", "format", "(", "'\\\\b(?:%s)\\\\b'", ",", "regexp", ".", "versioned", ".", "source", "+", "(", "opts", ".", "nil", "?", "'|'", "+", "regexp"...
RegExp for finding an RFC4122 compliant UUID in a string. @param {Object} opts Options object. @param {String} [opts.flags] Additional RegExp flags ('i' is always set). @param {Boolean} [opts.nil] Whether to include the nil/empty UUID pattern. @return {RegExp} RegExp for finding an RFC4122 compliant UUID in a strin...
[ "RegExp", "for", "finding", "an", "RFC4122", "compliant", "UUID", "in", "a", "string", "." ]
674d65e5e371d7c126a58a09281e8e21ee503e9a
https://github.com/wilmoore/uuid-regexp.js/blob/674d65e5e371d7c126a58a09281e8e21ee503e9a/index.js#L32-L39
46,028
75lb/object-get
lib/object-get.js
objectGet
function objectGet (object, expression) { if (!(object && expression)) throw new Error('both object and expression args are required') return expression.trim().split('.').reduce(function (prev, curr) { var arr = curr.match(/(.*?)\[(.*?)\]/) if (arr) { return prev && prev[arr[1]][arr[2]] } else { ...
javascript
function objectGet (object, expression) { if (!(object && expression)) throw new Error('both object and expression args are required') return expression.trim().split('.').reduce(function (prev, curr) { var arr = curr.match(/(.*?)\[(.*?)\]/) if (arr) { return prev && prev[arr[1]][arr[2]] } else { ...
[ "function", "objectGet", "(", "object", ",", "expression", ")", "{", "if", "(", "!", "(", "object", "&&", "expression", ")", ")", "throw", "new", "Error", "(", "'both object and expression args are required'", ")", "return", "expression", ".", "trim", "(", ")"...
Returns the value at the given property. @param {object} - the input object @param {string} - the property accessor expression. @returns {*} @alias module:object-get @example > objectGet({ animal: 'cow' }, 'animal') 'cow' > objectGet({ animal: { mood: 'lazy' } }, 'animal') { mood: 'lazy' } > objectGet({ animal: { mo...
[ "Returns", "the", "value", "at", "the", "given", "property", "." ]
67fe4b92af9a3f3311e90c9a89d35f24a956e5df
https://github.com/75lb/object-get/blob/67fe4b92af9a3f3311e90c9a89d35f24a956e5df/lib/object-get.js#L44-L54
46,029
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/input.js
Input
function Input(onKeyAction, bindings) { this.bindings = {}; if (onKeyAction !== void 0) { this.onKeyAction = onKeyAction; } if (bindings !== void 0) { this.addBindings(bindings); } this.startListening(); }
javascript
function Input(onKeyAction, bindings) { this.bindings = {}; if (onKeyAction !== void 0) { this.onKeyAction = onKeyAction; } if (bindings !== void 0) { this.addBindings(bindings); } this.startListening(); }
[ "function", "Input", "(", "onKeyAction", ",", "bindings", ")", "{", "this", ".", "bindings", "=", "{", "}", ";", "if", "(", "onKeyAction", "!==", "void", "0", ")", "{", "this", ".", "onKeyAction", "=", "onKeyAction", ";", "}", "if", "(", "bindings", ...
Helper for binding user key input to actions. @class Input @constructor @param {Function} onKeyAction - Function called when a key bound to an action is pressed (function(action){}). @param {Object} bindings - An object of key val pairs mapping an action to an array of keys that trigger it. Input.Keys is used to conver...
[ "Helper", "for", "binding", "user", "key", "input", "to", "actions", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/input.js#L22-L31
46,030
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/input.js
function(bindings) { for (var action in bindings) { var keys = bindings[action]; for (var i = 0; i < keys.length; i++) { var key = keys[i]; this.bindAction(action, key); } } }
javascript
function(bindings) { for (var action in bindings) { var keys = bindings[action]; for (var i = 0; i < keys.length; i++) { var key = keys[i]; this.bindAction(action, key); } } }
[ "function", "(", "bindings", ")", "{", "for", "(", "var", "action", "in", "bindings", ")", "{", "var", "keys", "=", "bindings", "[", "action", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "i", "++", ")"...
Loads multiple action key bindings @method addBindings @param {Object} bindings - An object of key val pairs mapping an action to an array of keys that trigger it. Input.Keys is used to convert input key string names to key codes. @param bindings.action1 {Array} Input keys mapped to action1. ['A', 'B', ...] @param bind...
[ "Loads", "multiple", "action", "key", "bindings" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/input.js#L91-L99
46,031
sergeyt/fetch-stream
src/index.js
pump
function pump(reader, handler) { reader.read().then(result => { if (result.done) { return; } if (handler(result.value) === false) { // cancelling return; } pump(reader, handler); }); }
javascript
function pump(reader, handler) { reader.read().then(result => { if (result.done) { return; } if (handler(result.value) === false) { // cancelling return; } pump(reader, handler); }); }
[ "function", "pump", "(", "reader", ",", "handler", ")", "{", "reader", ".", "read", "(", ")", ".", "then", "(", "result", "=>", "{", "if", "(", "result", ".", "done", ")", "{", "return", ";", "}", "if", "(", "handler", "(", "result", ".", "value"...
reads all chunks
[ "reads", "all", "chunks" ]
eab91c059ce3b1d172fd44890769c761bb4b7aa3
https://github.com/sergeyt/fetch-stream/blob/eab91c059ce3b1d172fd44890769c761bb4b7aa3/src/index.js#L13-L24
46,032
nodeca/event-wire
index.js
_hook
function _hook(slf, name, handlerInfo, params) { if (!slf.__hooks[name]) return; slf.__hooks[name].forEach(function (hook) { hook(handlerInfo, params); }); }
javascript
function _hook(slf, name, handlerInfo, params) { if (!slf.__hooks[name]) return; slf.__hooks[name].forEach(function (hook) { hook(handlerInfo, params); }); }
[ "function", "_hook", "(", "slf", ",", "name", ",", "handlerInfo", ",", "params", ")", "{", "if", "(", "!", "slf", ".", "__hooks", "[", "name", "]", ")", "return", ";", "slf", ".", "__hooks", "[", "name", "]", ".", "forEach", "(", "function", "(", ...
Helper to run hooks
[ "Helper", "to", "run", "hooks" ]
ae8d1e419bf20991ac716248914f688f1e2f6322
https://github.com/nodeca/event-wire/blob/ae8d1e419bf20991ac716248914f688f1e2f6322/index.js#L214-L220
46,033
nodeca/event-wire
index.js
wrap_cb
function wrap_cb(fn, P) { return function (params) { return new P(function (resolve, reject) { fn(params, function (err) { return !err ? resolve() : reject(err); }); }); }; }
javascript
function wrap_cb(fn, P) { return function (params) { return new P(function (resolve, reject) { fn(params, function (err) { return !err ? resolve() : reject(err); }); }); }; }
[ "function", "wrap_cb", "(", "fn", ",", "P", ")", "{", "return", "function", "(", "params", ")", "{", "return", "new", "P", "(", "function", "(", "resolve", ",", "reject", ")", "{", "fn", "(", "params", ",", "function", "(", "err", ")", "{", "return...
Wrap handler with callback
[ "Wrap", "handler", "with", "callback" ]
ae8d1e419bf20991ac716248914f688f1e2f6322
https://github.com/nodeca/event-wire/blob/ae8d1e419bf20991ac716248914f688f1e2f6322/index.js#L246-L252
46,034
nodeca/event-wire
index.js
finalizeHandler
function finalizeHandler(p, hInfo) { if (!p) return; return p .catch(storeErrOnce) .then(function () { if (errored && !hInfo.ensure) return null; _hook(self, 'eachAfter', hInfo, params); }) .catch(storeErrOnce); }
javascript
function finalizeHandler(p, hInfo) { if (!p) return; return p .catch(storeErrOnce) .then(function () { if (errored && !hInfo.ensure) return null; _hook(self, 'eachAfter', hInfo, params); }) .catch(storeErrOnce); }
[ "function", "finalizeHandler", "(", "p", ",", "hInfo", ")", "{", "if", "(", "!", "p", ")", "return", ";", "return", "p", ".", "catch", "(", "storeErrOnce", ")", ".", "then", "(", "function", "(", ")", "{", "if", "(", "errored", "&&", "!", "hInfo", ...
Finalize handler exec - should care about errors and post-hooks.
[ "Finalize", "handler", "exec", "-", "should", "care", "about", "errors", "and", "post", "-", "hooks", "." ]
ae8d1e419bf20991ac716248914f688f1e2f6322
https://github.com/nodeca/event-wire/blob/ae8d1e419bf20991ac716248914f688f1e2f6322/index.js#L303-L313
46,035
sergeyt/fetch-stream
lib/index.js
fetchStream
function fetchStream() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var callback = arguments[1]; var cb = callback; var stream = null; if (cb === undefined) { stream = makeStream(); cb = stream.handler; } var url = typeof options === 'string' ? options : options.u...
javascript
function fetchStream() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var callback = arguments[1]; var cb = callback; var stream = null; if (cb === undefined) { stream = makeStream(); cb = stream.handler; } var url = typeof options === 'string' ? options : options.u...
[ "function", "fetchStream", "(", ")", "{", "var", "options", "=", "arguments", ".", "length", "<=", "0", "||", "arguments", "[", "0", "]", "===", "undefined", "?", "{", "}", ":", "arguments", "[", "0", "]", ";", "var", "callback", "=", "arguments", "[...
Fetches resource stream. @param {object} [options] URL or options of request. @param {function} [callback] The callback to process each chunk in the stream.
[ "Fetches", "resource", "stream", "." ]
eab91c059ce3b1d172fd44890769c761bb4b7aa3
https://github.com/sergeyt/fetch-stream/blob/eab91c059ce3b1d172fd44890769c761bb4b7aa3/lib/index.js#L94-L146
46,036
ahmed-dinar/codeforces-api-node
src/codeforces.js
callApi
function callApi(method, parameters, callback) { if (typeof parameters === 'undefined') { throw new Error('undefined is not a valid parameters object.'); } if( typeof parameters !== 'object' ){ throw new Error('valid parameters object required.'); } var opts = this.options; v...
javascript
function callApi(method, parameters, callback) { if (typeof parameters === 'undefined') { throw new Error('undefined is not a valid parameters object.'); } if( typeof parameters !== 'object' ){ throw new Error('valid parameters object required.'); } var opts = this.options; v...
[ "function", "callApi", "(", "method", ",", "parameters", ",", "callback", ")", "{", "if", "(", "typeof", "parameters", "===", "'undefined'", ")", "{", "throw", "new", "Error", "(", "'undefined is not a valid parameters object.'", ")", ";", "}", "if", "(", "typ...
Send request to api @param {string} method - method of API request. @param {object} parameters - API url parameters @param {function} callback @returns {*}
[ "Send", "request", "to", "api" ]
2f85a6d833b32012adbf87440b2c16aeb4c167f7
https://github.com/ahmed-dinar/codeforces-api-node/blob/2f85a6d833b32012adbf87440b2c16aeb4c167f7/src/codeforces.js#L98-L144
46,037
ahmed-dinar/codeforces-api-node
src/codeforces.js
handleCallback
function handleCallback(callback, err, httpResponse, body) { if(err){ return callback(err); } // // API returns error // if( body.status !== 'OK' ){ return callback(new Error(body.comment)); } return callback(null, body.result); }
javascript
function handleCallback(callback, err, httpResponse, body) { if(err){ return callback(err); } // // API returns error // if( body.status !== 'OK' ){ return callback(new Error(body.comment)); } return callback(null, body.result); }
[ "function", "handleCallback", "(", "callback", ",", "err", ",", "httpResponse", ",", "body", ")", "{", "if", "(", "err", ")", "{", "return", "callback", "(", "err", ")", ";", "}", "//", "// API returns error", "//", "if", "(", "body", ".", "status", "!...
Handle user callback @param callback - user callback @param err - request errors @param httpResponse - request HTTP response @param body - request response body @returns {*}
[ "Handle", "user", "callback" ]
2f85a6d833b32012adbf87440b2c16aeb4c167f7
https://github.com/ahmed-dinar/codeforces-api-node/blob/2f85a6d833b32012adbf87440b2c16aeb4c167f7/src/codeforces.js#L156-L170
46,038
ahmed-dinar/codeforces-api-node
src/codeforces.js
makeApiUrl
function makeApiUrl(options,parameters) { var query = parameters; // // If any parameter given in array, make it string separated by semicolon(;) // for(let key in query){ if( _.isArray(query[key]) ){ query[key] = _.join(query[key],';'); } } let curTime = Math....
javascript
function makeApiUrl(options,parameters) { var query = parameters; // // If any parameter given in array, make it string separated by semicolon(;) // for(let key in query){ if( _.isArray(query[key]) ){ query[key] = _.join(query[key],';'); } } let curTime = Math....
[ "function", "makeApiUrl", "(", "options", ",", "parameters", ")", "{", "var", "query", "=", "parameters", ";", "//", "// If any parameter given in array, make it string separated by semicolon(;)", "//", "for", "(", "let", "key", "in", "query", ")", "{", "if", "(", ...
Generate API url according to CF API rules @param {array} options - main class options @param {array} parameters - API url parameters [see doc] @returns {string} - final url
[ "Generate", "API", "url", "according", "to", "CF", "API", "rules" ]
2f85a6d833b32012adbf87440b2c16aeb4c167f7
https://github.com/ahmed-dinar/codeforces-api-node/blob/2f85a6d833b32012adbf87440b2c16aeb4c167f7/src/codeforces.js#L192-L235
46,039
Lanfei/websocket-lib
lib/server.js
ServerSession
function ServerSession(request, socket, head, server) { Session.call(this, request, socket, head); this._resHeaders = {}; this._headerSent = false; /** * The server instance of this session. * @type {Server} */ this.server = server; /** * The HTTP status code of handshake. * @type {Number} * @de...
javascript
function ServerSession(request, socket, head, server) { Session.call(this, request, socket, head); this._resHeaders = {}; this._headerSent = false; /** * The server instance of this session. * @type {Server} */ this.server = server; /** * The HTTP status code of handshake. * @type {Number} * @de...
[ "function", "ServerSession", "(", "request", ",", "socket", ",", "head", ",", "server", ")", "{", "Session", ".", "call", "(", "this", ",", "request", ",", "socket", ",", "head", ")", ";", "this", ".", "_resHeaders", "=", "{", "}", ";", "this", ".", ...
WebSocket Server Session @constructor @extends Session @param {IncomingMessage} request see {@link Session#request} @param {Socket} socket see {@link Session#socket} @param {Buffer} [head] Data that received with headers. @param {Server} [server] see {@link ServerSession#ser...
[ "WebSocket", "Server", "Session" ]
d39f704490fb91b1e2897712b280c0e5ac79e123
https://github.com/Lanfei/websocket-lib/blob/d39f704490fb91b1e2897712b280c0e5ac79e123/lib/server.js#L227-L251
46,040
martinj/node-async-queue
async-queue.js
function (job) { if (job) { if (arguments.length > 1) { this.jobs = this.jobs.concat(Array.prototype.slice.call(arguments)); } else { this.jobs.push(job); } } return this; }
javascript
function (job) { if (job) { if (arguments.length > 1) { this.jobs = this.jobs.concat(Array.prototype.slice.call(arguments)); } else { this.jobs.push(job); } } return this; }
[ "function", "(", "job", ")", "{", "if", "(", "job", ")", "{", "if", "(", "arguments", ".", "length", ">", "1", ")", "{", "this", ".", "jobs", "=", "this", ".", "jobs", ".", "concat", "(", "Array", ".", "prototype", ".", "slice", ".", "call", "(...
Add job to the queue @param {Function} job
[ "Add", "job", "to", "the", "queue" ]
2b3870020611babbf2c4851c9b51da780da056eb
https://github.com/martinj/node-async-queue/blob/2b3870020611babbf2c4851c9b51da780da056eb/async-queue.js#L37-L46
46,041
martinj/node-async-queue
async-queue.js
function (err) { if (this.jobs.length) { var job = this.jobs.shift(); try { job(err, this); } catch (e) { this.next(e); } } else { this.running = false; } }
javascript
function (err) { if (this.jobs.length) { var job = this.jobs.shift(); try { job(err, this); } catch (e) { this.next(e); } } else { this.running = false; } }
[ "function", "(", "err", ")", "{", "if", "(", "this", ".", "jobs", ".", "length", ")", "{", "var", "job", "=", "this", ".", "jobs", ".", "shift", "(", ")", ";", "try", "{", "job", "(", "err", ",", "this", ")", ";", "}", "catch", "(", "e", ")...
Run the next job in queue @private @param {Object} err
[ "Run", "the", "next", "job", "in", "queue" ]
2b3870020611babbf2c4851c9b51da780da056eb
https://github.com/martinj/node-async-queue/blob/2b3870020611babbf2c4851c9b51da780da056eb/async-queue.js#L98-L109
46,042
juttle/juttle-elastic-adapter
lib/utils.js
index_date
function index_date(timestamp, interval) { function double_digitize(str) { return (str.length === 1) ? ('0' + str) : str; } var year = timestamp.getUTCFullYear(); var month = (timestamp.getUTCMonth() + 1).toString(); switch (interval) { case 'day': var day = timestamp.g...
javascript
function index_date(timestamp, interval) { function double_digitize(str) { return (str.length === 1) ? ('0' + str) : str; } var year = timestamp.getUTCFullYear(); var month = (timestamp.getUTCMonth() + 1).toString(); switch (interval) { case 'day': var day = timestamp.g...
[ "function", "index_date", "(", "timestamp", ",", "interval", ")", "{", "function", "double_digitize", "(", "str", ")", "{", "return", "(", "str", ".", "length", "===", "1", ")", "?", "(", "'0'", "+", "str", ")", ":", "str", ";", "}", "var", "year", ...
YYYY.MM.dd
[ "YYYY", ".", "MM", ".", "dd" ]
7b3b1c46943381230bc7dde33874a738a0a50cbe
https://github.com/juttle/juttle-elastic-adapter/blob/7b3b1c46943381230bc7dde33874a738a0a50cbe/lib/utils.js#L40-L69
46,043
nickzuber/needle
src/BinarySearchTree/binarySearchTree.js
deleteHelper
function deleteHelper (data, node, nodeType, parentNode) { if (node === null) { return false; } // @TODO handle object comparisons -- doing a stringify is horrible dont do that if (data === node.data) { if (nodeType === Types.RIGHT) { parentNode.right = null; } else { parentNode.left = ...
javascript
function deleteHelper (data, node, nodeType, parentNode) { if (node === null) { return false; } // @TODO handle object comparisons -- doing a stringify is horrible dont do that if (data === node.data) { if (nodeType === Types.RIGHT) { parentNode.right = null; } else { parentNode.left = ...
[ "function", "deleteHelper", "(", "data", ",", "node", ",", "nodeType", ",", "parentNode", ")", "{", "if", "(", "node", "===", "null", ")", "{", "return", "false", ";", "}", "// @TODO handle object comparisons -- doing a stringify is horrible dont do that", "if", "("...
Deletes a node from the tree with the value of `data`. @param {any} data The data of the node to delete. @param {Node} node The current node being analyzed. @param {Node} nodeType The type of child of the current node being analyzed. @param {Node} parentNode The last node that was analyzed. @return {...
[ "Deletes", "a", "node", "from", "the", "tree", "with", "the", "value", "of", "data", "." ]
9565b3c193b93d67ffed39d430eba395a7bb5531
https://github.com/nickzuber/needle/blob/9565b3c193b93d67ffed39d430eba395a7bb5531/src/BinarySearchTree/binarySearchTree.js#L231-L262
46,044
THEjoezack/BoxPusher
public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js
function(direction){ var directionCoords = { up: {x: 0, y:-1}, right: {x: 1, y: 0}, down: {x: 0, y: 1}, left: {x:-1, y: 0} }; return directionCoords[direction]; }
javascript
function(direction){ var directionCoords = { up: {x: 0, y:-1}, right: {x: 1, y: 0}, down: {x: 0, y: 1}, left: {x:-1, y: 0} }; return directionCoords[direction]; }
[ "function", "(", "direction", ")", "{", "var", "directionCoords", "=", "{", "up", ":", "{", "x", ":", "0", ",", "y", ":", "-", "1", "}", ",", "right", ":", "{", "x", ":", "1", ",", "y", ":", "0", "}", ",", "down", ":", "{", "x", ":", "0",...
Gets the adjustment coord from a direction string. @method directionToAdjustCoord @param {String} direction - The current direction. @return {Object} {x: 0, y: 0}
[ "Gets", "the", "adjustment", "coord", "from", "a", "direction", "string", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js#L21-L29
46,045
THEjoezack/BoxPusher
public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js
function(currentDirection){ var directions = ['up', 'right', 'down', 'left'], currentDirIndex = directions.indexOf(currentDirection), newDirIndex; // if currentDirection is not valid or is the last in the array use the first direction in the array if(c...
javascript
function(currentDirection){ var directions = ['up', 'right', 'down', 'left'], currentDirIndex = directions.indexOf(currentDirection), newDirIndex; // if currentDirection is not valid or is the last in the array use the first direction in the array if(c...
[ "function", "(", "currentDirection", ")", "{", "var", "directions", "=", "[", "'up'", ",", "'right'", ",", "'down'", ",", "'left'", "]", ",", "currentDirIndex", "=", "directions", ".", "indexOf", "(", "currentDirection", ")", ",", "newDirIndex", ";", "// if ...
Gets the next direction in the list @method getNextDirection @param {String} direction - The current direction. @return {String}
[ "Gets", "the", "next", "direction", "in", "the", "list" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js#L37-L48
46,046
THEjoezack/BoxPusher
public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js
function(x, y) { // remove light from current position if(this.game.lighting.get(this.x, this.y)){ this.game.lighting.remove(this.x, this.y); } // add to new position this.game.lighting.set(x, y, this.light_r, this.light_g, this.light_b); ...
javascript
function(x, y) { // remove light from current position if(this.game.lighting.get(this.x, this.y)){ this.game.lighting.remove(this.x, this.y); } // add to new position this.game.lighting.set(x, y, this.light_r, this.light_g, this.light_b); ...
[ "function", "(", "x", ",", "y", ")", "{", "// remove light from current position", "if", "(", "this", ".", "game", ".", "lighting", ".", "get", "(", "this", ".", "x", ",", "this", ".", "y", ")", ")", "{", "this", ".", "game", ".", "lighting", ".", ...
Changes the position of this entity on the map. @method moveTo @param {Number} x - The tile map x coord to move to. @param {Number} y - The tile map y coord to move to.
[ "Changes", "the", "position", "of", "this", "entity", "on", "the", "map", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/manual/index/entity/js/basic-movement.js#L84-L93
46,047
overtrue/validator.js
lib/validator.js
extend
function extend() { var src, copy, name, options, clone; var target = arguments[0] || {}; var i = 1; var length = arguments.length; for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object ...
javascript
function extend() { var src, copy, name, options, clone; var target = arguments[0] || {}; var i = 1; var length = arguments.length; for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object ...
[ "function", "extend", "(", ")", "{", "var", "src", ",", "copy", ",", "name", ",", "options", ",", "clone", ";", "var", "target", "=", "arguments", "[", "0", "]", "||", "{", "}", ";", "var", "i", "=", "1", ";", "var", "length", "=", "arguments", ...
Based on jquery's extend function
[ "Based", "on", "jquery", "s", "extend", "function" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L97-L133
46,048
overtrue/validator.js
lib/validator.js
_explodeRules
function _explodeRules(rules) { for (var i in rules) { if (is_string(rules[i])) { rules[i] = rules[i].split('|'); } } return rules; }
javascript
function _explodeRules(rules) { for (var i in rules) { if (is_string(rules[i])) { rules[i] = rules[i].split('|'); } } return rules; }
[ "function", "_explodeRules", "(", "rules", ")", "{", "for", "(", "var", "i", "in", "rules", ")", "{", "if", "(", "is_string", "(", "rules", "[", "i", "]", ")", ")", "{", "rules", "[", "i", "]", "=", "rules", "[", "i", "]", ".", "split", "(", ...
explode the rules into an array of rules. @return {Void}
[ "explode", "the", "rules", "into", "an", "array", "of", "rules", "." ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L211-L218
46,049
overtrue/validator.js
lib/validator.js
_parseRule
function _parseRule(rule) { var parameters = []; // The format for specifying validation rules and parameters follows an // easy {rule}:{parameters} formatting convention. For instance the // rule "Max:3" states that the value may only be three letters. if (rule.indexOf(':')) { var ruleInfo ...
javascript
function _parseRule(rule) { var parameters = []; // The format for specifying validation rules and parameters follows an // easy {rule}:{parameters} formatting convention. For instance the // rule "Max:3" states that the value may only be three letters. if (rule.indexOf(':')) { var ruleInfo ...
[ "function", "_parseRule", "(", "rule", ")", "{", "var", "parameters", "=", "[", "]", ";", "// The format for specifying validation rules and parameters follows an", "// easy {rule}:{parameters} formatting convention. For instance the", "// rule \"Max:3\" states that the value may only be...
parse the rule @param {Array} rule @return {Object}
[ "parse", "the", "rule" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L227-L239
46,050
overtrue/validator.js
lib/validator.js
_parseParameters
function _parseParameters(rule, parameter) { if (rule.toLowerCase() == 'regex') return [parameter]; if (is_string(parameter)) { return parameter.split(','); }; return []; }
javascript
function _parseParameters(rule, parameter) { if (rule.toLowerCase() == 'regex') return [parameter]; if (is_string(parameter)) { return parameter.split(','); }; return []; }
[ "function", "_parseParameters", "(", "rule", ",", "parameter", ")", "{", "if", "(", "rule", ".", "toLowerCase", "(", ")", "==", "'regex'", ")", "return", "[", "parameter", "]", ";", "if", "(", "is_string", "(", "parameter", ")", ")", "{", "return", "pa...
parse parameters of rule @param {String} rule @param {String} parameter @return {Array}
[ "parse", "parameters", "of", "rule" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L249-L256
46,051
overtrue/validator.js
lib/validator.js
_addFailure
function _addFailure(attribute, rule, parameters) { _addError(attribute, rule, parameters); if (! _failedRules[attribute]) { _failedRules[attribute] = {}; } _failedRules[attribute][rule] = parameters; }
javascript
function _addFailure(attribute, rule, parameters) { _addError(attribute, rule, parameters); if (! _failedRules[attribute]) { _failedRules[attribute] = {}; } _failedRules[attribute][rule] = parameters; }
[ "function", "_addFailure", "(", "attribute", ",", "rule", ",", "parameters", ")", "{", "_addError", "(", "attribute", ",", "rule", ",", "parameters", ")", ";", "if", "(", "!", "_failedRules", "[", "attribute", "]", ")", "{", "_failedRules", "[", "attribute...
add a failure rule @param {String} attribute @param {String} rule @param {Array} parameters @return {Void}
[ "add", "a", "failure", "rule" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L267-L273
46,052
overtrue/validator.js
lib/validator.js
_addError
function _addError(attribute, rule, parameters) { if (_errors[attribute]) { return; }; _errors[attribute] = _formatMessage(_getMessage(attribute, rule) || '', attribute, rule, parameters); }
javascript
function _addError(attribute, rule, parameters) { if (_errors[attribute]) { return; }; _errors[attribute] = _formatMessage(_getMessage(attribute, rule) || '', attribute, rule, parameters); }
[ "function", "_addError", "(", "attribute", ",", "rule", ",", "parameters", ")", "{", "if", "(", "_errors", "[", "attribute", "]", ")", "{", "return", ";", "}", ";", "_errors", "[", "attribute", "]", "=", "_formatMessage", "(", "_getMessage", "(", "attrib...
add a error message @param {String} attribute @param {String} rule @param {Array} parameters @return {Void}
[ "add", "a", "error", "message" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L284-L289
46,053
overtrue/validator.js
lib/validator.js
_getMessage
function _getMessage(attribute, rule) { var message = _messages[rule]; if (is_object(message)) { var value = _getValue(attribute); if (is_array(value) && message['array']) { return message['array']; } else if (_resolvers.numeric(value) && message['numeric']) { return message['...
javascript
function _getMessage(attribute, rule) { var message = _messages[rule]; if (is_object(message)) { var value = _getValue(attribute); if (is_array(value) && message['array']) { return message['array']; } else if (_resolvers.numeric(value) && message['numeric']) { return message['...
[ "function", "_getMessage", "(", "attribute", ",", "rule", ")", "{", "var", "message", "=", "_messages", "[", "rule", "]", ";", "if", "(", "is_object", "(", "message", ")", ")", "{", "var", "value", "=", "_getValue", "(", "attribute", ")", ";", "if", ...
get attribute message @param {String} attribute @param {String} rule @return {String}
[ "get", "attribute", "message" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L310-L325
46,054
overtrue/validator.js
lib/validator.js
_formatMessage
function _formatMessage(message, attribute, rule, parameters) { parameters.unshift(_getAttribute(attribute)); for(i in parameters){ message = message.replace(/:[a-zA-z_][a-zA-z_0-9]+/, parameters[i]); } if (typeof _replacers[rule] === 'function') { message = _replacers[rule](message, attri...
javascript
function _formatMessage(message, attribute, rule, parameters) { parameters.unshift(_getAttribute(attribute)); for(i in parameters){ message = message.replace(/:[a-zA-z_][a-zA-z_0-9]+/, parameters[i]); } if (typeof _replacers[rule] === 'function') { message = _replacers[rule](message, attri...
[ "function", "_formatMessage", "(", "message", ",", "attribute", ",", "rule", ",", "parameters", ")", "{", "parameters", ".", "unshift", "(", "_getAttribute", "(", "attribute", ")", ")", ";", "for", "(", "i", "in", "parameters", ")", "{", "message", "=", ...
replace attributes. @param {String} message @param {String} attribute @param {String} rule @param {Array} parameters @return {String}
[ "replace", "attributes", "." ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L337-L349
46,055
overtrue/validator.js
lib/validator.js
_getAttribute
function _getAttribute(attribute) { if (is_string(_attributes[attribute])) { return _attributes[attribute]; } if ((line = _translator.trans(attribute)) !== attribute) { return line; } else { return attribute.replace('_', ' '); } }
javascript
function _getAttribute(attribute) { if (is_string(_attributes[attribute])) { return _attributes[attribute]; } if ((line = _translator.trans(attribute)) !== attribute) { return line; } else { return attribute.replace('_', ' '); } }
[ "function", "_getAttribute", "(", "attribute", ")", "{", "if", "(", "is_string", "(", "_attributes", "[", "attribute", "]", ")", ")", "{", "return", "_attributes", "[", "attribute", "]", ";", "}", "if", "(", "(", "line", "=", "_translator", ".", "trans",...
get attribute name @param {String} attribute @return {String}
[ "get", "attribute", "name" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L358-L368
46,056
overtrue/validator.js
lib/validator.js
_getRule
function _getRule(attribute, rules) { rules = rules || []; if ( ! rules[attribute]) { return; } for(var i in rules[attribute]) { var value = rules[attribute][i]; parsedRule = _parseRule(rule); if (in_array(parsedRule.rule, rules)) return [parsedRule.rule, parsedRule.pa...
javascript
function _getRule(attribute, rules) { rules = rules || []; if ( ! rules[attribute]) { return; } for(var i in rules[attribute]) { var value = rules[attribute][i]; parsedRule = _parseRule(rule); if (in_array(parsedRule.rule, rules)) return [parsedRule.rule, parsedRule.pa...
[ "function", "_getRule", "(", "attribute", ",", "rules", ")", "{", "rules", "=", "rules", "||", "[", "]", ";", "if", "(", "!", "rules", "[", "attribute", "]", ")", "{", "return", ";", "}", "for", "(", "var", "i", "in", "rules", "[", "attribute", "...
get rule and parameters of a rules @param {String} attribute @param {String|array} rules @return {Array|null}
[ "get", "rule", "and", "parameters", "of", "a", "rules" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L390-L404
46,057
overtrue/validator.js
lib/validator.js
_getSize
function _getSize(attribute, value) { hasNumeric = _hasRule(attribute, _numericRules); // This method will determine if the attribute is a number, string, or file and // return the proper size accordingly. If it is a number, then number itself // is the size. If it is a file, we take kilobytes, and for...
javascript
function _getSize(attribute, value) { hasNumeric = _hasRule(attribute, _numericRules); // This method will determine if the attribute is a number, string, or file and // return the proper size accordingly. If it is a number, then number itself // is the size. If it is a file, we take kilobytes, and for...
[ "function", "_getSize", "(", "attribute", ",", "value", ")", "{", "hasNumeric", "=", "_hasRule", "(", "attribute", ",", "_numericRules", ")", ";", "// This method will determine if the attribute is a number, string, or file and", "// return the proper size accordingly. If it is a...
get attribute size @param {String} attribute @param {Mixed} value @return {Number}
[ "get", "attribute", "size" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L414-L428
46,058
overtrue/validator.js
lib/validator.js
_requireParameterCount
function _requireParameterCount(count, parameters, rule) { if (parameters.length < count) { throw Error('Validation rule"' + rule + '" requires at least ' + count + ' parameters.'); } }
javascript
function _requireParameterCount(count, parameters, rule) { if (parameters.length < count) { throw Error('Validation rule"' + rule + '" requires at least ' + count + ' parameters.'); } }
[ "function", "_requireParameterCount", "(", "count", ",", "parameters", ",", "rule", ")", "{", "if", "(", "parameters", ".", "length", "<", "count", ")", "{", "throw", "Error", "(", "'Validation rule\"'", "+", "rule", "+", "'\" requires at least '", "+", "count...
check parameters count @param {Number} count @param {Array} parameters @param {String} rule @return {Void}
[ "check", "parameters", "count" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L439-L443
46,059
overtrue/validator.js
lib/validator.js
_allFailingRequired
function _allFailingRequired(attributes) { for (var i in attributes) { var akey = attributes[i]; if (resolvers.validateRequired(key, self._getValue(key))) { return false; } } return true; }
javascript
function _allFailingRequired(attributes) { for (var i in attributes) { var akey = attributes[i]; if (resolvers.validateRequired(key, self._getValue(key))) { return false; } } return true; }
[ "function", "_allFailingRequired", "(", "attributes", ")", "{", "for", "(", "var", "i", "in", "attributes", ")", "{", "var", "akey", "=", "attributes", "[", "i", "]", ";", "if", "(", "resolvers", ".", "validateRequired", "(", "key", ",", "self", ".", "...
all failing check @param {Array} attributes @return {Boolean}
[ "all", "failing", "check" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L452-L462
46,060
overtrue/validator.js
lib/validator.js
_anyFailingRequired
function _anyFailingRequired(attributes) { for (var i in attributes) { var key = attributes[i]; if ( ! _resolvers.validateRequired(key, self.date[key])) { return true; } } return false; }
javascript
function _anyFailingRequired(attributes) { for (var i in attributes) { var key = attributes[i]; if ( ! _resolvers.validateRequired(key, self.date[key])) { return true; } } return false; }
[ "function", "_anyFailingRequired", "(", "attributes", ")", "{", "for", "(", "var", "i", "in", "attributes", ")", "{", "var", "key", "=", "attributes", "[", "i", "]", ";", "if", "(", "!", "_resolvers", ".", "validateRequired", "(", "key", ",", "self", "...
determine if any of the given attributes fail the required test. @param array $attributes @return bool
[ "determine", "if", "any", "of", "the", "given", "attributes", "fail", "the", "required", "test", "." ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L470-L479
46,061
overtrue/validator.js
lib/validator.js
function(rule, message) { if (is_object(rule)) { _messages = extend({}, _messages, rule); } else if (is_string(rule)) { _messages[rule] = message; } }
javascript
function(rule, message) { if (is_object(rule)) { _messages = extend({}, _messages, rule); } else if (is_string(rule)) { _messages[rule] = message; } }
[ "function", "(", "rule", ",", "message", ")", "{", "if", "(", "is_object", "(", "rule", ")", ")", "{", "_messages", "=", "extend", "(", "{", "}", ",", "_messages", ",", "rule", ")", ";", "}", "else", "if", "(", "is_string", "(", "rule", ")", ")",...
add custom messages @param {String/Object} rule @param {String} message @return {Void}
[ "add", "custom", "messages" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L741-L747
46,062
overtrue/validator.js
lib/validator.js
function(attribute, alias) { if (is_object(attribute)) { _attributes = extend({}, _attributes, attribute); } else if (is_string(attribute)) { _attributes[attribute] = alias; } }
javascript
function(attribute, alias) { if (is_object(attribute)) { _attributes = extend({}, _attributes, attribute); } else if (is_string(attribute)) { _attributes[attribute] = alias; } }
[ "function", "(", "attribute", ",", "alias", ")", "{", "if", "(", "is_object", "(", "attribute", ")", ")", "{", "_attributes", "=", "extend", "(", "{", "}", ",", "_attributes", ",", "attribute", ")", ";", "}", "else", "if", "(", "is_string", "(", "att...
add attributes alias @param {String/Object} attribute @param {String} alias @return {Void}
[ "add", "attributes", "alias" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L757-L763
46,063
overtrue/validator.js
lib/validator.js
function(value, alias) { if (is_object(value)) { _values = extend({}, _values, value); } else if (is_string(rule)) { _values[value] = alias; } }
javascript
function(value, alias) { if (is_object(value)) { _values = extend({}, _values, value); } else if (is_string(rule)) { _values[value] = alias; } }
[ "function", "(", "value", ",", "alias", ")", "{", "if", "(", "is_object", "(", "value", ")", ")", "{", "_values", "=", "extend", "(", "{", "}", ",", "_values", ",", "value", ")", ";", "}", "else", "if", "(", "is_string", "(", "rule", ")", ")", ...
add values alias @param {String/Object} attribute @param {String} alias @return {Void}
[ "add", "values", "alias" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L773-L779
46,064
overtrue/validator.js
lib/validator.js
function(rule, fn) { if (is_object(rule)) { _replacers = extend({}, _replacers, rule); } else if (is_string(rule)) { _replacers[rule] = fn; } }
javascript
function(rule, fn) { if (is_object(rule)) { _replacers = extend({}, _replacers, rule); } else if (is_string(rule)) { _replacers[rule] = fn; } }
[ "function", "(", "rule", ",", "fn", ")", "{", "if", "(", "is_object", "(", "rule", ")", ")", "{", "_replacers", "=", "extend", "(", "{", "}", ",", "_replacers", ",", "rule", ")", ";", "}", "else", "if", "(", "is_string", "(", "rule", ")", ")", ...
add message replacers @param {String/Object} rule @param {Function} fn @return {Void}
[ "add", "message", "replacers" ]
ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c
https://github.com/overtrue/validator.js/blob/ae20d12cd097ef6dc2e7b13ee9e58d4ed617529c/lib/validator.js#L789-L795
46,065
elidoran/node-date-holidays-us
lib/index.js
makeHoliday
function makeHoliday(date, info, observedInfo) { // always make the holiday. var holiday = { info: info, date: { month: date.getMonth(), day : date.getDate() } } // if the holiday info's `bank` value has a function then // give it the date so it can evaluate the value. if ('functi...
javascript
function makeHoliday(date, info, observedInfo) { // always make the holiday. var holiday = { info: info, date: { month: date.getMonth(), day : date.getDate() } } // if the holiday info's `bank` value has a function then // give it the date so it can evaluate the value. if ('functi...
[ "function", "makeHoliday", "(", "date", ",", "info", ",", "observedInfo", ")", "{", "// always make the holiday.", "var", "holiday", "=", "{", "info", ":", "info", ",", "date", ":", "{", "month", ":", "date", ".", "getMonth", "(", ")", ",", "day", ":", ...
helper function which accepts the calculated holiday date and holiday info's. if an observed date was produced then it returns both holidays. also helps with the `bank` boolean value.
[ "helper", "function", "which", "accepts", "the", "calculated", "holiday", "date", "and", "holiday", "info", "s", ".", "if", "an", "observed", "date", "was", "produced", "then", "it", "returns", "both", "holidays", ".", "also", "helps", "with", "the", "bank",...
7e3ada9bddcbe79e4f1eaf7161629cd7759fc275
https://github.com/elidoran/node-date-holidays-us/blob/7e3ada9bddcbe79e4f1eaf7161629cd7759fc275/lib/index.js#L198-L233
46,066
elidoran/node-date-holidays-us
lib/index.js
newYearsSpecial
function newYearsSpecial(year) { // 1. hold onto the date, we'll need it in #3 var date = holidays.newYearsDay(year) // 2. do the usual. var newYears = makeHoliday( date, { name: 'New Year\'s Day', bank: !date.observed }, { name: 'New Year\'s Day (Observed)', bank: true } ) // 3. check if the...
javascript
function newYearsSpecial(year) { // 1. hold onto the date, we'll need it in #3 var date = holidays.newYearsDay(year) // 2. do the usual. var newYears = makeHoliday( date, { name: 'New Year\'s Day', bank: !date.observed }, { name: 'New Year\'s Day (Observed)', bank: true } ) // 3. check if the...
[ "function", "newYearsSpecial", "(", "year", ")", "{", "// 1. hold onto the date, we'll need it in #3", "var", "date", "=", "holidays", ".", "newYearsDay", "(", "year", ")", "// 2. do the usual.", "var", "newYears", "=", "makeHoliday", "(", "date", ",", "{", "name", ...
The New Year's holiday can have an observed date in the previous year. That messes with the whole "generate and cache holidays by year" thing. This handles it by identifying when that happens and specifying the custom year. The @date/holidays package handles the custom year as of v0.3.1.
[ "The", "New", "Year", "s", "holiday", "can", "have", "an", "observed", "date", "in", "the", "previous", "year", ".", "That", "messes", "with", "the", "whole", "generate", "and", "cache", "holidays", "by", "year", "thing", ".", "This", "handles", "it", "b...
7e3ada9bddcbe79e4f1eaf7161629cd7759fc275
https://github.com/elidoran/node-date-holidays-us/blob/7e3ada9bddcbe79e4f1eaf7161629cd7759fc275/lib/index.js#L339-L358
46,067
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, implementation){ this.performableActions = this.performableActions || {}; this.performableActions[action] = this.performableActions[action] || {}; this.performableActions[action].actionName = this...
javascript
function(action, implementation){ this.performableActions = this.performableActions || {}; this.performableActions[action] = this.performableActions[action] || {}; this.performableActions[action].actionName = this...
[ "function", "(", "action", ",", "implementation", ")", "{", "this", ".", "performableActions", "=", "this", ".", "performableActions", "||", "{", "}", ";", "this", ".", "performableActions", "[", "action", "]", "=", "this", ".", "performableActions", "[", "a...
Sets a performable action implementation on object. @method setPerformableAction @param {String} action - The action name. @param {PerformableAction} implementation - Object to set as the action implementation. or a string to lookup an implementation `RL.PerformableActions[implementation]`.
[ "Sets", "a", "performable", "action", "implementation", "on", "object", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L20-L34
46,068
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, settings){ var handler = this.performableActions[action]; if(!handler){ return false; } if(!handler.getTargetsForAction){ return false; } settings = settings || {}; if(!settings.skipCan...
javascript
function(action, settings){ var handler = this.performableActions[action]; if(!handler){ return false; } if(!handler.getTargetsForAction){ return false; } settings = settings || {}; if(!settings.skipCan...
[ "function", "(", "action", ",", "settings", ")", "{", "var", "handler", "=", "this", ".", "performableActions", "[", "action", "]", ";", "if", "(", "!", "handler", ")", "{", "return", "false", ";", "}", "if", "(", "!", "handler", ".", "getTargetsForAct...
Returns a list of valid targets to perform an action on. @method getTargetsForAction @param {String} action - The action to get targets for. @param {Object} [settings] - Settings for the action. @return {Array} Array of valid targets.
[ "Returns", "a", "list", "of", "valid", "targets", "to", "perform", "an", "action", "on", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L43-L59
46,069
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, target, settings){ if(!this.performableActions){ return false; } var handler = this.performableActions[action]; if(!handler){ return false; } // target cannot resolve any actions if(!targ...
javascript
function(action, target, settings){ if(!this.performableActions){ return false; } var handler = this.performableActions[action]; if(!handler){ return false; } // target cannot resolve any actions if(!targ...
[ "function", "(", "action", ",", "target", ",", "settings", ")", "{", "if", "(", "!", "this", ".", "performableActions", ")", "{", "return", "false", ";", "}", "var", "handler", "=", "this", ".", "performableActions", "[", "action", "]", ";", "if", "(",...
Checks if source can perform an action on target with given settings. @method canPerformActionOnTarget @param {string} action - The action to check. @param {Object} target - The target object to check against. @param {Object} [settings] - Settings for the action. @param {Object} [settings.skipCanPerformAction] - If tru...
[ "Checks", "if", "source", "can", "perform", "an", "action", "on", "target", "with", "given", "settings", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L96-L118
46,070
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, target, settings){ if(!this.performableActions){ return false; } var handler = this.performableActions[action]; if(!handler){ return false; } settings = settings || {}; // the functions ...
javascript
function(action, target, settings){ if(!this.performableActions){ return false; } var handler = this.performableActions[action]; if(!handler){ return false; } settings = settings || {}; // the functions ...
[ "function", "(", "action", ",", "target", ",", "settings", ")", "{", "if", "(", "!", "this", ".", "performableActions", ")", "{", "return", "false", ";", "}", "var", "handler", "=", "this", ".", "performableActions", "[", "action", "]", ";", "if", "(",...
Performs an action on target with given settings. @method performAction @param {String} action - The action to perform. @param {Object} target - The target object to perform the action on. @param {Object} [settings] - Settings for the action. @param {Object} [settings.skipCanPerformAction] - If true skips checking that...
[ "Performs", "an", "action", "on", "target", "with", "given", "settings", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L130-L166
46,071
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, implementation){ this.resolvableActions = this.resolvableActions || {}; this.resolvableActions[action] = this.resolvableActions[action] || {}; this.resolvableActions[action].actionName = this.r...
javascript
function(action, implementation){ this.resolvableActions = this.resolvableActions || {}; this.resolvableActions[action] = this.resolvableActions[action] || {}; this.resolvableActions[action].actionName = this.r...
[ "function", "(", "action", ",", "implementation", ")", "{", "this", ".", "resolvableActions", "=", "this", ".", "resolvableActions", "||", "{", "}", ";", "this", ".", "resolvableActions", "[", "action", "]", "=", "this", ".", "resolvableActions", "[", "actio...
Sets a resolvable action implementation on object. @method setResolvableAction @param {String} action - The action name. @param {ResolvableAction} [implementation] - Object to set as the action implementation.
[ "Sets", "a", "resolvable", "action", "implementation", "on", "object", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L184-L197
46,072
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, source, settings){ if(!this.resolvableActions){ return false; } var handler = this.resolvableActions[action]; if(!handler){ return false; } if(handler.canResolveAction === false){ ret...
javascript
function(action, source, settings){ if(!this.resolvableActions){ return false; } var handler = this.resolvableActions[action]; if(!handler){ return false; } if(handler.canResolveAction === false){ ret...
[ "function", "(", "action", ",", "source", ",", "settings", ")", "{", "if", "(", "!", "this", ".", "resolvableActions", ")", "{", "return", "false", ";", "}", "var", "handler", "=", "this", ".", "resolvableActions", "[", "action", "]", ";", "if", "(", ...
Checks if a target can resolve an action with given source and settings. `this` is the target. @method canResolveAction @param {String} action - The action being performed on this target to resolve. @param {Object} source - The source object performing the action on this target. @param {Object} [settings] - Settings fo...
[ "Checks", "if", "a", "target", "can", "resolve", "an", "action", "with", "given", "source", "and", "settings", ".", "this", "is", "the", "target", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L207-L222
46,073
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins/action-interface.js
function(action, source, settings){ if(!this.resolvableActions){ return false; } var handler = this.resolvableActions[action]; if(!handler){ return false; } settings = settings || {}; if(!settings.skipCan...
javascript
function(action, source, settings){ if(!this.resolvableActions){ return false; } var handler = this.resolvableActions[action]; if(!handler){ return false; } settings = settings || {}; if(!settings.skipCan...
[ "function", "(", "action", ",", "source", ",", "settings", ")", "{", "if", "(", "!", "this", ".", "resolvableActions", ")", "{", "return", "false", ";", "}", "var", "handler", "=", "this", ".", "resolvableActions", "[", "action", "]", ";", "if", "(", ...
Resolves an action on target from source with given settings. @method performAction @param {String} action - The action being performed on this target to resolve. @param {Object} source - The source object performing the action on this target. @param {Object} [settings] - Settings for the action. @param {Object} [setti...
[ "Resolves", "an", "action", "on", "target", "from", "source", "with", "given", "settings", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins/action-interface.js#L233-L253
46,074
sematext/spm-agent-os
linuxAgent.js
function (metric) { var now = (new Date().getTime()).toFixed(0) var line = null if (metric.sct === 'OS' && /collectd/.test(metric.name)) { line = this.collectdFormatLine(metric) } else { if (metric.sct === 'OS') { // new OS metric format if (metric.filters ins...
javascript
function (metric) { var now = (new Date().getTime()).toFixed(0) var line = null if (metric.sct === 'OS' && /collectd/.test(metric.name)) { line = this.collectdFormatLine(metric) } else { if (metric.sct === 'OS') { // new OS metric format if (metric.filters ins...
[ "function", "(", "metric", ")", "{", "var", "now", "=", "(", "new", "Date", "(", ")", ".", "getTime", "(", ")", ")", ".", "toFixed", "(", "0", ")", "var", "line", "=", "null", "if", "(", "metric", ".", "sct", "===", "'OS'", "&&", "/", "collectd...
osnet 1457010656149 lo 0 0
[ "osnet", "1457010656149", "lo", "0", "0" ]
e3083f56b9d8542de29fc53679da8e8f4d1d4493
https://github.com/sematext/spm-agent-os/blob/e3083f56b9d8542de29fc53679da8e8f4d1d4493/linuxAgent.js#L49-L69
46,075
deepstreamIO/deepstream.io-service
src/daemon.js
monitor
function monitor() { if(!child.pid) { // If the number of periodic starts exceeds the max, kill the process if (starts >= options.maxRetries) { if ((Date.now() - startTime) > maxMilliseconds) { console.error( `Too many restarts within the last ${maxMilliseconds / 1000} seco...
javascript
function monitor() { if(!child.pid) { // If the number of periodic starts exceeds the max, kill the process if (starts >= options.maxRetries) { if ((Date.now() - startTime) > maxMilliseconds) { console.error( `Too many restarts within the last ${maxMilliseconds / 1000} seco...
[ "function", "monitor", "(", ")", "{", "if", "(", "!", "child", ".", "pid", ")", "{", "// If the number of periodic starts exceeds the max, kill the process", "if", "(", "starts", ">=", "options", ".", "maxRetries", ")", "{", "if", "(", "(", "Date", ".", "now",...
Monitor the process to make sure it is running
[ "Monitor", "the", "process", "to", "make", "sure", "it", "is", "running" ]
f0a4f482eb027cc503e86d7d6a298cfee03883e3
https://github.com/deepstreamIO/deepstream.io-service/blob/f0a4f482eb027cc503e86d7d6a298cfee03883e3/src/daemon.js#L16-L44
46,076
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
Game
function Game() { // un-populated instance of Array2d this.map = new RL.Map(this); this.entityManager = new RL.ObjectManager(this, RL.Entity); this.renderer = new RL.Renderer(this); this.console = new RL.Console(this); this.lighting = new RL.LightingROT(this); /...
javascript
function Game() { // un-populated instance of Array2d this.map = new RL.Map(this); this.entityManager = new RL.ObjectManager(this, RL.Entity); this.renderer = new RL.Renderer(this); this.console = new RL.Console(this); this.lighting = new RL.LightingROT(this); /...
[ "function", "Game", "(", ")", "{", "// un-populated instance of Array2d", "this", ".", "map", "=", "new", "RL", ".", "Map", "(", "this", ")", ";", "this", ".", "entityManager", "=", "new", "RL", ".", "ObjectManager", "(", "this", ",", "RL", ".", "Entity"...
Container for all game objects. Handles updating the state of game objects each turn. Listens for player input to trigger and resolve new turns. @class Game @constructor
[ "Container", "for", "all", "game", "objects", ".", "Handles", "updating", "the", "state", "of", "game", "objects", "each", "turn", ".", "Listens", "for", "player", "input", "to", "trigger", "and", "resolve", "new", "turns", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L11-L33
46,077
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(width, height){ this.map.setSize(width, height); this.player.fov.setSize(width, height); this.entityManager.setSize(width, height); this.lighting.setSize(width, height); }
javascript
function(width, height){ this.map.setSize(width, height); this.player.fov.setSize(width, height); this.entityManager.setSize(width, height); this.lighting.setSize(width, height); }
[ "function", "(", "width", ",", "height", ")", "{", "this", ".", "map", ".", "setSize", "(", "width", ",", "height", ")", ";", "this", ".", "player", ".", "fov", ".", "setSize", "(", "width", ",", "height", ")", ";", "this", ".", "entityManager", "....
Sets the size of the map resizing this.map and this.entityManager. @method setMapSize @param {Number} width - Width in tilse to set map and entityManager to. @param {Number} height - Height in tilse to set map and entityManager to.
[ "Sets", "the", "size", "of", "the", "map", "resizing", "this", ".", "map", "and", "this", ".", "entityManager", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L115-L120
46,078
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(action) { if(!this.gameOver){ var result = this.player.update(action); if(result){ this.entityManager.update(this.player); this.player.updateFov(); this.lighting.update(); this.renderer...
javascript
function(action) { if(!this.gameOver){ var result = this.player.update(action); if(result){ this.entityManager.update(this.player); this.player.updateFov(); this.lighting.update(); this.renderer...
[ "function", "(", "action", ")", "{", "if", "(", "!", "this", ".", "gameOver", ")", "{", "var", "result", "=", "this", ".", "player", ".", "update", "(", "action", ")", ";", "if", "(", "result", ")", "{", "this", ".", "entityManager", ".", "update",...
Handles user input actions. @method onKeyAction @param {String} action - Action triggered by user input.
[ "Handles", "user", "input", "actions", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L140-L157
46,079
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(x, y){ var coords = this.renderer.mouseToTileCoords(x, y), tile = this.map.get(coords.x, coords.y); if(!tile){ return; } var entityTile = this.entityManager.get(tile.x, tile.y); if(entityTile){ this.cons...
javascript
function(x, y){ var coords = this.renderer.mouseToTileCoords(x, y), tile = this.map.get(coords.x, coords.y); if(!tile){ return; } var entityTile = this.entityManager.get(tile.x, tile.y); if(entityTile){ this.cons...
[ "function", "(", "x", ",", "y", ")", "{", "var", "coords", "=", "this", ".", "renderer", ".", "mouseToTileCoords", "(", "x", ",", "y", ")", ",", "tile", "=", "this", ".", "map", ".", "get", "(", "coords", ".", "x", ",", "coords", ".", "y", ")",...
Handles tile mouse click events. @method onClick @param {Number} x - Mouse x coord relative to window. @param {Number} y - Mouse y coord relative to window.
[ "Handles", "tile", "mouse", "click", "events", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L165-L178
46,080
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(x, y){ var coords = this.renderer.mouseToTileCoords(x, y), tile = this.map.get(coords.x, coords.y); if(tile){ this.renderer.hoveredTileX = tile.x; this.renderer.hoveredTileY = tile.y; } else { this.renderer.hove...
javascript
function(x, y){ var coords = this.renderer.mouseToTileCoords(x, y), tile = this.map.get(coords.x, coords.y); if(tile){ this.renderer.hoveredTileX = tile.x; this.renderer.hoveredTileY = tile.y; } else { this.renderer.hove...
[ "function", "(", "x", ",", "y", ")", "{", "var", "coords", "=", "this", ".", "renderer", ".", "mouseToTileCoords", "(", "x", ",", "y", ")", ",", "tile", "=", "this", ".", "map", ".", "get", "(", "coords", ".", "x", ",", "coords", ".", "y", ")",...
Handles tile mouse hover events @method onHover @param {Number} x - Mouse x coord relative to window. @param {Number} y - Mouse y coord relative to window.
[ "Handles", "tile", "mouse", "hover", "events" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L186-L197
46,081
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(x, y){ var result = []; var entity = this.entityManager.get(x, y); if(entity){ result.push(entity); } // add items or any other objects that can be placed at a tile coord position return result; }
javascript
function(x, y){ var result = []; var entity = this.entityManager.get(x, y); if(entity){ result.push(entity); } // add items or any other objects that can be placed at a tile coord position return result; }
[ "function", "(", "x", ",", "y", ")", "{", "var", "result", "=", "[", "]", ";", "var", "entity", "=", "this", ".", "entityManager", ".", "get", "(", "x", ",", "y", ")", ";", "if", "(", "entity", ")", "{", "result", ".", "push", "(", "entity", ...
Gets all objects at tile position @method getObjectsAtPostion @param {Number} x @param {Number} y @return {Array}
[ "Gets", "all", "objects", "at", "tile", "position" ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L206-L217
46,082
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(entity, x, y){ var tile = this.map.get(x, y); // if tile blocks movement if(!tile || !tile.passable){ return false; } return true; }
javascript
function(entity, x, y){ var tile = this.map.get(x, y); // if tile blocks movement if(!tile || !tile.passable){ return false; } return true; }
[ "function", "(", "entity", ",", "x", ",", "y", ")", "{", "var", "tile", "=", "this", ".", "map", ".", "get", "(", "x", ",", "y", ")", ";", "// if tile blocks movement", "if", "(", "!", "tile", "||", "!", "tile", ".", "passable", ")", "{", "return...
Checks if an entity can move through a map tile. This does NOT check for entities on the tile blocking movement. This is where code for special cases changing an entity's ability to pass through a tile should be placed. Things like flying, swimming and ghosts moving through walls. @method entityCanMoveThrough @param {E...
[ "Checks", "if", "an", "entity", "can", "move", "through", "a", "map", "tile", ".", "This", "does", "NOT", "check", "for", "entities", "on", "the", "tile", "blocking", "movement", ".", "This", "is", "where", "code", "for", "special", "cases", "changing", ...
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L230-L237
46,083
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(entity, x, y){ if(!this.entityCanMoveThrough(entity, x, y)){ return false; } // check if occupied by entity if(this.entityManager.get(x, y)){ return false; } return true; }
javascript
function(entity, x, y){ if(!this.entityCanMoveThrough(entity, x, y)){ return false; } // check if occupied by entity if(this.entityManager.get(x, y)){ return false; } return true; }
[ "function", "(", "entity", ",", "x", ",", "y", ")", "{", "if", "(", "!", "this", ".", "entityCanMoveThrough", "(", "entity", ",", "x", ",", "y", ")", ")", "{", "return", "false", ";", "}", "// check if occupied by entity", "if", "(", "this", ".", "en...
Checks if an entity can move through and into a map tile and that tile is un-occupied. @method entityCanMoveTo @param {Entity} entity - The entity to check. @param {Number} x - The x map tile coord to check. @param {Number} y - The y map tile coord to check. @return {Bool}
[ "Checks", "if", "an", "entity", "can", "move", "through", "and", "into", "a", "map", "tile", "and", "that", "tile", "is", "un", "-", "occupied", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L247-L256
46,084
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/game.js
function(entity, x, y){ var tile = this.map.get(x, y); return tile && !tile.blocksLos; }
javascript
function(entity, x, y){ var tile = this.map.get(x, y); return tile && !tile.blocksLos; }
[ "function", "(", "entity", ",", "x", ",", "y", ")", "{", "var", "tile", "=", "this", ".", "map", ".", "get", "(", "x", ",", "y", ")", ";", "return", "tile", "&&", "!", "tile", ".", "blocksLos", ";", "}" ]
Checks if a map tile can be seen through. This is where code for special cases like smoke, fog, x-ray vision can be implemented by checking the entity param. @method entityCanSeeThrough @param {Number} x - The x map tile coord to check. @param {Number} y - The y map tile coord to check. @return {Bool}
[ "Checks", "if", "a", "map", "tile", "can", "be", "seen", "through", ".", "This", "is", "where", "code", "for", "special", "cases", "like", "smoke", "fog", "x", "-", "ray", "vision", "can", "be", "implemented", "by", "checking", "the", "entity", "param", ...
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/game.js#L283-L286
46,085
alexandrudima/typescript-with-globs
lib/tscg.js
handleRecipeFiles
function handleRecipeFiles(folderPath) { if (handled[folderPath]) { return; } handled[folderPath] = true; handleRecipeFile(path.join(folderPath, 'tsconfig.json')); handleRecipeFiles(path.dirname(folderPath)); }
javascript
function handleRecipeFiles(folderPath) { if (handled[folderPath]) { return; } handled[folderPath] = true; handleRecipeFile(path.join(folderPath, 'tsconfig.json')); handleRecipeFiles(path.dirname(folderPath)); }
[ "function", "handleRecipeFiles", "(", "folderPath", ")", "{", "if", "(", "handled", "[", "folderPath", "]", ")", "{", "return", ";", "}", "handled", "[", "folderPath", "]", "=", "true", ";", "handleRecipeFile", "(", "path", ".", "join", "(", "folderPath", ...
Walk up all folders and discover `tsconfig.json` files.
[ "Walk", "up", "all", "folders", "and", "discover", "tsconfig", ".", "json", "files", "." ]
ac63cf7a20f75626aee7c817a31af7e14a4e3603
https://github.com/alexandrudima/typescript-with-globs/blob/ac63cf7a20f75626aee7c817a31af7e14a4e3603/lib/tscg.js#L11-L19
46,086
alexandrudima/typescript-with-globs
lib/tscg.js
handleRecipeFile
function handleRecipeFile(recipePath) { var contents = null; try { contents = fs.readFileSync(recipePath); } catch (err) { // Not finding a recipe is OK return; } var config = null; try { config = JSON.parse(contents.toString()); } catch (err) { ...
javascript
function handleRecipeFile(recipePath) { var contents = null; try { contents = fs.readFileSync(recipePath); } catch (err) { // Not finding a recipe is OK return; } var config = null; try { config = JSON.parse(contents.toString()); } catch (err) { ...
[ "function", "handleRecipeFile", "(", "recipePath", ")", "{", "var", "contents", "=", "null", ";", "try", "{", "contents", "=", "fs", ".", "readFileSync", "(", "recipePath", ")", ";", "}", "catch", "(", "err", ")", "{", "// Not finding a recipe is OK\r", "ret...
Given a recipe is found at `recipePath`, create a `tsconfig.json` sibling file with the glob resolved.
[ "Given", "a", "recipe", "is", "found", "at", "recipePath", "create", "a", "tsconfig", ".", "json", "sibling", "file", "with", "the", "glob", "resolved", "." ]
ac63cf7a20f75626aee7c817a31af7e14a4e3603
https://github.com/alexandrudima/typescript-with-globs/blob/ac63cf7a20f75626aee7c817a31af7e14a4e3603/lib/tscg.js#L24-L60
46,087
commenthol/debug-level
src/middleware.js
middleware
function middleware (opts) { opts = Object.assign({maxSize: 100, logAll: false}, opts) const log = opts.logAll ? new CustomLog() : void (0) const loggers = new Loggers(opts.maxSize) return function (req, res) { let query = req.query if (!req.query) { query = qsParse(urlParse(req.url).query) }...
javascript
function middleware (opts) { opts = Object.assign({maxSize: 100, logAll: false}, opts) const log = opts.logAll ? new CustomLog() : void (0) const loggers = new Loggers(opts.maxSize) return function (req, res) { let query = req.query if (!req.query) { query = qsParse(urlParse(req.url).query) }...
[ "function", "middleware", "(", "opts", ")", "{", "opts", "=", "Object", ".", "assign", "(", "{", "maxSize", ":", "100", ",", "logAll", ":", "false", "}", ",", "opts", ")", "const", "log", "=", "opts", ".", "logAll", "?", "new", "CustomLog", "(", ")...
connect middleware which logs browser based logs on server side sends a transparent gif as response @param {Object} [opts] @param {Object} [opts.maxSize=100] - max number of different name loggers @param {Object} [opts.logAll=false] - log everything even strings @return {function} connect middleware
[ "connect", "middleware", "which", "logs", "browser", "based", "logs", "on", "server", "side", "sends", "a", "transparent", "gif", "as", "response" ]
e310fe5452984d898adfb8f924ac6f9021b05457
https://github.com/commenthol/debug-level/blob/e310fe5452984d898adfb8f924ac6f9021b05457/src/middleware.js#L44-L81
46,088
nickzuber/needle
src/RollingHash/rollingHash.js
function(base){ if(typeof base === 'undefined'){ throw new Error("Too few arguments in RollingHash constructor"); }else if(typeof base !== 'number'){ throw new TypeError("Invalid argument; expected a number in RollingHash constructor"); } // The base of the number system this.BASE = base; // The...
javascript
function(base){ if(typeof base === 'undefined'){ throw new Error("Too few arguments in RollingHash constructor"); }else if(typeof base !== 'number'){ throw new TypeError("Invalid argument; expected a number in RollingHash constructor"); } // The base of the number system this.BASE = base; // The...
[ "function", "(", "base", ")", "{", "if", "(", "typeof", "base", "===", "'undefined'", ")", "{", "throw", "new", "Error", "(", "\"Too few arguments in RollingHash constructor\"", ")", ";", "}", "else", "if", "(", "typeof", "base", "!==", "'number'", ")", "{",...
Single argument constructor which defines the base of the working @param {number} the base value of the rolling hash to compute its operations @return {void}
[ "Single", "argument", "constructor", "which", "defines", "the", "base", "of", "the", "working" ]
9565b3c193b93d67ffed39d430eba395a7bb5531
https://github.com/nickzuber/needle/blob/9565b3c193b93d67ffed39d430eba395a7bb5531/src/RollingHash/rollingHash.js#L85-L110
46,089
loverly/lexerific
lib/Lexerific.js
Lexerific
function Lexerific(config, _, FSM, Lexeme, StateGenerator, Token, TreeNode) { var _this = this; this._ = _; // Create a finite state machine for lexing this.fsm = new FSM({ name: 'lexerific', debug: true, resetAtRoot: true // erase history for every root bound transition }); this.fsm.on('retur...
javascript
function Lexerific(config, _, FSM, Lexeme, StateGenerator, Token, TreeNode) { var _this = this; this._ = _; // Create a finite state machine for lexing this.fsm = new FSM({ name: 'lexerific', debug: true, resetAtRoot: true // erase history for every root bound transition }); this.fsm.on('retur...
[ "function", "Lexerific", "(", "config", ",", "_", ",", "FSM", ",", "Lexeme", ",", "StateGenerator", ",", "Token", ",", "TreeNode", ")", "{", "var", "_this", "=", "this", ";", "this", ".", "_", "=", "_", ";", "// Create a finite state machine for lexing", "...
The Lexerific library extends the Transform stream class. Depending on the mode it either takes in buffers as input or a stream of token objects. Configuration options: * `mode` - Either `string` or `token` depending on what type of input should be consumed. `token` mode is for secondary scanning passes In `string`...
[ "The", "Lexerific", "library", "extends", "the", "Transform", "stream", "class", ".", "Depending", "on", "the", "mode", "it", "either", "takes", "in", "buffers", "as", "input", "or", "a", "stream", "of", "token", "objects", "." ]
ba10e4fdadd0d627a57b1997044d6f7b0282b862
https://github.com/loverly/lexerific/blob/ba10e4fdadd0d627a57b1997044d6f7b0282b862/lib/Lexerific.js#L17-L59
46,090
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/mixins.js
function() { return { char: this.char, color: this.color, bgColor: this.bgColor, borderColor: this.borderColor, borderWidth: this.borderWidth, ...
javascript
function() { return { char: this.char, color: this.color, bgColor: this.bgColor, borderColor: this.borderColor, borderWidth: this.borderWidth, ...
[ "function", "(", ")", "{", "return", "{", "char", ":", "this", ".", "char", ",", "color", ":", "this", ".", "color", ",", "bgColor", ":", "this", ".", "bgColor", ",", "borderColor", ":", "this", ".", "borderColor", ",", "borderWidth", ":", "this", "....
Returns as `tileData`object used by `Renderer` objects to draw tiles. @method getTileDrawData @return {TileDrawData}
[ "Returns", "as", "tileData", "object", "used", "by", "Renderer", "objects", "to", "draw", "tiles", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/mixins.js#L27-L43
46,091
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/util.js
function(defaults, settings) { var out = {}; for (var key in defaults) { if (key in settings) { out[key] = settings[key]; } else { out[key] = defaults[key]; } } return out; }
javascript
function(defaults, settings) { var out = {}; for (var key in defaults) { if (key in settings) { out[key] = settings[key]; } else { out[key] = defaults[key]; } } return out; }
[ "function", "(", "defaults", ",", "settings", ")", "{", "var", "out", "=", "{", "}", ";", "for", "(", "var", "key", "in", "defaults", ")", "{", "if", "(", "key", "in", "settings", ")", "{", "out", "[", "key", "]", "=", "settings", "[", "key", "...
Merges settings with default values. @method mergeDefaults @static @param {Object} defaults - Default values to merge with. @param {Object} settings - Settings to merge with default values. @return {Object} A new object with settings replacing defaults.
[ "Merges", "settings", "with", "default", "values", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/util.js#L137-L147
46,092
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/util.js
function(destination){ var sources = Array.prototype.slice.call(arguments, 1); for (var i = 0; i < sources.length; i++) { var source = sources[i]; for(var key in source){ destination[key] = source[key]; } } ...
javascript
function(destination){ var sources = Array.prototype.slice.call(arguments, 1); for (var i = 0; i < sources.length; i++) { var source = sources[i]; for(var key in source){ destination[key] = source[key]; } } ...
[ "function", "(", "destination", ")", "{", "var", "sources", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "sources", ".", "length", ";", "i", "++"...
Copy all of the properties in the source objects over to the destination object, and return the destination object. It's in-order, so the last source will override properties of the same name in previous arguments. @method merge @static @param {Object} destination - The object to copy properties to. @param {Object} sou...
[ "Copy", "all", "of", "the", "properties", "in", "the", "source", "objects", "over", "to", "the", "destination", "object", "and", "return", "the", "destination", "object", ".", "It", "s", "in", "-", "order", "so", "the", "last", "source", "will", "override"...
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/util.js#L158-L167
46,093
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/util.js
function(x1, y1, x2, y2, diagonalMovement){ if(!diagonalMovement){ return Math.abs(x2 - x1) + Math.abs(y2 - y1); } else { return Math.max(Math.abs(x2 - x1), Math.abs(y2 - y1)); } }
javascript
function(x1, y1, x2, y2, diagonalMovement){ if(!diagonalMovement){ return Math.abs(x2 - x1) + Math.abs(y2 - y1); } else { return Math.max(Math.abs(x2 - x1), Math.abs(y2 - y1)); } }
[ "function", "(", "x1", ",", "y1", ",", "x2", ",", "y2", ",", "diagonalMovement", ")", "{", "if", "(", "!", "diagonalMovement", ")", "{", "return", "Math", ".", "abs", "(", "x2", "-", "x1", ")", "+", "Math", ".", "abs", "(", "y2", "-", "y1", ")"...
Gets the distance in tile moves from point 1 to point 2. @method getTileMoveDistance @param {Number} x1 @param {Number} y1 @param {Number} x2 @param {Number} y2 @param {Bool} [diagonalMovement=false]if true, calculate the distance taking into account diagonal movement. @return {Number}
[ "Gets", "the", "distance", "in", "tile", "moves", "from", "point", "1", "to", "point", "2", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/util.js#L193-L199
46,094
soliton4/promiseland
promiseland.js
function(jsStr, __parObj){ if (!__parObj){ return eval(jsStr); }; var s = ""; var n; for (n in __parObj){ s += "var " + n + " = __parObj." + n + ";"; }; //s = "(function(){" + s; s += jsStr; //s += "})();"; return eval(s); ...
javascript
function(jsStr, __parObj){ if (!__parObj){ return eval(jsStr); }; var s = ""; var n; for (n in __parObj){ s += "var " + n + " = __parObj." + n + ";"; }; //s = "(function(){" + s; s += jsStr; //s += "})();"; return eval(s); ...
[ "function", "(", "jsStr", ",", "__parObj", ")", "{", "if", "(", "!", "__parObj", ")", "{", "return", "eval", "(", "jsStr", ")", ";", "}", ";", "var", "s", "=", "\"\"", ";", "var", "n", ";", "for", "(", "n", "in", "__parObj", ")", "{", "s", "+...
eval this is here because its pure javascript
[ "eval", "this", "is", "here", "because", "its", "pure", "javascript" ]
27ccbe9cabbfa4b36fb0395dbcc5d30470f2ba89
https://github.com/soliton4/promiseland/blob/27ccbe9cabbfa4b36fb0395dbcc5d30470f2ba89/promiseland.js#L40-L56
46,095
vmgltd/hlr-lookup-api-nodejs-sdk
src/lib/node-hlr-client.js
HlrLookupClient
function HlrLookupClient(username, password, noSsl) { this.username = username; this.password = password; this.url = (noSsl ? 'http' : 'https') + '://www.hlr-lookups.com/api'; }
javascript
function HlrLookupClient(username, password, noSsl) { this.username = username; this.password = password; this.url = (noSsl ? 'http' : 'https') + '://www.hlr-lookups.com/api'; }
[ "function", "HlrLookupClient", "(", "username", ",", "password", ",", "noSsl", ")", "{", "this", ".", "username", "=", "username", ";", "this", ".", "password", "=", "password", ";", "this", ".", "url", "=", "(", "noSsl", "?", "'http'", ":", "'https'", ...
Initializes the HLR Lookup Client @param username - www.hlr-lookups.com username @param password - www.hlr-lookups.com password @param noSsl - set to true to disable SSL @constructor
[ "Initializes", "the", "HLR", "Lookup", "Client" ]
d36bb40152622b5854b05ef90a6a5748045af408
https://github.com/vmgltd/hlr-lookup-api-nodejs-sdk/blob/d36bb40152622b5854b05ef90a6a5748045af408/src/lib/node-hlr-client.js#L13-L19
46,096
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/renderer-layer.js
RendererLayer
function RendererLayer(game, type, settings) { this.game = game; this.type = type; var typeData = RendererLayer.Types[type]; RL.Util.merge(this, typeData); for(var key in settings){ if(this[key] !== void 0){ this[key] = settings[key]; } ...
javascript
function RendererLayer(game, type, settings) { this.game = game; this.type = type; var typeData = RendererLayer.Types[type]; RL.Util.merge(this, typeData); for(var key in settings){ if(this[key] !== void 0){ this[key] = settings[key]; } ...
[ "function", "RendererLayer", "(", "game", ",", "type", ",", "settings", ")", "{", "this", ".", "game", "=", "game", ";", "this", ".", "type", "=", "type", ";", "var", "typeData", "=", "RendererLayer", ".", "Types", "[", "type", "]", ";", "RL", ".", ...
Represents a map tile layer to be rendered. @class RendererLayer @constructor @param {Game} game - Game instance this obj is attached to. @param {String} type - Type of `RendererLayer`. When created this object is merged with the value of `RendererLayer.Types[type]`.
[ "Represents", "a", "map", "tile", "layer", "to", "be", "rendered", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer-layer.js#L11-L22
46,097
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/renderer-layer.js
function(x, y, prevTileData){ var tileData = this.getTileData(x, y, prevTileData); if(this.mergeWithPrevLayer && prevTileData){ return this.mergeTileData(prevTileData, tileData); } return tileData; }
javascript
function(x, y, prevTileData){ var tileData = this.getTileData(x, y, prevTileData); if(this.mergeWithPrevLayer && prevTileData){ return this.mergeTileData(prevTileData, tileData); } return tileData; }
[ "function", "(", "x", ",", "y", ",", "prevTileData", ")", "{", "var", "tileData", "=", "this", ".", "getTileData", "(", "x", ",", "y", ",", "prevTileData", ")", ";", "if", "(", "this", ".", "mergeWithPrevLayer", "&&", "prevTileData", ")", "{", "return"...
Get layer's `TileData` for a given map tile coord. Optionally modifying the `prevTileData` object param if `this.mergeWithPrevLayer = true`. @method getModifiedTileData @param {Number} x - Map tile x coord. @param {Object} y - Map tile y coord. @param {Object} [prevTileData] - `tileData` object for the given map tile c...
[ "Get", "layer", "s", "TileData", "for", "a", "given", "map", "tile", "coord", ".", "Optionally", "modifying", "the", "prevTileData", "object", "param", "if", "this", ".", "mergeWithPrevLayer", "=", "true", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer-layer.js#L99-L105
46,098
THEjoezack/BoxPusher
public/js-roguelike-skeleton/src/renderer-layer.js
function(tileData1, tileData2){ var result = {}, key, val; for(key in tileData1){ result[key] = tileData1[key]; } for(key in tileData2){ val = tileData2[key]; if(val !== false && val !== void 0){ ...
javascript
function(tileData1, tileData2){ var result = {}, key, val; for(key in tileData1){ result[key] = tileData1[key]; } for(key in tileData2){ val = tileData2[key]; if(val !== false && val !== void 0){ ...
[ "function", "(", "tileData1", ",", "tileData2", ")", "{", "var", "result", "=", "{", "}", ",", "key", ",", "val", ";", "for", "(", "key", "in", "tileData1", ")", "{", "result", "[", "key", "]", "=", "tileData1", "[", "key", "]", ";", "}", "for", ...
Merges 2 `tileData` objects. Used to Merges layers of the same tile before drawing them. @method mergeTileData @param {TileData} tileData1 - `tileData` to merge to. @param {TileData} tileData2 - `tileData` to merge from, properties with values on tileData2 replace matching properties on tileData1 @return {TileData} A n...
[ "Merges", "2", "tileData", "objects", ".", "Used", "to", "Merges", "layers", "of", "the", "same", "tile", "before", "drawing", "them", "." ]
ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5
https://github.com/THEjoezack/BoxPusher/blob/ebd506f7e61d10e4d493cf1cad1fbd4b43be28d5/public/js-roguelike-skeleton/src/renderer-layer.js#L115-L128
46,099
jkphl/gulp-concat-flatten
index.js
endStream
function endStream(cb) { // If no files were passed in, no files go out ... if (!latestFile || (Object.keys(concats).length === 0 && concats.constructor === Object)) { cb(); return; } // Prepare a method for pushing the stream const pushJoinedFile = (join...
javascript
function endStream(cb) { // If no files were passed in, no files go out ... if (!latestFile || (Object.keys(concats).length === 0 && concats.constructor === Object)) { cb(); return; } // Prepare a method for pushing the stream const pushJoinedFile = (join...
[ "function", "endStream", "(", "cb", ")", "{", "// If no files were passed in, no files go out ...", "if", "(", "!", "latestFile", "||", "(", "Object", ".", "keys", "(", "concats", ")", ".", "length", "===", "0", "&&", "concats", ".", "constructor", "===", "Obj...
End the stream @param {Function} cb Callback
[ "End", "the", "stream" ]
0b59787b2ceb4538fcfb7907c2cec6ac452b4d87
https://github.com/jkphl/gulp-concat-flatten/blob/0b59787b2ceb4538fcfb7907c2cec6ac452b4d87/index.js#L175-L211