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
31,300
imonology/scalra
core/conn.js
Connection
function Connection (type, sender, from) { // provide default 'from' values from = from || {}; // connection-specific UUID this.connID = UTIL.createUUID(); // a project-specific / supplied name (can be account or app name) this.name = ''; // sender function associated with this connection this.connector ...
javascript
function Connection (type, sender, from) { // provide default 'from' values from = from || {}; // connection-specific UUID this.connID = UTIL.createUUID(); // a project-specific / supplied name (can be account or app name) this.name = ''; // sender function associated with this connection this.connector ...
[ "function", "Connection", "(", "type", ",", "sender", ",", "from", ")", "{", "// provide default 'from' values", "from", "=", "from", "||", "{", "}", ";", "// connection-specific UUID", "this", ".", "connID", "=", "UTIL", ".", "createUUID", "(", ")", ";", "/...
definition for a connection object
[ "definition", "for", "a", "connection", "object" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/conn.js#L168-L196
31,301
imonology/scalra
core/queue.js
function () { // get a event from the front of queue var tmdata = queue.dequeue(); // whether to keep processing (default is no) busy = false; // check if data exists if (tmdata === undefined) { return; } // handle the event if handler is a...
javascript
function () { // get a event from the front of queue var tmdata = queue.dequeue(); // whether to keep processing (default is no) busy = false; // check if data exists if (tmdata === undefined) { return; } // handle the event if handler is a...
[ "function", "(", ")", "{", "// get a event from the front of queue", "var", "tmdata", "=", "queue", ".", "dequeue", "(", ")", ";", "// whether to keep processing (default is no)", "busy", "=", "false", ";", "// check if data exists", "if", "(", "tmdata", "===", "undef...
this is private method to process
[ "this", "is", "private", "method", "to", "process" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/queue.js#L74-L131
31,302
imonology/scalra
extension/sync.js
function (arr) { // extract collection name if (arr && typeof arr._name === 'string') { var size = arr.length - arr._index; if (size <= 0) return false; LOG.sys('try to store to array [' + arr._name + '], # of elements to store: ' + size, 'SR.Sync'); // TODO: wasteful of space? // NOTE: only n...
javascript
function (arr) { // extract collection name if (arr && typeof arr._name === 'string') { var size = arr.length - arr._index; if (size <= 0) return false; LOG.sys('try to store to array [' + arr._name + '], # of elements to store: ' + size, 'SR.Sync'); // TODO: wasteful of space? // NOTE: only n...
[ "function", "(", "arr", ")", "{", "// extract collection name", "if", "(", "arr", "&&", "typeof", "arr", ".", "_name", "===", "'string'", ")", "{", "var", "size", "=", "arr", ".", "length", "-", "arr", ".", "_index", ";", "if", "(", "size", "<=", "0"...
store a particular record to DB
[ "store", "a", "particular", "record", "to", "DB" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/extension/sync.js#L62-L100
31,303
imonology/scalra
extension/sync.js
function (arrays, config, onDone) { var names = []; // load array's content from DB, if any SR.DB.getArray(SR.Settings.DB_NAME_SYNC, function (result) { // NOTE: if array does not exist it'll return success with an empty array if (result === null || result.length === 0) { LOG.warn('no a...
javascript
function (arrays, config, onDone) { var names = []; // load array's content from DB, if any SR.DB.getArray(SR.Settings.DB_NAME_SYNC, function (result) { // NOTE: if array does not exist it'll return success with an empty array if (result === null || result.length === 0) { LOG.warn('no a...
[ "function", "(", "arrays", ",", "config", ",", "onDone", ")", "{", "var", "names", "=", "[", "]", ";", "// load array's content from DB, if any\t", "SR", ".", "DB", ".", "getArray", "(", "SR", ".", "Settings", ".", "DB_NAME_SYNC", ",", "function", "(", "re...
load data from DB to an in-memory array returns a list of the names of arrays loaded
[ "load", "data", "from", "DB", "to", "an", "in", "-", "memory", "array", "returns", "a", "list", "of", "the", "names", "of", "arrays", "loaded" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/extension/sync.js#L212-L264
31,304
imonology/scalra
core/API.js
function (args, result, func, extra) { return new SR.promise(function (resolve, reject) { UTIL.safeCall(func, args, result, function () { UTIL.safeCall(resolve); }, extra); }); }
javascript
function (args, result, func, extra) { return new SR.promise(function (resolve, reject) { UTIL.safeCall(func, args, result, function () { UTIL.safeCall(resolve); }, extra); }); }
[ "function", "(", "args", ",", "result", ",", "func", ",", "extra", ")", "{", "return", "new", "SR", ".", "promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "UTIL", ".", "safeCall", "(", "func", ",", "args", ",", "result", ",", "fu...
define post-event action
[ "define", "post", "-", "event", "action" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/API.js#L52-L58
31,305
imonology/scalra
core/API.js
function (args, onDone, extra) { // if args are not provided then we shift the parameters if (typeof args === 'function') { extra = onDone; onDone = args; args = {}; } // TODO: perform argument type check (currently there's none, so internal API calls won't do type checks) // TODO: move checker to h...
javascript
function (args, onDone, extra) { // if args are not provided then we shift the parameters if (typeof args === 'function') { extra = onDone; onDone = args; args = {}; } // TODO: perform argument type check (currently there's none, so internal API calls won't do type checks) // TODO: move checker to h...
[ "function", "(", "args", ",", "onDone", ",", "extra", ")", "{", "// if args are not provided then we shift the parameters", "if", "(", "typeof", "args", "===", "'function'", ")", "{", "extra", "=", "onDone", ";", "onDone", "=", "args", ";", "args", "=", "{", ...
define wrapper function
[ "define", "wrapper", "function" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/API.js#L81-L150
31,306
imonology/scalra
modules/account.js
function (account) { // check if DB is initialized if (typeof l_accounts === 'undefined') { LOG.error('DB module is not loaded, please enable DB module', l_name); return false; } if (l_accounts.hasOwnProperty(account) === false) { LOG.error('[' + account + '] not found', l_name); return false; } return ...
javascript
function (account) { // check if DB is initialized if (typeof l_accounts === 'undefined') { LOG.error('DB module is not loaded, please enable DB module', l_name); return false; } if (l_accounts.hasOwnProperty(account) === false) { LOG.error('[' + account + '] not found', l_name); return false; } return ...
[ "function", "(", "account", ")", "{", "// check if DB is initialized", "if", "(", "typeof", "l_accounts", "===", "'undefined'", ")", "{", "LOG", ".", "error", "(", "'DB module is not loaded, please enable DB module'", ",", "l_name", ")", ";", "return", "false", ";",...
helper functions check if an account is valid
[ "helper", "functions", "check", "if", "an", "account", "is", "valid" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/modules/account.js#L42-L55
31,307
imonology/scalra
modules/account.js
getUIDCallback
function getUIDCallback (err, uid) { if (err) { return onDone('UID_ERROR'); } var ip = (extra) ? extra.conn.host : "server"; // NOTE: by default a user is a normal user, user 'groups' can later be customized var reg = { uid: uid, account: args.account, password: l_encryptPass(args.password), ...
javascript
function getUIDCallback (err, uid) { if (err) { return onDone('UID_ERROR'); } var ip = (extra) ? extra.conn.host : "server"; // NOTE: by default a user is a normal user, user 'groups' can later be customized var reg = { uid: uid, account: args.account, password: l_encryptPass(args.password), ...
[ "function", "getUIDCallback", "(", "err", ",", "uid", ")", "{", "if", "(", "err", ")", "{", "return", "onDone", "(", "'UID_ERROR'", ")", ";", "}", "var", "ip", "=", "(", "extra", ")", "?", "extra", ".", "conn", ".", "host", ":", "\"server\"", ";", ...
generate unique user_id
[ "generate", "unique", "user_id" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/modules/account.js#L239-L272
31,308
imonology/scalra
core/app_connector.js
function (conn) { LOG.error('AppManager disconnected', 'SR.AppConnector'); if (SR.Settings.APPSERVER_AUTOSHUT === true) { // shutdown this frontier l_dispose(); SR.Settings.FRONTIER.dispose(); } else { LOG.warn('auto-shutdown is false, attempt to re-connect AppManager in ' + l_timeout...
javascript
function (conn) { LOG.error('AppManager disconnected', 'SR.AppConnector'); if (SR.Settings.APPSERVER_AUTOSHUT === true) { // shutdown this frontier l_dispose(); SR.Settings.FRONTIER.dispose(); } else { LOG.warn('auto-shutdown is false, attempt to re-connect AppManager in ' + l_timeout...
[ "function", "(", "conn", ")", "{", "LOG", ".", "error", "(", "'AppManager disconnected'", ",", "'SR.AppConnector'", ")", ";", "if", "(", "SR", ".", "Settings", ".", "APPSERVER_AUTOSHUT", "===", "true", ")", "{", "// shutdown this frontier", "l_dispose", "(", "...
custom handling for removing a connection
[ "custom", "handling", "for", "removing", "a", "connection" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/app_connector.js#L36-L52
31,309
imonology/scalra
core/app_connector.js
function () { LOG.warn('appinfo sent to lobby:'); LOG.warn(l_appinfo); // notify AppManager we're ready l_notifyLobby('SR_APP_READY', l_appinfo, 'SR_APP_READY_RES', function (event) { if (event.data.op === true) LOG.sys('SR_APP_READY returns ok', 'l_HandlerPool'); ...
javascript
function () { LOG.warn('appinfo sent to lobby:'); LOG.warn(l_appinfo); // notify AppManager we're ready l_notifyLobby('SR_APP_READY', l_appinfo, 'SR_APP_READY_RES', function (event) { if (event.data.op === true) LOG.sys('SR_APP_READY returns ok', 'l_HandlerPool'); ...
[ "function", "(", ")", "{", "LOG", ".", "warn", "(", "'appinfo sent to lobby:'", ")", ";", "LOG", ".", "warn", "(", "l_appinfo", ")", ";", "// notify AppManager we're ready", "l_notifyLobby", "(", "'SR_APP_READY'", ",", "l_appinfo", ",", "'SR_APP_READY_RES'", ",", ...
register myself as a app to app manager do it after connector init success
[ "register", "myself", "as", "a", "app", "to", "app", "manager", "do", "it", "after", "connector", "init", "success" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/app_connector.js#L102-L123
31,310
imonology/scalra
core/app_connector.js
function (ip_port, onDone) { if (l_appConnector === undefined) { LOG.warn('appConnector not init, cannot connect'); return; } // retrieve from previous connect attempt, also store for later connect attempt // TODO: will need to change when lobby port becomes not fixed ip_port = ip_port || l_ip_port; l_ip_p...
javascript
function (ip_port, onDone) { if (l_appConnector === undefined) { LOG.warn('appConnector not init, cannot connect'); return; } // retrieve from previous connect attempt, also store for later connect attempt // TODO: will need to change when lobby port becomes not fixed ip_port = ip_port || l_ip_port; l_ip_p...
[ "function", "(", "ip_port", ",", "onDone", ")", "{", "if", "(", "l_appConnector", "===", "undefined", ")", "{", "LOG", ".", "warn", "(", "'appConnector not init, cannot connect'", ")", ";", "return", ";", "}", "// retrieve from previous connect attempt, also store for...
attempt to connect to manager
[ "attempt", "to", "connect", "to", "manager" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/app_connector.js#L126-L155
31,311
imonology/scalra
demo/lobby/router.js
function (req) { var session = l_getSession(req); if (session.hasOwnProperty('_user')) { var login = session._user; login.admin = (session._user.account === 'admin'); return login; } LOG.warn('user not yet logined...'); return {control: {groups: [], permissions: []}}; }
javascript
function (req) { var session = l_getSession(req); if (session.hasOwnProperty('_user')) { var login = session._user; login.admin = (session._user.account === 'admin'); return login; } LOG.warn('user not yet logined...'); return {control: {groups: [], permissions: []}}; }
[ "function", "(", "req", ")", "{", "var", "session", "=", "l_getSession", "(", "req", ")", ";", "if", "(", "session", ".", "hasOwnProperty", "(", "'_user'", ")", ")", "{", "var", "login", "=", "session", ".", "_user", ";", "login", ".", "admin", "=", ...
pass in request object, returns session data if logined, otherwise returns null
[ "pass", "in", "request", "object", "returns", "session", "data", "if", "logined", "otherwise", "returns", "null" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/demo/lobby/router.js#L31-L41
31,312
gastonelhordoy/grunt-rpm
tasks/rpm.js
copyFilesToPack
function copyFilesToPack(grunt, buildPath, filesToPack) { return function(callback) { grunt.util.async.forEach(filesToPack, function(fileConfig, callback) { try { var filepathDest; if (detectDestType(grunt, fileConfig.dest) === 'directory') { var dest = (fileConfig.orig.expand) ? fileConfig.dest : pa...
javascript
function copyFilesToPack(grunt, buildPath, filesToPack) { return function(callback) { grunt.util.async.forEach(filesToPack, function(fileConfig, callback) { try { var filepathDest; if (detectDestType(grunt, fileConfig.dest) === 'directory') { var dest = (fileConfig.orig.expand) ? fileConfig.dest : pa...
[ "function", "copyFilesToPack", "(", "grunt", ",", "buildPath", ",", "filesToPack", ")", "{", "return", "function", "(", "callback", ")", "{", "grunt", ".", "util", ".", "async", ".", "forEach", "(", "filesToPack", ",", "function", "(", "fileConfig", ",", "...
Copy all the selected files to the tmp folder which wikll be the buildroot directory for rpmbuild
[ "Copy", "all", "the", "selected", "files", "to", "the", "tmp", "folder", "which", "wikll", "be", "the", "buildroot", "directory", "for", "rpmbuild" ]
8c6761959f912aab7234b68ea40893612d6b9b3d
https://github.com/gastonelhordoy/grunt-rpm/blob/8c6761959f912aab7234b68ea40893612d6b9b3d/tasks/rpm.js#L93-L141
31,313
gastonelhordoy/grunt-rpm
tasks/rpm.js
writeSpecFile
function writeSpecFile(grunt, options, filesToPack) { return function(callback) { try { var specPath = path.join(options.destination, specFolder); options.files = filesToPack; var pkg = grunt.file.readJSON('package.json'); grunt.util._.defaults(options, pkg); options.specFilepath = path.join(specP...
javascript
function writeSpecFile(grunt, options, filesToPack) { return function(callback) { try { var specPath = path.join(options.destination, specFolder); options.files = filesToPack; var pkg = grunt.file.readJSON('package.json'); grunt.util._.defaults(options, pkg); options.specFilepath = path.join(specP...
[ "function", "writeSpecFile", "(", "grunt", ",", "options", ",", "filesToPack", ")", "{", "return", "function", "(", "callback", ")", "{", "try", "{", "var", "specPath", "=", "path", ".", "join", "(", "options", ".", "destination", ",", "specFolder", ")", ...
Write the spec file that rpmbuild will read for the rpm details
[ "Write", "the", "spec", "file", "that", "rpmbuild", "will", "read", "for", "the", "rpm", "details" ]
8c6761959f912aab7234b68ea40893612d6b9b3d
https://github.com/gastonelhordoy/grunt-rpm/blob/8c6761959f912aab7234b68ea40893612d6b9b3d/tasks/rpm.js#L146-L160
31,314
imonology/scalra
modules/cloud_connector.js
function () { if (l_ip_port === undefined) { LOG.warn('not init (or already disposed), cannot connect to server'); return; } if (l_connector === undefined) l_connector = new SR.Connector(l_config); // establish connection LOG.warn('connecting to: ' + l_ip_port); l_connector.connect(l_ip_port, func...
javascript
function () { if (l_ip_port === undefined) { LOG.warn('not init (or already disposed), cannot connect to server'); return; } if (l_connector === undefined) l_connector = new SR.Connector(l_config); // establish connection LOG.warn('connecting to: ' + l_ip_port); l_connector.connect(l_ip_port, func...
[ "function", "(", ")", "{", "if", "(", "l_ip_port", "===", "undefined", ")", "{", "LOG", ".", "warn", "(", "'not init (or already disposed), cannot connect to server'", ")", ";", "return", ";", "}", "if", "(", "l_connector", "===", "undefined", ")", "l_connector"...
connect to cloud server
[ "connect", "to", "cloud", "server" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/modules/cloud_connector.js#L36-L62
31,315
imonology/scalra
monitor/REST_handle.js
function (res, res_obj) { // return response if exist, otherwise response might be returned // AFTER some callback is done handling (i.e., response will be returned within the handler) if (typeof res_obj === 'string') { LOG.sys('replying a string: ' + res_obj); res.writeHead(200, {'Content...
javascript
function (res, res_obj) { // return response if exist, otherwise response might be returned // AFTER some callback is done handling (i.e., response will be returned within the handler) if (typeof res_obj === 'string') { LOG.sys('replying a string: ' + res_obj); res.writeHead(200, {'Content...
[ "function", "(", "res", ",", "res_obj", ")", "{", "// return response if exist, otherwise response might be returned ", "// AFTER some callback is done handling (i.e., response will be returned within the handler)", "if", "(", "typeof", "res_obj", "===", "'string'", ")", "{", "LOG"...
helper code send back response to client
[ "helper", "code", "send", "back", "response", "to", "client" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/monitor/REST_handle.js#L31-L45
31,316
imonology/scalra
monitor/REST_handle.js
function (ports) { var port = ports[0]; var list = ''; for (var i=0; i < ports.length; i++) { list += (ports[i] + ', '); delete l_ports[ports[i]]; } LOG.warn('release ports: ' + list, 'SR.Monitor'); // remove all other ports associated with this port for (var i in l_ports) { if (l_ports[i] === port) ...
javascript
function (ports) { var port = ports[0]; var list = ''; for (var i=0; i < ports.length; i++) { list += (ports[i] + ', '); delete l_ports[ports[i]]; } LOG.warn('release ports: ' + list, 'SR.Monitor'); // remove all other ports associated with this port for (var i in l_ports) { if (l_ports[i] === port) ...
[ "function", "(", "ports", ")", "{", "var", "port", "=", "ports", "[", "0", "]", ";", "var", "list", "=", "''", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "ports", ".", "length", ";", "i", "++", ")", "{", "list", "+=", "(", "ports...
recycle an app port
[ "recycle", "an", "app", "port" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/monitor/REST_handle.js#L49-L68
31,317
imonology/scalra
monitor/REST_handle.js
function (port, parent_port) { // check if the port wasn't reported if (l_ports.hasOwnProperty(port) === false) { LOG.warn('recording used port [' + port + ']...', 'SR.Monitor'); l_ports[port] = parent_port || port; } }
javascript
function (port, parent_port) { // check if the port wasn't reported if (l_ports.hasOwnProperty(port) === false) { LOG.warn('recording used port [' + port + ']...', 'SR.Monitor'); l_ports[port] = parent_port || port; } }
[ "function", "(", "port", ",", "parent_port", ")", "{", "// check if the port wasn't reported", "if", "(", "l_ports", ".", "hasOwnProperty", "(", "port", ")", "===", "false", ")", "{", "LOG", ".", "warn", "(", "'recording used port ['", "+", "port", "+", "']......
record an existing port 'parent_port' indicats the which port, if released, will also release the current port
[ "record", "an", "existing", "port", "parent_port", "indicats", "the", "which", "port", "if", "released", "will", "also", "release", "the", "current", "port" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/monitor/REST_handle.js#L72-L80
31,318
imonology/scalra
monitor/REST_handle.js
function (size) { size = size || 1; LOG.warn('trying to assign ' + size + ' new ports...', 'SR.Monitor'); // find first available port var port = SR.Settings.PORT_APP_RANGE_START; var last_port = SR.Settings.PORT_APP_RANGE_END; // first port found var first_port = undefined; var results = []; while (port...
javascript
function (size) { size = size || 1; LOG.warn('trying to assign ' + size + ' new ports...', 'SR.Monitor'); // find first available port var port = SR.Settings.PORT_APP_RANGE_START; var last_port = SR.Settings.PORT_APP_RANGE_END; // first port found var first_port = undefined; var results = []; while (port...
[ "function", "(", "size", ")", "{", "size", "=", "size", "||", "1", ";", "LOG", ".", "warn", "(", "'trying to assign '", "+", "size", "+", "' new ports...'", ",", "'SR.Monitor'", ")", ";", "// find first available port", "var", "port", "=", "SR", ".", "Sett...
assign a unique application port
[ "assign", "a", "unique", "application", "port" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/monitor/REST_handle.js#L83-L123
31,319
imonology/scalra
monitor/REST_handle.js
function () { var currTime = new Date(); var overtime = (SR.Settings.INTERVAL_STAT_REPORT * 2); // remove servers no longer reporting for (var serverID in SR.Report.servers) { var stat = SR.Report.servers[serverID]; if (!stat || !stat.reportedTime) continue; // server considered dead if (currTime...
javascript
function () { var currTime = new Date(); var overtime = (SR.Settings.INTERVAL_STAT_REPORT * 2); // remove servers no longer reporting for (var serverID in SR.Report.servers) { var stat = SR.Report.servers[serverID]; if (!stat || !stat.reportedTime) continue; // server considered dead if (currTime...
[ "function", "(", ")", "{", "var", "currTime", "=", "new", "Date", "(", ")", ";", "var", "overtime", "=", "(", "SR", ".", "Settings", ".", "INTERVAL_STAT_REPORT", "*", "2", ")", ";", "// remove servers no longer reporting", "for", "(", "var", "serverID", "i...
internal functions periodic checking liveness of app servers
[ "internal", "functions", "periodic", "checking", "liveness", "of", "app", "servers" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/monitor/REST_handle.js#L131-L158
31,320
imonology/scalra
core/REST/handler.js
function(req) { return ((req.headers.origin && req.headers.origin !== "null") ? req.headers.origin : "*"); }
javascript
function(req) { return ((req.headers.origin && req.headers.origin !== "null") ? req.headers.origin : "*"); }
[ "function", "(", "req", ")", "{", "return", "(", "(", "req", ".", "headers", ".", "origin", "&&", "req", ".", "headers", ".", "origin", "!==", "\"null\"", ")", "?", "req", ".", "headers", ".", "origin", ":", "\"*\"", ")", ";", "}" ]
helper code get origin from request
[ "helper", "code", "get", "origin", "from", "request" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/REST/handler.js#L32-L34
31,321
imonology/scalra
core/REST/handler.js
function (res_obj, data, conn) { // check if we should return empty response if (typeof res_obj === 'undefined') { SR.REST.reply(res, {}); return true; } // check for special case processing (SR_REDIRECT) if (res_obj[SR.Tags.UPDATE] === 'SR_REDIRECT' && res_obj[SR.Tags.PARA] && res_obj[SR.Tags.PARA].u...
javascript
function (res_obj, data, conn) { // check if we should return empty response if (typeof res_obj === 'undefined') { SR.REST.reply(res, {}); return true; } // check for special case processing (SR_REDIRECT) if (res_obj[SR.Tags.UPDATE] === 'SR_REDIRECT' && res_obj[SR.Tags.PARA] && res_obj[SR.Tags.PARA].u...
[ "function", "(", "res_obj", ",", "data", ",", "conn", ")", "{", "// check if we should return empty response", "if", "(", "typeof", "res_obj", "===", "'undefined'", ")", "{", "SR", ".", "REST", ".", "reply", "(", "res", ",", "{", "}", ")", ";", "return", ...
callback to return response to client
[ "callback", "to", "return", "response", "to", "client" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/REST/handler.js#L81-L243
31,322
imonology/scalra
core/REST/handler.js
function() { var origin = _getOrigin(req); SR.REST.reply(res, res_str, { origin: origin }); }
javascript
function() { var origin = _getOrigin(req); SR.REST.reply(res, res_str, { origin: origin }); }
[ "function", "(", ")", "{", "var", "origin", "=", "_getOrigin", "(", "req", ")", ";", "SR", ".", "REST", ".", "reply", "(", "res", ",", "res_str", ",", "{", "origin", ":", "origin", "}", ")", ";", "}" ]
replying the request
[ "replying", "the", "request" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/REST/handler.js#L329-L334
31,323
imonology/scalra
core/DB.js
function (clt_name, op, err, onFail, is_exception) { var msg = 'DB ' + op + ' error for [' + clt_name + ']'; LOG.error(msg, 'SR.DB'); LOG.error(err, 'SR.DB'); if (typeof err.stack !== 'undefined') { LOG.error(err.stack, 'SR.DB'); msg += ('\n\n' + err.stack); } UTIL.safeCall(onFail, err); if (is_exception) ...
javascript
function (clt_name, op, err, onFail, is_exception) { var msg = 'DB ' + op + ' error for [' + clt_name + ']'; LOG.error(msg, 'SR.DB'); LOG.error(err, 'SR.DB'); if (typeof err.stack !== 'undefined') { LOG.error(err.stack, 'SR.DB'); msg += ('\n\n' + err.stack); } UTIL.safeCall(onFail, err); if (is_exception) ...
[ "function", "(", "clt_name", ",", "op", ",", "err", ",", "onFail", ",", "is_exception", ")", "{", "var", "msg", "=", "'DB '", "+", "op", "+", "' error for ['", "+", "clt_name", "+", "']'", ";", "LOG", ".", "error", "(", "msg", ",", "'SR.DB'", ")", ...
helper to notify DB error
[ "helper", "to", "notify", "DB", "error" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/DB.js#L263-L284
31,324
imonology/scalra
core/DB.js
function (err_toArray, array) { if (err_toArray) { return l_notifyError(clt_name, 'getPage.toArray', err_toArray, cb); } //LOG.sys('array found succces, length: ' + array.length, 'SR.DB'); // NOTE: probably no need to check if (array.length === _opts.limit) { UTIL.safeCall(cb, null, array, arra...
javascript
function (err_toArray, array) { if (err_toArray) { return l_notifyError(clt_name, 'getPage.toArray', err_toArray, cb); } //LOG.sys('array found succces, length: ' + array.length, 'SR.DB'); // NOTE: probably no need to check if (array.length === _opts.limit) { UTIL.safeCall(cb, null, array, arra...
[ "function", "(", "err_toArray", ",", "array", ")", "{", "if", "(", "err_toArray", ")", "{", "return", "l_notifyError", "(", "clt_name", ",", "'getPage.toArray'", ",", "err_toArray", ",", "cb", ")", ";", "}", "//LOG.sys('array found succces, length: ' + array.length,...
convert result to an array
[ "convert", "result", "to", "an", "array" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/DB.js#L867-L880
31,325
particle-iot/particle-commands
src/cmd/library_install.js
nameVersionInstallStrategy
function nameVersionInstallStrategy(baseDir) { return (name, version) => { if (!version) { throw Error('hey I need a version!'); } // todo - should probably instead instantiate the appropriate library repository // so we get reuse and consistency return path.join(baseDir, name+'@'+version); }; }
javascript
function nameVersionInstallStrategy(baseDir) { return (name, version) => { if (!version) { throw Error('hey I need a version!'); } // todo - should probably instead instantiate the appropriate library repository // so we get reuse and consistency return path.join(baseDir, name+'@'+version); }; }
[ "function", "nameVersionInstallStrategy", "(", "baseDir", ")", "{", "return", "(", "name", ",", "version", ")", "=>", "{", "if", "(", "!", "version", ")", "{", "throw", "Error", "(", "'hey I need a version!'", ")", ";", "}", "// todo - should probably instead in...
A strategy factory that determines where to place libraries when installed to a shared directory. @param {string} baseDir the shared directory where the library should be installed ot @returns {function(*, *=)} A function that provides the target library directory
[ "A", "strategy", "factory", "that", "determines", "where", "to", "place", "libraries", "when", "installed", "to", "a", "shared", "directory", "." ]
012252e0faef5f4ee21aa3b36c58eace7296a633
https://github.com/particle-iot/particle-commands/blob/012252e0faef5f4ee21aa3b36c58eace7296a633/src/cmd/library_install.js#L101-L110
31,326
imonology/scalra
lib/SR_REST.js
function (type, para) { // avoid flooding if SR_PUBLISH is sending streaming data SR.Log('[' + type + '] received'); switch (type) { // // pubsub related // // when a new published message arrives case 'SR_MSG': // handle server-published messages case 'SR_PUBLISH': if (onChannelMessage...
javascript
function (type, para) { // avoid flooding if SR_PUBLISH is sending streaming data SR.Log('[' + type + '] received'); switch (type) { // // pubsub related // // when a new published message arrives case 'SR_MSG': // handle server-published messages case 'SR_PUBLISH': if (onChannelMessage...
[ "function", "(", "type", ",", "para", ")", "{", "// avoid flooding if SR_PUBLISH is sending streaming data", "SR", ".", "Log", "(", "'['", "+", "type", "+", "'] received'", ")", ";", "switch", "(", "type", ")", "{", "//", "// pubsub related", "//", "// when a ne...
generic response callback for system-defined messages
[ "generic", "response", "callback", "for", "system", "-", "defined", "messages" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/lib/SR_REST.js#L283-L387
31,327
imonology/scalra
lib/SR_REST.js
function (entry) { if (typeof entry === 'number' && entry < entryServers.length) { entryServers.splice(entry, 1); return true; } else if (typeof entry === 'string') { for (var i=0; i < entryServers.length; i++) { if (entryServers[i] === entry) { entryServers.splice(i, 1); SR.Log('remove en...
javascript
function (entry) { if (typeof entry === 'number' && entry < entryServers.length) { entryServers.splice(entry, 1); return true; } else if (typeof entry === 'string') { for (var i=0; i < entryServers.length; i++) { if (entryServers[i] === entry) { entryServers.splice(i, 1); SR.Log('remove en...
[ "function", "(", "entry", ")", "{", "if", "(", "typeof", "entry", "===", "'number'", "&&", "entry", "<", "entryServers", ".", "length", ")", "{", "entryServers", ".", "splice", "(", "entry", ",", "1", ")", ";", "return", "true", ";", "}", "else", "if...
remove a given entry server
[ "remove", "a", "given", "entry", "server" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/lib/SR_REST.js#L401-L416
31,328
imonology/scalra
lib/SR_REST.js
function (name) { return function (args, onDone) { if (typeof args === 'function') { onDone = args; args = {}; } console.log('calling API [' + name + ']...'); // NOTE: by default callbacks are always kept SR.sendEvent(name, args, function (result) { if (result.err) {...
javascript
function (name) { return function (args, onDone) { if (typeof args === 'function') { onDone = args; args = {}; } console.log('calling API [' + name + ']...'); // NOTE: by default callbacks are always kept SR.sendEvent(name, args, function (result) { if (result.err) {...
[ "function", "(", "name", ")", "{", "return", "function", "(", "args", ",", "onDone", ")", "{", "if", "(", "typeof", "args", "===", "'function'", ")", "{", "onDone", "=", "args", ";", "args", "=", "{", "}", ";", "}", "console", ".", "log", "(", "'...
build a specific API
[ "build", "a", "specific", "API" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/lib/SR_REST.js#L996-L1016
31,329
imonology/scalra
core/frontier.js
function (root_path, default_prefix) { var arr = SR.Settings.SR_PATH.split(SR.path.sep); var prefix = arr[arr.length-1] + '-'; var dirs = UTIL.getDirectoriesSync(root_path); if (default_prefix) prefix = default_prefix; //LOG.warn('default_prefix: ' + default_prefix + ' prefix: ' + prefix + ' paths to c...
javascript
function (root_path, default_prefix) { var arr = SR.Settings.SR_PATH.split(SR.path.sep); var prefix = arr[arr.length-1] + '-'; var dirs = UTIL.getDirectoriesSync(root_path); if (default_prefix) prefix = default_prefix; //LOG.warn('default_prefix: ' + default_prefix + ' prefix: ' + prefix + ' paths to c...
[ "function", "(", "root_path", ",", "default_prefix", ")", "{", "var", "arr", "=", "SR", ".", "Settings", ".", "SR_PATH", ".", "split", "(", "SR", ".", "path", ".", "sep", ")", ";", "var", "prefix", "=", "arr", "[", "arr", ".", "length", "-", "1", ...
build module path from a root path
[ "build", "module", "path", "from", "a", "root", "path" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/frontier.js#L130-L145
31,330
imonology/scalra
core/script.js
function (fullpath, publname) { var curr_time = new Date(); // store script if modified for first time if (fullpath !== undefined && publname !== undefined) { if (l_modified_scripts.hasOwnProperty(fullpath) === false) { LOG.warn('script modified: ' + fullp...
javascript
function (fullpath, publname) { var curr_time = new Date(); // store script if modified for first time if (fullpath !== undefined && publname !== undefined) { if (l_modified_scripts.hasOwnProperty(fullpath) === false) { LOG.warn('script modified: ' + fullp...
[ "function", "(", "fullpath", ",", "publname", ")", "{", "var", "curr_time", "=", "new", "Date", "(", ")", ";", "// store script if modified for first time", "if", "(", "fullpath", "!==", "undefined", "&&", "publname", "!==", "undefined", ")", "{", "if", "(", ...
script loader, will check periodically if modified script queue is non-empty
[ "script", "loader", "will", "check", "periodically", "if", "modified", "script", "queue", "is", "non", "-", "empty" ]
0cf7377d02bf1e6beb90d6821c144eefb89feaa9
https://github.com/imonology/scalra/blob/0cf7377d02bf1e6beb90d6821c144eefb89feaa9/core/script.js#L26-L108
31,331
doowb/sma
index.js
sma
function sma(arr, range, format) { if (!Array.isArray(arr)) { throw TypeError('expected first argument to be an array'); } var fn = typeof format === 'function' ? format : toFixed; var num = range || arr.length; var res = []; var len = arr.length + 1; var idx = num - 1; while (++idx < len) { re...
javascript
function sma(arr, range, format) { if (!Array.isArray(arr)) { throw TypeError('expected first argument to be an array'); } var fn = typeof format === 'function' ? format : toFixed; var num = range || arr.length; var res = []; var len = arr.length + 1; var idx = num - 1; while (++idx < len) { re...
[ "function", "sma", "(", "arr", ",", "range", ",", "format", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "arr", ")", ")", "{", "throw", "TypeError", "(", "'expected first argument to be an array'", ")", ";", "}", "var", "fn", "=", "typeof", ...
Calculate the simple moving average of an array. A new array is returned with the average of each range of elements. A range will only be calculated when it contains enough elements to fill the range. ```js console.log(sma([1, 2, 3, 4, 5, 6, 7, 8, 9], 4)); //=> [ '2.50', '3.50', '4.50', '5.50', '6.50', '7.50' ] //=> ...
[ "Calculate", "the", "simple", "moving", "average", "of", "an", "array", ".", "A", "new", "array", "is", "returned", "with", "the", "average", "of", "each", "range", "of", "elements", ".", "A", "range", "will", "only", "be", "calculated", "when", "it", "c...
4c419042c0377bf6c78a8c94832f3d2a59e11a72
https://github.com/doowb/sma/blob/4c419042c0377bf6c78a8c94832f3d2a59e11a72/index.js#L24-L38
31,332
doowb/sma
index.js
avg
function avg(arr, idx, range) { return sum(arr.slice(idx - range, idx)) / range; }
javascript
function avg(arr, idx, range) { return sum(arr.slice(idx - range, idx)) / range; }
[ "function", "avg", "(", "arr", ",", "idx", ",", "range", ")", "{", "return", "sum", "(", "arr", ".", "slice", "(", "idx", "-", "range", ",", "idx", ")", ")", "/", "range", ";", "}" ]
Create an average for the specified range. ```js console.log(avg([1, 2, 3, 4, 5, 6, 7, 8, 9], 5, 4)); //=> 3.5 ``` @param {Array} `arr` Array to pull the range from. @param {Number} `idx` Index of element being calculated @param {Number} `range` Size of range to calculate. @return {Number} Average of range.
[ "Create", "an", "average", "for", "the", "specified", "range", "." ]
4c419042c0377bf6c78a8c94832f3d2a59e11a72
https://github.com/doowb/sma/blob/4c419042c0377bf6c78a8c94832f3d2a59e11a72/index.js#L53-L55
31,333
doowb/sma
index.js
sum
function sum(arr) { var len = arr.length; var num = 0; while (len--) num += Number(arr[len]); return num; }
javascript
function sum(arr) { var len = arr.length; var num = 0; while (len--) num += Number(arr[len]); return num; }
[ "function", "sum", "(", "arr", ")", "{", "var", "len", "=", "arr", ".", "length", ";", "var", "num", "=", "0", ";", "while", "(", "len", "--", ")", "num", "+=", "Number", "(", "arr", "[", "len", "]", ")", ";", "return", "num", ";", "}" ]
Calculate the sum of an array. @param {Array} `arr` Array @return {Number} Sum
[ "Calculate", "the", "sum", "of", "an", "array", "." ]
4c419042c0377bf6c78a8c94832f3d2a59e11a72
https://github.com/doowb/sma/blob/4c419042c0377bf6c78a8c94832f3d2a59e11a72/index.js#L63-L68
31,334
protacon/ng-virtual-keyboard
dist/layouts.js
isSpecial
function isSpecial(key) { if (key.length > 1) { return !!exports.specialKeys.filter(function (specialKey) { var pattern = new RegExp("^(" + specialKey + ")(:(\\d+(\\.\\d+)?))?$", 'g'); return pattern.test(key); }).length; } return false; }
javascript
function isSpecial(key) { if (key.length > 1) { return !!exports.specialKeys.filter(function (specialKey) { var pattern = new RegExp("^(" + specialKey + ")(:(\\d+(\\.\\d+)?))?$", 'g'); return pattern.test(key); }).length; } return false; }
[ "function", "isSpecial", "(", "key", ")", "{", "if", "(", "key", ".", "length", ">", "1", ")", "{", "return", "!", "!", "exports", ".", "specialKeys", ".", "filter", "(", "function", "(", "specialKey", ")", "{", "var", "pattern", "=", "new", "RegExp"...
Helper function to determine if given key is special or not. @param {string} key @returns {boolean}
[ "Helper", "function", "to", "determine", "if", "given", "key", "is", "special", "or", "not", "." ]
cb55c5bbbb85e5a7e47eb8b84e90748a0b7fd9a8
https://github.com/protacon/ng-virtual-keyboard/blob/cb55c5bbbb85e5a7e47eb8b84e90748a0b7fd9a8/dist/layouts.js#L84-L92
31,335
protacon/ng-virtual-keyboard
dist/layouts.js
keyboardCapsLockLayout
function keyboardCapsLockLayout(layout, caps) { return layout.map(function (row) { return row.map(function (key) { return isSpecial(key) ? key : (caps ? key.toUpperCase() : key.toLowerCase()); }); }); }
javascript
function keyboardCapsLockLayout(layout, caps) { return layout.map(function (row) { return row.map(function (key) { return isSpecial(key) ? key : (caps ? key.toUpperCase() : key.toLowerCase()); }); }); }
[ "function", "keyboardCapsLockLayout", "(", "layout", ",", "caps", ")", "{", "return", "layout", ".", "map", "(", "function", "(", "row", ")", "{", "return", "row", ".", "map", "(", "function", "(", "key", ")", "{", "return", "isSpecial", "(", "key", ")...
Function to change specified layout to CapsLock layout. @param {KeyboardLayout} layout @param {boolean} caps @returns {KeyboardLayout}
[ "Function", "to", "change", "specified", "layout", "to", "CapsLock", "layout", "." ]
cb55c5bbbb85e5a7e47eb8b84e90748a0b7fd9a8
https://github.com/protacon/ng-virtual-keyboard/blob/cb55c5bbbb85e5a7e47eb8b84e90748a0b7fd9a8/dist/layouts.js#L101-L107
31,336
nolanlawson/node-websql
lib/websql/WebSQLDatabase.js
TransactionTask
function TransactionTask(readOnly, txnCallback, errorCallback, successCallback) { this.readOnly = readOnly; this.txnCallback = txnCallback; this.errorCallback = errorCallback; this.successCallback = successCallback; }
javascript
function TransactionTask(readOnly, txnCallback, errorCallback, successCallback) { this.readOnly = readOnly; this.txnCallback = txnCallback; this.errorCallback = errorCallback; this.successCallback = successCallback; }
[ "function", "TransactionTask", "(", "readOnly", ",", "txnCallback", ",", "errorCallback", ",", "successCallback", ")", "{", "this", ".", "readOnly", "=", "readOnly", ";", "this", ".", "txnCallback", "=", "txnCallback", ";", "this", ".", "errorCallback", "=", "...
v8 likes predictable objects
[ "v8", "likes", "predictable", "objects" ]
ab6d7e06e00909046b98250da71248802935a284
https://github.com/nolanlawson/node-websql/blob/ab6d7e06e00909046b98250da71248802935a284/lib/websql/WebSQLDatabase.js#L18-L23
31,337
typicode/pinst
index.js
renameKey
function renameKey(obj, prevKey, nextKey) { return mapKeys(obj, (_, key) => (key === prevKey ? nextKey : key)) }
javascript
function renameKey(obj, prevKey, nextKey) { return mapKeys(obj, (_, key) => (key === prevKey ? nextKey : key)) }
[ "function", "renameKey", "(", "obj", ",", "prevKey", ",", "nextKey", ")", "{", "return", "mapKeys", "(", "obj", ",", "(", "_", ",", "key", ")", "=>", "(", "key", "===", "prevKey", "?", "nextKey", ":", "key", ")", ")", "}" ]
Rename key in object without changing its position
[ "Rename", "key", "in", "object", "without", "changing", "its", "position" ]
719b1046c7d65ba445b171561b492e38c2791148
https://github.com/typicode/pinst/blob/719b1046c7d65ba445b171561b492e38c2791148/index.js#L8-L10
31,338
obliquid/jslardo
public/javascripts/jslardo.js
openModal
function openModal(src, width) { if ( !width ) width = 680; //var elementId = 'orcodio'; var originalYScroll = window.pageYOffset; //var modalFrame = $.modal('<iframe id="'+ elementId +'" src="' + src + '" width="' + width + '" onload="centerModal(this,' + originalYScroll + ')" style="border:0">', { var modalFrame...
javascript
function openModal(src, width) { if ( !width ) width = 680; //var elementId = 'orcodio'; var originalYScroll = window.pageYOffset; //var modalFrame = $.modal('<iframe id="'+ elementId +'" src="' + src + '" width="' + width + '" onload="centerModal(this,' + originalYScroll + ')" style="border:0">', { var modalFrame...
[ "function", "openModal", "(", "src", ",", "width", ")", "{", "if", "(", "!", "width", ")", "width", "=", "680", ";", "//var elementId = 'orcodio';", "var", "originalYScroll", "=", "window", ".", "pageYOffset", ";", "//var modalFrame = $.modal('<iframe id=\"'+ elemen...
open modal iframe popup
[ "open", "modal", "iframe", "popup" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/public/javascripts/jslardo.js#L68-L87
31,339
obliquid/jslardo
public/javascripts/jslardo.js
selectTab
function selectTab(tab,content) { //deseleziono tutti i tab $('#'+tab).parent().children().removeClass('tabButtonSelected'); //seleziono il tab cliccato $('#'+tab).addClass('tabButtonSelected'); //nascondo tutti i content $('#'+content).parent().children().fadeOut('fast'); //seleziono il tab cliccato $('#'+cont...
javascript
function selectTab(tab,content) { //deseleziono tutti i tab $('#'+tab).parent().children().removeClass('tabButtonSelected'); //seleziono il tab cliccato $('#'+tab).addClass('tabButtonSelected'); //nascondo tutti i content $('#'+content).parent().children().fadeOut('fast'); //seleziono il tab cliccato $('#'+cont...
[ "function", "selectTab", "(", "tab", ",", "content", ")", "{", "//deseleziono tutti i tab", "$", "(", "'#'", "+", "tab", ")", ".", "parent", "(", ")", ".", "children", "(", ")", ".", "removeClass", "(", "'tabButtonSelected'", ")", ";", "//seleziono il tab cl...
select a tab, displaying its content
[ "select", "a", "tab", "displaying", "its", "content" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/public/javascripts/jslardo.js#L161-L170
31,340
GruntBlanketMocha/grunt-blanket-mocha
support/grunt-reporter.js
function( data ) { var ret = { coverage: 0, hits: 0, misses: 0, sloc: 0 }; for (var i = 0; i < data.source.length; i++) { var line = data.source[i]; var num = i + 1; if (data[num] === 0) { ret.mis...
javascript
function( data ) { var ret = { coverage: 0, hits: 0, misses: 0, sloc: 0 }; for (var i = 0; i < data.source.length; i++) { var line = data.source[i]; var num = i + 1; if (data[num] === 0) { ret.mis...
[ "function", "(", "data", ")", "{", "var", "ret", "=", "{", "coverage", ":", "0", ",", "hits", ":", "0", ",", "misses", ":", "0", ",", "sloc", ":", "0", "}", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "data", ".", "source", ".", ...
helper function for computing coverage info for a particular file
[ "helper", "function", "for", "computing", "coverage", "info", "for", "a", "particular", "file" ]
c210fc13d9d4df73b10de0439940140a70768020
https://github.com/GruntBlanketMocha/grunt-blanket-mocha/blob/c210fc13d9d4df73b10de0439940140a70768020/support/grunt-reporter.js#L23-L45
31,341
GruntBlanketMocha/grunt-blanket-mocha
support/grunt-reporter.js
function(cov){ cov = window._$blanket; var sortedFileNames = []; var totals =[]; for (var filename in cov) { if (cov.hasOwnProperty(filename)) { sortedFileNames.push(filename); } } sortedFileNames.sort(); for (var i = 0...
javascript
function(cov){ cov = window._$blanket; var sortedFileNames = []; var totals =[]; for (var filename in cov) { if (cov.hasOwnProperty(filename)) { sortedFileNames.push(filename); } } sortedFileNames.sort(); for (var i = 0...
[ "function", "(", "cov", ")", "{", "cov", "=", "window", ".", "_$blanket", ";", "var", "sortedFileNames", "=", "[", "]", ";", "var", "totals", "=", "[", "]", ";", "for", "(", "var", "filename", "in", "cov", ")", "{", "if", "(", "cov", ".", "hasOwn...
this function is invoked by blanket.js when the coverage data is ready. it will compute per-file coverage info, and send a message to the parent phantomjs process for each file, which the grunt task will use to report passes & failures.
[ "this", "function", "is", "invoked", "by", "blanket", ".", "js", "when", "the", "coverage", "data", "is", "ready", ".", "it", "will", "compute", "per", "-", "file", "coverage", "info", "and", "send", "a", "message", "to", "the", "parent", "phantomjs", "p...
c210fc13d9d4df73b10de0439940140a70768020
https://github.com/GruntBlanketMocha/grunt-blanket-mocha/blob/c210fc13d9d4df73b10de0439940140a70768020/support/grunt-reporter.js#L50-L74
31,342
ajay2507/lasso-unpack
lib/lasso-unpack.js
extractLiterals
function extractLiterals(stats, args) { if (stats.getType() != null && (stats.getType() === "installed" || stats.getType() === "builtin")) { extractLiteralFromInstalled(stats, args); } if (stats.getType() != null && stats.getType() === "def") { extractLiteralFromDef(stats, args[0]); } ...
javascript
function extractLiterals(stats, args) { if (stats.getType() != null && (stats.getType() === "installed" || stats.getType() === "builtin")) { extractLiteralFromInstalled(stats, args); } if (stats.getType() != null && stats.getType() === "def") { extractLiteralFromDef(stats, args[0]); } ...
[ "function", "extractLiterals", "(", "stats", ",", "args", ")", "{", "if", "(", "stats", ".", "getType", "(", ")", "!=", "null", "&&", "(", "stats", ".", "getType", "(", ")", "===", "\"installed\"", "||", "stats", ".", "getType", "(", ")", "===", "\"b...
extract literal from AST tree.
[ "extract", "literal", "from", "AST", "tree", "." ]
fb228b00a549eedfafec7e8eaf9999d69db82a0c
https://github.com/ajay2507/lasso-unpack/blob/fb228b00a549eedfafec7e8eaf9999d69db82a0c/lib/lasso-unpack.js#L74-L86
31,343
obliquid/jslardo
public/javascripts/jq/jstree/jquery.jstree.js
function () { if(this.is_focused()) { return; } var f = $.jstree._focused(); if(f) { f.unset_focus(); } this.get_container().addClass("jstree-focused"); focused_instance = this.get_index(); this.__callback(); }
javascript
function () { if(this.is_focused()) { return; } var f = $.jstree._focused(); if(f) { f.unset_focus(); } this.get_container().addClass("jstree-focused"); focused_instance = this.get_index(); this.__callback(); }
[ "function", "(", ")", "{", "if", "(", "this", ".", "is_focused", "(", ")", ")", "{", "return", ";", "}", "var", "f", "=", "$", ".", "jstree", ".", "_focused", "(", ")", ";", "if", "(", "f", ")", "{", "f", ".", "unset_focus", "(", ")", ";", ...
deal with focus
[ "deal", "with", "focus" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/public/javascripts/jq/jstree/jquery.jstree.js#L552-L560
31,344
KenanY/trigger-event
index.js
triggerEvent
function triggerEvent(el, type, options) { if (isString(el)) { options = type; type = el; el = document; } var e = createEvent(type, options); el.dispatchEvent ? el.dispatchEvent(e) : el.fireEvent('on' + type, e); }
javascript
function triggerEvent(el, type, options) { if (isString(el)) { options = type; type = el; el = document; } var e = createEvent(type, options); el.dispatchEvent ? el.dispatchEvent(e) : el.fireEvent('on' + type, e); }
[ "function", "triggerEvent", "(", "el", ",", "type", ",", "options", ")", "{", "if", "(", "isString", "(", "el", ")", ")", "{", "options", "=", "type", ";", "type", "=", "el", ";", "el", "=", "document", ";", "}", "var", "e", "=", "createEvent", "...
Trigger an event of `type` on an `el` with `options`. @param {Element} el @param {String} type @param {Object} options
[ "Trigger", "an", "event", "of", "type", "on", "an", "el", "with", "options", "." ]
f7f4f539a76eb04c5ebca9411f64d03edc9ee96d
https://github.com/KenanY/trigger-event/blob/f7f4f539a76eb04c5ebca9411f64d03edc9ee96d/index.js#L12-L24
31,345
bytbil/sauce-test-runner
src/WrapperError.js
WrapperError
function WrapperError(message, innerError) { // supports instantiating the object without the new keyword if (!(this instanceof WrapperError)) { return new WrapperError(message, innerError); } Error.call(this); Error.captureStackTrace(this, WrapperError); this.message = message; this.innerError = in...
javascript
function WrapperError(message, innerError) { // supports instantiating the object without the new keyword if (!(this instanceof WrapperError)) { return new WrapperError(message, innerError); } Error.call(this); Error.captureStackTrace(this, WrapperError); this.message = message; this.innerError = in...
[ "function", "WrapperError", "(", "message", ",", "innerError", ")", "{", "// supports instantiating the object without the new keyword", "if", "(", "!", "(", "this", "instanceof", "WrapperError", ")", ")", "{", "return", "new", "WrapperError", "(", "message", ",", "...
An Error object which wraps another Error instance. @constructor @extends Error @param {String} message - Error message. @param {Error} innerError - The Error instance to wrap.
[ "An", "Error", "object", "which", "wraps", "another", "Error", "instance", "." ]
db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e
https://github.com/bytbil/sauce-test-runner/blob/db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e/src/WrapperError.js#L11-L22
31,346
bytbil/sauce-test-runner
src/WrapperError.js
formatError
function formatError(error, stack) { if (origPrepareStackTrace) { return origPrepareStackTrace(error, stack); } return [ error.toString(), stack .map(function (frame) { return 'at ' + frame.toString(); }) .map(padLeft) .join('\n') ].join('\n'); }
javascript
function formatError(error, stack) { if (origPrepareStackTrace) { return origPrepareStackTrace(error, stack); } return [ error.toString(), stack .map(function (frame) { return 'at ' + frame.toString(); }) .map(padLeft) .join('\n') ].join('\n'); }
[ "function", "formatError", "(", "error", ",", "stack", ")", "{", "if", "(", "origPrepareStackTrace", ")", "{", "return", "origPrepareStackTrace", "(", "error", ",", "stack", ")", ";", "}", "return", "[", "error", ".", "toString", "(", ")", ",", "stack", ...
Creates and returns a string representation of an error. @param {Error} error - The error. @returns {String} - A string representation of the error.
[ "Creates", "and", "returns", "a", "string", "representation", "of", "an", "error", "." ]
db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e
https://github.com/bytbil/sauce-test-runner/blob/db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e/src/WrapperError.js#L45-L58
31,347
syntaxhighlighter/syntaxhighlighter-regex
xregexp.js
isQuantifierNext
function isQuantifierNext(pattern, pos, flags) { return nativ.test.call( flags.indexOf('x') > -1 ? // Ignore any leading whitespace, line comments, and inline comments /^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline ...
javascript
function isQuantifierNext(pattern, pos, flags) { return nativ.test.call( flags.indexOf('x') > -1 ? // Ignore any leading whitespace, line comments, and inline comments /^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : // Ignore any leading inline ...
[ "function", "isQuantifierNext", "(", "pattern", ",", "pos", ",", "flags", ")", "{", "return", "nativ", ".", "test", ".", "call", "(", "flags", ".", "indexOf", "(", "'x'", ")", ">", "-", "1", "?", "// Ignore any leading whitespace, line comments, and inline comme...
Checks whether the next nonignorable token after the specified position is a quantifier. @private @param {String} pattern Pattern to search within. @param {Number} pos Index in `pattern` to search at. @param {String} flags Flags used by the pattern. @returns {Boolean} Whether the next token is a quantifier.
[ "Checks", "whether", "the", "next", "nonignorable", "token", "after", "the", "specified", "position", "is", "a", "quantifier", "." ]
a20b8bc52097774bf49e01a6554c904683c03878
https://github.com/syntaxhighlighter/syntaxhighlighter-regex/blob/a20b8bc52097774bf49e01a6554c904683c03878/xregexp.js#L309-L318
31,348
syntaxhighlighter/syntaxhighlighter-regex
xregexp.js
prepareOptions
function prepareOptions(value) { var options = {}; if (isType(value, 'String')) { XRegExp.forEach(value, /[^\s,]+/, function(match) { options[match] = true; }); return options; } return value; }
javascript
function prepareOptions(value) { var options = {}; if (isType(value, 'String')) { XRegExp.forEach(value, /[^\s,]+/, function(match) { options[match] = true; }); return options; } return value; }
[ "function", "prepareOptions", "(", "value", ")", "{", "var", "options", "=", "{", "}", ";", "if", "(", "isType", "(", "value", ",", "'String'", ")", ")", "{", "XRegExp", ".", "forEach", "(", "value", ",", "/", "[^\\s,]+", "/", ",", "function", "(", ...
Prepares an options object from the given value. @private @param {String|Object} value Value to convert to an options object. @returns {Object} Options object.
[ "Prepares", "an", "options", "object", "from", "the", "given", "value", "." ]
a20b8bc52097774bf49e01a6554c904683c03878
https://github.com/syntaxhighlighter/syntaxhighlighter-regex/blob/a20b8bc52097774bf49e01a6554c904683c03878/xregexp.js#L382-L394
31,349
fraserxu/babel-jsxgettext
index.js
parser
function parser (inputs, output, plugins, cb) { var data = { charset: 'UTF-8', headers: DEFAULT_HEADERS, translations: { context: {} } } var defaultContext = data.translations.context var headers = data.headers headers['plural-forms'] = headers['plural-forms'] || DEFAULT_HEADERS['plura...
javascript
function parser (inputs, output, plugins, cb) { var data = { charset: 'UTF-8', headers: DEFAULT_HEADERS, translations: { context: {} } } var defaultContext = data.translations.context var headers = data.headers headers['plural-forms'] = headers['plural-forms'] || DEFAULT_HEADERS['plura...
[ "function", "parser", "(", "inputs", ",", "output", ",", "plugins", ",", "cb", ")", "{", "var", "data", "=", "{", "charset", ":", "'UTF-8'", ",", "headers", ":", "DEFAULT_HEADERS", ",", "translations", ":", "{", "context", ":", "{", "}", "}", "}", "v...
The parser function @param {String} input The path to soure JavaScript file @param {String} output The path of the output PO file @param {Function} cb The callback function
[ "The", "parser", "function" ]
aa51718017879069bf93571958a9e86d2d3a8646
https://github.com/fraserxu/babel-jsxgettext/blob/aa51718017879069bf93571958a9e86d2d3a8646/index.js#L16-L100
31,350
storj/service-storage-models
index.js
Storage
function Storage(mongoURI, mongoOptions, storageOptions) { if (!(this instanceof Storage)) { return new Storage(mongoURI, mongoOptions, storageOptions); } assert(typeof mongoOptions === 'object', 'Invalid mongo options supplied'); this._uri = mongoURI; this._options = mongoOptions; const defaultLogge...
javascript
function Storage(mongoURI, mongoOptions, storageOptions) { if (!(this instanceof Storage)) { return new Storage(mongoURI, mongoOptions, storageOptions); } assert(typeof mongoOptions === 'object', 'Invalid mongo options supplied'); this._uri = mongoURI; this._options = mongoOptions; const defaultLogge...
[ "function", "Storage", "(", "mongoURI", ",", "mongoOptions", ",", "storageOptions", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Storage", ")", ")", "{", "return", "new", "Storage", "(", "mongoURI", ",", "mongoOptions", ",", "storageOptions", ")", ...
MongoDB storage interface @constructor @param {Object} mongoConf @param {Object} options
[ "MongoDB", "storage", "interface" ]
1271354451bb410bdf1ecc6285f40918d4bc861d
https://github.com/storj/service-storage-models/blob/1271354451bb410bdf1ecc6285f40918d4bc861d/index.js#L18-L41
31,351
neekey/connected-domain
lib/connected-domain.js
addPointToDomain
function addPointToDomain( point, x, y, domainId ){ var domain = domains[ domainId ]; var newPoint = { value: point, x: x, y: y, identifier: domain.identifier, domainId: domainId }; pointsHash[ x + '_' + y ] = { va...
javascript
function addPointToDomain( point, x, y, domainId ){ var domain = domains[ domainId ]; var newPoint = { value: point, x: x, y: y, identifier: domain.identifier, domainId: domainId }; pointsHash[ x + '_' + y ] = { va...
[ "function", "addPointToDomain", "(", "point", ",", "x", ",", "y", ",", "domainId", ")", "{", "var", "domain", "=", "domains", "[", "domainId", "]", ";", "var", "newPoint", "=", "{", "value", ":", "point", ",", "x", ":", "x", ",", "y", ":", "y", "...
add a point to a existing domain, and attach properties domainId and identifier to point. @param point @param x @param y @param domainId
[ "add", "a", "point", "to", "a", "existing", "domain", "and", "attach", "properties", "domainId", "and", "identifier", "to", "point", "." ]
ecb49662ddab7a5bc26d6ec94701a5129bc914f3
https://github.com/neekey/connected-domain/blob/ecb49662ddab7a5bc26d6ec94701a5129bc914f3/lib/connected-domain.js#L208-L226
31,352
Manabu-GT/grunt-auto-install
tasks/auto_install.js
function(dir) { var results = []; var list = fs.readdirSync(dir); list.forEach(function(file) { // Check for every given pattern, regardless of whether it is an array or a string var matchesSomeExclude = [].concat(options.exclude).some(function(regexp) { return file.match(r...
javascript
function(dir) { var results = []; var list = fs.readdirSync(dir); list.forEach(function(file) { // Check for every given pattern, regardless of whether it is an array or a string var matchesSomeExclude = [].concat(options.exclude).some(function(regexp) { return file.match(r...
[ "function", "(", "dir", ")", "{", "var", "results", "=", "[", "]", ";", "var", "list", "=", "fs", ".", "readdirSync", "(", "dir", ")", ";", "list", ".", "forEach", "(", "function", "(", "file", ")", "{", "// Check for every given pattern, regardless of whe...
Synchronously walks the directory and returns an array of every subdirectory that matches the patterns, and doesn't match any exclude pattern
[ "Synchronously", "walks", "the", "directory", "and", "returns", "an", "array", "of", "every", "subdirectory", "that", "matches", "the", "patterns", "and", "doesn", "t", "match", "any", "exclude", "pattern" ]
e0d394a047f5364a00340112a8090c86ebf3b469
https://github.com/Manabu-GT/grunt-auto-install/blob/e0d394a047f5364a00340112a8090c86ebf3b469/tasks/auto_install.js#L59-L88
31,353
Alhadis/Atom-Mocha
bin/post-install.js
die
function die(reason = "", error = null, exitCode = 0){ reason = (reason || "").trim(); // ANSI escape sequences (disabled if output is redirected) const [reset,, underline,, noUnderline, red] = process.stderr.isTTY ? [0, 1, 4, 22, 24, [31, 9, 38]].map(s => `\x1B[${ Array.isArray(s) ? s.join(";") : s}m`) : Arra...
javascript
function die(reason = "", error = null, exitCode = 0){ reason = (reason || "").trim(); // ANSI escape sequences (disabled if output is redirected) const [reset,, underline,, noUnderline, red] = process.stderr.isTTY ? [0, 1, 4, 22, 24, [31, 9, 38]].map(s => `\x1B[${ Array.isArray(s) ? s.join(";") : s}m`) : Arra...
[ "function", "die", "(", "reason", "=", "\"\"", ",", "error", "=", "null", ",", "exitCode", "=", "0", ")", "{", "reason", "=", "(", "reason", "||", "\"\"", ")", ".", "trim", "(", ")", ";", "// ANSI escape sequences (disabled if output is redirected)", "const"...
Print an error message to the standard error stream, then quit. @param {String} [reason=""] - Brief description of the error. @param {Error} [error=null] - Possible error object preceding output @param {Number} [exitCode=1] - Error code to exit with. @private
[ "Print", "an", "error", "message", "to", "the", "standard", "error", "stream", "then", "quit", "." ]
fa784a52905957dcf9e9cb6fec095f79972bfbc4
https://github.com/Alhadis/Atom-Mocha/blob/fa784a52905957dcf9e9cb6fec095f79972bfbc4/bin/post-install.js#L78-L118
31,354
Alhadis/Atom-Mocha
bin/post-install.js
read
function read(filePath, options){ return new Promise((resolve, reject) => { fs.readFile(filePath, options, (error, data) => { error ? reject(error) : resolve(data.toString()); }); }); }
javascript
function read(filePath, options){ return new Promise((resolve, reject) => { fs.readFile(filePath, options, (error, data) => { error ? reject(error) : resolve(data.toString()); }); }); }
[ "function", "read", "(", "filePath", ",", "options", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "fs", ".", "readFile", "(", "filePath", ",", "options", ",", "(", "error", ",", "data", ")", "=>", "{", "...
Promise-aware version of `fs.readFile`. @param {String} filePath - File to read @param {Object} [options] - Options passed to `fs.readFile` @return {Promise} Resolves with stringified data. @see {@link https://nodejs.org/api/fs.html#fs_fs_readfile_file_options_callback|`fs.readFile`}
[ "Promise", "-", "aware", "version", "of", "fs", ".", "readFile", "." ]
fa784a52905957dcf9e9cb6fec095f79972bfbc4
https://github.com/Alhadis/Atom-Mocha/blob/fa784a52905957dcf9e9cb6fec095f79972bfbc4/bin/post-install.js#L129-L137
31,355
Alhadis/Atom-Mocha
bin/post-install.js
write
function write(filePath, fileData, options){ return new Promise((resolve, reject) => { fs.writeFile(filePath, fileData, options, error => { error ? reject(error) : resolve(fileData); }); }); }
javascript
function write(filePath, fileData, options){ return new Promise((resolve, reject) => { fs.writeFile(filePath, fileData, options, error => { error ? reject(error) : resolve(fileData); }); }); }
[ "function", "write", "(", "filePath", ",", "fileData", ",", "options", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "fs", ".", "writeFile", "(", "filePath", ",", "fileData", ",", "options", ",", "error", "=>...
Promise-aware version of `fs.writeFile`. @param {String} filePath - File to write to @param {String} fileData - Data to be written @param {Object} [options] - Options passed to `fs.writeFile` @return {Promise} Resolves with input parameter for easier chaining @see {@link https://nodejs.org/api/fs.html#fs_fs_writefile_...
[ "Promise", "-", "aware", "version", "of", "fs", ".", "writeFile", "." ]
fa784a52905957dcf9e9cb6fec095f79972bfbc4
https://github.com/Alhadis/Atom-Mocha/blob/fa784a52905957dcf9e9cb6fec095f79972bfbc4/bin/post-install.js#L149-L157
31,356
kevinoid/nodecat
index.js
combineErrors
function combineErrors(errPrev, errNew) { if (!errPrev) { return errNew; } let errCombined; if (errPrev instanceof AggregateError) { errCombined = errPrev; } else { errCombined = new AggregateError(); errCombined.push(errPrev); } errCombined.push(errNew); return errCombined; }
javascript
function combineErrors(errPrev, errNew) { if (!errPrev) { return errNew; } let errCombined; if (errPrev instanceof AggregateError) { errCombined = errPrev; } else { errCombined = new AggregateError(); errCombined.push(errPrev); } errCombined.push(errNew); return errCombined; }
[ "function", "combineErrors", "(", "errPrev", ",", "errNew", ")", "{", "if", "(", "!", "errPrev", ")", "{", "return", "errNew", ";", "}", "let", "errCombined", ";", "if", "(", "errPrev", "instanceof", "AggregateError", ")", "{", "errCombined", "=", "errPrev...
Combines one or more errors into a single error. @param {AggregateError|Error} errPrev Previous errors, if any. @param {!Error} errNew New error. @return {!AggregateError|!Error} Error which represents all errors that have occurred. If only one error has occurred, it will be returned. Otherwise an {@link AggregateEr...
[ "Combines", "one", "or", "more", "errors", "into", "a", "single", "error", "." ]
333f9710bbe7ceac5ec3f6171b2e8446ab2f3973
https://github.com/kevinoid/nodecat/blob/333f9710bbe7ceac5ec3f6171b2e8446ab2f3973/index.js#L21-L36
31,357
Alhadis/Atom-Mocha
lib/extensions.js
addToChai
function addToChai(names, fn){ for(const name of names) Chai.Assertion.addMethod(name, fn); }
javascript
function addToChai(names, fn){ for(const name of names) Chai.Assertion.addMethod(name, fn); }
[ "function", "addToChai", "(", "names", ",", "fn", ")", "{", "for", "(", "const", "name", "of", "names", ")", "Chai", ".", "Assertion", ".", "addMethod", "(", "name", ",", "fn", ")", ";", "}" ]
Thin wrapper around Chai.Assertion.addMethod to permit plugin aliases
[ "Thin", "wrapper", "around", "Chai", ".", "Assertion", ".", "addMethod", "to", "permit", "plugin", "aliases" ]
fa784a52905957dcf9e9cb6fec095f79972bfbc4
https://github.com/Alhadis/Atom-Mocha/blob/fa784a52905957dcf9e9cb6fec095f79972bfbc4/lib/extensions.js#L184-L187
31,358
xiara-io/xiara-mongo
dist/Definitions/Decorators.js
FieldReference
function FieldReference(typeFunction, fieldOptions = {}) { return function (target, key) { let fieldType = Reflect.getMetadata("design:type", target, key); let schema = MongoSchemaRegistry_1.MongoSchemaRegistry.getSchema(target.constructor.name); if (!schema) { schema = new Mongo...
javascript
function FieldReference(typeFunction, fieldOptions = {}) { return function (target, key) { let fieldType = Reflect.getMetadata("design:type", target, key); let schema = MongoSchemaRegistry_1.MongoSchemaRegistry.getSchema(target.constructor.name); if (!schema) { schema = new Mongo...
[ "function", "FieldReference", "(", "typeFunction", ",", "fieldOptions", "=", "{", "}", ")", "{", "return", "function", "(", "target", ",", "key", ")", "{", "let", "fieldType", "=", "Reflect", ".", "getMetadata", "(", "\"design:type\"", ",", "target", ",", ...
Single field representing a singl object
[ "Single", "field", "representing", "a", "singl", "object" ]
cd816e9fce11b0739a0859c4f462bcbe72c729a9
https://github.com/xiara-io/xiara-mongo/blob/cd816e9fce11b0739a0859c4f462bcbe72c729a9/dist/Definitions/Decorators.js#L80-L102
31,359
timmywil/grunt-npmcopy
tasks/npmcopy.js
getNumTargets
function getNumTargets() { if (numTargets) { return numTargets } var targets = grunt.config('npmcopy') if (targets) { delete targets.options numTargets = Object.keys(targets).length } return numTargets }
javascript
function getNumTargets() { if (numTargets) { return numTargets } var targets = grunt.config('npmcopy') if (targets) { delete targets.options numTargets = Object.keys(targets).length } return numTargets }
[ "function", "getNumTargets", "(", ")", "{", "if", "(", "numTargets", ")", "{", "return", "numTargets", "}", "var", "targets", "=", "grunt", ".", "config", "(", "'npmcopy'", ")", "if", "(", "targets", ")", "{", "delete", "targets", ".", "options", "numTar...
Retrieve the number of targets from the grunt config @returns {number|undefined} Returns the number of targets, or undefined if the npmcopy config could not be found
[ "Retrieve", "the", "number", "of", "targets", "from", "the", "grunt", "config" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L42-L52
31,360
timmywil/grunt-npmcopy
tasks/npmcopy.js
convert
function convert(files) { var converted = [] files.forEach(function(file) { // We need originals as the destinations may not yet exist file = file.orig var dest = file.dest // Use destination for source if no source is available if (!file.src.length) { converted.push({ ...
javascript
function convert(files) { var converted = [] files.forEach(function(file) { // We need originals as the destinations may not yet exist file = file.orig var dest = file.dest // Use destination for source if no source is available if (!file.src.length) { converted.push({ ...
[ "function", "convert", "(", "files", ")", "{", "var", "converted", "=", "[", "]", "files", ".", "forEach", "(", "function", "(", "file", ")", "{", "// We need originals as the destinations may not yet exist", "file", "=", "file", ".", "orig", "var", "dest", "=...
Convert from grunt to a cleaner format @param {Array} files
[ "Convert", "from", "grunt", "to", "a", "cleaner", "format" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L58-L82
31,361
timmywil/grunt-npmcopy
tasks/npmcopy.js
filterRepresented
function filterRepresented(modules, files, options) { return _.filter(modules, function(module) { return !_.some(files, function(file) { // Look for the module name somewhere in the source path return ( path .join(sep, options.srcPrefix, file.src.replace(rmain, '$1'), sep...
javascript
function filterRepresented(modules, files, options) { return _.filter(modules, function(module) { return !_.some(files, function(file) { // Look for the module name somewhere in the source path return ( path .join(sep, options.srcPrefix, file.src.replace(rmain, '$1'), sep...
[ "function", "filterRepresented", "(", "modules", ",", "files", ",", "options", ")", "{", "return", "_", ".", "filter", "(", "modules", ",", "function", "(", "module", ")", "{", "return", "!", "_", ".", "some", "(", "files", ",", "function", "(", "file"...
Filter out all of the modules represented in the filesSrc array @param {Array} modules @param {Array} files @param {Object} options
[ "Filter", "out", "all", "of", "the", "modules", "represented", "in", "the", "filesSrc", "array" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L90-L101
31,362
timmywil/grunt-npmcopy
tasks/npmcopy.js
ensure
function ensure(files, options) { // Update the global array of represented modules unused = filterRepresented(unused, files, options) verbose.writeln('Unrepresented modules list currently at ', unused) // Only print message when all targets have been run if (++numRuns === getNumTargets()) { ...
javascript
function ensure(files, options) { // Update the global array of represented modules unused = filterRepresented(unused, files, options) verbose.writeln('Unrepresented modules list currently at ', unused) // Only print message when all targets have been run if (++numRuns === getNumTargets()) { ...
[ "function", "ensure", "(", "files", ",", "options", ")", "{", "// Update the global array of represented modules", "unused", "=", "filterRepresented", "(", "unused", ",", "files", ",", "options", ")", "verbose", ".", "writeln", "(", "'Unrepresented modules list currentl...
Ensure all npm dependencies are accounted for @param {Array} files Files property from the task @param {Object} options @returns {boolean} Returns whether all dependencies are accounted for
[ "Ensure", "all", "npm", "dependencies", "are", "accounted", "for" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L109-L126
31,363
timmywil/grunt-npmcopy
tasks/npmcopy.js
convertMatches
function convertMatches(files, options, dest) { return files.map(function(source) { return { src: source, dest: path.join( // Build a destination from the new source if no dest // was specified dest != null ? dest : path.dirname(source).replace(options.srcPrefix +...
javascript
function convertMatches(files, options, dest) { return files.map(function(source) { return { src: source, dest: path.join( // Build a destination from the new source if no dest // was specified dest != null ? dest : path.dirname(source).replace(options.srcPrefix +...
[ "function", "convertMatches", "(", "files", ",", "options", ",", "dest", ")", "{", "return", "files", ".", "map", "(", "function", "(", "source", ")", "{", "return", "{", "src", ":", "source", ",", "dest", ":", "path", ".", "join", "(", "// Build a des...
Convert an array of files sources to our format @param {Array} files @param {Object} options @param {String} [dest] A folder destination for all of these sources
[ "Convert", "an", "array", "of", "files", "sources", "to", "our", "format" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L134-L146
31,364
timmywil/grunt-npmcopy
tasks/npmcopy.js
getMain
function getMain(src, options, dest) { var meta = grunt.file.readJSON(path.join(src, 'package.json')) if (!meta.main) { fail.fatal( 'No main property specified by ' + path.normalize(src.replace(options.srcPrefix, '')) ) } var files = typeof meta.main === 'string' ? [meta.main] : meta...
javascript
function getMain(src, options, dest) { var meta = grunt.file.readJSON(path.join(src, 'package.json')) if (!meta.main) { fail.fatal( 'No main property specified by ' + path.normalize(src.replace(options.srcPrefix, '')) ) } var files = typeof meta.main === 'string' ? [meta.main] : meta...
[ "function", "getMain", "(", "src", ",", "options", ",", "dest", ")", "{", "var", "meta", "=", "grunt", ".", "file", ".", "readJSON", "(", "path", ".", "join", "(", "src", ",", "'package.json'", ")", ")", "if", "(", "!", "meta", ".", "main", ")", ...
Get the main files for a particular package @param {string} src @param {Object} options @param {string} dest @returns {Array} Returns an array of file locations from the main property
[ "Get", "the", "main", "files", "for", "a", "particular", "package" ]
bd7ebdfd043437ac52e123ee007cb174d94e2565
https://github.com/timmywil/grunt-npmcopy/blob/bd7ebdfd043437ac52e123ee007cb174d94e2565/tasks/npmcopy.js#L155-L169
31,365
obliquid/jslardo
core/permissions.js
readStrucPerm
function readStrucPerm(on, req, res, next) { //console.log('readStrucPerm: req.session.user_id = ' + req.session.user_id); //solo nel caso di favicon.ico non ha le session impostate, non so perchè, //quindi bypasso il controllo, perchè su favicon non ho nessuna restrizione if ( !req.session ) { next(); } else ...
javascript
function readStrucPerm(on, req, res, next) { //console.log('readStrucPerm: req.session.user_id = ' + req.session.user_id); //solo nel caso di favicon.ico non ha le session impostate, non so perchè, //quindi bypasso il controllo, perchè su favicon non ho nessuna restrizione if ( !req.session ) { next(); } else ...
[ "function", "readStrucPerm", "(", "on", ",", "req", ",", "res", ",", "next", ")", "{", "//console.log('readStrucPerm: req.session.user_id = ' + req.session.user_id);", "//solo nel caso di favicon.ico non ha le session impostate, non so perchè,", "//quindi bypasso il controllo, perchè su ...
questo metodo viene richiamato prima di eseguire ogni request che lo richiede in qualunque controller di qualunque oggetto
[ "questo", "metodo", "viene", "richiamato", "prima", "di", "eseguire", "ogni", "request", "che", "lo", "richiede", "in", "qualunque", "controller", "di", "qualunque", "oggetto" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/core/permissions.js#L179-L274
31,366
feedhenry/fh-gridfs
lib/gridFileManager.js
getFileDetails
function getFileDetails(db, fileSelectionCriteria, fileOptions, cb) { defaultLogger.debug("In getFileDetails "); var selectionQuery = undefined; if (fileSelectionCriteria.groupId) { selectionQuery= {"metadata.groupId": fileSelectionCriteria.groupId}; } else if (fileSelectionCriteria.hash) { selectio...
javascript
function getFileDetails(db, fileSelectionCriteria, fileOptions, cb) { defaultLogger.debug("In getFileDetails "); var selectionQuery = undefined; if (fileSelectionCriteria.groupId) { selectionQuery= {"metadata.groupId": fileSelectionCriteria.groupId}; } else if (fileSelectionCriteria.hash) { selectio...
[ "function", "getFileDetails", "(", "db", ",", "fileSelectionCriteria", ",", "fileOptions", ",", "cb", ")", "{", "defaultLogger", ".", "debug", "(", "\"In getFileDetails \"", ")", ";", "var", "selectionQuery", "=", "undefined", ";", "if", "(", "fileSelectionCriteri...
Utility function to search for files in the database.
[ "Utility", "function", "to", "search", "for", "files", "in", "the", "database", "." ]
6ca85b1cd5c5a7426708a2657725f3a9bda91fff
https://github.com/feedhenry/fh-gridfs/blob/6ca85b1cd5c5a7426708a2657725f3a9bda91fff/lib/gridFileManager.js#L636-L719
31,367
feedhenry/fh-gridfs
lib/gridFileManager.js
updateExistingFile
function updateExistingFile(db, fileName, fileReadStream, options, cb) { defaultLogger.debug("In updateExistingFile"); getFileDetails(db, {"groupId": options.groupId}, {}, function(err, fileInfo) { if (err) { defaultLogger.error(err); return cb(err); } var latestFileVersion = fileInfo.metadata.ve...
javascript
function updateExistingFile(db, fileName, fileReadStream, options, cb) { defaultLogger.debug("In updateExistingFile"); getFileDetails(db, {"groupId": options.groupId}, {}, function(err, fileInfo) { if (err) { defaultLogger.error(err); return cb(err); } var latestFileVersion = fileInfo.metadata.ve...
[ "function", "updateExistingFile", "(", "db", ",", "fileName", ",", "fileReadStream", ",", "options", ",", "cb", ")", "{", "defaultLogger", ".", "debug", "(", "\"In updateExistingFile\"", ")", ";", "getFileDetails", "(", "db", ",", "{", "\"groupId\"", ":", "opt...
Updating an existing file means that the new file is saved with the same name with an incremented version.
[ "Updating", "an", "existing", "file", "means", "that", "the", "new", "file", "is", "saved", "with", "the", "same", "name", "with", "an", "incremented", "version", "." ]
6ca85b1cd5c5a7426708a2657725f3a9bda91fff
https://github.com/feedhenry/fh-gridfs/blob/6ca85b1cd5c5a7426708a2657725f3a9bda91fff/lib/gridFileManager.js#L757-L773
31,368
feedhenry/fh-gridfs
lib/gridFileManager.js
createNewFile
function createNewFile(db, fileName, fileReadStream, options, cb) { defaultLogger.debug("In createNewFile"); createFileWithVersion(db, fileName, fileReadStream, constants.LOWEST_VERSION, options, cb); }
javascript
function createNewFile(db, fileName, fileReadStream, options, cb) { defaultLogger.debug("In createNewFile"); createFileWithVersion(db, fileName, fileReadStream, constants.LOWEST_VERSION, options, cb); }
[ "function", "createNewFile", "(", "db", ",", "fileName", ",", "fileReadStream", ",", "options", ",", "cb", ")", "{", "defaultLogger", ".", "debug", "(", "\"In createNewFile\"", ")", ";", "createFileWithVersion", "(", "db", ",", "fileName", ",", "fileReadStream",...
Creating a new file means creating a new file with fileName with version 0;
[ "Creating", "a", "new", "file", "means", "creating", "a", "new", "file", "with", "fileName", "with", "version", "0", ";" ]
6ca85b1cd5c5a7426708a2657725f3a9bda91fff
https://github.com/feedhenry/fh-gridfs/blob/6ca85b1cd5c5a7426708a2657725f3a9bda91fff/lib/gridFileManager.js#L776-L779
31,369
CactusTechnologies/cactus-utils
packages/logger/lib/serializers.js
errorSerializer
function errorSerializer (err) { if (!err || !err.stack) return err const obj = { message: err.message, name: err.name, code: err.code, stack: getErrorStack(err) } return obj }
javascript
function errorSerializer (err) { if (!err || !err.stack) return err const obj = { message: err.message, name: err.name, code: err.code, stack: getErrorStack(err) } return obj }
[ "function", "errorSerializer", "(", "err", ")", "{", "if", "(", "!", "err", "||", "!", "err", ".", "stack", ")", "return", "err", "const", "obj", "=", "{", "message", ":", "err", ".", "message", ",", "name", ":", "err", ".", "name", ",", "code", ...
Serializes Error Objects @type {import("pino").SerializerFn} @param {any} err
[ "Serializes", "Error", "Objects" ]
0a827dbd755766309a4bc0f0a47c9e8dc4eb8d17
https://github.com/CactusTechnologies/cactus-utils/blob/0a827dbd755766309a4bc0f0a47c9e8dc4eb8d17/packages/logger/lib/serializers.js#L14-L23
31,370
CactusTechnologies/cactus-utils
packages/logger/lib/serializers.js
getCleanUrl
function getCleanUrl (url) { try { const parsed = new URL(url) return parsed.pathname || url } catch (err) { return url } }
javascript
function getCleanUrl (url) { try { const parsed = new URL(url) return parsed.pathname || url } catch (err) { return url } }
[ "function", "getCleanUrl", "(", "url", ")", "{", "try", "{", "const", "parsed", "=", "new", "URL", "(", "url", ")", "return", "parsed", ".", "pathname", "||", "url", "}", "catch", "(", "err", ")", "{", "return", "url", "}", "}" ]
Returns the pathname part of the given url @param {String} url @return {String}
[ "Returns", "the", "pathname", "part", "of", "the", "given", "url" ]
0a827dbd755766309a4bc0f0a47c9e8dc4eb8d17
https://github.com/CactusTechnologies/cactus-utils/blob/0a827dbd755766309a4bc0f0a47c9e8dc4eb8d17/packages/logger/lib/serializers.js#L90-L97
31,371
Allenice/madoka
index.js
function(str, index) { // replace {{ xxx }} var obj = this str = str.replace(interpolateReg, function(match, interpolate) { try { /*jslint evil: true */ var funcNames = ['','index'].concat(fakerFuncNames).concat(['return ' + interpolate + ';']), func = new (Function.prototype.b...
javascript
function(str, index) { // replace {{ xxx }} var obj = this str = str.replace(interpolateReg, function(match, interpolate) { try { /*jslint evil: true */ var funcNames = ['','index'].concat(fakerFuncNames).concat(['return ' + interpolate + ';']), func = new (Function.prototype.b...
[ "function", "(", "str", ",", "index", ")", "{", "// replace {{ xxx }}", "var", "obj", "=", "this", "str", "=", "str", ".", "replace", "(", "interpolateReg", ",", "function", "(", "match", ",", "interpolate", ")", "{", "try", "{", "/*jslint evil: true */", ...
parse string template, if the parent template is an array, it will pass the index value to the child template
[ "parse", "string", "template", "if", "the", "parent", "template", "is", "an", "array", "it", "will", "pass", "the", "index", "value", "to", "the", "child", "template" ]
1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b
https://github.com/Allenice/madoka/blob/1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b/index.js#L46-L74
31,372
Allenice/madoka
index.js
function(obj, index) { var funcKey = []; for(var key in obj) { if(obj.hasOwnProperty(key)) { // If this is a function, generate it later. if(typeof obj[key] === 'function') { funcKey.push(key); continue; } obj[key] = generate.call(obj, obj[key], index)...
javascript
function(obj, index) { var funcKey = []; for(var key in obj) { if(obj.hasOwnProperty(key)) { // If this is a function, generate it later. if(typeof obj[key] === 'function') { funcKey.push(key); continue; } obj[key] = generate.call(obj, obj[key], index)...
[ "function", "(", "obj", ",", "index", ")", "{", "var", "funcKey", "=", "[", "]", ";", "for", "(", "var", "key", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "// If this is a function, generate it later.", "...
parse object, it will generate each property
[ "parse", "object", "it", "will", "generate", "each", "property" ]
1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b
https://github.com/Allenice/madoka/blob/1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b/index.js#L77-L98
31,373
Allenice/madoka
index.js
save
function save(template, distpath) { var data = generate(template); var dir = path.dirname(distpath); mkdirp(dir, function(err) { if(err) { console.log(err.message); return; } fs.writeFile(distpath, JSON.stringify(data, null, 2), function(err) { if(err) { console.log(err.mes...
javascript
function save(template, distpath) { var data = generate(template); var dir = path.dirname(distpath); mkdirp(dir, function(err) { if(err) { console.log(err.message); return; } fs.writeFile(distpath, JSON.stringify(data, null, 2), function(err) { if(err) { console.log(err.mes...
[ "function", "save", "(", "template", ",", "distpath", ")", "{", "var", "data", "=", "generate", "(", "template", ")", ";", "var", "dir", "=", "path", ".", "dirname", "(", "distpath", ")", ";", "mkdirp", "(", "dir", ",", "function", "(", "err", ")", ...
save as json file @param template - json scheme @param path - path to save file
[ "save", "as", "json", "file" ]
1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b
https://github.com/Allenice/madoka/blob/1d8ffca8cff4ce96980c0f30af0e38aadbd1fe1b/index.js#L170-L189
31,374
comapi/comapi-sdk-js
specs/server.js
setConversationEtagHeader
function setConversationEtagHeader(res, conversationInfo) { var copy = JSON.parse(JSON.stringify(conversationInfo)); delete copy.participants; delete copy.createdOn; delete copy.updatedOn; setEtagHeader(res, copy); }
javascript
function setConversationEtagHeader(res, conversationInfo) { var copy = JSON.parse(JSON.stringify(conversationInfo)); delete copy.participants; delete copy.createdOn; delete copy.updatedOn; setEtagHeader(res, copy); }
[ "function", "setConversationEtagHeader", "(", "res", ",", "conversationInfo", ")", "{", "var", "copy", "=", "JSON", ".", "parse", "(", "JSON", ".", "stringify", "(", "conversationInfo", ")", ")", ";", "delete", "copy", ".", "participants", ";", "delete", "co...
Copy the conversation info and lose the participants prior to setting the ETag ;-)
[ "Copy", "the", "conversation", "info", "and", "lose", "the", "participants", "prior", "to", "setting", "the", "ETag", ";", "-", ")" ]
fd39d098f6d4ae4bfba2d06bf0b42b70c45c418d
https://github.com/comapi/comapi-sdk-js/blob/fd39d098f6d4ae4bfba2d06bf0b42b70c45c418d/specs/server.js#L195-L201
31,375
obliquid/jslardo
core/i18n.js
translate
function translate(singular, plural) { if (!locales[currentLocale]) { read(currentLocale); } if (plural) { if (!locales[currentLocale][singular]) { locales[currentLocale][singular] = { 'one': singular, 'other': plural }; wr...
javascript
function translate(singular, plural) { if (!locales[currentLocale]) { read(currentLocale); } if (plural) { if (!locales[currentLocale][singular]) { locales[currentLocale][singular] = { 'one': singular, 'other': plural }; wr...
[ "function", "translate", "(", "singular", ",", "plural", ")", "{", "if", "(", "!", "locales", "[", "currentLocale", "]", ")", "{", "read", "(", "currentLocale", ")", ";", "}", "if", "(", "plural", ")", "{", "if", "(", "!", "locales", "[", "currentLoc...
read currentLocale file, translate a msg and write to fs if new QUI!!! metodo che usa currentLocale globale
[ "read", "currentLocale", "file", "translate", "a", "msg", "and", "write", "to", "fs", "if", "new", "QUI!!!", "metodo", "che", "usa", "currentLocale", "globale" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/core/i18n.js#L164-L184
31,376
obliquid/jslardo
core/i18n.js
read
function read(myLocale) { locales[myLocale] = {}; try { locales[myLocale] = JSON.parse(fs.readFileSync(locate(myLocale))); } catch(e) { console.log('initializing ' + locate(myLocale)); write(myLocale); } }
javascript
function read(myLocale) { locales[myLocale] = {}; try { locales[myLocale] = JSON.parse(fs.readFileSync(locate(myLocale))); } catch(e) { console.log('initializing ' + locate(myLocale)); write(myLocale); } }
[ "function", "read", "(", "myLocale", ")", "{", "locales", "[", "myLocale", "]", "=", "{", "}", ";", "try", "{", "locales", "[", "myLocale", "]", "=", "JSON", ".", "parse", "(", "fs", ".", "readFileSync", "(", "locate", "(", "myLocale", ")", ")", ")...
try reading a file
[ "try", "reading", "a", "file" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/core/i18n.js#L187-L195
31,377
obliquid/jslardo
core/i18n.js
write
function write(myLocale) { try { stats = fs.lstatSync(directory); } catch(e) { fs.mkdirSync(directory, 0755); } fs.writeFile(locate(myLocale), JSON.stringify(locales[myLocale], null, "\t")); }
javascript
function write(myLocale) { try { stats = fs.lstatSync(directory); } catch(e) { fs.mkdirSync(directory, 0755); } fs.writeFile(locate(myLocale), JSON.stringify(locales[myLocale], null, "\t")); }
[ "function", "write", "(", "myLocale", ")", "{", "try", "{", "stats", "=", "fs", ".", "lstatSync", "(", "directory", ")", ";", "}", "catch", "(", "e", ")", "{", "fs", ".", "mkdirSync", "(", "directory", ",", "0755", ")", ";", "}", "fs", ".", "writ...
try writing a file in a created directory
[ "try", "writing", "a", "file", "in", "a", "created", "directory" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/core/i18n.js#L198-L205
31,378
obliquid/jslardo
core/i18n.js
guessLanguage
function guessLanguage(request){ //console.log("guessLanguage"); if(typeof request === 'object'){ var language_header = request.headers['accept-language'], languages = []; regions = []; request.languages = [currentLocale]; /* for (x in request.languages) { console.log(reque...
javascript
function guessLanguage(request){ //console.log("guessLanguage"); if(typeof request === 'object'){ var language_header = request.headers['accept-language'], languages = []; regions = []; request.languages = [currentLocale]; /* for (x in request.languages) { console.log(reque...
[ "function", "guessLanguage", "(", "request", ")", "{", "//console.log(\"guessLanguage\");", "if", "(", "typeof", "request", "===", "'object'", ")", "{", "var", "language_header", "=", "request", ".", "headers", "[", "'accept-language'", "]", ",", "languages", "=",...
guess language setting based on http headers
[ "guess", "language", "setting", "based", "on", "http", "headers" ]
84225f280e0cce8d46bff8cc2d16f2c8f9633fac
https://github.com/obliquid/jslardo/blob/84225f280e0cce8d46bff8cc2d16f2c8f9633fac/core/i18n.js#L216-L257
31,379
happyplan/happyplan
grunt_tasks/config/connect.js
function(connect, options) { return [ require('connect-livereload')(), // Default middlewares // Serve static files. connect.static(options.base), // Make empty directories browsable. connect.directory(options.base) ]; }
javascript
function(connect, options) { return [ require('connect-livereload')(), // Default middlewares // Serve static files. connect.static(options.base), // Make empty directories browsable. connect.directory(options.base) ]; }
[ "function", "(", "connect", ",", "options", ")", "{", "return", "[", "require", "(", "'connect-livereload'", ")", "(", ")", ",", "// Default middlewares", "// Serve static files.", "connect", ".", "static", "(", "options", ".", "base", ")", ",", "// Make empty d...
Must be empty to be accessible everywhere and not only "localhost"
[ "Must", "be", "empty", "to", "be", "accessible", "everywhere", "and", "not", "only", "localhost" ]
38d0bce566a1864881b5867227348ff187e46999
https://github.com/happyplan/happyplan/blob/38d0bce566a1864881b5867227348ff187e46999/grunt_tasks/config/connect.js#L10-L19
31,380
Lemurro/client-framework7-core-frontend
dist/lemurro.js
fireCallback
function fireCallback(callbackName) { var data = [], len = arguments.length - 1; while ( len-- > 0 ) data[ len ] = arguments[ len + 1 ]; /* Callbacks: beforeCreate (options), beforeOpen (xhr, options), beforeSend (xhr, options), error (xhr, status), com...
javascript
function fireCallback(callbackName) { var data = [], len = arguments.length - 1; while ( len-- > 0 ) data[ len ] = arguments[ len + 1 ]; /* Callbacks: beforeCreate (options), beforeOpen (xhr, options), beforeSend (xhr, options), error (xhr, status), com...
[ "function", "fireCallback", "(", "callbackName", ")", "{", "var", "data", "=", "[", "]", ",", "len", "=", "arguments", ".", "length", "-", "1", ";", "while", "(", "len", "--", ">", "0", ")", "data", "[", "len", "]", "=", "arguments", "[", "len", ...
Function to run XHR callbacks and events
[ "Function", "to", "run", "XHR", "callbacks", "and", "events" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L3887-L3912
31,381
Lemurro/client-framework7-core-frontend
dist/lemurro.js
onTabLoaded
function onTabLoaded(contentEl) { // Remove theme elements router.removeThemeElements($newTabEl); var tabEventTarget = $newTabEl; if (typeof contentEl !== 'string') { tabEventTarget = $(contentEl); } tabEventTarget.trigger('tab:init tab:mounted', tabRoute); router.emit('tabInit tab...
javascript
function onTabLoaded(contentEl) { // Remove theme elements router.removeThemeElements($newTabEl); var tabEventTarget = $newTabEl; if (typeof contentEl !== 'string') { tabEventTarget = $(contentEl); } tabEventTarget.trigger('tab:init tab:mounted', tabRoute); router.emit('tabInit tab...
[ "function", "onTabLoaded", "(", "contentEl", ")", "{", "// Remove theme elements", "router", ".", "removeThemeElements", "(", "$newTabEl", ")", ";", "var", "tabEventTarget", "=", "$newTabEl", ";", "if", "(", "typeof", "contentEl", "!==", "'string'", ")", "{", "t...
Tab Content Loaded
[ "Tab", "Content", "Loaded" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L7147-L7172
31,382
Lemurro/client-framework7-core-frontend
dist/lemurro.js
loadTab
function loadTab(loadTabParams, loadTabOptions) { // Load Tab Props var url = loadTabParams.url; var content = loadTabParams.content; var el = loadTabParams.el; var template = loadTabParams.template; var templateUrl = loadTabParams.templateUrl; var component = loadTabParams.com...
javascript
function loadTab(loadTabParams, loadTabOptions) { // Load Tab Props var url = loadTabParams.url; var content = loadTabParams.content; var el = loadTabParams.el; var template = loadTabParams.template; var templateUrl = loadTabParams.templateUrl; var component = loadTabParams.com...
[ "function", "loadTab", "(", "loadTabParams", ",", "loadTabOptions", ")", "{", "// Load Tab Props", "var", "url", "=", "loadTabParams", ".", "url", ";", "var", "content", "=", "loadTabParams", ".", "content", ";", "var", "el", "=", "loadTabParams", ".", "el", ...
Load Tab Content
[ "Load", "Tab", "Content" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L7187-L7253
31,383
Lemurro/client-framework7-core-frontend
dist/lemurro.js
loadModal
function loadModal(loadModalParams, loadModalOptions) { // Load Modal Props var url = loadModalParams.url; var content = loadModalParams.content; var template = loadModalParams.template; var templateUrl = loadModalParams.templateUrl; var component = loadModalParams.component; v...
javascript
function loadModal(loadModalParams, loadModalOptions) { // Load Modal Props var url = loadModalParams.url; var content = loadModalParams.content; var template = loadModalParams.template; var templateUrl = loadModalParams.templateUrl; var component = loadModalParams.component; v...
[ "function", "loadModal", "(", "loadModalParams", ",", "loadModalOptions", ")", "{", "// Load Modal Props", "var", "url", "=", "loadModalParams", ".", "url", ";", "var", "content", "=", "loadModalParams", ".", "content", ";", "var", "template", "=", "loadModalParam...
Load Modal Content
[ "Load", "Modal", "Content" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L7405-L7469
31,384
Lemurro/client-framework7-core-frontend
dist/lemurro.js
isEmpty
function isEmpty(value) { if (value === null) { return true; } var type = typeof(value); switch (type) { case 'undefined': return true; case 'number': return isNaN(value); case 'string': r...
javascript
function isEmpty(value) { if (value === null) { return true; } var type = typeof(value); switch (type) { case 'undefined': return true; case 'number': return isNaN(value); case 'string': r...
[ "function", "isEmpty", "(", "value", ")", "{", "if", "(", "value", "===", "null", ")", "{", "return", "true", ";", "}", "var", "type", "=", "typeof", "(", "value", ")", ";", "switch", "(", "type", ")", "{", "case", "'undefined'", ":", "return", "tr...
Javascript empty value checker @param {null|undefined|number|string|object|array|function|boolean} value @version 07.02.2019 @author DimNS <atomcms@ya.ru>
[ "Javascript", "empty", "value", "checker" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L36474-L36503
31,385
Lemurro/client-framework7-core-frontend
dist/lemurro.js
_encodeBlob
function _encodeBlob(blob) { return new Promise$1(function (resolve, reject) { var reader = new FileReader(); reader.onerror = reject; reader.onloadend = function (e) { var base64 = btoa(e.target.result || ''); resolve({ __local_forage_encoded_blob: tr...
javascript
function _encodeBlob(blob) { return new Promise$1(function (resolve, reject) { var reader = new FileReader(); reader.onerror = reject; reader.onloadend = function (e) { var base64 = btoa(e.target.result || ''); resolve({ __local_forage_encoded_blob: tr...
[ "function", "_encodeBlob", "(", "blob", ")", "{", "return", "new", "Promise$1", "(", "function", "(", "resolve", ",", "reject", ")", "{", "var", "reader", "=", "new", "FileReader", "(", ")", ";", "reader", ".", "onerror", "=", "reject", ";", "reader", ...
encode a blob for indexeddb engines that don't support blobs
[ "encode", "a", "blob", "for", "indexeddb", "engines", "that", "don", "t", "support", "blobs" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L40250-L40264
31,386
Lemurro/client-framework7-core-frontend
dist/lemurro.js
checkIfLocalStorageThrows
function checkIfLocalStorageThrows() { var localStorageTestKey = '_localforage_support_test'; try { localStorage.setItem(localStorageTestKey, true); localStorage.removeItem(localStorageTestKey); return false; } catch (e) { return true; } }
javascript
function checkIfLocalStorageThrows() { var localStorageTestKey = '_localforage_support_test'; try { localStorage.setItem(localStorageTestKey, true); localStorage.removeItem(localStorageTestKey); return false; } catch (e) { return true; } }
[ "function", "checkIfLocalStorageThrows", "(", ")", "{", "var", "localStorageTestKey", "=", "'_localforage_support_test'", ";", "try", "{", "localStorage", ".", "setItem", "(", "localStorageTestKey", ",", "true", ")", ";", "localStorage", ".", "removeItem", "(", "loc...
Check if localStorage throws when saving an item
[ "Check", "if", "localStorage", "throws", "when", "saving", "an", "item" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L41661-L41672
31,387
Lemurro/client-framework7-core-frontend
dist/lemurro.js
uniqueArray
function uniqueArray(arr) { var result = []; for (var i = 0; i < arr.length; i++) { if (result.indexOf(arr[i]) === -1) { result.push(arr[i]); } } return result; }
javascript
function uniqueArray(arr) { var result = []; for (var i = 0; i < arr.length; i++) { if (result.indexOf(arr[i]) === -1) { result.push(arr[i]); } } return result; }
[ "function", "uniqueArray", "(", "arr", ")", "{", "var", "result", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";", "i", "++", ")", "{", "if", "(", "result", ".", "indexOf", "(", "arr", "[", "i", ...
Filter the unique values into a new array @param arr
[ "Filter", "the", "unique", "values", "into", "a", "new", "array" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L42526-L42536
31,388
Lemurro/client-framework7-core-frontend
dist/lemurro.js
warnOnce
function warnOnce(message) { if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { previousWarnOnceMessages.push(message); warn(message); } }
javascript
function warnOnce(message) { if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { previousWarnOnceMessages.push(message); warn(message); } }
[ "function", "warnOnce", "(", "message", ")", "{", "if", "(", "!", "(", "previousWarnOnceMessages", ".", "indexOf", "(", "message", ")", "!==", "-", "1", ")", ")", "{", "previousWarnOnceMessages", ".", "push", "(", "message", ")", ";", "warn", "(", "messa...
Show a console warning, but only if it hasn't already been shown @param message
[ "Show", "a", "console", "warning", "but", "only", "if", "it", "hasn", "t", "already", "been", "shown" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L42593-L42598
31,389
Lemurro/client-framework7-core-frontend
dist/lemurro.js
adaptInputValidator
function adaptInputValidator(legacyValidator) { return function adaptedInputValidator(inputValue, extraParams) { return legacyValidator.call(this, inputValue, extraParams).then(function () { return undefined; }, function (validationMessage) { return validationMessage; }); }; }
javascript
function adaptInputValidator(legacyValidator) { return function adaptedInputValidator(inputValue, extraParams) { return legacyValidator.call(this, inputValue, extraParams).then(function () { return undefined; }, function (validationMessage) { return validationMessage; }); }; }
[ "function", "adaptInputValidator", "(", "legacyValidator", ")", "{", "return", "function", "adaptedInputValidator", "(", "inputValue", ",", "extraParams", ")", "{", "return", "legacyValidator", ".", "call", "(", "this", ",", "inputValue", ",", "extraParams", ")", ...
Adapt a legacy inputValidator for use with expectRejections=false
[ "Adapt", "a", "legacy", "inputValidator", "for", "use", "with", "expectRejections", "=", "false" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L42651-L42659
31,390
Lemurro/client-framework7-core-frontend
dist/lemurro.js
showWarningsForParams
function showWarningsForParams(params) { for (var param in params) { if (!isValidParameter(param)) { warn("Unknown parameter \"".concat(param, "\"")); } if (params.toast && toastIncompatibleParams.indexOf(param) !== -1) { warn("The parameter \"".concat(param, "\" is incompatible with toasts")...
javascript
function showWarningsForParams(params) { for (var param in params) { if (!isValidParameter(param)) { warn("Unknown parameter \"".concat(param, "\"")); } if (params.toast && toastIncompatibleParams.indexOf(param) !== -1) { warn("The parameter \"".concat(param, "\" is incompatible with toasts")...
[ "function", "showWarningsForParams", "(", "params", ")", "{", "for", "(", "var", "param", "in", "params", ")", "{", "if", "(", "!", "isValidParameter", "(", "param", ")", ")", "{", "warn", "(", "\"Unknown parameter \\\"\"", ".", "concat", "(", "param", ","...
Show relevant warnings for given params @param params
[ "Show", "relevant", "warnings", "for", "given", "params" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L43502-L43516
31,391
Lemurro/client-framework7-core-frontend
dist/lemurro.js
mixin
function mixin(mixinParams) { return withNoNewKeyword( /*#__PURE__*/ function (_this) { _inherits(MixinSwal, _this); function MixinSwal() { _classCallCheck(this, MixinSwal); return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); } _createClass(Mi...
javascript
function mixin(mixinParams) { return withNoNewKeyword( /*#__PURE__*/ function (_this) { _inherits(MixinSwal, _this); function MixinSwal() { _classCallCheck(this, MixinSwal); return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments)); } _createClass(Mi...
[ "function", "mixin", "(", "mixinParams", ")", "{", "return", "withNoNewKeyword", "(", "/*#__PURE__*/", "function", "(", "_this", ")", "{", "_inherits", "(", "MixinSwal", ",", "_this", ")", ";", "function", "MixinSwal", "(", ")", "{", "_classCallCheck", "(", ...
Returns an extended version of `Swal` containing `params` as defaults. Useful for reusing Swal configuration. For example: Before: const textPromptOptions = { input: 'text', showCancelButton: true } const {value: firstName} = await Swal({ ...textPromptOptions, title: 'What is your first name?' }) const {value: lastNa...
[ "Returns", "an", "extended", "version", "of", "Swal", "containing", "params", "as", "defaults", ".", "Useful", "for", "reusing", "Swal", "configuration", "." ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L43592-L43613
31,392
Lemurro/client-framework7-core-frontend
dist/lemurro.js
showLoading
function showLoading() { var popup = getPopup(); if (!popup) { Swal(''); } popup = getPopup(); var actions = getActions(); var confirmButton = getConfirmButton(); var cancelButton = getCancelButton(); show(actions); show(confirmButton); addClass([popup, actions], swalClasses.loading); confir...
javascript
function showLoading() { var popup = getPopup(); if (!popup) { Swal(''); } popup = getPopup(); var actions = getActions(); var confirmButton = getConfirmButton(); var cancelButton = getCancelButton(); show(actions); show(confirmButton); addClass([popup, actions], swalClasses.loading); confir...
[ "function", "showLoading", "(", ")", "{", "var", "popup", "=", "getPopup", "(", ")", ";", "if", "(", "!", "popup", ")", "{", "Swal", "(", "''", ")", ";", "}", "popup", "=", "getPopup", "(", ")", ";", "var", "actions", "=", "getActions", "(", ")",...
Show spinner instead of Confirm button and disable Cancel button
[ "Show", "spinner", "instead", "of", "Confirm", "button", "and", "disable", "Cancel", "button" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L43687-L43706
31,393
Lemurro/client-framework7-core-frontend
dist/lemurro.js
hideLoading
function hideLoading() { var innerParams = privateProps.innerParams.get(this); var domCache = privateProps.domCache.get(this); if (!innerParams.showConfirmButton) { hide(domCache.confirmButton); if (!innerParams.showCancelButton) { hide(domCache.actions); } } removeClass([domCache.popup, ...
javascript
function hideLoading() { var innerParams = privateProps.innerParams.get(this); var domCache = privateProps.domCache.get(this); if (!innerParams.showConfirmButton) { hide(domCache.confirmButton); if (!innerParams.showCancelButton) { hide(domCache.actions); } } removeClass([domCache.popup, ...
[ "function", "hideLoading", "(", ")", "{", "var", "innerParams", "=", "privateProps", ".", "innerParams", ".", "get", "(", "this", ")", ";", "var", "domCache", "=", "privateProps", ".", "domCache", ".", "get", "(", "this", ")", ";", "if", "(", "!", "inn...
Enables buttons and hide loader.
[ "Enables", "buttons", "and", "hide", "loader", "." ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L43822-L43839
31,394
Lemurro/client-framework7-core-frontend
dist/lemurro.js
resetValidationMessage
function resetValidationMessage() { var domCache = privateProps.domCache.get(this); if (domCache.validationMessage) { hide(domCache.validationMessage); } var input = this.getInput(); if (input) { input.removeAttribute('aria-invalid'); input.removeAttribute('aria-describedBy'); removeClass(i...
javascript
function resetValidationMessage() { var domCache = privateProps.domCache.get(this); if (domCache.validationMessage) { hide(domCache.validationMessage); } var input = this.getInput(); if (input) { input.removeAttribute('aria-invalid'); input.removeAttribute('aria-describedBy'); removeClass(i...
[ "function", "resetValidationMessage", "(", ")", "{", "var", "domCache", "=", "privateProps", ".", "domCache", ".", "get", "(", "this", ")", ";", "if", "(", "domCache", ".", "validationMessage", ")", "{", "hide", "(", "domCache", ".", "validationMessage", ")"...
Hide block with validation message
[ "Hide", "block", "with", "validation", "message" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L43942-L43956
31,395
Lemurro/client-framework7-core-frontend
dist/lemurro.js
openPopup
function openPopup(params) { var container = getContainer(); var popup = getPopup(); if (params.onBeforeOpen !== null && typeof params.onBeforeOpen === 'function') { params.onBeforeOpen(popup); } if (params.animation) { addClass(popup, swalClasses.show); addClass(container, swalClasses.fade); ...
javascript
function openPopup(params) { var container = getContainer(); var popup = getPopup(); if (params.onBeforeOpen !== null && typeof params.onBeforeOpen === 'function') { params.onBeforeOpen(popup); } if (params.animation) { addClass(popup, swalClasses.show); addClass(container, swalClasses.fade); ...
[ "function", "openPopup", "(", "params", ")", "{", "var", "container", "=", "getContainer", "(", ")", ";", "var", "popup", "=", "getPopup", "(", ")", ";", "if", "(", "params", ".", "onBeforeOpen", "!==", "null", "&&", "typeof", "params", ".", "onBeforeOpe...
Open popup, add necessary classes and styles, fix scrollbar @param {Array} params
[ "Open", "popup", "add", "necessary", "classes", "and", "styles", "fix", "scrollbar" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L44191-L44246
31,396
Lemurro/client-framework7-core-frontend
dist/lemurro.js
getInputValue
function getInputValue() { var input = _this.getInput(); if (!input) { return null; } switch (innerParams.input) { case 'checkbox': return input.checked ? 1 : 0; case 'radio': return input.checked ? input.value : null; case 'file': ...
javascript
function getInputValue() { var input = _this.getInput(); if (!input) { return null; } switch (innerParams.input) { case 'checkbox': return input.checked ? 1 : 0; case 'radio': return input.checked ? input.value : null; case 'file': ...
[ "function", "getInputValue", "(", ")", "{", "var", "input", "=", "_this", ".", "getInput", "(", ")", ";", "if", "(", "!", "input", ")", "{", "return", "null", ";", "}", "switch", "(", "innerParams", ".", "input", ")", "{", "case", "'checkbox'", ":", ...
Get the value of the popup input
[ "Get", "the", "value", "of", "the", "popup", "input" ]
119985cb1d00b92b4400504e1c46f54dc36bcd77
https://github.com/Lemurro/client-framework7-core-frontend/blob/119985cb1d00b92b4400504e1c46f54dc36bcd77/dist/lemurro.js#L44319-L44339
31,397
bytbil/sauce-test-runner
src/Job.js
function (runner, url, browser) { this.id = null; this.taskId = null; this.user = runner.user; this.key = runner.key; this.framework = runner.framework; this.pollInterval = runner.pollInterval; this.statusCheckAttempts = runner.statusCheckAttempts; this.url = url; this.platform = _.i...
javascript
function (runner, url, browser) { this.id = null; this.taskId = null; this.user = runner.user; this.key = runner.key; this.framework = runner.framework; this.pollInterval = runner.pollInterval; this.statusCheckAttempts = runner.statusCheckAttempts; this.url = url; this.platform = _.i...
[ "function", "(", "runner", ",", "url", ",", "browser", ")", "{", "this", ".", "id", "=", "null", ";", "this", ".", "taskId", "=", "null", ";", "this", ".", "user", "=", "runner", ".", "user", ";", "this", ".", "key", "=", "runner", ".", "key", ...
Represents a Sauce Labs job. @constructor @param {Object} runner - TestRunner instance. @param {String} url - The test runner page's URL. @param {Object} browser - Object describing the platform to run the test on.
[ "Represents", "a", "Sauce", "Labs", "job", "." ]
db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e
https://github.com/bytbil/sauce-test-runner/blob/db0304a31a5fe7b4e6ab5f496cbca52a012d1b6e/src/Job.js#L38-L55
31,398
kevinoid/nodecat
lib/aggregate-error.js
AggregateError
function AggregateError(message) { if (!(this instanceof AggregateError)) { return new AggregateError(message); } Error.captureStackTrace(this, AggregateError); // Like http://www.ecma-international.org/ecma-262/6.0/#sec-error-message if (message !== undefined) { Object.defineProperty(this, 'message'...
javascript
function AggregateError(message) { if (!(this instanceof AggregateError)) { return new AggregateError(message); } Error.captureStackTrace(this, AggregateError); // Like http://www.ecma-international.org/ecma-262/6.0/#sec-error-message if (message !== undefined) { Object.defineProperty(this, 'message'...
[ "function", "AggregateError", "(", "message", ")", "{", "if", "(", "!", "(", "this", "instanceof", "AggregateError", ")", ")", "{", "return", "new", "AggregateError", "(", "message", ")", ";", "}", "Error", ".", "captureStackTrace", "(", "this", ",", "Aggr...
Constructs an AggregateError. Based on the AggregateError class from bluebird. @class Represents a collection of errors. @constructor @extends Error @extends Array @param {string=} message Human-readable description of the error.
[ "Constructs", "an", "AggregateError", "." ]
333f9710bbe7ceac5ec3f6171b2e8446ab2f3973
https://github.com/kevinoid/nodecat/blob/333f9710bbe7ceac5ec3f6171b2e8446ab2f3973/lib/aggregate-error.js#L21-L35
31,399
brainshave/sharpvg
split.js
split
function split (data, w, h) { var colors = {}; var pos = 0; for (var y = 0; y < h; ++y) { for (var x = 0; x < w; ++x) { pos = (y * w + x) * 4; if (data[pos + 3] > 0) { set(x, y, data[pos], data[pos + 1], data[pos + 2]); } } } return { w: w, h: h, colors: colors...
javascript
function split (data, w, h) { var colors = {}; var pos = 0; for (var y = 0; y < h; ++y) { for (var x = 0; x < w; ++x) { pos = (y * w + x) * 4; if (data[pos + 3] > 0) { set(x, y, data[pos], data[pos + 1], data[pos + 2]); } } } return { w: w, h: h, colors: colors...
[ "function", "split", "(", "data", ",", "w", ",", "h", ")", "{", "var", "colors", "=", "{", "}", ";", "var", "pos", "=", "0", ";", "for", "(", "var", "y", "=", "0", ";", "y", "<", "h", ";", "++", "y", ")", "{", "for", "(", "var", "x", "=...
Split colors of RGBA data to separate 2d arrays.
[ "Split", "colors", "of", "RGBA", "data", "to", "separate", "2d", "arrays", "." ]
c3bfe9d8566f149bc3ffd50a9ad2b26b01b3d08e
https://github.com/brainshave/sharpvg/blob/c3bfe9d8566f149bc3ffd50a9ad2b26b01b3d08e/split.js#L7-L40