id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
55,400
phun-ky/patsy
lib/patsy.js
function(how){ var _child, _cfg, patsy = this; var _execCmd = []; if(typeof this.project_cfg.project === 'undefined'){ /** * Require config from the library * * @var Object * @source patsy */ var config = require('./config')({ ...
javascript
function(how){ var _child, _cfg, patsy = this; var _execCmd = []; if(typeof this.project_cfg.project === 'undefined'){ /** * Require config from the library * * @var Object * @source patsy */ var config = require('./config')({ ...
[ "function", "(", "how", ")", "{", "var", "_child", ",", "_cfg", ",", "patsy", "=", "this", ";", "var", "_execCmd", "=", "[", "]", ";", "if", "(", "typeof", "this", ".", "project_cfg", ".", "project", "===", "'undefined'", ")", "{", "/**\n * Req...
Runs grunt tasks @param String how
[ "Runs", "grunt", "tasks" ]
b2bf3e6c72e17c38d9b2cf2fa4306478fc3858a5
https://github.com/phun-ky/patsy/blob/b2bf3e6c72e17c38d9b2cf2fa4306478fc3858a5/lib/patsy.js#L768-L843
55,401
syaning/zhimg
index.js
Image
function Image(src) { if (!(this instanceof Image)) { return new Image(src) } if (typeof src !== 'string') { throw new Error('param `src` must be a string') } var ret = reg.exec(src) if (!ret) { throw new Error('invalid param `src`') } this.src = src this.host = ret[1] || defaultHost ...
javascript
function Image(src) { if (!(this instanceof Image)) { return new Image(src) } if (typeof src !== 'string') { throw new Error('param `src` must be a string') } var ret = reg.exec(src) if (!ret) { throw new Error('invalid param `src`') } this.src = src this.host = ret[1] || defaultHost ...
[ "function", "Image", "(", "src", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Image", ")", ")", "{", "return", "new", "Image", "(", "src", ")", "}", "if", "(", "typeof", "src", "!==", "'string'", ")", "{", "throw", "new", "Error", "(", "...
Initialize `Image` with given `src`. @param {String} src @public
[ "Initialize", "Image", "with", "given", "src", "." ]
d63658f67a39ee0804ab61a6890c997a58e3c38e
https://github.com/syaning/zhimg/blob/d63658f67a39ee0804ab61a6890c997a58e3c38e/index.js#L12-L32
55,402
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function ($placeholder, file, that) { $.ajax({ type: "post", url: that.options.imagesUploadScript, xhr: function () { var xhr = new XMLHttpRequest(); xhr.upload.onprogress = that.updateProgressBar; return xhr; }, cache: false, contentType: false, complete: functi...
javascript
function ($placeholder, file, that) { $.ajax({ type: "post", url: that.options.imagesUploadScript, xhr: function () { var xhr = new XMLHttpRequest(); xhr.upload.onprogress = that.updateProgressBar; return xhr; }, cache: false, contentType: false, complete: functi...
[ "function", "(", "$placeholder", ",", "file", ",", "that", ")", "{", "$", ".", "ajax", "(", "{", "type", ":", "\"post\"", ",", "url", ":", "that", ".", "options", ".", "imagesUploadScript", ",", "xhr", ":", "function", "(", ")", "{", "var", "xhr", ...
Upload single file @param {element} $placeholder Placeholder to add image to @param {File} file File to upload @param {object} that Context @param {void}
[ "Upload", "single", "file" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L45-L62
55,403
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function (file, that) { $.ajax({ type: "post", url: that.options.imagesDeleteScript, data: { file: file } }); }
javascript
function (file, that) { $.ajax({ type: "post", url: that.options.imagesDeleteScript, data: { file: file } }); }
[ "function", "(", "file", ",", "that", ")", "{", "$", ".", "ajax", "(", "{", "type", ":", "\"post\"", ",", "url", ":", "that", ".", "options", ".", "imagesDeleteScript", ",", "data", ":", "{", "file", ":", "file", "}", "}", ")", ";", "}" ]
Makes ajax call for deleting a file on a server @param {string} file File name @param {object} that Context @return {void}
[ "Makes", "ajax", "call", "for", "deleting", "a", "file", "on", "a", "server" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L71-L79
55,404
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function (options) { if (options && options.$el) { this.$el = options.$el; } this.options = $.extend(this.defaults, options); this.setImageEvents(); if (this.options.useDragAndDrop === true){ this.setDragAndDropEvents(); } this.preparePreviousImages(); }
javascript
function (options) { if (options && options.$el) { this.$el = options.$el; } this.options = $.extend(this.defaults, options); this.setImageEvents(); if (this.options.useDragAndDrop === true){ this.setDragAndDropEvents(); } this.preparePreviousImages(); }
[ "function", "(", "options", ")", "{", "if", "(", "options", "&&", "options", ".", "$el", ")", "{", "this", ".", "$el", "=", "options", ".", "$el", ";", "}", "this", ".", "options", "=", "$", ".", "extend", "(", "this", ".", "defaults", ",", "opti...
Images initial function @param {object} options Options to overide defaults @return {void}
[ "Images", "initial", "function" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L90-L104
55,405
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function(buttonLabels){ var label = 'Img'; if (buttonLabels === 'fontawesome' || typeof buttonLabels === 'object' && !!(buttonLabels.fontawesome)) { label = '<i class="fa fa-picture-o"></i>'; } if (typeof buttonLabels === 'object' && buttonLabels.img) { label = buttonLabels.img; } return ...
javascript
function(buttonLabels){ var label = 'Img'; if (buttonLabels === 'fontawesome' || typeof buttonLabels === 'object' && !!(buttonLabels.fontawesome)) { label = '<i class="fa fa-picture-o"></i>'; } if (typeof buttonLabels === 'object' && buttonLabels.img) { label = buttonLabels.img; } return ...
[ "function", "(", "buttonLabels", ")", "{", "var", "label", "=", "'Img'", ";", "if", "(", "buttonLabels", "===", "'fontawesome'", "||", "typeof", "buttonLabels", "===", "'object'", "&&", "!", "!", "(", "buttonLabels", ".", "fontawesome", ")", ")", "{", "lab...
Returns insert button @param {string} buttonLabels @return {string}
[ "Returns", "insert", "button" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L114-L125
55,406
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function ($placeholder) { var that = this, $selectFile, files; $selectFile = $('<input type="file" multiple="multiple">').click(); $selectFile.change(function () { files = this.files; that.uploadFiles($placeholder, files, that); }); $.fn.mediumInsert.insert.deselect(); return $selectFi...
javascript
function ($placeholder) { var that = this, $selectFile, files; $selectFile = $('<input type="file" multiple="multiple">').click(); $selectFile.change(function () { files = this.files; that.uploadFiles($placeholder, files, that); }); $.fn.mediumInsert.insert.deselect(); return $selectFi...
[ "function", "(", "$placeholder", ")", "{", "var", "that", "=", "this", ",", "$selectFile", ",", "files", ";", "$selectFile", "=", "$", "(", "'<input type=\"file\" multiple=\"multiple\">'", ")", ".", "click", "(", ")", ";", "$selectFile", ".", "change", "(", ...
Add image to placeholder @param {element} $placeholder Placeholder to add image to @return {element} $selectFile <input type="file"> element
[ "Add", "image", "to", "placeholder" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L149-L162
55,407
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function (e) { var $progress = $('.progress:first', this.$el), complete; if (e.lengthComputable) { complete = e.loaded / e.total * 100; complete = complete ? complete : 0; $progress.attr('value', complete); $progress.html(complete); } }
javascript
function (e) { var $progress = $('.progress:first', this.$el), complete; if (e.lengthComputable) { complete = e.loaded / e.total * 100; complete = complete ? complete : 0; $progress.attr('value', complete); $progress.html(complete); } }
[ "function", "(", "e", ")", "{", "var", "$progress", "=", "$", "(", "'.progress:first'", ",", "this", ".", "$el", ")", ",", "complete", ";", "if", "(", "e", ".", "lengthComputable", ")", "{", "complete", "=", "e", ".", "loaded", "/", "e", ".", "tota...
Update progressbar while upload @param {event} e XMLHttpRequest.upload.onprogress event @return {void}
[ "Update", "progressbar", "while", "upload" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L171-L181
55,408
skerit/alchemy-styleboost
assets/scripts/medium-insert/images.js
function (jqxhr, $placeholder) { var $progress = $('.progress:first', $placeholder), $img; $progress.attr('value', 100); $progress.html(100); if (jqxhr.responseText) { $progress.before('<figure class="mediumInsert-images"><img src="'+ jqxhr.responseText +'" draggable="true" alt=""></figure>'); ...
javascript
function (jqxhr, $placeholder) { var $progress = $('.progress:first', $placeholder), $img; $progress.attr('value', 100); $progress.html(100); if (jqxhr.responseText) { $progress.before('<figure class="mediumInsert-images"><img src="'+ jqxhr.responseText +'" draggable="true" alt=""></figure>'); ...
[ "function", "(", "jqxhr", ",", "$placeholder", ")", "{", "var", "$progress", "=", "$", "(", "'.progress:first'", ",", "$placeholder", ")", ",", "$img", ";", "$progress", ".", "attr", "(", "'value'", ",", "100", ")", ";", "$progress", ".", "html", "(", ...
Show uploaded image after upload completed @param {jqXHR} jqxhr jqXHR object @return {void}
[ "Show", "uploaded", "image", "after", "upload", "completed" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/images.js#L190-L217
55,409
mgesmundo/authorify-client
lib/class/Store.js
function(key, callback) { if (key) { this.store.proxy.remove(this.prefix + key); if (callback) { callback(null, key); } } else { if (callback) { callback('missing key'); } } }
javascript
function(key, callback) { if (key) { this.store.proxy.remove(this.prefix + key); if (callback) { callback(null, key); } } else { if (callback) { callback('missing key'); } } }
[ "function", "(", "key", ",", "callback", ")", "{", "if", "(", "key", ")", "{", "this", ".", "store", ".", "proxy", ".", "remove", "(", "this", ".", "prefix", "+", "key", ")", ";", "if", "(", "callback", ")", "{", "callback", "(", "null", ",", "...
Destroy a stored item @param {String} key The key of the item @param {Function} callback Function called when the operation is done @return {callback(err, key)} The callback to execute as result @param {String} callback.err Error if occurred @param {String} callback.key The key of the destroyed item
[ "Destroy", "a", "stored", "item" ]
39fb57db897eaa49b76444ff62bbc0ccedc7ee16
https://github.com/mgesmundo/authorify-client/blob/39fb57db897eaa49b76444ff62bbc0ccedc7ee16/lib/class/Store.js#L53-L64
55,410
mgesmundo/authorify-client
lib/class/Store.js
function(key, callback) { if (key) { var _data = this.store.proxy.get(this.prefix + key), data; if ('undefined' !== typeof window) { // browser try { data = JSON.parse(_data); } catch (e) { data = _data; } } else {...
javascript
function(key, callback) { if (key) { var _data = this.store.proxy.get(this.prefix + key), data; if ('undefined' !== typeof window) { // browser try { data = JSON.parse(_data); } catch (e) { data = _data; } } else {...
[ "function", "(", "key", ",", "callback", ")", "{", "if", "(", "key", ")", "{", "var", "_data", "=", "this", ".", "store", ".", "proxy", ".", "get", "(", "this", ".", "prefix", "+", "key", ")", ",", "data", ";", "if", "(", "'undefined'", "!==", ...
Load stored item @param {String} key The key of the item @param {Function} callback Function called when the item is loaded @return {callback(err, data)} The callback to execute as result @param {String} callback.err Error if occurred @param {Object} callback.data The loaded item
[ "Load", "stored", "item" ]
39fb57db897eaa49b76444ff62bbc0ccedc7ee16
https://github.com/mgesmundo/authorify-client/blob/39fb57db897eaa49b76444ff62bbc0ccedc7ee16/lib/class/Store.js#L74-L92
55,411
mgesmundo/authorify-client
lib/class/Store.js
function(key, data, callback) { if (key) { if (data) { var _data = data; if ('undefined' !== typeof window && 'object' === typeof data) { _data = JSON.stringify(_data); } this.store.proxy.set(this.prefix + key, _data); callback(null); }...
javascript
function(key, data, callback) { if (key) { if (data) { var _data = data; if ('undefined' !== typeof window && 'object' === typeof data) { _data = JSON.stringify(_data); } this.store.proxy.set(this.prefix + key, _data); callback(null); }...
[ "function", "(", "key", ",", "data", ",", "callback", ")", "{", "if", "(", "key", ")", "{", "if", "(", "data", ")", "{", "var", "_data", "=", "data", ";", "if", "(", "'undefined'", "!==", "typeof", "window", "&&", "'object'", "===", "typeof", "data...
Save an item @param {String} key The key of the item @param {Object} data The item @param {Function} callback Function called when the session is saved @return {callback(err)} The callback to execute as result @param {String} callback.status Result from Redis query
[ "Save", "an", "item" ]
39fb57db897eaa49b76444ff62bbc0ccedc7ee16
https://github.com/mgesmundo/authorify-client/blob/39fb57db897eaa49b76444ff62bbc0ccedc7ee16/lib/class/Store.js#L102-L117
55,412
docvy/plugin-installer
lib/cli.js
list
function list() { return installer.listPlugins(function(listErr, plugins) { if (listErr) { return out.error("error listing installed plugins: %s", listErr); } if (plugins.length === 0) { return out.success("no plugins found"); } var string = ""; for (var idx = 0; idx < plugins.leng...
javascript
function list() { return installer.listPlugins(function(listErr, plugins) { if (listErr) { return out.error("error listing installed plugins: %s", listErr); } if (plugins.length === 0) { return out.success("no plugins found"); } var string = ""; for (var idx = 0; idx < plugins.leng...
[ "function", "list", "(", ")", "{", "return", "installer", ".", "listPlugins", "(", "function", "(", "listErr", ",", "plugins", ")", "{", "if", "(", "listErr", ")", "{", "return", "out", ".", "error", "(", "\"error listing installed plugins: %s\"", ",", "list...
listing installed plugins
[ "listing", "installed", "plugins" ]
eb645eb21f350a0fbbf783d83b25ab18feeee684
https://github.com/docvy/plugin-installer/blob/eb645eb21f350a0fbbf783d83b25ab18feeee684/lib/cli.js#L36-L51
55,413
pierrec/node-atok
lib/tokenizer.js
resolveId
function resolveId (prop) { if (rule[prop] === null || typeof rule[prop] === 'number') return // Resolve the property to an index var j = self._getRuleIndex(rule.id) if (j < 0) self._error( new Error('Atok#_resolveRules: ' + prop + '() value not found: ' + rule.id) ) rule[prop] = i - j...
javascript
function resolveId (prop) { if (rule[prop] === null || typeof rule[prop] === 'number') return // Resolve the property to an index var j = self._getRuleIndex(rule.id) if (j < 0) self._error( new Error('Atok#_resolveRules: ' + prop + '() value not found: ' + rule.id) ) rule[prop] = i - j...
[ "function", "resolveId", "(", "prop", ")", "{", "if", "(", "rule", "[", "prop", "]", "===", "null", "||", "typeof", "rule", "[", "prop", "]", "===", "'number'", ")", "return", "// Resolve the property to an index", "var", "j", "=", "self", ".", "_getRuleIn...
Perform various checks on a continue type property
[ "Perform", "various", "checks", "on", "a", "continue", "type", "property" ]
abe139e7fa8c092d87e528289b6abd9083df2323
https://github.com/pierrec/node-atok/blob/abe139e7fa8c092d87e528289b6abd9083df2323/lib/tokenizer.js#L759-L768
55,414
repetere/stylie.modals
lib/stylie.modals.js
function (options) { events.EventEmitter.call(this); // this.el = el; this.options = extend(this.options, options); // console.log(this.options); this._init(); this.show = this._show; this.hide = this._hide; }
javascript
function (options) { events.EventEmitter.call(this); // this.el = el; this.options = extend(this.options, options); // console.log(this.options); this._init(); this.show = this._show; this.hide = this._hide; }
[ "function", "(", "options", ")", "{", "events", ".", "EventEmitter", ".", "call", "(", "this", ")", ";", "// this.el = el;", "this", ".", "options", "=", "extend", "(", "this", ".", "options", ",", "options", ")", ";", "// console.log(this.options);", "this"...
A module that represents a StylieModals object, a componentTab is a page composition tool. @{@link https://github.com/typesettin/stylie.modals} @author Yaw Joseph Etse @copyright Copyright (c) 2014 Typesettin. All rights reserved. @license MIT @constructor StylieModals @requires module:util-extent @requires module:util...
[ "A", "module", "that", "represents", "a", "StylieModals", "object", "a", "componentTab", "is", "a", "page", "composition", "tool", "." ]
a27238e4a3c27fc7761e92d449fe6d1967f1fffb
https://github.com/repetere/stylie.modals/blob/a27238e4a3c27fc7761e92d449fe6d1967f1fffb/lib/stylie.modals.js#L28-L37
55,415
arpinum-oss/js-promising
benchmarks/compose.js
createFunctions
function createFunctions() { const result = []; for (let i = 0; i < count; i++) { result.push(number => Promise.resolve(number + 1)); } return result; }
javascript
function createFunctions() { const result = []; for (let i = 0; i < count; i++) { result.push(number => Promise.resolve(number + 1)); } return result; }
[ "function", "createFunctions", "(", ")", "{", "const", "result", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "result", ".", "push", "(", "number", "=>", "Promise", ".", "resolve", "(", ...
100000 functions handled in 267 ms
[ "100000", "functions", "handled", "in", "267", "ms" ]
710712e7d2b1429bda92d21c420d79d16cc6160a
https://github.com/arpinum-oss/js-promising/blob/710712e7d2b1429bda92d21c420d79d16cc6160a/benchmarks/compose.js#L13-L19
55,416
willmark/http-handler
index.js
function(filepath, req, res) { var path = require("path"), config = module.exports.config, result = false, parentdir; do { var defaultdir = path.resolve(path.join(config.responsesdefault, filepath)); parentdir = path.resolve(path.join(config.responses, filepath)); ...
javascript
function(filepath, req, res) { var path = require("path"), config = module.exports.config, result = false, parentdir; do { var defaultdir = path.resolve(path.join(config.responsesdefault, filepath)); parentdir = path.resolve(path.join(config.responses, filepath)); ...
[ "function", "(", "filepath", ",", "req", ",", "res", ")", "{", "var", "path", "=", "require", "(", "\"path\"", ")", ",", "config", "=", "module", ".", "exports", ".", "config", ",", "result", "=", "false", ",", "parentdir", ";", "do", "{", "var", "...
Join responses root folder to requested sub-directory id - sub-folder path req - http request http.IncomingMessage res - http response http.ServerResponse
[ "Join", "responses", "root", "folder", "to", "requested", "sub", "-", "directory", "id", "-", "sub", "-", "folder", "path", "req", "-", "http", "request", "http", ".", "IncomingMessage", "res", "-", "http", "response", "http", ".", "ServerResponse" ]
63defe72de0214f34500d3d9db75807014f5d134
https://github.com/willmark/http-handler/blob/63defe72de0214f34500d3d9db75807014f5d134/index.js#L36-L57
55,417
psastras/swag2blue
index.js
convert
function convert(swagger, done) { fury.parse({source: swagger}, function (parseErr, res) { if (parseErr) { return done(parseErr); } fury.serialize({api: res.api}, function (serializeErr, blueprint) { if (serializeErr) { return done(serializeErr); } done(null, blueprint); ...
javascript
function convert(swagger, done) { fury.parse({source: swagger}, function (parseErr, res) { if (parseErr) { return done(parseErr); } fury.serialize({api: res.api}, function (serializeErr, blueprint) { if (serializeErr) { return done(serializeErr); } done(null, blueprint); ...
[ "function", "convert", "(", "swagger", ",", "done", ")", "{", "fury", ".", "parse", "(", "{", "source", ":", "swagger", "}", ",", "function", "(", "parseErr", ",", "res", ")", "{", "if", "(", "parseErr", ")", "{", "return", "done", "(", "parseErr", ...
Take a loaded Swagger object and converts it to API Blueprint
[ "Take", "a", "loaded", "Swagger", "object", "and", "converts", "it", "to", "API", "Blueprint" ]
443f0703a6b60ed3da9b5cebfa4a9c1f167a9718
https://github.com/psastras/swag2blue/blob/443f0703a6b60ed3da9b5cebfa4a9c1f167a9718/index.js#L25-L38
55,418
psastras/swag2blue
index.js
run
function run(argv, done) { if (!argv) { argv = parser.argv; } if (argv.h) { parser.showHelp(); return done(null); } if (!argv._.length) { return done(new Error('Requires an input argument')); } else if (argv._.length > 2) { return done(new Error('Too many arguments given!')); } va...
javascript
function run(argv, done) { if (!argv) { argv = parser.argv; } if (argv.h) { parser.showHelp(); return done(null); } if (!argv._.length) { return done(new Error('Requires an input argument')); } else if (argv._.length > 2) { return done(new Error('Too many arguments given!')); } va...
[ "function", "run", "(", "argv", ",", "done", ")", "{", "if", "(", "!", "argv", ")", "{", "argv", "=", "parser", ".", "argv", ";", "}", "if", "(", "argv", ".", "h", ")", "{", "parser", ".", "showHelp", "(", ")", ";", "return", "done", "(", "nu...
Run the command with the given arguments.
[ "Run", "the", "command", "with", "the", "given", "arguments", "." ]
443f0703a6b60ed3da9b5cebfa4a9c1f167a9718
https://github.com/psastras/swag2blue/blob/443f0703a6b60ed3da9b5cebfa4a9c1f167a9718/index.js#L41-L78
55,419
trevorparscal/node-palo
lib/resources/ModuleResource.js
ModuleResource
function ModuleResource( pkg, config ) { // Parent constructor ModuleResource.super.call( this, pkg, config ); // Properties this.imports = config.imports || null; this.exports = config.exports || null; this.propertyNamePattern = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; }
javascript
function ModuleResource( pkg, config ) { // Parent constructor ModuleResource.super.call( this, pkg, config ); // Properties this.imports = config.imports || null; this.exports = config.exports || null; this.propertyNamePattern = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; }
[ "function", "ModuleResource", "(", "pkg", ",", "config", ")", "{", "// Parent constructor", "ModuleResource", ".", "super", ".", "call", "(", "this", ",", "pkg", ",", "config", ")", ";", "// Properties", "this", ".", "imports", "=", "config", ".", "imports",...
JavaScript module resource. @class @extends {FileResource} @constructor @param {Package} pkg Package this resource is part of @param {Object|string[]|string} config Resource configuration or one or more resource file paths
[ "JavaScript", "module", "resource", "." ]
425efdcf027c71296c732765afdf5cacae6a1a3e
https://github.com/trevorparscal/node-palo/blob/425efdcf027c71296c732765afdf5cacae6a1a3e/lib/resources/ModuleResource.js#L15-L23
55,420
kaelzhang/node-commonjs-walker
lib/walker.js
init
function init (done) { var node = tools.match_ext(filename, 'node') var json = tools.match_ext(filename, 'json') done(null, { content: content, json: json, node: node, // all other files are considered as javascript files. js: !node && !json, }) }
javascript
function init (done) { var node = tools.match_ext(filename, 'node') var json = tools.match_ext(filename, 'json') done(null, { content: content, json: json, node: node, // all other files are considered as javascript files. js: !node && !json, }) }
[ "function", "init", "(", "done", ")", "{", "var", "node", "=", "tools", ".", "match_ext", "(", "filename", ",", "'node'", ")", "var", "json", "=", "tools", ".", "match_ext", "(", "filename", ",", "'json'", ")", "done", "(", "null", ",", "{", "content...
If no registered compilers, just return
[ "If", "no", "registered", "compilers", "just", "return" ]
d96b3b56ffa9efb2eaa33e67c91d32622f79ea37
https://github.com/kaelzhang/node-commonjs-walker/blob/d96b3b56ffa9efb2eaa33e67c91d32622f79ea37/lib/walker.js#L242-L253
55,421
medic/couchdb-audit
couchdb-audit/kanso.js
function(db, auditDb) { var dbWrapper = getDbWrapper(db); var auditDbWrapper; if (auditDb) { auditDbWrapper = getDbWrapper(auditDb); } else { auditDbWrapper = dbWrapper; } var clientWrapper = { uuids: function(count, callback) { db.newUUID.call(db, 100, function(err, i...
javascript
function(db, auditDb) { var dbWrapper = getDbWrapper(db); var auditDbWrapper; if (auditDb) { auditDbWrapper = getDbWrapper(auditDb); } else { auditDbWrapper = dbWrapper; } var clientWrapper = { uuids: function(count, callback) { db.newUUID.call(db, 100, function(err, i...
[ "function", "(", "db", ",", "auditDb", ")", "{", "var", "dbWrapper", "=", "getDbWrapper", "(", "db", ")", ";", "var", "auditDbWrapper", ";", "if", "(", "auditDb", ")", "{", "auditDbWrapper", "=", "getDbWrapper", "(", "auditDb", ")", ";", "}", "else", "...
Sets up auditing to work with the kanso db module. @name withKanso(db) @param {Object} db The kanso db instance to use. @param {Object} auditDb Optionally the kanso db instance to use for auditing. @api public
[ "Sets", "up", "auditing", "to", "work", "with", "the", "kanso", "db", "module", "." ]
88a2fde06830e91966fc82c7356ec46da043fc01
https://github.com/medic/couchdb-audit/blob/88a2fde06830e91966fc82c7356ec46da043fc01/couchdb-audit/kanso.js#L35-L60
55,422
mattma/gulp-htmlbars
bower_components/ember/ember-template-compiler.js
domIndexOf
function domIndexOf(nodes, domNode) { var index = -1; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node.type !== 'TextNode' && node.type !== 'ElementNode') { continue; } else { index++; } if (node === domNode) { re...
javascript
function domIndexOf(nodes, domNode) { var index = -1; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node.type !== 'TextNode' && node.type !== 'ElementNode') { continue; } else { index++; } if (node === domNode) { re...
[ "function", "domIndexOf", "(", "nodes", ",", "domNode", ")", "{", "var", "index", "=", "-", "1", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "i", "++", ")", "{", "var", "node", "=", "nodes", "[", "i", "]...
Returns the index of `domNode` in the `nodes` array, skipping over any nodes which do not represent DOM nodes.
[ "Returns", "the", "index", "of", "domNode", "in", "the", "nodes", "array", "skipping", "over", "any", "nodes", "which", "do", "not", "represent", "DOM", "nodes", "." ]
c9e6bcf32023825efc34a93ecf8555b3f98b2bcf
https://github.com/mattma/gulp-htmlbars/blob/c9e6bcf32023825efc34a93ecf8555b3f98b2bcf/bower_components/ember/ember-template-compiler.js#L1891-L1909
55,423
mattma/gulp-htmlbars
bower_components/ember/ember-template-compiler.js
parseComponentBlockParams
function parseComponentBlockParams(element, program) { var l = element.attributes.length; var attrNames = []; for (var i = 0; i < l; i++) { attrNames.push(element.attributes[i].name); } var asIndex = attrNames.indexOf('as'); if (asIndex !== -1 && l > asIndex && attrNames[a...
javascript
function parseComponentBlockParams(element, program) { var l = element.attributes.length; var attrNames = []; for (var i = 0; i < l; i++) { attrNames.push(element.attributes[i].name); } var asIndex = attrNames.indexOf('as'); if (asIndex !== -1 && l > asIndex && attrNames[a...
[ "function", "parseComponentBlockParams", "(", "element", ",", "program", ")", "{", "var", "l", "=", "element", ".", "attributes", ".", "length", ";", "var", "attrNames", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "l", ";", ...
Checks the component's attributes to see if it uses block params. If it does, registers the block params with the program and removes the corresponding attributes from the element.
[ "Checks", "the", "component", "s", "attributes", "to", "see", "if", "it", "uses", "block", "params", ".", "If", "it", "does", "registers", "the", "block", "params", "with", "the", "program", "and", "removes", "the", "corresponding", "attributes", "from", "th...
c9e6bcf32023825efc34a93ecf8555b3f98b2bcf
https://github.com/mattma/gulp-htmlbars/blob/c9e6bcf32023825efc34a93ecf8555b3f98b2bcf/bower_components/ember/ember-template-compiler.js#L3889-L3924
55,424
AndreasMadsen/piccolo
lib/client/link.js
onLinkClick
function onLinkClick(event) { // Resolve anchor link var page = url.format( url.resolve(location, this.getAttribute('href')) ); // Load new page piccolo.loadPage( page ); event.preventDefault(); return false; }
javascript
function onLinkClick(event) { // Resolve anchor link var page = url.format( url.resolve(location, this.getAttribute('href')) ); // Load new page piccolo.loadPage( page ); event.preventDefault(); return false; }
[ "function", "onLinkClick", "(", "event", ")", "{", "// Resolve anchor link", "var", "page", "=", "url", ".", "format", "(", "url", ".", "resolve", "(", "location", ",", "this", ".", "getAttribute", "(", "'href'", ")", ")", ")", ";", "// Load new page", "pi...
Add handlers to anchor tag
[ "Add", "handlers", "to", "anchor", "tag" ]
ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d
https://github.com/AndreasMadsen/piccolo/blob/ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d/lib/client/link.js#L23-L31
55,425
AndreasMadsen/piccolo
lib/client/link.js
renderPage
function renderPage(state) { // Get presenter object piccolo.require(state.resolved.name, function (error, Resource) { if (error) return piccolo.emit('error', error); var presenter = new Resource(state.query.href, document); presenter[state.resolved.method].apply(presenter, state.resolved...
javascript
function renderPage(state) { // Get presenter object piccolo.require(state.resolved.name, function (error, Resource) { if (error) return piccolo.emit('error', error); var presenter = new Resource(state.query.href, document); presenter[state.resolved.method].apply(presenter, state.resolved...
[ "function", "renderPage", "(", "state", ")", "{", "// Get presenter object", "piccolo", ".", "require", "(", "state", ".", "resolved", ".", "name", ",", "function", "(", "error", ",", "Resource", ")", "{", "if", "(", "error", ")", "return", "piccolo", ".",...
Render page change
[ "Render", "page", "change" ]
ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d
https://github.com/AndreasMadsen/piccolo/blob/ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d/lib/client/link.js#L49-L57
55,426
AndreasMadsen/piccolo
lib/client/link.js
createStateObject
function createStateObject(page, callback) { // This callback function will create a change table state object var create = function () { var query = url.parse(page); var presenter = piccolo.build.router.parse(query.pathname); var state = { 'resolved': presenter, 'namespace':...
javascript
function createStateObject(page, callback) { // This callback function will create a change table state object var create = function () { var query = url.parse(page); var presenter = piccolo.build.router.parse(query.pathname); var state = { 'resolved': presenter, 'namespace':...
[ "function", "createStateObject", "(", "page", ",", "callback", ")", "{", "// This callback function will create a change table state object", "var", "create", "=", "function", "(", ")", "{", "var", "query", "=", "url", ".", "parse", "(", "page", ")", ";", "var", ...
Parse a page path and return state object
[ "Parse", "a", "page", "path", "and", "return", "state", "object" ]
ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d
https://github.com/AndreasMadsen/piccolo/blob/ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d/lib/client/link.js#L60-L77
55,427
AndreasMadsen/piccolo
lib/client/link.js
function () { var query = url.parse(page); var presenter = piccolo.build.router.parse(query.pathname); var state = { 'resolved': presenter, 'namespace': 'piccolo', 'query': query }; callback(state); }
javascript
function () { var query = url.parse(page); var presenter = piccolo.build.router.parse(query.pathname); var state = { 'resolved': presenter, 'namespace': 'piccolo', 'query': query }; callback(state); }
[ "function", "(", ")", "{", "var", "query", "=", "url", ".", "parse", "(", "page", ")", ";", "var", "presenter", "=", "piccolo", ".", "build", ".", "router", ".", "parse", "(", "query", ".", "pathname", ")", ";", "var", "state", "=", "{", "'resolved...
This callback function will create a change table state object
[ "This", "callback", "function", "will", "create", "a", "change", "table", "state", "object" ]
ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d
https://github.com/AndreasMadsen/piccolo/blob/ef43f5634c564eef0d21a4a6aa103b2f1e3baa3d/lib/client/link.js#L63-L74
55,428
jwoudenberg/chain-args
lib/createChain.js
createChain
function createChain(descriptor, callback) { if (typeof descriptor !== 'object') { throw new TypeError('createChain: descriptor is not an object: ' + descriptor); } //Create the Chain class. function CustomChain(callback) { if (!(this instanceof CustomChain))...
javascript
function createChain(descriptor, callback) { if (typeof descriptor !== 'object') { throw new TypeError('createChain: descriptor is not an object: ' + descriptor); } //Create the Chain class. function CustomChain(callback) { if (!(this instanceof CustomChain))...
[ "function", "createChain", "(", "descriptor", ",", "callback", ")", "{", "if", "(", "typeof", "descriptor", "!==", "'object'", ")", "{", "throw", "new", "TypeError", "(", "'createChain: descriptor is not an object: '", "+", "descriptor", ")", ";", "}", "//Create t...
Take a descriptor object and return a Chain constructor. An optional default callback for this type of Chain.
[ "Take", "a", "descriptor", "object", "and", "return", "a", "Chain", "constructor", ".", "An", "optional", "default", "callback", "for", "this", "type", "of", "Chain", "." ]
8a4c8a1b8bf66bad98ffaa2e8ef44b08abfb7228
https://github.com/jwoudenberg/chain-args/blob/8a4c8a1b8bf66bad98ffaa2e8ef44b08abfb7228/lib/createChain.js#L9-L50
55,429
jwoudenberg/chain-args
lib/createChain.js
CustomChain
function CustomChain(callback) { if (!(this instanceof CustomChain)) { return new CustomChain(callback); } CustomChain.super_.call(this, callback); CustomChain._lists.forEach(function(listName) { this._result[listName] = []; }, this); }
javascript
function CustomChain(callback) { if (!(this instanceof CustomChain)) { return new CustomChain(callback); } CustomChain.super_.call(this, callback); CustomChain._lists.forEach(function(listName) { this._result[listName] = []; }, this); }
[ "function", "CustomChain", "(", "callback", ")", "{", "if", "(", "!", "(", "this", "instanceof", "CustomChain", ")", ")", "{", "return", "new", "CustomChain", "(", "callback", ")", ";", "}", "CustomChain", ".", "super_", ".", "call", "(", "this", ",", ...
Create the Chain class.
[ "Create", "the", "Chain", "class", "." ]
8a4c8a1b8bf66bad98ffaa2e8ef44b08abfb7228
https://github.com/jwoudenberg/chain-args/blob/8a4c8a1b8bf66bad98ffaa2e8ef44b08abfb7228/lib/createChain.js#L16-L24
55,430
jisbruzzi/file-combiner
index.js
includedFiles
function includedFiles(name){ let includes=this.getIncludes(this.getFile(name)); let ret=includes.map(include => { let ret = { absolute:path.join(name,"../",include.relPath), relative:include.relPath, match:include.match } return ret; }) return...
javascript
function includedFiles(name){ let includes=this.getIncludes(this.getFile(name)); let ret=includes.map(include => { let ret = { absolute:path.join(name,"../",include.relPath), relative:include.relPath, match:include.match } return ret; }) return...
[ "function", "includedFiles", "(", "name", ")", "{", "let", "includes", "=", "this", ".", "getIncludes", "(", "this", ".", "getFile", "(", "name", ")", ")", ";", "let", "ret", "=", "includes", ".", "map", "(", "include", "=>", "{", "let", "ret", "=", ...
Returns the paths of the included files, relative to cwd @param {String} name
[ "Returns", "the", "paths", "of", "the", "included", "files", "relative", "to", "cwd" ]
f5f4135628de75e55aee3dab0d48e58160113d06
https://github.com/jisbruzzi/file-combiner/blob/f5f4135628de75e55aee3dab0d48e58160113d06/index.js#L25-L36
55,431
mauroc/passport-squiddio
lib/errors/squiddiotokenerror.js
SquiddioTokenError
function SquiddioTokenError(message, type, code, subcode) { Error.call(this); Error.captureStackTrace(this, arguments.callee); this.name = 'SquiddioTokenError'; this.message = message; this.type = type; this.code = code; this.subcode = subcode; this.status = 500; }
javascript
function SquiddioTokenError(message, type, code, subcode) { Error.call(this); Error.captureStackTrace(this, arguments.callee); this.name = 'SquiddioTokenError'; this.message = message; this.type = type; this.code = code; this.subcode = subcode; this.status = 500; }
[ "function", "SquiddioTokenError", "(", "message", ",", "type", ",", "code", ",", "subcode", ")", "{", "Error", ".", "call", "(", "this", ")", ";", "Error", ".", "captureStackTrace", "(", "this", ",", "arguments", ".", "callee", ")", ";", "this", ".", "...
`SquiddioTokenError` error. SquiddioTokenError represents an error received from a Squiddio's token endpoint. Note that these responses don't conform to the OAuth 2.0 specification. References: - https://developers.Squiddio.com/docs/reference/api/errors/ @constructor @param {String} [message] @param {String} [type]...
[ "SquiddioTokenError", "error", "." ]
f2a7b1defde5b82240a53817c42327a6e9a7ca5b
https://github.com/mauroc/passport-squiddio/blob/f2a7b1defde5b82240a53817c42327a6e9a7ca5b/lib/errors/squiddiotokenerror.js#L18-L27
55,432
mcdonnelldean/metalsmith-move-up
lib/plugin.js
onNextTransform
function onNextTransform (transform, next) { // check if we should handle this filePath function shouldProcess (filePath, done) { done(!!multimatch(filePath, transform.pattern, transform.opts).length) } // transform the path function process (filePath, complete) { ...
javascript
function onNextTransform (transform, next) { // check if we should handle this filePath function shouldProcess (filePath, done) { done(!!multimatch(filePath, transform.pattern, transform.opts).length) } // transform the path function process (filePath, complete) { ...
[ "function", "onNextTransform", "(", "transform", ",", "next", ")", "{", "// check if we should handle this filePath\r", "function", "shouldProcess", "(", "filePath", ",", "done", ")", "{", "done", "(", "!", "!", "multimatch", "(", "filePath", ",", "transform", "."...
will be called once per transform
[ "will", "be", "called", "once", "per", "transform" ]
32457e76fe8736318e6edda2172fa7721068d827
https://github.com/mcdonnelldean/metalsmith-move-up/blob/32457e76fe8736318e6edda2172fa7721068d827/lib/plugin.js#L64-L94
55,433
mcdonnelldean/metalsmith-move-up
lib/plugin.js
shouldProcess
function shouldProcess (filePath, done) { done(!!multimatch(filePath, transform.pattern, transform.opts).length) }
javascript
function shouldProcess (filePath, done) { done(!!multimatch(filePath, transform.pattern, transform.opts).length) }
[ "function", "shouldProcess", "(", "filePath", ",", "done", ")", "{", "done", "(", "!", "!", "multimatch", "(", "filePath", ",", "transform", ".", "pattern", ",", "transform", ".", "opts", ")", ".", "length", ")", "}" ]
check if we should handle this filePath
[ "check", "if", "we", "should", "handle", "this", "filePath" ]
32457e76fe8736318e6edda2172fa7721068d827
https://github.com/mcdonnelldean/metalsmith-move-up/blob/32457e76fe8736318e6edda2172fa7721068d827/lib/plugin.js#L66-L68
55,434
mcdonnelldean/metalsmith-move-up
lib/plugin.js
process
function process (filePath, complete) { var filename = path.basename(filePath), pathParts = path.dirname(filePath).split(path.sep) // we'll get an empty arrary if we overslice pathParts = pathParts.slice(transform.by) pathParts.push(filename) var newPath = p...
javascript
function process (filePath, complete) { var filename = path.basename(filePath), pathParts = path.dirname(filePath).split(path.sep) // we'll get an empty arrary if we overslice pathParts = pathParts.slice(transform.by) pathParts.push(filename) var newPath = p...
[ "function", "process", "(", "filePath", ",", "complete", ")", "{", "var", "filename", "=", "path", ".", "basename", "(", "filePath", ")", ",", "pathParts", "=", "path", ".", "dirname", "(", "filePath", ")", ".", "split", "(", "path", ".", "sep", ")", ...
transform the path
[ "transform", "the", "path" ]
32457e76fe8736318e6edda2172fa7721068d827
https://github.com/mcdonnelldean/metalsmith-move-up/blob/32457e76fe8736318e6edda2172fa7721068d827/lib/plugin.js#L71-L88
55,435
byu-oit/sans-server
bin/server/response.js
Response
function Response(request, key) { // define private store const store = { body: '', cookies: [], headers: {}, key: key, sent: false, statusCode: 0 }; this[STORE] = store; /** * The request that is tied to this response. * @name Response#re...
javascript
function Response(request, key) { // define private store const store = { body: '', cookies: [], headers: {}, key: key, sent: false, statusCode: 0 }; this[STORE] = store; /** * The request that is tied to this response. * @name Response#re...
[ "function", "Response", "(", "request", ",", "key", ")", "{", "// define private store", "const", "store", "=", "{", "body", ":", "''", ",", "cookies", ":", "[", "]", ",", "headers", ":", "{", "}", ",", "key", ":", "key", ",", "sent", ":", "false", ...
Create a response instance. @param {Request} request The request that is relying on this response that is being created. @param {Symbol} key @returns {Response} @constructor
[ "Create", "a", "response", "instance", "." ]
022bcf7b47321e6e8aa20467cd96a6a84a457ec8
https://github.com/byu-oit/sans-server/blob/022bcf7b47321e6e8aa20467cd96a6a84a457ec8/bin/server/response.js#L33-L118
55,436
bfontaine/tp.js
lib/mocha.js
text
function text(el, str) { if (el.textContent) { el.textContent = str; } else { el.innerText = str; } }
javascript
function text(el, str) { if (el.textContent) { el.textContent = str; } else { el.innerText = str; } }
[ "function", "text", "(", "el", ",", "str", ")", "{", "if", "(", "el", ".", "textContent", ")", "{", "el", ".", "textContent", "=", "str", ";", "}", "else", "{", "el", ".", "innerText", "=", "str", ";", "}", "}" ]
Set `el` text to `str`.
[ "Set", "el", "text", "to", "str", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L2451-L2457
55,437
bfontaine/tp.js
lib/mocha.js
map
function map(cov) { var ret = { instrumentation: 'node-jscoverage' , sloc: 0 , hits: 0 , misses: 0 , coverage: 0 , files: [] }; for (var filename in cov) { var data = coverage(filename, cov[filename]); ret.files.push(data); ret.hits += data.hits; ret.misses += data.misse...
javascript
function map(cov) { var ret = { instrumentation: 'node-jscoverage' , sloc: 0 , hits: 0 , misses: 0 , coverage: 0 , files: [] }; for (var filename in cov) { var data = coverage(filename, cov[filename]); ret.files.push(data); ret.hits += data.hits; ret.misses += data.misse...
[ "function", "map", "(", "cov", ")", "{", "var", "ret", "=", "{", "instrumentation", ":", "'node-jscoverage'", ",", "sloc", ":", "0", ",", "hits", ":", "0", ",", "misses", ":", "0", ",", "coverage", ":", "0", ",", "files", ":", "[", "]", "}", ";",...
Map jscoverage data to a JSON structure suitable for reporting. @param {Object} cov @return {Object} @api private
[ "Map", "jscoverage", "data", "to", "a", "JSON", "structure", "suitable", "for", "reporting", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L2561-L2588
55,438
bfontaine/tp.js
lib/mocha.js
coverage
function coverage(filename, data) { var ret = { filename: filename, coverage: 0, hits: 0, misses: 0, sloc: 0, source: {} }; data.source.forEach(function(line, num){ num++; if (data[num] === 0) { ret.misses++; ret.sloc++; } else if (data[num] !== undefined) { ...
javascript
function coverage(filename, data) { var ret = { filename: filename, coverage: 0, hits: 0, misses: 0, sloc: 0, source: {} }; data.source.forEach(function(line, num){ num++; if (data[num] === 0) { ret.misses++; ret.sloc++; } else if (data[num] !== undefined) { ...
[ "function", "coverage", "(", "filename", ",", "data", ")", "{", "var", "ret", "=", "{", "filename", ":", "filename", ",", "coverage", ":", "0", ",", "hits", ":", "0", ",", "misses", ":", "0", ",", "sloc", ":", "0", ",", "source", ":", "{", "}", ...
Map jscoverage data for a single source file to a JSON structure suitable for reporting. @param {String} filename name of the source file @param {Object} data jscoverage coverage data @return {Object} @api private
[ "Map", "jscoverage", "data", "for", "a", "single", "source", "file", "to", "a", "JSON", "structure", "suitable", "for", "reporting", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L2600-L2632
55,439
bfontaine/tp.js
lib/mocha.js
TAP
function TAP(runner) { Base.call(this, runner); var self = this , stats = this.stats , n = 1 , passes = 0 , failures = 0; runner.on('start', function(){ var total = runner.grepTotal(runner.suite); console.log('%d..%d', 1, total); }); runner.on('test end', function(){ ++n; }); ...
javascript
function TAP(runner) { Base.call(this, runner); var self = this , stats = this.stats , n = 1 , passes = 0 , failures = 0; runner.on('start', function(){ var total = runner.grepTotal(runner.suite); console.log('%d..%d', 1, total); }); runner.on('test end', function(){ ++n; }); ...
[ "function", "TAP", "(", "runner", ")", "{", "Base", ".", "call", "(", "this", ",", "runner", ")", ";", "var", "self", "=", "this", ",", "stats", "=", "this", ".", "stats", ",", "n", "=", "1", ",", "passes", "=", "0", ",", "failures", "=", "0", ...
Initialize a new `TAP` reporter. @param {Runner} runner @api public
[ "Initialize", "a", "new", "TAP", "reporter", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L3584-L3622
55,440
bfontaine/tp.js
lib/mocha.js
Teamcity
function Teamcity(runner) { Base.call(this, runner); var stats = this.stats; runner.on('start', function() { console.log("##teamcity[testSuiteStarted name='mocha.suite']"); }); runner.on('test', function(test) { console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); }); ...
javascript
function Teamcity(runner) { Base.call(this, runner); var stats = this.stats; runner.on('start', function() { console.log("##teamcity[testSuiteStarted name='mocha.suite']"); }); runner.on('test', function(test) { console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); }); ...
[ "function", "Teamcity", "(", "runner", ")", "{", "Base", ".", "call", "(", "this", ",", "runner", ")", ";", "var", "stats", "=", "this", ".", "stats", ";", "runner", ".", "on", "(", "'start'", ",", "function", "(", ")", "{", "console", ".", "log", ...
Initialize a new `Teamcity` reporter. @param {Runner} runner @api public
[ "Initialize", "a", "new", "Teamcity", "reporter", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L3659-L3686
55,441
bfontaine/tp.js
lib/mocha.js
XUnit
function XUnit(runner) { Base.call(this, runner); var stats = this.stats , tests = [] , self = this; runner.on('pass', function(test){ tests.push(test); }); runner.on('fail', function(test){ tests.push(test); }); runner.on('end', function(){ console.log(tag('testsuite', { ...
javascript
function XUnit(runner) { Base.call(this, runner); var stats = this.stats , tests = [] , self = this; runner.on('pass', function(test){ tests.push(test); }); runner.on('fail', function(test){ tests.push(test); }); runner.on('end', function(){ console.log(tag('testsuite', { ...
[ "function", "XUnit", "(", "runner", ")", "{", "Base", ".", "call", "(", "this", ",", "runner", ")", ";", "var", "stats", "=", "this", ".", "stats", ",", "tests", "=", "[", "]", ",", "self", "=", "this", ";", "runner", ".", "on", "(", "'pass'", ...
Initialize a new `XUnit` reporter. @param {Runner} runner @api public
[ "Initialize", "a", "new", "XUnit", "reporter", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L3740-L3768
55,442
bfontaine/tp.js
lib/mocha.js
Runner
function Runner(suite) { var self = this; this._globals = []; this.suite = suite; this.total = suite.total(); this.failures = 0; this.on('test end', function(test){ self.checkGlobals(test); }); this.on('hook end', function(hook){ self.checkGlobals(hook); }); this.grep(/.*/); this.globals(this.globalPr...
javascript
function Runner(suite) { var self = this; this._globals = []; this.suite = suite; this.total = suite.total(); this.failures = 0; this.on('test end', function(test){ self.checkGlobals(test); }); this.on('hook end', function(hook){ self.checkGlobals(hook); }); this.grep(/.*/); this.globals(this.globalPr...
[ "function", "Runner", "(", "suite", ")", "{", "var", "self", "=", "this", ";", "this", ".", "_globals", "=", "[", "]", ";", "this", ".", "suite", "=", "suite", ";", "this", ".", "total", "=", "suite", ".", "total", "(", ")", ";", "this", ".", "...
Initialize a `Runner` for the given `suite`. Events: - `start` execution started - `end` execution complete - `suite` (suite) test suite execution started - `suite end` (suite) all tests (and sub-suites) have finished - `test` (test) test execution started - `test end` (test) test completed - `hook` (hook) hoo...
[ "Initialize", "a", "Runner", "for", "the", "given", "suite", "." ]
dad7cb0f5398b1afcbc481f87c0b59c7131a49ed
https://github.com/bfontaine/tp.js/blob/dad7cb0f5398b1afcbc481f87c0b59c7131a49ed/lib/mocha.js#L4109-L4119
55,443
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/htmlparser/comment.js
function( filter, context ) { var comment = this.value; if ( !( comment = filter.onComment( context, comment, this ) ) ) { this.remove(); return false; } if ( typeof comment != 'string' ) { this.replaceWith( comment ); return false; } this.value = comment; return true; }
javascript
function( filter, context ) { var comment = this.value; if ( !( comment = filter.onComment( context, comment, this ) ) ) { this.remove(); return false; } if ( typeof comment != 'string' ) { this.replaceWith( comment ); return false; } this.value = comment; return true; }
[ "function", "(", "filter", ",", "context", ")", "{", "var", "comment", "=", "this", ".", "value", ";", "if", "(", "!", "(", "comment", "=", "filter", ".", "onComment", "(", "context", ",", "comment", ",", "this", ")", ")", ")", "{", "this", ".", ...
Filter this comment with given filter. @since 4.1 @param {CKEDITOR.htmlParser.filter} filter @returns {Boolean} Method returns `false` when this comment has been removed or replaced with other node. This is an information for {@link CKEDITOR.htmlParser.element#filterChildren} that it has to repeat filter on current po...
[ "Filter", "this", "comment", "with", "given", "filter", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/htmlparser/comment.js#L49-L65
55,444
techhead/mmm
mmm.js
getExistsSync
function getExistsSync(path, exts) { for (var i=0,len=exts.length; i<len; i++) { if (fs.existsSync(path + exts[i])) { return path + exts[i]; } } return false; }
javascript
function getExistsSync(path, exts) { for (var i=0,len=exts.length; i<len; i++) { if (fs.existsSync(path + exts[i])) { return path + exts[i]; } } return false; }
[ "function", "getExistsSync", "(", "path", ",", "exts", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "exts", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "fs", ".", "existsSync", "(", "path", "+", "...
Takes a path and array of file extensions and returns the first path + extension that exists or returns false.
[ "Takes", "a", "path", "and", "array", "of", "file", "extensions", "and", "returns", "the", "first", "path", "+", "extension", "that", "exists", "or", "returns", "false", "." ]
0ba6fd37cf542e2b48a35f57eff36d3ceff3ef46
https://github.com/techhead/mmm/blob/0ba6fd37cf542e2b48a35f57eff36d3ceff3ef46/mmm.js#L75-L82
55,445
techhead/mmm
mmm.js
extend
function extend(a,b) { var c = clone(a); for (var key in b) { c[key] = b[key]; } return c; }
javascript
function extend(a,b) { var c = clone(a); for (var key in b) { c[key] = b[key]; } return c; }
[ "function", "extend", "(", "a", ",", "b", ")", "{", "var", "c", "=", "clone", "(", "a", ")", ";", "for", "(", "var", "key", "in", "b", ")", "{", "c", "[", "key", "]", "=", "b", "[", "key", "]", ";", "}", "return", "c", ";", "}" ]
Return a new object that inherits from `a` and also contains the properties of `b`.
[ "Return", "a", "new", "object", "that", "inherits", "from", "a", "and", "also", "contains", "the", "properties", "of", "b", "." ]
0ba6fd37cf542e2b48a35f57eff36d3ceff3ef46
https://github.com/techhead/mmm/blob/0ba6fd37cf542e2b48a35f57eff36d3ceff3ef46/mmm.js#L129-L135
55,446
dominikwilkowski/grunt-wakeup
tasks/wakeup.js
randomize
function randomize( obj ) { var j = 0, i = Math.floor(Math.random() * (Object.keys(obj).length)), result; for(var property in obj) { if(j === i) { result = property; break; } j++; } return result; }
javascript
function randomize( obj ) { var j = 0, i = Math.floor(Math.random() * (Object.keys(obj).length)), result; for(var property in obj) { if(j === i) { result = property; break; } j++; } return result; }
[ "function", "randomize", "(", "obj", ")", "{", "var", "j", "=", "0", ",", "i", "=", "Math", ".", "floor", "(", "Math", ".", "random", "(", ")", "*", "(", "Object", ".", "keys", "(", "obj", ")", ".", "length", ")", ")", ",", "result", ";", "fo...
get random value off of an object
[ "get", "random", "value", "off", "of", "an", "object" ]
0558a2853316630b2793215fe5dd560abbac045a
https://github.com/dominikwilkowski/grunt-wakeup/blob/0558a2853316630b2793215fe5dd560abbac045a/tasks/wakeup.js#L18-L33
55,447
beyo/events
lib/events.js
_createEventRangeValidator
function _createEventRangeValidator(range) { var ctxRange = _createRangeArray(range); return function rangeValidator(range) { var leftIndex = 0; var rightIndex = 0; var left; var right; for (; leftIndex < ctxRange.length && rightIndex < range.length; ) { left = ctxRange[leftIndex]; ...
javascript
function _createEventRangeValidator(range) { var ctxRange = _createRangeArray(range); return function rangeValidator(range) { var leftIndex = 0; var rightIndex = 0; var left; var right; for (; leftIndex < ctxRange.length && rightIndex < range.length; ) { left = ctxRange[leftIndex]; ...
[ "function", "_createEventRangeValidator", "(", "range", ")", "{", "var", "ctxRange", "=", "_createRangeArray", "(", "range", ")", ";", "return", "function", "rangeValidator", "(", "range", ")", "{", "var", "leftIndex", "=", "0", ";", "var", "rightIndex", "=", ...
Create a range validator. The returned value is a function validating if a given range matches this range
[ "Create", "a", "range", "validator", ".", "The", "returned", "value", "is", "a", "function", "validating", "if", "a", "given", "range", "matches", "this", "range" ]
a5d82b1e3dc5cff012ec15dd0bf0a593ce316bf6
https://github.com/beyo/events/blob/a5d82b1e3dc5cff012ec15dd0bf0a593ce316bf6/lib/events.js#L258-L284
55,448
tgolen/skelenode-swagger
respond.js
sendSPrintFError
function sendSPrintFError(res, errorArray, code, internalCode) { var obj = { success: false }; obj[res ? 'description' : 'reason'] = errorArray; return sendError(res, obj, code, internalCode); }
javascript
function sendSPrintFError(res, errorArray, code, internalCode) { var obj = { success: false }; obj[res ? 'description' : 'reason'] = errorArray; return sendError(res, obj, code, internalCode); }
[ "function", "sendSPrintFError", "(", "res", ",", "errorArray", ",", "code", ",", "internalCode", ")", "{", "var", "obj", "=", "{", "success", ":", "false", "}", ";", "obj", "[", "res", "?", "'description'", ":", "'reason'", "]", "=", "errorArray", ";", ...
Sends a SPrintF formatted error to the user. Otherwise, behaves the same as sendStringError. @param res Optional Express Response object. @param errorArray The first element should be a string; subsequent args are formatted in to the first string. @param code The HTTP Status code to send (like 404, 403, etc). @param in...
[ "Sends", "a", "SPrintF", "formatted", "error", "to", "the", "user", ".", "Otherwise", "behaves", "the", "same", "as", "sendStringError", "." ]
9b8caa81d32b492b26d1bec34ce49ab015afd8bd
https://github.com/tgolen/skelenode-swagger/blob/9b8caa81d32b492b26d1bec34ce49ab015afd8bd/respond.js#L128-L132
55,449
tgolen/skelenode-swagger
respond.js
sendStringError
function sendStringError(res, error, code, internalCode) { var obj = { success: false }; obj[res ? 'description' : 'reason'] = error; return sendError(res, obj, code, internalCode); }
javascript
function sendStringError(res, error, code, internalCode) { var obj = { success: false }; obj[res ? 'description' : 'reason'] = error; return sendError(res, obj, code, internalCode); }
[ "function", "sendStringError", "(", "res", ",", "error", ",", "code", ",", "internalCode", ")", "{", "var", "obj", "=", "{", "success", ":", "false", "}", ";", "obj", "[", "res", "?", "'description'", ":", "'reason'", "]", "=", "error", ";", "return", ...
Sends a string error to the user. Attempts to localize it. @param res Optional Express Response object. @param error The error to send to the user. If it's a string, it will be localized. @param code The HTTP Status code to send (like 404, 403, etc). @param internalCode An optional internal code to also send to the cli...
[ "Sends", "a", "string", "error", "to", "the", "user", ".", "Attempts", "to", "localize", "it", "." ]
9b8caa81d32b492b26d1bec34ce49ab015afd8bd
https://github.com/tgolen/skelenode-swagger/blob/9b8caa81d32b492b26d1bec34ce49ab015afd8bd/respond.js#L141-L145
55,450
TempoIQ/tempoiq-node-js
lib/models/device.js
Device
function Device(key, params) { var p = params || {}; // The primary key of the device [String] this.key = key; // Human readable name of the device [String] EG - "My Device" this.name = p.name || ""; // Indexable attributes. Useful for grouping related Devices. // EG - {location: '445-w-Erie', model: 'T...
javascript
function Device(key, params) { var p = params || {}; // The primary key of the device [String] this.key = key; // Human readable name of the device [String] EG - "My Device" this.name = p.name || ""; // Indexable attributes. Useful for grouping related Devices. // EG - {location: '445-w-Erie', model: 'T...
[ "function", "Device", "(", "key", ",", "params", ")", "{", "var", "p", "=", "params", "||", "{", "}", ";", "// The primary key of the device [String]", "this", ".", "key", "=", "key", ";", "// Human readable name of the device [String] EG - \"My Device\"", "this", "...
The top level container for a group of sensors.
[ "The", "top", "level", "container", "for", "a", "group", "of", "sensors", "." ]
b3ab72f9d7760a54df9ef75093d349b28a29864c
https://github.com/TempoIQ/tempoiq-node-js/blob/b3ab72f9d7760a54df9ef75093d349b28a29864c/lib/models/device.js#L4-L16
55,451
benzhou1/iod
lib/send.js
function(err, httpRes, body) { if (err) _callback(err) else { try { var res = JSON.parse(body) } catch(err) { _callback(null, body) } if (httpRes && httpRes.statusCode !== 200) { maybeRetry(res, IOD, IODOpts, apiType, _callback) } else _callback(null, res) } }
javascript
function(err, httpRes, body) { if (err) _callback(err) else { try { var res = JSON.parse(body) } catch(err) { _callback(null, body) } if (httpRes && httpRes.statusCode !== 200) { maybeRetry(res, IOD, IODOpts, apiType, _callback) } else _callback(null, res) } }
[ "function", "(", "err", ",", "httpRes", ",", "body", ")", "{", "if", "(", "err", ")", "_callback", "(", "err", ")", "else", "{", "try", "{", "var", "res", "=", "JSON", ".", "parse", "(", "body", ")", "}", "catch", "(", "err", ")", "{", "_callba...
Callback for handling request. Errors if response from IOD server is not 200. Attempts to JSON parse response body on success, returns original body if fail to parse. @param {*} err - Request error @param {Object} httpRes - Request http response object @param {*} body - Request body
[ "Callback", "for", "handling", "request", ".", "Errors", "if", "response", "from", "IOD", "server", "is", "not", "200", ".", "Attempts", "to", "JSON", "parse", "response", "body", "on", "success", "returns", "original", "body", "if", "fail", "to", "parse", ...
a346628f9bc5e4420e4d00e8f21c4cb268b6237c
https://github.com/benzhou1/iod/blob/a346628f9bc5e4420e4d00e8f21c4cb268b6237c/lib/send.js#L48-L59
55,452
benzhou1/iod
lib/send.js
maybeRetry
function maybeRetry(err, IOD, IODOpts, apiType, callback) { var retryApiReq = apiType !== IOD.TYPES.SYNC && apiType !== IOD.TYPES.RESULT && apiType !== IOD.TYPES.DISCOVERY if (IODOpts.retries == null || retryApiReq) callback(err) else if (!--IODOpts.retries) callback(err) var reqTypeDontRetry = apiType !== IO...
javascript
function maybeRetry(err, IOD, IODOpts, apiType, callback) { var retryApiReq = apiType !== IOD.TYPES.SYNC && apiType !== IOD.TYPES.RESULT && apiType !== IOD.TYPES.DISCOVERY if (IODOpts.retries == null || retryApiReq) callback(err) else if (!--IODOpts.retries) callback(err) var reqTypeDontRetry = apiType !== IO...
[ "function", "maybeRetry", "(", "err", ",", "IOD", ",", "IODOpts", ",", "apiType", ",", "callback", ")", "{", "var", "retryApiReq", "=", "apiType", "!==", "IOD", ".", "TYPES", ".", "SYNC", "&&", "apiType", "!==", "IOD", ".", "TYPES", ".", "RESULT", "&&"...
If retries is specified on `IODOpts` and is greater than one, retry request if it is either a Backend failure or time out. @param {*} err - Error @param {IOD} IOD - IOD object @param {Object} IODOpts - IOD options @param {String} apiType - Api type @param {Function} callback - callback(err | res)
[ "If", "retries", "is", "specified", "on", "IODOpts", "and", "is", "greater", "than", "one", "retry", "request", "if", "it", "is", "either", "a", "Backend", "failure", "or", "time", "out", "." ]
a346628f9bc5e4420e4d00e8f21c4cb268b6237c
https://github.com/benzhou1/iod/blob/a346628f9bc5e4420e4d00e8f21c4cb268b6237c/lib/send.js#L91-L114
55,453
benzhou1/iod
lib/send.js
makeOptions
function makeOptions(IOD, IODOpts, apiType, reqOpts) { var path = IodU.makePath(IOD, IODOpts, apiType) var method = apiType === IOD.TYPES.JOB || !_.isEmpty(IODOpts.files) ? 'post' : IODOpts.method.toLowerCase() return _.defaults({ url: IOD.host + ':' + IOD.port + path, path: path, method: method, // For ...
javascript
function makeOptions(IOD, IODOpts, apiType, reqOpts) { var path = IodU.makePath(IOD, IODOpts, apiType) var method = apiType === IOD.TYPES.JOB || !_.isEmpty(IODOpts.files) ? 'post' : IODOpts.method.toLowerCase() return _.defaults({ url: IOD.host + ':' + IOD.port + path, path: path, method: method, // For ...
[ "function", "makeOptions", "(", "IOD", ",", "IODOpts", ",", "apiType", ",", "reqOpts", ")", "{", "var", "path", "=", "IodU", ".", "makePath", "(", "IOD", ",", "IODOpts", ",", "apiType", ")", "var", "method", "=", "apiType", "===", "IOD", ".", "TYPES", ...
Creates a request options object with. @param {IOD} IOD - IOD object @param {Object} IODOpts - IOD options @param {String} apiType - IOD request type @param {Object} reqOpts - Request options for current request @returns {Object} Request options object
[ "Creates", "a", "request", "options", "object", "with", "." ]
a346628f9bc5e4420e4d00e8f21c4cb268b6237c
https://github.com/benzhou1/iod/blob/a346628f9bc5e4420e4d00e8f21c4cb268b6237c/lib/send.js#L125-L143
55,454
benzhou1/iod
lib/send.js
addParamsToData
function addParamsToData(IOD, IODOpts, form) { form.append('apiKey', IOD.apiKey) _.each(exports.prepareParams(IODOpts.params), function(paramVal, paramName) { _.each(T.maybeToArray(paramVal), function(val) { form.append(paramName, val) }) }) }
javascript
function addParamsToData(IOD, IODOpts, form) { form.append('apiKey', IOD.apiKey) _.each(exports.prepareParams(IODOpts.params), function(paramVal, paramName) { _.each(T.maybeToArray(paramVal), function(val) { form.append(paramName, val) }) }) }
[ "function", "addParamsToData", "(", "IOD", ",", "IODOpts", ",", "form", ")", "{", "form", ".", "append", "(", "'apiKey'", ",", "IOD", ".", "apiKey", ")", "_", ".", "each", "(", "exports", ".", "prepareParams", "(", "IODOpts", ".", "params", ")", ",", ...
Add parameters to FormData object. Automatically append api key. Modifies `IODOpts` in place. @param {IOD} IOD - IOD object @param {Object} IODOpts - IOD options @param {FormData} form - FormData object
[ "Add", "parameters", "to", "FormData", "object", ".", "Automatically", "append", "api", "key", "." ]
a346628f9bc5e4420e4d00e8f21c4cb268b6237c
https://github.com/benzhou1/iod/blob/a346628f9bc5e4420e4d00e8f21c4cb268b6237c/lib/send.js#L155-L163
55,455
benzhou1/iod
lib/send.js
addFilesToData
function addFilesToData(IOD, IODOpts, apiType, form) { _.each(T.maybeToArray(IODOpts.files), function(file) { if (apiType === IOD.TYPES.JOB) { form.append(file.name, fs.createReadStream(file.path)) } else form.append('file', fs.createReadStream(file)) }) }
javascript
function addFilesToData(IOD, IODOpts, apiType, form) { _.each(T.maybeToArray(IODOpts.files), function(file) { if (apiType === IOD.TYPES.JOB) { form.append(file.name, fs.createReadStream(file.path)) } else form.append('file', fs.createReadStream(file)) }) }
[ "function", "addFilesToData", "(", "IOD", ",", "IODOpts", ",", "apiType", ",", "form", ")", "{", "_", ".", "each", "(", "T", ".", "maybeToArray", "(", "IODOpts", ".", "files", ")", ",", "function", "(", "file", ")", "{", "if", "(", "apiType", "===", ...
Add files to FormData object. Modifies `IODOpts` in place. @param {IOD} IOD - IOD object @param {Object} IODOpts - IOD options @param {String} apiType - IOD request type @param {FormData} form - FormData object
[ "Add", "files", "to", "FormData", "object", "." ]
a346628f9bc5e4420e4d00e8f21c4cb268b6237c
https://github.com/benzhou1/iod/blob/a346628f9bc5e4420e4d00e8f21c4cb268b6237c/lib/send.js#L175-L182
55,456
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/fakeobjects/plugin.js
replaceCssLength
function replaceCssLength( length1, length2 ) { var parts1 = cssLengthRegex.exec( length1 ), parts2 = cssLengthRegex.exec( length2 ); // Omit pixel length unit when necessary, // e.g. replaceCssLength( 10, '20px' ) -> 20 if ( parts1 ) { if ( !parts1[ 2 ] && parts2[ 2 ] == 'px' ) return parts2...
javascript
function replaceCssLength( length1, length2 ) { var parts1 = cssLengthRegex.exec( length1 ), parts2 = cssLengthRegex.exec( length2 ); // Omit pixel length unit when necessary, // e.g. replaceCssLength( 10, '20px' ) -> 20 if ( parts1 ) { if ( !parts1[ 2 ] && parts2[ 2 ] == 'px' ) return parts2...
[ "function", "replaceCssLength", "(", "length1", ",", "length2", ")", "{", "var", "parts1", "=", "cssLengthRegex", ".", "exec", "(", "length1", ")", ",", "parts2", "=", "cssLengthRegex", ".", "exec", "(", "length2", ")", ";", "// Omit pixel length unit when neces...
Replacing the former CSS length value with the later one, with adjustment to the length unit.
[ "Replacing", "the", "former", "CSS", "length", "value", "with", "the", "later", "one", "with", "adjustment", "to", "the", "length", "unit", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/fakeobjects/plugin.js#L14-L28
55,457
phated/grunt-enyo
tasks/init/enyo/root/enyo/source/kernel/UiComponent.js
function() { var results = []; for (var i=0, cs=this.controls, c; c=cs[i]; i++) { if (!c.isChrome) { results.push(c); } } return results; }
javascript
function() { var results = []; for (var i=0, cs=this.controls, c; c=cs[i]; i++) { if (!c.isChrome) { results.push(c); } } return results; }
[ "function", "(", ")", "{", "var", "results", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "cs", "=", "this", ".", "controls", ",", "c", ";", "c", "=", "cs", "[", "i", "]", ";", "i", "++", ")", "{", "if", "(", "!", "c", "."...
Returns all non-chrome controls.
[ "Returns", "all", "non", "-", "chrome", "controls", "." ]
d2990ee4cd85eea8db4108c43086c6d8c3c90c30
https://github.com/phated/grunt-enyo/blob/d2990ee4cd85eea8db4108c43086c6d8c3c90c30/tasks/init/enyo/root/enyo/source/kernel/UiComponent.js#L121-L129
55,458
phated/grunt-enyo
tasks/init/enyo/root/enyo/source/kernel/UiComponent.js
function() { var c$ = this.getClientControls(); for (var i=0, c; c=c$[i]; i++) { c.destroy(); } }
javascript
function() { var c$ = this.getClientControls(); for (var i=0, c; c=c$[i]; i++) { c.destroy(); } }
[ "function", "(", ")", "{", "var", "c$", "=", "this", ".", "getClientControls", "(", ")", ";", "for", "(", "var", "i", "=", "0", ",", "c", ";", "c", "=", "c$", "[", "i", "]", ";", "i", "++", ")", "{", "c", ".", "destroy", "(", ")", ";", "}...
Destroys "client controls", the same set of controls returned by _getClientControls_.
[ "Destroys", "client", "controls", "the", "same", "set", "of", "controls", "returned", "by", "_getClientControls_", "." ]
d2990ee4cd85eea8db4108c43086c6d8c3c90c30
https://github.com/phated/grunt-enyo/blob/d2990ee4cd85eea8db4108c43086c6d8c3c90c30/tasks/init/enyo/root/enyo/source/kernel/UiComponent.js#L134-L139
55,459
phated/grunt-enyo
tasks/init/enyo/root/enyo/source/kernel/UiComponent.js
function(inMessage, inPayload, inSender) { // Note: Controls will generally be both in a $ hash and a child list somewhere. // Attempt to avoid duplicated messages by sending only to components that are not // UiComponent, as those components are guaranteed not to be in a child list. // May cause a problem if t...
javascript
function(inMessage, inPayload, inSender) { // Note: Controls will generally be both in a $ hash and a child list somewhere. // Attempt to avoid duplicated messages by sending only to components that are not // UiComponent, as those components are guaranteed not to be in a child list. // May cause a problem if t...
[ "function", "(", "inMessage", ",", "inPayload", ",", "inSender", ")", "{", "// Note: Controls will generally be both in a $ hash and a child list somewhere.", "// Attempt to avoid duplicated messages by sending only to components that are not", "// UiComponent, as those components are guarante...
Sends a message to all my descendents.
[ "Sends", "a", "message", "to", "all", "my", "descendents", "." ]
d2990ee4cd85eea8db4108c43086c6d8c3c90c30
https://github.com/phated/grunt-enyo/blob/d2990ee4cd85eea8db4108c43086c6d8c3c90c30/tasks/init/enyo/root/enyo/source/kernel/UiComponent.js#L246-L269
55,460
yanni4night/grunt-web-stamp
tasks/stamp.js
function(path, stamp) { var name = sysPath.basename(path); var ext = sysPath.extname(name); var stub = path.slice(0, name ? (-name.length) : path.length - 1); if (ext.length) { name = name.slice(0, -ext.length); } //Ignore leading dot if ('.' === ext[0]...
javascript
function(path, stamp) { var name = sysPath.basename(path); var ext = sysPath.extname(name); var stub = path.slice(0, name ? (-name.length) : path.length - 1); if (ext.length) { name = name.slice(0, -ext.length); } //Ignore leading dot if ('.' === ext[0]...
[ "function", "(", "path", ",", "stamp", ")", "{", "var", "name", "=", "sysPath", ".", "basename", "(", "path", ")", ";", "var", "ext", "=", "sysPath", ".", "extname", "(", "name", ")", ";", "var", "stub", "=", "path", ".", "slice", "(", "0", ",", ...
Merge stamp into filename @param {String} path @param {String} stamp
[ "Merge", "stamp", "into", "filename" ]
e7040f9c7ebe5ac29be72790297019d417ba9fc7
https://github.com/yanni4night/grunt-web-stamp/blob/e7040f9c7ebe5ac29be72790297019d417ba9fc7/tasks/stamp.js#L93-L107
55,461
timkuijsten/node-bcrypt-user
index.js
User
function User(db, username, opts) { if (typeof db !== 'object') { throw new TypeError('db must be an object'); } if (typeof username !== 'string') { throw new TypeError('username must be a string'); } opts = opts || {}; if (typeof opts !== 'object') { throw new TypeError('opts must be an object'); } var rea...
javascript
function User(db, username, opts) { if (typeof db !== 'object') { throw new TypeError('db must be an object'); } if (typeof username !== 'string') { throw new TypeError('username must be a string'); } opts = opts || {}; if (typeof opts !== 'object') { throw new TypeError('opts must be an object'); } var rea...
[ "function", "User", "(", "db", ",", "username", ",", "opts", ")", "{", "if", "(", "typeof", "db", "!==", "'object'", ")", "{", "throw", "new", "TypeError", "(", "'db must be an object'", ")", ";", "}", "if", "(", "typeof", "username", "!==", "'string'", ...
Create a new User object. Either for maintenance, verification or registration. A user may be bound to a realm. @param {Object} db object that implements find, updateHash and insert methods @param {String} username the name of the user to bind this instance to @param {Object} [opts] object containing optional param...
[ "Create", "a", "new", "User", "object", ".", "Either", "for", "maintenance", "verification", "or", "registration", ".", "A", "user", "may", "be", "bound", "to", "a", "realm", "." ]
bd39885107d5bb4b95a70d4983e893f9a1f5ff8a
https://github.com/timkuijsten/node-bcrypt-user/blob/bd39885107d5bb4b95a70d4983e893f9a1f5ff8a/index.js#L58-L100
55,462
lastboy/require-mapper
src/Mapper.js
function(data) { var map = _map, key; if (map && data) { for (key in data) { if (key && data.hasOwnProperty(key)) { _map[key] = data[key]; } } } }
javascript
function(data) { var map = _map, key; if (map && data) { for (key in data) { if (key && data.hasOwnProperty(key)) { _map[key] = data[key]; } } } }
[ "function", "(", "data", ")", "{", "var", "map", "=", "_map", ",", "key", ";", "if", "(", "map", "&&", "data", ")", "{", "for", "(", "key", "in", "data", ")", "{", "if", "(", "key", "&&", "data", ".", "hasOwnProperty", "(", "key", ")", ")", "...
Set the data to the mapper Behaves like a Map object, if the key already exists the last will override the existing @param data
[ "Set", "the", "data", "to", "the", "mapper" ]
201d047d2aade143e64d96b2a7bfddf2b52298fb
https://github.com/lastboy/require-mapper/blob/201d047d2aade143e64d96b2a7bfddf2b52298fb/src/Mapper.js#L83-L96
55,463
esatterwhite/skyring-scylladown
lib/index.js
ScyllaDown
function ScyllaDown(location) { if (!(this instanceof ScyllaDown)) return new ScyllaDown(location) AbstractLevelDOWN.call(this, location) this.keyspace = null this.client = null this.table = slugify(location) this[kQuery] = { insert: null , update: null , get: null , del: null } }
javascript
function ScyllaDown(location) { if (!(this instanceof ScyllaDown)) return new ScyllaDown(location) AbstractLevelDOWN.call(this, location) this.keyspace = null this.client = null this.table = slugify(location) this[kQuery] = { insert: null , update: null , get: null , del: null } }
[ "function", "ScyllaDown", "(", "location", ")", "{", "if", "(", "!", "(", "this", "instanceof", "ScyllaDown", ")", ")", "return", "new", "ScyllaDown", "(", "location", ")", "AbstractLevelDOWN", ".", "call", "(", "this", ",", "location", ")", "this", ".", ...
ScyllaDB Leveldown backend for levelup @class ScyllaDown @extends AbstractLevelDOWN @alias module:@skyring/scylladown @params {String} location The name of a the database table the db instance is responsible for
[ "ScyllaDB", "Leveldown", "backend", "for", "levelup" ]
c51ea78a21db4da05314c2f5216e005a420feec8
https://github.com/esatterwhite/skyring-scylladown/blob/c51ea78a21db4da05314c2f5216e005a420feec8/lib/index.js#L52-L66
55,464
peteward44/git-svn-interface
lib/git.js
executeGit
function executeGit( args, options ) { options = options || {}; return new Promise( function( resolve, reject ) { var stdo = ''; var proc = doSpawn( 'git', args, { cwd: options.cwd ? options.cwd : process.cwd(), stdio: [ 'ignore', 'pipe', 'ignore' ] } ); function unpipe() { } if ( options.captureStdout ) ...
javascript
function executeGit( args, options ) { options = options || {}; return new Promise( function( resolve, reject ) { var stdo = ''; var proc = doSpawn( 'git', args, { cwd: options.cwd ? options.cwd : process.cwd(), stdio: [ 'ignore', 'pipe', 'ignore' ] } ); function unpipe() { } if ( options.captureStdout ) ...
[ "function", "executeGit", "(", "args", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "return", "new", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "var", "stdo", "=", "''", ";", "var", "proc", "=", ...
used if the git library doesn't support what we need to do
[ "used", "if", "the", "git", "library", "doesn", "t", "support", "what", "we", "need", "to", "do" ]
16a874912fdfd69654d1d84a22d2e3838ea2ae8a
https://github.com/peteward44/git-svn-interface/blob/16a874912fdfd69654d1d84a22d2e3838ea2ae8a/lib/git.js#L29-L67
55,465
tgideas/grunt-motion-build
tasks/motion_build.js
function(filepath, data){ filepath = [].concat(filepath); var buf=[].concat(filepath); function parse(fileId, refUri, data) { var filepath = id2Uri(fileId, refUri, data); if(!grunt.file.exists(filepath)){ //file not found grunt.log.warn('Source file "' + filepath + '" not fou...
javascript
function(filepath, data){ filepath = [].concat(filepath); var buf=[].concat(filepath); function parse(fileId, refUri, data) { var filepath = id2Uri(fileId, refUri, data); if(!grunt.file.exists(filepath)){ //file not found grunt.log.warn('Source file "' + filepath + '" not fou...
[ "function", "(", "filepath", ",", "data", ")", "{", "filepath", "=", "[", "]", ".", "concat", "(", "filepath", ")", ";", "var", "buf", "=", "[", "]", ".", "concat", "(", "filepath", ")", ";", "function", "parse", "(", "fileId", ",", "refUri", ",", ...
get all dependencies by one file path @param {String} filepath file path @return {Array} dependencies list
[ "get", "all", "dependencies", "by", "one", "file", "path" ]
57d9b2a8725ae22c98f7150cae9a85badbd2c9cb
https://github.com/tgideas/grunt-motion-build/blob/57d9b2a8725ae22c98f7150cae9a85badbd2c9cb/tasks/motion_build.js#L197-L230
55,466
genjs/gutil
lib/util/and.js
and
function and(values, values2) { var results = []; if(values instanceof Array) { for(var i=0; i<values.length; i++) { results.push(values[i]); } } if(values2 instanceof Array) { for(var i=0; i<values2.length; i++) { results.push(values2[i]); } }...
javascript
function and(values, values2) { var results = []; if(values instanceof Array) { for(var i=0; i<values.length; i++) { results.push(values[i]); } } if(values2 instanceof Array) { for(var i=0; i<values2.length; i++) { results.push(values2[i]); } }...
[ "function", "and", "(", "values", ",", "values2", ")", "{", "var", "results", "=", "[", "]", ";", "if", "(", "values", "instanceof", "Array", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")...
Merge two arrays. @param values array 1 @param values2 array 2 @returns {Array}
[ "Merge", "two", "arrays", "." ]
c2890fdd030bb9f0cad9f5c7c9da442411c3903a
https://github.com/genjs/gutil/blob/c2890fdd030bb9f0cad9f5c7c9da442411c3903a/lib/util/and.js#L7-L20
55,467
david4096/ga4gh-node-gateway
src/rpc.js
getMethod
function getMethod(methodname) { if (controllers[methodname]) { return function(call, callback) { console.log(call); return controllers[methodname](call, callback); }; } else { return function(call, callback) { // By default we print an empty response. callback(null, {}); }; ...
javascript
function getMethod(methodname) { if (controllers[methodname]) { return function(call, callback) { console.log(call); return controllers[methodname](call, callback); }; } else { return function(call, callback) { // By default we print an empty response. callback(null, {}); }; ...
[ "function", "getMethod", "(", "methodname", ")", "{", "if", "(", "controllers", "[", "methodname", "]", ")", "{", "return", "function", "(", "call", ",", "callback", ")", "{", "console", ".", "log", "(", "call", ")", ";", "return", "controllers", "[", ...
Allows us to define methods as we go and hook them up by name to the schemas. It should be possible to determine if a method is streaming or not and get it from a different controller. No maintaining key-value maps!
[ "Allows", "us", "to", "define", "methods", "as", "we", "go", "and", "hook", "them", "up", "by", "name", "to", "the", "schemas", ".", "It", "should", "be", "possible", "to", "determine", "if", "a", "method", "is", "streaming", "or", "not", "and", "get",...
3864c10503c9273ea2697d1754bef775ec6ad536
https://github.com/david4096/ga4gh-node-gateway/blob/3864c10503c9273ea2697d1754bef775ec6ad536/src/rpc.js#L12-L24
55,468
MaiaVictor/dattata
Vector3.js
scale
function scale(s, v){ return Vector3(v.x*s, v.y*s, v.z*s); }
javascript
function scale(s, v){ return Vector3(v.x*s, v.y*s, v.z*s); }
[ "function", "scale", "(", "s", ",", "v", ")", "{", "return", "Vector3", "(", "v", ".", "x", "*", "s", ",", "v", ".", "y", "*", "s", ",", "v", ".", "z", "*", "s", ")", ";", "}" ]
Double, Vector -> Vector
[ "Double", "Vector", "-", ">", "Vector" ]
890d83b89b7193ce8863bb9ac9b296b3510e8db9
https://github.com/MaiaVictor/dattata/blob/890d83b89b7193ce8863bb9ac9b296b3510e8db9/Vector3.js#L44-L46
55,469
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList, contentHtml ) { if ( arguments.length < 4 ) return; var _ = initPrivateObject.call( this, elementDefinition ); _.labelId = CKEDITOR.tools.getNextId() + '_label'; var children = this._.children = []; var innerHTML = function() { var...
javascript
function( dialog, elementDefinition, htmlList, contentHtml ) { if ( arguments.length < 4 ) return; var _ = initPrivateObject.call( this, elementDefinition ); _.labelId = CKEDITOR.tools.getNextId() + '_label'; var children = this._.children = []; var innerHTML = function() { var...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ",", "contentHtml", ")", "{", "if", "(", "arguments", ".", "length", "<", "4", ")", "return", ";", "var", "_", "=", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition...
Base class for all dialog window elements with a textual label on the left. @class CKEDITOR.ui.dialog.labeledElement @extends CKEDITOR.ui.dialog.uiElement @constructor Creates a labeledElement class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} ele...
[ "Base", "class", "for", "all", "dialog", "window", "elements", "with", "a", "textual", "label", "on", "the", "left", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L125-L181
55,470
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput', attributes = { 'class': 'cke_dialog_ui_input_' + elementDefinition.type, id: domId...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput', attributes = { 'class': 'cke_dialog_ui_input_' + elementDefinition.type, id: domId...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ")", ";", "var", "domId", "=", "...
A text input with a label. This UI element class represents both the single-line text inputs and password inputs in dialog boxes. @class CKEDITOR.ui.dialog.textInput @extends CKEDITOR.ui.dialog.labeledElement @constructor Creates a textInput class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. ...
[ "A", "text", "input", "with", "a", "label", ".", "This", "UI", "element", "class", "represents", "both", "the", "single", "-", "line", "text", "inputs", "and", "password", "inputs", "in", "dialog", "boxes", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L202-L262
55,471
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); var me = this, domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea', attributes = {}; if ( elementDefinition.validate ) th...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); var me = this, domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea', attributes = {}; if ( elementDefinition.validate ) th...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ")", ";", "var", "me", "=", "thi...
A text area with a label at the top or on the left. @class CKEDITOR.ui.dialog.textarea @extends CKEDITOR.ui.dialog.labeledElement @constructor Creates a textarea class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element def...
[ "A", "text", "area", "with", "a", "label", "at", "the", "top", "or", "on", "the", "left", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L284-L318
55,472
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition, { 'default': !!elementDefinition[ 'default' ] } ); if ( elementDefinition.validate ) this.validate = elementDefinition.validate; var innerH...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition, { 'default': !!elementDefinition[ 'default' ] } ); if ( elementDefinition.validate ) this.validate = elementDefinition.validate; var innerH...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "var", "_", "=", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ",", "{", "'def...
A single checkbox with a label on the right. @class CKEDITOR.ui.dialog.checkbox @extends CKEDITOR.ui.dialog.uiElement @constructor Creates a checkbox class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element definition. Acce...
[ "A", "single", "checkbox", "with", "a", "label", "on", "the", "right", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L337-L367
55,473
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); if ( !this._[ 'default' ] ) this._[ 'default' ] = this._.initValue = elementDefinition.items[ 0 ][ 1 ]; if ( elementDefinition.validate ) t...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; initPrivateObject.call( this, elementDefinition ); if ( !this._[ 'default' ] ) this._[ 'default' ] = this._.initValue = elementDefinition.items[ 0 ][ 1 ]; if ( elementDefinition.validate ) t...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ")", ";", "if", "(", "!", "this"...
A group of radio buttons. @class CKEDITOR.ui.dialog.radio @extends CKEDITOR.ui.dialog.labeledElement @constructor Creates a radio class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element definition. Accepted fields: * `def...
[ "A", "group", "of", "radio", "buttons", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L387-L469
55,474
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( !arguments.length ) return; if ( typeof elementDefinition == 'function' ) elementDefinition = elementDefinition( dialog.getParentEditor() ); initPrivateObject.call( this, elementDefinition, { disabled: elementDefinition.disabled || fa...
javascript
function( dialog, elementDefinition, htmlList ) { if ( !arguments.length ) return; if ( typeof elementDefinition == 'function' ) elementDefinition = elementDefinition( dialog.getParentEditor() ); initPrivateObject.call( this, elementDefinition, { disabled: elementDefinition.disabled || fa...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "!", "arguments", ".", "length", ")", "return", ";", "if", "(", "typeof", "elementDefinition", "==", "'function'", ")", "elementDefinition", "=", "elementDefinition", "(...
A button with a label inside. @class CKEDITOR.ui.dialog.button @extends CKEDITOR.ui.dialog.uiElement @constructor Creates a button class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element definition. Accepted fields: * `la...
[ "A", "button", "with", "a", "label", "inside", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L487-L538
55,475
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition ); if ( elementDefinition.validate ) this.validate = elementDefinition.validate; _.inputId = CKEDITOR.tools.getNextId() + '_select'; ...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition ); if ( elementDefinition.validate ) this.validate = elementDefinition.validate; _.inputId = CKEDITOR.tools.getNextId() + '_select'; ...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "var", "_", "=", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ")", ";", "if",...
A select box. @class CKEDITOR.ui.dialog.select @extends CKEDITOR.ui.dialog.uiElement @constructor Creates a button class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element definition. Accepted fields: * `default` (Required...
[ "A", "select", "box", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L563-L609
55,476
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; if ( elementDefinition[ 'default' ] === undefined ) elementDefinition[ 'default' ] = ''; var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition: elementDefinition,...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; if ( elementDefinition[ 'default' ] === undefined ) elementDefinition[ 'default' ] = ''; var _ = CKEDITOR.tools.extend( initPrivateObject.call( this, elementDefinition ), { definition: elementDefinition,...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "if", "(", "elementDefinition", "[", "'default'", "]", "===", "undefined", ")", "elementDefinition", "[", "...
A file upload input. @class CKEDITOR.ui.dialog.file @extends CKEDITOR.ui.dialog.labeledElement @constructor Creates a file class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element definition. Accepted fields: * `validate` ...
[ "A", "file", "upload", "input", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L625-L675
55,477
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition ), me = this; if ( elementDefinition.validate ) this.validate = elementDefinition.validate; var myDefinition = CKEDITOR.tools.extend( ...
javascript
function( dialog, elementDefinition, htmlList ) { if ( arguments.length < 3 ) return; var _ = initPrivateObject.call( this, elementDefinition ), me = this; if ( elementDefinition.validate ) this.validate = elementDefinition.validate; var myDefinition = CKEDITOR.tools.extend( ...
[ "function", "(", "dialog", ",", "elementDefinition", ",", "htmlList", ")", "{", "if", "(", "arguments", ".", "length", "<", "3", ")", "return", ";", "var", "_", "=", "initPrivateObject", ".", "call", "(", "this", ",", "elementDefinition", ")", ",", "me",...
A button for submitting the file in a file upload input. @class CKEDITOR.ui.dialog.fileButton @extends CKEDITOR.ui.dialog.button @constructor Creates a fileButton class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {CKEDITOR.dialog.definition.uiElement} elementDefinition The element def...
[ "A", "button", "for", "submitting", "the", "file", "in", "a", "file", "upload", "input", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L693-L719
55,478
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { var legendLabel = elementDefinition.label; /** @ignore */ var innerHTML = function() { var html = []; legendLabel && html.push( '<legend' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition....
javascript
function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) { var legendLabel = elementDefinition.label; /** @ignore */ var innerHTML = function() { var html = []; legendLabel && html.push( '<legend' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition....
[ "function", "(", "dialog", ",", "childObjList", ",", "childHtmlList", ",", "htmlList", ",", "elementDefinition", ")", "{", "var", "legendLabel", "=", "elementDefinition", ".", "label", ";", "/** @ignore */", "var", "innerHTML", "=", "function", "(", ")", "{", ...
Form fieldset for grouping dialog UI elements. @class CKEDITOR.ui.dialog.fieldset @extends CKEDITOR.ui.dialog.uiElement @constructor Creates a fieldset class instance. @param {CKEDITOR.dialog} dialog Parent dialog window object. @param {Array} childObjList Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside t...
[ "Form", "fieldset", "for", "grouping", "dialog", "UI", "elements", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L802-L817
55,479
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( label ) { var node = CKEDITOR.document.getById( this._.labelId ); if ( node.getChildCount() < 1 ) ( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node ); else node.getChild( 0 ).$.nodeValue = label; return this; }
javascript
function( label ) { var node = CKEDITOR.document.getById( this._.labelId ); if ( node.getChildCount() < 1 ) ( new CKEDITOR.dom.text( label, CKEDITOR.document ) ).appendTo( node ); else node.getChild( 0 ).$.nodeValue = label; return this; }
[ "function", "(", "label", ")", "{", "var", "node", "=", "CKEDITOR", ".", "document", ".", "getById", "(", "this", ".", "_", ".", "labelId", ")", ";", "if", "(", "node", ".", "getChildCount", "(", ")", "<", "1", ")", "(", "new", "CKEDITOR", ".", "...
Sets the label text of the element. @param {String} label The new label text. @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element.
[ "Sets", "the", "label", "text", "of", "the", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L831-L838
55,480
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function() { var node = CKEDITOR.document.getById( this._.labelId ); if ( !node || node.getChildCount() < 1 ) return ''; else return node.getChild( 0 ).getText(); }
javascript
function() { var node = CKEDITOR.document.getById( this._.labelId ); if ( !node || node.getChildCount() < 1 ) return ''; else return node.getChild( 0 ).getText(); }
[ "function", "(", ")", "{", "var", "node", "=", "CKEDITOR", ".", "document", ".", "getById", "(", "this", ".", "_", ".", "labelId", ")", ";", "if", "(", "!", "node", "||", "node", ".", "getChildCount", "(", ")", "<", "1", ")", "return", "''", ";",...
Retrieves the current label text of the elment. @returns {String} The current label text.
[ "Retrieves", "the", "current", "label", "text", "of", "the", "elment", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L845-L851
55,481
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function() { var me = this.selectParentTab(); // GECKO BUG: setTimeout() is needed to workaround invisible selections. setTimeout( function() { var e = me.getInputElement(); if ( e ) { e.$.focus(); e.$.select(); } }, 0 ); }
javascript
function() { var me = this.selectParentTab(); // GECKO BUG: setTimeout() is needed to workaround invisible selections. setTimeout( function() { var e = me.getInputElement(); if ( e ) { e.$.focus(); e.$.select(); } }, 0 ); }
[ "function", "(", ")", "{", "var", "me", "=", "this", ".", "selectParentTab", "(", ")", ";", "// GECKO BUG: setTimeout() is needed to workaround invisible selections.\r", "setTimeout", "(", "function", "(", ")", "{", "var", "e", "=", "me", ".", "getInputElement", "...
Selects all the text in the text input.
[ "Selects", "all", "the", "text", "in", "the", "text", "input", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L968-L979
55,482
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( value ) { !value && ( value = '' ); return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments ); }
javascript
function( value ) { !value && ( value = '' ); return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments ); }
[ "function", "(", "value", ")", "{", "!", "value", "&&", "(", "value", "=", "''", ")", ";", "return", "CKEDITOR", ".", "ui", ".", "dialog", ".", "uiElement", ".", "prototype", ".", "setValue", ".", "apply", "(", "this", ",", "arguments", ")", ";", "...
Sets the value of this text input object. uiElement.setValue( 'Blamo' ); @param {Object} value The new value. @returns {CKEDITOR.ui.dialog.textInput} The current UI element.
[ "Sets", "the", "value", "of", "this", "text", "input", "object", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L997-L1000
55,483
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( label, value, index ) { var option = new CKEDITOR.dom.element( 'option', this.getDialog().getParentEditor().document ), selectElement = this.getInputElement().$; option.$.text = label; option.$.value = ( value === undefined || value === null ) ? label : value; if ( index === undefine...
javascript
function( label, value, index ) { var option = new CKEDITOR.dom.element( 'option', this.getDialog().getParentEditor().document ), selectElement = this.getInputElement().$; option.$.text = label; option.$.value = ( value === undefined || value === null ) ? label : value; if ( index === undefine...
[ "function", "(", "label", ",", "value", ",", "index", ")", "{", "var", "option", "=", "new", "CKEDITOR", ".", "dom", ".", "element", "(", "'option'", ",", "this", ".", "getDialog", "(", ")", ".", "getParentEditor", "(", ")", ".", "document", ")", ","...
Adds an option to the select box. @param {String} label Option label. @param {String} value (Optional) Option value, if not defined it will be assumed to be the same as the label. @param {Number} index (Optional) Position of the option to be inserted to. If not defined, the new option will be inserted to the end of li...
[ "Adds", "an", "option", "to", "the", "select", "box", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L1028-L1041
55,484
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( value, noChangeEvent ) { var children = this._.children, item; for ( var i = 0; ( i < children.length ) && ( item = children[ i ] ); i++ ) item.getElement().$.checked = ( item.getValue() == value ); !noChangeEvent && this.fire( 'change', { value: value } ); }
javascript
function( value, noChangeEvent ) { var children = this._.children, item; for ( var i = 0; ( i < children.length ) && ( item = children[ i ] ); i++ ) item.getElement().$.checked = ( item.getValue() == value ); !noChangeEvent && this.fire( 'change', { value: value } ); }
[ "function", "(", "value", ",", "noChangeEvent", ")", "{", "var", "children", "=", "this", ".", "_", ".", "children", ",", "item", ";", "for", "(", "var", "i", "=", "0", ";", "(", "i", "<", "children", ".", "length", ")", "&&", "(", "item", "=", ...
Selects one of the radio buttons in this button group. @param {String} value The value of the button to be chcked. @param {Boolean} noChangeEvent Internal commit, to supress the `change` event on this element.
[ "Selects", "one", "of", "the", "radio", "buttons", "in", "this", "button", "group", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L1143-L1150
55,485
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function() { var children = this._.children; for ( var i = 0; i < children.length; i++ ) { if ( children[ i ].getElement().$.checked ) return children[ i ].getValue(); } return null; }
javascript
function() { var children = this._.children; for ( var i = 0; i < children.length; i++ ) { if ( children[ i ].getElement().$.checked ) return children[ i ].getValue(); } return null; }
[ "function", "(", ")", "{", "var", "children", "=", "this", ".", "_", ".", "children", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "[", "i", "]", ".", "getEl...
Gets the value of the currently selected radio button. @returns {String} The currently selected button's value.
[ "Gets", "the", "value", "of", "the", "currently", "selected", "radio", "button", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L1157-L1164
55,486
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function() { var children = this._.children, i; for ( i = 0; i < children.length; i++ ) { if ( children[ i ].getElement().$.checked ) { children[ i ].getElement().focus(); return; } } children[ 0 ].getElement().focus(); }
javascript
function() { var children = this._.children, i; for ( i = 0; i < children.length; i++ ) { if ( children[ i ].getElement().$.checked ) { children[ i ].getElement().focus(); return; } } children[ 0 ].getElement().focus(); }
[ "function", "(", ")", "{", "var", "children", "=", "this", ".", "_", ".", "children", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "[", "i", "]", ".", "...
Handler for the access key up event. Focuses the currently selected radio button, or the first radio button if none is selected.
[ "Handler", "for", "the", "access", "key", "up", "event", ".", "Focuses", "the", "currently", "selected", "radio", "button", "or", "the", "first", "radio", "button", "if", "none", "is", "selected", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L1170-L1180
55,487
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/dialogui/plugin.js
function( definition ) { var regex = /^on([A-Z]\w+)/, match; var registerDomEvent = function( uiElement, dialog, eventName, func ) { uiElement.on( 'formLoaded', function() { uiElement.getInputElement().on( eventName, func, uiElement ); } ); }; for ( var i in definiti...
javascript
function( definition ) { var regex = /^on([A-Z]\w+)/, match; var registerDomEvent = function( uiElement, dialog, eventName, func ) { uiElement.on( 'formLoaded', function() { uiElement.getInputElement().on( eventName, func, uiElement ); } ); }; for ( var i in definiti...
[ "function", "(", "definition", ")", "{", "var", "regex", "=", "/", "^on([A-Z]\\w+)", "/", ",", "match", ";", "var", "registerDomEvent", "=", "function", "(", "uiElement", ",", "dialog", ",", "eventName", ",", "func", ")", "{", "uiElement", ".", "on", "("...
The events must be applied to the inner input element, and this must be done when the iframe and form have been loaded.
[ "The", "events", "must", "be", "applied", "to", "the", "inner", "input", "element", "and", "this", "must", "be", "done", "when", "the", "iframe", "and", "form", "have", "been", "loaded", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/dialogui/plugin.js#L1246-L1267
55,488
jhooky/events
events.js
function (callback, context, args) { var arg1, arg2, arg3 arg1 = args[0] arg2 = args[1] arg3 = args[2] switch (args.length) { case 0: callback.call(context); return case 1: callback.call(context, arg1); return case 2: callback.call(arg1, arg2); return case 3: callback.c...
javascript
function (callback, context, args) { var arg1, arg2, arg3 arg1 = args[0] arg2 = args[1] arg3 = args[2] switch (args.length) { case 0: callback.call(context); return case 1: callback.call(context, arg1); return case 2: callback.call(arg1, arg2); return case 3: callback.c...
[ "function", "(", "callback", ",", "context", ",", "args", ")", "{", "var", "arg1", ",", "arg2", ",", "arg3", "arg1", "=", "args", "[", "0", "]", "arg2", "=", "args", "[", "1", "]", "arg3", "=", "args", "[", "2", "]", "switch", "(", "args", ".",...
This is probably overkill... but what the hell, why not?
[ "This", "is", "probably", "overkill", "...", "but", "what", "the", "hell", "why", "not?" ]
ed74b0ca5a333c889e8a9291c8c24e813c950e86
https://github.com/jhooky/events/blob/ed74b0ca5a333c889e8a9291c8c24e813c950e86/events.js#L27-L44
55,489
Pocketbrain/native-ads-web-ad-library
src/adLib.js
function (environment, options) { this.applicationId = options && options.applicationId; this.environment = environment; this.page = page; this.adManager = null; this.path = window.location.pathname; this.events = events; this.adManager = new AdManager(this.applicationId, this.deviceDetails,...
javascript
function (environment, options) { this.applicationId = options && options.applicationId; this.environment = environment; this.page = page; this.adManager = null; this.path = window.location.pathname; this.events = events; this.adManager = new AdManager(this.applicationId, this.deviceDetails,...
[ "function", "(", "environment", ",", "options", ")", "{", "this", ".", "applicationId", "=", "options", "&&", "options", ".", "applicationId", ";", "this", ".", "environment", "=", "environment", ";", "this", ".", "page", "=", "page", ";", "this", ".", "...
Constructor that creates an instance of the AdLibrary object @param environment - The environment object containing environment specific functions @param [options] - Optional options to initialize the ad library with @constructor
[ "Constructor", "that", "creates", "an", "instance", "of", "the", "AdLibrary", "object" ]
aafee1c42e0569ee77f334fc2c4eb71eb146957e
https://github.com/Pocketbrain/native-ads-web-ad-library/blob/aafee1c42e0569ee77f334fc2c4eb71eb146957e/src/adLib.js#L18-L40
55,490
pvorb/node-pub
pub.js
exp
function exp(cmd, confdir) { return function (files, opt) { var defaultOpt = { cwd: process.cwd() }; opt = append(defaultOpt, opt); if (typeof files == 'string') files = [ files ]; require(path.resolve(confdir, cmd + '.js'))(files, opt); }; }
javascript
function exp(cmd, confdir) { return function (files, opt) { var defaultOpt = { cwd: process.cwd() }; opt = append(defaultOpt, opt); if (typeof files == 'string') files = [ files ]; require(path.resolve(confdir, cmd + '.js'))(files, opt); }; }
[ "function", "exp", "(", "cmd", ",", "confdir", ")", "{", "return", "function", "(", "files", ",", "opt", ")", "{", "var", "defaultOpt", "=", "{", "cwd", ":", "process", ".", "cwd", "(", ")", "}", ";", "opt", "=", "append", "(", "defaultOpt", ",", ...
exports a command
[ "exports", "a", "command" ]
d1caf1b8e5b9d4dd43bbedf7a112646108653b02
https://github.com/pvorb/node-pub/blob/d1caf1b8e5b9d4dd43bbedf7a112646108653b02/pub.js#L24-L36
55,491
christophercrouzet/pillr
lib/components/render_content.js
popFootnoteTokens
function popFootnoteTokens(tokens) { const from = tokens.findIndex(token => token.type === 'footnote_block_open'); const to = tokens.findIndex(token => token.type === 'footnote_block_close'); if (from === -1 || to === -1) { return []; } return tokens.splice(from, (to - from) + 1); }
javascript
function popFootnoteTokens(tokens) { const from = tokens.findIndex(token => token.type === 'footnote_block_open'); const to = tokens.findIndex(token => token.type === 'footnote_block_close'); if (from === -1 || to === -1) { return []; } return tokens.splice(from, (to - from) + 1); }
[ "function", "popFootnoteTokens", "(", "tokens", ")", "{", "const", "from", "=", "tokens", ".", "findIndex", "(", "token", "=>", "token", ".", "type", "===", "'footnote_block_open'", ")", ";", "const", "to", "=", "tokens", ".", "findIndex", "(", "token", "=...
Remove the footnote tokens from within a token list.
[ "Remove", "the", "footnote", "tokens", "from", "within", "a", "token", "list", "." ]
411ccd344a03478776c4e8d2e2f9bdc45dc8ee45
https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/components/render_content.js#L15-L23
55,492
christophercrouzet/pillr
lib/components/render_content.js
footnoteTokensToMeta
function footnoteTokensToMeta(tokens, md) { return tokens .map((token, i) => { return token.type === 'footnote_open' ? i : -1; }) .filter(i => i >= 0) .map((i) => { const inlineToken = tokens[i + 2]; assert(inlineToken.type === 'inline'); const anchorToken = tokens[i + 3]; assert(a...
javascript
function footnoteTokensToMeta(tokens, md) { return tokens .map((token, i) => { return token.type === 'footnote_open' ? i : -1; }) .filter(i => i >= 0) .map((i) => { const inlineToken = tokens[i + 2]; assert(inlineToken.type === 'inline'); const anchorToken = tokens[i + 3]; assert(a...
[ "function", "footnoteTokensToMeta", "(", "tokens", ",", "md", ")", "{", "return", "tokens", ".", "map", "(", "(", "token", ",", "i", ")", "=>", "{", "return", "token", ".", "type", "===", "'footnote_open'", "?", "i", ":", "-", "1", ";", "}", ")", "...
Convert the footnote tokens into metadata.
[ "Convert", "the", "footnote", "tokens", "into", "metadata", "." ]
411ccd344a03478776c4e8d2e2f9bdc45dc8ee45
https://github.com/christophercrouzet/pillr/blob/411ccd344a03478776c4e8d2e2f9bdc45dc8ee45/lib/components/render_content.js#L27-L42
55,493
amooj/node-xcheck
lib/namespace.js
function (namespace, names){ if (names){ for (let i = 0, n = names.length; i < n; ++i){ let typeName = names[i]; if (namespace.names.hasOwnProperty(typeName)){ this.names[typeName] = namespace.names[typeName]; } else { throw new ReferenceError('import error:...
javascript
function (namespace, names){ if (names){ for (let i = 0, n = names.length; i < n; ++i){ let typeName = names[i]; if (namespace.names.hasOwnProperty(typeName)){ this.names[typeName] = namespace.names[typeName]; } else { throw new ReferenceError('import error:...
[ "function", "(", "namespace", ",", "names", ")", "{", "if", "(", "names", ")", "{", "for", "(", "let", "i", "=", "0", ",", "n", "=", "names", ".", "length", ";", "i", "<", "n", ";", "++", "i", ")", "{", "let", "typeName", "=", "names", "[", ...
Import type names from another namespace. @param {TemplateNamespace} namespace @param {Array<String>} [names] - names to import @returns {TemplateNamespace}
[ "Import", "type", "names", "from", "another", "namespace", "." ]
33b2b59f7d81a8e0421a468a405f15a19126bedf
https://github.com/amooj/node-xcheck/blob/33b2b59f7d81a8e0421a468a405f15a19126bedf/lib/namespace.js#L28-L49
55,494
amooj/node-xcheck
lib/namespace.js
function(alias, typeName){ let template = this.resolve(typeName); if (!template){ throw new ReferenceError('bad alias \'' + alias + '\': type \'' + typeName + '\' is undefined'); } this.names[alias] = template; }
javascript
function(alias, typeName){ let template = this.resolve(typeName); if (!template){ throw new ReferenceError('bad alias \'' + alias + '\': type \'' + typeName + '\' is undefined'); } this.names[alias] = template; }
[ "function", "(", "alias", ",", "typeName", ")", "{", "let", "template", "=", "this", ".", "resolve", "(", "typeName", ")", ";", "if", "(", "!", "template", ")", "{", "throw", "new", "ReferenceError", "(", "'bad alias \\''", "+", "alias", "+", "'\\': type...
Defines an typename alias. @param {String} alias @param {String} typeName - existing template type, may be a built-in type.
[ "Defines", "an", "typename", "alias", "." ]
33b2b59f7d81a8e0421a468a405f15a19126bedf
https://github.com/amooj/node-xcheck/blob/33b2b59f7d81a8e0421a468a405f15a19126bedf/lib/namespace.js#L56-L62
55,495
amooj/node-xcheck
lib/namespace.js
function(typeName, template){ if (!(template instanceof ValueTemplate)){ template = ValueTemplate.parse(template, {namespace:this}); } class UserDefinedTemplate extends ValueTemplate{ constructor(defaultValue, validator){ super(typeName, defaultValue, validator); this.template = ...
javascript
function(typeName, template){ if (!(template instanceof ValueTemplate)){ template = ValueTemplate.parse(template, {namespace:this}); } class UserDefinedTemplate extends ValueTemplate{ constructor(defaultValue, validator){ super(typeName, defaultValue, validator); this.template = ...
[ "function", "(", "typeName", ",", "template", ")", "{", "if", "(", "!", "(", "template", "instanceof", "ValueTemplate", ")", ")", "{", "template", "=", "ValueTemplate", ".", "parse", "(", "template", ",", "{", "namespace", ":", "this", "}", ")", ";", "...
Defines a template type. @param {String} typeName - name of the new type. @param {*|ValueTemplate} template - base template of the new type.
[ "Defines", "a", "template", "type", "." ]
33b2b59f7d81a8e0421a468a405f15a19126bedf
https://github.com/amooj/node-xcheck/blob/33b2b59f7d81a8e0421a468a405f15a19126bedf/lib/namespace.js#L69-L85
55,496
royriojas/grunt-r3m
lib/lib.js
function(lastValue) { //var currentItem if (current === len) { cb && cb(lastValue); return; } var item = items[current++]; setTimeout(function() { fn(item, function(val) { process(val && lastValue); }); }, 20); }
javascript
function(lastValue) { //var currentItem if (current === len) { cb && cb(lastValue); return; } var item = items[current++]; setTimeout(function() { fn(item, function(val) { process(val && lastValue); }); }, 20); }
[ "function", "(", "lastValue", ")", "{", "//var currentItem", "if", "(", "current", "===", "len", ")", "{", "cb", "&&", "cb", "(", "lastValue", ")", ";", "return", ";", "}", "var", "item", "=", "items", "[", "current", "++", "]", ";", "setTimeout", "(...
closure function to iterate over the items async
[ "closure", "function", "to", "iterate", "over", "the", "items", "async" ]
bfe1ab877bcfd12df9503a1911aa0aeb08c09b96
https://github.com/royriojas/grunt-r3m/blob/bfe1ab877bcfd12df9503a1911aa0aeb08c09b96/lib/lib.js#L96-L108
55,497
royriojas/grunt-r3m
lib/lib.js
function(ns, root){ if (!ns) { return null; } var nsParts = ns.split("."); root = root || this; for (var i = 0, len = nsParts.length; i < len; i++) { if (typeof root[nsParts[i]] === "undefined") { root[nsParts[i]] = {}; } root = root[nsParts[i]]; } return root...
javascript
function(ns, root){ if (!ns) { return null; } var nsParts = ns.split("."); root = root || this; for (var i = 0, len = nsParts.length; i < len; i++) { if (typeof root[nsParts[i]] === "undefined") { root[nsParts[i]] = {}; } root = root[nsParts[i]]; } return root...
[ "function", "(", "ns", ",", "root", ")", "{", "if", "(", "!", "ns", ")", "{", "return", "null", ";", "}", "var", "nsParts", "=", "ns", ".", "split", "(", "\".\"", ")", ";", "root", "=", "root", "||", "this", ";", "for", "(", "var", "i", "=", ...
define a namespace object @param {Object} ns
[ "define", "a", "namespace", "object" ]
bfe1ab877bcfd12df9503a1911aa0aeb08c09b96
https://github.com/royriojas/grunt-r3m/blob/bfe1ab877bcfd12df9503a1911aa0aeb08c09b96/lib/lib.js#L220-L233
55,498
royriojas/grunt-r3m
lib/lib.js
function() { var min, max, args = arguments; //if only one argument is provided we are expecting to have a value between 0 and max if (args.length === 1) { max = args[0]; min = 0; } //two arguments provided mean we are expecting to have a number between min and max if (args.length >=...
javascript
function() { var min, max, args = arguments; //if only one argument is provided we are expecting to have a value between 0 and max if (args.length === 1) { max = args[0]; min = 0; } //two arguments provided mean we are expecting to have a number between min and max if (args.length >=...
[ "function", "(", ")", "{", "var", "min", ",", "max", ",", "args", "=", "arguments", ";", "//if only one argument is provided we are expecting to have a value between 0 and max", "if", "(", "args", ".", "length", "===", "1", ")", "{", "max", "=", "args", "[", "0"...
return a random number between a min and a max value
[ "return", "a", "random", "number", "between", "a", "min", "and", "a", "max", "value" ]
bfe1ab877bcfd12df9503a1911aa0aeb08c09b96
https://github.com/royriojas/grunt-r3m/blob/bfe1ab877bcfd12df9503a1911aa0aeb08c09b96/lib/lib.js#L240-L258
55,499
sazze/node-thrift
lib/_thriftServer.js
Server
function Server(service, methods) { this.service = service; this.methods = methods; if (typeof service === 'undefined') { throw new Error('Thrift Service is required'); } if (typeof methods !== 'object' || Object.keys(methods).length === 0) { throw new Error('Thrift Methods Handlers are required'); ...
javascript
function Server(service, methods) { this.service = service; this.methods = methods; if (typeof service === 'undefined') { throw new Error('Thrift Service is required'); } if (typeof methods !== 'object' || Object.keys(methods).length === 0) { throw new Error('Thrift Methods Handlers are required'); ...
[ "function", "Server", "(", "service", ",", "methods", ")", "{", "this", ".", "service", "=", "service", ";", "this", ".", "methods", "=", "methods", ";", "if", "(", "typeof", "service", "===", "'undefined'", ")", "{", "throw", "new", "Error", "(", "'Th...
Create a New thrift Server @param {object} service the thrift service @param {object} methods the function handlers for the thrift calls @fires thrift/Server#listening @fires thrift/Server#connection @fires thrift/Server#close @fires thrift/Server#error @class thrift/Server
[ "Create", "a", "New", "thrift", "Server" ]
458d1829813cbd2d50dae610bc7210b75140e58f
https://github.com/sazze/node-thrift/blob/458d1829813cbd2d50dae610bc7210b75140e58f/lib/_thriftServer.js#L17-L31