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
partition
stringclasses
1 value
crcn/beet
lib/group.js
function(ops, callback) { if(!callback) callback = function() { }; //name of the script to run for supervisord if(!ops.name) ops.name = 'undefined'; var supervisordName = this._name(ops.name); //script exists? split it apart if(ops.script) { ops.di...
javascript
function(ops, callback) { if(!callback) callback = function() { }; //name of the script to run for supervisord if(!ops.name) ops.name = 'undefined'; var supervisordName = this._name(ops.name); //script exists? split it apart if(ops.script) { ops.di...
[ "function", "(", "ops", ",", "callback", ")", "{", "if", "(", "!", "callback", ")", "callback", "=", "function", "(", ")", "{", "}", ";", "//name of the script to run for supervisord", "if", "(", "!", "ops", ".", "name", ")", "ops", ".", "name", "=", "...
addes a process to a given group
[ "addes", "a", "process", "to", "a", "given", "group" ]
e8622c5c48592bddcf9507a388022aea1f571f01
https://github.com/crcn/beet/blob/e8622c5c48592bddcf9507a388022aea1f571f01/lib/group.js#L153-L218
train
crcn/beet
lib/group.js
function(ops, callback) { var search = typeof ops == 'string' ? { name: ops } : ops, query = this._query(search), self = this; //stop the app in case... self.stop(search.name, function(err, result) { if(callback) callback(err, result); }); //remove ...
javascript
function(ops, callback) { var search = typeof ops == 'string' ? { name: ops } : ops, query = this._query(search), self = this; //stop the app in case... self.stop(search.name, function(err, result) { if(callback) callback(err, result); }); //remove ...
[ "function", "(", "ops", ",", "callback", ")", "{", "var", "search", "=", "typeof", "ops", "==", "'string'", "?", "{", "name", ":", "ops", "}", ":", "ops", ",", "query", "=", "this", ".", "_query", "(", "search", ")", ",", "self", "=", "this", ";"...
Removes a script from supervisord
[ "Removes", "a", "script", "from", "supervisord" ]
e8622c5c48592bddcf9507a388022aea1f571f01
https://github.com/crcn/beet/blob/e8622c5c48592bddcf9507a388022aea1f571f01/lib/group.js#L224-L236
train
themouette/screenstory
lib/reporter.js
ForwardMochaReporter
function ForwardMochaReporter(mochaRunner, options) { Base.call(this, mochaRunner, options); forwardEvent(mochaRunner, runner, 'start'); forwardEvent(mochaRunner, runner, 'suite'); forwardEvent(mochaRunner, runner, 'suite end'); forwardEvent(mochaRunner, runner, 'pending'); forwardEvent(mochaRun...
javascript
function ForwardMochaReporter(mochaRunner, options) { Base.call(this, mochaRunner, options); forwardEvent(mochaRunner, runner, 'start'); forwardEvent(mochaRunner, runner, 'suite'); forwardEvent(mochaRunner, runner, 'suite end'); forwardEvent(mochaRunner, runner, 'pending'); forwardEvent(mochaRun...
[ "function", "ForwardMochaReporter", "(", "mochaRunner", ",", "options", ")", "{", "Base", ".", "call", "(", "this", ",", "mochaRunner", ",", "options", ")", ";", "forwardEvent", "(", "mochaRunner", ",", "runner", ",", "'start'", ")", ";", "forwardEvent", "("...
Initialize a new `ProxyReporter` reporter. @param {Runner} runner @api public
[ "Initialize", "a", "new", "ProxyReporter", "reporter", "." ]
0c847f5514a55e7c2f59728565591d4bb5788915
https://github.com/themouette/screenstory/blob/0c847f5514a55e7c2f59728565591d4bb5788915/lib/reporter.js#L22-L44
train
redisjs/jsr-log
lib/logtime.js
logtime
function logtime() { var d = new Date() , space = ' ' , delimiter = ':' , str = d.toString() , month = str.split(' ')[1]; return d.getDate() + space + month + space + d.getHours() + delimiter + pad(d.getMinutes()) + delimiter + pad(d.getSeconds()) + '.' + pad(d.getMillisecond...
javascript
function logtime() { var d = new Date() , space = ' ' , delimiter = ':' , str = d.toString() , month = str.split(' ')[1]; return d.getDate() + space + month + space + d.getHours() + delimiter + pad(d.getMinutes()) + delimiter + pad(d.getSeconds()) + '.' + pad(d.getMillisecond...
[ "function", "logtime", "(", ")", "{", "var", "d", "=", "new", "Date", "(", ")", ",", "space", "=", "' '", ",", "delimiter", "=", "':'", ",", "str", "=", "d", ".", "toString", "(", ")", ",", "month", "=", "str", ".", "split", "(", "' '", ")", ...
Utility to get a time format.
[ "Utility", "to", "get", "a", "time", "format", "." ]
a67a34285449b0d731493def58d8a5212aad5526
https://github.com/redisjs/jsr-log/blob/a67a34285449b0d731493def58d8a5212aad5526/lib/logtime.js#L6-L19
train
fazo96/LC2.js
peripherals/console.js
Console
function Console (lc2, position, debug) { this.lc2 = lc2 this.position = position this.debug = debug || false this.name = 'Console' this.lastReadKey = 0 this.inputBuffer = 0 this.outputKey = 0 this.displayReady = 1 }
javascript
function Console (lc2, position, debug) { this.lc2 = lc2 this.position = position this.debug = debug || false this.name = 'Console' this.lastReadKey = 0 this.inputBuffer = 0 this.outputKey = 0 this.displayReady = 1 }
[ "function", "Console", "(", "lc2", ",", "position", ",", "debug", ")", "{", "this", ".", "lc2", "=", "lc2", "this", ".", "position", "=", "position", "this", ".", "debug", "=", "debug", "||", "false", "this", ".", "name", "=", "'Console'", "this", "....
Creates a new Console. Of course it needs a reference to a `lc2` CPU, the `position` in memory that will map to the Console registers, and wether or not debug mode might be activated.
[ "Creates", "a", "new", "Console", ".", "Of", "course", "it", "needs", "a", "reference", "to", "a", "lc2", "CPU", "the", "position", "in", "memory", "that", "will", "map", "to", "the", "Console", "registers", "and", "wether", "or", "not", "debug", "mode",...
33b1d1e84d5da7c0df16290fc1289628ba65b430
https://github.com/fazo96/LC2.js/blob/33b1d1e84d5da7c0df16290fc1289628ba65b430/peripherals/console.js#L183-L192
train
lorenwest/monitor-min
lib/probes/FileProbe.js
function() { FS.readFile(path, options.encoding, function(err, text) { if (err) { // Forward the error return callback(err); } // Success callback(null, text.toString()); }); }
javascript
function() { FS.readFile(path, options.encoding, function(err, text) { if (err) { // Forward the error return callback(err); } // Success callback(null, text.toString()); }); }
[ "function", "(", ")", "{", "FS", ".", "readFile", "(", "path", ",", "options", ".", "encoding", ",", "function", "(", "err", ",", "text", ")", "{", "if", "(", "err", ")", "{", "// Forward the error", "return", "callback", "(", "err", ")", ";", "}", ...
Build the function to call when the file changes
[ "Build", "the", "function", "to", "call", "when", "the", "file", "changes" ]
859ba34a121498dc1cb98577ae24abd825407fca
https://github.com/lorenwest/monitor-min/blob/859ba34a121498dc1cb98577ae24abd825407fca/lib/probes/FileProbe.js#L254-L263
train
bibig/rander
libs/rander.js
pickup
function pickup (/*len, dict || dict */) { var str = '', pos; var len, dict; if (arguments.length === 1) { dict = arguments[0]; len = 1; } else if (arguments.length === 2) { len = arguments[0]; dict = arguments[1]; } else { return string(); } for (var i=0; i< len; i++) { pos = dice(dict.length - 1)...
javascript
function pickup (/*len, dict || dict */) { var str = '', pos; var len, dict; if (arguments.length === 1) { dict = arguments[0]; len = 1; } else if (arguments.length === 2) { len = arguments[0]; dict = arguments[1]; } else { return string(); } for (var i=0; i< len; i++) { pos = dice(dict.length - 1)...
[ "function", "pickup", "(", "/*len, dict || dict */", ")", "{", "var", "str", "=", "''", ",", "pos", ";", "var", "len", ",", "dict", ";", "if", "(", "arguments", ".", "length", "===", "1", ")", "{", "dict", "=", "arguments", "[", "0", "]", ";", "len...
dict is a string
[ "dict", "is", "a", "string" ]
8f4d4d807994d9b11e57ea979e9a7597d8c983eb
https://github.com/bibig/rander/blob/8f4d4d807994d9b11e57ea979e9a7597d8c983eb/libs/rander.js#L21-L41
train
JoshuaToenyes/browserify-testability
src/prelude.js
function(x, reload){ // Get the numeric ID for the module to load. var id = modules[name][1][x]; // If there's a matching module in the testability cache, return it. if (_testability_cache_[x]) return _testability_cache_[x]; // Return recursively... the...
javascript
function(x, reload){ // Get the numeric ID for the module to load. var id = modules[name][1][x]; // If there's a matching module in the testability cache, return it. if (_testability_cache_[x]) return _testability_cache_[x]; // Return recursively... the...
[ "function", "(", "x", ",", "reload", ")", "{", "// Get the numeric ID for the module to load.", "var", "id", "=", "modules", "[", "name", "]", "[", "1", "]", "[", "x", "]", ";", "// If there's a matching module in the testability cache, return it.", "if", "(", "_tes...
Create the require function for this module.
[ "Create", "the", "require", "function", "for", "this", "module", "." ]
a8966b3dc49b84e68198e87a7d1ec61b2bddfe23
https://github.com/JoshuaToenyes/browserify-testability/blob/a8966b3dc49b84e68198e87a7d1ec61b2bddfe23/src/prelude.js#L42-L53
train
transomjs/transom-mongoose-localuser
lib/localUserMiddleware.js
groupMembershipMiddleware
function groupMembershipMiddleware(groups) { if (typeof groups === 'string') { groups = [groups]; } return function hasGroupMembership(req, res, next) { if (req.locals.user) { const userGroups = req.locals.user.groups || []; for (let group of groups) { if (userGroups.indexOf(group) !== -1) { ...
javascript
function groupMembershipMiddleware(groups) { if (typeof groups === 'string') { groups = [groups]; } return function hasGroupMembership(req, res, next) { if (req.locals.user) { const userGroups = req.locals.user.groups || []; for (let group of groups) { if (userGroups.indexOf(group) !== -1) { ...
[ "function", "groupMembershipMiddleware", "(", "groups", ")", "{", "if", "(", "typeof", "groups", "===", "'string'", ")", "{", "groups", "=", "[", "groups", "]", ";", "}", "return", "function", "hasGroupMembership", "(", "req", ",", "res", ",", "next", ")",...
api configs Create a middleware that confirms whether a logged in user has one of the specified Groups. @param {string or Array} groups one or more Group codes that are required for this route.
[ "api", "configs", "Create", "a", "middleware", "that", "confirms", "whether", "a", "logged", "in", "user", "has", "one", "of", "the", "specified", "Groups", "." ]
e610ba9e08c5a117f71a8aac33997f0549df06fe
https://github.com/transomjs/transom-mongoose-localuser/blob/e610ba9e08c5a117f71a8aac33997f0549df06fe/lib/localUserMiddleware.js#L17-L34
train
transomjs/transom-mongoose-localuser
lib/localUserMiddleware.js
isLoggedInMiddleware
function isLoggedInMiddleware() { return function isLoggedIn(req, res, next) { const AclUser = mongoose.model("TransomAclUser"); if ((req.headers && req.headers.authorization) || (req.body && req.body.access_token) || (req.query && req.query.access_token)) { // Verify the authorization token or fail. p...
javascript
function isLoggedInMiddleware() { return function isLoggedIn(req, res, next) { const AclUser = mongoose.model("TransomAclUser"); if ((req.headers && req.headers.authorization) || (req.body && req.body.access_token) || (req.query && req.query.access_token)) { // Verify the authorization token or fail. p...
[ "function", "isLoggedInMiddleware", "(", ")", "{", "return", "function", "isLoggedIn", "(", "req", ",", "res", ",", "next", ")", "{", "const", "AclUser", "=", "mongoose", ".", "model", "(", "\"TransomAclUser\"", ")", ";", "if", "(", "(", "req", ".", "hea...
Create middleware that requires a valid Bearer token.
[ "Create", "middleware", "that", "requires", "a", "valid", "Bearer", "token", "." ]
e610ba9e08c5a117f71a8aac33997f0549df06fe
https://github.com/transomjs/transom-mongoose-localuser/blob/e610ba9e08c5a117f71a8aac33997f0549df06fe/lib/localUserMiddleware.js#L39-L86
train
themouette/screenstory
lib/runner/runMocha.js
prepareContext
function prepareContext(screenstoryRunner, options, context, file, mochaRunner) { debug('prepare context for %s', file); var wdOptions = { desiredCapabilities: options.wdCapabilities, host: options.wdHost, port: options.wdPort, user: options.wdUser...
javascript
function prepareContext(screenstoryRunner, options, context, file, mochaRunner) { debug('prepare context for %s', file); var wdOptions = { desiredCapabilities: options.wdCapabilities, host: options.wdHost, port: options.wdPort, user: options.wdUser...
[ "function", "prepareContext", "(", "screenstoryRunner", ",", "options", ",", "context", ",", "file", ",", "mochaRunner", ")", "{", "debug", "(", "'prepare context for %s'", ",", "file", ")", ";", "var", "wdOptions", "=", "{", "desiredCapabilities", ":", "options...
prepare context before given file runs see mocha runner `pre-require` event
[ "prepare", "context", "before", "given", "file", "runs", "see", "mocha", "runner", "pre", "-", "require", "event" ]
0c847f5514a55e7c2f59728565591d4bb5788915
https://github.com/themouette/screenstory/blob/0c847f5514a55e7c2f59728565591d4bb5788915/lib/runner/runMocha.js#L64-L111
train
airbrite/muni
router.js
function(req, requiredParams) { // Find all missing parameters var missingParams = []; _.forEach(requiredParams, function(requiredParam) { if ( Mixins.isNullOrUndefined(req.params && req.params[requiredParam]) && Mixins.isNullOrUndefined(req.query && req.query[requiredParam...
javascript
function(req, requiredParams) { // Find all missing parameters var missingParams = []; _.forEach(requiredParams, function(requiredParam) { if ( Mixins.isNullOrUndefined(req.params && req.params[requiredParam]) && Mixins.isNullOrUndefined(req.query && req.query[requiredParam...
[ "function", "(", "req", ",", "requiredParams", ")", "{", "// Find all missing parameters", "var", "missingParams", "=", "[", "]", ";", "_", ".", "forEach", "(", "requiredParams", ",", "function", "(", "requiredParam", ")", "{", "if", "(", "Mixins", ".", "isN...
Return a list of missing parameters that were required @param {Object} req @param {Array} requiredParams @return {Array}
[ "Return", "a", "list", "of", "missing", "parameters", "that", "were", "required" ]
ea8b26aa94836514374907c325a0d79f28838e2e
https://github.com/airbrite/muni/blob/ea8b26aa94836514374907c325a0d79f28838e2e/router.js#L43-L56
train
airbrite/muni
router.js
function(missingParams) { var errParts = []; missingParams = _.map(missingParams, function(missingParam) { return '`' + missingParam + '`'; }); errParts.push("Missing"); errParts.push(missingParams.join(', ')); errParts.push("parameter(s)."); return new MuniError(errPar...
javascript
function(missingParams) { var errParts = []; missingParams = _.map(missingParams, function(missingParam) { return '`' + missingParam + '`'; }); errParts.push("Missing"); errParts.push(missingParams.join(', ')); errParts.push("parameter(s)."); return new MuniError(errPar...
[ "function", "(", "missingParams", ")", "{", "var", "errParts", "=", "[", "]", ";", "missingParams", "=", "_", ".", "map", "(", "missingParams", ",", "function", "(", "missingParam", ")", "{", "return", "'`'", "+", "missingParam", "+", "'`'", ";", "}", ...
Return an Error containing missing parameters that were required @param {Array} missingParams @return {MuniError}
[ "Return", "an", "Error", "containing", "missing", "parameters", "that", "were", "required" ]
ea8b26aa94836514374907c325a0d79f28838e2e
https://github.com/airbrite/muni/blob/ea8b26aa94836514374907c325a0d79f28838e2e/router.js#L65-L74
train
airbrite/muni
router.js
function() { // Used for de-duping var paths = {}; // Each controller has a `routes` object // Connect all routes defined in controllers _.forEach(router.controllers, function(controller) { _.forEach(controller.routes, function(route, method) { _.forEach(route, function(...
javascript
function() { // Used for de-duping var paths = {}; // Each controller has a `routes` object // Connect all routes defined in controllers _.forEach(router.controllers, function(controller) { _.forEach(controller.routes, function(route, method) { _.forEach(route, function(...
[ "function", "(", ")", "{", "// Used for de-duping", "var", "paths", "=", "{", "}", ";", "// Each controller has a `routes` object", "// Connect all routes defined in controllers", "_", ".", "forEach", "(", "router", ".", "controllers", ",", "function", "(", "controller"...
Iterates over all controllers and connects any routes defined
[ "Iterates", "over", "all", "controllers", "and", "connects", "any", "routes", "defined" ]
ea8b26aa94836514374907c325a0d79f28838e2e
https://github.com/airbrite/muni/blob/ea8b26aa94836514374907c325a0d79f28838e2e/router.js#L115-L169
train
mrduncan/ranger
lib/ranger/client.js
toRooms
function toRooms(data) { var i, rooms; rooms = []; for (i = 0; i < data.rooms.length; i++) { rooms.push(new Room(connection, data.rooms[i])); } return rooms; }
javascript
function toRooms(data) { var i, rooms; rooms = []; for (i = 0; i < data.rooms.length; i++) { rooms.push(new Room(connection, data.rooms[i])); } return rooms; }
[ "function", "toRooms", "(", "data", ")", "{", "var", "i", ",", "rooms", ";", "rooms", "=", "[", "]", ";", "for", "(", "i", "=", "0", ";", "i", "<", "data", ".", "rooms", ".", "length", ";", "i", "++", ")", "{", "rooms", ".", "push", "(", "n...
Convert the specified response data into an array of Rooms. @param {Object} data The server response data. @return {Array.<Room>} An array of Rooms.
[ "Convert", "the", "specified", "response", "data", "into", "an", "array", "of", "Rooms", "." ]
6fed6e8353512e9b4985f6080aa6f2cc1363e840
https://github.com/mrduncan/ranger/blob/6fed6e8353512e9b4985f6080aa6f2cc1363e840/lib/ranger/client.js#L19-L28
train
SideCatt/SideCat
src/js/lib/react.js
parseActiveChildren
function parseActiveChildren(values, active) { let activeChild = false; const activeValues = values.map(function (val) { const childrenTraversed = (val.children && parseActiveChildren(val.children, active)); const isActive = val.value === active || Boolean(childrenTraversed && childrenTraversed.hasActiveChild); ...
javascript
function parseActiveChildren(values, active) { let activeChild = false; const activeValues = values.map(function (val) { const childrenTraversed = (val.children && parseActiveChildren(val.children, active)); const isActive = val.value === active || Boolean(childrenTraversed && childrenTraversed.hasActiveChild); ...
[ "function", "parseActiveChildren", "(", "values", ",", "active", ")", "{", "let", "activeChild", "=", "false", ";", "const", "activeValues", "=", "values", ".", "map", "(", "function", "(", "val", ")", "{", "const", "childrenTraversed", "=", "(", "val", "....
Class handles boilerplate javascript to attribute active state to a data array. This does not handle array of active values. Recursively searches children. @param {array} values Array of data for iteratively rendered child components @param {string} active Active element of child components @returns {object} ...
[ "Class", "handles", "boilerplate", "javascript", "to", "attribute", "active", "state", "to", "a", "data", "array", ".", "This", "does", "not", "handle", "array", "of", "active", "values", ".", "Recursively", "searches", "children", "." ]
40ecf15eb9a26a3ad94cc771c235508e654b51c0
https://github.com/SideCatt/SideCat/blob/40ecf15eb9a26a3ad94cc771c235508e654b51c0/src/js/lib/react.js#L9-L35
train
douglasduteil/gesalakacula
lib/gesalakacula.js
queueLauncherKey
function queueLauncherKey(asKey, subprocess) { return function processTarget(targets) { return Object .keys(targets) .map(function (targetName) { return subprocess(targets[targetName]) .map(function (launcher) { launcher[asKey] = targetName; return launcher; ...
javascript
function queueLauncherKey(asKey, subprocess) { return function processTarget(targets) { return Object .keys(targets) .map(function (targetName) { return subprocess(targets[targetName]) .map(function (launcher) { launcher[asKey] = targetName; return launcher; ...
[ "function", "queueLauncherKey", "(", "asKey", ",", "subprocess", ")", "{", "return", "function", "processTarget", "(", "targets", ")", "{", "return", "Object", ".", "keys", "(", "targets", ")", ".", "map", "(", "function", "(", "targetName", ")", "{", "ret...
Generic in queue key assignment. @description This will assign the in the result fo a sub process. @param {String} asKey the name to use in the launcher environment for the current key in the target. @param {Function} subprocess process to use as launcher environment @returns {Function} A target processor.
[ "Generic", "in", "queue", "key", "assignment", "." ]
86e117807a2ab86b1e72972c3371ec92f14c9353
https://github.com/douglasduteil/gesalakacula/blob/86e117807a2ab86b1e72972c3371ec92f14c9353/lib/gesalakacula.js#L71-L87
train
douglasduteil/gesalakacula
lib/gesalakacula.js
generateSauceLabsKarmaCustomLaunchers
function generateSauceLabsKarmaCustomLaunchers(config) { return processPlatform(config) .reduce(function (memo, launcher) { var launcherName = [ SAUCELABS_PREFIX, shorty(launcher.platform), shorty(launcher.browserName), launcher.version ].join('_'); memo[launcherN...
javascript
function generateSauceLabsKarmaCustomLaunchers(config) { return processPlatform(config) .reduce(function (memo, launcher) { var launcherName = [ SAUCELABS_PREFIX, shorty(launcher.platform), shorty(launcher.browserName), launcher.version ].join('_'); memo[launcherN...
[ "function", "generateSauceLabsKarmaCustomLaunchers", "(", "config", ")", "{", "return", "processPlatform", "(", "config", ")", ".", "reduce", "(", "function", "(", "memo", ",", "launcher", ")", "{", "var", "launcherName", "=", "[", "SAUCELABS_PREFIX", ",", "shor...
Generate SauceLabs Karma "customLaunchers". @param {Object} config The abstract full config to process @returns {Object} The karma ready "customLaunchers" object.
[ "Generate", "SauceLabs", "Karma", "customLaunchers", "." ]
86e117807a2ab86b1e72972c3371ec92f14c9353
https://github.com/douglasduteil/gesalakacula/blob/86e117807a2ab86b1e72972c3371ec92f14c9353/lib/gesalakacula.js#L94-L116
train
electrovir/arff-toolkit
arffToolkit.js
separateMultiClassArffData
function separateMultiClassArffData(arffData, outputAttributes) { if (!Array.isArray(outputAttributes) || outputAttributes.length === 0) { outputAttributes = [arffData.attributes[arffData.attributes.length - 1]]; } outputAttributes.forEach((attribute) => { if (arffData.types[attribute].hasOwnProperty...
javascript
function separateMultiClassArffData(arffData, outputAttributes) { if (!Array.isArray(outputAttributes) || outputAttributes.length === 0) { outputAttributes = [arffData.attributes[arffData.attributes.length - 1]]; } outputAttributes.forEach((attribute) => { if (arffData.types[attribute].hasOwnProperty...
[ "function", "separateMultiClassArffData", "(", "arffData", ",", "outputAttributes", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "outputAttributes", ")", "||", "outputAttributes", ".", "length", "===", "0", ")", "{", "outputAttributes", "=", "[", "a...
this mutates arffData
[ "this", "mutates", "arffData" ]
82edbacf84cc8acf347256c7d65f12688f91e439
https://github.com/electrovir/arff-toolkit/blob/82edbacf84cc8acf347256c7d65f12688f91e439/arffToolkit.js#L34-L67
train
electrovir/arff-toolkit
arffToolkit.js
loadArff
function loadArff(fileName, callback) { ARFF.load(fileName, (error, data) => { if (error) { throw new Error(filename + error); } callback(data); }); return 'THIS IS ASYNCHRONOUS'; }
javascript
function loadArff(fileName, callback) { ARFF.load(fileName, (error, data) => { if (error) { throw new Error(filename + error); } callback(data); }); return 'THIS IS ASYNCHRONOUS'; }
[ "function", "loadArff", "(", "fileName", ",", "callback", ")", "{", "ARFF", ".", "load", "(", "fileName", ",", "(", "error", ",", "data", ")", "=>", "{", "if", "(", "error", ")", "{", "throw", "new", "Error", "(", "filename", "+", "error", ")", ";"...
just a wrapper to make it easier to read ARFF files
[ "just", "a", "wrapper", "to", "make", "it", "easier", "to", "read", "ARFF", "files" ]
82edbacf84cc8acf347256c7d65f12688f91e439
https://github.com/electrovir/arff-toolkit/blob/82edbacf84cc8acf347256c7d65f12688f91e439/arffToolkit.js#L166-L175
train
dizmo/functions-random
dist/lib/index.js
random
function random() { var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 36; return String.random(length, range); }
javascript
function random() { var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 36; return String.random(length, range); }
[ "function", "random", "(", ")", "{", "var", "length", "=", "arguments", ".", "length", ">", "0", "&&", "arguments", "[", "0", "]", "!==", "undefined", "?", "arguments", "[", "0", "]", ":", "0", ";", "var", "range", "=", "arguments", ".", "length", ...
Returns a random string for the provided length and range. @param length of returned string in [0..8] @param range of characters in [2..36] @returns a random string
[ "Returns", "a", "random", "string", "for", "the", "provided", "length", "and", "range", "." ]
480c9ff22622842ecaa4c034c61f342a6ae14fc6
https://github.com/dizmo/functions-random/blob/480c9ff22622842ecaa4c034c61f342a6ae14fc6/dist/lib/index.js#L13-L18
train
sackio/pa1d
lib/providers/braintree.js
function(obj, name, callback){ if (!obj) return Belt.noop; var s = _.pick(obj, B._api_objects[name + 's']); var stream = B._gateway[name].search(function(search){ _.each(s, function(v, k){ if (_.isObject(v)) return search[k].call(search)[v.op](v.val, v.val2); retur...
javascript
function(obj, name, callback){ if (!obj) return Belt.noop; var s = _.pick(obj, B._api_objects[name + 's']); var stream = B._gateway[name].search(function(search){ _.each(s, function(v, k){ if (_.isObject(v)) return search[k].call(search)[v.op](v.val, v.val2); retur...
[ "function", "(", "obj", ",", "name", ",", "callback", ")", "{", "if", "(", "!", "obj", ")", "return", "Belt", ".", "noop", ";", "var", "s", "=", "_", ".", "pick", "(", "obj", ",", "B", ".", "_api_objects", "[", "name", "+", "'s'", "]", ")", "...
return function with searching criteria
[ "return", "function", "with", "searching", "criteria" ]
fc981f086434045d8eed50f631645558ef212507
https://github.com/sackio/pa1d/blob/fc981f086434045d8eed50f631645558ef212507/lib/providers/braintree.js#L84-L108
train
victorherraiz/xcatalog
index.js
xcatalog
function xcatalog(id) { const definition = definitions.get(id); if (!definition) { throw new TypeError("No definition for: " + id); } if (!definition.fac) { definition.fac = build(definition, definition.dep.map(xcatalog)); } return definition.fac(); }
javascript
function xcatalog(id) { const definition = definitions.get(id); if (!definition) { throw new TypeError("No definition for: " + id); } if (!definition.fac) { definition.fac = build(definition, definition.dep.map(xcatalog)); } return definition.fac(); }
[ "function", "xcatalog", "(", "id", ")", "{", "const", "definition", "=", "definitions", ".", "get", "(", "id", ")", ";", "if", "(", "!", "definition", ")", "{", "throw", "new", "TypeError", "(", "\"No definition for: \"", "+", "id", ")", ";", "}", "if"...
Retrieves a stored reference @param {string} id - xcatalog id item
[ "Retrieves", "a", "stored", "reference" ]
1b91bf6f75ce57bf1abbc9f15c56d53f3dc8e966
https://github.com/victorherraiz/xcatalog/blob/1b91bf6f75ce57bf1abbc9f15c56d53f3dc8e966/index.js#L28-L37
train
antonycourtney/tabli-core
lib/js/components/browserConstants.js
initBrowser
function initBrowser() { if (window.chrome) { Object.assign(module.exports, chromeConstants); } else { Object.assign(module.exports, braveConstants); } }
javascript
function initBrowser() { if (window.chrome) { Object.assign(module.exports, chromeConstants); } else { Object.assign(module.exports, braveConstants); } }
[ "function", "initBrowser", "(", ")", "{", "if", "(", "window", ".", "chrome", ")", "{", "Object", ".", "assign", "(", "module", ".", "exports", ",", "chromeConstants", ")", ";", "}", "else", "{", "Object", ".", "assign", "(", "module", ".", "exports", ...
do browser detection and assign constants to exported bindings. Should only happen once.
[ "do", "browser", "detection", "and", "assign", "constants", "to", "exported", "bindings", "." ]
76cc540891421bc6c8bdcf00f277ebb6e716fdd9
https://github.com/antonycourtney/tabli-core/blob/76cc540891421bc6c8bdcf00f277ebb6e716fdd9/lib/js/components/browserConstants.js#L11-L17
train
AmrEldib/agol-data-faker
build-doc.js
generateCodeDocs
function generateCodeDocs() { config.codeFiles.forEach(function (jsFile) { var jf = [jsFile]; documentation(jf, {}, function (err, result) { documentation.formats.md(result, {}, function (err, md) { // Write to file fs.writeFile(path.resolve(__dirname, config.docFolder + "/" + jsFile + "...
javascript
function generateCodeDocs() { config.codeFiles.forEach(function (jsFile) { var jf = [jsFile]; documentation(jf, {}, function (err, result) { documentation.formats.md(result, {}, function (err, md) { // Write to file fs.writeFile(path.resolve(__dirname, config.docFolder + "/" + jsFile + "...
[ "function", "generateCodeDocs", "(", ")", "{", "config", ".", "codeFiles", ".", "forEach", "(", "function", "(", "jsFile", ")", "{", "var", "jf", "=", "[", "jsFile", "]", ";", "documentation", "(", "jf", ",", "{", "}", ",", "function", "(", "err", ",...
Generate documentation for code files. It reads the JSDoc comments and generate markdown files for them. One markdown file is generated for each code file.
[ "Generate", "documentation", "for", "code", "files", ".", "It", "reads", "the", "JSDoc", "comments", "and", "generate", "markdown", "files", "for", "them", ".", "One", "markdown", "file", "is", "generated", "for", "each", "code", "file", "." ]
9bb7e29698a34effd98afe135d053256050a072e
https://github.com/AmrEldib/agol-data-faker/blob/9bb7e29698a34effd98afe135d053256050a072e/build-doc.js#L9-L19
train
ro-ka/stylesheet.js
lib/stylesheet.js
Stylesheet
function Stylesheet() { var styleElement = document.createElement('style'), head = document.getElementsByTagName('head')[0]; head.appendChild(styleElement); // Safari does not see the new stylesheet unless you append something. // However! IE will blow chunks, so ... filter it thusly: if (!window.creat...
javascript
function Stylesheet() { var styleElement = document.createElement('style'), head = document.getElementsByTagName('head')[0]; head.appendChild(styleElement); // Safari does not see the new stylesheet unless you append something. // However! IE will blow chunks, so ... filter it thusly: if (!window.creat...
[ "function", "Stylesheet", "(", ")", "{", "var", "styleElement", "=", "document", ".", "createElement", "(", "'style'", ")", ",", "head", "=", "document", ".", "getElementsByTagName", "(", "'head'", ")", "[", "0", "]", ";", "head", ".", "appendChild", "(", ...
Create a new stylesheet
[ "Create", "a", "new", "stylesheet" ]
4f02289b62da5d49d7f001e6934371342e07d4a7
https://github.com/ro-ka/stylesheet.js/blob/4f02289b62da5d49d7f001e6934371342e07d4a7/lib/stylesheet.js#L4-L17
train
aliaksandr-master/node-verifier-schema
lib/schema.js
function (validations) { if (!validations) { return this; } if (!this.validations) { this.validations = []; } var that = this; _.isArray(validations) || (validations = [ validations ]); _.each(validations, function (validation) { that.validations.push(validation); }); return this; }
javascript
function (validations) { if (!validations) { return this; } if (!this.validations) { this.validations = []; } var that = this; _.isArray(validations) || (validations = [ validations ]); _.each(validations, function (validation) { that.validations.push(validation); }); return this; }
[ "function", "(", "validations", ")", "{", "if", "(", "!", "validations", ")", "{", "return", "this", ";", "}", "if", "(", "!", "this", ".", "validations", ")", "{", "this", ".", "validations", "=", "[", "]", ";", "}", "var", "that", "=", "this", ...
set validate options. can be called several times @method @this {Schema} @param {*} validations - validation options. @returns {Schema} @this
[ "set", "validate", "options", ".", "can", "be", "called", "several", "times" ]
dc49df3c4703928bcfd7447a59cdd70bafac21b0
https://github.com/aliaksandr-master/node-verifier-schema/blob/dc49df3c4703928bcfd7447a59cdd70bafac21b0/lib/schema.js#L102-L120
train
aliaksandr-master/node-verifier-schema
lib/schema.js
function (flagOrBuilder) { if (_.isFunction(flagOrBuilder)) { this.object(flagOrBuilder); } if (flagOrBuilder == null || flagOrBuilder) { this.isArray = true; } else { delete this.isArray; } return this; }
javascript
function (flagOrBuilder) { if (_.isFunction(flagOrBuilder)) { this.object(flagOrBuilder); } if (flagOrBuilder == null || flagOrBuilder) { this.isArray = true; } else { delete this.isArray; } return this; }
[ "function", "(", "flagOrBuilder", ")", "{", "if", "(", "_", ".", "isFunction", "(", "flagOrBuilder", ")", ")", "{", "this", ".", "object", "(", "flagOrBuilder", ")", ";", "}", "if", "(", "flagOrBuilder", "==", "null", "||", "flagOrBuilder", ")", "{", "...
set nested fields builder with type array @method @this {Schema} @param {?Boolean} [flagOrBuilder] @throws {TypeError} If nested is not a function if specified @returns {Schema} @this
[ "set", "nested", "fields", "builder", "with", "type", "array" ]
dc49df3c4703928bcfd7447a59cdd70bafac21b0
https://github.com/aliaksandr-master/node-verifier-schema/blob/dc49df3c4703928bcfd7447a59cdd70bafac21b0/lib/schema.js#L146-L158
train
aliaksandr-master/node-verifier-schema
lib/schema.js
function (schema, process) { var that = this; if (!(schema instanceof Schema)) { throw new Error('first argument must be instance of Schema'); } if (process) { var r = process.call(this, schema); if (r != null && !r) { return this; } } _.each(schema.fields, function (fieldSchema, fieldNa...
javascript
function (schema, process) { var that = this; if (!(schema instanceof Schema)) { throw new Error('first argument must be instance of Schema'); } if (process) { var r = process.call(this, schema); if (r != null && !r) { return this; } } _.each(schema.fields, function (fieldSchema, fieldNa...
[ "function", "(", "schema", ",", "process", ")", "{", "var", "that", "=", "this", ";", "if", "(", "!", "(", "schema", "instanceof", "Schema", ")", ")", "{", "throw", "new", "Error", "(", "'first argument must be instance of Schema'", ")", ";", "}", "if", ...
clone schema to this schema object @method @this {Schema} @param {Schema} schema @param {processFunction} [process] @returns {Schema} new object (clone)
[ "clone", "schema", "to", "this", "schema", "object" ]
dc49df3c4703928bcfd7447a59cdd70bafac21b0
https://github.com/aliaksandr-master/node-verifier-schema/blob/dc49df3c4703928bcfd7447a59cdd70bafac21b0/lib/schema.js#L214-L246
train
aliaksandr-master/node-verifier-schema
lib/schema.js
function (name, validation) { if (name == null && validation == null) { delete this.isRequired; return this; } return this.field(name).validate(validation); }
javascript
function (name, validation) { if (name == null && validation == null) { delete this.isRequired; return this; } return this.field(name).validate(validation); }
[ "function", "(", "name", ",", "validation", ")", "{", "if", "(", "name", "==", "null", "&&", "validation", "==", "null", ")", "{", "delete", "this", ".", "isRequired", ";", "return", "this", ";", "}", "return", "this", ".", "field", "(", "name", ")",...
add new required nested schema by construct @method @this {Schema} @param {?String} [name] - field name. @param {?*} [validation] - validation options. @returns {Schema}
[ "add", "new", "required", "nested", "schema", "by", "construct" ]
dc49df3c4703928bcfd7447a59cdd70bafac21b0
https://github.com/aliaksandr-master/node-verifier-schema/blob/dc49df3c4703928bcfd7447a59cdd70bafac21b0/lib/schema.js#L277-L284
train
aliaksandr-master/node-verifier-schema
lib/schema.js
function (name, validation) { if (name == null && validation == null) { this.isRequired = false; return this; } return this.field(name).validate(validation).optional(); }
javascript
function (name, validation) { if (name == null && validation == null) { this.isRequired = false; return this; } return this.field(name).validate(validation).optional(); }
[ "function", "(", "name", ",", "validation", ")", "{", "if", "(", "name", "==", "null", "&&", "validation", "==", "null", ")", "{", "this", ".", "isRequired", "=", "false", ";", "return", "this", ";", "}", "return", "this", ".", "field", "(", "name", ...
add new optional nested schema by construct @method @this {Schema} @param {?String} [name] - field name. @param {?*} [validation] - validation options. @returns {Schema}
[ "add", "new", "optional", "nested", "schema", "by", "construct" ]
dc49df3c4703928bcfd7447a59cdd70bafac21b0
https://github.com/aliaksandr-master/node-verifier-schema/blob/dc49df3c4703928bcfd7447a59cdd70bafac21b0/lib/schema.js#L297-L304
train
thomasdobber/grunt-remfallback
tasks/remfallback.js
preciseRound
function preciseRound(num) { var decimals = options.round ? 0 : 1; return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals); }
javascript
function preciseRound(num) { var decimals = options.round ? 0 : 1; return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals); }
[ "function", "preciseRound", "(", "num", ")", "{", "var", "decimals", "=", "options", ".", "round", "?", "0", ":", "1", ";", "return", "Math", ".", "round", "(", "num", "*", "Math", ".", "pow", "(", "10", ",", "decimals", ")", ")", "/", "Math", "....
round floating numbers
[ "round", "floating", "numbers" ]
4c1559e214720dbc3b8899f4affdf5564bb9ebc5
https://github.com/thomasdobber/grunt-remfallback/blob/4c1559e214720dbc3b8899f4affdf5564bb9ebc5/tasks/remfallback.js#L53-L56
train
thomasdobber/grunt-remfallback
tasks/remfallback.js
remToPx
function remToPx(remArray) { var pxArray = remArray.map(function(v) { if (regexCalc.test(v)) { return v; } else if (regexRem.test(v)) { // this one is needed to split properties like '2rem/1.5' var restValue = ''; if (/\//.test(v)) { ...
javascript
function remToPx(remArray) { var pxArray = remArray.map(function(v) { if (regexCalc.test(v)) { return v; } else if (regexRem.test(v)) { // this one is needed to split properties like '2rem/1.5' var restValue = ''; if (/\//.test(v)) { ...
[ "function", "remToPx", "(", "remArray", ")", "{", "var", "pxArray", "=", "remArray", ".", "map", "(", "function", "(", "v", ")", "{", "if", "(", "regexCalc", ".", "test", "(", "v", ")", ")", "{", "return", "v", ";", "}", "else", "if", "(", "regex...
convert rem to px
[ "convert", "rem", "to", "px" ]
4c1559e214720dbc3b8899f4affdf5564bb9ebc5
https://github.com/thomasdobber/grunt-remfallback/blob/4c1559e214720dbc3b8899f4affdf5564bb9ebc5/tasks/remfallback.js#L72-L97
train
thomasdobber/grunt-remfallback
tasks/remfallback.js
createBaseSize
function createBaseSize(value) { if (/px/.test(value)) { return value.replace(/px/, ''); } if (/em|rem/.test(value)) { return value.replace(/em|rem/, '') * 16; } if (/%/.test(value)) { return value.replace(/%/, '')/100 * 16; } }
javascript
function createBaseSize(value) { if (/px/.test(value)) { return value.replace(/px/, ''); } if (/em|rem/.test(value)) { return value.replace(/em|rem/, '') * 16; } if (/%/.test(value)) { return value.replace(/%/, '')/100 * 16; } }
[ "function", "createBaseSize", "(", "value", ")", "{", "if", "(", "/", "px", "/", ".", "test", "(", "value", ")", ")", "{", "return", "value", ".", "replace", "(", "/", "px", "/", ",", "''", ")", ";", "}", "if", "(", "/", "em|rem", "/", ".", "...
create a base value from px,em,rem or percentage
[ "create", "a", "base", "value", "from", "px", "em", "rem", "or", "percentage" ]
4c1559e214720dbc3b8899f4affdf5564bb9ebc5
https://github.com/thomasdobber/grunt-remfallback/blob/4c1559e214720dbc3b8899f4affdf5564bb9ebc5/tasks/remfallback.js#L111-L123
train
thomasdobber/grunt-remfallback
tasks/remfallback.js
findRoot
function findRoot(r) { r.selectors.forEach(function(s) { // look for 'html' selectors if (regexHtml.test(s)) { r.declarations.forEach(function(d) { var foundSize = false; // look for the 'font' property if (d.property === 'font' && reg...
javascript
function findRoot(r) { r.selectors.forEach(function(s) { // look for 'html' selectors if (regexHtml.test(s)) { r.declarations.forEach(function(d) { var foundSize = false; // look for the 'font' property if (d.property === 'font' && reg...
[ "function", "findRoot", "(", "r", ")", "{", "r", ".", "selectors", ".", "forEach", "(", "function", "(", "s", ")", "{", "// look for 'html' selectors", "if", "(", "regexHtml", ".", "test", "(", "s", ")", ")", "{", "r", ".", "declarations", ".", "forEac...
find root font-size declarations
[ "find", "root", "font", "-", "size", "declarations" ]
4c1559e214720dbc3b8899f4affdf5564bb9ebc5
https://github.com/thomasdobber/grunt-remfallback/blob/4c1559e214720dbc3b8899f4affdf5564bb9ebc5/tasks/remfallback.js#L126-L152
train
thomasdobber/grunt-remfallback
tasks/remfallback.js
findRems
function findRems(rule) { for (var i = 0; i < rule.declarations.length; i++) { var declaration = rule.declarations[i]; // grab values that contain 'rem' if (declaration.type === 'declaration' && isSupported(declaration) && regexRem.test(declaration.value)) { var pxVa...
javascript
function findRems(rule) { for (var i = 0; i < rule.declarations.length; i++) { var declaration = rule.declarations[i]; // grab values that contain 'rem' if (declaration.type === 'declaration' && isSupported(declaration) && regexRem.test(declaration.value)) { var pxVa...
[ "function", "findRems", "(", "rule", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "rule", ".", "declarations", ".", "length", ";", "i", "++", ")", "{", "var", "declaration", "=", "rule", ".", "declarations", "[", "i", "]", ";", "// ...
look for rem values
[ "look", "for", "rem", "values" ]
4c1559e214720dbc3b8899f4affdf5564bb9ebc5
https://github.com/thomasdobber/grunt-remfallback/blob/4c1559e214720dbc3b8899f4affdf5564bb9ebc5/tasks/remfallback.js#L155-L175
train
char1e5/ot-webdriverjs
lib/webdriver/promise.js
propagateError
function propagateError(error) { flow.pendingRejections_ += 1; return flow.timer.setTimeout(function() { flow.pendingRejections_ -= 1; flow.abortFrame_(error); }, 0); }
javascript
function propagateError(error) { flow.pendingRejections_ += 1; return flow.timer.setTimeout(function() { flow.pendingRejections_ -= 1; flow.abortFrame_(error); }, 0); }
[ "function", "propagateError", "(", "error", ")", "{", "flow", ".", "pendingRejections_", "+=", "1", ";", "return", "flow", ".", "timer", ".", "setTimeout", "(", "function", "(", ")", "{", "flow", ".", "pendingRejections_", "-=", "1", ";", "flow", ".", "a...
Propagates an unhandled rejection to the parent ControlFlow in a future turn of the JavaScript event loop. @param {*} error The error value to report. @return {number} The key for the registered timeout.
[ "Propagates", "an", "unhandled", "rejection", "to", "the", "parent", "ControlFlow", "in", "a", "future", "turn", "of", "the", "JavaScript", "event", "loop", "." ]
5fc8cabcb481602673f1d47cdf544d681c35f784
https://github.com/char1e5/ot-webdriverjs/blob/5fc8cabcb481602673f1d47cdf544d681c35f784/lib/webdriver/promise.js#L345-L351
train
char1e5/ot-webdriverjs
lib/webdriver/promise.js
then
function then(opt_callback, opt_errback) { // Avoid unnecessary allocations if we weren't given any callback functions. if (!opt_callback && !opt_errback) { return promise; } // The moment a listener is registered, we consider this deferred to be // handled; the callback must handle any rejec...
javascript
function then(opt_callback, opt_errback) { // Avoid unnecessary allocations if we weren't given any callback functions. if (!opt_callback && !opt_errback) { return promise; } // The moment a listener is registered, we consider this deferred to be // handled; the callback must handle any rejec...
[ "function", "then", "(", "opt_callback", ",", "opt_errback", ")", "{", "// Avoid unnecessary allocations if we weren't given any callback functions.", "if", "(", "!", "opt_callback", "&&", "!", "opt_errback", ")", "{", "return", "promise", ";", "}", "// The moment a liste...
Registers a callback on this Deferred. @param {?(function(T): (R|webdriver.promise.Promise.<R>))=} opt_callback . @param {?(function(*): (R|webdriver.promise.Promise.<R>))=} opt_errback . @return {!webdriver.promise.Promise.<R>} A new promise representing the result of the callback. @template R @see webdriver.promise....
[ "Registers", "a", "callback", "on", "this", "Deferred", "." ]
5fc8cabcb481602673f1d47cdf544d681c35f784
https://github.com/char1e5/ot-webdriverjs/blob/5fc8cabcb481602673f1d47cdf544d681c35f784/lib/webdriver/promise.js#L388-L418
train
davemedema/grunt-funky-tag
tasks/tag.js
function() { var highestTag = '0.0.0'; var tags = exec('git tag'); if (tags.code !== 0) return highestTag; tags = tags.output.split('\n'); tags.forEach(function(tag) { tag = semver.valid(tag); if (tag && (!highestTag || semver.gt(tag, highestTag))) { highestTag = tag; } ...
javascript
function() { var highestTag = '0.0.0'; var tags = exec('git tag'); if (tags.code !== 0) return highestTag; tags = tags.output.split('\n'); tags.forEach(function(tag) { tag = semver.valid(tag); if (tag && (!highestTag || semver.gt(tag, highestTag))) { highestTag = tag; } ...
[ "function", "(", ")", "{", "var", "highestTag", "=", "'0.0.0'", ";", "var", "tags", "=", "exec", "(", "'git tag'", ")", ";", "if", "(", "tags", ".", "code", "!==", "0", ")", "return", "highestTag", ";", "tags", "=", "tags", ".", "output", ".", "spl...
Returns the highest tag in the repo. @return {String}
[ "Returns", "the", "highest", "tag", "in", "the", "repo", "." ]
a930fd8054246494d4c1298f41f12a530158957b
https://github.com/davemedema/grunt-funky-tag/blob/a930fd8054246494d4c1298f41f12a530158957b/tasks/tag.js#L39-L54
train
joekarl/fastsync
fastsync.js
makeChainedWaterfallCallback
function makeChainedWaterfallCallback(i, fns, cb) { return function() { var args = Array.prototype.slice.call(arguments); if (args[0]) { //ie. we had an error return cb(args[0]); } if (fns[i + 1]) { //remove error ar...
javascript
function makeChainedWaterfallCallback(i, fns, cb) { return function() { var args = Array.prototype.slice.call(arguments); if (args[0]) { //ie. we had an error return cb(args[0]); } if (fns[i + 1]) { //remove error ar...
[ "function", "makeChainedWaterfallCallback", "(", "i", ",", "fns", ",", "cb", ")", "{", "return", "function", "(", ")", "{", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ";", "if", "(", "args", "[", ...
Create a function that will call the next function in a chain with the results of the original function until the chain is finished
[ "Create", "a", "function", "that", "will", "call", "the", "next", "function", "in", "a", "chain", "with", "the", "results", "of", "the", "original", "function", "until", "the", "chain", "is", "finished" ]
b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4
https://github.com/joekarl/fastsync/blob/b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4/fastsync.js#L120-L136
train
joekarl/fastsync
fastsync.js
makeChainedCallback
function makeChainedCallback(i, fns, results, cb) { return function(err, result) { if (err) { return cb(err); } results[i] = result; if (fns[i + 1]) { return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb)); } el...
javascript
function makeChainedCallback(i, fns, results, cb) { return function(err, result) { if (err) { return cb(err); } results[i] = result; if (fns[i + 1]) { return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb)); } el...
[ "function", "makeChainedCallback", "(", "i", ",", "fns", ",", "results", ",", "cb", ")", "{", "return", "function", "(", "err", ",", "result", ")", "{", "if", "(", "err", ")", "{", "return", "cb", "(", "err", ")", ";", "}", "results", "[", "i", "...
Create a function that will call the next function in a chain when finished
[ "Create", "a", "function", "that", "will", "call", "the", "next", "function", "in", "a", "chain", "when", "finished" ]
b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4
https://github.com/joekarl/fastsync/blob/b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4/fastsync.js#L142-L154
train
joekarl/fastsync
fastsync.js
makeCountNCallback
function makeCountNCallback(n, cb) { var count = 0, results = [], error; return function(index, err, result) { results[index] = result; if (!error && err) { error = err; return cb(err); } if (!error &...
javascript
function makeCountNCallback(n, cb) { var count = 0, results = [], error; return function(index, err, result) { results[index] = result; if (!error && err) { error = err; return cb(err); } if (!error &...
[ "function", "makeCountNCallback", "(", "n", ",", "cb", ")", "{", "var", "count", "=", "0", ",", "results", "=", "[", "]", ",", "error", ";", "return", "function", "(", "index", ",", "err", ",", "result", ")", "{", "results", "[", "index", "]", "=",...
Create a function that will call a callback after n function calls
[ "Create", "a", "function", "that", "will", "call", "a", "callback", "after", "n", "function", "calls" ]
b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4
https://github.com/joekarl/fastsync/blob/b2a81cb5990e15c3f8bfab6efd7856ae4d51b9d4/fastsync.js#L159-L173
train
walling/logentries-query-stream
index.js
logentriesRawStream
function logentriesRawStream(pathname, query={}) { query = Object.assign({}, query); // If query format is not defined, we set it by default to JSON. if (!query.format) { query.format = 'json'; } // Text format is default in Logentries, in this case we remove the parameter. if (query.f...
javascript
function logentriesRawStream(pathname, query={}) { query = Object.assign({}, query); // If query format is not defined, we set it by default to JSON. if (!query.format) { query.format = 'json'; } // Text format is default in Logentries, in this case we remove the parameter. if (query.f...
[ "function", "logentriesRawStream", "(", "pathname", ",", "query", "=", "{", "}", ")", "{", "query", "=", "Object", ".", "assign", "(", "{", "}", ",", "query", ")", ";", "// If query format is not defined, we set it by default to JSON.", "if", "(", "!", "query", ...
Query and stream raw logs from Logentries. This is not returning an object stream. If you want JSON objects, use the `logentriesJsonStream` function.
[ "Query", "and", "stream", "raw", "logs", "from", "Logentries", ".", "This", "is", "not", "returning", "an", "object", "stream", ".", "If", "you", "want", "JSON", "objects", "use", "the", "logentriesJsonStream", "function", "." ]
59035ebc0acaf269ca5230e56116d535c2d88d7a
https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L10-L44
train
walling/logentries-query-stream
index.js
logentriesJsonStream
function logentriesJsonStream(pathname, query={}) { query = Object.assign({}, query); // Force query format to JSON. query.format = 'json'; // Parse each array entry from raw stream and emit JSON objects. return pump(logentriesRawStream(pathname, query), JSONStream.parse('*')); }
javascript
function logentriesJsonStream(pathname, query={}) { query = Object.assign({}, query); // Force query format to JSON. query.format = 'json'; // Parse each array entry from raw stream and emit JSON objects. return pump(logentriesRawStream(pathname, query), JSONStream.parse('*')); }
[ "function", "logentriesJsonStream", "(", "pathname", ",", "query", "=", "{", "}", ")", "{", "query", "=", "Object", ".", "assign", "(", "{", "}", ",", "query", ")", ";", "// Force query format to JSON.", "query", ".", "format", "=", "'json'", ";", "// Pars...
Query and stream logs from Logentries. This returns a readable object stream emitting log record JSON objects.
[ "Query", "and", "stream", "logs", "from", "Logentries", ".", "This", "returns", "a", "readable", "object", "stream", "emitting", "log", "record", "JSON", "objects", "." ]
59035ebc0acaf269ca5230e56116d535c2d88d7a
https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L48-L56
train
walling/logentries-query-stream
index.js
logentriesConnect
function logentriesConnect(options={}) { // Define path to access specific account, log set and log. let pathname = '/' + encodeURIComponent(options.account) + '/hosts/' + encodeURIComponent(options.logset) + '/' + encodeURIComponent(options.log) + '/'; // ...
javascript
function logentriesConnect(options={}) { // Define path to access specific account, log set and log. let pathname = '/' + encodeURIComponent(options.account) + '/hosts/' + encodeURIComponent(options.logset) + '/' + encodeURIComponent(options.log) + '/'; // ...
[ "function", "logentriesConnect", "(", "options", "=", "{", "}", ")", "{", "// Define path to access specific account, log set and log.", "let", "pathname", "=", "'/'", "+", "encodeURIComponent", "(", "options", ".", "account", ")", "+", "'/hosts/'", "+", "encodeURICom...
Setup connection to a specific account and log. Returns query function.
[ "Setup", "connection", "to", "a", "specific", "account", "and", "log", ".", "Returns", "query", "function", "." ]
59035ebc0acaf269ca5230e56116d535c2d88d7a
https://github.com/walling/logentries-query-stream/blob/59035ebc0acaf269ca5230e56116d535c2d88d7a/index.js#L59-L73
train
Qwerios/madlib-generic-cache
lib/index.js
CacheModule
function CacheModule(settings, cacheName, serviceHandler, serviceCallName) { if (serviceCallName == null) { serviceCallName = "call"; } settings.init("cacheModules", { expiration: { "default": 1800000 } }); this.settings = settings; ...
javascript
function CacheModule(settings, cacheName, serviceHandler, serviceCallName) { if (serviceCallName == null) { serviceCallName = "call"; } settings.init("cacheModules", { expiration: { "default": 1800000 } }); this.settings = settings; ...
[ "function", "CacheModule", "(", "settings", ",", "cacheName", ",", "serviceHandler", ",", "serviceCallName", ")", "{", "if", "(", "serviceCallName", "==", "null", ")", "{", "serviceCallName", "=", "\"call\"", ";", "}", "settings", ".", "init", "(", "\"cacheMod...
The class constructor. @function constructor @params {Object} settings A madlib-settings instance @params {String} cacheName The name of the cache. Used to retrieve expiration settings and logging purposes @params {Function} serviceHandler The 'service' instance providing the data for...
[ "The", "class", "constructor", "." ]
0d2d00d727abab421a5ae4fd91ca162ad3d0d126
https://github.com/Qwerios/madlib-generic-cache/blob/0d2d00d727abab421a5ae4fd91ca162ad3d0d126/lib/index.js#L36-L53
train
Industryswarm/isnode-mod-data
lib/mongodb/mongodb/lib/operations/db_ops.js
addUser
function addUser(db, username, password, options, callback) { const Db = require('../db'); // Did the user destroy the topology if (db.serverConfig && db.serverConfig.isDestroyed()) return callback(new MongoError('topology was destroyed')); // Attempt to execute auth command executeAuthCreateUserCommand(...
javascript
function addUser(db, username, password, options, callback) { const Db = require('../db'); // Did the user destroy the topology if (db.serverConfig && db.serverConfig.isDestroyed()) return callback(new MongoError('topology was destroyed')); // Attempt to execute auth command executeAuthCreateUserCommand(...
[ "function", "addUser", "(", "db", ",", "username", ",", "password", ",", "options", ",", "callback", ")", "{", "const", "Db", "=", "require", "(", "'../db'", ")", ";", "// Did the user destroy the topology", "if", "(", "db", ".", "serverConfig", "&&", "db", ...
Add a user to the database. @method @param {Db} db The Db instance on which to add a user. @param {string} username The username. @param {string} password The password. @param {object} [options] Optional settings. See Db.prototype.addUser for a list of options. @param {Db~resultCallback} [callback] The command result c...
[ "Add", "a", "user", "to", "the", "database", "." ]
5adc639b88a0d72cbeef23a6b5df7f4540745089
https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb/lib/operations/db_ops.js#L66-L124
train
ojj11/morphic
morphic.js
morphic
function morphic(options) { var optionsIn = options || {}; var Matcher = optionsIn.matcherCore || defaultMatcher var matcher = new Matcher(optionsIn); var generateMatchers = optionsIn.generateMatchers || defaultGenerateMatchers; var generateNamedFieldExtractors = optionsIn.generateNamedFieldExtractors || defa...
javascript
function morphic(options) { var optionsIn = options || {}; var Matcher = optionsIn.matcherCore || defaultMatcher var matcher = new Matcher(optionsIn); var generateMatchers = optionsIn.generateMatchers || defaultGenerateMatchers; var generateNamedFieldExtractors = optionsIn.generateNamedFieldExtractors || defa...
[ "function", "morphic", "(", "options", ")", "{", "var", "optionsIn", "=", "options", "||", "{", "}", ";", "var", "Matcher", "=", "optionsIn", ".", "matcherCore", "||", "defaultMatcher", "var", "matcher", "=", "new", "Matcher", "(", "optionsIn", ")", ";", ...
This class is essentially syntactic sugar around the core matcher found in matcher.js
[ "This", "class", "is", "essentially", "syntactic", "sugar", "around", "the", "core", "matcher", "found", "in", "matcher", ".", "js" ]
1ec6fd2f299e50866b9165c2545c430519f522ef
https://github.com/ojj11/morphic/blob/1ec6fd2f299e50866b9165c2545c430519f522ef/morphic.js#L43-L79
train
gmalysa/flux-link
lib/flux-link.js
LoopChain
function LoopChain(cond, fns) { if (fns instanceof Array) Chain.apply(this, fns); else Chain.apply(this, slice.call(arguments, 1)); this.cond = this.wrap(cond); this.name = '(anonymous loop chain)'; }
javascript
function LoopChain(cond, fns) { if (fns instanceof Array) Chain.apply(this, fns); else Chain.apply(this, slice.call(arguments, 1)); this.cond = this.wrap(cond); this.name = '(anonymous loop chain)'; }
[ "function", "LoopChain", "(", "cond", ",", "fns", ")", "{", "if", "(", "fns", "instanceof", "Array", ")", "Chain", ".", "apply", "(", "this", ",", "fns", ")", ";", "else", "Chain", ".", "apply", "(", "this", ",", "slice", ".", "call", "(", "argumen...
A Loop Chain will iterate over its functions until the condition function specified returns false, standardizing and simplifying the implementation for something that could already be done with standard serial Chains. @param cond Conditional function that is evaluated with an environment and an after @param fns/varargs...
[ "A", "Loop", "Chain", "will", "iterate", "over", "its", "functions", "until", "the", "condition", "function", "specified", "returns", "false", "standardizing", "and", "simplifying", "the", "implementation", "for", "something", "that", "could", "already", "be", "do...
567ac39a1f4a74f85465a58fb6fd96d64b1b765f
https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L344-L352
train
gmalysa/flux-link
lib/flux-link.js
Branch
function Branch(cond, t, f) { this.cond = this.wrap(cond); this.if_true = this.wrap(t); this.if_false = this.wrap(f); this.name = '(Unnamed Branch)'; }
javascript
function Branch(cond, t, f) { this.cond = this.wrap(cond); this.if_true = this.wrap(t); this.if_false = this.wrap(f); this.name = '(Unnamed Branch)'; }
[ "function", "Branch", "(", "cond", ",", "t", ",", "f", ")", "{", "this", ".", "cond", "=", "this", ".", "wrap", "(", "cond", ")", ";", "this", ".", "if_true", "=", "this", ".", "wrap", "(", "t", ")", ";", "this", ".", "if_false", "=", "this", ...
A branch is used to simplify multipath management when constructing Chains. It works just like a normal Chain, except that it calls the asynchronous decision function and uses it to select between the A and B alternatives, which are most useful when given as Chains. @param cond Condition function to use as the branch d...
[ "A", "branch", "is", "used", "to", "simplify", "multipath", "management", "when", "constructing", "Chains", ".", "It", "works", "just", "like", "a", "normal", "Chain", "except", "that", "it", "calls", "the", "asynchronous", "decision", "function", "and", "uses...
567ac39a1f4a74f85465a58fb6fd96d64b1b765f
https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L526-L531
train
gmalysa/flux-link
lib/flux-link.js
__chain_inner
function __chain_inner(result) { var args = slice.call(arguments, 1); nextTick(function() { try { if (result) { var params = that.handle_args(env, that.if_true, args); params.unshift(env, after); env._fm.$push_call(helpers.fname(that.if_true, that.if_true.fn.name)); that.if_true.fn.apply(...
javascript
function __chain_inner(result) { var args = slice.call(arguments, 1); nextTick(function() { try { if (result) { var params = that.handle_args(env, that.if_true, args); params.unshift(env, after); env._fm.$push_call(helpers.fname(that.if_true, that.if_true.fn.name)); that.if_true.fn.apply(...
[ "function", "__chain_inner", "(", "result", ")", "{", "var", "args", "=", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "nextTick", "(", "function", "(", ")", "{", "try", "{", "if", "(", "result", ")", "{", "var", "params", "=", "that...
This closure handles the response from the condition function
[ "This", "closure", "handles", "the", "response", "from", "the", "condition", "function" ]
567ac39a1f4a74f85465a58fb6fd96d64b1b765f
https://github.com/gmalysa/flux-link/blob/567ac39a1f4a74f85465a58fb6fd96d64b1b765f/lib/flux-link.js#L584-L605
train
hal313/html-amend
src/html-amend.js
replaceWith
function replaceWith(input, regex, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'replaceWith'); verifyParameterIsDefined(regex, 'regex', 'replaceWith'); return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(...
javascript
function replaceWith(input, regex, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'replaceWith'); verifyParameterIsDefined(regex, 'regex', 'replaceWith'); return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(...
[ "function", "replaceWith", "(", "input", ",", "regex", ",", "content", ")", "{", "// Sanity check", "verifyParameterIsDefined", "(", "input", ",", "'input'", ",", "'replaceWith'", ")", ";", "verifyParameterIsDefined", "(", "regex", ",", "'regex'", ",", "'replaceWi...
Replaces content specified by a regular expression with specified content. @param {String|Function} input the input to replace @param {String|RegExp|Function} regEx the regular expression (or string) to replace within the input @param {String|Function} [content] the content to replace @return {String} a String which h...
[ "Replaces", "content", "specified", "by", "a", "regular", "expression", "with", "specified", "content", "." ]
a96d1c347a3842cfa5d08870bc383d7925b8a894
https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L134-L140
train
hal313/html-amend
src/html-amend.js
afterElementOpen
function afterElementOpen(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'afterElementOpen'); verifyParameterIsDefined(element, 'element', 'afterElementOpen'); return insertAfter(normalizeValue(input), normalizeRegExp(`<${normalizeVal...
javascript
function afterElementOpen(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', 'afterElementOpen'); verifyParameterIsDefined(element, 'element', 'afterElementOpen'); return insertAfter(normalizeValue(input), normalizeRegExp(`<${normalizeVal...
[ "function", "afterElementOpen", "(", "input", ",", "element", ",", "content", ")", "{", "// Sanity check", "verifyParameterIsDefined", "(", "input", ",", "'input'", ",", "'afterElementOpen'", ")", ";", "verifyParameterIsDefined", "(", "element", ",", "'element'", ",...
Inserts content into the input string after the first occurrence of the element has been opened. @param {String|Function} input the input to replace @param {String|Function} element the element to insert after @param {String|Function} [content] the content to insert within the input string @return {String} a String wh...
[ "Inserts", "content", "into", "the", "input", "string", "after", "the", "first", "occurrence", "of", "the", "element", "has", "been", "opened", "." ]
a96d1c347a3842cfa5d08870bc383d7925b8a894
https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L150-L156
train
hal313/html-amend
src/html-amend.js
beforeElementClose
function beforeElementClose(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', beforeElementClose.name); verifyParameterIsDefined(element, 'element', beforeElementClose.name); return insertBefore(normalizeValue(input), normalizeRegExp(`<\...
javascript
function beforeElementClose(input, element, content) { // Sanity check verifyParameterIsDefined(input, 'input', beforeElementClose.name); verifyParameterIsDefined(element, 'element', beforeElementClose.name); return insertBefore(normalizeValue(input), normalizeRegExp(`<\...
[ "function", "beforeElementClose", "(", "input", ",", "element", ",", "content", ")", "{", "// Sanity check", "verifyParameterIsDefined", "(", "input", ",", "'input'", ",", "beforeElementClose", ".", "name", ")", ";", "verifyParameterIsDefined", "(", "element", ",", ...
Inserts content into the input string before the first occurrence of the element close tag. @param {String|Function} input the input to replace @param {String|Function} element the element to insert before close @param {String|Function} content the content to replace within the input string @return {String} a String w...
[ "Inserts", "content", "into", "the", "input", "string", "before", "the", "first", "occurrence", "of", "the", "element", "close", "tag", "." ]
a96d1c347a3842cfa5d08870bc383d7925b8a894
https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L166-L172
train
hal313/html-amend
src/html-amend.js
insertComment
function insertComment(input, element, comment) { // Sanity check verifyParameterIsDefined(input, 'input', insertComment.name); verifyParameterIsDefined(element, 'element', insertComment.name); return insertAfter(normalizeValue(input), normalizeRegExp(`<\/${normalizeValu...
javascript
function insertComment(input, element, comment) { // Sanity check verifyParameterIsDefined(input, 'input', insertComment.name); verifyParameterIsDefined(element, 'element', insertComment.name); return insertAfter(normalizeValue(input), normalizeRegExp(`<\/${normalizeValu...
[ "function", "insertComment", "(", "input", ",", "element", ",", "comment", ")", "{", "// Sanity check", "verifyParameterIsDefined", "(", "input", ",", "'input'", ",", "insertComment", ".", "name", ")", ";", "verifyParameterIsDefined", "(", "element", ",", "'elemen...
Inserts an HTML comment into the input string after the first occurrence of the element close tag. @param {String|Function} input the input to replace @param {String|Function} element the element to add the comment after @param {String|Function} [content] the comment to add. @return {String} a String which has the com...
[ "Inserts", "an", "HTML", "comment", "into", "the", "input", "string", "after", "the", "first", "occurrence", "of", "the", "element", "close", "tag", "." ]
a96d1c347a3842cfa5d08870bc383d7925b8a894
https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L182-L188
train
hal313/html-amend
src/html-amend.js
insertAttribute
function insertAttribute(input, element, attributeName, attributeValue) { // Sanity check verifyParameterIsDefined(input, 'input', insertAttribute.name); verifyParameterIsDefined(element, 'element', insertAttribute.name); verifyParameterIsDefined(attributeName, 'attribute...
javascript
function insertAttribute(input, element, attributeName, attributeValue) { // Sanity check verifyParameterIsDefined(input, 'input', insertAttribute.name); verifyParameterIsDefined(element, 'element', insertAttribute.name); verifyParameterIsDefined(attributeName, 'attribute...
[ "function", "insertAttribute", "(", "input", ",", "element", ",", "attributeName", ",", "attributeValue", ")", "{", "// Sanity check", "verifyParameterIsDefined", "(", "input", ",", "'input'", ",", "insertAttribute", ".", "name", ")", ";", "verifyParameterIsDefined", ...
Inserts an attribute into the input string within the first occurrence of the element open tag. @param {String|Function} input the input string @param {String|Function} element the element tag to modify @param {String|Function} attributeName the attribute name to add @param {String|Function} [attributeValue] the attri...
[ "Inserts", "an", "attribute", "into", "the", "input", "string", "within", "the", "first", "occurrence", "of", "the", "element", "open", "tag", "." ]
a96d1c347a3842cfa5d08870bc383d7925b8a894
https://github.com/hal313/html-amend/blob/a96d1c347a3842cfa5d08870bc383d7925b8a894/src/html-amend.js#L199-L206
train
shinout/Struct.js
lib/Struct.js
function(keyname) { const _ = Struct.PriProp(keyname); if (_.__proto__) { _.__proto__ = Struct.prototype; } else { Object.keys(Struct.prototype).forEach(function(p) { Object.defineProperty(_, p, { value : Struct.prototype[p], writable : false }); }, this); } var cl...
javascript
function(keyname) { const _ = Struct.PriProp(keyname); if (_.__proto__) { _.__proto__ = Struct.prototype; } else { Object.keys(Struct.prototype).forEach(function(p) { Object.defineProperty(_, p, { value : Struct.prototype[p], writable : false }); }, this); } var cl...
[ "function", "(", "keyname", ")", "{", "const", "_", "=", "Struct", ".", "PriProp", "(", "keyname", ")", ";", "if", "(", "_", ".", "__proto__", ")", "{", "_", ".", "__proto__", "=", "Struct", ".", "prototype", ";", "}", "else", "{", "Object", ".", ...
Struct.js v0.0.1 Copyright 2011, SHIN Suzuki
[ "Struct", ".", "js", "v0", ".", "0", ".", "1" ]
55aff5edcb956d85dcb0b55c8fdfe423aa34f53c
https://github.com/shinout/Struct.js/blob/55aff5edcb956d85dcb0b55c8fdfe423aa34f53c/lib/Struct.js#L8-L73
train
ianmuninio/jmodel
lib/model.js
Model
function Model(collectionName, attributes, values) { this.collectionName = collectionName; this.idAttribute = Model.getId(attributes); this.attributes = attributeValidator.validate(attributes); this.values = { }; this.virtuals = { }; // initially add the null value from all attributes for (...
javascript
function Model(collectionName, attributes, values) { this.collectionName = collectionName; this.idAttribute = Model.getId(attributes); this.attributes = attributeValidator.validate(attributes); this.values = { }; this.virtuals = { }; // initially add the null value from all attributes for (...
[ "function", "Model", "(", "collectionName", ",", "attributes", ",", "values", ")", "{", "this", ".", "collectionName", "=", "collectionName", ";", "this", ".", "idAttribute", "=", "Model", ".", "getId", "(", "attributes", ")", ";", "this", ".", "attributes",...
An entity is a lightweight persistence domain object. @param {String} collectionName @param {Object} attributes @param {Object} values @returns {Model}
[ "An", "entity", "is", "a", "lightweight", "persistence", "domain", "object", "." ]
c118bfc46596f59445604acc43b01ad2b04c31ef
https://github.com/ianmuninio/jmodel/blob/c118bfc46596f59445604acc43b01ad2b04c31ef/lib/model.js#L17-L37
train
queckezz/list
lib/drop.js
drop
function drop (n, array) { return (n < array.length) ? slice(n, array.length, array) : [] }
javascript
function drop (n, array) { return (n < array.length) ? slice(n, array.length, array) : [] }
[ "function", "drop", "(", "n", ",", "array", ")", "{", "return", "(", "n", "<", "array", ".", "length", ")", "?", "slice", "(", "n", ",", "array", ".", "length", ",", "array", ")", ":", "[", "]", "}" ]
Slice `n` items from `array` returning the sliced elements as a new array. @param {Int} n How many elements to drop @param {Array} array Array to drop from @return {Array} New Array with the dropped items
[ "Slice", "n", "items", "from", "array", "returning", "the", "sliced", "elements", "as", "a", "new", "array", "." ]
a26130020b447a1aa136f0fed3283821490f7da4
https://github.com/queckezz/list/blob/a26130020b447a1aa136f0fed3283821490f7da4/lib/drop.js#L13-L17
train
Pocketbrain/native-ads-web-ad-library
src/ads/fetchAds.js
_getRequiredAdCountForAdUnit
function _getRequiredAdCountForAdUnit(adUnit) { var adContainers = page.getAdContainers(adUnit); if (!adContainers.length) { return 0; } var numberOfAdsToInsert = 0; for (var i = 0; i < adContainers.length; i++) { var adContainer = adContainers[i]; numberOfAdsToInsert += ad...
javascript
function _getRequiredAdCountForAdUnit(adUnit) { var adContainers = page.getAdContainers(adUnit); if (!adContainers.length) { return 0; } var numberOfAdsToInsert = 0; for (var i = 0; i < adContainers.length; i++) { var adContainer = adContainers[i]; numberOfAdsToInsert += ad...
[ "function", "_getRequiredAdCountForAdUnit", "(", "adUnit", ")", "{", "var", "adContainers", "=", "page", ".", "getAdContainers", "(", "adUnit", ")", ";", "if", "(", "!", "adContainers", ".", "length", ")", "{", "return", "0", ";", "}", "var", "numberOfAdsToI...
Get the number of ads this unit needs to place all the ads on the page @param adUnit The ad unit to get the required number of ads for @returns {number} the number of required ads @private
[ "Get", "the", "number", "of", "ads", "this", "unit", "needs", "to", "place", "all", "the", "ads", "on", "the", "page" ]
aafee1c42e0569ee77f334fc2c4eb71eb146957e
https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L17-L31
train
Pocketbrain/native-ads-web-ad-library
src/ads/fetchAds.js
_buildImageFields
function _buildImageFields(data){ var newUnits = []; for (var i = 0, len = data.length; i < len; i++){ adUnit = data[i]; // todo: create adUnit object to encapsulate this logic if ('images' in adUnit){ if ('banner' in adUnit.images){ adUnit.campaign_banner_url = adUnit.images.banner.ur...
javascript
function _buildImageFields(data){ var newUnits = []; for (var i = 0, len = data.length; i < len; i++){ adUnit = data[i]; // todo: create adUnit object to encapsulate this logic if ('images' in adUnit){ if ('banner' in adUnit.images){ adUnit.campaign_banner_url = adUnit.images.banner.ur...
[ "function", "_buildImageFields", "(", "data", ")", "{", "var", "newUnits", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "len", "=", "data", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "adUnit", "=", "data", "[",...
Fills some image fields with JSON data @param data The data coming from the server @returns processed data @private
[ "Fills", "some", "image", "fields", "with", "JSON", "data" ]
aafee1c42e0569ee77f334fc2c4eb71eb146957e
https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L39-L63
train
Pocketbrain/native-ads-web-ad-library
src/ads/fetchAds.js
requestAds
function requestAds(adUnit, callback) { var limit = _getRequiredAdCountForAdUnit(adUnit); var token = page.getToken(); var imageType = adUnit.imageType; if (typeof imageType == 'undefined'){ imageType = "hq_icon"; } var requestQuery = { "output": "json", "placement_key": ad...
javascript
function requestAds(adUnit, callback) { var limit = _getRequiredAdCountForAdUnit(adUnit); var token = page.getToken(); var imageType = adUnit.imageType; if (typeof imageType == 'undefined'){ imageType = "hq_icon"; } var requestQuery = { "output": "json", "placement_key": ad...
[ "function", "requestAds", "(", "adUnit", ",", "callback", ")", "{", "var", "limit", "=", "_getRequiredAdCountForAdUnit", "(", "adUnit", ")", ";", "var", "token", "=", "page", ".", "getToken", "(", ")", ";", "var", "imageType", "=", "adUnit", ".", "imageTyp...
Request ads from the offerEngine @param adUnit - The ad Unit that is requesting ads @param callback - The callback to execute containing the ads
[ "Request", "ads", "from", "the", "offerEngine" ]
aafee1c42e0569ee77f334fc2c4eb71eb146957e
https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/ads/fetchAds.js#L70-L109
train
FinalDevStudio/fi-security
lib/index.js
clean
function clean(method) { for (let m of methods) { if (new RegExp(m, 'i').test(method)) { return m; } } throw new Error(`Invalid method name: ${method}`); }
javascript
function clean(method) { for (let m of methods) { if (new RegExp(m, 'i').test(method)) { return m; } } throw new Error(`Invalid method name: ${method}`); }
[ "function", "clean", "(", "method", ")", "{", "for", "(", "let", "m", "of", "methods", ")", "{", "if", "(", "new", "RegExp", "(", "m", ",", "'i'", ")", ".", "test", "(", "method", ")", ")", "{", "return", "m", ";", "}", "}", "throw", "new", "...
Returns a clean, lower-case method name. @param {String} method The method to check and clean. @returns {String} The clean method name.
[ "Returns", "a", "clean", "lower", "-", "case", "method", "name", "." ]
4673865a2e618138012bc89b1ba7160eb632ab5a
https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L41-L49
train
FinalDevStudio/fi-security
lib/index.js
middleware
function middleware(req, res, next) { req.security.csrf.exclude = true; next(); }
javascript
function middleware(req, res, next) { req.security.csrf.exclude = true; next(); }
[ "function", "middleware", "(", "req", ",", "res", ",", "next", ")", "{", "req", ".", "security", ".", "csrf", ".", "exclude", "=", "true", ";", "next", "(", ")", ";", "}" ]
Default exclusion middleware. @type {ExpressMiddlware} @param {Object} req Express' request object. @param {Object} res Express' response object. @param {Function} next Express' next middleware callback.
[ "Default", "exclusion", "middleware", "." ]
4673865a2e618138012bc89b1ba7160eb632ab5a
https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L60-L63
train
FinalDevStudio/fi-security
lib/index.js
onEachExcludedRoute
function onEachExcludedRoute(app, route) { const normalized = normalize(route); debug(`Excluding ${(normalized.method || 'all').toUpperCase()} ${normalized.path} from CSRF check...`); const router = app.route(normalized.path); if (is.array(normalized.method) && normalized.method.length) { for (let i = 0,...
javascript
function onEachExcludedRoute(app, route) { const normalized = normalize(route); debug(`Excluding ${(normalized.method || 'all').toUpperCase()} ${normalized.path} from CSRF check...`); const router = app.route(normalized.path); if (is.array(normalized.method) && normalized.method.length) { for (let i = 0,...
[ "function", "onEachExcludedRoute", "(", "app", ",", "route", ")", "{", "const", "normalized", "=", "normalize", "(", "route", ")", ";", "debug", "(", "`", "${", "(", "normalized", ".", "method", "||", "'all'", ")", ".", "toUpperCase", "(", ")", "}", "$...
Processes each excluded route. @param {ExpressApplication} app Your express application instance. @param {Object} route The route object to process.
[ "Processes", "each", "excluded", "route", "." ]
4673865a2e618138012bc89b1ba7160eb632ab5a
https://github.com/FinalDevStudio/fi-security/blob/4673865a2e618138012bc89b1ba7160eb632ab5a/lib/index.js#L110-L130
train
MaiaVictor/dattata
Geometries.js
block
function block(w, h, d){ return function(cons, nil){ for (var z=-d; z<=d; ++z) for (var y=-h; y<=h; ++y) for (var x=-w; x<=w; ++x) nil = cons(x, y, z), nil = cons(x, y, z); return nil; }; }
javascript
function block(w, h, d){ return function(cons, nil){ for (var z=-d; z<=d; ++z) for (var y=-h; y<=h; ++y) for (var x=-w; x<=w; ++x) nil = cons(x, y, z), nil = cons(x, y, z); return nil; }; }
[ "function", "block", "(", "w", ",", "h", ",", "d", ")", "{", "return", "function", "(", "cons", ",", "nil", ")", "{", "for", "(", "var", "z", "=", "-", "d", ";", "z", "<=", "d", ";", "++", "z", ")", "for", "(", "var", "y", "=", "-", "h", ...
Number, Number, Number -> AtomsCList
[ "Number", "Number", "Number", "-", ">", "AtomsCList" ]
890d83b89b7193ce8863bb9ac9b296b3510e8db9
https://github.com/MaiaVictor/dattata/blob/890d83b89b7193ce8863bb9ac9b296b3510e8db9/Geometries.js#L53-L62
train
MaiaVictor/dattata
Geometries.js
sphereVoxels
function sphereVoxels(cx, cy, cz, r, col){ return function(cons, nil){ sphere(cx, cy, cz, r)(function(x, y, z, res){ return cons(x, y, z, col, res); }, nil); }; }
javascript
function sphereVoxels(cx, cy, cz, r, col){ return function(cons, nil){ sphere(cx, cy, cz, r)(function(x, y, z, res){ return cons(x, y, z, col, res); }, nil); }; }
[ "function", "sphereVoxels", "(", "cx", ",", "cy", ",", "cz", ",", "r", ",", "col", ")", "{", "return", "function", "(", "cons", ",", "nil", ")", "{", "sphere", "(", "cx", ",", "cy", ",", "cz", ",", "r", ")", "(", "function", "(", "x", ",", "y...
Number, Number, Number, Number, RGBA8 -> Voxels
[ "Number", "Number", "Number", "Number", "RGBA8", "-", ">", "Voxels" ]
890d83b89b7193ce8863bb9ac9b296b3510e8db9
https://github.com/MaiaVictor/dattata/blob/890d83b89b7193ce8863bb9ac9b296b3510e8db9/Geometries.js#L66-L72
train
wigy/chronicles_of_grunt
tasks/info.js
dumpFiles
function dumpFiles(title, fn) { var matches = fn(); if (matches.length) { log.info(""); log.info((title + ":")['green']); for (var i = 0; i < matches.length; i++) { if (matches[i].src === matches[i].dst) { ...
javascript
function dumpFiles(title, fn) { var matches = fn(); if (matches.length) { log.info(""); log.info((title + ":")['green']); for (var i = 0; i < matches.length; i++) { if (matches[i].src === matches[i].dst) { ...
[ "function", "dumpFiles", "(", "title", ",", "fn", ")", "{", "var", "matches", "=", "fn", "(", ")", ";", "if", "(", "matches", ".", "length", ")", "{", "log", ".", "info", "(", "\"\"", ")", ";", "log", ".", "info", "(", "(", "title", "+", "\":\"...
List files returned by the given listing function on screen.
[ "List", "files", "returned", "by", "the", "given", "listing", "function", "on", "screen", "." ]
c5f089a6f391a0ca625fcb81ef51907713471bb3
https://github.com/wigy/chronicles_of_grunt/blob/c5f089a6f391a0ca625fcb81ef51907713471bb3/tasks/info.js#L33-L46
train
sydneystockholm/blog.md
lib/loaders/fs.js
FileSystemLoader
function FileSystemLoader(dir, options) { this.dir = dir.replace(/\/$/, ''); this.options = options || (options = {}); this.posts = []; this.files = {}; this.ignore = {}; var self = this; (options.ignore || FileSystemLoader.ignore).forEach(function (file) { self.ignore[file] = true; ...
javascript
function FileSystemLoader(dir, options) { this.dir = dir.replace(/\/$/, ''); this.options = options || (options = {}); this.posts = []; this.files = {}; this.ignore = {}; var self = this; (options.ignore || FileSystemLoader.ignore).forEach(function (file) { self.ignore[file] = true; ...
[ "function", "FileSystemLoader", "(", "dir", ",", "options", ")", "{", "this", ".", "dir", "=", "dir", ".", "replace", "(", "/", "\\/$", "/", ",", "''", ")", ";", "this", ".", "options", "=", "options", "||", "(", "options", "=", "{", "}", ")", ";...
Create a new file system loader. @param {String} dir - the folder containing blog posts @param {Object} options (optional)
[ "Create", "a", "new", "file", "system", "loader", "." ]
0b145fa1620cbe8b7296eb242241ee93223db9f9
https://github.com/sydneystockholm/blog.md/blob/0b145fa1620cbe8b7296eb242241ee93223db9f9/lib/loaders/fs.js#L22-L35
train
cameronwp/endpoint
lib/Endpoint.js
Endpoint
function Endpoint() { var self = this; const subscriptions = {}; const ps = new Pubsub(); this._publish = ps.publish; this._subscribe = ps.subscribe; this.active = false; this.connections = []; /** * Publishes a new connection. * @function _newConnection * @private * @param {string} sID soc...
javascript
function Endpoint() { var self = this; const subscriptions = {}; const ps = new Pubsub(); this._publish = ps.publish; this._subscribe = ps.subscribe; this.active = false; this.connections = []; /** * Publishes a new connection. * @function _newConnection * @private * @param {string} sID soc...
[ "function", "Endpoint", "(", ")", "{", "var", "self", "=", "this", ";", "const", "subscriptions", "=", "{", "}", ";", "const", "ps", "=", "new", "Pubsub", "(", ")", ";", "this", ".", "_publish", "=", "ps", ".", "publish", ";", "this", ".", "_subscr...
Message response callback. @callback messageResponse @param {any} response Base class for handling socket.io connections. @class Endpoint
[ "Message", "response", "callback", "." ]
6163756360080aa7e984660f1cede7e4ab627da5
https://github.com/cameronwp/endpoint/blob/6163756360080aa7e984660f1cede7e4ab627da5/lib/Endpoint.js#L27-L96
train
christophercrouzet/pillr
lib/queue.js
find
function find(queue, name) { const out = queue.findIndex(e => e.name === name); if (out === -1) { throw new Error(`${name}: Could not find this function`); } return out; }
javascript
function find(queue, name) { const out = queue.findIndex(e => e.name === name); if (out === -1) { throw new Error(`${name}: Could not find this function`); } return out; }
[ "function", "find", "(", "queue", ",", "name", ")", "{", "const", "out", "=", "queue", ".", "findIndex", "(", "e", "=>", "e", ".", "name", "===", "name", ")", ";", "if", "(", "out", "===", "-", "1", ")", "{", "throw", "new", "Error", "(", "`", ...
Find the index of a function.
[ "Find", "the", "index", "of", "a", "function", "." ]
411ccd344a03478776c4e8d2e2f9bdc45dc8ee45
https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/queue.js#L13-L20
train
christophercrouzet/pillr
lib/queue.js
insert
function insert(queue, index, fns, mode = InsertMode.REGULAR) { fns.forEach(({ fn, name }) => { if (queue.findIndex(e => e.name === name) !== -1) { throw new Error(`${name}: A function is already queued with this name`); } else if (typeof fn !== 'function') { throw new Error(`${name}: Not a valid ...
javascript
function insert(queue, index, fns, mode = InsertMode.REGULAR) { fns.forEach(({ fn, name }) => { if (queue.findIndex(e => e.name === name) !== -1) { throw new Error(`${name}: A function is already queued with this name`); } else if (typeof fn !== 'function') { throw new Error(`${name}: Not a valid ...
[ "function", "insert", "(", "queue", ",", "index", ",", "fns", ",", "mode", "=", "InsertMode", ".", "REGULAR", ")", "{", "fns", ".", "forEach", "(", "(", "{", "fn", ",", "name", "}", ")", "=>", "{", "if", "(", "queue", ".", "findIndex", "(", "e", ...
Insert a bunch of functions into a queue at a given index.
[ "Insert", "a", "bunch", "of", "functions", "into", "a", "queue", "at", "a", "given", "index", "." ]
411ccd344a03478776c4e8d2e2f9bdc45dc8ee45
https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/queue.js#L24-L35
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
addElement
function addElement( element, target, moveCurrent ) { target = target || currentNode || root; // Current element might be mangled by fix body below, // save it for restore later. var savedCurrent = currentNode; // Ignore any element that has already been added. if ( element.previous === undefined ) ...
javascript
function addElement( element, target, moveCurrent ) { target = target || currentNode || root; // Current element might be mangled by fix body below, // save it for restore later. var savedCurrent = currentNode; // Ignore any element that has already been added. if ( element.previous === undefined ) ...
[ "function", "addElement", "(", "element", ",", "target", ",", "moveCurrent", ")", "{", "target", "=", "target", "||", "currentNode", "||", "root", ";", "// Current element might be mangled by fix body below,", "// save it for restore later.", "var", "savedCurrent", "=", ...
Beside of simply append specified element to target, this function also takes care of other dirty lifts like forcing block in body, trimming spaces at the block boundaries etc. @param {Element} element The element to be added as the last child of {@link target}. @param {Element} target The parent element to relieve t...
[ "Beside", "of", "simply", "append", "specified", "element", "to", "target", "this", "function", "also", "takes", "care", "of", "other", "dirty", "lifts", "like", "forcing", "block", "in", "body", "trimming", "spaces", "at", "the", "block", "boundaries", "etc",...
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L171-L208
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
checkAutoParagraphing
function checkAutoParagraphing( parent, node ) { // Check for parent that can contain block. if ( ( parent == root || parent.name == 'body' ) && fixingBlock && ( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) { var name, realName; if ( node.attributes && ( realName = node.attributes...
javascript
function checkAutoParagraphing( parent, node ) { // Check for parent that can contain block. if ( ( parent == root || parent.name == 'body' ) && fixingBlock && ( !parent.name || CKEDITOR.dtd[ parent.name ][ fixingBlock ] ) ) { var name, realName; if ( node.attributes && ( realName = node.attributes...
[ "function", "checkAutoParagraphing", "(", "parent", ",", "node", ")", "{", "// Check for parent that can contain block.", "if", "(", "(", "parent", "==", "root", "||", "parent", ".", "name", "==", "'body'", ")", "&&", "fixingBlock", "&&", "(", "!", "parent", "...
Auto paragraphing should happen when inline content enters the root element.
[ "Auto", "paragraphing", "should", "happen", "when", "inline", "content", "enters", "the", "root", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L211-L229
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
possiblySibling
function possiblySibling( tag1, tag2 ) { if ( tag1 in CKEDITOR.dtd.$listItem || tag1 in CKEDITOR.dtd.$tableContent ) return tag1 == tag2 || tag1 == 'dt' && tag2 == 'dd' || tag1 == 'dd' && tag2 == 'dt'; return false; }
javascript
function possiblySibling( tag1, tag2 ) { if ( tag1 in CKEDITOR.dtd.$listItem || tag1 in CKEDITOR.dtd.$tableContent ) return tag1 == tag2 || tag1 == 'dt' && tag2 == 'dd' || tag1 == 'dd' && tag2 == 'dt'; return false; }
[ "function", "possiblySibling", "(", "tag1", ",", "tag2", ")", "{", "if", "(", "tag1", "in", "CKEDITOR", ".", "dtd", ".", "$listItem", "||", "tag1", "in", "CKEDITOR", ".", "dtd", ".", "$tableContent", ")", "return", "tag1", "==", "tag2", "||", "tag1", "...
Judge whether two element tag names are likely the siblings from the same structural element.
[ "Judge", "whether", "two", "element", "tag", "names", "are", "likely", "the", "siblings", "from", "the", "same", "structural", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L233-L239
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
function( filter, context ) { context = this.getFilterContext( context ); // Apply the root filter. filter.onRoot( context, this ); this.filterChildren( filter, false, context ); }
javascript
function( filter, context ) { context = this.getFilterContext( context ); // Apply the root filter. filter.onRoot( context, this ); this.filterChildren( filter, false, context ); }
[ "function", "(", "filter", ",", "context", ")", "{", "context", "=", "this", ".", "getFilterContext", "(", "context", ")", ";", "// Apply the root filter.", "filter", ".", "onRoot", "(", "context", ",", "this", ")", ";", "this", ".", "filterChildren", "(", ...
Filter this fragment's content with given filter. @since 4.1 @param {CKEDITOR.htmlParser.filter} filter
[ "Filter", "this", "fragment", "s", "content", "with", "given", "filter", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L513-L520
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
function( filter, filterRoot, context ) { // If this element's children were already filtered // by current filter, don't filter them 2nd time. // This situation may occur when filtering bottom-up // (filterChildren() called manually in element's filter), // or in unpredictable edge cases when filter ...
javascript
function( filter, filterRoot, context ) { // If this element's children were already filtered // by current filter, don't filter them 2nd time. // This situation may occur when filtering bottom-up // (filterChildren() called manually in element's filter), // or in unpredictable edge cases when filter ...
[ "function", "(", "filter", ",", "filterRoot", ",", "context", ")", "{", "// If this element's children were already filtered", "// by current filter, don't filter them 2nd time.", "// This situation may occur when filtering bottom-up", "// (filterChildren() called manually in element's filte...
Filter this fragment's children with given filter. Element's children may only be filtered once by one instance of filter. @since 4.1 @param {CKEDITOR.htmlParser.filter} filter @param {Boolean} [filterRoot] Whether to apply the "root" filter rule specified in the `filter`.
[ "Filter", "this", "fragment", "s", "children", "with", "given", "filter", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L532-L557
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/fragment.js
function( writer, filter, filterRoot ) { var context = this.getFilterContext(); // Filtering root if enforced. if ( filterRoot && !this.parent && filter ) filter.onRoot( context, this ); if ( filter ) this.filterChildren( filter, false, context ); for ( var i = 0, children = this.children, l =...
javascript
function( writer, filter, filterRoot ) { var context = this.getFilterContext(); // Filtering root if enforced. if ( filterRoot && !this.parent && filter ) filter.onRoot( context, this ); if ( filter ) this.filterChildren( filter, false, context ); for ( var i = 0, children = this.children, l =...
[ "function", "(", "writer", ",", "filter", ",", "filterRoot", ")", "{", "var", "context", "=", "this", ".", "getFilterContext", "(", ")", ";", "// Filtering root if enforced.", "if", "(", "filterRoot", "&&", "!", "this", ".", "parent", "&&", "filter", ")", ...
Write and filtering the child nodes of this fragment. @param {CKEDITOR.htmlParser.basicWriter} writer The writer to which write the HTML. @param {CKEDITOR.htmlParser.filter} [filter] The filter to use when writing the HTML. @param {Boolean} [filterRoot] Whether to apply the "root" filter rule specified in the `filter`...
[ "Write", "and", "filtering", "the", "child", "nodes", "of", "this", "fragment", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/fragment.js#L584-L596
train
yoshuawuyts/myth-request
index.js
mr
function mr(bundler) { var prevError = null var pending = null var buffer = null build() // bundler.on('update', update) return handler /** * Build the CSS and pass it to `buffer`. * * @api private */ function build() { const p = pending = new Emitter() buffer = bundler.toString() ...
javascript
function mr(bundler) { var prevError = null var pending = null var buffer = null build() // bundler.on('update', update) return handler /** * Build the CSS and pass it to `buffer`. * * @api private */ function build() { const p = pending = new Emitter() buffer = bundler.toString() ...
[ "function", "mr", "(", "bundler", ")", "{", "var", "prevError", "=", "null", "var", "pending", "=", "null", "var", "buffer", "=", "null", "build", "(", ")", "// bundler.on('update', update)", "return", "handler", "/**\n * Build the CSS and pass it to `buffer`.\n *...
Respond myth in an http request. @param {Function} bundler @return {Function} @api public
[ "Respond", "myth", "in", "an", "http", "request", "." ]
0c70a49e2b8abbfcd6fd0a3735a18064d952992b
https://github.com/yoshuawuyts/myth-request/blob/0c70a49e2b8abbfcd6fd0a3735a18064d952992b/index.js#L12-L61
train
yoshuawuyts/myth-request
index.js
build
function build() { const p = pending = new Emitter() buffer = bundler.toString() if (p !== pending) return pending.emit('ready', null, pending = false) }
javascript
function build() { const p = pending = new Emitter() buffer = bundler.toString() if (p !== pending) return pending.emit('ready', null, pending = false) }
[ "function", "build", "(", ")", "{", "const", "p", "=", "pending", "=", "new", "Emitter", "(", ")", "buffer", "=", "bundler", ".", "toString", "(", ")", "if", "(", "p", "!==", "pending", ")", "return", "pending", ".", "emit", "(", "'ready'", ",", "n...
Build the CSS and pass it to `buffer`. @api private
[ "Build", "the", "CSS", "and", "pass", "it", "to", "buffer", "." ]
0c70a49e2b8abbfcd6fd0a3735a18064d952992b
https://github.com/yoshuawuyts/myth-request/blob/0c70a49e2b8abbfcd6fd0a3735a18064d952992b/index.js#L26-L32
train
adriancmiranda/dotcfg
dist/dotcfg.amd.js
deletePropertyAt
function deletePropertyAt(object, prop) { if (object == null) { return object; } var value = object[prop]; delete object[prop]; return value; }
javascript
function deletePropertyAt(object, prop) { if (object == null) { return object; } var value = object[prop]; delete object[prop]; return value; }
[ "function", "deletePropertyAt", "(", "object", ",", "prop", ")", "{", "if", "(", "object", "==", "null", ")", "{", "return", "object", ";", "}", "var", "value", "=", "object", "[", "prop", "]", ";", "delete", "object", "[", "prop", "]", ";", "return"...
Removes a property from an object; if no more references to the same property are held, it is eventually released automatically. @param {Object} object @param {String} prop
[ "Removes", "a", "property", "from", "an", "object", ";", "if", "no", "more", "references", "to", "the", "same", "property", "are", "held", "it", "is", "eventually", "released", "automatically", "." ]
ef6cca524621c4bffd0b0c95c62f7330070c26eb
https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L455-L460
train
adriancmiranda/dotcfg
dist/dotcfg.amd.js
DotCfg
function DotCfg(namespace, scope, strategy) { if (instanceOf(DotCfg, this)) { if (exotic(namespace)) { strategy = scope; scope = namespace; namespace = undefined; } if (primitive(scope)) { scope = env; } if (string(namespace)) { scope[namespace] = scope[namespace] || {}; scope =...
javascript
function DotCfg(namespace, scope, strategy) { if (instanceOf(DotCfg, this)) { if (exotic(namespace)) { strategy = scope; scope = namespace; namespace = undefined; } if (primitive(scope)) { scope = env; } if (string(namespace)) { scope[namespace] = scope[namespace] || {}; scope =...
[ "function", "DotCfg", "(", "namespace", ",", "scope", ",", "strategy", ")", "{", "if", "(", "instanceOf", "(", "DotCfg", ",", "this", ")", ")", "{", "if", "(", "exotic", "(", "namespace", ")", ")", "{", "strategy", "=", "scope", ";", "scope", "=", ...
Create a instance of `DotCfg`. @param namespace: A string containing a qualified name to identify objects from. @param scope: A object that have system-wide relevance. @param strategy: A function that configures the input values.
[ "Create", "a", "instance", "of", "DotCfg", "." ]
ef6cca524621c4bffd0b0c95c62f7330070c26eb
https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L639-L660
train
adriancmiranda/dotcfg
dist/dotcfg.amd.js
set
function set(notation, value, strategy) { var this$1 = this; var fn = !undef(value) && callable(strategy) ? strategy : this.strategy; if (object(notation)) { var context; for (var key in notation) { if (ownProperty(notation, key)) { context = write(this$1.scope, key, notation[key], fn); ...
javascript
function set(notation, value, strategy) { var this$1 = this; var fn = !undef(value) && callable(strategy) ? strategy : this.strategy; if (object(notation)) { var context; for (var key in notation) { if (ownProperty(notation, key)) { context = write(this$1.scope, key, notation[key], fn); ...
[ "function", "set", "(", "notation", ",", "value", ",", "strategy", ")", "{", "var", "this$1", "=", "this", ";", "var", "fn", "=", "!", "undef", "(", "value", ")", "&&", "callable", "(", "strategy", ")", "?", "strategy", ":", "this", ".", "strategy", ...
Write in scope. @param notation: A object path. @param value: Arguments for the object. @param strategy: Arguments for the object. @returns DotCfg
[ "Write", "in", "scope", "." ]
ef6cca524621c4bffd0b0c95c62f7330070c26eb
https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L703-L718
train
adriancmiranda/dotcfg
dist/dotcfg.amd.js
get
function get(notation, defaultValue) { var value = read(this.scope, notation); return undef(value) ? defaultValue : value; }
javascript
function get(notation, defaultValue) { var value = read(this.scope, notation); return undef(value) ? defaultValue : value; }
[ "function", "get", "(", "notation", ",", "defaultValue", ")", "{", "var", "value", "=", "read", "(", "this", ".", "scope", ",", "notation", ")", ";", "return", "undef", "(", "value", ")", "?", "defaultValue", ":", "value", ";", "}" ]
Read scope notation. @param notation: A object path. @param defaultValue: A fallback value. @returns any
[ "Read", "scope", "notation", "." ]
ef6cca524621c4bffd0b0c95c62f7330070c26eb
https://github.com/adriancmiranda/dotcfg/blob/ef6cca524621c4bffd0b0c95c62f7330070c26eb/dist/dotcfg.amd.js#L726-L729
train
mar10/grunt-yabs
tasks/yabs.js
makeArrayOpt
function makeArrayOpt(opts, name) { if( !Array.isArray(opts[name]) ) { opts[name] = [ opts[name] ]; } return opts[name]; }
javascript
function makeArrayOpt(opts, name) { if( !Array.isArray(opts[name]) ) { opts[name] = [ opts[name] ]; } return opts[name]; }
[ "function", "makeArrayOpt", "(", "opts", ",", "name", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "opts", "[", "name", "]", ")", ")", "{", "opts", "[", "name", "]", "=", "[", "opts", "[", "name", "]", "]", ";", "}", "return", "opts"...
Convert opts.name to an array if not already.
[ "Convert", "opts", ".", "name", "to", "an", "array", "if", "not", "already", "." ]
050741679227fc6342fdef17966f04989e34c244
https://github.com/mar10/grunt-yabs/blob/050741679227fc6342fdef17966f04989e34c244/tasks/yabs.js#L124-L129
train
jonschlinkert/rethrow
index.js
rethrow
function rethrow(options) { var opts = lazy.extend({before: 3, after: 3}, options); return function (err, filename, lineno, str, expr) { if (!(err instanceof Error)) throw err; lineno = lineno >> 0; var lines = str.split('\n'); var before = Math.max(lineno - (+opts.before), 0); var after = Math...
javascript
function rethrow(options) { var opts = lazy.extend({before: 3, after: 3}, options); return function (err, filename, lineno, str, expr) { if (!(err instanceof Error)) throw err; lineno = lineno >> 0; var lines = str.split('\n'); var before = Math.max(lineno - (+opts.before), 0); var after = Math...
[ "function", "rethrow", "(", "options", ")", "{", "var", "opts", "=", "lazy", ".", "extend", "(", "{", "before", ":", "3", ",", "after", ":", "3", "}", ",", "options", ")", ";", "return", "function", "(", "err", ",", "filename", ",", "lineno", ",", ...
Re-throw the given `err` in context to the offending template expression in `filename` at the given `lineno`. @param {Error} `err` Error object @param {String} `filename` The file path of the template @param {String} `lineno` The line number of the expression causing the error. @param {String} `str` Template string @a...
[ "Re", "-", "throw", "the", "given", "err", "in", "context", "to", "the", "offending", "template", "expression", "in", "filename", "at", "the", "given", "lineno", "." ]
2ab061ed114e7ab076f76b39fae749146d8c4a3c
https://github.com/jonschlinkert/rethrow/blob/2ab061ed114e7ab076f76b39fae749146d8c4a3c/index.js#L28-L63
train
mamboer/cssutil
pather.js
processRelativePath
function processRelativePath(cssPath, importCssPath, importCssText) { cssPath = cssPath.split('\\'); importCssPath = importCssPath.split('/'); var isSibling = importCssPath.length == 1; return importCssText.replace(reg, function(css, before, imgPath, after) { if (/^http\S/.te...
javascript
function processRelativePath(cssPath, importCssPath, importCssText) { cssPath = cssPath.split('\\'); importCssPath = importCssPath.split('/'); var isSibling = importCssPath.length == 1; return importCssText.replace(reg, function(css, before, imgPath, after) { if (/^http\S/.te...
[ "function", "processRelativePath", "(", "cssPath", ",", "importCssPath", ",", "importCssText", ")", "{", "cssPath", "=", "cssPath", ".", "split", "(", "'\\\\'", ")", ";", "importCssPath", "=", "importCssPath", ".", "split", "(", "'/'", ")", ";", "var", "isSi...
process relative image pathes in specified imported css @param {String} cssPath css absolute file path @param {String} importCssPath relative imported css file path @param {String} importCssText contents of the imported css file
[ "process", "relative", "image", "pathes", "in", "specified", "imported", "css" ]
430cc26bea5cdb195411b5b4d1db3c4c4d817246
https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L10-L22
train
mamboer/cssutil
pather.js
getRelativePath
function getRelativePath(cssPath, importCssPath, imgPath) { var count1 = 0, count2 = 0, result = ''; importCssPath = getFilePath(cssPath, importCssPath); imgPath = getFilePath(importCssPath, imgPath); for (var i = 0, length = cssPath.length; i < length; i++) { ...
javascript
function getRelativePath(cssPath, importCssPath, imgPath) { var count1 = 0, count2 = 0, result = ''; importCssPath = getFilePath(cssPath, importCssPath); imgPath = getFilePath(importCssPath, imgPath); for (var i = 0, length = cssPath.length; i < length; i++) { ...
[ "function", "getRelativePath", "(", "cssPath", ",", "importCssPath", ",", "imgPath", ")", "{", "var", "count1", "=", "0", ",", "count2", "=", "0", ",", "result", "=", "''", ";", "importCssPath", "=", "getFilePath", "(", "cssPath", ",", "importCssPath", ")"...
get images' relative path after css merging @param {String} cssPath css absolute file path @param {String} importCssPath relative imported css file path @param {String} imgPath raw image relative path
[ "get", "images", "relative", "path", "after", "css", "merging" ]
430cc26bea5cdb195411b5b4d1db3c4c4d817246
https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L29-L48
train
mamboer/cssutil
pather.js
getFilePath
function getFilePath(basePath, relativePath) { var count = 0, array1, array2; for (var i = 0, length = relativePath.length; i < length; i++) { if (relativePath[i] == '..') { count++; } } array1 = basePath.slice(0, basePath.length - 1 - ...
javascript
function getFilePath(basePath, relativePath) { var count = 0, array1, array2; for (var i = 0, length = relativePath.length; i < length; i++) { if (relativePath[i] == '..') { count++; } } array1 = basePath.slice(0, basePath.length - 1 - ...
[ "function", "getFilePath", "(", "basePath", ",", "relativePath", ")", "{", "var", "count", "=", "0", ",", "array1", ",", "array2", ";", "for", "(", "var", "i", "=", "0", ",", "length", "=", "relativePath", ".", "length", ";", "i", "<", "length", ";",...
get relative file path basing on its containing file path and its relative path @param {String} basePath containing file path @param {String} relative path
[ "get", "relative", "file", "path", "basing", "on", "its", "containing", "file", "path", "and", "its", "relative", "path" ]
430cc26bea5cdb195411b5b4d1db3c4c4d817246
https://github.com/mamboer/cssutil/blob/430cc26bea5cdb195411b5b4d1db3c4c4d817246/pather.js#L54-L65
train
byu-oit/sans-server
bin/util.js
copy
function copy(obj, map) { if (map.has(obj)) { return map.get(obj); } else if (Array.isArray(obj)) { const result = []; map.set(obj, result); obj.forEach(item => { result.push(copy(item, map)); }); return result; } else if (typeof obj === 'object' &...
javascript
function copy(obj, map) { if (map.has(obj)) { return map.get(obj); } else if (Array.isArray(obj)) { const result = []; map.set(obj, result); obj.forEach(item => { result.push(copy(item, map)); }); return result; } else if (typeof obj === 'object' &...
[ "function", "copy", "(", "obj", ",", "map", ")", "{", "if", "(", "map", ".", "has", "(", "obj", ")", ")", "{", "return", "map", ".", "get", "(", "obj", ")", ";", "}", "else", "if", "(", "Array", ".", "isArray", "(", "obj", ")", ")", "{", "c...
Perform a deep copy of a value. @param {*} obj @param {WeakMap} [map] @returns {*}
[ "Perform", "a", "deep", "copy", "of", "a", "value", "." ]
022bcf7b47321e6e8aa20467cd96a6a84a457ec8
https://github.com/byu-oit/sans-server/blob/022bcf7b47321e6e8aa20467cd96a6a84a457ec8/bin/util.js#L73-L93
train
kuhnza/node-tubesio
examples/javascript/beatport-charts.js
parseSearchResults
function parseSearchResults(err, body) { if (err) { return tubesio.finish(err); } var result = []; jsdom.env({ html: body, scripts: [ 'http://code.jquery.com/jquery-1.5.min.js' ] }, function (err, window) { if (err) { return tubesio.finish(err); } v...
javascript
function parseSearchResults(err, body) { if (err) { return tubesio.finish(err); } var result = []; jsdom.env({ html: body, scripts: [ 'http://code.jquery.com/jquery-1.5.min.js' ] }, function (err, window) { if (err) { return tubesio.finish(err); } v...
[ "function", "parseSearchResults", "(", "err", ",", "body", ")", "{", "if", "(", "err", ")", "{", "return", "tubesio", ".", "finish", "(", "err", ")", ";", "}", "var", "result", "=", "[", "]", ";", "jsdom", ".", "env", "(", "{", "html", ":", "body...
Parses search results into an array.
[ "Parses", "search", "results", "into", "an", "array", "." ]
198d005de764480485fe038d1832ccb0f6e0596e
https://github.com/kuhnza/node-tubesio/blob/198d005de764480485fe038d1832ccb0f6e0596e/examples/javascript/beatport-charts.js#L18-L51
train
snowyu/inherits-ex.js
src/inherits.js
inherits
function inherits(ctor, superCtor, staticInherit) { var v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); var mixinCtor = ctor.mixinCtor_; if (mixinCtor && v === mixinCtor) { ctor = mixinCtor; v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); } var ...
javascript
function inherits(ctor, superCtor, staticInherit) { var v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); var mixinCtor = ctor.mixinCtor_; if (mixinCtor && v === mixinCtor) { ctor = mixinCtor; v = (ctor.hasOwnProperty('super_') && ctor.super_) || getPrototypeOf(ctor); } var ...
[ "function", "inherits", "(", "ctor", ",", "superCtor", ",", "staticInherit", ")", "{", "var", "v", "=", "(", "ctor", ".", "hasOwnProperty", "(", "'super_'", ")", "&&", "ctor", ".", "super_", ")", "||", "getPrototypeOf", "(", "ctor", ")", ";", "var", "m...
Inherit the prototype methods from one constructor into another. The Function.prototype.inherits from lang.js rewritten as a standalone function (not on Function.prototype). NOTE: If this file is to be loaded during bootstrapping this function needs to be rewritten using some native functions as prototype setup using...
[ "Inherit", "the", "prototype", "methods", "from", "one", "constructor", "into", "another", "." ]
09f10e8400bd2b16943ec0dea01d0d9b79abea74
https://github.com/snowyu/inherits-ex.js/blob/09f10e8400bd2b16943ec0dea01d0d9b79abea74/src/inherits.js#L22-L42
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function( text ) { if ( this.$.text != null ) this.$.text += text; else this.append( new CKEDITOR.dom.text( text ) ); }
javascript
function( text ) { if ( this.$.text != null ) this.$.text += text; else this.append( new CKEDITOR.dom.text( text ) ); }
[ "function", "(", "text", ")", "{", "if", "(", "this", ".", "$", ".", "text", "!=", "null", ")", "this", ".", "$", ".", "text", "+=", "text", ";", "else", "this", ".", "append", "(", "new", "CKEDITOR", ".", "dom", ".", "text", "(", "text", ")", ...
Append text to this element. var p = new CKEDITOR.dom.element( 'p' ); p.appendText( 'This is' ); p.appendText( ' some text' ); // Result: '<p>This is some text</p>' @param {String} text The text to be appended. @returns {CKEDITOR.dom.node} The appended node.
[ "Append", "text", "to", "this", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L248-L253
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function( parent ) { var range = new CKEDITOR.dom.range( this.getDocument() ); // We'll be extracting part of this element, so let's use our // range to get the correct piece. range.setStartAfter( this ); range.setEndAfter( parent ); // Extract it. var docFrag = range.extractContents(); // Mo...
javascript
function( parent ) { var range = new CKEDITOR.dom.range( this.getDocument() ); // We'll be extracting part of this element, so let's use our // range to get the correct piece. range.setStartAfter( this ); range.setEndAfter( parent ); // Extract it. var docFrag = range.extractContents(); // Mo...
[ "function", "(", "parent", ")", "{", "var", "range", "=", "new", "CKEDITOR", ".", "dom", ".", "range", "(", "this", ".", "getDocument", "(", ")", ")", ";", "// We'll be extracting part of this element, so let's use our", "// range to get the correct piece.", "range", ...
Breaks one of the ancestor element in the element position, moving this element between the broken parts. // Before breaking: // <b>This <i>is some<span /> sample</i> test text</b> // If "element" is <span /> and "parent" is <i>: // <b>This <i>is some</i><span /><i> sample</i> test text</b> element.breakParent( pare...
[ "Breaks", "one", "of", "the", "ancestor", "element", "in", "the", "element", "position", "moving", "this", "element", "between", "the", "broken", "parts", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L298-L314
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function() { // http://help.dottoro.com/ljvmcrrn.php var rect = CKEDITOR.tools.extend( {}, this.$.getBoundingClientRect() ); !rect.width && ( rect.width = rect.right - rect.left ); !rect.height && ( rect.height = rect.bottom - rect.top ); return rect; }
javascript
function() { // http://help.dottoro.com/ljvmcrrn.php var rect = CKEDITOR.tools.extend( {}, this.$.getBoundingClientRect() ); !rect.width && ( rect.width = rect.right - rect.left ); !rect.height && ( rect.height = rect.bottom - rect.top ); return rect; }
[ "function", "(", ")", "{", "// http://help.dottoro.com/ljvmcrrn.php", "var", "rect", "=", "CKEDITOR", ".", "tools", ".", "extend", "(", "{", "}", ",", "this", ".", "$", ".", "getBoundingClientRect", "(", ")", ")", ";", "!", "rect", ".", "width", "&&", "(...
Retrieve the bounding rectangle of the current element, in pixels, relative to the upper-left corner of the browser's client area. @returns {Object} The dimensions of the DOM element including `left`, `top`, `right`, `bottom`, `width` and `height`.
[ "Retrieve", "the", "bounding", "rectangle", "of", "the", "current", "element", "in", "pixels", "relative", "to", "the", "upper", "-", "left", "corner", "of", "the", "browser", "s", "client", "area", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L399-L407
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function( otherElement ) { // do shallow clones, but with IDs var thisEl = this.clone( 0, 1 ), otherEl = otherElement.clone( 0, 1 ); // Remove distractions. thisEl.removeAttributes( [ '_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name' ] ); otherEl.removeAttributes( [ '_mo...
javascript
function( otherElement ) { // do shallow clones, but with IDs var thisEl = this.clone( 0, 1 ), otherEl = otherElement.clone( 0, 1 ); // Remove distractions. thisEl.removeAttributes( [ '_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name' ] ); otherEl.removeAttributes( [ '_mo...
[ "function", "(", "otherElement", ")", "{", "// do shallow clones, but with IDs", "var", "thisEl", "=", "this", ".", "clone", "(", "0", ",", "1", ")", ",", "otherEl", "=", "otherElement", ".", "clone", "(", "0", ",", "1", ")", ";", "// Remove distractions.", ...
Compare this element's inner html, tag name, attributes, etc. with other one. See [W3C's DOM Level 3 spec - node#isEqualNode](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode) for more details. @param {CKEDITOR.dom.element} otherElement Element to compare. @returns {Boolean}
[ "Compare", "this", "element", "s", "inner", "html", "tag", "name", "attributes", "etc", ".", "with", "other", "one", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L843-L874
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function() { // CSS unselectable. this.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'none' ) ); // For IE/Opera which doesn't support for the above CSS style, // the unselectable="on" attribute only specifies the selection // process cannot start in the element itself, and it doesn't inheri...
javascript
function() { // CSS unselectable. this.setStyles( CKEDITOR.tools.cssVendorPrefix( 'user-select', 'none' ) ); // For IE/Opera which doesn't support for the above CSS style, // the unselectable="on" attribute only specifies the selection // process cannot start in the element itself, and it doesn't inheri...
[ "function", "(", ")", "{", "// CSS unselectable.", "this", ".", "setStyles", "(", "CKEDITOR", ".", "tools", ".", "cssVendorPrefix", "(", "'user-select'", ",", "'none'", ")", ")", ";", "// For IE/Opera which doesn't support for the above CSS style,", "// the unselectable=\...
Makes the element and its children unselectable. var element = CKEDITOR.document.getById( 'myElement' ); element.unselectable(); @method
[ "Makes", "the", "element", "and", "its", "children", "unselectable", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1351-L1369
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
function( alignToTop ) { var parent = this.getParent(); if ( !parent ) return; // Scroll the element into parent container from the inner out. do { // Check ancestors that overflows. var overflowed = parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth || parent.$.clien...
javascript
function( alignToTop ) { var parent = this.getParent(); if ( !parent ) return; // Scroll the element into parent container from the inner out. do { // Check ancestors that overflows. var overflowed = parent.$.clientWidth && parent.$.clientWidth < parent.$.scrollWidth || parent.$.clien...
[ "function", "(", "alignToTop", ")", "{", "var", "parent", "=", "this", ".", "getParent", "(", ")", ";", "if", "(", "!", "parent", ")", "return", ";", "// Scroll the element into parent container from the inner out.", "do", "{", "// Check ancestors that overflows.", ...
Make any page element visible inside the browser viewport. @param {Boolean} [alignToTop=false]
[ "Make", "any", "page", "element", "visible", "inside", "the", "browser", "viewport", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1488-L1517
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
scrollBy
function scrollBy( x, y ) { // Webkit doesn't support "scrollTop/scrollLeft" // on documentElement/body element. if ( /body|html/.test( parent.getName() ) ) parent.getWindow().$.scrollBy( x, y ); else { parent.$.scrollLeft += x; parent.$.scrollTop += y; } }
javascript
function scrollBy( x, y ) { // Webkit doesn't support "scrollTop/scrollLeft" // on documentElement/body element. if ( /body|html/.test( parent.getName() ) ) parent.getWindow().$.scrollBy( x, y ); else { parent.$.scrollLeft += x; parent.$.scrollTop += y; } }
[ "function", "scrollBy", "(", "x", ",", "y", ")", "{", "// Webkit doesn't support \"scrollTop/scrollLeft\"", "// on documentElement/body element.", "if", "(", "/", "body|html", "/", ".", "test", "(", "parent", ".", "getName", "(", ")", ")", ")", "parent", ".", "g...
Scroll the parent by the specified amount.
[ "Scroll", "the", "parent", "by", "the", "specified", "amount", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1540-L1549
train
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/dom/element.js
screenPos
function screenPos( element, refWin ) { var pos = { x: 0, y: 0 }; if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) { var box = element.$.getBoundingClientRect(); pos.x = box.left, pos.y = box.top; } var win = element.getWindow(); if ( !win.equals( refWin ) ) { var outerPos = scr...
javascript
function screenPos( element, refWin ) { var pos = { x: 0, y: 0 }; if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) { var box = element.$.getBoundingClientRect(); pos.x = box.left, pos.y = box.top; } var win = element.getWindow(); if ( !win.equals( refWin ) ) { var outerPos = scr...
[ "function", "screenPos", "(", "element", ",", "refWin", ")", "{", "var", "pos", "=", "{", "x", ":", "0", ",", "y", ":", "0", "}", ";", "if", "(", "!", "(", "element", ".", "is", "(", "isQuirks", "?", "'body'", ":", "'html'", ")", ")", ")", "{...
Figure out the element position relative to the specified window.
[ "Figure", "out", "the", "element", "position", "relative", "to", "the", "specified", "window", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/dom/element.js#L1552-L1567
train