repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
d-oliveros/isomorphine
src/util.js
firstFunction
function firstFunction(args) { for (var i = 0, len = args.length; i < len; i++) { if (typeof args[i] === 'function') { return args[i]; } } return null; }
javascript
function firstFunction(args) { for (var i = 0, len = args.length; i < len; i++) { if (typeof args[i] === 'function') { return args[i]; } } return null; }
[ "function", "firstFunction", "(", "args", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "=", "args", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", "(", "typeof", "args", "[", "i", "]", "===", "'function'", ")", ...
Returns the first function in an array. @param {Array} args The array to take the function from. @return {Function} The resulting function, or null.
[ "Returns", "the", "first", "function", "in", "an", "array", "." ]
cb123d16b4be3bb7ec57758bd0b2e43767e91864
https://github.com/d-oliveros/isomorphine/blob/cb123d16b4be3bb7ec57758bd0b2e43767e91864/src/util.js#L31-L39
train
d-oliveros/isomorphine
src/util.js
serializeCallback
function serializeCallback(args) { var callback; debug('Transforming callback in ', args); return args.map(function(arg) { if (typeof arg !== 'function') return arg; // It shouldn't be an argument after the callback function invariant(!callback, 'Only one callback function is allowed.'); callb...
javascript
function serializeCallback(args) { var callback; debug('Transforming callback in ', args); return args.map(function(arg) { if (typeof arg !== 'function') return arg; // It shouldn't be an argument after the callback function invariant(!callback, 'Only one callback function is allowed.'); callb...
[ "function", "serializeCallback", "(", "args", ")", "{", "var", "callback", ";", "debug", "(", "'Transforming callback in '", ",", "args", ")", ";", "return", "args", ".", "map", "(", "function", "(", "arg", ")", "{", "if", "(", "typeof", "arg", "!==", "'...
Transforms the client's callback function to a callback notice string. @param {Array} args Array of arguments to transform. @return {Array} The transformed arguments array.
[ "Transforms", "the", "client", "s", "callback", "function", "to", "a", "callback", "notice", "string", "." ]
cb123d16b4be3bb7ec57758bd0b2e43767e91864
https://github.com/d-oliveros/isomorphine/blob/cb123d16b4be3bb7ec57758bd0b2e43767e91864/src/util.js#L47-L62
train
d-oliveros/isomorphine
src/util.js
promisify
function promisify(func) { return function promisified() { var args = Array.prototype.slice.call(arguments); var context = this; return new Promise(function(resolve, reject) { try { func.apply(context, args.concat(function(err, data) { if (err) { return reject(err); ...
javascript
function promisify(func) { return function promisified() { var args = Array.prototype.slice.call(arguments); var context = this; return new Promise(function(resolve, reject) { try { func.apply(context, args.concat(function(err, data) { if (err) { return reject(err); ...
[ "function", "promisify", "(", "func", ")", "{", "return", "function", "promisified", "(", ")", "{", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ";", "var", "context", "=", "this", ";", "return", "new...
Transforms a callback-based function flow to a promise-based flow
[ "Transforms", "a", "callback", "-", "based", "function", "flow", "to", "a", "promise", "-", "based", "flow" ]
cb123d16b4be3bb7ec57758bd0b2e43767e91864
https://github.com/d-oliveros/isomorphine/blob/cb123d16b4be3bb7ec57758bd0b2e43767e91864/src/util.js#L67-L86
train
d-oliveros/isomorphine
src/util.js
changeConfig
function changeConfig(oldConfig, newConfig) { invariant(isObject(oldConfig), 'Old config is not valid'); invariant(isObject(newConfig), 'Config is not valid'); if (newConfig.host) { var host = newConfig.host; var prefix = ''; if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) { p...
javascript
function changeConfig(oldConfig, newConfig) { invariant(isObject(oldConfig), 'Old config is not valid'); invariant(isObject(newConfig), 'Config is not valid'); if (newConfig.host) { var host = newConfig.host; var prefix = ''; if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) { p...
[ "function", "changeConfig", "(", "oldConfig", ",", "newConfig", ")", "{", "invariant", "(", "isObject", "(", "oldConfig", ")", ",", "'Old config is not valid'", ")", ";", "invariant", "(", "isObject", "(", "newConfig", ")", ",", "'Config is not valid'", ")", ";"...
Updates a config object @param {Object} oldConfig Old configuration object @param {Object} newConfig New configuration object @return {Undefined}
[ "Updates", "a", "config", "object" ]
cb123d16b4be3bb7ec57758bd0b2e43767e91864
https://github.com/d-oliveros/isomorphine/blob/cb123d16b4be3bb7ec57758bd0b2e43767e91864/src/util.js#L155-L173
train
phadej/ljs
lib/literate.js
appendCode
function appendCode() { if (state === "code") { state = "text"; if (!isWhitespace(codeBuffer)) { content += codeOpen + codeBuffer.replace(/^(?:\s*\n)+/, "").replace(/[\s\n]*$/, "") + codeClose; } codeBuffer = ""; } }
javascript
function appendCode() { if (state === "code") { state = "text"; if (!isWhitespace(codeBuffer)) { content += codeOpen + codeBuffer.replace(/^(?:\s*\n)+/, "").replace(/[\s\n]*$/, "") + codeClose; } codeBuffer = ""; } }
[ "function", "appendCode", "(", ")", "{", "if", "(", "state", "===", "\"code\"", ")", "{", "state", "=", "\"text\"", ";", "if", "(", "!", "isWhitespace", "(", "codeBuffer", ")", ")", "{", "content", "+=", "codeOpen", "+", "codeBuffer", ".", "replace", "...
buffer for code output
[ "buffer", "for", "code", "output" ]
2ef94df30174a0aa12a65dbe0a66128b3c2726bb
https://github.com/phadej/ljs/blob/2ef94df30174a0aa12a65dbe0a66128b3c2726bb/lib/literate.js#L127-L135
train
camme/plugwisejs
plugwise.js
sendCommand
function sendCommand(command, mac, params, callback, scope) { var commandParts = []; // check for callback instead of params if (typeof params == 'function') { callback = params; params = ''; scope = callback; } var completeCommand = ''; ...
javascript
function sendCommand(command, mac, params, callback, scope) { var commandParts = []; // check for callback instead of params if (typeof params == 'function') { callback = params; params = ''; scope = callback; } var completeCommand = ''; ...
[ "function", "sendCommand", "(", "command", ",", "mac", ",", "params", ",", "callback", ",", "scope", ")", "{", "var", "commandParts", "=", "[", "]", ";", "// check for callback instead of params", "if", "(", "typeof", "params", "==", "'function'", ")", "{", ...
builds the command string and sends it
[ "builds", "the", "command", "string", "and", "sends", "it" ]
04bc02a8f734e6833cc2bf03d6e8d5b88863ea9e
https://github.com/camme/plugwisejs/blob/04bc02a8f734e6833cc2bf03d6e8d5b88863ea9e/plugwise.js#L243-L295
train
Zerg00s/spforms
src/Templates/App/services/spFormFactory.js
addFileToFolder
function addFileToFolder(arrayBuffer) { // Construct the endpoint. var fileCollectionEndpoint = String.format(spFormFactory.getFileEndpointUri(_spPageContextInfo.webAbsoluteUrl, doclibname, foldername) + "/add(overwrite=true, url='{0}')", fileuniquename); // Send the request and ret...
javascript
function addFileToFolder(arrayBuffer) { // Construct the endpoint. var fileCollectionEndpoint = String.format(spFormFactory.getFileEndpointUri(_spPageContextInfo.webAbsoluteUrl, doclibname, foldername) + "/add(overwrite=true, url='{0}')", fileuniquename); // Send the request and ret...
[ "function", "addFileToFolder", "(", "arrayBuffer", ")", "{", "// Construct the endpoint.", "var", "fileCollectionEndpoint", "=", "String", ".", "format", "(", "spFormFactory", ".", "getFileEndpointUri", "(", "_spPageContextInfo", ".", "webAbsoluteUrl", ",", "doclibname", ...
}, onError); Add the file to the file collection in the Shared Documents folder.
[ "}", "onError", ")", ";", "Add", "the", "file", "to", "the", "file", "collection", "in", "the", "Shared", "Documents", "folder", "." ]
f8eaa19eeefa6ca7a3664138b76744f9c1d9ecec
https://github.com/Zerg00s/spforms/blob/f8eaa19eeefa6ca7a3664138b76744f9c1d9ecec/src/Templates/App/services/spFormFactory.js#L373-L391
train
Zerg00s/spforms
src/Templates/App/services/spFormFactory.js
updateListItem
function updateListItem(itemMetadata, customFileMetadata) { // Define the list item changes. Use the FileLeafRef property to change the display name. // Assemble the file update metadata var metadata = { __metadata: { type: itemMetadata.type ...
javascript
function updateListItem(itemMetadata, customFileMetadata) { // Define the list item changes. Use the FileLeafRef property to change the display name. // Assemble the file update metadata var metadata = { __metadata: { type: itemMetadata.type ...
[ "function", "updateListItem", "(", "itemMetadata", ",", "customFileMetadata", ")", "{", "// Define the list item changes. Use the FileLeafRef property to change the display name. ", "// Assemble the file update metadata ", "var", "metadata", "=", "{", "__metadata", ":", "{", "type"...
Change the display name and title of the list item.
[ "Change", "the", "display", "name", "and", "title", "of", "the", "list", "item", "." ]
f8eaa19eeefa6ca7a3664138b76744f9c1d9ecec
https://github.com/Zerg00s/spforms/blob/f8eaa19eeefa6ca7a3664138b76744f9c1d9ecec/src/Templates/App/services/spFormFactory.js#L403-L429
train
anseki/process-bridge
process-bridge.js
parseIpcMessage
function parseIpcMessage(message, cb) { var requestId; if (message._requestId == null) { // eslint-disable-line eqeqeq throw new Error('Invalid message: ' + JSON.stringify(message)); } requestId = message._requestId; delete message._requestId; return cb(+requestId, message); }
javascript
function parseIpcMessage(message, cb) { var requestId; if (message._requestId == null) { // eslint-disable-line eqeqeq throw new Error('Invalid message: ' + JSON.stringify(message)); } requestId = message._requestId; delete message._requestId; return cb(+requestId, message); }
[ "function", "parseIpcMessage", "(", "message", ",", "cb", ")", "{", "var", "requestId", ";", "if", "(", "message", ".", "_requestId", "==", "null", ")", "{", "// eslint-disable-line eqeqeq", "throw", "new", "Error", "(", "'Invalid message: '", "+", "JSON", "."...
Callback that handles the parsed message object. @callback procMessage @param {string} requestId - ID of the message. @param {Object} message - The message object. Normalize an IPC message. @param {Object} message - IPC message. @param {procMessage} cb - Callback function that is called. @returns {any} Something that...
[ "Callback", "that", "handles", "the", "parsed", "message", "object", "." ]
3621bda208e1a94527636dacd0a8f4b9e42c9cd0
https://github.com/anseki/process-bridge/blob/3621bda208e1a94527636dacd0a8f4b9e42c9cd0/process-bridge.js#L39-L47
train
anseki/process-bridge
process-bridge.js
parseMessageLines
function parseMessageLines(lines, getLine, cb) { var matches, line, lineParts; if (arguments.length < 3) { cb = getLine; getLine = false; } RE_MESSAGE_LINE.lastIndex = 0; while ((matches = RE_MESSAGE_LINE.exec(lines))) { line = matches[1]; lines = matches[2]; if (line === '') { con...
javascript
function parseMessageLines(lines, getLine, cb) { var matches, line, lineParts; if (arguments.length < 3) { cb = getLine; getLine = false; } RE_MESSAGE_LINE.lastIndex = 0; while ((matches = RE_MESSAGE_LINE.exec(lines))) { line = matches[1]; lines = matches[2]; if (line === '') { con...
[ "function", "parseMessageLines", "(", "lines", ",", "getLine", ",", "cb", ")", "{", "var", "matches", ",", "line", ",", "lineParts", ";", "if", "(", "arguments", ".", "length", "<", "3", ")", "{", "cb", "=", "getLine", ";", "getLine", "=", "false", "...
Extract & normalize an IPC message from current input stream lines, and return remaining data. @param {string} lines - current input stream. @param {boolean} [getLine] - Get a line as plain string. @param {procMessage|Function} cb - Callback function that is called. It is called with a line if `getLine` is `true`. @ret...
[ "Extract", "&", "normalize", "an", "IPC", "message", "from", "current", "input", "stream", "lines", "and", "return", "remaining", "data", "." ]
3621bda208e1a94527636dacd0a8f4b9e42c9cd0
https://github.com/anseki/process-bridge/blob/3621bda208e1a94527636dacd0a8f4b9e42c9cd0/process-bridge.js#L56-L81
train
anseki/process-bridge
process-bridge.js
sendIpc
function sendIpc(message) { var requestIds; clearTimeout(retryTimer); if (message) { tranRequests[message._requestId] = message; } if ((requestIds = Object.keys(tranRequests)).length) { if (!childProc) { throw new Error('Child process already exited.'); } requestIds.forEach(function(requestI...
javascript
function sendIpc(message) { var requestIds; clearTimeout(retryTimer); if (message) { tranRequests[message._requestId] = message; } if ((requestIds = Object.keys(tranRequests)).length) { if (!childProc) { throw new Error('Child process already exited.'); } requestIds.forEach(function(requestI...
[ "function", "sendIpc", "(", "message", ")", "{", "var", "requestIds", ";", "clearTimeout", "(", "retryTimer", ")", ";", "if", "(", "message", ")", "{", "tranRequests", "[", "message", ".", "_requestId", "]", "=", "message", ";", "}", "if", "(", "(", "r...
Recover failed IPC-sending. In some environment, IPC message does not reach to child, with no error and return value.
[ "Recover", "failed", "IPC", "-", "sending", ".", "In", "some", "environment", "IPC", "message", "does", "not", "reach", "to", "child", "with", "no", "error", "and", "return", "value", "." ]
3621bda208e1a94527636dacd0a8f4b9e42c9cd0
https://github.com/anseki/process-bridge/blob/3621bda208e1a94527636dacd0a8f4b9e42c9cd0/process-bridge.js#L410-L422
train
anandthakker/geojson-clip-polygon
index.js
isOutside
function isOutside (feature, poly) { var a = feature.bbox = feature.bbox || extent(feature) var b = poly.bbox = poly.bbox || extent(poly) return a[2] < b[0] || a[0] > b[2] || a[3] < b[1] || a[1] > b[3] }
javascript
function isOutside (feature, poly) { var a = feature.bbox = feature.bbox || extent(feature) var b = poly.bbox = poly.bbox || extent(poly) return a[2] < b[0] || a[0] > b[2] || a[3] < b[1] || a[1] > b[3] }
[ "function", "isOutside", "(", "feature", ",", "poly", ")", "{", "var", "a", "=", "feature", ".", "bbox", "=", "feature", ".", "bbox", "||", "extent", "(", "feature", ")", "var", "b", "=", "poly", ".", "bbox", "=", "poly", ".", "bbox", "||", "extent...
no false positives, some false negatives
[ "no", "false", "positives", "some", "false", "negatives" ]
dde74a362f2817f7553a6dd4ee133ad06a27463b
https://github.com/anandthakker/geojson-clip-polygon/blob/dde74a362f2817f7553a6dd4ee133ad06a27463b/index.js#L66-L70
train
thealjey/webcompiler
lib/highlight.js
highlight
function highlight(value) { const el = document.createElement('div'); cm(el, { value, mode: { name: 'jsx', typescript: true }, scrollbarStyle: 'null', inputStyle: 'contenteditable' }); const dom = (0, _cheerio.load)(el.innerHTML), lines = dom('.CodeMirror-line'); // eslint-disable-next-line lodash/pr...
javascript
function highlight(value) { const el = document.createElement('div'); cm(el, { value, mode: { name: 'jsx', typescript: true }, scrollbarStyle: 'null', inputStyle: 'contenteditable' }); const dom = (0, _cheerio.load)(el.innerHTML), lines = dom('.CodeMirror-line'); // eslint-disable-next-line lodash/pr...
[ "function", "highlight", "(", "value", ")", "{", "const", "el", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "cm", "(", "el", ",", "{", "value", ",", "mode", ":", "{", "name", ":", "'jsx'", ",", "typescript", ":", "true", "}", ","...
Using the CodeMirror editor highlights a string of text representing JavaScript program code. @memberof module:highlight @private @method highlight @param {string} value - any valid ES2015, TypeScript, JSX, Flow code @return {Object} an object containing a CheerioDOM object and a CheerioCollection of the `pre.CodeMirr...
[ "Using", "the", "CodeMirror", "editor", "highlights", "a", "string", "of", "text", "representing", "JavaScript", "program", "code", "." ]
eb094f1632e5313ed0c5391a303150f1416b9629
https://github.com/thealjey/webcompiler/blob/eb094f1632e5313ed0c5391a303150f1416b9629/lib/highlight.js#L63-L75
train
thealjey/webcompiler
lib/highlight.js
highlightHTML
function highlightHTML(code = '') { if (!code) { return ''; } const { dom, lines } = highlight(code); return dom.html(lines); }
javascript
function highlightHTML(code = '') { if (!code) { return ''; } const { dom, lines } = highlight(code); return dom.html(lines); }
[ "function", "highlightHTML", "(", "code", "=", "''", ")", "{", "if", "(", "!", "code", ")", "{", "return", "''", ";", "}", "const", "{", "dom", ",", "lines", "}", "=", "highlight", "(", "code", ")", ";", "return", "dom", ".", "html", "(", "lines"...
Using the CodeMirror editor highlights a string of text representing JavaScript program code and returns an HTML string. @memberof module:highlight @method highlightHTML @param {string} [code=""] - any valid ES2015, TypeScript, JSX, Flow code @return {string} an HTML string of the `pre.CodeMirror-line` elements @examp...
[ "Using", "the", "CodeMirror", "editor", "highlights", "a", "string", "of", "text", "representing", "JavaScript", "program", "code", "and", "returns", "an", "HTML", "string", "." ]
eb094f1632e5313ed0c5391a303150f1416b9629
https://github.com/thealjey/webcompiler/blob/eb094f1632e5313ed0c5391a303150f1416b9629/lib/highlight.js#L93-L100
train
svanderburg/nijs
bin/nijs-build/operations.js
evaluatePackage
function evaluatePackage(filename, attr, format) { var pkgs = require(path.resolve(filename)).pkgs; var pkg = pkgs[attr](); var expr = nijs.jsToNix(pkg, format); return expr; }
javascript
function evaluatePackage(filename, attr, format) { var pkgs = require(path.resolve(filename)).pkgs; var pkg = pkgs[attr](); var expr = nijs.jsToNix(pkg, format); return expr; }
[ "function", "evaluatePackage", "(", "filename", ",", "attr", ",", "format", ")", "{", "var", "pkgs", "=", "require", "(", "path", ".", "resolve", "(", "filename", ")", ")", ".", "pkgs", ";", "var", "pkg", "=", "pkgs", "[", "attr", "]", "(", ")", ";...
Imports the given package composition CommonJS module and evaluates the specified package. @param {String} filename Path to the package composition CommonJS module @param {String} attr Name of the package to evaluate @param {Boolean} format Indicates whether to nicely format to expression (i.e. generating whitespaces)...
[ "Imports", "the", "given", "package", "composition", "CommonJS", "module", "and", "evaluates", "the", "specified", "package", "." ]
4e2738cbff3a43aba9297315ca5120cecf8dae3e
https://github.com/svanderburg/nijs/blob/4e2738cbff3a43aba9297315ca5120cecf8dae3e/bin/nijs-build/operations.js#L17-L22
train
svanderburg/nijs
bin/nijs-build/operations.js
evaluatePackageAsync
function evaluatePackageAsync(filename, attr, format, callback) { var pkgs = require(path.resolve(filename)).pkgs; slasp.sequence([ function(callback) { pkgs[attr](callback); }, function(callback, pkg) { var expr = nijs.jsToNix(pkg, format); ...
javascript
function evaluatePackageAsync(filename, attr, format, callback) { var pkgs = require(path.resolve(filename)).pkgs; slasp.sequence([ function(callback) { pkgs[attr](callback); }, function(callback, pkg) { var expr = nijs.jsToNix(pkg, format); ...
[ "function", "evaluatePackageAsync", "(", "filename", ",", "attr", ",", "format", ",", "callback", ")", "{", "var", "pkgs", "=", "require", "(", "path", ".", "resolve", "(", "filename", ")", ")", ".", "pkgs", ";", "slasp", ".", "sequence", "(", "[", "fu...
Imports the given package composition CommonJS module and asynchronously evaluates the specified package. @param {String} filename Path to the package composition CommonJS module @param {String} attr Name of the package to evaluate @param {Boolean} format Indicates whether to nicely format to expression (i.e. generati...
[ "Imports", "the", "given", "package", "composition", "CommonJS", "module", "and", "asynchronously", "evaluates", "the", "specified", "package", "." ]
4e2738cbff3a43aba9297315ca5120cecf8dae3e
https://github.com/svanderburg/nijs/blob/4e2738cbff3a43aba9297315ca5120cecf8dae3e/bin/nijs-build/operations.js#L33-L46
train
manuelodelain/screen-navigator
examples/basic/index.js
onScreenBtnClick
function onScreenBtnClick (event) { const screenId = event.currentTarget.getAttribute('data-screen'); // if the current screen is the same as the clicked one if (screenId === screenNavigator.currentItemId) return; // display the new screen screenNavigator.showScreen(screenId); }
javascript
function onScreenBtnClick (event) { const screenId = event.currentTarget.getAttribute('data-screen'); // if the current screen is the same as the clicked one if (screenId === screenNavigator.currentItemId) return; // display the new screen screenNavigator.showScreen(screenId); }
[ "function", "onScreenBtnClick", "(", "event", ")", "{", "const", "screenId", "=", "event", ".", "currentTarget", ".", "getAttribute", "(", "'data-screen'", ")", ";", "// if the current screen is the same as the clicked one", "if", "(", "screenId", "===", "screenNavigato...
screenNavigator.transitionType = Transitions.OutAndIn; button click handler
[ "screenNavigator", ".", "transitionType", "=", "Transitions", ".", "OutAndIn", ";", "button", "click", "handler" ]
73281a47e04bc0e8f146a5fe3d80f354a21febcf
https://github.com/manuelodelain/screen-navigator/blob/73281a47e04bc0e8f146a5fe3d80f354a21febcf/examples/basic/index.js#L39-L47
train
igorski/zMIDI
src/zMIDI.js
function( aPortNumber ) { var listener = zMIDI._listenerMap[ aPortNumber], inChannel; if ( listener ) { inChannel = zMIDI.getInChannels()[ aPortNumber ]; inChannel.close(); inChannel.removeEventListener( "midimessage", listener...
javascript
function( aPortNumber ) { var listener = zMIDI._listenerMap[ aPortNumber], inChannel; if ( listener ) { inChannel = zMIDI.getInChannels()[ aPortNumber ]; inChannel.close(); inChannel.removeEventListener( "midimessage", listener...
[ "function", "(", "aPortNumber", ")", "{", "var", "listener", "=", "zMIDI", ".", "_listenerMap", "[", "aPortNumber", "]", ",", "inChannel", ";", "if", "(", "listener", ")", "{", "inChannel", "=", "zMIDI", ".", "getInChannels", "(", ")", "[", "aPortNumber", ...
detach a method to listen to MIDI message in events @public @param {number} aPortNumber index of the MIDI port stop listening on
[ "detach", "a", "method", "to", "listen", "to", "MIDI", "message", "in", "events" ]
671bb154fda0ce13269d624464a2dfc95e2a9b34
https://github.com/igorski/zMIDI/blob/671bb154fda0ce13269d624464a2dfc95e2a9b34/src/zMIDI.js#L279-L290
train
igorski/zMIDI
src/zMIDI.js
function() { if ( zMIDI.isConnected() ) { var inputs = /** @type {Array.<MIDIInput>} */ ( [] ); var iface = zMIDI._interface; if ( typeof iface.inputs === "function" ) { inputs = iface.inputs(); ...
javascript
function() { if ( zMIDI.isConnected() ) { var inputs = /** @type {Array.<MIDIInput>} */ ( [] ); var iface = zMIDI._interface; if ( typeof iface.inputs === "function" ) { inputs = iface.inputs(); ...
[ "function", "(", ")", "{", "if", "(", "zMIDI", ".", "isConnected", "(", ")", ")", "{", "var", "inputs", "=", "/** @type {Array.<MIDIInput>} */", "(", "[", "]", ")", ";", "var", "iface", "=", "zMIDI", ".", "_interface", ";", "if", "(", "typeof", "iface"...
retrieve all available MIDI inputs @public @return {Array.<MIDIInput>}
[ "retrieve", "all", "available", "MIDI", "inputs" ]
671bb154fda0ce13269d624464a2dfc95e2a9b34
https://github.com/igorski/zMIDI/blob/671bb154fda0ce13269d624464a2dfc95e2a9b34/src/zMIDI.js#L314-L337
train
igorski/zMIDI
src/zMIDI.js
function() { if ( zMIDI.isConnected() ) { var outputs = /** @type {Array.<MIDIOutput>} */ ( [] ); var iface = zMIDI._interface; if ( typeof iface.outputs === "function" ) { outputs = iface.outputs(); ...
javascript
function() { if ( zMIDI.isConnected() ) { var outputs = /** @type {Array.<MIDIOutput>} */ ( [] ); var iface = zMIDI._interface; if ( typeof iface.outputs === "function" ) { outputs = iface.outputs(); ...
[ "function", "(", ")", "{", "if", "(", "zMIDI", ".", "isConnected", "(", ")", ")", "{", "var", "outputs", "=", "/** @type {Array.<MIDIOutput>} */", "(", "[", "]", ")", ";", "var", "iface", "=", "zMIDI", ".", "_interface", ";", "if", "(", "typeof", "ifac...
retrieve all available MIDI output ports @public @return {Array.<MIDIOutput>}
[ "retrieve", "all", "available", "MIDI", "output", "ports" ]
671bb154fda0ce13269d624464a2dfc95e2a9b34
https://github.com/igorski/zMIDI/blob/671bb154fda0ce13269d624464a2dfc95e2a9b34/src/zMIDI.js#L345-L368
train
serg-io/dyndb
dyndb.js
sendRequest
function sendRequest(operationName, body, callback, context) { if (_.isFunction(body)) { context = callback; callback = body; body = undefined; } body || (body = {}); body = new Buffer(_.isString(body) ? body : JSON.stringify(body)); var httpOpts = { host: SERVICE_NAME.toLowerCase() + '.' + regio...
javascript
function sendRequest(operationName, body, callback, context) { if (_.isFunction(body)) { context = callback; callback = body; body = undefined; } body || (body = {}); body = new Buffer(_.isString(body) ? body : JSON.stringify(body)); var httpOpts = { host: SERVICE_NAME.toLowerCase() + '.' + regio...
[ "function", "sendRequest", "(", "operationName", ",", "body", ",", "callback", ",", "context", ")", "{", "if", "(", "_", ".", "isFunction", "(", "body", ")", ")", "{", "context", "=", "callback", ";", "callback", "=", "body", ";", "body", "=", "undefin...
Underlying method that builds the request before sending it and relays the response to the callback. @method sendRequest @private @param {String} operationName Name of the DynamoDB operation to request. @param {Object|String} [body='{}'] Body of the request. @param {Function} [callback] Callback function to call after...
[ "Underlying", "method", "that", "builds", "the", "request", "before", "sending", "it", "and", "relays", "the", "response", "to", "the", "callback", "." ]
6f916347aec6678a855c0fa2205e8c84cabce65c
https://github.com/serg-io/dyndb/blob/6f916347aec6678a855c0fa2205e8c84cabce65c/dyndb.js#L272-L304
train
purtuga/dom-data-bind
src/Template.js
getTextBindingForToken
function getTextBindingForToken(Directive, tokenText) { tokenText = tokenText.trim(); let directiveInstances = PRIVATE.get(Directive); if (!directiveInstances) { directiveInstances = {}; PRIVATE.set(Directive, directiveInstances); } if (!directiveInstances[tokenText]) { di...
javascript
function getTextBindingForToken(Directive, tokenText) { tokenText = tokenText.trim(); let directiveInstances = PRIVATE.get(Directive); if (!directiveInstances) { directiveInstances = {}; PRIVATE.set(Directive, directiveInstances); } if (!directiveInstances[tokenText]) { di...
[ "function", "getTextBindingForToken", "(", "Directive", ",", "tokenText", ")", "{", "tokenText", "=", "tokenText", ".", "trim", "(", ")", ";", "let", "directiveInstances", "=", "PRIVATE", ".", "get", "(", "Directive", ")", ";", "if", "(", "!", "directiveInst...
Returns a node handlers for the given directive @param {Directive} Directive @param {String} tokenText The token text (no curly braces) @returns {Directive} Returns a Directive instance. Call `.getNodeHandler` to get a handler for a given node
[ "Returns", "a", "node", "handlers", "for", "the", "given", "directive" ]
0935941568ee5b48dd62a8a0baf982028adce15a
https://github.com/purtuga/dom-data-bind/blob/0935941568ee5b48dd62a8a0baf982028adce15a/src/Template.js#L338-L353
train
nicjansma/saltthepass.js
dist/saltthepass.js
DomainNameRule
function DomainNameRule(data) { if (typeof (data) === "undefined") { return; } // // matches // this.domain = data.domain; if (data.aliases instanceof Array) { this.aliases = data.aliases.slice(); } else { this.aliases...
javascript
function DomainNameRule(data) { if (typeof (data) === "undefined") { return; } // // matches // this.domain = data.domain; if (data.aliases instanceof Array) { this.aliases = data.aliases.slice(); } else { this.aliases...
[ "function", "DomainNameRule", "(", "data", ")", "{", "if", "(", "typeof", "(", "data", ")", "===", "\"undefined\"", ")", "{", "return", ";", "}", "//", "// matches", "//", "this", ".", "domain", "=", "data", ".", "domain", ";", "if", "(", "data", "."...
Constructor Creates a new DomainNameRule @param {object} data Parameters
[ "Constructor", "Creates", "a", "new", "DomainNameRule" ]
11a3bc652a239d7d505b0debd16adc6d338d19f0
https://github.com/nicjansma/saltthepass.js/blob/11a3bc652a239d7d505b0debd16adc6d338d19f0/dist/saltthepass.js#L107-L136
train
rocketedaway/node-flickr-image-downloader
flickr-image-downloader.js
FlickrImageDownloader
function FlickrImageDownloader () { var that = this; that.url = ''; that.delay = 500; that.downloadFolder = ''; that.paths = {}; that.paths.base = 'https://www.flickr.com'; that.paths.photostream = 'photos/!username'; that.paths.set = that.paths.photostream + '/sets'; that.paths.favorites = that.paths.photo...
javascript
function FlickrImageDownloader () { var that = this; that.url = ''; that.delay = 500; that.downloadFolder = ''; that.paths = {}; that.paths.base = 'https://www.flickr.com'; that.paths.photostream = 'photos/!username'; that.paths.set = that.paths.photostream + '/sets'; that.paths.favorites = that.paths.photo...
[ "function", "FlickrImageDownloader", "(", ")", "{", "var", "that", "=", "this", ";", "that", ".", "url", "=", "''", ";", "that", ".", "delay", "=", "500", ";", "that", ".", "downloadFolder", "=", "''", ";", "that", ".", "paths", "=", "{", "}", ";",...
Module to export
[ "Module", "to", "export" ]
220e93eebd652d0abce944f1c774604aa86baab7
https://github.com/rocketedaway/node-flickr-image-downloader/blob/220e93eebd652d0abce944f1c774604aa86baab7/flickr-image-downloader.js#L12-L54
train
af83/node-serializer
serializer.js
signStr
function signStr(str, key) { var hmac = crypto.createHmac('sha1', key); hmac.update(str); return hmac.digest('base64').replace(/\+/g, '-').replace(/\//g, '_'); }
javascript
function signStr(str, key) { var hmac = crypto.createHmac('sha1', key); hmac.update(str); return hmac.digest('base64').replace(/\+/g, '-').replace(/\//g, '_'); }
[ "function", "signStr", "(", "str", ",", "key", ")", "{", "var", "hmac", "=", "crypto", ".", "createHmac", "(", "'sha1'", ",", "key", ")", ";", "hmac", ".", "update", "(", "str", ")", ";", "return", "hmac", ".", "digest", "(", "'base64'", ")", ".", ...
Return base64url signed sha1 hash of str using key
[ "Return", "base64url", "signed", "sha1", "hash", "of", "str", "using", "key" ]
c7cb3a075fa4b979b2bcb90fe1e457f013c7777b
https://github.com/af83/node-serializer/blob/c7cb3a075fa4b979b2bcb90fe1e457f013c7777b/serializer.js#L59-L63
train
anywhichway/chrome-proxy
index.js
function (changeset) { changeset.forEach(function(change) { if(change.name!=="__target__") { if(change.type==="delete") { delete proxy[change.name]; } else if(change.type==="update") { // update handler if target key value changes from function to non-function or from a non-function to ...
javascript
function (changeset) { changeset.forEach(function(change) { if(change.name!=="__target__") { if(change.type==="delete") { delete proxy[change.name]; } else if(change.type==="update") { // update handler if target key value changes from function to non-function or from a non-function to ...
[ "function", "(", "changeset", ")", "{", "changeset", ".", "forEach", "(", "function", "(", "change", ")", "{", "if", "(", "change", ".", "name", "!==", "\"__target__\"", ")", "{", "if", "(", "change", ".", "type", "===", "\"delete\"", ")", "{", "delete...
Observe the target for changes and update the handlers accordingly
[ "Observe", "the", "target", "for", "changes", "and", "update", "the", "handlers", "accordingly" ]
41dde561732d27e98651beffe48b5cd389e7975b
https://github.com/anywhichway/chrome-proxy/blob/41dde561732d27e98651beffe48b5cd389e7975b/index.js#L101-L114
train
aldeed/node-mongo-object
lib/mongo-object.js
traverse
function traverse(obj) { each(obj, (val, indexOrProp) => { // Move deeper into the object const next = obj[indexOrProp]; // If we can go no further, then quit if (MongoObject.isBasicObject(next)) { traverse(next); } else if (Array.isArray(next)) { obj[i...
javascript
function traverse(obj) { each(obj, (val, indexOrProp) => { // Move deeper into the object const next = obj[indexOrProp]; // If we can go no further, then quit if (MongoObject.isBasicObject(next)) { traverse(next); } else if (Array.isArray(next)) { obj[i...
[ "function", "traverse", "(", "obj", ")", "{", "each", "(", "obj", ",", "(", "val", ",", "indexOrProp", ")", "=>", "{", "// Move deeper into the object", "const", "next", "=", "obj", "[", "indexOrProp", "]", ";", "// If we can go no further, then quit", "if", "...
Traverse and pull out removed array items at this point
[ "Traverse", "and", "pull", "out", "removed", "array", "items", "at", "this", "point" ]
040fbbdeeea4d1f8c6da17ecca2d203b8a20c048
https://github.com/aldeed/node-mongo-object/blob/040fbbdeeea4d1f8c6da17ecca2d203b8a20c048/lib/mongo-object.js#L558-L571
train
aldeed/node-mongo-object
lib/mongo-object.js
extractOp
function extractOp(position) { const firstPositionPiece = position.slice(0, position.indexOf('[')); return (firstPositionPiece.substring(0, 1) === '$') ? firstPositionPiece : null; }
javascript
function extractOp(position) { const firstPositionPiece = position.slice(0, position.indexOf('[')); return (firstPositionPiece.substring(0, 1) === '$') ? firstPositionPiece : null; }
[ "function", "extractOp", "(", "position", ")", "{", "const", "firstPositionPiece", "=", "position", ".", "slice", "(", "0", ",", "position", ".", "indexOf", "(", "'['", ")", ")", ";", "return", "(", "firstPositionPiece", ".", "substring", "(", "0", ",", ...
Extracts operator piece, if present, from position string
[ "Extracts", "operator", "piece", "if", "present", "from", "position", "string" ]
040fbbdeeea4d1f8c6da17ecca2d203b8a20c048
https://github.com/aldeed/node-mongo-object/blob/040fbbdeeea4d1f8c6da17ecca2d203b8a20c048/lib/mongo-object.js#L929-L932
train
ithinkihaveacat/node-fishback
lib/helper.js
isFreshEnough
function isFreshEnough(entry, req) { // If no cache-control header in request, then entry is fresh // if it hasn't expired. if (!("cache-control" in req.headers)) { return new Date().getTime() < entry.expires; } var headers = parseHeader(req.headers["cache-control"]); if ("must-revalid...
javascript
function isFreshEnough(entry, req) { // If no cache-control header in request, then entry is fresh // if it hasn't expired. if (!("cache-control" in req.headers)) { return new Date().getTime() < entry.expires; } var headers = parseHeader(req.headers["cache-control"]); if ("must-revalid...
[ "function", "isFreshEnough", "(", "entry", ",", "req", ")", "{", "// If no cache-control header in request, then entry is fresh", "// if it hasn't expired.", "if", "(", "!", "(", "\"cache-control\"", "in", "req", ".", "headers", ")", ")", "{", "return", "new", "Date",...
true if the candidate reponse satisfies the request in terms of freshness, otherwise false.
[ "true", "if", "the", "candidate", "reponse", "satisfies", "the", "request", "in", "terms", "of", "freshness", "otherwise", "false", "." ]
dbf21d1dcc87cd0bfe19af673157a1869090934f
https://github.com/ithinkihaveacat/node-fishback/blob/dbf21d1dcc87cd0bfe19af673157a1869090934f/lib/helper.js#L70-L93
train
thealjey/webcompiler
lib/yaml.js
yaml
function yaml(filename, callback) { try { const yamlString = (0, _fs.readFileSync)(filename, 'utf8'); callback(null, (0, _jsYaml.safeLoad)(yamlString, { filename })); } catch (e) { callback(e, {}); } }
javascript
function yaml(filename, callback) { try { const yamlString = (0, _fs.readFileSync)(filename, 'utf8'); callback(null, (0, _jsYaml.safeLoad)(yamlString, { filename })); } catch (e) { callback(e, {}); } }
[ "function", "yaml", "(", "filename", ",", "callback", ")", "{", "try", "{", "const", "yamlString", "=", "(", "0", ",", "_fs", ".", "readFileSync", ")", "(", "filename", ",", "'utf8'", ")", ";", "callback", "(", "null", ",", "(", "0", ",", "_jsYaml", ...
Read the contents of a YAML file @function yaml @param {string} filename - the full system path to a YAML file @param {ObjectOrErrorCallback} callback - a callback function @example import {yaml} from 'webcompiler'; // or - import {yaml} from 'webcompiler/lib/yaml'; // or - var yaml = require('webcompil...
[ "Read", "the", "contents", "of", "a", "YAML", "file" ]
eb094f1632e5313ed0c5391a303150f1416b9629
https://github.com/thealjey/webcompiler/blob/eb094f1632e5313ed0c5391a303150f1416b9629/lib/yaml.js#L31-L39
train
reklatsmasters/ip2buf
lib/pton6.js
pton6
function pton6(addr, dest, index = 0) { if (typeof addr !== 'string') { throw new TypeError('Argument 1 should be a string.') } if (addr.length <= 0) { einval() } const isbuffer = Buffer.isBuffer(dest) const endp = index + IPV6_OCTETS if (isbuffer) { if (endp > dest.length) { throw ne...
javascript
function pton6(addr, dest, index = 0) { if (typeof addr !== 'string') { throw new TypeError('Argument 1 should be a string.') } if (addr.length <= 0) { einval() } const isbuffer = Buffer.isBuffer(dest) const endp = index + IPV6_OCTETS if (isbuffer) { if (endp > dest.length) { throw ne...
[ "function", "pton6", "(", "addr", ",", "dest", ",", "index", "=", "0", ")", "{", "if", "(", "typeof", "addr", "!==", "'string'", ")", "{", "throw", "new", "TypeError", "(", "'Argument 1 should be a string.'", ")", "}", "if", "(", "addr", ".", "length", ...
Convert IPv6 to the Buffer. @param {string} addr @param {Buffer} [dest] @return {Buffer}
[ "Convert", "IPv6", "to", "the", "Buffer", "." ]
439c55cc7605423929808d42a29b9cd284914cd6
https://github.com/reklatsmasters/ip2buf/blob/439c55cc7605423929808d42a29b9cd284914cd6/lib/pton6.js#L47-L156
train
thealjey/webcompiler
lib/markdown.js
markdownToUnwrappedHTML
function markdownToUnwrappedHTML(markdown) { const html = (0, _trim2.default)(md.render(markdown)), { dom, children } = (0, _jsx.parseHTML)(html); if (1 !== children.length) { return html; } const [child] = children, { type, name } = child; return 'tag' === type && 'p' === name ? dom(chi...
javascript
function markdownToUnwrappedHTML(markdown) { const html = (0, _trim2.default)(md.render(markdown)), { dom, children } = (0, _jsx.parseHTML)(html); if (1 !== children.length) { return html; } const [child] = children, { type, name } = child; return 'tag' === type && 'p' === name ? dom(chi...
[ "function", "markdownToUnwrappedHTML", "(", "markdown", ")", "{", "const", "html", "=", "(", "0", ",", "_trim2", ".", "default", ")", "(", "md", ".", "render", "(", "markdown", ")", ")", ",", "{", "dom", ",", "children", "}", "=", "(", "0", ",", "_...
Useful utilities for working with Markdown. @module markdown If a simple single line string is passed to the Markdown parser it thinks that it's a paragraph (it sort of technically is) and unnecessarily wraps it into `<p></p>`, which most often is not the desired behavior. This function converts Markdown to HTML an...
[ "Useful", "utilities", "for", "working", "with", "Markdown", "." ]
eb094f1632e5313ed0c5391a303150f1416b9629
https://github.com/thealjey/webcompiler/blob/eb094f1632e5313ed0c5391a303150f1416b9629/lib/markdown.js#L44-L55
train
thealjey/webcompiler
lib/markdown.js
markdownToJSX
function markdownToJSX(markdown = '') { markdown = (0, _trim2.default)(markdown); return markdown ? (0, _jsx.htmlToJSX)(markdownToUnwrappedHTML(markdown)) : []; }
javascript
function markdownToJSX(markdown = '') { markdown = (0, _trim2.default)(markdown); return markdown ? (0, _jsx.htmlToJSX)(markdownToUnwrappedHTML(markdown)) : []; }
[ "function", "markdownToJSX", "(", "markdown", "=", "''", ")", "{", "markdown", "=", "(", "0", ",", "_trim2", ".", "default", ")", "(", "markdown", ")", ";", "return", "markdown", "?", "(", "0", ",", "_jsx", ".", "htmlToJSX", ")", "(", "markdownToUnwrap...
Converts an arbitrary Markdown string to an array of React Elements @memberof module:markdown @method markdownToJSX @param {string} [markdown=""] - an arbitrary Markdown string @return {Array<ReactElement>} an array of React Elements @example import {markdownToJSX} from 'webcompiler'; // or - import {markdownToJSX} fr...
[ "Converts", "an", "arbitrary", "Markdown", "string", "to", "an", "array", "of", "React", "Elements" ]
eb094f1632e5313ed0c5391a303150f1416b9629
https://github.com/thealjey/webcompiler/blob/eb094f1632e5313ed0c5391a303150f1416b9629/lib/markdown.js#L94-L98
train
jclulow/node-ansiterm
examples/scrol.js
_listbox
function _listbox() { at.write(VT_SAVE_CURSOR); // save at.write(CSI + (LAST + 2) + ';' + (AGAIN - 2) + 'r'); at.moveto(1, LAST + 2); //at.write(CSI + 'J'); // erase down KEYS.forEach(function(line, idx) { if (selected === idx) at.reverse(); var ll = line.substr(0, process.stdout.columns - 2); a...
javascript
function _listbox() { at.write(VT_SAVE_CURSOR); // save at.write(CSI + (LAST + 2) + ';' + (AGAIN - 2) + 'r'); at.moveto(1, LAST + 2); //at.write(CSI + 'J'); // erase down KEYS.forEach(function(line, idx) { if (selected === idx) at.reverse(); var ll = line.substr(0, process.stdout.columns - 2); a...
[ "function", "_listbox", "(", ")", "{", "at", ".", "write", "(", "VT_SAVE_CURSOR", ")", ";", "// save", "at", ".", "write", "(", "CSI", "+", "(", "LAST", "+", "2", ")", "+", "';'", "+", "(", "AGAIN", "-", "2", ")", "+", "'r'", ")", ";", "at", ...
which index into KEYS is presently selected?
[ "which", "index", "into", "KEYS", "is", "presently", "selected?" ]
cf5223e692e1e1f20c452c9f21060df2cb5bd90e
https://github.com/jclulow/node-ansiterm/blob/cf5223e692e1e1f20c452c9f21060df2cb5bd90e/examples/scrol.js#L173-L191
train
Hugo-ter-Doest/chart-parsers
lib/Chart.js
Chart
function Chart(N) { logger.debug("Chart: " + N); this.N = N; this.outgoing_edges = new Array(N+1); this.incoming_edges = new Array(N+1); var i; for (i = 0; i <= N; i++) { this.outgoing_edges[i] = {}; this.incoming_edges[i] = {}; } }
javascript
function Chart(N) { logger.debug("Chart: " + N); this.N = N; this.outgoing_edges = new Array(N+1); this.incoming_edges = new Array(N+1); var i; for (i = 0; i <= N; i++) { this.outgoing_edges[i] = {}; this.incoming_edges[i] = {}; } }
[ "function", "Chart", "(", "N", ")", "{", "logger", ".", "debug", "(", "\"Chart: \"", "+", "N", ")", ";", "this", ".", "N", "=", "N", ";", "this", ".", "outgoing_edges", "=", "new", "Array", "(", "N", "+", "1", ")", ";", "this", ".", "incoming_edg...
Creates a chart for recognition of a sentence of length N
[ "Creates", "a", "chart", "for", "recognition", "of", "a", "sentence", "of", "length", "N" ]
81be32f897f6dceeffebd2009ad865964da12c4b
https://github.com/Hugo-ter-Doest/chart-parsers/blob/81be32f897f6dceeffebd2009ad865964da12c4b/lib/Chart.js#L31-L43
train
quantmind/d3-visualize
src/core/visual.js
visualManager
function visualManager (records) { let nodes, node; records.forEach(record => { nodes = record.removedNodes; if (!nodes || !nodes.length) return; for (let i=0; i<nodes.length; ++i) { node = nodes[i]; if (node.querySelectorAll) { if (!node.__visua...
javascript
function visualManager (records) { let nodes, node; records.forEach(record => { nodes = record.removedNodes; if (!nodes || !nodes.length) return; for (let i=0; i<nodes.length; ++i) { node = nodes[i]; if (node.querySelectorAll) { if (!node.__visua...
[ "function", "visualManager", "(", "records", ")", "{", "let", "nodes", ",", "node", ";", "records", ".", "forEach", "(", "record", "=>", "{", "nodes", "=", "record", ".", "removedNodes", ";", "if", "(", "!", "nodes", "||", "!", "nodes", ".", "length", ...
Clears visualisation going out of scope
[ "Clears", "visualisation", "going", "out", "of", "scope" ]
67dac5a3ea5146eb70eb975667b49cf3827a5df7
https://github.com/quantmind/d3-visualize/blob/67dac5a3ea5146eb70eb975667b49cf3827a5df7/src/core/visual.js#L190-L207
train
Gi60s/cli-format
bin/format.js
maximizeLargeWord
function maximizeLargeWord(word, hardBreakStr, maxWidth) { var availableWidth; var ch; var chWidth; var i; availableWidth = maxWidth - Format.width(hardBreakStr); for (i = 0; i < word.length; i++) { ch = word.charAt(i); chWidth = Format.width(ch); if (availableWidth >= ...
javascript
function maximizeLargeWord(word, hardBreakStr, maxWidth) { var availableWidth; var ch; var chWidth; var i; availableWidth = maxWidth - Format.width(hardBreakStr); for (i = 0; i < word.length; i++) { ch = word.charAt(i); chWidth = Format.width(ch); if (availableWidth >= ...
[ "function", "maximizeLargeWord", "(", "word", ",", "hardBreakStr", ",", "maxWidth", ")", "{", "var", "availableWidth", ";", "var", "ch", ";", "var", "chWidth", ";", "var", "i", ";", "availableWidth", "=", "maxWidth", "-", "Format", ".", "width", "(", "hard...
If a word is too large for a line then find out how much will fit on one line and return the result. @param {string} word @param {string} hardBreakStr @param {number} maxWidth @returns {object}
[ "If", "a", "word", "is", "too", "large", "for", "a", "line", "then", "find", "out", "how", "much", "will", "fit", "on", "one", "line", "and", "return", "the", "result", "." ]
fe74d976cd3cb3bbbaec7d966ffd9bc41bda150d
https://github.com/Gi60s/cli-format/blob/fe74d976cd3cb3bbbaec7d966ffd9bc41bda150d/bin/format.js#L500-L522
train
sammysaglam/axe-prop-types
index.js
function (propType, values) { propType.info = Object.assign( propType.info ? propType.info : {}, values ); if (propType.isRequired) { propType.isRequired.info = Object.assign( propType.isRequired && propType.isRequired.info ? propType.isRequired.info : {}, values ); propType.isRequired.info.isRequ...
javascript
function (propType, values) { propType.info = Object.assign( propType.info ? propType.info : {}, values ); if (propType.isRequired) { propType.isRequired.info = Object.assign( propType.isRequired && propType.isRequired.info ? propType.isRequired.info : {}, values ); propType.isRequired.info.isRequ...
[ "function", "(", "propType", ",", "values", ")", "{", "propType", ".", "info", "=", "Object", ".", "assign", "(", "propType", ".", "info", "?", "propType", ".", "info", ":", "{", "}", ",", "values", ")", ";", "if", "(", "propType", ".", "isRequired",...
function to add key value pair to proptype
[ "function", "to", "add", "key", "value", "pair", "to", "proptype" ]
4f836232c75556ff510bc1ccff2656a4fb88315b
https://github.com/sammysaglam/axe-prop-types/blob/4f836232c75556ff510bc1ccff2656a4fb88315b/index.js#L23-L41
train
tamtakoe/node-arjs-builder
index.js
copy
function copy(copiesMap, projectsPath, buildPath) { return _.map(copiesMap, function(dstPath, srcPath) { if (/\/$/.test(dstPath)) { //copy directory return gulp.src(path.join(projectsPath, srcPath)) .pipe(gulp.dest(path.join(bui...
javascript
function copy(copiesMap, projectsPath, buildPath) { return _.map(copiesMap, function(dstPath, srcPath) { if (/\/$/.test(dstPath)) { //copy directory return gulp.src(path.join(projectsPath, srcPath)) .pipe(gulp.dest(path.join(bui...
[ "function", "copy", "(", "copiesMap", ",", "projectsPath", ",", "buildPath", ")", "{", "return", "_", ".", "map", "(", "copiesMap", ",", "function", "(", "dstPath", ",", "srcPath", ")", "{", "if", "(", "/", "\\/$", "/", ".", "test", "(", "dstPath", "...
copying for other projects
[ "copying", "for", "other", "projects" ]
9fb6ff399fe09b860f1a4673b643d291834ec632
https://github.com/tamtakoe/node-arjs-builder/blob/9fb6ff399fe09b860f1a4673b643d291834ec632/index.js#L211-L224
train
waigo/waigo
src/support/middleware/errorHandler.js
function() { let args = Array.prototype.slice.call(arguments), ErrorClass = args[0]; if (_.isObject(ErrorClass)) { args.shift(); } else { ErrorClass = errors.RuntimeError; } args.unshift(null); // the this arg for the .bind() call throw new (Function.prototype.bind.apply(ErrorClass, args));...
javascript
function() { let args = Array.prototype.slice.call(arguments), ErrorClass = args[0]; if (_.isObject(ErrorClass)) { args.shift(); } else { ErrorClass = errors.RuntimeError; } args.unshift(null); // the this arg for the .bind() call throw new (Function.prototype.bind.apply(ErrorClass, args));...
[ "function", "(", ")", "{", "let", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ",", "ErrorClass", "=", "args", "[", "0", "]", ";", "if", "(", "_", ".", "isObject", "(", "ErrorClass", ")", ")", "{", "ar...
Throw an error @param {Class} [errorClass] Error class. Default is `RuntimeError`. @param {Any} ... Additional arguments get passed to error class constructor. @throws Error
[ "Throw", "an", "error" ]
b2f50cd66b8b19016e2c7de75733330c791c76ff
https://github.com/waigo/waigo/blob/b2f50cd66b8b19016e2c7de75733330c791c76ff/src/support/middleware/errorHandler.js#L83-L96
train
alexindigo/deeply
adapters/array.js
arrayAdapter
function arrayAdapter(to, from, merge) { // reset target array to.splice(0); // transfer actual values from.reduce(function(target, value, index) { // use `undefined` as always-override value target[index] = merge(undefined, value); return target; }, to); return to; }
javascript
function arrayAdapter(to, from, merge) { // reset target array to.splice(0); // transfer actual values from.reduce(function(target, value, index) { // use `undefined` as always-override value target[index] = merge(undefined, value); return target; }, to); return to; }
[ "function", "arrayAdapter", "(", "to", ",", "from", ",", "merge", ")", "{", "// reset target array", "to", ".", "splice", "(", "0", ")", ";", "// transfer actual values", "from", ".", "reduce", "(", "function", "(", "target", ",", "value", ",", "index", ")...
Adapter to merge arrays Note: resets target value @param {array} to - target array to update @param {array} from - array to clone @param {function} merge - iterator to merge sub elements @returns {array} - modified target object
[ "Adapter", "to", "merge", "arrays" ]
d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1
https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/adapters/array.js#L14-L29
train
pford68/aspectjs
index.js
weave
function weave(type, advised, advisedFunc, aopProxy) { let f, $execute, standalone = false, transfer = aopProxy.transfer, adviser = aopProxy.adviser; if (!advisedFunc) { standalone = true; $execute = advised; } else { $execute = advised[advisedFunc].bind(advised); ...
javascript
function weave(type, advised, advisedFunc, aopProxy) { let f, $execute, standalone = false, transfer = aopProxy.transfer, adviser = aopProxy.adviser; if (!advisedFunc) { standalone = true; $execute = advised; } else { $execute = advised[advisedFunc].bind(advised); ...
[ "function", "weave", "(", "type", ",", "advised", ",", "advisedFunc", ",", "aopProxy", ")", "{", "let", "f", ",", "$execute", ",", "standalone", "=", "false", ",", "transfer", "=", "aopProxy", ".", "transfer", ",", "adviser", "=", "aopProxy", ".", "advis...
A simple AOP implementation for JavaScript @author Philip Ford
[ "A", "simple", "AOP", "implementation", "for", "JavaScript" ]
7e2a78d2e45ffd33ea736d5f171191121075a73a
https://github.com/pford68/aspectjs/blob/7e2a78d2e45ffd33ea736d5f171191121075a73a/index.js#L7-L58
train
bvalosek/sticky
util/identityTransform.js
identityTranform
function identityTranform(idSelector) { idSelector = idSelector || function(x) { return x.id; }; var identityMap = {}; return function(input, output, instance) { var id; // Swap out the instance we are populating in the output transform chain if // we have a cached version of it, otherwise this will...
javascript
function identityTranform(idSelector) { idSelector = idSelector || function(x) { return x.id; }; var identityMap = {}; return function(input, output, instance) { var id; // Swap out the instance we are populating in the output transform chain if // we have a cached version of it, otherwise this will...
[ "function", "identityTranform", "(", "idSelector", ")", "{", "idSelector", "=", "idSelector", "||", "function", "(", "x", ")", "{", "return", "x", ".", "id", ";", "}", ";", "var", "identityMap", "=", "{", "}", ";", "return", "function", "(", "input", "...
A stick tranform that keeps in internal hash of all returned objects to ensure that identity is maintained. This is leaky as hell. @param {function(item: any): string} idSelector
[ "A", "stick", "tranform", "that", "keeps", "in", "internal", "hash", "of", "all", "returned", "objects", "to", "ensure", "that", "identity", "is", "maintained", ".", "This", "is", "leaky", "as", "hell", "." ]
8cb5fdba05be161e5936f7208558bc4702aae59a
https://github.com/bvalosek/sticky/blob/8cb5fdba05be161e5936f7208558bc4702aae59a/util/identityTransform.js#L8-L42
train
jtangelder/faketouches.js
faketouches.js
FakeTouches
function FakeTouches(element) { this.element = element; this.touches = []; this.touch_type = FakeTouches.TOUCH_EVENTS; this.has_multitouch = true; }
javascript
function FakeTouches(element) { this.element = element; this.touches = []; this.touch_type = FakeTouches.TOUCH_EVENTS; this.has_multitouch = true; }
[ "function", "FakeTouches", "(", "element", ")", "{", "this", ".", "element", "=", "element", ";", "this", ".", "touches", "=", "[", "]", ";", "this", ".", "touch_type", "=", "FakeTouches", ".", "TOUCH_EVENTS", ";", "this", ".", "has_multitouch", "=", "tr...
create faketouches instance @param element @constructor
[ "create", "faketouches", "instance" ]
6d45de08109018a768bf1e3822a4bf63fd230564
https://github.com/jtangelder/faketouches.js/blob/6d45de08109018a768bf1e3822a4bf63fd230564/faketouches.js#L13-L19
train
jtangelder/faketouches.js
faketouches.js
triggerTouch
function triggerTouch(type) { var event = document.createEvent('Event'); var touchlist = this._createTouchList(this.touches); event.initEvent('touch' + type, true, true); event.touches = touchlist; event.changedTouches = touchlist; return this.element.dispatchEvent(even...
javascript
function triggerTouch(type) { var event = document.createEvent('Event'); var touchlist = this._createTouchList(this.touches); event.initEvent('touch' + type, true, true); event.touches = touchlist; event.changedTouches = touchlist; return this.element.dispatchEvent(even...
[ "function", "triggerTouch", "(", "type", ")", "{", "var", "event", "=", "document", ".", "createEvent", "(", "'Event'", ")", ";", "var", "touchlist", "=", "this", ".", "_createTouchList", "(", "this", ".", "touches", ")", ";", "event", ".", "initEvent", ...
trigger touch event @param type @returns {Boolean}
[ "trigger", "touch", "event" ]
6d45de08109018a768bf1e3822a4bf63fd230564
https://github.com/jtangelder/faketouches.js/blob/6d45de08109018a768bf1e3822a4bf63fd230564/faketouches.js#L175-L184
train
jtangelder/faketouches.js
faketouches.js
triggerMouse
function triggerMouse(type) { var names = { start: 'mousedown', move: 'mousemove', end: 'mouseup' }; var event = document.createEvent('Event'); event.initEvent(names[type], true, true); var touchList = this._createTouchList(this.touches); ...
javascript
function triggerMouse(type) { var names = { start: 'mousedown', move: 'mousemove', end: 'mouseup' }; var event = document.createEvent('Event'); event.initEvent(names[type], true, true); var touchList = this._createTouchList(this.touches); ...
[ "function", "triggerMouse", "(", "type", ")", "{", "var", "names", "=", "{", "start", ":", "'mousedown'", ",", "move", ":", "'mousemove'", ",", "end", ":", "'mouseup'", "}", ";", "var", "event", "=", "document", ".", "createEvent", "(", "'Event'", ")", ...
trigger mouse event @param type @returns {Boolean}
[ "trigger", "mouse", "event" ]
6d45de08109018a768bf1e3822a4bf63fd230564
https://github.com/jtangelder/faketouches.js/blob/6d45de08109018a768bf1e3822a4bf63fd230564/faketouches.js#L191-L209
train
jtangelder/faketouches.js
faketouches.js
triggerPointerEvents
function triggerPointerEvents(type, pointerType) { var self = this; var names = { start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp' }; var touchList = this._createTouchList(this.touches); touchList.forEach(function(touch) { ...
javascript
function triggerPointerEvents(type, pointerType) { var self = this; var names = { start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp' }; var touchList = this._createTouchList(this.touches); touchList.forEach(function(touch) { ...
[ "function", "triggerPointerEvents", "(", "type", ",", "pointerType", ")", "{", "var", "self", "=", "this", ";", "var", "names", "=", "{", "start", ":", "'MSPointerDown'", ",", "move", ":", "'MSPointerMove'", ",", "end", ":", "'MSPointerUp'", "}", ";", "var...
trigger pointer event @param type @param pointerType @returns {Boolean}
[ "trigger", "pointer", "event" ]
6d45de08109018a768bf1e3822a4bf63fd230564
https://github.com/jtangelder/faketouches.js/blob/6d45de08109018a768bf1e3822a4bf63fd230564/faketouches.js#L217-L246
train
arve0/metalsmith-pandoc
index.js
plugin
function plugin(options){ options = options || {}; var from = options.from || 'markdown'; var to = options.to || 'html5'; var args = options.args || []; var opts = options.opts || {}; var pattern = options.pattern || '**/*.md'; var extension = options.ext || '.html'; if (to === 'docx' || to === 'pd...
javascript
function plugin(options){ options = options || {}; var from = options.from || 'markdown'; var to = options.to || 'html5'; var args = options.args || []; var opts = options.opts || {}; var pattern = options.pattern || '**/*.md'; var extension = options.ext || '.html'; if (to === 'docx' || to === 'pd...
[ "function", "plugin", "(", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "from", "=", "options", ".", "from", "||", "'markdown'", ";", "var", "to", "=", "options", ".", "to", "||", "'html5'", ";", "var", "args", "=", "...
Metalsmith plugin to convert files using pandoc.
[ "Metalsmith", "plugin", "to", "convert", "files", "using", "pandoc", "." ]
75d4c97850e0b3a32ce9b27a0984eb6cb901e42e
https://github.com/arve0/metalsmith-pandoc/blob/75d4c97850e0b3a32ce9b27a0984eb6cb901e42e/index.js#L32-L105
train
bmacheski/node-icloud
index.js
Device
function Device(apple_id, password, display_name) { if (!(this instanceof Device)) return new Device(apple_id, password, display_name); this.apple_id = apple_id; this.password = password; this.display_name = display_name; this.devices = []; this.authenticated = false; }
javascript
function Device(apple_id, password, display_name) { if (!(this instanceof Device)) return new Device(apple_id, password, display_name); this.apple_id = apple_id; this.password = password; this.display_name = display_name; this.devices = []; this.authenticated = false; }
[ "function", "Device", "(", "apple_id", ",", "password", ",", "display_name", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Device", ")", ")", "return", "new", "Device", "(", "apple_id", ",", "password", ",", "display_name", ")", ";", "this", ".",...
Initialize a new `Device`. @param {String} username @param {String} password @param {String} device_name
[ "Initialize", "a", "new", "Device", "." ]
ea4b7cf1e92f5603adb04872997a2e586491d7d7
https://github.com/bmacheski/node-icloud/blob/ea4b7cf1e92f5603adb04872997a2e586491d7d7/index.js#L33-L40
train
bmacheski/node-icloud
index.js
addDevices
function addDevices(deviceArr) { deviceArr.forEach(function(el, i) { self.devices.push({ name: deviceArr[i]['name'], deviceId: deviceArr[i]['id'] }); }); }
javascript
function addDevices(deviceArr) { deviceArr.forEach(function(el, i) { self.devices.push({ name: deviceArr[i]['name'], deviceId: deviceArr[i]['id'] }); }); }
[ "function", "addDevices", "(", "deviceArr", ")", "{", "deviceArr", ".", "forEach", "(", "function", "(", "el", ",", "i", ")", "{", "self", ".", "devices", ".", "push", "(", "{", "name", ":", "deviceArr", "[", "i", "]", "[", "'name'", "]", ",", "dev...
Create array of available devices from response.
[ "Create", "array", "of", "available", "devices", "from", "response", "." ]
ea4b7cf1e92f5603adb04872997a2e586491d7d7
https://github.com/bmacheski/node-icloud/blob/ea4b7cf1e92f5603adb04872997a2e586491d7d7/index.js#L112-L119
train
bmacheski/node-icloud
index.js
function(res) { function addCookie(cookie) { try { cookieJar.setCookieSync(cookie, config.base_url); } catch (err) { throw err; } } if (Array.isArray(res.headers['set-cookie'])) { res.headers['set-cookie'].forEach(addCookie); } else { addCookie(res.headers['set-cookie']); } }
javascript
function(res) { function addCookie(cookie) { try { cookieJar.setCookieSync(cookie, config.base_url); } catch (err) { throw err; } } if (Array.isArray(res.headers['set-cookie'])) { res.headers['set-cookie'].forEach(addCookie); } else { addCookie(res.headers['set-cookie']); } }
[ "function", "(", "res", ")", "{", "function", "addCookie", "(", "cookie", ")", "{", "try", "{", "cookieJar", ".", "setCookieSync", "(", "cookie", ",", "config", ".", "base_url", ")", ";", "}", "catch", "(", "err", ")", "{", "throw", "err", ";", "}", ...
Handle cookies required for iCloud services to function after authentication. @param {Object} res
[ "Handle", "cookies", "required", "for", "iCloud", "services", "to", "function", "after", "authentication", "." ]
ea4b7cf1e92f5603adb04872997a2e586491d7d7
https://github.com/bmacheski/node-icloud/blob/ea4b7cf1e92f5603adb04872997a2e586491d7d7/index.js#L180-L194
train
juanpicado/metalsmith-youtube
src/index.js
plugin
function plugin( _options ) { let options = _options || {}; return ( files, metalsmith, done ) => { let app = new Youtube( options, files ); app.parse( function() { done(); }); }; }
javascript
function plugin( _options ) { let options = _options || {}; return ( files, metalsmith, done ) => { let app = new Youtube( options, files ); app.parse( function() { done(); }); }; }
[ "function", "plugin", "(", "_options", ")", "{", "let", "options", "=", "_options", "||", "{", "}", ";", "return", "(", "files", ",", "metalsmith", ",", "done", ")", "=>", "{", "let", "app", "=", "new", "Youtube", "(", "options", ",", "files", ")", ...
Metalsmith plugin to render Youtube Video @param {Object} options (optional) @return {Function}
[ "Metalsmith", "plugin", "to", "render", "Youtube", "Video" ]
9e2cccc48a31ee85a3b0514aca8382368609bd3f
https://github.com/juanpicado/metalsmith-youtube/blob/9e2cccc48a31ee85a3b0514aca8382368609bd3f/src/index.js#L76-L84
train
alexindigo/deeply
merge.js
merge
function merge(to, from) { // if no suitable adapters found // just return overriding value var result = from , typeOf = getTypeOfAdapter.call(this) , type = typeOf(from) , adapter = getMergeByTypeAdapter.call(this, type) ; // if target object isn't the same type as the source object, //...
javascript
function merge(to, from) { // if no suitable adapters found // just return overriding value var result = from , typeOf = getTypeOfAdapter.call(this) , type = typeOf(from) , adapter = getMergeByTypeAdapter.call(this, type) ; // if target object isn't the same type as the source object, //...
[ "function", "merge", "(", "to", ",", "from", ")", "{", "// if no suitable adapters found", "// just return overriding value", "var", "result", "=", "from", ",", "typeOf", "=", "getTypeOfAdapter", ".", "call", "(", "this", ")", ",", "type", "=", "typeOf", "(", ...
Merges provided values, utilizing available adapters if no adapter found, reference to the same object will be returned, considering it as primitive value @param {mixed} to - value to merge into @param {mixed} from - value to merge @returns {mixed} - result of the merge
[ "Merges", "provided", "values", "utilizing", "available", "adapters", "if", "no", "adapter", "found", "reference", "to", "the", "same", "object", "will", "be", "returned", "considering", "it", "as", "primitive", "value" ]
d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1
https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/merge.js#L18-L40
train
alexindigo/deeply
merge.js
getMergeByTypeAdapter
function getMergeByTypeAdapter(type) { var adapter = adapters[type] || passThru; // only if usage of custom adapters is authorized // to prevent global context leaking in if (this.useCustomAdapters === behaviors.useCustomAdapters && typeof this[type] == 'function' ) { adapter = this[type]; } ret...
javascript
function getMergeByTypeAdapter(type) { var adapter = adapters[type] || passThru; // only if usage of custom adapters is authorized // to prevent global context leaking in if (this.useCustomAdapters === behaviors.useCustomAdapters && typeof this[type] == 'function' ) { adapter = this[type]; } ret...
[ "function", "getMergeByTypeAdapter", "(", "type", ")", "{", "var", "adapter", "=", "adapters", "[", "type", "]", "||", "passThru", ";", "// only if usage of custom adapters is authorized", "// to prevent global context leaking in", "if", "(", "this", ".", "useCustomAdapte...
Returns merge adapter for the requested type either default one or custom one if provided @param {string} type - hook type to look for @returns {function} - merge adapter or pass-thru function, if not adapter found
[ "Returns", "merge", "adapter", "for", "the", "requested", "type", "either", "default", "one", "or", "custom", "one", "if", "provided" ]
d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1
https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/merge.js#L68-L82
train
alexindigo/deeply
merge.js
getInitialValue
function getInitialValue(type, adapter) { var value // should be either `window` or `global` , glob = typeof window == 'object' ? window : global // capitalize the first letter to make object constructor , objectType = type[0].toUpperCase() + type.substr(1) ; if (typeof adapter.initialVal...
javascript
function getInitialValue(type, adapter) { var value // should be either `window` or `global` , glob = typeof window == 'object' ? window : global // capitalize the first letter to make object constructor , objectType = type[0].toUpperCase() + type.substr(1) ; if (typeof adapter.initialVal...
[ "function", "getInitialValue", "(", "type", ",", "adapter", ")", "{", "var", "value", "// should be either `window` or `global`", ",", "glob", "=", "typeof", "window", "==", "'object'", "?", "window", ":", "global", "// capitalize the first letter to make object construct...
Creates initial value for the provided type @param {string} type - type to create new value of @param {function} adapter - adapter function with custom `initialValue` method @returns {mixed} - new value of the requested type
[ "Creates", "initial", "value", "for", "the", "provided", "type" ]
d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1
https://github.com/alexindigo/deeply/blob/d9f59eec37b75ce52038b3fcfb0fd86d4989c0c1/merge.js#L91-L113
train
dpjanes/iotdb-homestar
bin/commands/old/add-id.js
function (filename) { if (!fs.existsSync(filename)) { logger.error({ method: "edit_add_cookbook_ids", filename: filename }, "file does not exist"); return; } var encoding = 'utf8'; var changed = false; var contents = fs.readFileSync(filename, encoding...
javascript
function (filename) { if (!fs.existsSync(filename)) { logger.error({ method: "edit_add_cookbook_ids", filename: filename }, "file does not exist"); return; } var encoding = 'utf8'; var changed = false; var contents = fs.readFileSync(filename, encoding...
[ "function", "(", "filename", ")", "{", "if", "(", "!", "fs", ".", "existsSync", "(", "filename", ")", ")", "{", "logger", ".", "error", "(", "{", "method", ":", "\"edit_add_cookbook_ids\"", ",", "filename", ":", "filename", "}", ",", "\"file does not exist...
This will edit a file and add UDIDs to Chapters <p> This is synchronous
[ "This", "will", "edit", "a", "file", "and", "add", "UDIDs", "to", "Chapters" ]
ed6535aa17c8b0538f43a876c9a6025e26a389e3
https://github.com/dpjanes/iotdb-homestar/blob/ed6535aa17c8b0538f43a876c9a6025e26a389e3/bin/commands/old/add-id.js#L41-L70
train
scijs/qr-solve
index.js
copy_row
function copy_row(nnz, offset, A, /*int* index, // const int* double* value, // const double* */ x) // x = sparseVector { for(var i=nnz-1; i>=0; --i) if(A.value[i + offset]){ x.push_front(new SparseEntry...
javascript
function copy_row(nnz, offset, A, /*int* index, // const int* double* value, // const double* */ x) // x = sparseVector { for(var i=nnz-1; i>=0; --i) if(A.value[i + offset]){ x.push_front(new SparseEntry...
[ "function", "copy_row", "(", "nnz", ",", "offset", ",", "A", ",", "/*int* index, // const int*\n double* value, // const double*\n */", "x", ")", "// x = sparseVector", "{", "for", "(", "var", "i", "=", "nnz", "-", "1", ";", "i", ">...
var proto = SparseVector.prototype
[ "var", "proto", "=", "SparseVector", ".", "prototype" ]
bf226a1ac836ec54e6f46f5324a30b692e85d2b6
https://github.com/scijs/qr-solve/blob/bf226a1ac836ec54e6f46f5324a30b692e85d2b6/index.js#L79-L92
train
SilentCicero/ethdeploy
src/loaders/solc-json/index.js
solcOutputLike
function solcOutputLike(obj) { let isSolcLike = false; Object.keys(obj).forEach((key) => { if (!isSolcLike && typeof obj[key] === 'object') { isSolcLike = (typeof obj[key].bytecode === 'string' && typeof obj[key].interface === 'string'); } }); return isSolcLike; }
javascript
function solcOutputLike(obj) { let isSolcLike = false; Object.keys(obj).forEach((key) => { if (!isSolcLike && typeof obj[key] === 'object') { isSolcLike = (typeof obj[key].bytecode === 'string' && typeof obj[key].interface === 'string'); } }); return isSolcLike; }
[ "function", "solcOutputLike", "(", "obj", ")", "{", "let", "isSolcLike", "=", "false", ";", "Object", ".", "keys", "(", "obj", ")", ".", "forEach", "(", "(", "key", ")", "=>", "{", "if", "(", "!", "isSolcLike", "&&", "typeof", "obj", "[", "key", "]...
like solc output
[ "like", "solc", "output" ]
acb1212e1942ce604eb82e34ce2f8c9d6b20a0a6
https://github.com/SilentCicero/ethdeploy/blob/acb1212e1942ce604eb82e34ce2f8c9d6b20a0a6/src/loaders/solc-json/index.js#L2-L13
train
magora-labs/mgl-validate
lib/registry.js
Registry
function Registry(opt_options) { if (!(this instanceof Registry)) { return new Registry(opt_options); } opt_options = opt_options || {}; this.breakOnError = opt_options.breakOnError || false; this.depth = opt_options.depth || 10; // regex to match "$schema.*" this._match = /"\$id:[a-z0-9_-]*"/ig; ...
javascript
function Registry(opt_options) { if (!(this instanceof Registry)) { return new Registry(opt_options); } opt_options = opt_options || {}; this.breakOnError = opt_options.breakOnError || false; this.depth = opt_options.depth || 10; // regex to match "$schema.*" this._match = /"\$id:[a-z0-9_-]*"/ig; ...
[ "function", "Registry", "(", "opt_options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Registry", ")", ")", "{", "return", "new", "Registry", "(", "opt_options", ")", ";", "}", "opt_options", "=", "opt_options", "||", "{", "}", ";", "this", ...
The schema registry @param {?Object=} opt_options The registry configuration @constructor
[ "The", "schema", "registry" ]
811b0d4f1e28ae3f21318f857ed63390aa74d89e
https://github.com/magora-labs/mgl-validate/blob/811b0d4f1e28ae3f21318f857ed63390aa74d89e/lib/registry.js#L12-L27
train
Justineo/kolor
kolor.js
function (items, i, j) { var k = items[i]; items[i] = items[j]; items[j] = k; }
javascript
function (items, i, j) { var k = items[i]; items[i] = items[j]; items[j] = k; }
[ "function", "(", "items", ",", "i", ",", "j", ")", "{", "var", "k", "=", "items", "[", "i", "]", ";", "items", "[", "i", "]", "=", "items", "[", "j", "]", ";", "items", "[", "j", "]", "=", "k", ";", "}" ]
Swaps two array elements.
[ "Swaps", "two", "array", "elements", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L56-L60
train
Justineo/kolor
kolor.js
function (source, callback, context) { var results = []; var i = source.length; while (i--) { results[i] = callback.call(context || source, source[i], i); } return results; }
javascript
function (source, callback, context) { var results = []; var i = source.length; while (i--) { results[i] = callback.call(context || source, source[i], i); } return results; }
[ "function", "(", "source", ",", "callback", ",", "context", ")", "{", "var", "results", "=", "[", "]", ";", "var", "i", "=", "source", ".", "length", ";", "while", "(", "i", "--", ")", "{", "results", "[", "i", "]", "=", "callback", ".", "call", ...
Iterates through the given array and produces a new array by mapping each value through a given function.
[ "Iterates", "through", "the", "given", "array", "and", "produces", "a", "new", "array", "by", "mapping", "each", "value", "through", "a", "given", "function", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L73-L80
train
Justineo/kolor
kolor.js
function (value, min, max) { var interval; if (min > max) { max = min + max; min = max - min; max = max - min; } interval = max - min; return min + ((value % interval) + interval) % interval; }
javascript
function (value, min, max) { var interval; if (min > max) { max = min + max; min = max - min; max = max - min; } interval = max - min; return min + ((value % interval) + interval) % interval; }
[ "function", "(", "value", ",", "min", ",", "max", ")", "{", "var", "interval", ";", "if", "(", "min", ">", "max", ")", "{", "max", "=", "min", "+", "max", ";", "min", "=", "max", "-", "min", ";", "max", "=", "max", "-", "min", ";", "}", "in...
Wraps a number inside a given range with modulo operation.
[ "Wraps", "a", "number", "inside", "a", "given", "range", "with", "modulo", "operation", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L96-L105
train
Justineo/kolor
kolor.js
function (number, width) { number += ''; width -= number.length; if (width > 0) { return new Array(width + 1).join('0') + number; } return number + ''; }
javascript
function (number, width) { number += ''; width -= number.length; if (width > 0) { return new Array(width + 1).join('0') + number; } return number + ''; }
[ "function", "(", "number", ",", "width", ")", "{", "number", "+=", "''", ";", "width", "-=", "number", ".", "length", ";", "if", "(", "width", ">", "0", ")", "{", "return", "new", "Array", "(", "width", "+", "1", ")", ".", "join", "(", "'0'", "...
Fills leading zeros for a number to make sure it has a fixed width.
[ "Fills", "leading", "zeros", "for", "a", "number", "to", "make", "sure", "it", "has", "a", "fixed", "width", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L108-L115
train
Justineo/kolor
kolor.js
fixHues
function fixHues(h1, h2) { var diff = Math.abs(NAMED_HUE_INDEX[h1] - NAMED_HUE_INDEX[h2]); if (diff !== 1 && diff !== 5) { return false; } var result = { h1: h1, h2: h2 }; if (h1 === 0 && h2 === 300) { result.h1 ...
javascript
function fixHues(h1, h2) { var diff = Math.abs(NAMED_HUE_INDEX[h1] - NAMED_HUE_INDEX[h2]); if (diff !== 1 && diff !== 5) { return false; } var result = { h1: h1, h2: h2 }; if (h1 === 0 && h2 === 300) { result.h1 ...
[ "function", "fixHues", "(", "h1", ",", "h2", ")", "{", "var", "diff", "=", "Math", ".", "abs", "(", "NAMED_HUE_INDEX", "[", "h1", "]", "-", "NAMED_HUE_INDEX", "[", "h2", "]", ")", ";", "if", "(", "diff", "!==", "1", "&&", "diff", "!==", "5", ")",...
0 -> 360 in some circumstances for correct calculation
[ "0", "-", ">", "360", "in", "some", "circumstances", "for", "correct", "calculation" ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L328-L344
train
Justineo/kolor
kolor.js
parseNamedHues
function parseNamedHues(value) { var tokens = value.split(/\s+/); var l = tokens.length; if (l < 1 || l > 2) { return false; } var t1 = tokens[l - 1].toLowerCase(); if (!(t1 in BASE_HUE)) { return false; } var h1 =...
javascript
function parseNamedHues(value) { var tokens = value.split(/\s+/); var l = tokens.length; if (l < 1 || l > 2) { return false; } var t1 = tokens[l - 1].toLowerCase(); if (!(t1 in BASE_HUE)) { return false; } var h1 =...
[ "function", "parseNamedHues", "(", "value", ")", "{", "var", "tokens", "=", "value", ".", "split", "(", "/", "\\s+", "/", ")", ";", "var", "l", "=", "tokens", ".", "length", ";", "if", "(", "l", "<", "1", "||", "l", ">", "2", ")", "{", "return"...
Parses simple named hues
[ "Parses", "simple", "named", "hues" ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L347-L398
train
Justineo/kolor
kolor.js
Octet
function Octet() { Channel.apply(this, arguments); this.dataType = INTEGER | PERCENT; this.cssType = INTEGER; this.range = [0, 255]; this.filter = CLAMP; this.initial = 255; }
javascript
function Octet() { Channel.apply(this, arguments); this.dataType = INTEGER | PERCENT; this.cssType = INTEGER; this.range = [0, 255]; this.filter = CLAMP; this.initial = 255; }
[ "function", "Octet", "(", ")", "{", "Channel", ".", "apply", "(", "this", ",", "arguments", ")", ";", "this", ".", "dataType", "=", "INTEGER", "|", "PERCENT", ";", "this", ".", "cssType", "=", "INTEGER", ";", "this", ".", "range", "=", "[", "0", ",...
Constructor for 0~255 integer or percentage.
[ "Constructor", "for", "0~255", "integer", "or", "percentage", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L552-L559
train
Justineo/kolor
kolor.js
Ratio
function Ratio() { Channel.apply(this, arguments); this.dataType = NUMBER | PERCENT; this.cssType = NUMBER; this.range = [0, 1]; this.filter = CLAMP; this.initial = 1; }
javascript
function Ratio() { Channel.apply(this, arguments); this.dataType = NUMBER | PERCENT; this.cssType = NUMBER; this.range = [0, 1]; this.filter = CLAMP; this.initial = 1; }
[ "function", "Ratio", "(", ")", "{", "Channel", ".", "apply", "(", "this", ",", "arguments", ")", ";", "this", ".", "dataType", "=", "NUMBER", "|", "PERCENT", ";", "this", ".", "cssType", "=", "NUMBER", ";", "this", ".", "range", "=", "[", "0", ",",...
Constructor for channel can be number from 0~1 or percentage.
[ "Constructor", "for", "channel", "can", "be", "number", "from", "0~1", "or", "percentage", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L564-L571
train
Justineo/kolor
kolor.js
Hue
function Hue() { Channel.apply(this, arguments); this.dataType = NUMBER | HUE; this.cssType = NUMBER; this.range = [0, 360]; this.filter = MOD; this.initial = 0; }
javascript
function Hue() { Channel.apply(this, arguments); this.dataType = NUMBER | HUE; this.cssType = NUMBER; this.range = [0, 360]; this.filter = MOD; this.initial = 0; }
[ "function", "Hue", "(", ")", "{", "Channel", ".", "apply", "(", "this", ",", "arguments", ")", ";", "this", ".", "dataType", "=", "NUMBER", "|", "HUE", ";", "this", ".", "cssType", "=", "NUMBER", ";", "this", ".", "range", "=", "[", "0", ",", "36...
Constructor for those channel can be .
[ "Constructor", "for", "those", "channel", "can", "be", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L584-L591
train
Justineo/kolor
kolor.js
ADD_ALPHA
function ADD_ALPHA() { var space = this.space(); var channels = SPACES[space].channels; var result = []; var l = channels.length; for (var i = 0; i < l; i++) { result.push(this[channels[i].name]()); } result.push(1); return new kolor...
javascript
function ADD_ALPHA() { var space = this.space(); var channels = SPACES[space].channels; var result = []; var l = channels.length; for (var i = 0; i < l; i++) { result.push(this[channels[i].name]()); } result.push(1); return new kolor...
[ "function", "ADD_ALPHA", "(", ")", "{", "var", "space", "=", "this", ".", "space", "(", ")", ";", "var", "channels", "=", "SPACES", "[", "space", "]", ".", "channels", ";", "var", "result", "=", "[", "]", ";", "var", "l", "=", "channels", ".", "l...
Produces a new color object by adding alpha channel to the old one.
[ "Produces", "a", "new", "color", "object", "by", "adding", "alpha", "channel", "to", "the", "old", "one", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L684-L695
train
Justineo/kolor
kolor.js
REMOVE_ALPHA
function REMOVE_ALPHA() { var space = this.space(); var channels = SPACES[space].channels; var result = []; var l = channels.length; for (var i = 0; i < l - 1; i++) { result.push(this[channels[i].name]()); } return new kolor[space.slice(0, -1...
javascript
function REMOVE_ALPHA() { var space = this.space(); var channels = SPACES[space].channels; var result = []; var l = channels.length; for (var i = 0; i < l - 1; i++) { result.push(this[channels[i].name]()); } return new kolor[space.slice(0, -1...
[ "function", "REMOVE_ALPHA", "(", ")", "{", "var", "space", "=", "this", ".", "space", "(", ")", ";", "var", "channels", "=", "SPACES", "[", "space", "]", ".", "channels", ";", "var", "result", "=", "[", "]", ";", "var", "l", "=", "channels", ".", ...
Produces a new color object by removing alpha channel from the old one.
[ "Produces", "a", "new", "color", "object", "by", "removing", "alpha", "channel", "from", "the", "old", "one", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L698-L708
train
Justineo/kolor
kolor.js
RGBA_TO_CMYK
function RGBA_TO_CMYK() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var black = 1 - Math.max(r, g, b); if (black === 0) { return kolor.cmyk(0, 0, 0, 0); } var c = (1 - r - black) / (1 - black); var m =...
javascript
function RGBA_TO_CMYK() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var black = 1 - Math.max(r, g, b); if (black === 0) { return kolor.cmyk(0, 0, 0, 0); } var c = (1 - r - black) / (1 - black); var m =...
[ "function", "RGBA_TO_CMYK", "(", ")", "{", "var", "r", "=", "this", ".", "r", "(", ")", "/", "255", ";", "var", "g", "=", "this", ".", "g", "(", ")", "/", "255", ";", "var", "b", "=", "this", ".", "b", "(", ")", "/", "255", ";", "var", "b...
Naively converts RGBA color to CMYK
[ "Naively", "converts", "RGBA", "color", "to", "CMYK" ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L711-L725
train
Justineo/kolor
kolor.js
RGBA_TO_HSLA
function RGBA_TO_HSLA() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var a = this.a(); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var diff = max - min; var sum = max + min; var h; var s;...
javascript
function RGBA_TO_HSLA() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var a = this.a(); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var diff = max - min; var sum = max + min; var h; var s;...
[ "function", "RGBA_TO_HSLA", "(", ")", "{", "var", "r", "=", "this", ".", "r", "(", ")", "/", "255", ";", "var", "g", "=", "this", ".", "g", "(", ")", "/", "255", ";", "var", "b", "=", "this", ".", "b", "(", ")", "/", "255", ";", "var", "a...
Converts RGBA color to HSLA.
[ "Converts", "RGBA", "color", "to", "HSLA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L728-L764
train
Justineo/kolor
kolor.js
RGBA_TO_HSVA
function RGBA_TO_HSVA() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var a = this.a(); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var diff = max - min; var h; var s; if (max === min) {...
javascript
function RGBA_TO_HSVA() { var r = this.r() / 255; var g = this.g() / 255; var b = this.b() / 255; var a = this.a(); var max = Math.max(r, g, b); var min = Math.min(r, g, b); var diff = max - min; var h; var s; if (max === min) {...
[ "function", "RGBA_TO_HSVA", "(", ")", "{", "var", "r", "=", "this", ".", "r", "(", ")", "/", "255", ";", "var", "g", "=", "this", ".", "g", "(", ")", "/", "255", ";", "var", "b", "=", "this", ".", "b", "(", ")", "/", "255", ";", "var", "a...
Converts RGBA color to HSVA.
[ "Converts", "RGBA", "color", "to", "HSVA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L767-L798
train
Justineo/kolor
kolor.js
HSLA_TO_RGBA
function HSLA_TO_RGBA() { var h = this.h(); var s = this.s(); var l = this.l(); var a = this.a(); var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; var hk = h / 360; var t = {}; var rgb = {}; t.r = hk + 1 / 3; ...
javascript
function HSLA_TO_RGBA() { var h = this.h(); var s = this.s(); var l = this.l(); var a = this.a(); var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; var hk = h / 360; var t = {}; var rgb = {}; t.r = hk + 1 / 3; ...
[ "function", "HSLA_TO_RGBA", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "l", "=", "this", ".", "l", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HSLA color to RGBA.
[ "Converts", "HSLA", "color", "to", "RGBA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L806-L842
train
Justineo/kolor
kolor.js
HSLA_TO_HSVA
function HSLA_TO_HSVA() { var h = this.h(); var s = this.s(); var l = this.l(); var a = this.a(); l *= 2; s *= (l <= 1) ? l : 2 - l; var v = (l + s) / 2; var sv = (2 * s) / (l + s); return kolor.hsva(h, sv, v, a); }
javascript
function HSLA_TO_HSVA() { var h = this.h(); var s = this.s(); var l = this.l(); var a = this.a(); l *= 2; s *= (l <= 1) ? l : 2 - l; var v = (l + s) / 2; var sv = (2 * s) / (l + s); return kolor.hsva(h, sv, v, a); }
[ "function", "HSLA_TO_HSVA", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "l", "=", "this", ".", "l", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HSLA color to HSVA.
[ "Converts", "HSLA", "color", "to", "HSVA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L845-L856
train
Justineo/kolor
kolor.js
HSVA_TO_RGBA
function HSVA_TO_RGBA() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); var hi = Math.floor(h / 60); var f = h / 60 - hi; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); var r...
javascript
function HSVA_TO_RGBA() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); var hi = Math.floor(h / 60); var f = h / 60 - hi; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); var r...
[ "function", "HSVA_TO_RGBA", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "v", "=", "this", ".", "v", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HSVA color to RGBA.
[ "Converts", "HSVA", "color", "to", "RGBA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L859-L893
train
Justineo/kolor
kolor.js
HSVA_TO_HSLA
function HSVA_TO_HSLA() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); var l = (2 - s) * v; var sl = s * v; sl /= (l <= 1) ? l : 2 - l; sl = sl || 0; l /= 2; return kolor.hsla(h, sl, l, a); }
javascript
function HSVA_TO_HSLA() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); var l = (2 - s) * v; var sl = s * v; sl /= (l <= 1) ? l : 2 - l; sl = sl || 0; l /= 2; return kolor.hsla(h, sl, l, a); }
[ "function", "HSVA_TO_HSLA", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "v", "=", "this", ".", "v", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HSVA color to HSLA.
[ "Converts", "HSVA", "color", "to", "HSLA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L896-L908
train
Justineo/kolor
kolor.js
HSVA_TO_HWB
function HSVA_TO_HWB() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); return kolor.hwb(h, (1 - s) * v, 1 - v, a); }
javascript
function HSVA_TO_HWB() { var h = this.h(); var s = this.s(); var v = this.v(); var a = this.a(); return kolor.hwb(h, (1 - s) * v, 1 - v, a); }
[ "function", "HSVA_TO_HWB", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "v", "=", "this", ".", "v", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HSVA color to HWB.
[ "Converts", "HSVA", "color", "to", "HWB", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L911-L917
train
Justineo/kolor
kolor.js
HWB_TO_HSVA
function HWB_TO_HSVA() { var h = this.h(); var w = this.w(); var b = this.b(); var a = this.a(); return kolor.hsva(h, 1 - w / (1 - b), 1 - b, a); }
javascript
function HWB_TO_HSVA() { var h = this.h(); var w = this.w(); var b = this.b(); var a = this.a(); return kolor.hsva(h, 1 - w / (1 - b), 1 - b, a); }
[ "function", "HWB_TO_HSVA", "(", ")", "{", "var", "h", "=", "this", ".", "h", "(", ")", ";", "var", "w", "=", "this", ".", "w", "(", ")", ";", "var", "b", "=", "this", ".", "b", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ...
Converts HWB color to HSVA.
[ "Converts", "HWB", "color", "to", "HSVA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L920-L926
train
Justineo/kolor
kolor.js
GRAY_TO_RGBA
function GRAY_TO_RGBA() { var s = this.s(); var a = this.a(); return kolor.rgba(s, s, s, a); }
javascript
function GRAY_TO_RGBA() { var s = this.s(); var a = this.a(); return kolor.rgba(s, s, s, a); }
[ "function", "GRAY_TO_RGBA", "(", ")", "{", "var", "s", "=", "this", ".", "s", "(", ")", ";", "var", "a", "=", "this", ".", "a", "(", ")", ";", "return", "kolor", ".", "rgba", "(", "s", ",", "s", ",", "s", ",", "a", ")", ";", "}" ]
Converts GRAY color to RGBA.
[ "Converts", "GRAY", "color", "to", "RGBA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L929-L934
train
Justineo/kolor
kolor.js
CMYK_TO_RGBA
function CMYK_TO_RGBA() { var c = this.c(); var m = this.m(); var y = this.y(); var black = this.b(); var r = 1 - Math.min(1, c * (1 - black) + black); var g = 1 - Math.min(1, m * (1 - black) + black); var b = 1 - Math.min(1, y * (1 - black) + black); ...
javascript
function CMYK_TO_RGBA() { var c = this.c(); var m = this.m(); var y = this.y(); var black = this.b(); var r = 1 - Math.min(1, c * (1 - black) + black); var g = 1 - Math.min(1, m * (1 - black) + black); var b = 1 - Math.min(1, y * (1 - black) + black); ...
[ "function", "CMYK_TO_RGBA", "(", ")", "{", "var", "c", "=", "this", ".", "c", "(", ")", ";", "var", "m", "=", "this", ".", "m", "(", ")", ";", "var", "y", "=", "this", ".", "y", "(", ")", ";", "var", "black", "=", "this", ".", "b", "(", "...
Naively converts CMYK color to RGBA.
[ "Naively", "converts", "CMYK", "color", "to", "RGBA", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L937-L947
train
Justineo/kolor
kolor.js
getConverters
function getConverters(from, to) { if (from === to) { return []; } if (CONVERTERS[from][to]) { return [to]; } var queue = [from]; var path = {}; path[from] = []; while (queue.length) { var v = queue.shif...
javascript
function getConverters(from, to) { if (from === to) { return []; } if (CONVERTERS[from][to]) { return [to]; } var queue = [from]; var path = {}; path[from] = []; while (queue.length) { var v = queue.shif...
[ "function", "getConverters", "(", "from", ",", "to", ")", "{", "if", "(", "from", "===", "to", ")", "{", "return", "[", "]", ";", "}", "if", "(", "CONVERTERS", "[", "from", "]", "[", "to", "]", ")", "{", "return", "[", "to", "]", ";", "}", "v...
Breadth-first search to find the conversion path
[ "Breadth", "-", "first", "search", "to", "find", "the", "conversion", "path" ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L989-L1016
train
Justineo/kolor
kolor.js
filterValue
function filterValue(value, channel) { var type; for (var key in DATATYPES) { type = DATATYPES[key]; if (type.flag & channel.dataType) { var val = type.parse(value); if (val !== false) { if (type.flag === PERCENT) { ...
javascript
function filterValue(value, channel) { var type; for (var key in DATATYPES) { type = DATATYPES[key]; if (type.flag & channel.dataType) { var val = type.parse(value); if (val !== false) { if (type.flag === PERCENT) { ...
[ "function", "filterValue", "(", "value", ",", "channel", ")", "{", "var", "type", ";", "for", "(", "var", "key", "in", "DATATYPES", ")", "{", "type", "=", "DATATYPES", "[", "key", "]", ";", "if", "(", "type", ".", "flag", "&", "channel", ".", "data...
Filters input value according to data type definitions and color space configurations.
[ "Filters", "input", "value", "according", "to", "data", "type", "definitions", "and", "color", "space", "configurations", "." ]
e02d41e32e85e1d5e414e1367c38a500d162e081
https://github.com/Justineo/kolor/blob/e02d41e32e85e1d5e414e1367c38a500d162e081/kolor.js#L1020-L1035
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(event_name, fn, context, listener_args) { return this._addListener(event_name, fn, context, listener_args, this._listeners) }
javascript
function(event_name, fn, context, listener_args) { return this._addListener(event_name, fn, context, listener_args, this._listeners) }
[ "function", "(", "event_name", ",", "fn", ",", "context", ",", "listener_args", ")", "{", "return", "this", ".", "_addListener", "(", "event_name", ",", "fn", ",", "context", ",", "listener_args", ",", "this", ".", "_listeners", ")", "}" ]
Add listener for event `event_name` @param {string} event_name Name of the event to listen to @param {function} fn The callback @param {Object} context The context for callback execution (an object, to which the callback belongs) @param {*} [listener_args] Static listener arguments. May be usable when one callback res...
[ "Add", "listener", "for", "event", "event_name" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L31-L35
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(event_name, fn, context, listener_args, listeners_by_event) { // otherwise, listener would be called on window object if (Lava.schema.DEBUG && !context) Lava.t('Listener was created without a context'); // note 1: member count for a plain object like this must not exceed 8 // otherwise, chrome will s...
javascript
function(event_name, fn, context, listener_args, listeners_by_event) { // otherwise, listener would be called on window object if (Lava.schema.DEBUG && !context) Lava.t('Listener was created without a context'); // note 1: member count for a plain object like this must not exceed 8 // otherwise, chrome will s...
[ "function", "(", "event_name", ",", "fn", ",", "context", ",", "listener_args", ",", "listeners_by_event", ")", "{", "// otherwise, listener would be called on window object", "if", "(", "Lava", ".", "schema", ".", "DEBUG", "&&", "!", "context", ")", "Lava", ".", ...
Create the listener construct and push it into the listeners array for given event name @param {string} event_name The name of event @param {function} fn The callback @param {Object} context The owner of the callback @param {*} listener_args Static listener arguments @param {Object.<string, Array.<_tListener>>} listen...
[ "Create", "the", "listener", "construct", "and", "push", "it", "into", "the", "listeners", "array", "for", "given", "event", "name" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L47-L76
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(listener, listeners_by_event) { var list = listeners_by_event[listener.event_name], index; if (list) { index = list.indexOf(listener); if (index != -1) { list.splice(index, 1); if (list.length == 0) { listeners_by_event[listener.event_name] = null; } } } }
javascript
function(listener, listeners_by_event) { var list = listeners_by_event[listener.event_name], index; if (list) { index = list.indexOf(listener); if (index != -1) { list.splice(index, 1); if (list.length == 0) { listeners_by_event[listener.event_name] = null; } } } }
[ "function", "(", "listener", ",", "listeners_by_event", ")", "{", "var", "list", "=", "listeners_by_event", "[", "listener", ".", "event_name", "]", ",", "index", ";", "if", "(", "list", ")", "{", "index", "=", "list", ".", "indexOf", "(", "listener", ")...
Perform removal of the listener structure @param {_tListener} listener Structure, which was returned by {@link Lava.mixin.Observable#on} method @param {Object.<string, Array.<_tListener>>} listeners_by_event {@link Lava.mixin.Observable#_listeners} or {@link Lava.mixin.Properties#_property_listeners}
[ "Perform", "removal", "of", "the", "listener", "structure" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L93-L108
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(listeners, event_args) { var copy = listeners.slice(), // cause they may be removed during the fire cycle i = 0, count = listeners.length, listener; for (; i < count; i++) { listener = copy[i]; listener.fn.call(listener.context, this, event_args, listener.listener_args); } }
javascript
function(listeners, event_args) { var copy = listeners.slice(), // cause they may be removed during the fire cycle i = 0, count = listeners.length, listener; for (; i < count; i++) { listener = copy[i]; listener.fn.call(listener.context, this, event_args, listener.listener_args); } }
[ "function", "(", "listeners", ",", "event_args", ")", "{", "var", "copy", "=", "listeners", ".", "slice", "(", ")", ",", "// cause they may be removed during the fire cycle", "i", "=", "0", ",", "count", "=", "listeners", ".", "length", ",", "listener", ";", ...
Perform fire - call listeners of an event @param {Array.<_tListener>} listeners An array with listener structures @param {*} event_args Dynamic event arguments
[ "Perform", "fire", "-", "call", "listeners", "of", "an", "event" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L132-L146
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(properties_object) { if (Lava.schema.DEBUG && properties_object && properties_object.isProperties) Lava.t("setProperties expects a plain JS object as an argument, not a class"); for (var name in properties_object) { this.set(name, properties_object[name]); } }
javascript
function(properties_object) { if (Lava.schema.DEBUG && properties_object && properties_object.isProperties) Lava.t("setProperties expects a plain JS object as an argument, not a class"); for (var name in properties_object) { this.set(name, properties_object[name]); } }
[ "function", "(", "properties_object", ")", "{", "if", "(", "Lava", ".", "schema", ".", "DEBUG", "&&", "properties_object", "&&", "properties_object", ".", "isProperties", ")", "Lava", ".", "t", "(", "\"setProperties expects a plain JS object as an argument, not a class\...
Set multiple properties at once @param {Object.<string, *>} properties_object A hash with new property values
[ "Set", "multiple", "properties", "at", "once" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L259-L269
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(config, target) { this.guid = Lava.guid++; if (config.duration) { this._duration = config.duration; } this._target = target; this._transition = config.transition || Lava.transitions[config.transition_name || 'linear']; this._config = config; }
javascript
function(config, target) { this.guid = Lava.guid++; if (config.duration) { this._duration = config.duration; } this._target = target; this._transition = config.transition || Lava.transitions[config.transition_name || 'linear']; this._config = config; }
[ "function", "(", "config", ",", "target", ")", "{", "this", ".", "guid", "=", "Lava", ".", "guid", "++", ";", "if", "(", "config", ".", "duration", ")", "{", "this", ".", "_duration", "=", "config", ".", "duration", ";", "}", "this", ".", "_target"...
Constructs the class instance @param {_cAnimation} config Settings, `this._config` @param {*} target `this._target`
[ "Constructs", "the", "class", "instance" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L665-L675
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function() { this._is_reversed = !this._is_reversed; if (this._is_running) { var now = new Date().getTime(), new_end = 2 * now - this._started_time; // it's possible in case of script lags. Must not allow negative transition values. if (now > this._end_time) { this._started_time = this._end_ti...
javascript
function() { this._is_reversed = !this._is_reversed; if (this._is_running) { var now = new Date().getTime(), new_end = 2 * now - this._started_time; // it's possible in case of script lags. Must not allow negative transition values. if (now > this._end_time) { this._started_time = this._end_ti...
[ "function", "(", ")", "{", "this", ".", "_is_reversed", "=", "!", "this", ".", "_is_reversed", ";", "if", "(", "this", ".", "_is_running", ")", "{", "var", "now", "=", "new", "Date", "(", ")", ".", "getTime", "(", ")", ",", "new_end", "=", "2", "...
Reverse animation direction
[ "Reverse", "animation", "direction" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L741-L767
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(transition_value) { for (var i = 0, count = this._animators.length; i < count; i++) { this._animators[i].animate(this._target, transition_value); } }
javascript
function(transition_value) { for (var i = 0, count = this._animators.length; i < count; i++) { this._animators[i].animate(this._target, transition_value); } }
[ "function", "(", "transition_value", ")", "{", "for", "(", "var", "i", "=", "0", ",", "count", "=", "this", ".", "_animators", ".", "length", ";", "i", "<", "count", ";", "i", "++", ")", "{", "this", ".", "_animators", "[", "i", "]", ".", "animat...
Calls all animator instances. This function may be substituted with pre-generated version from `_shared` @param {number} transition_value The current percent of animation
[ "Calls", "all", "animator", "instances", ".", "This", "function", "may", "be", "substituted", "with", "pre", "-", "generated", "version", "from", "_shared" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L939-L947
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(now) { if (now < this._end_time) { this._callAnimators(this._transition((now - this._started_time) / this._duration)); } else { this._callAnimators(this._transition(1)); this._finish(); } }
javascript
function(now) { if (now < this._end_time) { this._callAnimators(this._transition((now - this._started_time) / this._duration)); } else { this._callAnimators(this._transition(1)); this._finish(); } }
[ "function", "(", "now", ")", "{", "if", "(", "now", "<", "this", ".", "_end_time", ")", "{", "this", ".", "_callAnimators", "(", "this", ".", "_transition", "(", "(", "now", "-", "this", ".", "_started_time", ")", "/", "this", ".", "_duration", ")", ...
Perform animation in normal direction @param {number} now The current global time in milliseconds
[ "Perform", "animation", "in", "normal", "direction" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L953-L966
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(config) { if (config) { if (config.check_property_names === false) this._check_property_names = false; } this._serializeFunction = (config && config.pretty_print_functions) ? this._serializeFunction_PrettyPrint : this._serializeFunction_Normal }
javascript
function(config) { if (config) { if (config.check_property_names === false) this._check_property_names = false; } this._serializeFunction = (config && config.pretty_print_functions) ? this._serializeFunction_PrettyPrint : this._serializeFunction_Normal }
[ "function", "(", "config", ")", "{", "if", "(", "config", ")", "{", "if", "(", "config", ".", "check_property_names", "===", "false", ")", "this", ".", "_check_property_names", "=", "false", ";", "}", "this", ".", "_serializeFunction", "=", "(", "config", ...
Create Serializer instance @param {?_cSerializer} config
[ "Create", "Serializer", "instance" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1446-L1456
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(value, padding) { var type = Firestorm.getType(value), result; if (Lava.schema.DEBUG && !(type in this._callback_map)) Lava.t("Unsupported type for serialization: " + type); result = this[this._callback_map[type]](value, padding); return result; }
javascript
function(value, padding) { var type = Firestorm.getType(value), result; if (Lava.schema.DEBUG && !(type in this._callback_map)) Lava.t("Unsupported type for serialization: " + type); result = this[this._callback_map[type]](value, padding); return result; }
[ "function", "(", "value", ",", "padding", ")", "{", "var", "type", "=", "Firestorm", ".", "getType", "(", "value", ")", ",", "result", ";", "if", "(", "Lava", ".", "schema", ".", "DEBUG", "&&", "!", "(", "type", "in", "this", ".", "_callback_map", ...
Perform value serialization @param {*} value @param {string} padding The initial padding for JavaScript code @returns {string}
[ "Perform", "value", "serialization" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1475-L1486
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(data, padding) { var tempResult = [], i = 0, count = data.length, child_padding = padding + "\t", result; if (count == 0) { result = '[]'; } else if (count == 1) { result = '[' + this._serializeValue(data[i], padding) + ']'; } else { for (; i < count; i++) { tempResult....
javascript
function(data, padding) { var tempResult = [], i = 0, count = data.length, child_padding = padding + "\t", result; if (count == 0) { result = '[]'; } else if (count == 1) { result = '[' + this._serializeValue(data[i], padding) + ']'; } else { for (; i < count; i++) { tempResult....
[ "function", "(", "data", ",", "padding", ")", "{", "var", "tempResult", "=", "[", "]", ",", "i", "=", "0", ",", "count", "=", "data", ".", "length", ",", "child_padding", "=", "padding", "+", "\"\\t\"", ",", "result", ";", "if", "(", "count", "==",...
Perform serialization of an array @param {Array} data @param {string} padding @returns {string}
[ "Perform", "serialization", "of", "an", "array" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1494-L1524
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(data, padding) { var tempResult = [], child_padding = padding + "\t", name, type, result, is_complex = false, only_key = null, is_empty = true; // this may be faster than using Object.keys(data), but I haven't done speed comparison yet. // Purpose of the following code: // 1) if ...
javascript
function(data, padding) { var tempResult = [], child_padding = padding + "\t", name, type, result, is_complex = false, only_key = null, is_empty = true; // this may be faster than using Object.keys(data), but I haven't done speed comparison yet. // Purpose of the following code: // 1) if ...
[ "function", "(", "data", ",", "padding", ")", "{", "var", "tempResult", "=", "[", "]", ",", "child_padding", "=", "padding", "+", "\"\\t\"", ",", "name", ",", "type", ",", "result", ",", "is_complex", "=", "false", ",", "only_key", "=", "null", ",", ...
Serialize an object @param {Object} data @param {string} padding @returns {string}
[ "Serialize", "an", "object" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1543-L1602
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(name, value, padding) { var type = Firestorm.getType(value); // if you serialize only Lava configs, then most likely you do not need this check, // cause the property names in configs are always valid. if (this._check_property_names && (!Lava.VALID_PROPERTY_NAME_REGEX.test(name) || Lava.JS_KEYWORDS.i...
javascript
function(name, value, padding) { var type = Firestorm.getType(value); // if you serialize only Lava configs, then most likely you do not need this check, // cause the property names in configs are always valid. if (this._check_property_names && (!Lava.VALID_PROPERTY_NAME_REGEX.test(name) || Lava.JS_KEYWORDS.i...
[ "function", "(", "name", ",", "value", ",", "padding", ")", "{", "var", "type", "=", "Firestorm", ".", "getType", "(", "value", ")", ";", "// if you serialize only Lava configs, then most likely you do not need this check,", "// cause the property names in configs are always ...
Serialize one key-value pair in an object @param {string} name @param {*} value @param {string} padding @returns {string}
[ "Serialize", "one", "key", "-", "value", "pair", "in", "an", "object" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1611-L1625
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(data, padding) { var result = this._serializeFunction_Normal(data), lines = result.split(/\r?\n/), last_line = lines[lines.length - 1], tabs, num_tabs, i = 1, count = lines.length; if (/^\t*\}$/.test(last_line)) { if (last_line.length > 1) { // if there are tabs tabs = last_line....
javascript
function(data, padding) { var result = this._serializeFunction_Normal(data), lines = result.split(/\r?\n/), last_line = lines[lines.length - 1], tabs, num_tabs, i = 1, count = lines.length; if (/^\t*\}$/.test(last_line)) { if (last_line.length > 1) { // if there are tabs tabs = last_line....
[ "function", "(", "data", ",", "padding", ")", "{", "var", "result", "=", "this", ".", "_serializeFunction_Normal", "(", "data", ")", ",", "lines", "=", "result", ".", "split", "(", "/", "\\r?\\n", "/", ")", ",", "last_line", "=", "lines", "[", "lines",...
Serialize function, then pad it's source code. Is not guaranteed to produce correct results, so may be used only for pretty-printing of source code for browser. @param {function} data @param {string} padding @returns {string}
[ "Serialize", "function", "then", "pad", "it", "s", "source", "code", ".", "Is", "not", "guaranteed", "to", "produce", "correct", "results", "so", "may", "be", "used", "only", "for", "pretty", "-", "printing", "of", "source", "code", "for", "browser", "." ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L1664-L1690
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function() { var old_uid = this._data_uids.pop(), old_value = this._data_values.pop(), old_name = this._data_names.pop(), count = this._count - 1; this._setLength(count); this._fire('items_removed', { uids: [old_uid], values: [old_value], names: [old_name] }); this._fire('collection_chan...
javascript
function() { var old_uid = this._data_uids.pop(), old_value = this._data_values.pop(), old_name = this._data_names.pop(), count = this._count - 1; this._setLength(count); this._fire('items_removed', { uids: [old_uid], values: [old_value], names: [old_name] }); this._fire('collection_chan...
[ "function", "(", ")", "{", "var", "old_uid", "=", "this", ".", "_data_uids", ".", "pop", "(", ")", ",", "old_value", "=", "this", ".", "_data_values", ".", "pop", "(", ")", ",", "old_name", "=", "this", ".", "_data_names", ".", "pop", "(", ")", ","...
Remove a value from the end of the collection @returns {*} Removed value
[ "Remove", "a", "value", "from", "the", "end", "of", "the", "collection" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L2019-L2037
train
kogarashisan/LiquidLava
lib/packages/core-classes.js
function(value) { var result = false, index = this._data_values.indexOf(value); if (index != -1) { this.removeAt(index); result = true; } return result; }
javascript
function(value) { var result = false, index = this._data_values.indexOf(value); if (index != -1) { this.removeAt(index); result = true; } return result; }
[ "function", "(", "value", ")", "{", "var", "result", "=", "false", ",", "index", "=", "this", ".", "_data_values", ".", "indexOf", "(", "value", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "this", ".", "removeAt", "(", "index", ")", "...
Removes the first occurrence of value within collection @param {*} value @returns {boolean} <kw>true</kw>, if the value existed
[ "Removes", "the", "first", "occurrence", "of", "value", "within", "collection" ]
fb8618821a51fad373106b5cc9247464b0a23cf6
https://github.com/kogarashisan/LiquidLava/blob/fb8618821a51fad373106b5cc9247464b0a23cf6/lib/packages/core-classes.js#L2045-L2057
train