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
56,600
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( newImage ) { // Do not change snapshots stack is locked. if ( this.locked ) return; if ( !newImage ) newImage = new Image( this.editor ); var i = this.index, snapshots = this.snapshots; // Find all previous snapshots made for the same content (which differ // only ...
javascript
function( newImage ) { // Do not change snapshots stack is locked. if ( this.locked ) return; if ( !newImage ) newImage = new Image( this.editor ); var i = this.index, snapshots = this.snapshots; // Find all previous snapshots made for the same content (which differ // only ...
[ "function", "(", "newImage", ")", "{", "// Do not change snapshots stack is locked.\r", "if", "(", "this", ".", "locked", ")", "return", ";", "if", "(", "!", "newImage", ")", "newImage", "=", "new", "Image", "(", "this", ".", "editor", ")", ";", "var", "i"...
Updates the last snapshot of the undo stack with the current editor content. @param {CKEDITOR.plugins.undo.Image} [newImage] The image which will replace the current one. If it is not set, it defaults to the image taken from the editor.
[ "Updates", "the", "last", "snapshot", "of", "the", "undo", "stack", "with", "the", "current", "editor", "content", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L540-L559
56,601
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function() { if ( this.locked ) { // Decrease level of lock and check if equals 0, what means that undoM is completely unlocked. if ( !--this.locked.level ) { var update = this.locked.update; this.locked = null; // forceUpdate was passed to lock(). if ( update === true ) ...
javascript
function() { if ( this.locked ) { // Decrease level of lock and check if equals 0, what means that undoM is completely unlocked. if ( !--this.locked.level ) { var update = this.locked.update; this.locked = null; // forceUpdate was passed to lock(). if ( update === true ) ...
[ "function", "(", ")", "{", "if", "(", "this", ".", "locked", ")", "{", "// Decrease level of lock and check if equals 0, what means that undoM is completely unlocked.\r", "if", "(", "!", "--", "this", ".", "locked", ".", "level", ")", "{", "var", "update", "=", "t...
Unlocks the snapshot stack and checks to amend the last snapshot. See {@link #lock} for more details. @since 4.0
[ "Unlocks", "the", "snapshot", "stack", "and", "checks", "to", "amend", "the", "last", "snapshot", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L650-L670
56,602
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
onTypingStart
function onTypingStart( undoManager ) { // It's safe to now indicate typing state. undoManager.typing = true; // Manually mark snapshot as available. undoManager.hasUndo = true; undoManager.hasRedo = false; undoManager.onChange(); }
javascript
function onTypingStart( undoManager ) { // It's safe to now indicate typing state. undoManager.typing = true; // Manually mark snapshot as available. undoManager.hasUndo = true; undoManager.hasRedo = false; undoManager.onChange(); }
[ "function", "onTypingStart", "(", "undoManager", ")", "{", "// It's safe to now indicate typing state.\r", "undoManager", ".", "typing", "=", "true", ";", "// Manually mark snapshot as available.\r", "undoManager", ".", "hasUndo", "=", "true", ";", "undoManager", ".", "ha...
Helper method called when undoManager.typing val was changed to true.
[ "Helper", "method", "called", "when", "undoManager", ".", "typing", "val", "was", "changed", "to", "true", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L759-L768
56,603
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( evt ) { // Block undo/redo keystrokes when at the bottom/top of the undo stack (#11126 and #11677). if ( CKEDITOR.tools.indexOf( keystrokes, evt.data.getKeystroke() ) > -1 ) { evt.data.preventDefault(); return; } // Cleaning tab functional keys. this.keyEventsStack.cleanUp( evt...
javascript
function( evt ) { // Block undo/redo keystrokes when at the bottom/top of the undo stack (#11126 and #11677). if ( CKEDITOR.tools.indexOf( keystrokes, evt.data.getKeystroke() ) > -1 ) { evt.data.preventDefault(); return; } // Cleaning tab functional keys. this.keyEventsStack.cleanUp( evt...
[ "function", "(", "evt", ")", "{", "// Block undo/redo keystrokes when at the bottom/top of the undo stack (#11126 and #11677).\r", "if", "(", "CKEDITOR", ".", "tools", ".", "indexOf", "(", "keystrokes", ",", "evt", ".", "data", ".", "getKeystroke", "(", ")", ")", ">",...
The `keydown` event listener. @param {CKEDITOR.dom.event} evt
[ "The", "keydown", "event", "listener", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L923-L953
56,604
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function() { // Input event is ignored if paste/drop event were fired before. if ( this.ignoreInputEvent ) { // Reset flag - ignore only once. this.ignoreInputEvent = false; return; } var lastInput = this.keyEventsStack.getLast(); // Nothing in key events stack, but input event call...
javascript
function() { // Input event is ignored if paste/drop event were fired before. if ( this.ignoreInputEvent ) { // Reset flag - ignore only once. this.ignoreInputEvent = false; return; } var lastInput = this.keyEventsStack.getLast(); // Nothing in key events stack, but input event call...
[ "function", "(", ")", "{", "// Input event is ignored if paste/drop event were fired before.\r", "if", "(", "this", ".", "ignoreInputEvent", ")", "{", "// Reset flag - ignore only once.\r", "this", ".", "ignoreInputEvent", "=", "false", ";", "return", ";", "}", "var", "...
The `input` event listener.
[ "The", "input", "event", "listener", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L958-L981
56,605
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( evt ) { var undoManager = this.undoManager, keyCode = evt.data.getKey(), totalInputs = this.keyEventsStack.getTotalInputs(); // Remove record from stack for provided key code. this.keyEventsStack.remove( keyCode ); // Second part of the workaround for IEs functional keys bug. We ...
javascript
function( evt ) { var undoManager = this.undoManager, keyCode = evt.data.getKey(), totalInputs = this.keyEventsStack.getTotalInputs(); // Remove record from stack for provided key code. this.keyEventsStack.remove( keyCode ); // Second part of the workaround for IEs functional keys bug. We ...
[ "function", "(", "evt", ")", "{", "var", "undoManager", "=", "this", ".", "undoManager", ",", "keyCode", "=", "evt", ".", "data", ".", "getKey", "(", ")", ",", "totalInputs", "=", "this", ".", "keyEventsStack", ".", "getTotalInputs", "(", ")", ";", "//...
The `keyup` event listener. @param {CKEDITOR.dom.event} evt
[ "The", "keyup", "event", "listener", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L988-L1010
56,606
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( skipContentCompare ) { var undoManager = this.undoManager; // We attempt to save content snapshot, if content didn't change, we'll // only amend selection. if ( skipContentCompare || !undoManager.save( true, null, false ) ) undoManager.updateSelection( new Image( undoManager.editor ) );...
javascript
function( skipContentCompare ) { var undoManager = this.undoManager; // We attempt to save content snapshot, if content didn't change, we'll // only amend selection. if ( skipContentCompare || !undoManager.save( true, null, false ) ) undoManager.updateSelection( new Image( undoManager.editor ) );...
[ "function", "(", "skipContentCompare", ")", "{", "var", "undoManager", "=", "this", ".", "undoManager", ";", "// We attempt to save content snapshot, if content didn't change, we'll\r", "// only amend selection.\r", "if", "(", "skipContentCompare", "||", "!", "undoManager", "...
Method called for navigation change. At first it will check if current content does not differ from the last saved snapshot. * If the content is different, the method creates a standard, extra snapshot. * If the content is not different, the method will compare the selection, and will amend the last snapshot selection...
[ "Method", "called", "for", "navigation", "change", ".", "At", "first", "it", "will", "check", "if", "current", "content", "does", "not", "differ", "from", "the", "last", "saved", "snapshot", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L1022-L1031
56,607
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function() { var editor = this.undoManager.editor, editable = editor.editable(), that = this; // We'll create a snapshot here (before DOM modification), because we'll // need unmodified content when we got keygroup toggled in keyup. editable.attachListener( editable, 'keydown', function( evt...
javascript
function() { var editor = this.undoManager.editor, editable = editor.editable(), that = this; // We'll create a snapshot here (before DOM modification), because we'll // need unmodified content when we got keygroup toggled in keyup. editable.attachListener( editable, 'keydown', function( evt...
[ "function", "(", ")", "{", "var", "editor", "=", "this", ".", "undoManager", ".", "editor", ",", "editable", "=", "editor", ".", "editable", "(", ")", ",", "that", "=", "this", ";", "// We'll create a snapshot here (before DOM modification), because we'll\r", "// ...
Attaches editable listeners required to provide the undo functionality.
[ "Attaches", "editable", "listeners", "required", "to", "provide", "the", "undo", "functionality", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L1043-L1085
56,608
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( keyCode ) { if ( typeof keyCode != 'number' ) { return this.stack.length - 1; // Last index or -1. } else { var i = this.stack.length; while ( i-- ) { if ( this.stack[ i ].keyCode == keyCode ) { return i; } } return -1; } }
javascript
function( keyCode ) { if ( typeof keyCode != 'number' ) { return this.stack.length - 1; // Last index or -1. } else { var i = this.stack.length; while ( i-- ) { if ( this.stack[ i ].keyCode == keyCode ) { return i; } } return -1; } }
[ "function", "(", "keyCode", ")", "{", "if", "(", "typeof", "keyCode", "!=", "'number'", ")", "{", "return", "this", ".", "stack", ".", "length", "-", "1", ";", "// Last index or -1.\r", "}", "else", "{", "var", "i", "=", "this", ".", "stack", ".", "l...
Returns the index of the last registered `keyCode` in the stack. If no `keyCode` is provided, then the function will return the index of the last item. If an item is not found, it will return `-1`. @param {Number} [keyCode] @returns {Number}
[ "Returns", "the", "index", "of", "the", "last", "registered", "keyCode", "in", "the", "stack", ".", "If", "no", "keyCode", "is", "provided", "then", "the", "function", "will", "return", "the", "index", "of", "the", "last", "item", ".", "If", "an", "item"...
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L1124-L1136
56,609
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function( keyCode ) { if ( typeof keyCode == 'number' ) { var last = this.getLast( keyCode ); if ( !last ) { // %REMOVE_LINE% throw new Error( 'Trying to reset inputs count, but could not found by keyCode: ' + keyCode + '.' ); // %REMOVE_LINE% } // %REMOVE_LINE% last.inputs = 0; } ...
javascript
function( keyCode ) { if ( typeof keyCode == 'number' ) { var last = this.getLast( keyCode ); if ( !last ) { // %REMOVE_LINE% throw new Error( 'Trying to reset inputs count, but could not found by keyCode: ' + keyCode + '.' ); // %REMOVE_LINE% } // %REMOVE_LINE% last.inputs = 0; } ...
[ "function", "(", "keyCode", ")", "{", "if", "(", "typeof", "keyCode", "==", "'number'", ")", "{", "var", "last", "=", "this", ".", "getLast", "(", "keyCode", ")", ";", "if", "(", "!", "last", ")", "{", "// %REMOVE_LINE%\r", "throw", "new", "Error", "...
Resets the `inputs` value to `0` for a given `keyCode` or in entire stack if a `keyCode` is not specified. @param {Number} [keyCode]
[ "Resets", "the", "inputs", "value", "to", "0", "for", "a", "given", "keyCode", "or", "in", "entire", "stack", "if", "a", "keyCode", "is", "not", "specified", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L1187-L1202
56,610
skerit/alchemy-styleboost
public/ckeditor/4.4dev/plugins/undo/plugin.js
function() { var i = this.stack.length, total = 0; while ( i-- ) { total += this.stack[ i ].inputs; } return total; }
javascript
function() { var i = this.stack.length, total = 0; while ( i-- ) { total += this.stack[ i ].inputs; } return total; }
[ "function", "(", ")", "{", "var", "i", "=", "this", ".", "stack", ".", "length", ",", "total", "=", "0", ";", "while", "(", "i", "--", ")", "{", "total", "+=", "this", ".", "stack", "[", "i", "]", ".", "inputs", ";", "}", "return", "total", "...
Sums up inputs number for each key code and returns it. @returns {Number}
[ "Sums", "up", "inputs", "number", "for", "each", "key", "code", "and", "returns", "it", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/undo/plugin.js#L1209-L1217
56,611
skerit/alchemy-styleboost
assets/scripts/medium-insert/insert-plugin.js
function () { $.fn.mediumInsert.settings.enabled = false; $.fn.mediumInsert.insert.$el.find('.mediumInsert-buttons').addClass('hide'); }
javascript
function () { $.fn.mediumInsert.settings.enabled = false; $.fn.mediumInsert.insert.$el.find('.mediumInsert-buttons').addClass('hide'); }
[ "function", "(", ")", "{", "$", ".", "fn", ".", "mediumInsert", ".", "settings", ".", "enabled", "=", "false", ";", "$", ".", "fn", ".", "mediumInsert", ".", "insert", ".", "$el", ".", "find", "(", "'.mediumInsert-buttons'", ")", ".", "addClass", "(", ...
Disable the plugin @return {void}
[ "Disable", "the", "plugin" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/insert-plugin.js#L211-L215
56,612
skerit/alchemy-styleboost
assets/scripts/medium-insert/insert-plugin.js
function () { $.fn.mediumInsert.settings.enabled = true; $.fn.mediumInsert.insert.$el.find('.mediumInsert-buttons').removeClass('hide'); }
javascript
function () { $.fn.mediumInsert.settings.enabled = true; $.fn.mediumInsert.insert.$el.find('.mediumInsert-buttons').removeClass('hide'); }
[ "function", "(", ")", "{", "$", ".", "fn", ".", "mediumInsert", ".", "settings", ".", "enabled", "=", "true", ";", "$", ".", "fn", ".", "mediumInsert", ".", "insert", ".", "$el", ".", "find", "(", "'.mediumInsert-buttons'", ")", ".", "removeClass", "("...
Enable the plugin @return {void}
[ "Enable", "the", "plugin" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/insert-plugin.js#L223-L227
56,613
skerit/alchemy-styleboost
assets/scripts/medium-insert/insert-plugin.js
function (addon) { var editor = $.fn.mediumInsert.settings.editor, buttonLabels = (editor && editor.options) ? editor.options.buttonLabels : ''; var buttons; if($.fn.mediumInsert.settings.enabled) { buttons = '<div class="mediumInsert-buttons">'+ '<a class="mediumInsert-buttonsShow">+</a>'+ ...
javascript
function (addon) { var editor = $.fn.mediumInsert.settings.editor, buttonLabels = (editor && editor.options) ? editor.options.buttonLabels : ''; var buttons; if($.fn.mediumInsert.settings.enabled) { buttons = '<div class="mediumInsert-buttons">'+ '<a class="mediumInsert-buttonsShow">+</a>'+ ...
[ "function", "(", "addon", ")", "{", "var", "editor", "=", "$", ".", "fn", ".", "mediumInsert", ".", "settings", ".", "editor", ",", "buttonLabels", "=", "(", "editor", "&&", "editor", ".", "options", ")", "?", "editor", ".", "options", ".", "buttonLabe...
Return insert buttons optionally filtered by addon name @param {string} addon Addon name of addon to display only @return {void}
[ "Return", "insert", "buttons", "optionally", "filtered", "by", "addon", "name" ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/assets/scripts/medium-insert/insert-plugin.js#L253-L283
56,614
mrfishie/starmap
lib/modelItem.js
update
function update(item, model, data, funcParams) { var working = []; var definedByData = []; _.forEach(data, function(value, key) { if (_.isFunction(value)) { working.push(Promise.resolve(value()).then(function(val) { item[key] = val; })); } else item[k...
javascript
function update(item, model, data, funcParams) { var working = []; var definedByData = []; _.forEach(data, function(value, key) { if (_.isFunction(value)) { working.push(Promise.resolve(value()).then(function(val) { item[key] = val; })); } else item[k...
[ "function", "update", "(", "item", ",", "model", ",", "data", ",", "funcParams", ")", "{", "var", "working", "=", "[", "]", ";", "var", "definedByData", "=", "[", "]", ";", "_", ".", "forEach", "(", "data", ",", "function", "(", "value", ",", "key"...
Updates the model to represent the given data @param {object} item @param {Model} model @param {object} data the data to add to the model @param {object?} funcParams parameters to pass to any precalc functions @returns {Promise}
[ "Updates", "the", "model", "to", "represent", "the", "given", "data" ]
0d2637e7863d65c165abf63766605e6a643d2580
https://github.com/mrfishie/starmap/blob/0d2637e7863d65c165abf63766605e6a643d2580/lib/modelItem.js#L14-L38
56,615
mrfishie/starmap
lib/modelItem.js
serverProperties
function serverProperties(item, model, props) { var result = {}; var toRefresh = []; _.forEach(props || item, function(val, key) { if (val == null) return; if (val._isModelItem) { result[key] = val.id; toRefresh.push(val); } else if (_.isArray(val)) { ...
javascript
function serverProperties(item, model, props) { var result = {}; var toRefresh = []; _.forEach(props || item, function(val, key) { if (val == null) return; if (val._isModelItem) { result[key] = val.id; toRefresh.push(val); } else if (_.isArray(val)) { ...
[ "function", "serverProperties", "(", "item", ",", "model", ",", "props", ")", "{", "var", "result", "=", "{", "}", ";", "var", "toRefresh", "=", "[", "]", ";", "_", ".", "forEach", "(", "props", "||", "item", ",", "function", "(", "val", ",", "key"...
Gets properties to be synced with the server @param {object} item @param {Model} model @param {object?} props @returns {object}
[ "Gets", "properties", "to", "be", "synced", "with", "the", "server" ]
0d2637e7863d65c165abf63766605e6a643d2580
https://github.com/mrfishie/starmap/blob/0d2637e7863d65c165abf63766605e6a643d2580/lib/modelItem.js#L48-L74
56,616
mrfishie/starmap
lib/modelItem.js
create
function create(item, model, data) { var serverProps = serverProperties(item, model, data).properties; return utils.socketPut(model.io, model.url + '/create/', serverProps).then(function(response) { _.merge(serverProps, response); return update(item, model, serverProps); }).then(function() {...
javascript
function create(item, model, data) { var serverProps = serverProperties(item, model, data).properties; return utils.socketPut(model.io, model.url + '/create/', serverProps).then(function(response) { _.merge(serverProps, response); return update(item, model, serverProps); }).then(function() {...
[ "function", "create", "(", "item", ",", "model", ",", "data", ")", "{", "var", "serverProps", "=", "serverProperties", "(", "item", ",", "model", ",", "data", ")", ".", "properties", ";", "return", "utils", ".", "socketPut", "(", "model", ".", "io", ",...
Creates the item on the server @param {object} item @param {Model} model @param {object?} data @returns {Promise}
[ "Creates", "the", "item", "on", "the", "server" ]
0d2637e7863d65c165abf63766605e6a643d2580
https://github.com/mrfishie/starmap/blob/0d2637e7863d65c165abf63766605e6a643d2580/lib/modelItem.js#L84-L95
56,617
mrfishie/starmap
lib/modelItem.js
modelItem
function modelItem(data, model) { var res = {}; utils.defineProperties(res, { _isModelItem: { value: true }, model: { value: model.value }, update: { value: function(data, sync) { if (sync == null) sync = true; return update(res, model, data).then(function() {...
javascript
function modelItem(data, model) { var res = {}; utils.defineProperties(res, { _isModelItem: { value: true }, model: { value: model.value }, update: { value: function(data, sync) { if (sync == null) sync = true; return update(res, model, data).then(function() {...
[ "function", "modelItem", "(", "data", ",", "model", ")", "{", "var", "res", "=", "{", "}", ";", "utils", ".", "defineProperties", "(", "res", ",", "{", "_isModelItem", ":", "{", "value", ":", "true", "}", ",", "model", ":", "{", "value", ":", "mode...
A single model item that is synced with the server @param {object} data @param {Model} model
[ "A", "single", "model", "item", "that", "is", "synced", "with", "the", "server" ]
0d2637e7863d65c165abf63766605e6a643d2580
https://github.com/mrfishie/starmap/blob/0d2637e7863d65c165abf63766605e6a643d2580/lib/modelItem.js#L103-L168
56,618
greggman/hft-sample-ui
src/hft/scripts/misc/cookies.js
function(name, opt_path) { var path = opt_path || "/"; /** * Sets the cookie * @param {string} value value for cookie * @param {number?} opt_days number of days until cookie * expires. Default = none */ this.set = function(value, opt_days) { if (value === undefined) { ...
javascript
function(name, opt_path) { var path = opt_path || "/"; /** * Sets the cookie * @param {string} value value for cookie * @param {number?} opt_days number of days until cookie * expires. Default = none */ this.set = function(value, opt_days) { if (value === undefined) { ...
[ "function", "(", "name", ",", "opt_path", ")", "{", "var", "path", "=", "opt_path", "||", "\"/\"", ";", "/**\n * Sets the cookie\n * @param {string} value value for cookie\n * @param {number?} opt_days number of days until cookie\n * expires. Default = none\n *...
Represents a cookie. This is an object, that way you set the name just once so calling set or get you don't have to worry about getting the name wrong. @example var fooCookie = new Cookie("foo"); var value = fooCookie.get(); fooCookie.set(newValue); fooCookie.erase(); @constructor @alias Cookie @param {string} name ...
[ "Represents", "a", "cookie", "." ]
b9e20afd5183db73522bcfae48225c87e01f68c0
https://github.com/greggman/hft-sample-ui/blob/b9e20afd5183db73522bcfae48225c87e01f68c0/src/hft/scripts/misc/cookies.js#L54-L114
56,619
sax1johno/simple-logger
lib/simple_logger.js
SimpleLogger
function SimpleLogger() { /* This class is a singleton */ if (arguments.callee._singletonInstance) { return arguments.callee._singletonInstance; } arguments.callee._singletonInstance = this; EventEmitter.call(this); // First, some basic loglevels. These can be overridden b...
javascript
function SimpleLogger() { /* This class is a singleton */ if (arguments.callee._singletonInstance) { return arguments.callee._singletonInstance; } arguments.callee._singletonInstance = this; EventEmitter.call(this); // First, some basic loglevels. These can be overridden b...
[ "function", "SimpleLogger", "(", ")", "{", "/* This class is a singleton */", "if", "(", "arguments", ".", "callee", ".", "_singletonInstance", ")", "{", "return", "arguments", ".", "callee", ".", "_singletonInstance", ";", "}", "arguments", ".", "callee", ".", ...
SimpleLogger is a basic logging utility that uses events to let developers manage logging facilities. By default, events are merely fired when the appropriate loglevels are encountered and provides a basic console logger that can be used by the developer. Logging functionality can be overridden by removing the listene...
[ "SimpleLogger", "is", "a", "basic", "logging", "utility", "that", "uses", "events", "to", "let", "developers", "manage", "logging", "facilities", ".", "By", "default", "events", "are", "merely", "fired", "when", "the", "appropriate", "loglevels", "are", "encount...
e58f2f575198e165721f8fdd0457be3c74b0c4b7
https://github.com/sax1johno/simple-logger/blob/e58f2f575198e165721f8fdd0457be3c74b0c4b7/lib/simple_logger.js#L16-L56
56,620
gtriggiano/dnsmq-messagebus
src/Node.js
activate
function activate () { if (_active) return node _active = true debug('activated') if (!external) { _masterBroker.bind() _masterResolver.bind() } if (!node.isReady) _seekForMaster() return node }
javascript
function activate () { if (_active) return node _active = true debug('activated') if (!external) { _masterBroker.bind() _masterResolver.bind() } if (!node.isReady) _seekForMaster() return node }
[ "function", "activate", "(", ")", "{", "if", "(", "_active", ")", "return", "node", "_active", "=", "true", "debug", "(", "'activated'", ")", "if", "(", "!", "external", ")", "{", "_masterBroker", ".", "bind", "(", ")", "_masterResolver", ".", "bind", ...
Activates the node @return {object} node instance
[ "Activates", "the", "node" ]
ab935cae537f8a7e61a6ed6fba247661281c9374
https://github.com/gtriggiano/dnsmq-messagebus/blob/ab935cae537f8a7e61a6ed6fba247661281c9374/src/Node.js#L150-L161
56,621
gtriggiano/dnsmq-messagebus
src/Node.js
deactivate
function deactivate () { if (!_active || _deactivating) return node debug('deactivating') if (external) { _active = false _subConnection.disconnect() _pubConnection.disconnect() node.emit('deactivated') } else { _deactivating = true let ensuredMaster = Promise.resolv...
javascript
function deactivate () { if (!_active || _deactivating) return node debug('deactivating') if (external) { _active = false _subConnection.disconnect() _pubConnection.disconnect() node.emit('deactivated') } else { _deactivating = true let ensuredMaster = Promise.resolv...
[ "function", "deactivate", "(", ")", "{", "if", "(", "!", "_active", "||", "_deactivating", ")", "return", "node", "debug", "(", "'deactivating'", ")", "if", "(", "external", ")", "{", "_active", "=", "false", "_subConnection", ".", "disconnect", "(", ")", ...
Starts the node's deactivation routine @return {object} node instance
[ "Starts", "the", "node", "s", "deactivation", "routine" ]
ab935cae537f8a7e61a6ed6fba247661281c9374
https://github.com/gtriggiano/dnsmq-messagebus/blob/ab935cae537f8a7e61a6ed6fba247661281c9374/src/Node.js#L166-L215
56,622
gtriggiano/dnsmq-messagebus
src/Node.js
publish
function publish (channel, ...args) { if (!isString(channel)) throw new TypeError(`${_debugStr}: .publish(channel, [...args]) channel MUST be a string`) if (~internalChannels.indexOf(channel)) { console.warn(`${_debugStr} channel '${channel}' is used internally and you cannot publish in it`) return ...
javascript
function publish (channel, ...args) { if (!isString(channel)) throw new TypeError(`${_debugStr}: .publish(channel, [...args]) channel MUST be a string`) if (~internalChannels.indexOf(channel)) { console.warn(`${_debugStr} channel '${channel}' is used internally and you cannot publish in it`) return ...
[ "function", "publish", "(", "channel", ",", "...", "args", ")", "{", "if", "(", "!", "isString", "(", "channel", ")", ")", "throw", "new", "TypeError", "(", "`", "${", "_debugStr", "}", "`", ")", "if", "(", "~", "internalChannels", ".", "indexOf", "(...
Sends a message through the bus, published on a particular channel @param {string} channel @param {array} args @return {object} node instance
[ "Sends", "a", "message", "through", "the", "bus", "published", "on", "a", "particular", "channel" ]
ab935cae537f8a7e61a6ed6fba247661281c9374
https://github.com/gtriggiano/dnsmq-messagebus/blob/ab935cae537f8a7e61a6ed6fba247661281c9374/src/Node.js#L222-L234
56,623
gtriggiano/dnsmq-messagebus
src/Node.js
unsubscribe
function unsubscribe (channels) { if (!isArray(channels)) channels = [channels] if (!every(channels, isString)) throw new TypeError(`${_debugStr}: .unsubscribe([channels]) channels must be represented by strings`) channels.forEach(channel => { if (~internalChannels.indexOf(channel)) { console...
javascript
function unsubscribe (channels) { if (!isArray(channels)) channels = [channels] if (!every(channels, isString)) throw new TypeError(`${_debugStr}: .unsubscribe([channels]) channels must be represented by strings`) channels.forEach(channel => { if (~internalChannels.indexOf(channel)) { console...
[ "function", "unsubscribe", "(", "channels", ")", "{", "if", "(", "!", "isArray", "(", "channels", ")", ")", "channels", "=", "[", "channels", "]", "if", "(", "!", "every", "(", "channels", ",", "isString", ")", ")", "throw", "new", "TypeError", "(", ...
Unsubscribes the node from the provided channels @param {string|array<string>} channels @return {object} node instance
[ "Unsubscribes", "the", "node", "from", "the", "provided", "channels" ]
ab935cae537f8a7e61a6ed6fba247661281c9374
https://github.com/gtriggiano/dnsmq-messagebus/blob/ab935cae537f8a7e61a6ed6fba247661281c9374/src/Node.js#L258-L270
56,624
gtriggiano/dnsmq-messagebus
src/Node.js
_validateSettings
function _validateSettings (settings) { let { host, external, voteTimeout, electionPriority, coordinationPort } = settings if (!host || !isString(host)) throw new TypeError(ctorMessage('host is mandatory and should be a string.')) if (!isInteger(coordinationPort) || coordinationPort <= 0) ...
javascript
function _validateSettings (settings) { let { host, external, voteTimeout, electionPriority, coordinationPort } = settings if (!host || !isString(host)) throw new TypeError(ctorMessage('host is mandatory and should be a string.')) if (!isInteger(coordinationPort) || coordinationPort <= 0) ...
[ "function", "_validateSettings", "(", "settings", ")", "{", "let", "{", "host", ",", "external", ",", "voteTimeout", ",", "electionPriority", ",", "coordinationPort", "}", "=", "settings", "if", "(", "!", "host", "||", "!", "isString", "(", "host", ")", ")...
Validates a map of node settings @param {object} settings
[ "Validates", "a", "map", "of", "node", "settings" ]
ab935cae537f8a7e61a6ed6fba247661281c9374
https://github.com/gtriggiano/dnsmq-messagebus/blob/ab935cae537f8a7e61a6ed6fba247661281c9374/src/Node.js#L302-L319
56,625
kvnneff/deku-component-find-all
index.js
findAll
function findAll (tree, test) { var found = test(tree) ? [tree] : [] if (isNode(tree)) { if (tree.children.length > 0) { tree.children.forEach(function (child) { found = found.concat(findAll(child, test)) }) } } return found }
javascript
function findAll (tree, test) { var found = test(tree) ? [tree] : [] if (isNode(tree)) { if (tree.children.length > 0) { tree.children.forEach(function (child) { found = found.concat(findAll(child, test)) }) } } return found }
[ "function", "findAll", "(", "tree", ",", "test", ")", "{", "var", "found", "=", "test", "(", "tree", ")", "?", "[", "tree", "]", ":", "[", "]", "if", "(", "isNode", "(", "tree", ")", ")", "{", "if", "(", "tree", ".", "children", ".", "length", ...
Traverses the tree and returns all components that satisfy the function `test`. @param {DekuComponent} tree the tree to traverse @param {Function} test the test for each component @return {Array} the components that satisfied `test`
[ "Traverses", "the", "tree", "and", "returns", "all", "components", "that", "satisfy", "the", "function", "test", "." ]
dd18baf93fc036c61b5e081d06227f89a0697ee1
https://github.com/kvnneff/deku-component-find-all/blob/dd18baf93fc036c61b5e081d06227f89a0697ee1/index.js#L10-L21
56,626
imcuttle/quote-it
index.es5.js
quote
function quote(string) { var _Object$assign var quoteChar = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '"' if (quoteChar.length > 1 && process.env.NODE_ENV !== 'production') { console.error('quote: `quoteChar` is recommended as single character, but ' + JSON.stringify(quoteChar) + '...
javascript
function quote(string) { var _Object$assign var quoteChar = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '"' if (quoteChar.length > 1 && process.env.NODE_ENV !== 'production') { console.error('quote: `quoteChar` is recommended as single character, but ' + JSON.stringify(quoteChar) + '...
[ "function", "quote", "(", "string", ")", "{", "var", "_Object$assign", "var", "quoteChar", "=", "arguments", ".", "length", ">", "1", "&&", "arguments", "[", "1", "]", "!==", "undefined", "?", "arguments", "[", "1", "]", ":", "'\"'", "if", "(", "quoteC...
Uses `quoteChar` to wrap string. @public @param string {string} @param quoteChar {string} @return {string} @example import quote from 'quote-it' quote("abc", "'") === "'abc'"
[ "Uses", "quoteChar", "to", "wrap", "string", "." ]
51c020b78f020f7e6c89352a2807342631bf3b7e
https://github.com/imcuttle/quote-it/blob/51c020b78f020f7e6c89352a2807342631bf3b7e/index.es5.js#L56-L75
56,627
jurca/idb-entity
es2015/clone.js
cloneValue
function cloneValue(value, traversedValues) { if (!(value instanceof Object)) { return value } if (value instanceof Boolean) { return new Boolean(value.valueOf()) } if (value instanceof Number) { return new Number(value.valueOf()) } if (value instanceof String) { return new String(v...
javascript
function cloneValue(value, traversedValues) { if (!(value instanceof Object)) { return value } if (value instanceof Boolean) { return new Boolean(value.valueOf()) } if (value instanceof Number) { return new Number(value.valueOf()) } if (value instanceof String) { return new String(v...
[ "function", "cloneValue", "(", "value", ",", "traversedValues", ")", "{", "if", "(", "!", "(", "value", "instanceof", "Object", ")", ")", "{", "return", "value", "}", "if", "(", "value", "instanceof", "Boolean", ")", "{", "return", "new", "Boolean", "(",...
Clones the provided value using the structured clone algorithm. @param {*} value The value to clone. @param {Map<Object, Object>} traversedValues A map of traversed non-primitive keys and values. The keys are the keys and values traversed in the source structure or structures referencing this structure, the values are...
[ "Clones", "the", "provided", "value", "using", "the", "structured", "clone", "algorithm", "." ]
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L33-L112
56,628
jurca/idb-entity
es2015/clone.js
cloneArray
function cloneArray(source, traversedValues) { let clone = [] traversedValues.set(source, clone) cloneStructure( source.keys(), key => source[key], (key, value) => clone[key] = value, traversedValues ) return clone }
javascript
function cloneArray(source, traversedValues) { let clone = [] traversedValues.set(source, clone) cloneStructure( source.keys(), key => source[key], (key, value) => clone[key] = value, traversedValues ) return clone }
[ "function", "cloneArray", "(", "source", ",", "traversedValues", ")", "{", "let", "clone", "=", "[", "]", "traversedValues", ".", "set", "(", "source", ",", "clone", ")", "cloneStructure", "(", "source", ".", "keys", "(", ")", ",", "key", "=>", "source",...
Clones the provided array. @param {*[]} source The array to clone. @param {Map<Object, Object>} traversedValues A map of traversed non-primitive keys and values. The keys are the keys and values traversed in the source structure or structures referencing this structure, the values are the clones of the keys and values...
[ "Clones", "the", "provided", "array", "." ]
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L124-L136
56,629
jurca/idb-entity
es2015/clone.js
cloneMap
function cloneMap(source, traversedValues) { let clone = new Map() traversedValues.set(source, clone) cloneStructure( source.keys(), key => source.get(key), (key, value) => clone.set(key, value), traversedValues ) return clone }
javascript
function cloneMap(source, traversedValues) { let clone = new Map() traversedValues.set(source, clone) cloneStructure( source.keys(), key => source.get(key), (key, value) => clone.set(key, value), traversedValues ) return clone }
[ "function", "cloneMap", "(", "source", ",", "traversedValues", ")", "{", "let", "clone", "=", "new", "Map", "(", ")", "traversedValues", ".", "set", "(", "source", ",", "clone", ")", "cloneStructure", "(", "source", ".", "keys", "(", ")", ",", "key", "...
Clones the provided map. @param {Map<*, *>} source The map to clone. @param {Map<Object, Object>} traversedValues A map of traversed non-primitive keys and values. The keys are the keys and values traversed in the source structure or structures referencing this structure, the values are the clones of the keys and valu...
[ "Clones", "the", "provided", "map", "." ]
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L148-L160
56,630
jurca/idb-entity
es2015/clone.js
cloneSet
function cloneSet(source, traversedValues) { let clone = new Set() traversedValues.set(source, clone) cloneStructure( source.values(), entry => undefined, entry => clone.add(entry), traversedValues ) return clone }
javascript
function cloneSet(source, traversedValues) { let clone = new Set() traversedValues.set(source, clone) cloneStructure( source.values(), entry => undefined, entry => clone.add(entry), traversedValues ) return clone }
[ "function", "cloneSet", "(", "source", ",", "traversedValues", ")", "{", "let", "clone", "=", "new", "Set", "(", ")", "traversedValues", ".", "set", "(", "source", ",", "clone", ")", "cloneStructure", "(", "source", ".", "values", "(", ")", ",", "entry",...
Clones the provided set. @param {Set<*>} source The set to clone. @param {Map<Object, Object>} traversedValues A map of traversed non-primitive keys and values. The keys are the keys and values traversed in the source structure or structures referencing this structure, the values are the clones of the keys and values....
[ "Clones", "the", "provided", "set", "." ]
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L172-L184
56,631
jurca/idb-entity
es2015/clone.js
cloneObject
function cloneObject(source, traversedValues) { let clone = {} traversedValues.set(source, clone) cloneStructure( Object.keys(source), key => source[key], (key, value) => clone[key] = value, traversedValues ) return clone }
javascript
function cloneObject(source, traversedValues) { let clone = {} traversedValues.set(source, clone) cloneStructure( Object.keys(source), key => source[key], (key, value) => clone[key] = value, traversedValues ) return clone }
[ "function", "cloneObject", "(", "source", ",", "traversedValues", ")", "{", "let", "clone", "=", "{", "}", "traversedValues", ".", "set", "(", "source", ",", "clone", ")", "cloneStructure", "(", "Object", ".", "keys", "(", "source", ")", ",", "key", "=>"...
Clones the provided plain object. Symbol and prototype properties are not copied. @param {Object<string, *>} source The object to clone. @param {Map<Object, Object>} traversedValues A map of traversed non-primitive keys and values. The keys are the keys and values traversed in the source structure or structures refere...
[ "Clones", "the", "provided", "plain", "object", ".", "Symbol", "and", "prototype", "properties", "are", "not", "copied", "." ]
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L197-L209
56,632
jurca/idb-entity
es2015/clone.js
cloneStructure
function cloneStructure(keys, getter, setter, traversedValues) { for (let key of keys) { let value = getter(key) let keyClone if (key instanceof Object) { if (traversedValues.has(key)) { keyClone = traversedValues.get(key) } else { keyClone = cloneValue(key, traversedValue...
javascript
function cloneStructure(keys, getter, setter, traversedValues) { for (let key of keys) { let value = getter(key) let keyClone if (key instanceof Object) { if (traversedValues.has(key)) { keyClone = traversedValues.get(key) } else { keyClone = cloneValue(key, traversedValue...
[ "function", "cloneStructure", "(", "keys", ",", "getter", ",", "setter", ",", "traversedValues", ")", "{", "for", "(", "let", "key", "of", "keys", ")", "{", "let", "value", "=", "getter", "(", "key", ")", "let", "keyClone", "if", "(", "key", "instanceo...
Clones the structure having the specified property keys, using the provided getters and setters. The function clones the keys and values before setting them using the setters. The cloned structure may contain circular references, the function keeps track of those using the {@code traversedValues} map. @param {(*[]|{[...
[ "Clones", "the", "structure", "having", "the", "specified", "property", "keys", "using", "the", "provided", "getters", "and", "setters", ".", "The", "function", "clones", "the", "keys", "and", "values", "before", "setting", "them", "using", "the", "setters", "...
361ef8482872d9fc9a0d83b86970d49d391dc276
https://github.com/jurca/idb-entity/blob/361ef8482872d9fc9a0d83b86970d49d391dc276/es2015/clone.js#L232-L260
56,633
labs42/prelint
src/prelint.js
getStagedFiles
function getStagedFiles(callback) { const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ] execFile('git', options, (err, stdout) => { if (err) return callback(err) const stagedFiles = stdout .split('\n') .filter(filename => filename.match(/.js$/))...
javascript
function getStagedFiles(callback) { const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ] execFile('git', options, (err, stdout) => { if (err) return callback(err) const stagedFiles = stdout .split('\n') .filter(filename => filename.match(/.js$/))...
[ "function", "getStagedFiles", "(", "callback", ")", "{", "const", "options", "=", "[", "'diff'", ",", "'--cached'", ",", "'--name-only'", ",", "'--diff-filter=ACM'", "]", "execFile", "(", "'git'", ",", "options", ",", "(", "err", ",", "stdout", ")", "=>", ...
Calls callback with list of staged files @param {Function} callback @returns {void}
[ "Calls", "callback", "with", "list", "of", "staged", "files" ]
94d81bb786ae3a7ec759a1ba2c10461b34f6a15f
https://github.com/labs42/prelint/blob/94d81bb786ae3a7ec759a1ba2c10461b34f6a15f/src/prelint.js#L15-L31
56,634
labs42/prelint
src/prelint.js
lintFiles
function lintFiles(files) { const eslint = new CLIEngine() const report = eslint.executeOnFiles(files) return { text: friendlyFormatter(report.results), errorCount: report.errorCount, } }
javascript
function lintFiles(files) { const eslint = new CLIEngine() const report = eslint.executeOnFiles(files) return { text: friendlyFormatter(report.results), errorCount: report.errorCount, } }
[ "function", "lintFiles", "(", "files", ")", "{", "const", "eslint", "=", "new", "CLIEngine", "(", ")", "const", "report", "=", "eslint", ".", "executeOnFiles", "(", "files", ")", "return", "{", "text", ":", "friendlyFormatter", "(", "report", ".", "results...
Perform ESLint validation on list of files @param {Array<string>} files @returns {Object} report
[ "Perform", "ESLint", "validation", "on", "list", "of", "files" ]
94d81bb786ae3a7ec759a1ba2c10461b34f6a15f
https://github.com/labs42/prelint/blob/94d81bb786ae3a7ec759a1ba2c10461b34f6a15f/src/prelint.js#L38-L49
56,635
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/editor.js
isSupportedElement
function isSupportedElement( element, mode ) { if ( mode == CKEDITOR.ELEMENT_MODE_INLINE ) return element.is( CKEDITOR.dtd.$editable ) || element.is( 'textarea' ); else if ( mode == CKEDITOR.ELEMENT_MODE_REPLACE ) return !element.is( CKEDITOR.dtd.$nonBodyContent ); return 1; }
javascript
function isSupportedElement( element, mode ) { if ( mode == CKEDITOR.ELEMENT_MODE_INLINE ) return element.is( CKEDITOR.dtd.$editable ) || element.is( 'textarea' ); else if ( mode == CKEDITOR.ELEMENT_MODE_REPLACE ) return !element.is( CKEDITOR.dtd.$nonBodyContent ); return 1; }
[ "function", "isSupportedElement", "(", "element", ",", "mode", ")", "{", "if", "(", "mode", "==", "CKEDITOR", ".", "ELEMENT_MODE_INLINE", ")", "return", "element", ".", "is", "(", "CKEDITOR", ".", "dtd", ".", "$editable", ")", "||", "element", ".", "is", ...
Asserting element DTD depending on mode.
[ "Asserting", "element", "DTD", "depending", "on", "mode", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/editor.js#L200-L206
56,636
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/editor.js
initComponents
function initComponents( editor ) { // Documented in dataprocessor.js. editor.dataProcessor = new CKEDITOR.htmlDataProcessor( editor ); // Set activeFilter directly to avoid firing event. editor.filter = editor.activeFilter = new CKEDITOR.filter( editor ); loadSkin( editor ); }
javascript
function initComponents( editor ) { // Documented in dataprocessor.js. editor.dataProcessor = new CKEDITOR.htmlDataProcessor( editor ); // Set activeFilter directly to avoid firing event. editor.filter = editor.activeFilter = new CKEDITOR.filter( editor ); loadSkin( editor ); }
[ "function", "initComponents", "(", "editor", ")", "{", "// Documented in dataprocessor.js.", "editor", ".", "dataProcessor", "=", "new", "CKEDITOR", ".", "htmlDataProcessor", "(", "editor", ")", ";", "// Set activeFilter directly to avoid firing event.", "editor", ".", "f...
Various other core components that read editor configuration.
[ "Various", "other", "core", "components", "that", "read", "editor", "configuration", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/editor.js#L389-L397
56,637
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/editor.js
updateEditorElement
function updateEditorElement() { var element = this.element; // Some editor creation mode will not have the // associated element. if ( element && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO ) { var data = this.getData(); if ( this.config.htmlEncodeOutput ) data = CKEDITOR.tools.htmlEncode( d...
javascript
function updateEditorElement() { var element = this.element; // Some editor creation mode will not have the // associated element. if ( element && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO ) { var data = this.getData(); if ( this.config.htmlEncodeOutput ) data = CKEDITOR.tools.htmlEncode( d...
[ "function", "updateEditorElement", "(", ")", "{", "var", "element", "=", "this", ".", "element", ";", "// Some editor creation mode will not have the", "// associated element.", "if", "(", "element", "&&", "this", ".", "elementMode", "!=", "CKEDITOR", ".", "ELEMENT_MO...
Send to data output back to editor's associated element.
[ "Send", "to", "data", "output", "back", "to", "editor", "s", "associated", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/editor.js#L625-L644
56,638
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/editor.js
function( commandName, data ) { var command = this.getCommand( commandName ); var eventData = { name: commandName, commandData: data, command: command }; if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) { if ( this.fire( 'beforeCommandExec', eventData ) !== false ) { even...
javascript
function( commandName, data ) { var command = this.getCommand( commandName ); var eventData = { name: commandName, commandData: data, command: command }; if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) { if ( this.fire( 'beforeCommandExec', eventData ) !== false ) { even...
[ "function", "(", "commandName", ",", "data", ")", "{", "var", "command", "=", "this", ".", "getCommand", "(", "commandName", ")", ";", "var", "eventData", "=", "{", "name", ":", "commandName", ",", "commandData", ":", "data", ",", "command", ":", "comman...
Executes a command associated with the editor. editorInstance.execCommand( 'bold' ); @param {String} commandName The indentifier name of the command. @param {Object} [data] Data to be passed to the command. @returns {Boolean} `true` if the command was executed successfully, otherwise `false`. @see CKEDITOR.editor#add...
[ "Executes", "a", "command", "associated", "with", "the", "editor", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/editor.js#L819-L840
56,639
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/editor.js
function() { var keystrokes = this.keystrokeHandler.keystrokes, newKeystrokes = CKEDITOR.tools.isArray( arguments[ 0 ] ) ? arguments[ 0 ] : [ [].slice.call( arguments, 0 ) ], keystroke, behavior; for ( var i = newKeystrokes.length; i--; ) { keystroke = newKeystrokes[ i ]; behavior = 0; // It...
javascript
function() { var keystrokes = this.keystrokeHandler.keystrokes, newKeystrokes = CKEDITOR.tools.isArray( arguments[ 0 ] ) ? arguments[ 0 ] : [ [].slice.call( arguments, 0 ) ], keystroke, behavior; for ( var i = newKeystrokes.length; i--; ) { keystroke = newKeystrokes[ i ]; behavior = 0; // It...
[ "function", "(", ")", "{", "var", "keystrokes", "=", "this", ".", "keystrokeHandler", ".", "keystrokes", ",", "newKeystrokes", "=", "CKEDITOR", ".", "tools", ".", "isArray", "(", "arguments", "[", "0", "]", ")", "?", "arguments", "[", "0", "]", ":", "[...
Assigns keystrokes associated to editor commands. editor.setKeystroke( CKEDITOR.CTRL + 115, 'save' ); // Assigned CTRL+S to "save" command. editor.setKeystroke( CKEDITOR.CTRL + 115, false ); // Disabled CTRL+S keystroke assignment. editor.setKeystroke( [ [ CKEDITOR.ALT + 122, false ], [ CKEDITOR.CTRL + 121, 'link' ], ...
[ "Assigns", "keystrokes", "associated", "to", "editor", "commands", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/editor.js#L1153-L1173
56,640
pinyin/outline
vendor/transformation-matrix/transform.js
transform
function transform() { for (var _len = arguments.length, matrices = Array(_len), _key = 0; _key < _len; _key++) { matrices[_key] = arguments[_key]; } matrices = Array.isArray(matrices[0]) ? matrices[0] : matrices; var multiply = function multiply(m1, m2) { return { a: m1.a ...
javascript
function transform() { for (var _len = arguments.length, matrices = Array(_len), _key = 0; _key < _len; _key++) { matrices[_key] = arguments[_key]; } matrices = Array.isArray(matrices[0]) ? matrices[0] : matrices; var multiply = function multiply(m1, m2) { return { a: m1.a ...
[ "function", "transform", "(", ")", "{", "for", "(", "var", "_len", "=", "arguments", ".", "length", ",", "matrices", "=", "Array", "(", "_len", ")", ",", "_key", "=", "0", ";", "_key", "<", "_len", ";", "_key", "++", ")", "{", "matrices", "[", "_...
Merge multiple matrices into one @param matrices {...object} list of matrices @returns {{a: number, b: number, c: number, e: number, d: number, f: number}} Affine matrix
[ "Merge", "multiple", "matrices", "into", "one" ]
e49f05d2f8ab384f5b1d71b2b10875cd48d41051
https://github.com/pinyin/outline/blob/e49f05d2f8ab384f5b1d71b2b10875cd48d41051/vendor/transformation-matrix/transform.js#L28-L62
56,641
stadt-bielefeld/wms-capabilities-tools
baseUrl.js
correctQuestionMarkAndAnd
function correctQuestionMarkAndAnd(url) { var baseURL = url; // Remove && mistake baseURL = baseURL.replace(new RegExp('&&', 'g'), '&'); // Ends width ? if (new RegExp('[\?]$').test(baseURL)) { // Do nothing } else { // Does not end on ? // Contains ? if (baseURL.includes('?')) { // Ends width & i...
javascript
function correctQuestionMarkAndAnd(url) { var baseURL = url; // Remove && mistake baseURL = baseURL.replace(new RegExp('&&', 'g'), '&'); // Ends width ? if (new RegExp('[\?]$').test(baseURL)) { // Do nothing } else { // Does not end on ? // Contains ? if (baseURL.includes('?')) { // Ends width & i...
[ "function", "correctQuestionMarkAndAnd", "(", "url", ")", "{", "var", "baseURL", "=", "url", ";", "// Remove && mistake", "baseURL", "=", "baseURL", ".", "replace", "(", "new", "RegExp", "(", "'&&'", ",", "'g'", ")", ",", "'&'", ")", ";", "// Ends width ?", ...
Correct mistakes with the characters '?' and '&'. @param {string} url URL with mistakes with the characters '?' and '&'. @returns {string} URL without mistakes with the characters '?' and '&'.
[ "Correct", "mistakes", "with", "the", "characters", "?", "and", "&", "." ]
647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1
https://github.com/stadt-bielefeld/wms-capabilities-tools/blob/647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1/baseUrl.js#L96-L160
56,642
stadt-bielefeld/wms-capabilities-tools
baseUrl.js
removeParameters
function removeParameters(url) { var baseURL = url; // Iterate over all parameters for (var int = 0; int < params.length; int++) { // Remove parameter baseURL = baseURL.replace(new RegExp(params[int] + '=[^&]*&', 'ig'), ''); } return baseURL; }
javascript
function removeParameters(url) { var baseURL = url; // Iterate over all parameters for (var int = 0; int < params.length; int++) { // Remove parameter baseURL = baseURL.replace(new RegExp(params[int] + '=[^&]*&', 'ig'), ''); } return baseURL; }
[ "function", "removeParameters", "(", "url", ")", "{", "var", "baseURL", "=", "url", ";", "// Iterate over all parameters", "for", "(", "var", "int", "=", "0", ";", "int", "<", "params", ".", "length", ";", "int", "++", ")", "{", "// Remove parameter", "bas...
Removes OWS-Parameters from URL. The Parameters are defined at removeParameters.json. @param {string} url URL with OWS-Parameters. @returns {string} URL without OWS-Parameters.
[ "Removes", "OWS", "-", "Parameters", "from", "URL", ".", "The", "Parameters", "are", "defined", "at", "removeParameters", ".", "json", "." ]
647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1
https://github.com/stadt-bielefeld/wms-capabilities-tools/blob/647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1/baseUrl.js#L170-L181
56,643
stadt-bielefeld/wms-capabilities-tools
baseUrl.js
determineBaseURL
function determineBaseURL(url) { var baseURL; // Check if url is set if (url) { // Remove whitespace baseURL = url.trim(); baseURL = correctHttpAndHttps(baseURL); baseURL = correctQuestionMarkAndAnd(baseURL); baseURL = removeParameters(baseURL); } else { // Throw error (no url) throw new Error('T...
javascript
function determineBaseURL(url) { var baseURL; // Check if url is set if (url) { // Remove whitespace baseURL = url.trim(); baseURL = correctHttpAndHttps(baseURL); baseURL = correctQuestionMarkAndAnd(baseURL); baseURL = removeParameters(baseURL); } else { // Throw error (no url) throw new Error('T...
[ "function", "determineBaseURL", "(", "url", ")", "{", "var", "baseURL", ";", "// Check if url is set", "if", "(", "url", ")", "{", "// Remove whitespace", "baseURL", "=", "url", ".", "trim", "(", ")", ";", "baseURL", "=", "correctHttpAndHttps", "(", "baseURL",...
Corrects all mistakes in a URL. @param {string} url URL with mistakes. @returns {string} URL without mistakes.
[ "Corrects", "all", "mistakes", "in", "a", "URL", "." ]
647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1
https://github.com/stadt-bielefeld/wms-capabilities-tools/blob/647321bc7fb9a50a5fdc6c3424ede3d9c0fd1cb1/baseUrl.js#L190-L210
56,644
robertblackwell/yake
src/yake/cli_args.js
ParseWithConfig
function ParseWithConfig(config, argv) { const debug = false; const parser = dashdash.createParser({ options : config }); const helpText = parser.help({ includeEnv : true }).trimRight(); try { const opts = parser.parse(argv, 2); const innerOptions = parser.options; const key...
javascript
function ParseWithConfig(config, argv) { const debug = false; const parser = dashdash.createParser({ options : config }); const helpText = parser.help({ includeEnv : true }).trimRight(); try { const opts = parser.parse(argv, 2); const innerOptions = parser.options; const key...
[ "function", "ParseWithConfig", "(", "config", ",", "argv", ")", "{", "const", "debug", "=", "false", ";", "const", "parser", "=", "dashdash", ".", "createParser", "(", "{", "options", ":", "config", "}", ")", ";", "const", "helpText", "=", "parser", ".",...
ParseWithConfig - A function that parses an array of command line options and arguments @param {object} config The configuration @param {array} argv an array of things like command line options and arguments @return {array} of CliOptions, CliAruments} returns 2 values via an array.length =...
[ "ParseWithConfig", "-", "A", "function", "that", "parses", "an", "array", "of", "command", "line", "options", "and", "arguments" ]
172b02e29303fb718bac88bbda9b85749c57169c
https://github.com/robertblackwell/yake/blob/172b02e29303fb718bac88bbda9b85749c57169c/src/yake/cli_args.js#L295-L340
56,645
pierrec/node-atok-parser
lib/helpers.js
hasEscapeFirst
function hasEscapeFirst (data, offset) { isBuffer = (!isQuiet && typeof data !== 'string') escaped = (this.prev.idx > 0) return escaped ? ( escapeOffset = offset - escLength, -1 ) //HACK to bypass the trimLeft/trimRight properties : ( this.prev.prev.length = leftLength + 1, atok.offset--,...
javascript
function hasEscapeFirst (data, offset) { isBuffer = (!isQuiet && typeof data !== 'string') escaped = (this.prev.idx > 0) return escaped ? ( escapeOffset = offset - escLength, -1 ) //HACK to bypass the trimLeft/trimRight properties : ( this.prev.prev.length = leftLength + 1, atok.offset--,...
[ "function", "hasEscapeFirst", "(", "data", ",", "offset", ")", "{", "isBuffer", "=", "(", "!", "isQuiet", "&&", "typeof", "data", "!==", "'string'", ")", "escaped", "=", "(", "this", ".", "prev", ".", "idx", ">", "0", ")", "return", "escaped", "?", "...
Make the rule fail if an escape char was found
[ "Make", "the", "rule", "fail", "if", "an", "escape", "char", "was", "found" ]
414d39904dff73ffdde049212076c14ca40aa20b
https://github.com/pierrec/node-atok-parser/blob/414d39904dff73ffdde049212076c14ca40aa20b/lib/helpers.js#L774-L782
56,646
vitorleal/say-something
lib/say-something.js
function (config) { 'use strict'; //If is not instance of SaySomething return a new instance if (false === (this instanceof SaySomething)) { return new SaySomething(config); } events.EventEmitter.call(this); this.defaults = { language: 'en' }; //Extend default with the config object _.ext...
javascript
function (config) { 'use strict'; //If is not instance of SaySomething return a new instance if (false === (this instanceof SaySomething)) { return new SaySomething(config); } events.EventEmitter.call(this); this.defaults = { language: 'en' }; //Extend default with the config object _.ext...
[ "function", "(", "config", ")", "{", "'use strict'", ";", "//If is not instance of SaySomething return a new instance", "if", "(", "false", "===", "(", "this", "instanceof", "SaySomething", ")", ")", "{", "return", "new", "SaySomething", "(", "config", ")", ";", ...
Creates an instance of the SaySomething object. @class @param config {object} - configuration object. @param config.language {string} - OPTIONAL (dafault 'en'). @extends EventEmitter @fires taliking - will be emitted when talking something. @fires done - will be emitted after say something. @example ```js var SaySometh...
[ "Creates", "an", "instance", "of", "the", "SaySomething", "object", "." ]
e197c520dcfa44d267a30f6c10fed521b830e8e1
https://github.com/vitorleal/say-something/blob/e197c520dcfa44d267a30f6c10fed521b830e8e1/lib/say-something.js#L25-L43
56,647
byu-oit/sans-server-swagger
bin/middleware.js
executeController
function executeController(server, controller, req, res) { try { const promise = controller.call(server, req, res); if (promise && typeof promise.catch === 'function') { promise.catch(function(err) { res.status(500).send(err); }); } } catch (err) {...
javascript
function executeController(server, controller, req, res) { try { const promise = controller.call(server, req, res); if (promise && typeof promise.catch === 'function') { promise.catch(function(err) { res.status(500).send(err); }); } } catch (err) {...
[ "function", "executeController", "(", "server", ",", "controller", ",", "req", ",", "res", ")", "{", "try", "{", "const", "promise", "=", "controller", ".", "call", "(", "server", ",", "req", ",", "res", ")", ";", "if", "(", "promise", "&&", "typeof", ...
Safely execute a controller. @param server @param controller @param req @param res
[ "Safely", "execute", "a", "controller", "." ]
455e76b8d65451e606e3c7894ff08affbeb447f1
https://github.com/byu-oit/sans-server-swagger/blob/455e76b8d65451e606e3c7894ff08affbeb447f1/bin/middleware.js#L311-L322
56,648
byu-oit/sans-server-swagger
bin/middleware.js
findMatchingExample
function findMatchingExample(req, code, type) { const swagger = req.swagger.root; const responses = req.swagger.rel.responses; // if no responses then exit const responseKeys = responses && typeof responses === 'object' ? Object.keys(responses) : []; if (responseKeys.length === 0) return { code: 50...
javascript
function findMatchingExample(req, code, type) { const swagger = req.swagger.root; const responses = req.swagger.rel.responses; // if no responses then exit const responseKeys = responses && typeof responses === 'object' ? Object.keys(responses) : []; if (responseKeys.length === 0) return { code: 50...
[ "function", "findMatchingExample", "(", "req", ",", "code", ",", "type", ")", "{", "const", "swagger", "=", "req", ".", "swagger", ".", "root", ";", "const", "responses", "=", "req", ".", "swagger", ".", "rel", ".", "responses", ";", "// if no responses th...
Look through swagger examples and find a match based on the accept content type @param {object} req @param {string|number} [code] @param {string} [type] @returns {{ code: number, type: string|undefined }}
[ "Look", "through", "swagger", "examples", "and", "find", "a", "match", "based", "on", "the", "accept", "content", "type" ]
455e76b8d65451e606e3c7894ff08affbeb447f1
https://github.com/byu-oit/sans-server-swagger/blob/455e76b8d65451e606e3c7894ff08affbeb447f1/bin/middleware.js#L331-L391
56,649
byu-oit/sans-server-swagger
bin/middleware.js
loadController
function loadController(controllersDirectory, controller, development) { const filePath = path.resolve(controllersDirectory, controller); try { return require(filePath); } catch (e) { if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf("Cannot find module '" + filePath + "'") === 0 && dev...
javascript
function loadController(controllersDirectory, controller, development) { const filePath = path.resolve(controllersDirectory, controller); try { return require(filePath); } catch (e) { if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf("Cannot find module '" + filePath + "'") === 0 && dev...
[ "function", "loadController", "(", "controllersDirectory", ",", "controller", ",", "development", ")", "{", "const", "filePath", "=", "path", ".", "resolve", "(", "controllersDirectory", ",", "controller", ")", ";", "try", "{", "return", "require", "(", "filePat...
Attempt to load a node module as a controller. @param {string} controllersDirectory @param {string} controller @param {boolean} development @returns {*}
[ "Attempt", "to", "load", "a", "node", "module", "as", "a", "controller", "." ]
455e76b8d65451e606e3c7894ff08affbeb447f1
https://github.com/byu-oit/sans-server-swagger/blob/455e76b8d65451e606e3c7894ff08affbeb447f1/bin/middleware.js#L400-L412
56,650
niallo/deadlift
lib/heroku.js
full_uri_encode
function full_uri_encode(string) { string = encodeURIComponent(string); string = string.replace(/\./g, '%2E'); return(string); }
javascript
function full_uri_encode(string) { string = encodeURIComponent(string); string = string.replace(/\./g, '%2E'); return(string); }
[ "function", "full_uri_encode", "(", "string", ")", "{", "string", "=", "encodeURIComponent", "(", "string", ")", ";", "string", "=", "string", ".", "replace", "(", "/", "\\.", "/", "g", ",", "'%2E'", ")", ";", "return", "(", "string", ")", ";", "}" ]
Special Heroku URI encoding. Used for key deletes.
[ "Special", "Heroku", "URI", "encoding", ".", "Used", "for", "key", "deletes", "." ]
ff37d4eeccc326ec5e1390394585f6ac10bcc703
https://github.com/niallo/deadlift/blob/ff37d4eeccc326ec5e1390394585f6ac10bcc703/lib/heroku.js#L97-L101
56,651
niallo/deadlift
lib/heroku.js
function(err, privkey, pubkey) { if (err) throw err; this.pubkey = pubkey; this.privkey = privkey; this.user_host_field = pubkey.split(' ')[2].trim(); console.log("Adding Heroku SSH keypair via API"); add_ssh_key(api_key, pubkey, this); }
javascript
function(err, privkey, pubkey) { if (err) throw err; this.pubkey = pubkey; this.privkey = privkey; this.user_host_field = pubkey.split(' ')[2].trim(); console.log("Adding Heroku SSH keypair via API"); add_ssh_key(api_key, pubkey, this); }
[ "function", "(", "err", ",", "privkey", ",", "pubkey", ")", "{", "if", "(", "err", ")", "throw", "err", ";", "this", ".", "pubkey", "=", "pubkey", ";", "this", ".", "privkey", "=", "privkey", ";", "this", ".", "user_host_field", "=", "pubkey", ".", ...
Add keypair to Heroku account
[ "Add", "keypair", "to", "Heroku", "account" ]
ff37d4eeccc326ec5e1390394585f6ac10bcc703
https://github.com/niallo/deadlift/blob/ff37d4eeccc326ec5e1390394585f6ac10bcc703/lib/heroku.js#L139-L146
56,652
niallo/deadlift
lib/heroku.js
function(err, r, b) { if (err) throw err; try { fs.unlink(keyname, this.parallel()); fs.unlink(keyname + ".pub", this.parallel()); } catch(e) { // do nothing }; console.log("Heroku SSH keypair deleted from local FS"); callback(err, this.privkey, this.pubkey, t...
javascript
function(err, r, b) { if (err) throw err; try { fs.unlink(keyname, this.parallel()); fs.unlink(keyname + ".pub", this.parallel()); } catch(e) { // do nothing }; console.log("Heroku SSH keypair deleted from local FS"); callback(err, this.privkey, this.pubkey, t...
[ "function", "(", "err", ",", "r", ",", "b", ")", "{", "if", "(", "err", ")", "throw", "err", ";", "try", "{", "fs", ".", "unlink", "(", "keyname", ",", "this", ".", "parallel", "(", ")", ")", ";", "fs", ".", "unlink", "(", "keyname", "+", "\"...
SSH key has been added, unlink files
[ "SSH", "key", "has", "been", "added", "unlink", "files" ]
ff37d4eeccc326ec5e1390394585f6ac10bcc703
https://github.com/niallo/deadlift/blob/ff37d4eeccc326ec5e1390394585f6ac10bcc703/lib/heroku.js#L148-L158
56,653
GrabarzUndPartner/gp-module-base
install.js
preparePackage
function preparePackage() { var ignoreFiles = ['package.json', 'README.md', 'LICENSE.md', '.gitignore', '.npmignore']; var ignoreCopyFiles = []; var copyRecursiveSync = function(src, dest) { var exists = fs.existsSync(src); var stats = exists && fs.statSync(src); var isDirectory = ex...
javascript
function preparePackage() { var ignoreFiles = ['package.json', 'README.md', 'LICENSE.md', '.gitignore', '.npmignore']; var ignoreCopyFiles = []; var copyRecursiveSync = function(src, dest) { var exists = fs.existsSync(src); var stats = exists && fs.statSync(src); var isDirectory = ex...
[ "function", "preparePackage", "(", ")", "{", "var", "ignoreFiles", "=", "[", "'package.json'", ",", "'README.md'", ",", "'LICENSE.md'", ",", "'.gitignore'", ",", "'.npmignore'", "]", ";", "var", "ignoreCopyFiles", "=", "[", "]", ";", "var", "copyRecursiveSync", ...
Clean package root and exclude src
[ "Clean", "package", "root", "and", "exclude", "src" ]
d255cf6cfec7d783b591dc6f5c4ef60ce913013c
https://github.com/GrabarzUndPartner/gp-module-base/blob/d255cf6cfec7d783b591dc6f5c4ef60ce913013c/install.js#L23-L57
56,654
jhermsmeier/node-bloodline
bloodline.js
describe
function describe( object ) { return Object.getOwnPropertyNames( object ) .reduce( function( desc, key ) { desc[ key ] = Object.getOwnPropertyDescriptor( object, key ) return desc }, Object.create( null )) }
javascript
function describe( object ) { return Object.getOwnPropertyNames( object ) .reduce( function( desc, key ) { desc[ key ] = Object.getOwnPropertyDescriptor( object, key ) return desc }, Object.create( null )) }
[ "function", "describe", "(", "object", ")", "{", "return", "Object", ".", "getOwnPropertyNames", "(", "object", ")", ".", "reduce", "(", "function", "(", "desc", ",", "key", ")", "{", "desc", "[", "key", "]", "=", "Object", ".", "getOwnPropertyDescriptor",...
Retrieves an object's description @param {Object} object @return {Object} description
[ "Retrieves", "an", "object", "s", "description" ]
a789250ca2f4d2dc7f3f653aaf784197ea3b3aeb
https://github.com/jhermsmeier/node-bloodline/blob/a789250ca2f4d2dc7f3f653aaf784197ea3b3aeb/bloodline.js#L6-L12
56,655
jhermsmeier/node-bloodline
bloodline.js
inherit
function inherit( ctor, sctor ) { ctor.prototype = Object.create( sctor.prototype, describe( ctor.prototype ) ) }
javascript
function inherit( ctor, sctor ) { ctor.prototype = Object.create( sctor.prototype, describe( ctor.prototype ) ) }
[ "function", "inherit", "(", "ctor", ",", "sctor", ")", "{", "ctor", ".", "prototype", "=", "Object", ".", "create", "(", "sctor", ".", "prototype", ",", "describe", "(", "ctor", ".", "prototype", ")", ")", "}" ]
Inherits from sctor to ctor @param {Function} ctor @param {Function} sctor @return {Object}
[ "Inherits", "from", "sctor", "to", "ctor" ]
a789250ca2f4d2dc7f3f653aaf784197ea3b3aeb
https://github.com/jhermsmeier/node-bloodline/blob/a789250ca2f4d2dc7f3f653aaf784197ea3b3aeb/bloodline.js#L20-L25
56,656
tsunammis/command-asker.js
lib/command-asker.js
CommandAsker
function CommandAsker(questions, options) { options = options || {}; if (!_.isArray(questions)) { throw "there are no questions available :'("; } this.questions = questions; this.response = {}; this.cli = readline.createInterface({ input: process.stdin, output: ...
javascript
function CommandAsker(questions, options) { options = options || {}; if (!_.isArray(questions)) { throw "there are no questions available :'("; } this.questions = questions; this.response = {}; this.cli = readline.createInterface({ input: process.stdin, output: ...
[ "function", "CommandAsker", "(", "questions", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "if", "(", "!", "_", ".", "isArray", "(", "questions", ")", ")", "{", "throw", "\"there are no questions available :'(\"", ";", "}", "th...
Create new asker @constructor
[ "Create", "new", "asker" ]
e157862cdb37fba4b89a0b98c25dc9037a64e1a9
https://github.com/tsunammis/command-asker.js/blob/e157862cdb37fba4b89a0b98c25dc9037a64e1a9/lib/command-asker.js#L21-L37
56,657
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
function( editor ) { // Backward compatibility. if ( editor instanceof CKEDITOR.dom.document ) return applyStyleOnSelection.call( this, editor.getSelection() ); if ( this.checkApplicable( editor.elementPath(), editor ) ) { var initialEnterMode = this._.enterMode; // See comment in removeStyle. ...
javascript
function( editor ) { // Backward compatibility. if ( editor instanceof CKEDITOR.dom.document ) return applyStyleOnSelection.call( this, editor.getSelection() ); if ( this.checkApplicable( editor.elementPath(), editor ) ) { var initialEnterMode = this._.enterMode; // See comment in removeStyle. ...
[ "function", "(", "editor", ")", "{", "// Backward compatibility.", "if", "(", "editor", "instanceof", "CKEDITOR", ".", "dom", ".", "document", ")", "return", "applyStyleOnSelection", ".", "call", "(", "this", ",", "editor", ".", "getSelection", "(", ")", ")", ...
Applies the style on the editor's current selection. Before the style is applied, the method checks if the {@link #checkApplicable style is applicable}. **Note:** The recommended way of applying the style is by using the {@link CKEDITOR.editor#applyStyle} method, which is a shorthand for this method. @param {CKEDITO...
[ "Applies", "the", "style", "on", "the", "editor", "s", "current", "selection", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L199-L213
56,658
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
function( elementPath, editor, filter ) { // Backward compatibility. if ( editor && editor instanceof CKEDITOR.filter ) filter = editor; if ( filter && !filter.check( this ) ) return false; switch ( this.type ) { case CKEDITOR.STYLE_OBJECT: return !!elementPath.contains( this.element ); ...
javascript
function( elementPath, editor, filter ) { // Backward compatibility. if ( editor && editor instanceof CKEDITOR.filter ) filter = editor; if ( filter && !filter.check( this ) ) return false; switch ( this.type ) { case CKEDITOR.STYLE_OBJECT: return !!elementPath.contains( this.element ); ...
[ "function", "(", "elementPath", ",", "editor", ",", "filter", ")", "{", "// Backward compatibility.", "if", "(", "editor", "&&", "editor", "instanceof", "CKEDITOR", ".", "filter", ")", "filter", "=", "editor", ";", "if", "(", "filter", "&&", "!", "filter", ...
Whether this style can be applied at the specified elements path. @param {CKEDITOR.dom.elementPath} elementPath The elements path to check the style against. @param {CKEDITOR.editor} editor The editor instance. Required argument since CKEditor 4.4. The style system will work without it, but it is highly recommended to...
[ "Whether", "this", "style", "can", "be", "applied", "at", "the", "specified", "elements", "path", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L365-L381
56,659
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
function( element, fullMatch ) { var def = this._.definition; if ( !element || !def.ignoreReadonly && element.isReadOnly() ) return false; var attribs, name = element.getName(); // If the element name is the same as the style name. if ( typeof this.element == 'string' ? name == this.element : ...
javascript
function( element, fullMatch ) { var def = this._.definition; if ( !element || !def.ignoreReadonly && element.isReadOnly() ) return false; var attribs, name = element.getName(); // If the element name is the same as the style name. if ( typeof this.element == 'string' ? name == this.element : ...
[ "function", "(", "element", ",", "fullMatch", ")", "{", "var", "def", "=", "this", ".", "_", ".", "definition", ";", "if", "(", "!", "element", "||", "!", "def", ".", "ignoreReadonly", "&&", "element", ".", "isReadOnly", "(", ")", ")", "return", "fal...
Checks if the element matches the current style definition. @param {CKEDITOR.dom.element} element @param {Boolean} fullMatch @param {CKEDITOR.editor} editor The editor instance. Required argument since CKEditor 4.4. The style system will work without it, but it is highly recommended to provide it for integration with ...
[ "Checks", "if", "the", "element", "matches", "the", "current", "style", "definition", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L394-L434
56,660
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
checkIfNodeCanBeChildOfStyle
function checkIfNodeCanBeChildOfStyle( def, currentNode, lastNode, nodeName, dtd, nodeIsNoStyle, nodeIsReadonly, includeReadonly ) { // Style can be applied to text node. if ( !nodeName ) return 1; // Style definitely cannot be applied if DTD or data-nostyle do not allow. if ( !dtd[ nodeName ] || nodeIsNoSt...
javascript
function checkIfNodeCanBeChildOfStyle( def, currentNode, lastNode, nodeName, dtd, nodeIsNoStyle, nodeIsReadonly, includeReadonly ) { // Style can be applied to text node. if ( !nodeName ) return 1; // Style definitely cannot be applied if DTD or data-nostyle do not allow. if ( !dtd[ nodeName ] || nodeIsNoSt...
[ "function", "checkIfNodeCanBeChildOfStyle", "(", "def", ",", "currentNode", ",", "lastNode", ",", "nodeName", ",", "dtd", ",", "nodeIsNoStyle", ",", "nodeIsReadonly", ",", "includeReadonly", ")", "{", "// Style can be applied to text node.", "if", "(", "!", "nodeName"...
Checks if the current node can be a child of the style element.
[ "Checks", "if", "the", "current", "node", "can", "be", "a", "child", "of", "the", "style", "element", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L753-L768
56,661
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
checkIfStyleCanBeChildOf
function checkIfStyleCanBeChildOf( def, currentParent, elementName, isUnknownElement ) { return currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) && ( !def.parentRule || def.parentRule( currentParent ) ); }
javascript
function checkIfStyleCanBeChildOf( def, currentParent, elementName, isUnknownElement ) { return currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) && ( !def.parentRule || def.parentRule( currentParent ) ); }
[ "function", "checkIfStyleCanBeChildOf", "(", "def", ",", "currentParent", ",", "elementName", ",", "isUnknownElement", ")", "{", "return", "currentParent", "&&", "(", "(", "currentParent", ".", "getDtd", "(", ")", "||", "CKEDITOR", ".", "dtd", ".", "span", ")"...
Check if the style element can be a child of the current node parent or if the element is not defined in the DTD.
[ "Check", "if", "the", "style", "element", "can", "be", "a", "child", "of", "the", "current", "node", "parent", "or", "if", "the", "element", "is", "not", "defined", "in", "the", "DTD", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L772-L776
56,662
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
checkPositionAndRule
function checkPositionAndRule( nodeA, nodeB, def, posBitFlags ) { return ( nodeA.getPosition( nodeB ) | posBitFlags ) == posBitFlags && ( !def.childRule || def.childRule( nodeA ) ); }
javascript
function checkPositionAndRule( nodeA, nodeB, def, posBitFlags ) { return ( nodeA.getPosition( nodeB ) | posBitFlags ) == posBitFlags && ( !def.childRule || def.childRule( nodeA ) ); }
[ "function", "checkPositionAndRule", "(", "nodeA", ",", "nodeB", ",", "def", ",", "posBitFlags", ")", "{", "return", "(", "nodeA", ".", "getPosition", "(", "nodeB", ")", "|", "posBitFlags", ")", "==", "posBitFlags", "&&", "(", "!", "def", ".", "childRule", ...
Checks if position is a subset of posBitFlags and that nodeA fulfills style def rule.
[ "Checks", "if", "position", "is", "a", "subset", "of", "posBitFlags", "and", "that", "nodeA", "fulfills", "style", "def", "rule", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L791-L794
56,663
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
applyStyleOnNestedEditables
function applyStyleOnNestedEditables( editablesContainer ) { var editables = findNestedEditables( editablesContainer ), editable, l = editables.length, i = 0, range = l && new CKEDITOR.dom.range( editablesContainer.getDocument() ); for ( ; i < l; ++i ) { editable = editables[ i ]; // Check if sty...
javascript
function applyStyleOnNestedEditables( editablesContainer ) { var editables = findNestedEditables( editablesContainer ), editable, l = editables.length, i = 0, range = l && new CKEDITOR.dom.range( editablesContainer.getDocument() ); for ( ; i < l; ++i ) { editable = editables[ i ]; // Check if sty...
[ "function", "applyStyleOnNestedEditables", "(", "editablesContainer", ")", "{", "var", "editables", "=", "findNestedEditables", "(", "editablesContainer", ")", ",", "editable", ",", "l", "=", "editables", ".", "length", ",", "i", "=", "0", ",", "range", "=", "...
Apply style to nested editables inside editablesContainer. @param {CKEDITOR.dom.element} editablesContainer @context CKEDITOR.style
[ "Apply", "style", "to", "nested", "editables", "inside", "editablesContainer", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L1187-L1202
56,664
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
checkIfAllowedInEditable
function checkIfAllowedInEditable( editable, style ) { var filter = CKEDITOR.filter.instances[ editable.data( 'cke-filter' ) ]; return filter ? filter.check( style ) : 1; }
javascript
function checkIfAllowedInEditable( editable, style ) { var filter = CKEDITOR.filter.instances[ editable.data( 'cke-filter' ) ]; return filter ? filter.check( style ) : 1; }
[ "function", "checkIfAllowedInEditable", "(", "editable", ",", "style", ")", "{", "var", "filter", "=", "CKEDITOR", ".", "filter", ".", "instances", "[", "editable", ".", "data", "(", "'cke-filter'", ")", "]", ";", "return", "filter", "?", "filter", ".", "c...
Checks if style is allowed in this editable.
[ "Checks", "if", "style", "is", "allowed", "in", "this", "editable", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L1220-L1224
56,665
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
toPre
function toPre( block, newBlock ) { var bogus = block.getBogus(); bogus && bogus.remove(); // First trim the block content. var preHtml = block.getHtml(); // 1. Trim head/tail spaces, they're not visible. preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' ); // 2. Delete ANSI whitespaces...
javascript
function toPre( block, newBlock ) { var bogus = block.getBogus(); bogus && bogus.remove(); // First trim the block content. var preHtml = block.getHtml(); // 1. Trim head/tail spaces, they're not visible. preHtml = replace( preHtml, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, '' ); // 2. Delete ANSI whitespaces...
[ "function", "toPre", "(", "block", ",", "newBlock", ")", "{", "var", "bogus", "=", "block", ".", "getBogus", "(", ")", ";", "bogus", "&&", "bogus", ".", "remove", "(", ")", ";", "// First trim the block content.", "var", "preHtml", "=", "block", ".", "ge...
Converting from a non-PRE block to a PRE block in formatting operations.
[ "Converting", "from", "a", "non", "-", "PRE", "block", "to", "a", "PRE", "block", "in", "formatting", "operations", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L1454-L1486
56,666
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
getAttributesForComparison
function getAttributesForComparison( styleDefinition ) { // If we have already computed it, just return it. var attribs = styleDefinition._AC; if ( attribs ) return attribs; attribs = {}; var length = 0; // Loop through all defined attributes. var styleAttribs = styleDefinition.attributes; if ( st...
javascript
function getAttributesForComparison( styleDefinition ) { // If we have already computed it, just return it. var attribs = styleDefinition._AC; if ( attribs ) return attribs; attribs = {}; var length = 0; // Loop through all defined attributes. var styleAttribs = styleDefinition.attributes; if ( st...
[ "function", "getAttributesForComparison", "(", "styleDefinition", ")", "{", "// If we have already computed it, just return it.", "var", "attribs", "=", "styleDefinition", ".", "_AC", ";", "if", "(", "attribs", ")", "return", "attribs", ";", "attribs", "=", "{", "}", ...
Returns an object that can be used for style matching comparison. Attributes names and values are all lowercased, and the styles get merged with the style attribute.
[ "Returns", "an", "object", "that", "can", "be", "used", "for", "style", "matching", "comparison", ".", "Attributes", "names", "and", "values", "are", "all", "lowercased", "and", "the", "styles", "get", "merged", "with", "the", "style", "attribute", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L1690-L1722
56,667
skerit/alchemy-styleboost
public/ckeditor/4.4dev/core/style.js
function( callback ) { if ( !this._.stylesDefinitions ) { var editor = this, // Respect the backwards compatible definition entry configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet; // The false value means that none styles should be loaded. if ( configStyleSet === false...
javascript
function( callback ) { if ( !this._.stylesDefinitions ) { var editor = this, // Respect the backwards compatible definition entry configStyleSet = editor.config.stylesCombo_stylesSet || editor.config.stylesSet; // The false value means that none styles should be loaded. if ( configStyleSet === false...
[ "function", "(", "callback", ")", "{", "if", "(", "!", "this", ".", "_", ".", "stylesDefinitions", ")", "{", "var", "editor", "=", "this", ",", "// Respect the backwards compatible definition entry", "configStyleSet", "=", "editor", ".", "config", ".", "stylesCo...
Gets the current `stylesSet` for this instance. editor.getStylesSet( function( stylesDefinitions ) {} ); See also {@link CKEDITOR.editor#stylesSet} event. @member CKEDITOR.editor @param {Function} callback The function to be called with the styles data.
[ "Gets", "the", "current", "stylesSet", "for", "this", "instance", "." ]
2b90b8a6afc9f065f785651292fb193940021d90
https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/core/style.js#L1977-L2013
56,668
nknapp/m-io
fs.js
walk
function walk (directoryPath, filter, collector) { var defer = Q.defer() fs.stat(directoryPath, function (err, stat) { if (err) { if (err.code === 'ENOENT') { // Like q-io/fs, return an empty array, if the directory does not exist return defer.resolve([]) } return defer.reject(...
javascript
function walk (directoryPath, filter, collector) { var defer = Q.defer() fs.stat(directoryPath, function (err, stat) { if (err) { if (err.code === 'ENOENT') { // Like q-io/fs, return an empty array, if the directory does not exist return defer.resolve([]) } return defer.reject(...
[ "function", "walk", "(", "directoryPath", ",", "filter", ",", "collector", ")", "{", "var", "defer", "=", "Q", ".", "defer", "(", ")", "fs", ".", "stat", "(", "directoryPath", ",", "function", "(", "err", ",", "stat", ")", "{", "if", "(", "err", ")...
Walk a directory tree, collect paths of files in an Array and return a Promise for the fulfilled action @param {string} directoryPath the base path @param {function(string,fs.Stats):boolean} filter a function that returns true, false or null to show that a file should be included or ignored and that a directory should ...
[ "Walk", "a", "directory", "tree", "collect", "paths", "of", "files", "in", "an", "Array", "and", "return", "a", "Promise", "for", "the", "fulfilled", "action" ]
c2bcb22d49ef9d13e3601703f57824b954862bed
https://github.com/nknapp/m-io/blob/c2bcb22d49ef9d13e3601703f57824b954862bed/fs.js#L165-L203
56,669
ethul/connect-uglify-js
lib/middleware.js
doesEscapeRoot
function doesEscapeRoot(root,file) { if (file.indexOf(path.normalize(root+"/")) === 0) return just(file); else return nothing(); }
javascript
function doesEscapeRoot(root,file) { if (file.indexOf(path.normalize(root+"/")) === 0) return just(file); else return nothing(); }
[ "function", "doesEscapeRoot", "(", "root", ",", "file", ")", "{", "if", "(", "file", ".", "indexOf", "(", "path", ".", "normalize", "(", "root", "+", "\"/\"", ")", ")", "===", "0", ")", "return", "just", "(", "file", ")", ";", "else", "return", "no...
The computed path for the requested file should always have the root as the prefix. When it does not, that means the computed request path is pointing outside of the root, which could be malicious.
[ "The", "computed", "path", "for", "the", "requested", "file", "should", "always", "have", "the", "root", "as", "the", "prefix", ".", "When", "it", "does", "not", "that", "means", "the", "computed", "request", "path", "is", "pointing", "outside", "of", "the...
3e6caa3098a099ec3d007d17a37d54ec6c30e798
https://github.com/ethul/connect-uglify-js/blob/3e6caa3098a099ec3d007d17a37d54ec6c30e798/lib/middleware.js#L71-L74
56,670
ethul/connect-uglify-js
lib/middleware.js
httpOk
function httpOk(response,isHead,body) { response.setHeader(HTTP_CONTENT_TYPE,MIME_TYPE_JAVASCRIPT); response.setHeader(HTTP_CONTENT_LENGTH,body.length); response.statusCode = HTTP_OK; if (isHead) response.end(); else response.end(body); }
javascript
function httpOk(response,isHead,body) { response.setHeader(HTTP_CONTENT_TYPE,MIME_TYPE_JAVASCRIPT); response.setHeader(HTTP_CONTENT_LENGTH,body.length); response.statusCode = HTTP_OK; if (isHead) response.end(); else response.end(body); }
[ "function", "httpOk", "(", "response", ",", "isHead", ",", "body", ")", "{", "response", ".", "setHeader", "(", "HTTP_CONTENT_TYPE", ",", "MIME_TYPE_JAVASCRIPT", ")", ";", "response", ".", "setHeader", "(", "HTTP_CONTENT_LENGTH", ",", "body", ".", "length", ")...
Helper method to response with an HTTP ok with a body, when the isHead is true then no body is returned
[ "Helper", "method", "to", "response", "with", "an", "HTTP", "ok", "with", "a", "body", "when", "the", "isHead", "is", "true", "then", "no", "body", "is", "returned" ]
3e6caa3098a099ec3d007d17a37d54ec6c30e798
https://github.com/ethul/connect-uglify-js/blob/3e6caa3098a099ec3d007d17a37d54ec6c30e798/lib/middleware.js#L114-L120
56,671
tracker1/mssql-ng
src/connections/close.js
closeConnection
function closeConnection(options) { //no options, close/delete all connection references if (!options) { try { mssql.close(); } catch(err){} //create list to track items to close let closeList = []; //iterate through each connection for (let key in promises) { //if there's a cl...
javascript
function closeConnection(options) { //no options, close/delete all connection references if (!options) { try { mssql.close(); } catch(err){} //create list to track items to close let closeList = []; //iterate through each connection for (let key in promises) { //if there's a cl...
[ "function", "closeConnection", "(", "options", ")", "{", "//no options, close/delete all connection references", "if", "(", "!", "options", ")", "{", "try", "{", "mssql", ".", "close", "(", ")", ";", "}", "catch", "(", "err", ")", "{", "}", "//create list to t...
close a specific connection, if no options specified, deletes all connections
[ "close", "a", "specific", "connection", "if", "no", "options", "specified", "deletes", "all", "connections" ]
7f32135d33f9b8324fdd94656136cae4087464ce
https://github.com/tracker1/mssql-ng/blob/7f32135d33f9b8324fdd94656136cae4087464ce/src/connections/close.js#L8-L35
56,672
dominictarr/kiddb
index.js
function (_data, cb) { if(!db.data) return cb(new Error('kiddb not open')) if(!writing) return db._update(_data, cb) db.__data = _data qcb.push(cb) onWrote = function () { onWrote = null var cbs = qcb; qcb = [] var _data = db.__data db.__data = null ...
javascript
function (_data, cb) { if(!db.data) return cb(new Error('kiddb not open')) if(!writing) return db._update(_data, cb) db.__data = _data qcb.push(cb) onWrote = function () { onWrote = null var cbs = qcb; qcb = [] var _data = db.__data db.__data = null ...
[ "function", "(", "_data", ",", "cb", ")", "{", "if", "(", "!", "db", ".", "data", ")", "return", "cb", "(", "new", "Error", "(", "'kiddb not open'", ")", ")", "if", "(", "!", "writing", ")", "return", "db", ".", "_update", "(", "_data", ",", "cb"...
instead of doing a concurrent write, queue the new writes. these can probably be merged together, and then a bunch will succeed at once. if you contrived your benchmark the right way, this could look like really great performance!
[ "instead", "of", "doing", "a", "concurrent", "write", "queue", "the", "new", "writes", ".", "these", "can", "probably", "be", "merged", "together", "and", "then", "a", "bunch", "will", "succeed", "at", "once", ".", "if", "you", "contrived", "your", "benchm...
63d81daf6a0a9a941be6e70f87e7a45094592535
https://github.com/dominictarr/kiddb/blob/63d81daf6a0a9a941be6e70f87e7a45094592535/index.js#L82-L98
56,673
dominictarr/kiddb
index.js
function (key, cb) { if(!db.data) return cb(new Error('kiddb not open')) if(db.data[key]) cb(null, db.data[key]) else cb(new Error('not found')) }
javascript
function (key, cb) { if(!db.data) return cb(new Error('kiddb not open')) if(db.data[key]) cb(null, db.data[key]) else cb(new Error('not found')) }
[ "function", "(", "key", ",", "cb", ")", "{", "if", "(", "!", "db", ".", "data", ")", "return", "cb", "(", "new", "Error", "(", "'kiddb not open'", ")", ")", "if", "(", "db", ".", "data", "[", "key", "]", ")", "cb", "(", "null", ",", "db", "."...
following is a bunch of stuff to make give the leveldown api...
[ "following", "is", "a", "bunch", "of", "stuff", "to", "make", "give", "the", "leveldown", "api", "..." ]
63d81daf6a0a9a941be6e70f87e7a45094592535
https://github.com/dominictarr/kiddb/blob/63d81daf6a0a9a941be6e70f87e7a45094592535/index.js#L102-L106
56,674
SpringRoll/grunt-springroll-download
tasks/springroll.js
downloadArchive
function downloadArchive(id, call, options, done) { grunt.log.write('Downloading '.gray + id.yellow + ' ... '.gray); request(call, function(err, response, body) { if (err) return done(err); var result = JSON.parse(body); if (!result.success) { return done(result.error + ' with game "' + id + ...
javascript
function downloadArchive(id, call, options, done) { grunt.log.write('Downloading '.gray + id.yellow + ' ... '.gray); request(call, function(err, response, body) { if (err) return done(err); var result = JSON.parse(body); if (!result.success) { return done(result.error + ' with game "' + id + ...
[ "function", "downloadArchive", "(", "id", ",", "call", ",", "options", ",", "done", ")", "{", "grunt", ".", "log", ".", "write", "(", "'Downloading '", ".", "gray", "+", "id", ".", "yellow", "+", "' ... '", ".", "gray", ")", ";", "request", "(", "cal...
Handle the request
[ "Handle", "the", "request" ]
af59b2254866010e3ac0e0a53bda4b8202deae02
https://github.com/SpringRoll/grunt-springroll-download/blob/af59b2254866010e3ac0e0a53bda4b8202deae02/tasks/springroll.js#L143-L180
56,675
bammoo/grunt-assets-version-replace
tasks/index.js
function(dest, src) { if(src.indexOf('.js') > -1) { return dest + src.replace('.js','.' + tsPrefix + newTS + '.js'); } else { return dest + src.replace('.css','.' + tsPrefix + newTS + '.css'); } }
javascript
function(dest, src) { if(src.indexOf('.js') > -1) { return dest + src.replace('.js','.' + tsPrefix + newTS + '.js'); } else { return dest + src.replace('.css','.' + tsPrefix + newTS + '.css'); } }
[ "function", "(", "dest", ",", "src", ")", "{", "if", "(", "src", ".", "indexOf", "(", "'.js'", ")", ">", "-", "1", ")", "{", "return", "dest", "+", "src", ".", "replace", "(", "'.js'", ",", "'.'", "+", "tsPrefix", "+", "newTS", "+", "'.js'", ")...
Add rename function to copy task config
[ "Add", "rename", "function", "to", "copy", "task", "config" ]
7fe9fd6c6301ec0cc2ebdceec99f2e89a87210b5
https://github.com/bammoo/grunt-assets-version-replace/blob/7fe9fd6c6301ec0cc2ebdceec99f2e89a87210b5/tasks/index.js#L70-L77
56,676
NiklasGollenstede/regexpx
index.js
isEscapeingAt
function isEscapeingAt(string, index) { if (index === 0) { return false; } let i = index - 1; while ( i >= 0 && string[i] === '\\' ) { --i; } return (index - i) % 2 === 0; }
javascript
function isEscapeingAt(string, index) { if (index === 0) { return false; } let i = index - 1; while ( i >= 0 && string[i] === '\\' ) { --i; } return (index - i) % 2 === 0; }
[ "function", "isEscapeingAt", "(", "string", ",", "index", ")", "{", "if", "(", "index", "===", "0", ")", "{", "return", "false", ";", "}", "let", "i", "=", "index", "-", "1", ";", "while", "(", "i", ">=", "0", "&&", "string", "[", "i", "]", "==...
checks whether the string is escaping the char at index
[ "checks", "whether", "the", "string", "is", "escaping", "the", "char", "at", "index" ]
f0ef06cbab75345963c31a5a05d024de8e22ed9d
https://github.com/NiklasGollenstede/regexpx/blob/f0ef06cbab75345963c31a5a05d024de8e22ed9d/index.js#L120-L127
56,677
wilmoore/json-parse.js
index.js
parse
function parse (defaultValue, data) { try { return JSON.parse(data) } catch (error) { if (defaultValue === null || defaultValue === undefined) { throw error } else { return defaultValue } } }
javascript
function parse (defaultValue, data) { try { return JSON.parse(data) } catch (error) { if (defaultValue === null || defaultValue === undefined) { throw error } else { return defaultValue } } }
[ "function", "parse", "(", "defaultValue", ",", "data", ")", "{", "try", "{", "return", "JSON", ".", "parse", "(", "data", ")", "}", "catch", "(", "error", ")", "{", "if", "(", "defaultValue", "===", "null", "||", "defaultValue", "===", "undefined", ")"...
Curried function that calls `JSON.parse` on provided input returning either the parsed JSON or the specified default value if the data fails to parse as valid JSON instead of throwing a `SyntaxError`. @param {*} defaultValue Default value to return if given data does not parse as valid JSON. @param {*} data Data to p...
[ "Curried", "function", "that", "calls", "JSON", ".", "parse", "on", "provided", "input", "returning", "either", "the", "parsed", "JSON", "or", "the", "specified", "default", "value", "if", "the", "data", "fails", "to", "parse", "as", "valid", "JSON", "instea...
143631ea04bcaecdc5e3e336edcb56e065158c29
https://github.com/wilmoore/json-parse.js/blob/143631ea04bcaecdc5e3e336edcb56e065158c29/index.js#L30-L40
56,678
adoyle-h/config-sp
src/config.js
load
function load(fromPath, relativePaths, opts) { opts = opts || {}; var ignores = opts.ignores || []; if (typeof ignores === 'string') ignores = [ignores]; var conf = {}; relativePaths.forEach(function(relativePath) { var path = Path.resolve(fromPath, relativePath); var config = loadF...
javascript
function load(fromPath, relativePaths, opts) { opts = opts || {}; var ignores = opts.ignores || []; if (typeof ignores === 'string') ignores = [ignores]; var conf = {}; relativePaths.forEach(function(relativePath) { var path = Path.resolve(fromPath, relativePath); var config = loadF...
[ "function", "load", "(", "fromPath", ",", "relativePaths", ",", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "var", "ignores", "=", "opts", ".", "ignores", "||", "[", "]", ";", "if", "(", "typeof", "ignores", "===", "'string'", ")", ...
Load your config files. You could invoke the `load` function many times. Each returned config is independent and not affected by each other. @example // Assume that there are two files 'test/config/default.js', 'test/config/local.js', // and the codes in 'test/config/index.js': load(__dirname, ['default.js', 'local.j...
[ "Load", "your", "config", "files", "." ]
cdfefc1b1c292d834b1144695bb284f0e26a6a77
https://github.com/adoyle-h/config-sp/blob/cdfefc1b1c292d834b1144695bb284f0e26a6a77/src/config.js#L71-L90
56,679
adoyle-h/config-sp
src/config.js
create
function create() { var args = Array.prototype.slice.call(arguments); var conf = {}; args.forEach(function(config) { extend(conf, config); }); if (conf.get === undefined) { bindGetMethod(conf); } else { throw new Error('`get` property cannot be the root key of config');...
javascript
function create() { var args = Array.prototype.slice.call(arguments); var conf = {}; args.forEach(function(config) { extend(conf, config); }); if (conf.get === undefined) { bindGetMethod(conf); } else { throw new Error('`get` property cannot be the root key of config');...
[ "function", "create", "(", ")", "{", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ";", "var", "conf", "=", "{", "}", ";", "args", ".", "forEach", "(", "function", "(", "config", ")", "{", "extend"...
create a config with multi objects. The latter object will overwrite the former recursively. @example create({a: 1, b: 2}, {a: 0, c: 3}); // => {a: 0, b: 2, c: 3} @param {Object...} source a set of config objects. @return {Object} The final config object. @method create
[ "create", "a", "config", "with", "multi", "objects", "." ]
cdfefc1b1c292d834b1144695bb284f0e26a6a77
https://github.com/adoyle-h/config-sp/blob/cdfefc1b1c292d834b1144695bb284f0e26a6a77/src/config.js#L106-L121
56,680
nachos/settings-file
lib/index.js
SettingsFile
function SettingsFile(app, options) { if (!app) { throw new TypeError('SettingsFile must accept an app name'); } else if (typeof app !== 'string') { throw new TypeError('SettingsFile app name must be a string'); } debug('initialize new settings file for app: %s', app); this._app = app; this._path...
javascript
function SettingsFile(app, options) { if (!app) { throw new TypeError('SettingsFile must accept an app name'); } else if (typeof app !== 'string') { throw new TypeError('SettingsFile app name must be a string'); } debug('initialize new settings file for app: %s', app); this._app = app; this._path...
[ "function", "SettingsFile", "(", "app", ",", "options", ")", "{", "if", "(", "!", "app", ")", "{", "throw", "new", "TypeError", "(", "'SettingsFile must accept an app name'", ")", ";", "}", "else", "if", "(", "typeof", "app", "!==", "'string'", ")", "{", ...
Nachos settings file @param {String} app The name of the app @param {Object} options Optional templates for global and instance settings @constructor
[ "Nachos", "settings", "file" ]
d31e6d7db3f5b48cf6fb042507119e3488285e92
https://github.com/nachos/settings-file/blob/d31e6d7db3f5b48cf6fb042507119e3488285e92/lib/index.js#L23-L39
56,681
nachos/settings-file
lib/index.js
function (content) { var fileContent = self._readFileSync(); fileContent.instances = fileContent.instances || {}; fileContent.instances[this._id] = content; self._writeFileSync(fileContent); }
javascript
function (content) { var fileContent = self._readFileSync(); fileContent.instances = fileContent.instances || {}; fileContent.instances[this._id] = content; self._writeFileSync(fileContent); }
[ "function", "(", "content", ")", "{", "var", "fileContent", "=", "self", ".", "_readFileSync", "(", ")", ";", "fileContent", ".", "instances", "=", "fileContent", ".", "instances", "||", "{", "}", ";", "fileContent", ".", "instances", "[", "this", ".", "...
Save the instance settings @param {Object} content The instance settings
[ "Save", "the", "instance", "settings" ]
d31e6d7db3f5b48cf6fb042507119e3488285e92
https://github.com/nachos/settings-file/blob/d31e6d7db3f5b48cf6fb042507119e3488285e92/lib/index.js#L293-L299
56,682
PrinceNebulon/github-api-promise
src/teams/teams.js
function(id, params) { return req.standardRequest(`${config.host}/teams/${id}/teams?${req.assembleQueryParams(params, ['page'])}`); }
javascript
function(id, params) { return req.standardRequest(`${config.host}/teams/${id}/teams?${req.assembleQueryParams(params, ['page'])}`); }
[ "function", "(", "id", ",", "params", ")", "{", "return", "req", ".", "standardRequest", "(", "`", "${", "config", ".", "host", "}", "${", "id", "}", "${", "req", ".", "assembleQueryParams", "(", "params", ",", "[", "'page'", "]", ")", "}", "`", ")...
List child teams At this time, the hellcat-preview media type is required to use this endpoint. @see {@link https://developer.github.com/v3/teams/#list-child-teams} @param {string} id - The team ID @param {object} params - An object of parameters for the request @param {int} params.page - The page o...
[ "List", "child", "teams" ]
990cb2cce19b53f54d9243002fde47428f24e7cc
https://github.com/PrinceNebulon/github-api-promise/blob/990cb2cce19b53f54d9243002fde47428f24e7cc/src/teams/teams.js#L147-L150
56,683
PrinceNebulon/github-api-promise
src/teams/teams.js
function(id, projectId, body) { return req.standardRequest(`${config.host}/teams/${id}/projects/${projectId}`, 'put', body); }
javascript
function(id, projectId, body) { return req.standardRequest(`${config.host}/teams/${id}/projects/${projectId}`, 'put', body); }
[ "function", "(", "id", ",", "projectId", ",", "body", ")", "{", "return", "req", ".", "standardRequest", "(", "`", "${", "config", ".", "host", "}", "${", "id", "}", "${", "projectId", "}", "`", ",", "'put'", ",", "body", ")", ";", "}" ]
Add or update team project Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have admin permissions for the project. The project and team must be part of the same organization. @see {@link https://developer.github.com/v3/teams/...
[ "Add", "or", "update", "team", "project" ]
990cb2cce19b53f54d9243002fde47428f24e7cc
https://github.com/PrinceNebulon/github-api-promise/blob/990cb2cce19b53f54d9243002fde47428f24e7cc/src/teams/teams.js#L302-L304
56,684
jasonpincin/pharos-tree
index.js
createStream
function createStream (options) { options = options || {} var stream = through2.obj(function transform (chunk, encoding, cb) { stream.push(options.objectMode ? chunk : JSON.stringify(chunk)+'\n') cb() }) stream.close = function close () { setImmediate...
javascript
function createStream (options) { options = options || {} var stream = through2.obj(function transform (chunk, encoding, cb) { stream.push(options.objectMode ? chunk : JSON.stringify(chunk)+'\n') cb() }) stream.close = function close () { setImmediate...
[ "function", "createStream", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", "var", "stream", "=", "through2", ".", "obj", "(", "function", "transform", "(", "chunk", ",", "encoding", ",", "cb", ")", "{", "stream", ".", "push", "(",...
create stream of changes
[ "create", "stream", "of", "changes" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L20-L37
56,685
jasonpincin/pharos-tree
index.js
feed
function feed(op, pnode) { if (numStreams > 0) { changes.push({op:op, pnode:pnode.toJSON()}) } }
javascript
function feed(op, pnode) { if (numStreams > 0) { changes.push({op:op, pnode:pnode.toJSON()}) } }
[ "function", "feed", "(", "op", ",", "pnode", ")", "{", "if", "(", "numStreams", ">", "0", ")", "{", "changes", ".", "push", "(", "{", "op", ":", "op", ",", "pnode", ":", "pnode", ".", "toJSON", "(", ")", "}", ")", "}", "}" ]
feed change streams
[ "feed", "change", "streams" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L39-L43
56,686
jasonpincin/pharos-tree
index.js
setPnodeData
function setPnodeData (pnode, value) { if (!pnode.exists) { pnode._data = value persistPnode(pnode) } else if (pnode._data !== value) { pnode._data = value incTransaction() incPnodeVersion(pnode) feed('change', pnode) ...
javascript
function setPnodeData (pnode, value) { if (!pnode.exists) { pnode._data = value persistPnode(pnode) } else if (pnode._data !== value) { pnode._data = value incTransaction() incPnodeVersion(pnode) feed('change', pnode) ...
[ "function", "setPnodeData", "(", "pnode", ",", "value", ")", "{", "if", "(", "!", "pnode", ".", "exists", ")", "{", "pnode", ".", "_data", "=", "value", "persistPnode", "(", "pnode", ")", "}", "else", "if", "(", "pnode", ".", "_data", "!==", "value",...
set pnode data
[ "set", "pnode", "data" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L80-L92
56,687
jasonpincin/pharos-tree
index.js
unsetPnodeData
function unsetPnodeData (pnode) { if (pnode.hasOwnProperty('_data') && pnode._data !== undefined) { pnode._data = undefined incTransaction() incPnodeVersion(pnode) feed('change', pnode) } return pnode }
javascript
function unsetPnodeData (pnode) { if (pnode.hasOwnProperty('_data') && pnode._data !== undefined) { pnode._data = undefined incTransaction() incPnodeVersion(pnode) feed('change', pnode) } return pnode }
[ "function", "unsetPnodeData", "(", "pnode", ")", "{", "if", "(", "pnode", ".", "hasOwnProperty", "(", "'_data'", ")", "&&", "pnode", ".", "_data", "!==", "undefined", ")", "{", "pnode", ".", "_data", "=", "undefined", "incTransaction", "(", ")", "incPnodeV...
unset pnode data
[ "unset", "pnode", "data" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L94-L102
56,688
jasonpincin/pharos-tree
index.js
incPnodeVersion
function incPnodeVersion (pnode) { pnode._version = pnode._version ? pnode._version + 1 : 1 pnode._mtxid = ptree.txid pnode._mtime = new Date if (!pnode._ctxid) pnode._ctxid = pnode._mtxid if (!pnode._ctime) pnode._ctime = pnode._mtime return pnode }
javascript
function incPnodeVersion (pnode) { pnode._version = pnode._version ? pnode._version + 1 : 1 pnode._mtxid = ptree.txid pnode._mtime = new Date if (!pnode._ctxid) pnode._ctxid = pnode._mtxid if (!pnode._ctime) pnode._ctime = pnode._mtime return pnode }
[ "function", "incPnodeVersion", "(", "pnode", ")", "{", "pnode", ".", "_version", "=", "pnode", ".", "_version", "?", "pnode", ".", "_version", "+", "1", ":", "1", "pnode", ".", "_mtxid", "=", "ptree", ".", "txid", "pnode", ".", "_mtime", "=", "new", ...
increment pnode version
[ "increment", "pnode", "version" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L104-L111
56,689
jasonpincin/pharos-tree
index.js
incChildrenVersion
function incChildrenVersion (pnode) { if (pnode && pnode._childrenVersion) pnode._childrenVersion++ else pnode._childrenVersion = 1 return pnode }
javascript
function incChildrenVersion (pnode) { if (pnode && pnode._childrenVersion) pnode._childrenVersion++ else pnode._childrenVersion = 1 return pnode }
[ "function", "incChildrenVersion", "(", "pnode", ")", "{", "if", "(", "pnode", "&&", "pnode", ".", "_childrenVersion", ")", "pnode", ".", "_childrenVersion", "++", "else", "pnode", ".", "_childrenVersion", "=", "1", "return", "pnode", "}" ]
incrememnt childrenVersion of pnode
[ "incrememnt", "childrenVersion", "of", "pnode" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L113-L117
56,690
jasonpincin/pharos-tree
index.js
addChild
function addChild(parent, child) { parent._children.push(child) incChildrenVersion(parent) return parent }
javascript
function addChild(parent, child) { parent._children.push(child) incChildrenVersion(parent) return parent }
[ "function", "addChild", "(", "parent", ",", "child", ")", "{", "parent", ".", "_children", ".", "push", "(", "child", ")", "incChildrenVersion", "(", "parent", ")", "return", "parent", "}" ]
add child to pnode
[ "add", "child", "to", "pnode" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L125-L129
56,691
jasonpincin/pharos-tree
index.js
removeChild
function removeChild(parent, child) { var parentChildIdx = parent._children.indexOf(child) parent._children.splice(parentChildIdx, 1) incChildrenVersion(parent) return parent }
javascript
function removeChild(parent, child) { var parentChildIdx = parent._children.indexOf(child) parent._children.splice(parentChildIdx, 1) incChildrenVersion(parent) return parent }
[ "function", "removeChild", "(", "parent", ",", "child", ")", "{", "var", "parentChildIdx", "=", "parent", ".", "_children", ".", "indexOf", "(", "child", ")", "parent", ".", "_children", ".", "splice", "(", "parentChildIdx", ",", "1", ")", "incChildrenVersio...
remove child from pnode
[ "remove", "child", "from", "pnode" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L131-L136
56,692
jasonpincin/pharos-tree
index.js
pnodeParents
function pnodeParents (pnode) { if (!pnode.valid) return undefined var parentPaths = parents(pnode.path), list = [] for (var i = 0; i < parentPaths.length; i++) list.push( ptree(parentPaths[i]) ) return list }
javascript
function pnodeParents (pnode) { if (!pnode.valid) return undefined var parentPaths = parents(pnode.path), list = [] for (var i = 0; i < parentPaths.length; i++) list.push( ptree(parentPaths[i]) ) return list }
[ "function", "pnodeParents", "(", "pnode", ")", "{", "if", "(", "!", "pnode", ".", "valid", ")", "return", "undefined", "var", "parentPaths", "=", "parents", "(", "pnode", ".", "path", ")", ",", "list", "=", "[", "]", "for", "(", "var", "i", "=", "0...
get all parents of a pnoce
[ "get", "all", "parents", "of", "a", "pnoce" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L138-L144
56,693
jasonpincin/pharos-tree
index.js
pnodeParent
function pnodeParent (pnode) { if (!pnode.valid) return undefined var parentPath = parents.immediate(pnode.path) return parentPath ? ptree(parentPath) : null }
javascript
function pnodeParent (pnode) { if (!pnode.valid) return undefined var parentPath = parents.immediate(pnode.path) return parentPath ? ptree(parentPath) : null }
[ "function", "pnodeParent", "(", "pnode", ")", "{", "if", "(", "!", "pnode", ".", "valid", ")", "return", "undefined", "var", "parentPath", "=", "parents", ".", "immediate", "(", "pnode", ".", "path", ")", "return", "parentPath", "?", "ptree", "(", "paren...
get immediate parent of pnode
[ "get", "immediate", "parent", "of", "pnode" ]
c0988800d6ffbcbfee153c4f07c194979f5e4f43
https://github.com/jasonpincin/pharos-tree/blob/c0988800d6ffbcbfee153c4f07c194979f5e4f43/index.js#L146-L150
56,694
wilmoore/parameters-named.js
index.js
parameters
function parameters (spec) { var defs = {} var envs = {} return function (params) { init(spec, defs, envs) var opts = cat(defs, envs, params) var errs = [] def(opts, spec, errs) req(opts, spec, errs) val(opts, spec, errs) return { error: errs.length ? errs[0] : null, err...
javascript
function parameters (spec) { var defs = {} var envs = {} return function (params) { init(spec, defs, envs) var opts = cat(defs, envs, params) var errs = [] def(opts, spec, errs) req(opts, spec, errs) val(opts, spec, errs) return { error: errs.length ? errs[0] : null, err...
[ "function", "parameters", "(", "spec", ")", "{", "var", "defs", "=", "{", "}", "var", "envs", "=", "{", "}", "return", "function", "(", "params", ")", "{", "init", "(", "spec", ",", "defs", ",", "envs", ")", "var", "opts", "=", "cat", "(", "defs"...
Named parameters supporting default value, validation, and environment variables. @param {String} string string literal. @return {String} string literal.
[ "Named", "parameters", "supporting", "default", "value", "validation", "and", "environment", "variables", "." ]
d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2
https://github.com/wilmoore/parameters-named.js/blob/d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2/index.js#L28-L47
56,695
wilmoore/parameters-named.js
index.js
init
function init (spec, defs, envs) { for (var key in spec || {}) { if (spec[key].def) defs[key] = spec[key].def if (has(spec[key].env)) envs[key] = get(spec[key].env) } }
javascript
function init (spec, defs, envs) { for (var key in spec || {}) { if (spec[key].def) defs[key] = spec[key].def if (has(spec[key].env)) envs[key] = get(spec[key].env) } }
[ "function", "init", "(", "spec", ",", "defs", ",", "envs", ")", "{", "for", "(", "var", "key", "in", "spec", "||", "{", "}", ")", "{", "if", "(", "spec", "[", "key", "]", ".", "def", ")", "defs", "[", "key", "]", "=", "spec", "[", "key", "]...
Initialize defaults and environment variables. @param {String} spec Parameters definition object. @param {Object} defs Default values container. @param {String} spec Environment values container.
[ "Initialize", "defaults", "and", "environment", "variables", "." ]
d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2
https://github.com/wilmoore/parameters-named.js/blob/d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2/index.js#L62-L67
56,696
wilmoore/parameters-named.js
index.js
def
function def (params, spec, errs) { for (var key in params) { if (!spec.hasOwnProperty(key)) defError(key, errs) } }
javascript
function def (params, spec, errs) { for (var key in params) { if (!spec.hasOwnProperty(key)) defError(key, errs) } }
[ "function", "def", "(", "params", ",", "spec", ",", "errs", ")", "{", "for", "(", "var", "key", "in", "params", ")", "{", "if", "(", "!", "spec", ".", "hasOwnProperty", "(", "key", ")", ")", "defError", "(", "key", ",", "errs", ")", "}", "}" ]
Ensure that parameter is defined. @param {Object} params Parameters value object. @param {String} spec Parameters definition object. @param {Array} errs Errors list.
[ "Ensure", "that", "parameter", "is", "defined", "." ]
d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2
https://github.com/wilmoore/parameters-named.js/blob/d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2/index.js#L82-L86
56,697
wilmoore/parameters-named.js
index.js
req
function req (params, spec, errs) { for (var key in spec) { if (spec[key].req && !params.hasOwnProperty(key)) reqError(key, errs) } }
javascript
function req (params, spec, errs) { for (var key in spec) { if (spec[key].req && !params.hasOwnProperty(key)) reqError(key, errs) } }
[ "function", "req", "(", "params", ",", "spec", ",", "errs", ")", "{", "for", "(", "var", "key", "in", "spec", ")", "{", "if", "(", "spec", "[", "key", "]", ".", "req", "&&", "!", "params", ".", "hasOwnProperty", "(", "key", ")", ")", "reqError", ...
Ensure that required keys are set. @param {Object} params Parameters value object. @param {String} spec Parameters definition object. @param {Array} errs Errors list.
[ "Ensure", "that", "required", "keys", "are", "set", "." ]
d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2
https://github.com/wilmoore/parameters-named.js/blob/d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2/index.js#L115-L119
56,698
wilmoore/parameters-named.js
index.js
val
function val (params, spec, errs) { for (var key in params) { if (key in spec && isFunction(spec[key].val) && !spec[key].val(params[key])) valError(key, errs) } }
javascript
function val (params, spec, errs) { for (var key in params) { if (key in spec && isFunction(spec[key].val) && !spec[key].val(params[key])) valError(key, errs) } }
[ "function", "val", "(", "params", ",", "spec", ",", "errs", ")", "{", "for", "(", "var", "key", "in", "params", ")", "{", "if", "(", "key", "in", "spec", "&&", "isFunction", "(", "spec", "[", "key", "]", ".", "val", ")", "&&", "!", "spec", "[",...
Ensure that validation predicates pass. @param {Object} params Parameters value object. @param {String} spec Parameters definition object. @param {Array} errs Errors list.
[ "Ensure", "that", "validation", "predicates", "pass", "." ]
d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2
https://github.com/wilmoore/parameters-named.js/blob/d4201cd97b986ac2a24910d9f1d3c5c6f35dd5b2/index.js#L148-L152
56,699
clusterpoint/nodejs-client-api
lib/connection.js
header
function header(length) { var res = [0x09, 0x09, 0x00, 0x00]; res.push((length & 0x000000FF) >> 0); res.push((length & 0x0000FF00) >> 8); res.push((length & 0x00FF0000) >> 16); res.push((length & 0xFF000000) >> 24); return n...
javascript
function header(length) { var res = [0x09, 0x09, 0x00, 0x00]; res.push((length & 0x000000FF) >> 0); res.push((length & 0x0000FF00) >> 8); res.push((length & 0x00FF0000) >> 16); res.push((length & 0xFF000000) >> 24); return n...
[ "function", "header", "(", "length", ")", "{", "var", "res", "=", "[", "0x09", ",", "0x09", ",", "0x00", ",", "0x00", "]", ";", "res", ".", "push", "(", "(", "length", "&", "0x000000FF", ")", ">>", "0", ")", ";", "res", ".", "push", "(", "(", ...
Creates header for clusterpoint messages @param {Integer} length @return {Buffer}
[ "Creates", "header", "for", "clusterpoint", "messages" ]
ca9322eab3d11f7cc43ce0e6f6e2403f5b3712a0
https://github.com/clusterpoint/nodejs-client-api/blob/ca9322eab3d11f7cc43ce0e6f6e2403f5b3712a0/lib/connection.js#L192-L199