id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
41,000
nightwolfz/mobx-connect
src/connect.js
provide
function provide() { if (console) console.warn('@provide is now deprecated. Use @connect instead'); return composeWithContext(Array.prototype.slice.call(arguments)) }
javascript
function provide() { if (console) console.warn('@provide is now deprecated. Use @connect instead'); return composeWithContext(Array.prototype.slice.call(arguments)) }
[ "function", "provide", "(", ")", "{", "if", "(", "console", ")", "console", ".", "warn", "(", "'@provide is now deprecated. Use @connect instead'", ")", ";", "return", "composeWithContext", "(", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "argumen...
Grant components access to store and state without making observable @param args {Component|...String} @returns {Component|Object}
[ "Grant", "components", "access", "to", "store", "and", "state", "without", "making", "observable" ]
139636954359079717f4ac522fe5943efab6744d
https://github.com/nightwolfz/mobx-connect/blob/139636954359079717f4ac522fe5943efab6744d/src/connect.js#L76-L79
41,001
dailymotion/vmap-js
src/parser_utils.js
parseNodeValue
function parseNodeValue(node) { const childNodes = node && node.childNodes && [...node.childNodes]; if (!childNodes) { return {}; } // Trying to find and parse CDATA as JSON const cdatas = childNodes.filter((childNode) => childNode.nodeName === '#cdata-section'); if (cdatas && cdatas.length > 0) { ...
javascript
function parseNodeValue(node) { const childNodes = node && node.childNodes && [...node.childNodes]; if (!childNodes) { return {}; } // Trying to find and parse CDATA as JSON const cdatas = childNodes.filter((childNode) => childNode.nodeName === '#cdata-section'); if (cdatas && cdatas.length > 0) { ...
[ "function", "parseNodeValue", "(", "node", ")", "{", "const", "childNodes", "=", "node", "&&", "node", ".", "childNodes", "&&", "[", "...", "node", ".", "childNodes", "]", ";", "if", "(", "!", "childNodes", ")", "{", "return", "{", "}", ";", "}", "//...
Parses a node value giving priority to CDATA as a JSON over text, if CDATA is not a valid JSON it is converted to text @param {Object} node - The node to parse the value from. @return {String|Object}
[ "Parses", "a", "node", "value", "giving", "priority", "to", "CDATA", "as", "a", "JSON", "over", "text", "if", "CDATA", "is", "not", "a", "valid", "JSON", "it", "is", "converted", "to", "text" ]
7c16cc5745dc819343856de4f7252659a66c463e
https://github.com/dailymotion/vmap-js/blob/7c16cc5745dc819343856de4f7252659a66c463e/src/parser_utils.js#L21-L48
41,002
dailymotion/vmap-js
src/parser_utils.js
parseXMLNode
function parseXMLNode(node) { const parsedNode = { attributes: {}, children: {}, value: {}, }; parsedNode.value = parseNodeValue(node); if (node.attributes) { [...node.attributes].forEach((nodeAttr) => { if (nodeAttr.nodeName && nodeAttr.nodeValue !== undefined && nodeAttr.nodeValue !== ...
javascript
function parseXMLNode(node) { const parsedNode = { attributes: {}, children: {}, value: {}, }; parsedNode.value = parseNodeValue(node); if (node.attributes) { [...node.attributes].forEach((nodeAttr) => { if (nodeAttr.nodeName && nodeAttr.nodeValue !== undefined && nodeAttr.nodeValue !== ...
[ "function", "parseXMLNode", "(", "node", ")", "{", "const", "parsedNode", "=", "{", "attributes", ":", "{", "}", ",", "children", ":", "{", "}", ",", "value", ":", "{", "}", ",", "}", ";", "parsedNode", ".", "value", "=", "parseNodeValue", "(", "node...
Parses an XML node recursively. @param {Object} node - The node to parse. @return {Object}
[ "Parses", "an", "XML", "node", "recursively", "." ]
7c16cc5745dc819343856de4f7252659a66c463e
https://github.com/dailymotion/vmap-js/blob/7c16cc5745dc819343856de4f7252659a66c463e/src/parser_utils.js#L55-L81
41,003
c-h-/node-run-cmd
index.js
async
function async(makeGenerator) { return () => { const generator = makeGenerator(...arguments); function handle(result) { // result => { done: [Boolean], value: [Object] } if (result.done) { return Promise.resolve(result.value); } return Promise.resolve(result.value).then(res =...
javascript
function async(makeGenerator) { return () => { const generator = makeGenerator(...arguments); function handle(result) { // result => { done: [Boolean], value: [Object] } if (result.done) { return Promise.resolve(result.value); } return Promise.resolve(result.value).then(res =...
[ "function", "async", "(", "makeGenerator", ")", "{", "return", "(", ")", "=>", "{", "const", "generator", "=", "makeGenerator", "(", "...", "arguments", ")", ";", "function", "handle", "(", "result", ")", "{", "// result => { done: [Boolean], value: [Object] }", ...
Returns a function that resolves any yielded promises inside the generator. @param {Function} makeGenerator - the function to turn into an async generator/promise @returns {Function} the function that will iterate over interior promises on each call when invoked
[ "Returns", "a", "function", "that", "resolves", "any", "yielded", "promises", "inside", "the", "generator", "." ]
2cca799e75cbb6afba63dc6ae1598324143a71d6
https://github.com/c-h-/node-run-cmd/blob/2cca799e75cbb6afba63dc6ae1598324143a71d6/index.js#L107-L130
41,004
c-h-/node-run-cmd
index.js
runMultiple
function runMultiple(input, options) { return new Promise((resolve, reject) => { let commands = input; // set default options const defaultOpts = { cwd: process.cwd(), verbose: DEFAULT_VERBOSE, mode: SEQUENTIAL, logger: console.log, }; // set global options const globa...
javascript
function runMultiple(input, options) { return new Promise((resolve, reject) => { let commands = input; // set default options const defaultOpts = { cwd: process.cwd(), verbose: DEFAULT_VERBOSE, mode: SEQUENTIAL, logger: console.log, }; // set global options const globa...
[ "function", "runMultiple", "(", "input", ",", "options", ")", "{", "return", "new", "Promise", "(", "(", "resolve", ",", "reject", ")", "=>", "{", "let", "commands", "=", "input", ";", "// set default options", "const", "defaultOpts", "=", "{", "cwd", ":",...
Run multiple commands. @param {Array} commands - an array of objects or strings containing details of commands to run @param {Object} options - an object containing global options for each command @example runMultiple(['mkdir test', 'cd test', 'ls']); @example runMultiple(['mkdir test', 'cd test', 'ls'], { cwd: '../myC...
[ "Run", "multiple", "commands", "." ]
2cca799e75cbb6afba63dc6ae1598324143a71d6
https://github.com/c-h-/node-run-cmd/blob/2cca799e75cbb6afba63dc6ae1598324143a71d6/index.js#L151-L216
41,005
parkerd/statsd-zabbix-backend
lib/zabbix.js
itemsForCounter
function itemsForCounter(flushInterval, host, key, value) { const avg = value / (flushInterval / 1000); // calculate "per second" rate return [ { host, key: `${key}[total]`, value, }, { host, key: `${key}[avg]`, value: avg, }, ]; }
javascript
function itemsForCounter(flushInterval, host, key, value) { const avg = value / (flushInterval / 1000); // calculate "per second" rate return [ { host, key: `${key}[total]`, value, }, { host, key: `${key}[avg]`, value: avg, }, ]; }
[ "function", "itemsForCounter", "(", "flushInterval", ",", "host", ",", "key", ",", "value", ")", "{", "const", "avg", "=", "value", "/", "(", "flushInterval", "/", "1000", ")", ";", "// calculate \"per second\" rate", "return", "[", "{", "host", ",", "key", ...
Generate items for a counter. @param {number} flushInterval How long stats were collected, for calculating average. @param {string} host Hostname in Zabbix. @param {string} key Item key in Zabbix. @param {number} value Total collected during interval. @returns {array} Array of {host, key, value} objects.
[ "Generate", "items", "for", "a", "counter", "." ]
e459939108ae6aee3b155eed6b76eba1dc053af9
https://github.com/parkerd/statsd-zabbix-backend/blob/e459939108ae6aee3b155eed6b76eba1dc053af9/lib/zabbix.js#L116-L131
41,006
parkerd/statsd-zabbix-backend
lib/zabbix.js
itemsForTimer
function itemsForTimer(percentiles, host, key, data) { const values = data.sort((a, b) => (a - b)); const count = values.length; const min = values[0]; const max = values[count - 1]; let mean = min; let maxAtThreshold = max; const items = [ { host, key: `${key}[lower]`, value: min ...
javascript
function itemsForTimer(percentiles, host, key, data) { const values = data.sort((a, b) => (a - b)); const count = values.length; const min = values[0]; const max = values[count - 1]; let mean = min; let maxAtThreshold = max; const items = [ { host, key: `${key}[lower]`, value: min ...
[ "function", "itemsForTimer", "(", "percentiles", ",", "host", ",", "key", ",", "data", ")", "{", "const", "values", "=", "data", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "(", "a", "-", "b", ")", ")", ";", "const", "count", "=", "values", ...
Generate items for a timer. @param {array} percentiles Array of numbers, percentiles to calculate mean and max for. @param {string} host Hostname in Zabbix. @param {string} key Item key in Zabbix. @param {number} data All timing values collected during interval. @returns {array} Array of {host, key, value} objects.
[ "Generate", "items", "for", "a", "timer", "." ]
e459939108ae6aee3b155eed6b76eba1dc053af9
https://github.com/parkerd/statsd-zabbix-backend/blob/e459939108ae6aee3b155eed6b76eba1dc053af9/lib/zabbix.js#L141-L199
41,007
parkerd/statsd-zabbix-backend
lib/zabbix.js
flush
function flush(targetBuilder, sender, flushInterval, timestamp, metrics) { debug(`starting flush for timestamp ${timestamp}`); const flushStart = tsNow(); const handle = (processor, stat, value) => { try { const { host, key } = targetBuilder(stat); processor(host, key, value).forEach((item) => { ...
javascript
function flush(targetBuilder, sender, flushInterval, timestamp, metrics) { debug(`starting flush for timestamp ${timestamp}`); const flushStart = tsNow(); const handle = (processor, stat, value) => { try { const { host, key } = targetBuilder(stat); processor(host, key, value).forEach((item) => { ...
[ "function", "flush", "(", "targetBuilder", ",", "sender", ",", "flushInterval", ",", "timestamp", ",", "metrics", ")", "{", "debug", "(", "`", "${", "timestamp", "}", "`", ")", ";", "const", "flushStart", "=", "tsNow", "(", ")", ";", "const", "handle", ...
Flush metrics data to Zabbix. @param {function} targetBuilder Returns a {host,key} object based on the stat provided. @param {ZabbixSender} sender Instance of ZabbixSender for sending stats to Zabbix. @param {number} flushInterval How long stats were collected, for calculating average. @param {number} timestamp Time of...
[ "Flush", "metrics", "data", "to", "Zabbix", "." ]
e459939108ae6aee3b155eed6b76eba1dc053af9
https://github.com/parkerd/statsd-zabbix-backend/blob/e459939108ae6aee3b155eed6b76eba1dc053af9/lib/zabbix.js#L227-L277
41,008
parkerd/statsd-zabbix-backend
lib/zabbix.js
status
function status(writeCb) { Object.keys(stats).forEach((stat) => { writeCb(null, 'zabbix', stat, stats[stat]); }); }
javascript
function status(writeCb) { Object.keys(stats).forEach((stat) => { writeCb(null, 'zabbix', stat, stats[stat]); }); }
[ "function", "status", "(", "writeCb", ")", "{", "Object", ".", "keys", "(", "stats", ")", ".", "forEach", "(", "(", "stat", ")", "=>", "{", "writeCb", "(", "null", ",", "'zabbix'", ",", "stat", ",", "stats", "[", "stat", "]", ")", ";", "}", ")", ...
Dump plugin stats. @param {function} writeCb Callback to write stats to. @returns {undefined}
[ "Dump", "plugin", "stats", "." ]
e459939108ae6aee3b155eed6b76eba1dc053af9
https://github.com/parkerd/statsd-zabbix-backend/blob/e459939108ae6aee3b155eed6b76eba1dc053af9/lib/zabbix.js#L284-L288
41,009
parkerd/statsd-zabbix-backend
lib/zabbix.js
init
function init(startupTime, config, events, l) { logger = l; let targetBuilder; if (config.zabbixTargetHostname) { targetBuilder = targetStatic.bind(undefined, config.zabbixTargetHostname); } else { targetBuilder = targetDecode; } const sender = new ZabbixSender({ host: config.zabbixHost || 'lo...
javascript
function init(startupTime, config, events, l) { logger = l; let targetBuilder; if (config.zabbixTargetHostname) { targetBuilder = targetStatic.bind(undefined, config.zabbixTargetHostname); } else { targetBuilder = targetDecode; } const sender = new ZabbixSender({ host: config.zabbixHost || 'lo...
[ "function", "init", "(", "startupTime", ",", "config", ",", "events", ",", "l", ")", "{", "logger", "=", "l", ";", "let", "targetBuilder", ";", "if", "(", "config", ".", "zabbixTargetHostname", ")", "{", "targetBuilder", "=", "targetStatic", ".", "bind", ...
Initalize the plugin. @param {number} startupTime Timestamp StatsD started. @param {Object} config Global configuration provided to StatsD. @param {Object} events Event handler to register actions on. @param {Object} l Global logger instance. @returns {boolean} Status of initialization.
[ "Initalize", "the", "plugin", "." ]
e459939108ae6aee3b155eed6b76eba1dc053af9
https://github.com/parkerd/statsd-zabbix-backend/blob/e459939108ae6aee3b155eed6b76eba1dc053af9/lib/zabbix.js#L298-L323
41,010
gagan-bansal/json-groupby
json-groupby.js
collectProperties
function collectProperties(groups, properties) { var collection = {}; for (var key in groups) { if (Array.isArray(groups[key])) { collection[key] = groups[key].reduce(function(coll, item) { properties.forEach(function(prop) { if (!coll[prop]) coll[prop] = []; coll[prop] = col...
javascript
function collectProperties(groups, properties) { var collection = {}; for (var key in groups) { if (Array.isArray(groups[key])) { collection[key] = groups[key].reduce(function(coll, item) { properties.forEach(function(prop) { if (!coll[prop]) coll[prop] = []; coll[prop] = col...
[ "function", "collectProperties", "(", "groups", ",", "properties", ")", "{", "var", "collection", "=", "{", "}", ";", "for", "(", "var", "key", "in", "groups", ")", "{", "if", "(", "Array", ".", "isArray", "(", "groups", "[", "key", "]", ")", ")", ...
collect the properties in an array
[ "collect", "the", "properties", "in", "an", "array" ]
4955b1ccb13320d4732147b2500cb162b69b076c
https://github.com/gagan-bansal/json-groupby/blob/4955b1ccb13320d4732147b2500cb162b69b076c/json-groupby.js#L56-L72
41,011
TooTallNate/file-uri-to-path
index.js
fileUriToPath
function fileUriToPath (uri) { if ('string' != typeof uri || uri.length <= 7 || 'file://' != uri.substring(0, 7)) { throw new TypeError('must pass in a file:// URI to convert to a file path'); } var rest = decodeURI(uri.substring(7)); var firstSlash = rest.indexOf('/'); var host = rest.substr...
javascript
function fileUriToPath (uri) { if ('string' != typeof uri || uri.length <= 7 || 'file://' != uri.substring(0, 7)) { throw new TypeError('must pass in a file:// URI to convert to a file path'); } var rest = decodeURI(uri.substring(7)); var firstSlash = rest.indexOf('/'); var host = rest.substr...
[ "function", "fileUriToPath", "(", "uri", ")", "{", "if", "(", "'string'", "!=", "typeof", "uri", "||", "uri", ".", "length", "<=", "7", "||", "'file://'", "!=", "uri", ".", "substring", "(", "0", ",", "7", ")", ")", "{", "throw", "new", "TypeError", ...
File URI to Path function. @param {String} uri @return {String} path @api public
[ "File", "URI", "to", "Path", "function", "." ]
db012b4db2c9da9f6eeb5202b4a493450482e0e4
https://github.com/TooTallNate/file-uri-to-path/blob/db012b4db2c9da9f6eeb5202b4a493450482e0e4/index.js#L22-L66
41,012
stephanebachelier/superapi-cache
dist/hydrate.js
parseHeaders
function parseHeaders() { var str = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; var lines = str.split(/\r?\n/); var fields = {}; var index = undefined; var line = undefined; var field = undefined; var val = undefined; lines.pop(); // trailing CRLF for (var i = 0, len = ...
javascript
function parseHeaders() { var str = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; var lines = str.split(/\r?\n/); var fields = {}; var index = undefined; var line = undefined; var field = undefined; var val = undefined; lines.pop(); // trailing CRLF for (var i = 0, len = ...
[ "function", "parseHeaders", "(", ")", "{", "var", "str", "=", "arguments", ".", "length", "<=", "0", "||", "arguments", "[", "0", "]", "===", "undefined", "?", "''", ":", "arguments", "[", "0", "]", ";", "var", "lines", "=", "str", ".", "split", "(...
borrow from superagent
[ "borrow", "from", "superagent" ]
0d9ff011a52b369d8cf82cea135418a1d021e80c
https://github.com/stephanebachelier/superapi-cache/blob/0d9ff011a52b369d8cf82cea135418a1d021e80c/dist/hydrate.js#L28-L49
41,013
wanchain/wanx
src/btc/utils.js
buildHashTimeLockContract
function buildHashTimeLockContract(network, xHash, destH160Addr, revokerH160Addr, lockTime) { const bitcoinNetwork = bitcoin.networks[network]; const redeemScript = bitcoin.script.compile([ bitcoin.opcodes.OP_IF, bitcoin.opcodes.OP_SHA256, Buffer.from(xHash, 'hex'), bitcoin.opcodes.OP_EQUALVERIFY, ...
javascript
function buildHashTimeLockContract(network, xHash, destH160Addr, revokerH160Addr, lockTime) { const bitcoinNetwork = bitcoin.networks[network]; const redeemScript = bitcoin.script.compile([ bitcoin.opcodes.OP_IF, bitcoin.opcodes.OP_SHA256, Buffer.from(xHash, 'hex'), bitcoin.opcodes.OP_EQUALVERIFY, ...
[ "function", "buildHashTimeLockContract", "(", "network", ",", "xHash", ",", "destH160Addr", ",", "revokerH160Addr", ",", "lockTime", ")", "{", "const", "bitcoinNetwork", "=", "bitcoin", ".", "networks", "[", "network", "]", ";", "const", "redeemScript", "=", "bi...
Generate P2SH timelock contract @param {string} network - Network name (mainnet, testnet) @param {string} xHash - The xHash string @param {string} destH160Addr - Hash160 of the receiver's bitcoin address @param {string} revokerH160Addr - Hash160 of the revoker's bitcoin address @param {number} lockTime - The timestamp ...
[ "Generate", "P2SH", "timelock", "contract" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/btc/utils.js#L42-L85
41,014
wanchain/wanx
src/btc/utils.js
hashForRedeemSig
function hashForRedeemSig(network, txid, address, value, redeemScript) { const tx = btcUtil.buildIncompleteRedeem(network, txid, address, value); const sigHash = tx.hashForSignature( 0, new Buffer.from(redeemScript, 'hex'), bitcoin.Transaction.SIGHASH_ALL ); return sigHash.toString('hex'); }
javascript
function hashForRedeemSig(network, txid, address, value, redeemScript) { const tx = btcUtil.buildIncompleteRedeem(network, txid, address, value); const sigHash = tx.hashForSignature( 0, new Buffer.from(redeemScript, 'hex'), bitcoin.Transaction.SIGHASH_ALL ); return sigHash.toString('hex'); }
[ "function", "hashForRedeemSig", "(", "network", ",", "txid", ",", "address", ",", "value", ",", "redeemScript", ")", "{", "const", "tx", "=", "btcUtil", ".", "buildIncompleteRedeem", "(", "network", ",", "txid", ",", "address", ",", "value", ")", ";", "con...
Get the hash to be signed for a redeem transaction @param {string} network - Network name (mainnet, testnet) @param {string} txid - The txid for the UTXO being spent @param {string} address - The address to receive funds @param {string|number} value - The amount of funds to be sent (in Satoshis) @param {string} redeemS...
[ "Get", "the", "hash", "to", "be", "signed", "for", "a", "redeem", "transaction" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/btc/utils.js#L96-L105
41,015
wanchain/wanx
src/btc/utils.js
hashForRevokeSig
function hashForRevokeSig(network, txid, address, value, lockTime, redeemScript) { const tx = btcUtil.buildIncompleteRevoke(network, txid, address, value, lockTime); const sigHash = tx.hashForSignature( 0, new Buffer.from(redeemScript, 'hex'), bitcoin.Transaction.SIGHASH_ALL ); return sigHash.toStr...
javascript
function hashForRevokeSig(network, txid, address, value, lockTime, redeemScript) { const tx = btcUtil.buildIncompleteRevoke(network, txid, address, value, lockTime); const sigHash = tx.hashForSignature( 0, new Buffer.from(redeemScript, 'hex'), bitcoin.Transaction.SIGHASH_ALL ); return sigHash.toStr...
[ "function", "hashForRevokeSig", "(", "network", ",", "txid", ",", "address", ",", "value", ",", "lockTime", ",", "redeemScript", ")", "{", "const", "tx", "=", "btcUtil", ".", "buildIncompleteRevoke", "(", "network", ",", "txid", ",", "address", ",", "value",...
Get the hash to be signed for a revoke transaction @param {string} network - Network name (mainnet, testnet) @param {string} txid - The txid for the UTXO being spent @param {string} address - The address to receive funds @param {string|number} value - The amount of funds to be sent (in Satoshis) @param {number} lockTim...
[ "Get", "the", "hash", "to", "be", "signed", "for", "a", "revoke", "transaction" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/btc/utils.js#L117-L126
41,016
wanchain/wanx
src/btc/utils.js
buildIncompleteRedeem
function buildIncompleteRedeem(network, txid, address, value) { const bitcoinNetwork = bitcoin.networks[network]; // NB: storemen address validation requires that vout is 0 const vout = 0; const txb = new bitcoin.TransactionBuilder(bitcoinNetwork); txb.setVersion(1); txb.addInput(hex.stripPrefix(txid), v...
javascript
function buildIncompleteRedeem(network, txid, address, value) { const bitcoinNetwork = bitcoin.networks[network]; // NB: storemen address validation requires that vout is 0 const vout = 0; const txb = new bitcoin.TransactionBuilder(bitcoinNetwork); txb.setVersion(1); txb.addInput(hex.stripPrefix(txid), v...
[ "function", "buildIncompleteRedeem", "(", "network", ",", "txid", ",", "address", ",", "value", ")", "{", "const", "bitcoinNetwork", "=", "bitcoin", ".", "networks", "[", "network", "]", ";", "// NB: storemen address validation requires that vout is 0", "const", "vout...
Build incomplete redeem transaction @param {string} network - Network name (mainnet, testnet) @param {string} txid - The txid for the UTXO being spent @param {string} address - The address to receive funds @param {string|number} value - The amount of funds to be sent (in Satoshis) @returns {Object} Incomplete redeem tr...
[ "Build", "incomplete", "redeem", "transaction" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/btc/utils.js#L136-L149
41,017
wanchain/wanx
src/btc/utils.js
buildRedeemTx
function buildRedeemTx(network, txid, value, redeemScript, x, publicKey, signedSigHash, toAddress) { const bitcoinNetwork = bitcoin.networks[network]; // if toAddress is not supplied, derive it from the publicKey if (! toAddress) { const { address } = bitcoin.payments.p2pkh({ network: bitcoinNetwork, ...
javascript
function buildRedeemTx(network, txid, value, redeemScript, x, publicKey, signedSigHash, toAddress) { const bitcoinNetwork = bitcoin.networks[network]; // if toAddress is not supplied, derive it from the publicKey if (! toAddress) { const { address } = bitcoin.payments.p2pkh({ network: bitcoinNetwork, ...
[ "function", "buildRedeemTx", "(", "network", ",", "txid", ",", "value", ",", "redeemScript", ",", "x", ",", "publicKey", ",", "signedSigHash", ",", "toAddress", ")", "{", "const", "bitcoinNetwork", "=", "bitcoin", ".", "networks", "[", "network", "]", ";", ...
Create redeem transaction using signed sigHash @param {string} network - Network name (mainnet, testnet) @param {string} txid - The txid for the UTXO being spent @param {string|number} value - The amount of funds to be sent (in Satoshis) @param {string} redeemScript - The redeemScript of the P2SH address @param {string...
[ "Create", "redeem", "transaction", "using", "signed", "sigHash" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/btc/utils.js#L188-L225
41,018
aantthony/javascript-cas
examples/solver.js
solveLinearIntersect
function solveLinearIntersect(a,b, c, d,e, f) { // ax + by = c; // dx + ey = d; console.log('WORKED: ', arguments); if(a === 0) { var y = c/b; var x = (d-e*y)/x; return [x, y]; } var denom = e-d/a * b; if(denom === 0) { // Either infinite solutions or no solutions return [undefined, undefined]; } va...
javascript
function solveLinearIntersect(a,b, c, d,e, f) { // ax + by = c; // dx + ey = d; console.log('WORKED: ', arguments); if(a === 0) { var y = c/b; var x = (d-e*y)/x; return [x, y]; } var denom = e-d/a * b; if(denom === 0) { // Either infinite solutions or no solutions return [undefined, undefined]; } va...
[ "function", "solveLinearIntersect", "(", "a", ",", "b", ",", "c", ",", "d", ",", "e", ",", "f", ")", "{", "// ax + by = c;", "// dx + ey = d;", "console", ".", "log", "(", "'WORKED: '", ",", "arguments", ")", ";", "if", "(", "a", "===", "0", ")", "{"...
Does not work!!!, but a general idea of how it would once bugs are fixed.
[ "Does", "not", "work!!!", "but", "a", "general", "idea", "of", "how", "it", "would", "once", "bugs", "are", "fixed", "." ]
d13ca4eb1a8aee3b712a8d48e06280b87bf96ed3
https://github.com/aantthony/javascript-cas/blob/d13ca4eb1a8aee3b712a8d48e06280b87bf96ed3/examples/solver.js#L3-L20
41,019
wanchain/wanx
src/lib/hex.js
fromString
function fromString(str) { const bytes = []; for (let n = 0, l = str.length; n < l; n++) { const hex = Number(str.charCodeAt(n)).toString(16); bytes.push(hex); } return '0x' + bytes.join(''); }
javascript
function fromString(str) { const bytes = []; for (let n = 0, l = str.length; n < l; n++) { const hex = Number(str.charCodeAt(n)).toString(16); bytes.push(hex); } return '0x' + bytes.join(''); }
[ "function", "fromString", "(", "str", ")", "{", "const", "bytes", "=", "[", "]", ";", "for", "(", "let", "n", "=", "0", ",", "l", "=", "str", ".", "length", ";", "n", "<", "l", ";", "n", "++", ")", "{", "const", "hex", "=", "Number", "(", "...
Convert ascii `String` to hex @param {String} str @return {String}
[ "Convert", "ascii", "String", "to", "hex" ]
1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875
https://github.com/wanchain/wanx/blob/1136b7b8ae79cc6e5499f5eb63d5cdb1e6080875/src/lib/hex.js#L62-L71
41,020
siffogh/eslint-plugin-better-styled-components
lib/rules/sort-declarations-alphabetically.js
isValidAtomicRule
function isValidAtomicRule(rule) { const decls = rule.nodes.filter(node => node.type === "decl"); if (decls.length < 0) { return { isValid: true }; } for (let i = 1; i < decls.length; i++) { const current = decls[i].prop; const prev = decls[i - 1].prop; if (current < prev) { const loc = {...
javascript
function isValidAtomicRule(rule) { const decls = rule.nodes.filter(node => node.type === "decl"); if (decls.length < 0) { return { isValid: true }; } for (let i = 1; i < decls.length; i++) { const current = decls[i].prop; const prev = decls[i - 1].prop; if (current < prev) { const loc = {...
[ "function", "isValidAtomicRule", "(", "rule", ")", "{", "const", "decls", "=", "rule", ".", "nodes", ".", "filter", "(", "node", "=>", "node", ".", "type", "===", "\"decl\"", ")", ";", "if", "(", "decls", ".", "length", "<", "0", ")", "{", "return", ...
An atomic rule is a rule without nested rules.
[ "An", "atomic", "rule", "is", "a", "rule", "without", "nested", "rules", "." ]
0728200fa2f0a58af5fac6c94538bda292ab1d2a
https://github.com/siffogh/eslint-plugin-better-styled-components/blob/0728200fa2f0a58af5fac6c94538bda292ab1d2a/lib/rules/sort-declarations-alphabetically.js#L14-L40
41,021
frozzare/json-to-html
index.js
html
function html(obj, indents) { indents = indents || 1; function indent() { return Array(indents).join(' '); } if ('string' == typeof obj) { var str = escape(obj); if (urlRegex().test(obj)) { str = '<a href="' + str + '">' + str + '</a>'; } return span('string value', '"' + str + '"')...
javascript
function html(obj, indents) { indents = indents || 1; function indent() { return Array(indents).join(' '); } if ('string' == typeof obj) { var str = escape(obj); if (urlRegex().test(obj)) { str = '<a href="' + str + '">' + str + '</a>'; } return span('string value', '"' + str + '"')...
[ "function", "html", "(", "obj", ",", "indents", ")", "{", "indents", "=", "indents", "||", "1", ";", "function", "indent", "(", ")", "{", "return", "Array", "(", "indents", ")", ".", "join", "(", "' '", ")", ";", "}", "if", "(", "'string'", "==", ...
Convert JSON Object to html. @param {Object} obj @return {String} @api public
[ "Convert", "JSON", "Object", "to", "html", "." ]
07c45bf5e686855fd7ccab0c99d58effef3e744c
https://github.com/frozzare/json-to-html/blob/07c45bf5e686855fd7ccab0c99d58effef3e744c/index.js#L47-L106
41,022
thauburger/js-heap
heap.js
function(sort) { this._array = []; this._sort = sort; Object.defineProperty(this, 'length', { enumerable: true, get: function() { return this._array.length }, }); if (typeof this._sort !== 'function') { this._sort = function(a, b) { return a - b; } } }
javascript
function(sort) { this._array = []; this._sort = sort; Object.defineProperty(this, 'length', { enumerable: true, get: function() { return this._array.length }, }); if (typeof this._sort !== 'function') { this._sort = function(a, b) { return a - b; } } }
[ "function", "(", "sort", ")", "{", "this", ".", "_array", "=", "[", "]", ";", "this", ".", "_sort", "=", "sort", ";", "Object", ".", "defineProperty", "(", "this", ",", "'length'", ",", "{", "enumerable", ":", "true", ",", "get", ":", "function", "...
heap.js JS heap implementation
[ "heap", ".", "js", "JS", "heap", "implementation" ]
019d4b6ad4aa8a424760d17405d99a1fc5bca84d
https://github.com/thauburger/js-heap/blob/019d4b6ad4aa8a424760d17405d99a1fc5bca84d/heap.js#L6-L20
41,023
ozum/auto-generate
lib/auto-generate.js
autoStartLine
function autoStartLine(name) { var pre = new Array(Math.floor((60 - name.length) / 2) - 3).join('-'); var post = new Array(60 - pre.length - name.length).join('-'); return signature + 'S' + pre + ' Auto Start: ' + name + ' ' + post + '\n'; }
javascript
function autoStartLine(name) { var pre = new Array(Math.floor((60 - name.length) / 2) - 3).join('-'); var post = new Array(60 - pre.length - name.length).join('-'); return signature + 'S' + pre + ' Auto Start: ' + name + ' ' + post + '\n'; }
[ "function", "autoStartLine", "(", "name", ")", "{", "var", "pre", "=", "new", "Array", "(", "Math", ".", "floor", "(", "(", "60", "-", "name", ".", "length", ")", "/", "2", ")", "-", "3", ")", ".", "join", "(", "'-'", ")", ";", "var", "post", ...
Object which contains detailed info of an auto generated part. @private @typedef {Object} partInfo @property {string} startLine - Start line (opening tag / marker) of auto generated part. @property {string} warningLine - Warning message line of auto generated part. @property {string} content - Auto generated content. @...
[ "Object", "which", "contains", "detailed", "info", "of", "an", "auto", "generated", "part", "." ]
5b8574514d5095d647545e93e6042cd585f90d48
https://github.com/ozum/auto-generate/blob/5b8574514d5095d647545e93e6042cd585f90d48/lib/auto-generate.js#L105-L109
41,024
ozum/auto-generate
lib/auto-generate.js
makeBackup
function makeBackup(filePath) { var dateString = new Date().toISOString().replace(/:/g, '.').replace('Z', '').replace('T', ' '); try { fs.mkdirSync(path.join(path.dirname(filePath), 'BACKUP')); } catch(err) { if (err.code != 'EEXIST') { throw err } } fs.writeFileSync(path.join(path.dirname(file...
javascript
function makeBackup(filePath) { var dateString = new Date().toISOString().replace(/:/g, '.').replace('Z', '').replace('T', ' '); try { fs.mkdirSync(path.join(path.dirname(filePath), 'BACKUP')); } catch(err) { if (err.code != 'EEXIST') { throw err } } fs.writeFileSync(path.join(path.dirname(file...
[ "function", "makeBackup", "(", "filePath", ")", "{", "var", "dateString", "=", "new", "Date", "(", ")", ".", "toISOString", "(", ")", ".", "replace", "(", "/", ":", "/", "g", ",", "'.'", ")", ".", "replace", "(", "'Z'", ",", "''", ")", ".", "repl...
Creates backup of a file. To do this, it creates a directory called BACKUP in the same directory where original file is located in. Backup file name has a suffix of ISO style date and time. ie. 'model.js' becomes '2014-01-12 22.02.23.345 model.js' @private @param {string} filePath - Absolute path of file
[ "Creates", "backup", "of", "a", "file", ".", "To", "do", "this", "it", "creates", "a", "directory", "called", "BACKUP", "in", "the", "same", "directory", "where", "original", "file", "is", "located", "in", ".", "Backup", "file", "name", "has", "a", "suff...
5b8574514d5095d647545e93e6042cd585f90d48
https://github.com/ozum/auto-generate/blob/5b8574514d5095d647545e93e6042cd585f90d48/lib/auto-generate.js#L130-L135
41,025
ozum/auto-generate
lib/auto-generate.js
getPart
function getPart(name, fileContent, options) { if (!name || !options) { throw new Error('name and options are required.'); } var parts = fileContent.match(getRegularExpression(name)); if ( parts ) { // Aranan bölüm varsa var fileContentDigest = calculateMD5(parts[3], options); ...
javascript
function getPart(name, fileContent, options) { if (!name || !options) { throw new Error('name and options are required.'); } var parts = fileContent.match(getRegularExpression(name)); if ( parts ) { // Aranan bölüm varsa var fileContentDigest = calculateMD5(parts[3], options); ...
[ "function", "getPart", "(", "name", ",", "fileContent", ",", "options", ")", "{", "if", "(", "!", "name", "||", "!", "options", ")", "{", "throw", "new", "Error", "(", "'name and options are required.'", ")", ";", "}", "var", "parts", "=", "fileContent", ...
Finds auto generated part and returns an object which contains information about auto generated part. If auto part with requested name cannot be found, it returns null. @private @param name - Name of the auto generated part. @param fileContent - content of the file which part is searched in. @param {genOptions} options...
[ "Finds", "auto", "generated", "part", "and", "returns", "an", "object", "which", "contains", "information", "about", "auto", "generated", "part", ".", "If", "auto", "part", "with", "requested", "name", "cannot", "be", "found", "it", "returns", "null", "." ]
5b8574514d5095d647545e93e6042cd585f90d48
https://github.com/ozum/auto-generate/blob/5b8574514d5095d647545e93e6042cd585f90d48/lib/auto-generate.js#L180-L202
41,026
ozum/auto-generate
lib/auto-generate.js
fileExists
function fileExists(file) { try { var targetStat = fs.statSync(file); if (targetStat.isDirectory() ) { throw new Error("File exists but it's a driectory: " + file); } } catch(err) { if (err.code == 'ENOENT') { // No such file or directory retur...
javascript
function fileExists(file) { try { var targetStat = fs.statSync(file); if (targetStat.isDirectory() ) { throw new Error("File exists but it's a driectory: " + file); } } catch(err) { if (err.code == 'ENOENT') { // No such file or directory retur...
[ "function", "fileExists", "(", "file", ")", "{", "try", "{", "var", "targetStat", "=", "fs", ".", "statSync", "(", "file", ")", ";", "if", "(", "targetStat", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "Error", "(", "\"File exists but it's a ...
Checks if the file exists at the given path. Returns true if it exists, false otherwise. @private @param {string} file - Path of the file to check @returns {boolean}
[ "Checks", "if", "the", "file", "exists", "at", "the", "given", "path", ".", "Returns", "true", "if", "it", "exists", "false", "otherwise", "." ]
5b8574514d5095d647545e93e6042cd585f90d48
https://github.com/ozum/auto-generate/blob/5b8574514d5095d647545e93e6042cd585f90d48/lib/auto-generate.js#L210-L226
41,027
goto-bus-stop/browser-pack-flat
example/out/flat.js
walk
function walk (newNode, oldNode) { // if (DEBUG) { // console.log( // 'walk\nold\n %s\nnew\n %s', // oldNode && oldNode.outerHTML, // newNode && newNode.outerHTML // ) // } if (!oldNode) { return newNode } else if (!newNode) { return null } else if (newNode.isSameNode && newNode.is...
javascript
function walk (newNode, oldNode) { // if (DEBUG) { // console.log( // 'walk\nold\n %s\nnew\n %s', // oldNode && oldNode.outerHTML, // newNode && newNode.outerHTML // ) // } if (!oldNode) { return newNode } else if (!newNode) { return null } else if (newNode.isSameNode && newNode.is...
[ "function", "walk", "(", "newNode", ",", "oldNode", ")", "{", "// if (DEBUG) {", "// console.log(", "// 'walk\\nold\\n %s\\nnew\\n %s',", "// oldNode && oldNode.outerHTML,", "// newNode && newNode.outerHTML", "// )", "// }", "if", "(", "!", "oldNode", ")", "{", "r...
Walk and morph a dom tree
[ "Walk", "and", "morph", "a", "dom", "tree" ]
c12e407a027a0a07c6d750781125317d6a166327
https://github.com/goto-bus-stop/browser-pack-flat/blob/c12e407a027a0a07c6d750781125317d6a166327/example/out/flat.js#L270-L291
41,028
byteclubfr/js-hal
hal.js
Link
function Link (rel, value) { if (!(this instanceof Link)) { return new Link(rel, value); } if (!rel) throw new Error('Required <link> attribute "rel"'); this.rel = rel; if (typeof value === 'object') { // If value is a hashmap, just copy properties if (!value.href) throw new Er...
javascript
function Link (rel, value) { if (!(this instanceof Link)) { return new Link(rel, value); } if (!rel) throw new Error('Required <link> attribute "rel"'); this.rel = rel; if (typeof value === 'object') { // If value is a hashmap, just copy properties if (!value.href) throw new Er...
[ "function", "Link", "(", "rel", ",", "value", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Link", ")", ")", "{", "return", "new", "Link", "(", "rel", ",", "value", ")", ";", "}", "if", "(", "!", "rel", ")", "throw", "new", "Error", "("...
Link to another hypermedia @param String rel → the relation identifier @param String|Object value → the href, or the hash of all attributes (including href)
[ "Link", "to", "another", "hypermedia" ]
16c1e6d15093b7eee28f874b56081a58ed7f4f03
https://github.com/byteclubfr/js-hal/blob/16c1e6d15093b7eee28f874b56081a58ed7f4f03/hal.js#L8-L39
41,029
byteclubfr/js-hal
hal.js
Resource
function Resource (object, uri) { // new Resource(resource) === resource if (object instanceof Resource) { return object; } // Still work if "new" is omitted if (!(this instanceof Resource)) { return new Resource(object, uri); } // Initialize _links and _embedded properties ...
javascript
function Resource (object, uri) { // new Resource(resource) === resource if (object instanceof Resource) { return object; } // Still work if "new" is omitted if (!(this instanceof Resource)) { return new Resource(object, uri); } // Initialize _links and _embedded properties ...
[ "function", "Resource", "(", "object", ",", "uri", ")", "{", "// new Resource(resource) === resource", "if", "(", "object", "instanceof", "Resource", ")", "{", "return", "object", ";", "}", "// Still work if \"new\" is omitted", "if", "(", "!", "(", "this", "insta...
A hypertext resource @param Object object → the base properties Define "href" if you choose not to pass parameter "uri" Do not define "_links" and "_embedded" unless you know what you're doing @param String uri → href for the <link rel="self"> (can use reserved "href" property instead)
[ "A", "hypertext", "resource" ]
16c1e6d15093b7eee28f874b56081a58ed7f4f03
https://github.com/byteclubfr/js-hal/blob/16c1e6d15093b7eee28f874b56081a58ed7f4f03/hal.js#L74-L107
41,030
byteclubfr/js-hal
hal.js
resourceToJsonObject
function resourceToJsonObject (resource) { var result = {}; for (var prop in resource) { if (prop === '_links') { if (Object.keys(resource._links).length > 0) { // Note: we need to copy data to remove "rel" property without corrupting original Link object result._links = Obje...
javascript
function resourceToJsonObject (resource) { var result = {}; for (var prop in resource) { if (prop === '_links') { if (Object.keys(resource._links).length > 0) { // Note: we need to copy data to remove "rel" property without corrupting original Link object result._links = Obje...
[ "function", "resourceToJsonObject", "(", "resource", ")", "{", "var", "result", "=", "{", "}", ";", "for", "(", "var", "prop", "in", "resource", ")", "{", "if", "(", "prop", "===", "'_links'", ")", "{", "if", "(", "Object", ".", "keys", "(", "resourc...
Convert a resource to a stringifiable anonymous object @private @param Resource resource
[ "Convert", "a", "resource", "to", "a", "stringifiable", "anonymous", "object" ]
16c1e6d15093b7eee28f874b56081a58ed7f4f03
https://github.com/byteclubfr/js-hal/blob/16c1e6d15093b7eee28f874b56081a58ed7f4f03/hal.js#L169-L211
41,031
byteclubfr/js-hal
hal.js
resourceToXml
function resourceToXml (resource, rel, currentIndent, nextIndent) { // Do not add line feeds if no indentation is asked var LF = (currentIndent || nextIndent) ? '\n' : ''; // Resource tag var xml = currentIndent + '<resource'; // Resource attributes: rel, href, name if (rel) xml += ' rel="' + ...
javascript
function resourceToXml (resource, rel, currentIndent, nextIndent) { // Do not add line feeds if no indentation is asked var LF = (currentIndent || nextIndent) ? '\n' : ''; // Resource tag var xml = currentIndent + '<resource'; // Resource attributes: rel, href, name if (rel) xml += ' rel="' + ...
[ "function", "resourceToXml", "(", "resource", ",", "rel", ",", "currentIndent", ",", "nextIndent", ")", "{", "// Do not add line feeds if no indentation is asked", "var", "LF", "=", "(", "currentIndent", "||", "nextIndent", ")", "?", "'\\n'", ":", "''", ";", "// R...
Convert a resource to its XML representation @private @param Resource resource @param String rel → relation identifier for embedded object @param String currentIdent → current indentation @param String nextIndent → next indentation
[ "Convert", "a", "resource", "to", "its", "XML", "representation" ]
16c1e6d15093b7eee28f874b56081a58ed7f4f03
https://github.com/byteclubfr/js-hal/blob/16c1e6d15093b7eee28f874b56081a58ed7f4f03/hal.js#L238-L277
41,032
akamai/akamai-gen-edgerc
bin/gen-edgerc.js
init
function init() { // Retrieve any arguments passed in via the command line args = cliConfig.getArguments(); // Supply usage info if help argument was passed if (args.help) { console.log(cliConfig.getUsage()); process.exit(0); } getClientAuth(function(data) { parseClientAuth(data, function(err,...
javascript
function init() { // Retrieve any arguments passed in via the command line args = cliConfig.getArguments(); // Supply usage info if help argument was passed if (args.help) { console.log(cliConfig.getUsage()); process.exit(0); } getClientAuth(function(data) { parseClientAuth(data, function(err,...
[ "function", "init", "(", ")", "{", "// Retrieve any arguments passed in via the command line", "args", "=", "cliConfig", ".", "getArguments", "(", ")", ";", "// Supply usage info if help argument was passed", "if", "(", "args", ".", "help", ")", "{", "console", ".", "...
Initialize the script, setting up default values, and prepping the CLI params.
[ "Initialize", "the", "script", "setting", "up", "default", "values", "and", "prepping", "the", "CLI", "params", "." ]
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/bin/gen-edgerc.js#L35-L64
41,033
akamai/akamai-gen-edgerc
bin/gen-edgerc.js
getClientAuth
function getClientAuth(callback) { console.log("This script will create a section named '" + args.section + "'" + "in the local file " + args.path + ".\n"); // Read the client authorization file. If not found, notify user. if (args.file) { clientAuthData = fs.readFileSync(args.file, 'utf8'); console....
javascript
function getClientAuth(callback) { console.log("This script will create a section named '" + args.section + "'" + "in the local file " + args.path + ".\n"); // Read the client authorization file. If not found, notify user. if (args.file) { clientAuthData = fs.readFileSync(args.file, 'utf8'); console....
[ "function", "getClientAuth", "(", "callback", ")", "{", "console", ".", "log", "(", "\"This script will create a section named '\"", "+", "args", ".", "section", "+", "\"'\"", "+", "\"in the local file \"", "+", "args", ".", "path", "+", "\".\\n\"", ")", ";", "/...
Gets the client authorization data by either reading the file path passed in by the user or requesting the user to copy and paste the data directly into the command line. @param {Function} callback Callback function accepting a data param which will be called once the data is ready.
[ "Gets", "the", "client", "authorization", "data", "by", "either", "reading", "the", "file", "path", "passed", "in", "by", "the", "user", "or", "requesting", "the", "user", "to", "copy", "and", "paste", "the", "data", "directly", "into", "the", "command", "...
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/bin/gen-edgerc.js#L76-L118
41,034
akamai/akamai-gen-edgerc
bin/gen-edgerc.js
parseClientAuth
function parseClientAuth(data, callback) { authParser.parseAuth(data, function(err, data) { if (err) callback(err, null); callback(null, data); }); }
javascript
function parseClientAuth(data, callback) { authParser.parseAuth(data, function(err, data) { if (err) callback(err, null); callback(null, data); }); }
[ "function", "parseClientAuth", "(", "data", ",", "callback", ")", "{", "authParser", ".", "parseAuth", "(", "data", ",", "function", "(", "err", ",", "data", ")", "{", "if", "(", "err", ")", "callback", "(", "err", ",", "null", ")", ";", "callback", ...
Parses the client authorization file. @param {String} data Parsed array of client authorization data @param {Function} callback Callback function accepting an error parameter
[ "Parses", "the", "client", "authorization", "file", "." ]
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/bin/gen-edgerc.js#L126-L131
41,035
akamai/akamai-gen-edgerc
bin/gen-edgerc.js
writeEdgerc
function writeEdgerc(data, callback) { try { edgercWriter.writeEdgercSection( args.path, args.section, data["URL:"], data["Secret:"], data["Tokens:"], data["token:"], data["max-body"] ); } catch (err) { callback(err); } return callback(); }
javascript
function writeEdgerc(data, callback) { try { edgercWriter.writeEdgercSection( args.path, args.section, data["URL:"], data["Secret:"], data["Tokens:"], data["token:"], data["max-body"] ); } catch (err) { callback(err); } return callback(); }
[ "function", "writeEdgerc", "(", "data", ",", "callback", ")", "{", "try", "{", "edgercWriter", ".", "writeEdgercSection", "(", "args", ".", "path", ",", "args", ".", "section", ",", "data", "[", "\"URL:\"", "]", ",", "data", "[", "\"Secret:\"", "]", ",",...
Writes the parsed client auth data to the .edgerc file. @param {Array} data Array of parsed client auth data @param {Function} callback unction to receive errors and handle completion
[ "Writes", "the", "parsed", "client", "auth", "data", "to", "the", ".", "edgerc", "file", "." ]
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/bin/gen-edgerc.js#L139-L155
41,036
shannonmoeller/handlebars-group-by
index.js
groupBy
function groupBy(handlebars) { var helpers = { /** * @method group * @param {Array} list * @param {Object} options * @param {Object} options.hash * @param {String} options.hash.by * @return {String} Rendered partial. */ group: function (list, options) { options = options || {}; var fn =...
javascript
function groupBy(handlebars) { var helpers = { /** * @method group * @param {Array} list * @param {Object} options * @param {Object} options.hash * @param {String} options.hash.by * @return {String} Rendered partial. */ group: function (list, options) { options = options || {}; var fn =...
[ "function", "groupBy", "(", "handlebars", ")", "{", "var", "helpers", "=", "{", "/**\n\t\t * @method group\n\t\t * @param {Array} list\n\t\t * @param {Object} options\n\t\t * @param {Object} options.hash\n\t\t * @param {String} options.hash.by\n\t\t * @return {String} Rendered partial.\n\t\t */"...
Registers a group helper on an instance of Handlebars. @type {Function} @param {Object} handlebars Handlebars instance. @return {Object} Handlebars instance.
[ "Registers", "a", "group", "helper", "on", "an", "instance", "of", "Handlebars", "." ]
bd3e48f787ea253b8beaec6145b9151b326bcb32
https://github.com/shannonmoeller/handlebars-group-by/blob/bd3e48f787ea253b8beaec6145b9151b326bcb32/index.js#L29-L83
41,037
goto-bus-stop/browser-pack-flat
index.js
markDuplicateVariableNames
function markDuplicateVariableNames (row, i, rows) { var ast = row[kAst] var scope = scan.scope(ast) if (scope) { scope.forEach(function (binding, name) { binding[kShouldRename] = rows.usedGlobalVariables.has(name) rows.usedGlobalVariables.add(name) }) } }
javascript
function markDuplicateVariableNames (row, i, rows) { var ast = row[kAst] var scope = scan.scope(ast) if (scope) { scope.forEach(function (binding, name) { binding[kShouldRename] = rows.usedGlobalVariables.has(name) rows.usedGlobalVariables.add(name) }) } }
[ "function", "markDuplicateVariableNames", "(", "row", ",", "i", ",", "rows", ")", "{", "var", "ast", "=", "row", "[", "kAst", "]", "var", "scope", "=", "scan", ".", "scope", "(", "ast", ")", "if", "(", "scope", ")", "{", "scope", ".", "forEach", "(...
Mark module variables that collide with variable names from other modules so we can rewrite them.
[ "Mark", "module", "variables", "that", "collide", "with", "variable", "names", "from", "other", "modules", "so", "we", "can", "rewrite", "them", "." ]
c12e407a027a0a07c6d750781125317d6a166327
https://github.com/goto-bus-stop/browser-pack-flat/blob/c12e407a027a0a07c6d750781125317d6a166327/index.js#L295-L305
41,038
goto-bus-stop/browser-pack-flat
index.js
detectCycles
function detectCycles (rows) { var cyclicalModules = new Set() var checked = new Set() rows.forEach(function (module) { var visited = [] check(module) function check (row) { var i = visited.indexOf(row) if (i !== -1) { checked.add(row) for (; i < visited.length; i++) { ...
javascript
function detectCycles (rows) { var cyclicalModules = new Set() var checked = new Set() rows.forEach(function (module) { var visited = [] check(module) function check (row) { var i = visited.indexOf(row) if (i !== -1) { checked.add(row) for (; i < visited.length; i++) { ...
[ "function", "detectCycles", "(", "rows", ")", "{", "var", "cyclicalModules", "=", "new", "Set", "(", ")", "var", "checked", "=", "new", "Set", "(", ")", "rows", ".", "forEach", "(", "function", "(", "module", ")", "{", "var", "visited", "=", "[", "]"...
Detect cyclical dependencies in the bundle. All modules in a dependency cycle are moved to the top of the bundle and wrapped in functions so they're not evaluated immediately. When other modules need a module that's in a dependency cycle, instead of using the module's exportName, it'll call the `createModuleFactory` ru...
[ "Detect", "cyclical", "dependencies", "in", "the", "bundle", ".", "All", "modules", "in", "a", "dependency", "cycle", "are", "moved", "to", "the", "top", "of", "the", "bundle", "and", "wrapped", "in", "functions", "so", "they", "re", "not", "evaluated", "i...
c12e407a027a0a07c6d750781125317d6a166327
https://github.com/goto-bus-stop/browser-pack-flat/blob/c12e407a027a0a07c6d750781125317d6a166327/index.js#L567-L600
41,039
akamai/akamai-gen-edgerc
src/edgerc-writer.js
createSectionObj
function createSectionObj( host, secret, accessToken, clientToken, maxBody) { var section = {}; section.client_secret = secret; section.host = host; section.access_token = accessToken; section.client_token = clientToken; section["max-body"] = maxBody ? maxBody : "131072"; return section; }
javascript
function createSectionObj( host, secret, accessToken, clientToken, maxBody) { var section = {}; section.client_secret = secret; section.host = host; section.access_token = accessToken; section.client_token = clientToken; section["max-body"] = maxBody ? maxBody : "131072"; return section; }
[ "function", "createSectionObj", "(", "host", ",", "secret", ",", "accessToken", ",", "clientToken", ",", "maxBody", ")", "{", "var", "section", "=", "{", "}", ";", "section", ".", "client_secret", "=", "secret", ";", "section", ".", "host", "=", "host", ...
Creates a properly formatted .edgerc section Object @param {String} section The section title @param {String} host The host value @param {String} secret The secret value @param {String} accessToken The access token value @param {String} clientToken The client token value @param {String} max-body ...
[ "Creates", "a", "properly", "formatted", ".", "edgerc", "section", "Object" ]
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/src/edgerc-writer.js#L94-L108
41,040
nknapp/html5-media-converter
src/VideoConverter.js
VideoConverter
function VideoConverter(options) { var _this = this; this.name = function() { return options.name; }; this.extName = function () { return options.ext; }; /** * Generate a stream from the video converter * @param size * @returns {*} */ this.toStream = f...
javascript
function VideoConverter(options) { var _this = this; this.name = function() { return options.name; }; this.extName = function () { return options.ext; }; /** * Generate a stream from the video converter * @param size * @returns {*} */ this.toStream = f...
[ "function", "VideoConverter", "(", "options", ")", "{", "var", "_this", "=", "this", ";", "this", ".", "name", "=", "function", "(", ")", "{", "return", "options", ".", "name", ";", "}", ";", "this", ".", "extName", "=", "function", "(", ")", "{", ...
Creates a new @param options.streamEncoding {Boolean} @param options.args {Array.<String>} @param options.ext {String} @param options.name {String} a name for the converter @constructor
[ "Creates", "a", "new" ]
1411ac7dd2102facfaa0d08f9b9e2f0718d12690
https://github.com/nknapp/html5-media-converter/blob/1411ac7dd2102facfaa0d08f9b9e2f0718d12690/src/VideoConverter.js#L13-L73
41,041
parro-it/libui-napi
index.js
initAsyncResource
function initAsyncResource(asyncId, type, triggerAsyncId, resource) { if (wakingup) { return; } wakingup = true; setImmediate(() => { EventLoop.wakeupBackgroundThread(); wakingup = false; }); }
javascript
function initAsyncResource(asyncId, type, triggerAsyncId, resource) { if (wakingup) { return; } wakingup = true; setImmediate(() => { EventLoop.wakeupBackgroundThread(); wakingup = false; }); }
[ "function", "initAsyncResource", "(", "asyncId", ",", "type", ",", "triggerAsyncId", ",", "resource", ")", "{", "if", "(", "wakingup", ")", "{", "return", ";", "}", "wakingup", "=", "true", ";", "setImmediate", "(", "(", ")", "=>", "{", "EventLoop", ".",...
This is called when a new async handle is created. It's used to signal the background thread to stop awaiting calls and upgrade it's list of handles it's awaiting for.
[ "This", "is", "called", "when", "a", "new", "async", "handle", "is", "created", ".", "It", "s", "used", "to", "signal", "the", "background", "thread", "to", "stop", "awaiting", "calls", "and", "upgrade", "it", "s", "list", "of", "handles", "it", "s", "...
5e32314516a163bc91da36cb709382cbc656e56f
https://github.com/parro-it/libui-napi/blob/5e32314516a163bc91da36cb709382cbc656e56f/index.js#L268-L277
41,042
NiklasGollenstede/native-ext
extension/common/exe-url.js
getUrl
function getUrl(version = current) { const name = `native-ext-v${version}-${os}-${arch}.${ext}`; return `https://github.com/NiklasGollenstede/native-ext/releases/download/v${version}/`+ name; }
javascript
function getUrl(version = current) { const name = `native-ext-v${version}-${os}-${arch}.${ext}`; return `https://github.com/NiklasGollenstede/native-ext/releases/download/v${version}/`+ name; }
[ "function", "getUrl", "(", "version", "=", "current", ")", "{", "const", "name", "=", "`", "${", "version", "}", "${", "os", "}", "${", "arch", "}", "${", "ext", "}", "`", ";", "return", "`", "${", "version", "}", "`", "+", "name", ";", "}" ]
no support for other OSs or ARM
[ "no", "support", "for", "other", "OSs", "or", "ARM" ]
c353d551d5890343faa9e89309a6fcf7fbdd5569
https://github.com/NiklasGollenstede/native-ext/blob/c353d551d5890343faa9e89309a6fcf7fbdd5569/extension/common/exe-url.js#L11-L14
41,043
dawsbot/satoshi-bitcoin
index.js
function(satoshi) { //validate arg var satoshiType = typeof satoshi; if (satoshiType === 'string') { satoshi = toNumber(satoshi); satoshiType = 'number'; } if (satoshiType !== 'number'){ throw new TypeError('toBitcoin must be called on a number or string, got ' + satoshiType); ...
javascript
function(satoshi) { //validate arg var satoshiType = typeof satoshi; if (satoshiType === 'string') { satoshi = toNumber(satoshi); satoshiType = 'number'; } if (satoshiType !== 'number'){ throw new TypeError('toBitcoin must be called on a number or string, got ' + satoshiType); ...
[ "function", "(", "satoshi", ")", "{", "//validate arg", "var", "satoshiType", "=", "typeof", "satoshi", ";", "if", "(", "satoshiType", "===", "'string'", ")", "{", "satoshi", "=", "toNumber", "(", "satoshi", ")", ";", "satoshiType", "=", "'number'", ";", "...
Convert Satoshi to Bitcoin @param {number|string} satoshi Amount of Satoshi to convert. Must be a whole number @throws {TypeError} Thrown if input is not a number or string @throws {TypeError} Thrown if input is not a whole number or string format whole number @returns {number}
[ "Convert", "Satoshi", "to", "Bitcoin" ]
bf3d74d4f58f0bc98c340f065937a786ce3cf86d
https://github.com/dawsbot/satoshi-bitcoin/blob/bf3d74d4f58f0bc98c340f065937a786ce3cf86d/index.js#L31-L47
41,044
dawsbot/satoshi-bitcoin
index.js
function(bitcoin) { //validate arg var bitcoinType = typeof bitcoin; if (bitcoinType === 'string') { bitcoin = toNumber(bitcoin); bitcoinType = 'number'; } if (bitcoinType !== 'number'){ throw new TypeError('toSatoshi must be called on a number or string, got ' + bitcoinType); ...
javascript
function(bitcoin) { //validate arg var bitcoinType = typeof bitcoin; if (bitcoinType === 'string') { bitcoin = toNumber(bitcoin); bitcoinType = 'number'; } if (bitcoinType !== 'number'){ throw new TypeError('toSatoshi must be called on a number or string, got ' + bitcoinType); ...
[ "function", "(", "bitcoin", ")", "{", "//validate arg", "var", "bitcoinType", "=", "typeof", "bitcoin", ";", "if", "(", "bitcoinType", "===", "'string'", ")", "{", "bitcoin", "=", "toNumber", "(", "bitcoin", ")", ";", "bitcoinType", "=", "'number'", ";", "...
Convert Bitcoin to Satoshi @param {number|string} bitcoin Amount of Bitcoin to convert @throws {TypeError} Thrown if input is not a number or string @returns {number}
[ "Convert", "Bitcoin", "to", "Satoshi" ]
bf3d74d4f58f0bc98c340f065937a786ce3cf86d
https://github.com/dawsbot/satoshi-bitcoin/blob/bf3d74d4f58f0bc98c340f065937a786ce3cf86d/index.js#L55-L68
41,045
akamai/akamai-gen-edgerc
src/cli-config.js
createArguments
function createArguments() { var cli = commandLineArgs([{ name: 'file', alias: 'f', type: String, defaultValue: "", description: "Full path to the credentials file.", required: true }, { name: 'section', alias: 's', type: String, defaultValue: "default", description: "Tit...
javascript
function createArguments() { var cli = commandLineArgs([{ name: 'file', alias: 'f', type: String, defaultValue: "", description: "Full path to the credentials file.", required: true }, { name: 'section', alias: 's', type: String, defaultValue: "default", description: "Tit...
[ "function", "createArguments", "(", ")", "{", "var", "cli", "=", "commandLineArgs", "(", "[", "{", "name", ":", "'file'", ",", "alias", ":", "'f'", ",", "type", ":", "String", ",", "defaultValue", ":", "\"\"", ",", "description", ":", "\"Full path to the c...
Create and return an instance of the CommandLineArgs object with the desired arguments specified.
[ "Create", "and", "return", "an", "instance", "of", "the", "CommandLineArgs", "object", "with", "the", "desired", "arguments", "specified", "." ]
12f522cc2d595a04af635a15046d0bd1ac3550b2
https://github.com/akamai/akamai-gen-edgerc/blob/12f522cc2d595a04af635a15046d0bd1ac3550b2/src/cli-config.js#L36-L63
41,046
Streampunk/ledger
model/Device.js
Device
function Device(id, version, label, type, node_id, senders, receivers) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * [Device type]{@link deviceTypes} URN. * @type {string} * @readonly */ this.type = this.generateType(ty...
javascript
function Device(id, version, label, type, node_id, senders, receivers) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * [Device type]{@link deviceTypes} URN. * @type {string} * @readonly */ this.type = this.generateType(ty...
[ "function", "Device", "(", "id", ",", "version", ",", "label", ",", "type", ",", "node_id", ",", "senders", ",", "receivers", ")", "{", "this", ".", "id", "=", "this", ".", "generateID", "(", "id", ")", ";", "this", ".", "version", "=", "this", "."...
Describes a Device. Immutable value. @constructor @augments Versionned @param {String} id Globally unique UUID identifier for the Device. @param {string} version String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) indicating precisely when an attribute of the resource las...
[ "Describes", "a", "Device", ".", "Immutable", "value", "." ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Device.js#L36-L66
41,047
DeMille/node-usbmux
lib/usbmux.js
pack
function pack(payload_obj) { var payload_plist = plist.build(payload_obj) , payload_buf = new Buffer(payload_plist); var header = { len: payload_buf.length + 16, version: 1, request: 8, tag: 1 }; var header_buf = new Buffer(16); header_buf.fill(0); header_buf.writ...
javascript
function pack(payload_obj) { var payload_plist = plist.build(payload_obj) , payload_buf = new Buffer(payload_plist); var header = { len: payload_buf.length + 16, version: 1, request: 8, tag: 1 }; var header_buf = new Buffer(16); header_buf.fill(0); header_buf.writ...
[ "function", "pack", "(", "payload_obj", ")", "{", "var", "payload_plist", "=", "plist", ".", "build", "(", "payload_obj", ")", ",", "payload_buf", "=", "new", "Buffer", "(", "payload_plist", ")", ";", "var", "header", "=", "{", "len", ":", "payload_buf", ...
Pack a request object into a buffer for usbmuxd @param {object} payload_obj @return {Buffer}
[ "Pack", "a", "request", "object", "into", "a", "buffer", "for", "usbmuxd" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/lib/usbmux.js#L98-L117
41,048
DeMille/node-usbmux
lib/usbmux.js
UsbmuxdError
function UsbmuxdError(message, number) { this.name = 'UsbmuxdError'; this.message = message; if (number) { this.number = number; this.message += ', Err #' + number; } if (number === 2) this.message += ": Device isn't connected"; if (number === 3) this.message += ": Port isn't available or open"; ...
javascript
function UsbmuxdError(message, number) { this.name = 'UsbmuxdError'; this.message = message; if (number) { this.number = number; this.message += ', Err #' + number; } if (number === 2) this.message += ": Device isn't connected"; if (number === 3) this.message += ": Port isn't available or open"; ...
[ "function", "UsbmuxdError", "(", "message", ",", "number", ")", "{", "this", ".", "name", "=", "'UsbmuxdError'", ";", "this", ".", "message", "=", "message", ";", "if", "(", "number", ")", "{", "this", ".", "number", "=", "number", ";", "this", ".", ...
Custom usbmuxd error There's no documentation for usbmuxd responses, but I think I've figured out these result numbers: 0 - Success 2 - Device requested isn't connected 3 - Port requested isn't available \ open 5 - Malformed request @param {string} message - Error message @param {integer} [number] - Error number gi...
[ "Custom", "usbmuxd", "error" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/lib/usbmux.js#L229-L240
41,049
DeMille/node-usbmux
lib/usbmux.js
createListener
function createListener() { var conn = net.connect(address) , req = protocol.listen; /** * Handle complete messages from usbmuxd * @function */ var parse = protocol.makeParser(function onMsgComplete(msg) { debug.listen('Response: \n%o', msg); // first response always acknowledges / denies t...
javascript
function createListener() { var conn = net.connect(address) , req = protocol.listen; /** * Handle complete messages from usbmuxd * @function */ var parse = protocol.makeParser(function onMsgComplete(msg) { debug.listen('Response: \n%o', msg); // first response always acknowledges / denies t...
[ "function", "createListener", "(", ")", "{", "var", "conn", "=", "net", ".", "connect", "(", "address", ")", ",", "req", "=", "protocol", ".", "listen", ";", "/**\n * Handle complete messages from usbmuxd\n * @function\n */", "var", "parse", "=", "protocol", ...
Connects to usbmuxd and listens for ios devices This connection stays open, listening as devices are plugged/unplugged and cant be upgraded into a tcp tunnel. You have to start a second connection with connect() to actually make tunnel. @return {net.Socket} - Socket with 2 bolted on events, attached & detached: Fire...
[ "Connects", "to", "usbmuxd", "and", "listens", "for", "ios", "devices" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/lib/usbmux.js#L264-L306
41,050
DeMille/node-usbmux
lib/usbmux.js
connect
function connect(deviceID, devicePort) { return Q.Promise(function(resolve, reject) { var conn = net.connect(address) , req = protocol.connect(deviceID, devicePort); /** * Handle complete messages from usbmuxd * @function */ var parse = protocol.makeParser(function onMsgComplete(msg)...
javascript
function connect(deviceID, devicePort) { return Q.Promise(function(resolve, reject) { var conn = net.connect(address) , req = protocol.connect(deviceID, devicePort); /** * Handle complete messages from usbmuxd * @function */ var parse = protocol.makeParser(function onMsgComplete(msg)...
[ "function", "connect", "(", "deviceID", ",", "devicePort", ")", "{", "return", "Q", ".", "Promise", "(", "function", "(", "resolve", ",", "reject", ")", "{", "var", "conn", "=", "net", ".", "connect", "(", "address", ")", ",", "req", "=", "protocol", ...
Connects to a device through usbmuxd for a tunneled tcp connection @param {string} deviceID - Target device's usbmuxd ID @param {integer} devicePort - Port on ios device to connect to @return {Q.promise} - resolves {net.Socket} - Tunneled tcp connection to device - rejects {Error}
[ "Connects", "to", "a", "device", "through", "usbmuxd", "for", "a", "tunneled", "tcp", "connection" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/lib/usbmux.js#L318-L348
41,051
DeMille/node-usbmux
lib/usbmux.js
Relay
function Relay(devicePort, relayPort, opts) { if (!(this instanceof Relay)) return new Relay(arguments); this._devicePort = devicePort; this._relayPort = relayPort; opts = opts || {}; this._udid = opts.udid; this._startListener(opts.timeout); this._startServer(); }
javascript
function Relay(devicePort, relayPort, opts) { if (!(this instanceof Relay)) return new Relay(arguments); this._devicePort = devicePort; this._relayPort = relayPort; opts = opts || {}; this._udid = opts.udid; this._startListener(opts.timeout); this._startServer(); }
[ "function", "Relay", "(", "devicePort", ",", "relayPort", ",", "opts", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Relay", ")", ")", "return", "new", "Relay", "(", "arguments", ")", ";", "this", ".", "_devicePort", "=", "devicePort", ";", "th...
Creates a new tcp relay to a port on connected usb device @constructor @param {integer} devicePort - Port to connect to on device @param {integer} relayPort - Local port that will listen as relay @param {object} [opts] - Options @param {integer} [opts.timeout=1000] - Search time (ms) b...
[ "Creates", "a", "new", "tcp", "relay", "to", "a", "port", "on", "connected", "usb", "device" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/lib/usbmux.js#L363-L374
41,052
layerhq/web-xdk
src/ui/adapters/angular.js
initAngular
function initAngular(angular) { // Define the layerXDKController const controllers = angular.module('layerXDKControllers', []); // Setup the properties for the given widget that is being generated function setupProps(scope, elem, attrs, props) { /* * For each property we are going to do the followin...
javascript
function initAngular(angular) { // Define the layerXDKController const controllers = angular.module('layerXDKControllers', []); // Setup the properties for the given widget that is being generated function setupProps(scope, elem, attrs, props) { /* * For each property we are going to do the followin...
[ "function", "initAngular", "(", "angular", ")", "{", "// Define the layerXDKController", "const", "controllers", "=", "angular", ".", "module", "(", "'layerXDKControllers'", ",", "[", "]", ")", ";", "// Setup the properties for the given widget that is being generated", "fu...
Call this function to initialize all of the angular 1.x directives needed to handle the Layer UI for Web widgets. When passing scope values/function into widget properties, prefix the property with `ng-`; for functions, replace `on-` with `ng-`. If passing in a literal, do NOT prefix with `ng-`: ``` <layer-notifier ...
[ "Call", "this", "function", "to", "initialize", "all", "of", "the", "angular", "1", ".", "x", "directives", "needed", "to", "handle", "the", "Layer", "UI", "for", "Web", "widgets", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/adapters/angular.js#L69-L145
41,053
layerhq/web-xdk
src/ui/adapters/angular.js
setupProps
function setupProps(scope, elem, attrs, props) { /* * For each property we are going to do the following: * * 1. See if there is an initial value * 2. Evaluate it against the scope via scope.$eval() so we have a resolved value * 3. $observe() for any changes in the property * 4. $watc...
javascript
function setupProps(scope, elem, attrs, props) { /* * For each property we are going to do the following: * * 1. See if there is an initial value * 2. Evaluate it against the scope via scope.$eval() so we have a resolved value * 3. $observe() for any changes in the property * 4. $watc...
[ "function", "setupProps", "(", "scope", ",", "elem", ",", "attrs", ",", "props", ")", "{", "/*\n * For each property we are going to do the following:\n *\n * 1. See if there is an initial value\n * 2. Evaluate it against the scope via scope.$eval() so we have a resolved valu...
Setup the properties for the given widget that is being generated
[ "Setup", "the", "properties", "for", "the", "given", "widget", "that", "is", "being", "generated" ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/adapters/angular.js#L75-L126
41,054
layerhq/web-xdk
src/ui/components/component.js
setupDomNodes
function setupDomNodes() { this.nodes = {}; this._findNodesWithin(this, (node, isComponent) => { const layerId = node.getAttribute && node.getAttribute('layer-id'); if (layerId) this.nodes[layerId] = node; if (isComponent) { if (!node.properties) node.properties = {}; node.pr...
javascript
function setupDomNodes() { this.nodes = {}; this._findNodesWithin(this, (node, isComponent) => { const layerId = node.getAttribute && node.getAttribute('layer-id'); if (layerId) this.nodes[layerId] = node; if (isComponent) { if (!node.properties) node.properties = {}; node.pr...
[ "function", "setupDomNodes", "(", ")", "{", "this", ".", "nodes", "=", "{", "}", ";", "this", ".", "_findNodesWithin", "(", "this", ",", "(", "node", ",", "isComponent", ")", "=>", "{", "const", "layerId", "=", "node", ".", "getAttribute", "&&", "node"...
The setupDomNodes method looks at all child nodes of this node that have layer-id properties and indexes them in the `nodes` property. Typically, this node has child nodes loaded via its template, and ready by the time your `created` method is called. This call is made on your behalf prior to calling `created`, but i...
[ "The", "setupDomNodes", "method", "looks", "at", "all", "child", "nodes", "of", "this", "node", "that", "have", "layer", "-", "id", "properties", "and", "indexes", "them", "in", "the", "nodes", "property", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1550-L1562
41,055
layerhq/web-xdk
src/ui/components/component.js
_findNodesWithin
function _findNodesWithin(node, callback) { const children = node.childNodes; for (let i = 0; i < children.length; i++) { const innerNode = children[i]; if (innerNode instanceof HTMLElement) { const isLUIComponent = Boolean(ComponentsHash[innerNode.tagName.toLowerCase()]); const resu...
javascript
function _findNodesWithin(node, callback) { const children = node.childNodes; for (let i = 0; i < children.length; i++) { const innerNode = children[i]; if (innerNode instanceof HTMLElement) { const isLUIComponent = Boolean(ComponentsHash[innerNode.tagName.toLowerCase()]); const resu...
[ "function", "_findNodesWithin", "(", "node", ",", "callback", ")", "{", "const", "children", "=", "node", ".", "childNodes", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "const", "innerNod...
Iterate over all child nodes generated by the template; skip all subcomponent's child nodes. If callback returns a value, then what is sought has been found; stop searching. The returned value is the return value for this function. If searching for ALL matches, do not return a value in your callback. @method _findN...
[ "Iterate", "over", "all", "child", "nodes", "generated", "by", "the", "template", ";", "skip", "all", "subcomponent", "s", "child", "nodes", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1579-L1595
41,056
layerhq/web-xdk
src/ui/components/component.js
getTemplate
function getTemplate() { const tagName = this.tagName.toLocaleLowerCase(); if (ComponentsHash[tagName].style) { const styleNode = document.createElement('style'); styleNode.id = 'style-' + this.tagName.toLowerCase(); styleNode.innerHTML = ComponentsHash[tagName].style; document.getEleme...
javascript
function getTemplate() { const tagName = this.tagName.toLocaleLowerCase(); if (ComponentsHash[tagName].style) { const styleNode = document.createElement('style'); styleNode.id = 'style-' + this.tagName.toLowerCase(); styleNode.innerHTML = ComponentsHash[tagName].style; document.getEleme...
[ "function", "getTemplate", "(", ")", "{", "const", "tagName", "=", "this", ".", "tagName", ".", "toLocaleLowerCase", "(", ")", ";", "if", "(", "ComponentsHash", "[", "tagName", "]", ".", "style", ")", "{", "const", "styleNode", "=", "document", ".", "cre...
Return the template for this Component. Get the default template: ``` var template = widget.getTemplate(); ``` Typical components should not need to call this; this will be called automatically prior to calling the Component's `created` method. Some components wanting to reset dom to initial state may use this metho...
[ "Return", "the", "template", "for", "this", "Component", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1620-L1631
41,057
layerhq/web-xdk
src/ui/components/component.js
trigger
function trigger(eventName, details) { const evt = new CustomEvent(eventName, { detail: details, bubbles: true, cancelable: true, }); this.dispatchEvent(evt); return !evt.defaultPrevented; }
javascript
function trigger(eventName, details) { const evt = new CustomEvent(eventName, { detail: details, bubbles: true, cancelable: true, }); this.dispatchEvent(evt); return !evt.defaultPrevented; }
[ "function", "trigger", "(", "eventName", ",", "details", ")", "{", "const", "evt", "=", "new", "CustomEvent", "(", "eventName", ",", "{", "detail", ":", "details", ",", "bubbles", ":", "true", ",", "cancelable", ":", "true", ",", "}", ")", ";", "this",...
Triggers a dom level event which bubbles up the dom. Call with an event name and a `detail` object: ``` this.trigger('something-happened', { someSortOf: 'value' }); ``` The `someSortOf` key, and any other keys you pass into that object can be accessed via `evt.detail.someSortOf` or `evt.detail.xxxx`: ``` // Listen ...
[ "Triggers", "a", "dom", "level", "event", "which", "bubbles", "up", "the", "dom", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1680-L1688
41,058
layerhq/web-xdk
src/ui/components/component.js
toggleClass
function toggleClass(...args) { const cssClass = args[0]; const enable = (args.length === 2) ? args[1] : !this.classList.contains(cssClass); this.classList[enable ? 'add' : 'remove'](cssClass); }
javascript
function toggleClass(...args) { const cssClass = args[0]; const enable = (args.length === 2) ? args[1] : !this.classList.contains(cssClass); this.classList[enable ? 'add' : 'remove'](cssClass); }
[ "function", "toggleClass", "(", "...", "args", ")", "{", "const", "cssClass", "=", "args", "[", "0", "]", ";", "const", "enable", "=", "(", "args", ".", "length", "===", "2", ")", "?", "args", "[", "1", "]", ":", "!", "this", ".", "classList", "....
Toggle a CSS Class. Why do we have this? Well, sadly as long as we support IE11 which has an incorrect implementation of node.classList.toggle, we will have to do this ourselves. @method toggleClass @param {String} className @param {Boolean} [enable=!enable]
[ "Toggle", "a", "CSS", "Class", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1714-L1718
41,059
layerhq/web-xdk
src/ui/components/component.js
createElement
function createElement(tagName, properties) { const node = document.createElement(tagName); node.parentComponent = this; const ignore = ['parentNode', 'name', 'classList', 'noCreate']; Object.keys(properties).forEach((propName) => { if (ignore.indexOf(propName) === -1) node[propName] = properties...
javascript
function createElement(tagName, properties) { const node = document.createElement(tagName); node.parentComponent = this; const ignore = ['parentNode', 'name', 'classList', 'noCreate']; Object.keys(properties).forEach((propName) => { if (ignore.indexOf(propName) === -1) node[propName] = properties...
[ "function", "createElement", "(", "tagName", ",", "properties", ")", "{", "const", "node", "=", "document", ".", "createElement", "(", "tagName", ")", ";", "node", ".", "parentComponent", "=", "this", ";", "const", "ignore", "=", "[", "'parentNode'", ",", ...
Shorthand for `document.createElement` followed by a bunch of standard setup. ``` var avatar = this.createElement({ name: "myavatar", size: "large", users: [client.user], parentNode: this.nodes.avatarContainer }); console.log(avatar === this.nodes.myavatar); // returns true ``` TODO: Most `document.createElement` cal...
[ "Shorthand", "for", "document", ".", "createElement", "followed", "by", "a", "bunch", "of", "standard", "setup", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L1746-L1763
41,060
layerhq/web-xdk
src/ui/components/component.js
destroy
function destroy() { if (this.properties._internalState.onDestroyCalled) return; if (this.parentNode) { this.parentNode.removeChild(this); } Object.keys(this.nodes || {}).forEach((name) => { if (this.nodes[name] && this.nodes[name].destroy) this.nodes[name].destroy(); }); this.onDest...
javascript
function destroy() { if (this.properties._internalState.onDestroyCalled) return; if (this.parentNode) { this.parentNode.removeChild(this); } Object.keys(this.nodes || {}).forEach((name) => { if (this.nodes[name] && this.nodes[name].destroy) this.nodes[name].destroy(); }); this.onDest...
[ "function", "destroy", "(", ")", "{", "if", "(", "this", ".", "properties", ".", "_internalState", ".", "onDestroyCalled", ")", "return", ";", "if", "(", "this", ".", "parentNode", ")", "{", "this", ".", "parentNode", ".", "removeChild", "(", "this", ")"...
Call this to destroy the UI Component. Destroying will cause it to be removed from its parent node, it will call destroy on all child nodes, and then call the {@link #onDestroy} method. > *Note* > > destroy is called to remove a component, but it is not a lifecycle method; a component that has been removed > from the...
[ "Call", "this", "to", "destroy", "the", "UI", "Component", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L2078-L2087
41,061
layerhq/web-xdk
src/ui/components/component.js
_registerAll
function _registerAll() { if (!registerAllCalled) { registerAllCalled = true; Object.keys(ComponentsHash) .filter(tagName => typeof ComponentsHash[tagName] !== 'function') .forEach(tagName => _registerComponent(tagName)); } }
javascript
function _registerAll() { if (!registerAllCalled) { registerAllCalled = true; Object.keys(ComponentsHash) .filter(tagName => typeof ComponentsHash[tagName] !== 'function') .forEach(tagName => _registerComponent(tagName)); } }
[ "function", "_registerAll", "(", ")", "{", "if", "(", "!", "registerAllCalled", ")", "{", "registerAllCalled", "=", "true", ";", "Object", ".", "keys", "(", "ComponentsHash", ")", ".", "filter", "(", "tagName", "=>", "typeof", "ComponentsHash", "[", "tagName...
Registers all defined components with the browser as WebComponents. This is called by `Layer.init()` and should not be called directly. @private @method _registerAll
[ "Registers", "all", "defined", "components", "with", "the", "browser", "as", "WebComponents", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/component.js#L2137-L2144
41,062
layerhq/web-xdk
src/ui/components/layer-message-list/layer-message-item-mixin.js
onRender
function onRender() { try { // Setup the layer-sender-name if (this.nodes.sender) { this.nodes.sender.innerHTML = this.item.sender.displayName; } if (this.nodes.avatar) { this.nodes.avatar.users = [this.item.sender]; } // Setup the layer-date ...
javascript
function onRender() { try { // Setup the layer-sender-name if (this.nodes.sender) { this.nodes.sender.innerHTML = this.item.sender.displayName; } if (this.nodes.avatar) { this.nodes.avatar.users = [this.item.sender]; } // Setup the layer-date ...
[ "function", "onRender", "(", ")", "{", "try", "{", "// Setup the layer-sender-name", "if", "(", "this", ".", "nodes", ".", "sender", ")", "{", "this", ".", "nodes", ".", "sender", ".", "innerHTML", "=", "this", ".", "item", ".", "sender", ".", "displayNa...
Lifecycle method sets up the Message to render
[ "Lifecycle", "method", "sets", "up", "the", "Message", "to", "render" ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/ui/components/layer-message-list/layer-message-item-mixin.js#L237-L273
41,063
Streampunk/ledger
model/Versionned.js
Versionned
function Versionned(id, version, label) { /** * Globally unique UUID identifier for the resource. * @type {string} * @readonly */ this.id = this.generateID(id); /** * String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) * indicating precisely when an attribute o...
javascript
function Versionned(id, version, label) { /** * Globally unique UUID identifier for the resource. * @type {string} * @readonly */ this.id = this.generateID(id); /** * String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) * indicating precisely when an attribute o...
[ "function", "Versionned", "(", "id", ",", "version", ",", "label", ")", "{", "/**\n * Globally unique UUID identifier for the resource.\n * @type {string}\n * @readonly\n */", "this", ".", "id", "=", "this", ".", "generateID", "(", "id", ")", ";", "/**\n * Strin...
Supertype of every class that has UUID identity, version numbers and labels. Methods are designed to be mixed in piecemeal as required. @constructor @param {string} id Globally unique UUID identifier for the resource. @param {string} version String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseco...
[ "Supertype", "of", "every", "class", "that", "has", "UUID", "identity", "version", "numbers", "and", "labels", ".", "Methods", "are", "designed", "to", "be", "mixed", "in", "piecemeal", "as", "required", "." ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Versionned.js#L41-L62
41,064
layerhq/web-xdk
src/core/root.js
initClass
function initClass(newClass, className, namespace) { // Make sure our new class has a name property try { if (newClass.name !== className) newClass.altName = className; } catch (e) { // No-op } // Make sure our new class has a _supportedEvents, _ignoredEvents, _inObjectIgnore and EVENTS properties ...
javascript
function initClass(newClass, className, namespace) { // Make sure our new class has a name property try { if (newClass.name !== className) newClass.altName = className; } catch (e) { // No-op } // Make sure our new class has a _supportedEvents, _ignoredEvents, _inObjectIgnore and EVENTS properties ...
[ "function", "initClass", "(", "newClass", ",", "className", ",", "namespace", ")", "{", "// Make sure our new class has a name property", "try", "{", "if", "(", "newClass", ".", "name", "!==", "className", ")", "newClass", ".", "altName", "=", "className", ";", ...
Initialize a class definition that is a subclass of Root. ``` class myClass extends Root { } Root.initClass(myClass, 'myClass'); console.log(Layer.Core.myClass); ``` With namespace: ``` const MyNameSpace = {}; class myClass extends Root { } Root.initClass(myClass, 'myClass', MyNameSpace); console.log(MyNameSpace.myCl...
[ "Initialize", "a", "class", "definition", "that", "is", "a", "subclass", "of", "Root", "." ]
a2d61e62d22db6511c2920e7989ba2afb4dad274
https://github.com/layerhq/web-xdk/blob/a2d61e62d22db6511c2920e7989ba2afb4dad274/src/core/root.js#L661-L703
41,065
Streampunk/ledger
model/Receiver.js
Receiver
function Receiver(id, version, label, description, format, caps, tags, device_id, transport, subscription) { // Globally unique identifier for the Receiver this.id = this.generateID(id); // String formatted PTP timestamp (<seconds>:<nanoseconds>) indicating // precisely when an attribute of the resource...
javascript
function Receiver(id, version, label, description, format, caps, tags, device_id, transport, subscription) { // Globally unique identifier for the Receiver this.id = this.generateID(id); // String formatted PTP timestamp (<seconds>:<nanoseconds>) indicating // precisely when an attribute of the resource...
[ "function", "Receiver", "(", "id", ",", "version", ",", "label", ",", "description", ",", "format", ",", "caps", ",", "tags", ",", "device_id", ",", "transport", ",", "subscription", ")", "{", "// Globally unique identifier for the Receiver\r", "this", ".", "id...
Describes a receiver
[ "Describes", "a", "receiver" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Receiver.js#L21-L47
41,066
Streampunk/ledger
api/NodeAPI.js
registerResources
function registerResources(rs) { registerPromise = registerPromise.then(() => { return Promise.all(rs.map((r) => { return Promise.denodeify(pushResource)(r); })); }); }
javascript
function registerResources(rs) { registerPromise = registerPromise.then(() => { return Promise.all(rs.map((r) => { return Promise.denodeify(pushResource)(r); })); }); }
[ "function", "registerResources", "(", "rs", ")", "{", "registerPromise", "=", "registerPromise", ".", "then", "(", "(", ")", "=>", "{", "return", "Promise", ".", "all", "(", "rs", ".", "map", "(", "(", "r", ")", "=>", "{", "return", "Promise", ".", "...
only use registerResources for independent resources
[ "only", "use", "registerResources", "for", "independent", "resources" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/api/NodeAPI.js#L680-L684
41,067
DeMille/node-usbmux
bin/cli.js
info
function info() { if (argv.verbose !== 1) return; var args = Array.prototype.slice.call(arguments); if (!args[args.length-1]) args.pop(); // if last arg is undefined, remove it console.log.apply(console, args); }
javascript
function info() { if (argv.verbose !== 1) return; var args = Array.prototype.slice.call(arguments); if (!args[args.length-1]) args.pop(); // if last arg is undefined, remove it console.log.apply(console, args); }
[ "function", "info", "(", ")", "{", "if", "(", "argv", ".", "verbose", "!==", "1", ")", "return", ";", "var", "args", "=", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ")", ";", "if", "(", "!", "args", "[", "args", ".", ...
Shows debugging info only for verbosity = 1 @param {*...} arguments
[ "Shows", "debugging", "info", "only", "for", "verbosity", "=", "1" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/bin/cli.js#L32-L37
41,068
DeMille/node-usbmux
bin/cli.js
onErr
function onErr(err) { // local port is in use if (err.code === 'EADDRINUSE') { panic('Local port is in use \nFailing...'); } // usbmux not there if (err.code === 'ECONNREFUSED' || err.code === 'EADDRNOTAVAIL') { panic('Usbmuxd not found at', usbmux.address, '\nFailing...'); } // other panic('%s ...
javascript
function onErr(err) { // local port is in use if (err.code === 'EADDRINUSE') { panic('Local port is in use \nFailing...'); } // usbmux not there if (err.code === 'ECONNREFUSED' || err.code === 'EADDRNOTAVAIL') { panic('Usbmuxd not found at', usbmux.address, '\nFailing...'); } // other panic('%s ...
[ "function", "onErr", "(", "err", ")", "{", "// local port is in use", "if", "(", "err", ".", "code", "===", "'EADDRINUSE'", ")", "{", "panic", "(", "'Local port is in use \\nFailing...'", ")", ";", "}", "// usbmux not there", "if", "(", "err", ".", "code", "==...
Error handler for listener and relay @param {Error} err
[ "Error", "handler", "for", "listener", "and", "relay" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/bin/cli.js#L54-L65
41,069
DeMille/node-usbmux
bin/cli.js
listenForDevices
function listenForDevices() { console.log('Listening for connected devices... \n'); usbmux.createListener() .on('error', onErr) .on('attached', function(udid) { console.log('Device found: ', udid); }) .on('detached', function(udid) { console.log('Device removed: ', udid); }); }
javascript
function listenForDevices() { console.log('Listening for connected devices... \n'); usbmux.createListener() .on('error', onErr) .on('attached', function(udid) { console.log('Device found: ', udid); }) .on('detached', function(udid) { console.log('Device removed: ', udid); }); }
[ "function", "listenForDevices", "(", ")", "{", "console", ".", "log", "(", "'Listening for connected devices... \\n'", ")", ";", "usbmux", ".", "createListener", "(", ")", ".", "on", "(", "'error'", ",", "onErr", ")", ".", "on", "(", "'attached'", ",", "func...
Listen for and report connected devices
[ "Listen", "for", "and", "report", "connected", "devices" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/bin/cli.js#L70-L81
41,070
DeMille/node-usbmux
bin/cli.js
startRelay
function startRelay(portPair) { var devicePort = portPair[0] , relayPort = portPair[1]; console.log('Starting relay from local port: %s -> device port: %s', relayPort, devicePort); new usbmux.Relay(devicePort, relayPort, {udid: argv.udid}) .on('error', onErr) .on('warning', console.log.bind(cons...
javascript
function startRelay(portPair) { var devicePort = portPair[0] , relayPort = portPair[1]; console.log('Starting relay from local port: %s -> device port: %s', relayPort, devicePort); new usbmux.Relay(devicePort, relayPort, {udid: argv.udid}) .on('error', onErr) .on('warning', console.log.bind(cons...
[ "function", "startRelay", "(", "portPair", ")", "{", "var", "devicePort", "=", "portPair", "[", "0", "]", ",", "relayPort", "=", "portPair", "[", "1", "]", ";", "console", ".", "log", "(", "'Starting relay from local port: %s -> device port: %s'", ",", "relayPor...
Start a new relay from a pair of given ports @param {integer[]} portPair - [devicePort, relayPort]
[ "Start", "a", "new", "relay", "from", "a", "pair", "of", "given", "ports" ]
54cafd659947d3c7761e4498392a49ad73c2ad60
https://github.com/DeMille/node-usbmux/blob/54cafd659947d3c7761e4498392a49ad73c2ad60/bin/cli.js#L111-L127
41,071
Streampunk/ledger
model/Source.js
Source
function Source(id, version, label, description, format, caps, tags, device_id, parents) { // Globally unique identifier for the Source this.id = this.generateID(id); // String formatted PTP timestamp (<seconds>:<nanoseconds>) indicating // precisely when an attribute of the resource last changed ...
javascript
function Source(id, version, label, description, format, caps, tags, device_id, parents) { // Globally unique identifier for the Source this.id = this.generateID(id); // String formatted PTP timestamp (<seconds>:<nanoseconds>) indicating // precisely when an attribute of the resource last changed ...
[ "function", "Source", "(", "id", ",", "version", ",", "label", ",", "description", ",", "format", ",", "caps", ",", "tags", ",", "device_id", ",", "parents", ")", "{", "// Globally unique identifier for the Source\r", "this", ".", "id", "=", "this", ".", "ge...
Describes a source
[ "Describes", "a", "source" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Source.js#L21-L46
41,072
Streampunk/ledger
api/RegistrationAPI.js
validStore
function validStore(store) { return store && typeof store.getNodes === 'function' && typeof store.getNode === 'function' && typeof store.getDevices === 'function' && typeof store.getDevice === 'function' && typeof store.getSources === 'function' && typeof store.getSource =...
javascript
function validStore(store) { return store && typeof store.getNodes === 'function' && typeof store.getNode === 'function' && typeof store.getDevices === 'function' && typeof store.getDevice === 'function' && typeof store.getSources === 'function' && typeof store.getSource =...
[ "function", "validStore", "(", "store", ")", "{", "return", "store", "&&", "typeof", "store", ".", "getNodes", "===", "'function'", "&&", "typeof", "store", ".", "getNode", "===", "'function'", "&&", "typeof", "store", ".", "getDevices", "===", "'function'", ...
Check that a store has a sufficient contract for this API
[ "Check", "that", "a", "store", "has", "a", "sufficient", "contract", "for", "this", "API" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/api/RegistrationAPI.js#L460-L475
41,073
Streampunk/ledger
api/NodeRAMStore.js
checkSkip
function checkSkip (skip, keys) { if (skip && typeof skip === 'string') skip = +skip; if (!skip || Number(skip) !== skip || skip % 1 !== 0 || skip < 0) skip = 0; if (skip > keys.length) skip = keys.length; return skip; }
javascript
function checkSkip (skip, keys) { if (skip && typeof skip === 'string') skip = +skip; if (!skip || Number(skip) !== skip || skip % 1 !== 0 || skip < 0) skip = 0; if (skip > keys.length) skip = keys.length; return skip; }
[ "function", "checkSkip", "(", "skip", ",", "keys", ")", "{", "if", "(", "skip", "&&", "typeof", "skip", "===", "'string'", ")", "skip", "=", "+", "skip", ";", "if", "(", "!", "skip", "||", "Number", "(", "skip", ")", "!==", "skip", "||", "skip", ...
Check that the skip parameter is withing range, or set defaults
[ "Check", "that", "the", "skip", "parameter", "is", "withing", "range", "or", "set", "defaults" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/api/NodeRAMStore.js#L34-L41
41,074
Streampunk/ledger
api/NodeRAMStore.js
checkLimit
function checkLimit (limit, keys) { if (limit && typeof limit === 'string') limit = +limit; if (!limit || Number(limit) !== limit || limit % 1 !== 0 || limit > keys.length) limit = keys.length; if (limit < 0) limit = 0; return limit; }
javascript
function checkLimit (limit, keys) { if (limit && typeof limit === 'string') limit = +limit; if (!limit || Number(limit) !== limit || limit % 1 !== 0 || limit > keys.length) limit = keys.length; if (limit < 0) limit = 0; return limit; }
[ "function", "checkLimit", "(", "limit", ",", "keys", ")", "{", "if", "(", "limit", "&&", "typeof", "limit", "===", "'string'", ")", "limit", "=", "+", "limit", ";", "if", "(", "!", "limit", "||", "Number", "(", "limit", ")", "!==", "limit", "||", "...
Check that the limit parameter is withing range, or set defaults
[ "Check", "that", "the", "limit", "parameter", "is", "withing", "range", "or", "set", "defaults" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/api/NodeRAMStore.js#L44-L51
41,075
Streampunk/ledger
api/NodeRAMStore.js
getCollection
function getCollection(items, query, cb, argsLength) { var skip = 0, limit = Number.MAX_SAFE_INTEGER; setImmediate(function() { if (argsLength === 1) { cb = query; } else { skip = (query.skip) ? query.skip : 0; limit = (query.limit) ? query.limit : Number.MAX_SAFE_INTEGER; } var so...
javascript
function getCollection(items, query, cb, argsLength) { var skip = 0, limit = Number.MAX_SAFE_INTEGER; setImmediate(function() { if (argsLength === 1) { cb = query; } else { skip = (query.skip) ? query.skip : 0; limit = (query.limit) ? query.limit : Number.MAX_SAFE_INTEGER; } var so...
[ "function", "getCollection", "(", "items", ",", "query", ",", "cb", ",", "argsLength", ")", "{", "var", "skip", "=", "0", ",", "limit", "=", "Number", ".", "MAX_SAFE_INTEGER", ";", "setImmediate", "(", "function", "(", ")", "{", "if", "(", "argsLength", ...
Generic get collection methods that returns an ordered sequence of items
[ "Generic", "get", "collection", "methods", "that", "returns", "an", "ordered", "sequence", "of", "items" ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/api/NodeRAMStore.js#L68-L103
41,076
Streampunk/ledger
model/Node.js
Node
function Node(id, version, label, href, hostname, caps, services) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * HTTP access href for the Node's API. * @type {string} * @readonly */ this.href = this.generateHref(...
javascript
function Node(id, version, label, href, hostname, caps, services) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * HTTP access href for the Node's API. * @type {string} * @readonly */ this.href = this.generateHref(...
[ "function", "Node", "(", "id", ",", "version", ",", "label", ",", "href", ",", "hostname", ",", "caps", ",", "services", ")", "{", "this", ".", "id", "=", "this", ".", "generateID", "(", "id", ")", ";", "this", ".", "version", "=", "this", ".", "...
Describes a Node. Immutable value. @constructor @augments Versionned @param {string} id Globally unique UUID identifier for the Node. @param {string} version String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) indicating precisely when an attribute of the resource last changed....
[ "Describes", "a", "Node", ".", "Immutable", "value", "." ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Node.js#L37-L66
41,077
Streampunk/ledger
model/Flow.js
Flow
function Flow(id, version, label, description, format, tags, source_id, parents) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * Detailed description of the Flow. * @type {string} * @readonly */ this.descrip...
javascript
function Flow(id, version, label, description, format, tags, source_id, parents) { this.id = this.generateID(id); this.version = this.generateVersion(version); this.label = this.generateLabel(label); /** * Detailed description of the Flow. * @type {string} * @readonly */ this.descrip...
[ "function", "Flow", "(", "id", ",", "version", ",", "label", ",", "description", ",", "format", ",", "tags", ",", "source_id", ",", "parents", ")", "{", "this", ".", "id", "=", "this", ".", "generateID", "(", "id", ")", ";", "this", ".", "version", ...
Describes a Flow Describes a Flow. Immutable value. @constructor @augments Versionned @param {string} id Globally unique UUID identifier for the Flow. @param {string} version String formatted PTP timestamp (&lt;<em>seconds</em>&gt;:&lt;<em>nanoseconds</em>&gt;) indicating precisely when an attribute of th...
[ "Describes", "a", "Flow", "Describes", "a", "Flow", ".", "Immutable", "value", "." ]
561ee93e15e8620d505bfcddfbe357375f5d0e07
https://github.com/Streampunk/ledger/blob/561ee93e15e8620d505bfcddfbe357375f5d0e07/model/Flow.js#L42-L79
41,078
SINTEF-9012/Proto2TypeScript
command.js
generateNames
function generateNames(model, prefix, name) { if (name === void 0) { name = ""; } model.fullPackageName = prefix + (name != "." ? name : ""); // Copies the settings (I'm lazy) model.properties = argv.properties; model.explicitRequired = argv.explicitRequired; model.camelCaseProperties = argv.cam...
javascript
function generateNames(model, prefix, name) { if (name === void 0) { name = ""; } model.fullPackageName = prefix + (name != "." ? name : ""); // Copies the settings (I'm lazy) model.properties = argv.properties; model.explicitRequired = argv.explicitRequired; model.camelCaseProperties = argv.cam...
[ "function", "generateNames", "(", "model", ",", "prefix", ",", "name", ")", "{", "if", "(", "name", "===", "void", "0", ")", "{", "name", "=", "\"\"", ";", "}", "model", ".", "fullPackageName", "=", "prefix", "+", "(", "name", "!=", "\".\"", "?", "...
Generate the names for the model, the types, and the interfaces
[ "Generate", "the", "names", "for", "the", "model", "the", "types", "and", "the", "interfaces" ]
d96cfd3dc7afcdbea86114cefca1a761fe0d59ca
https://github.com/SINTEF-9012/Proto2TypeScript/blob/d96cfd3dc7afcdbea86114cefca1a761fe0d59ca/command.js#L83-L127
41,079
elsehow/signal-protocol
src/curve25519_wrapper.js
_allocate
function _allocate(bytes) { var address = Module._malloc(bytes.length); Module.HEAPU8.set(bytes, address); return address; }
javascript
function _allocate(bytes) { var address = Module._malloc(bytes.length); Module.HEAPU8.set(bytes, address); return address; }
[ "function", "_allocate", "(", "bytes", ")", "{", "var", "address", "=", "Module", ".", "_malloc", "(", "bytes", ".", "length", ")", ";", "Module", ".", "HEAPU8", ".", "set", "(", "bytes", ",", "address", ")", ";", "return", "address", ";", "}" ]
Insert some bytes into the emscripten memory and return a pointer
[ "Insert", "some", "bytes", "into", "the", "emscripten", "memory", "and", "return", "a", "pointer" ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/src/curve25519_wrapper.js#L7-L12
41,080
elsehow/signal-protocol
build/curve25519_compiled.js
doRun
function doRun() { if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening Module['calledRun'] = true; if (ABORT) return; ensureInitRuntime(); preMain(); if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); i...
javascript
function doRun() { if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening Module['calledRun'] = true; if (ABORT) return; ensureInitRuntime(); preMain(); if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); i...
[ "function", "doRun", "(", ")", "{", "if", "(", "Module", "[", "'calledRun'", "]", ")", "return", ";", "// run may have just been called while the async setStatus time below was happening", "Module", "[", "'calledRun'", "]", "=", "true", ";", "if", "(", "ABORT", ")",...
run may have just been called through dependencies being fulfilled just in this very frame
[ "run", "may", "have", "just", "been", "called", "through", "dependencies", "being", "fulfilled", "just", "in", "this", "very", "frame" ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/curve25519_compiled.js#L20596-L20612
41,081
doublemarked/loopback-console
repl.js
wrapReplEval
function wrapReplEval(replServer) { const defaultEval = replServer.eval; return function(code, context, file, cb) { return defaultEval.call(this, code, context, file, (err, result) => { if (!result || !result.then) { return cb(err, result); } result.then(resolved => { resolve...
javascript
function wrapReplEval(replServer) { const defaultEval = replServer.eval; return function(code, context, file, cb) { return defaultEval.call(this, code, context, file, (err, result) => { if (!result || !result.then) { return cb(err, result); } result.then(resolved => { resolve...
[ "function", "wrapReplEval", "(", "replServer", ")", "{", "const", "defaultEval", "=", "replServer", ".", "eval", ";", "return", "function", "(", "code", ",", "context", ",", "file", ",", "cb", ")", "{", "return", "defaultEval", ".", "call", "(", "this", ...
Wrap the default eval with a handler that resolves promises
[ "Wrap", "the", "default", "eval", "with", "a", "handler", "that", "resolves", "promises" ]
b3259ad6bd79ef9c529ca07b2a72bf998925cff4
https://github.com/doublemarked/loopback-console/blob/b3259ad6bd79ef9c529ca07b2a72bf998925cff4/repl.js#L101-L135
41,082
TheRoSS/mongodb-autoincrement
index.js
getNextId
function getNextId(db, collectionName, fieldName, callback) { if (typeof fieldName == "function") { callback = fieldName; fieldName = null; } fieldName = fieldName || getOption(collectionName, "field"); var collection = db.collection(defaultSettings.collection); var step = getOption...
javascript
function getNextId(db, collectionName, fieldName, callback) { if (typeof fieldName == "function") { callback = fieldName; fieldName = null; } fieldName = fieldName || getOption(collectionName, "field"); var collection = db.collection(defaultSettings.collection); var step = getOption...
[ "function", "getNextId", "(", "db", ",", "collectionName", ",", "fieldName", ",", "callback", ")", "{", "if", "(", "typeof", "fieldName", "==", "\"function\"", ")", "{", "callback", "=", "fieldName", ";", "fieldName", "=", "null", ";", "}", "fieldName", "=...
Get next auto increment index for the given collection @param {MongodbNativeDriver} db @param {String} collectionName @param {String} [fieldName] @param {Function} callback
[ "Get", "next", "auto", "increment", "index", "for", "the", "given", "collection" ]
b36f0a172cc17b7d1bc0bfaa9ee48a7a57c30803
https://github.com/TheRoSS/mongodb-autoincrement/blob/b36f0a172cc17b7d1bc0bfaa9ee48a7a57c30803/index.js#L102-L133
41,083
elsehow/signal-protocol
build/components_concat.js
mkNumber
function mkNumber(val) { var sign = 1; if (val.charAt(0) == '-') { sign = -1; val = val.substring(1); } if (Lang.NUMBER_DEC.test(val)) return sign * parseInt(val, 10); else if (Lang.NUMBER_HEX.test(val)) ...
javascript
function mkNumber(val) { var sign = 1; if (val.charAt(0) == '-') { sign = -1; val = val.substring(1); } if (Lang.NUMBER_DEC.test(val)) return sign * parseInt(val, 10); else if (Lang.NUMBER_HEX.test(val)) ...
[ "function", "mkNumber", "(", "val", ")", "{", "var", "sign", "=", "1", ";", "if", "(", "val", ".", "charAt", "(", "0", ")", "==", "'-'", ")", "{", "sign", "=", "-", "1", ";", "val", "=", "val", ".", "substring", "(", "1", ")", ";", "}", "if...
Converts a numerical string to a number. @param {string} val @returns {number} @inner
[ "Converts", "a", "numerical", "string", "to", "a", "number", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L5340-L5359
41,084
elsehow/signal-protocol
build/components_concat.js
setOption
function setOption(options, name, value) { if (typeof options[name] === 'undefined') options[name] = value; else { if (!Array.isArray(options[name])) options[name] = [ options[name] ]; options[name].push(value); ...
javascript
function setOption(options, name, value) { if (typeof options[name] === 'undefined') options[name] = value; else { if (!Array.isArray(options[name])) options[name] = [ options[name] ]; options[name].push(value); ...
[ "function", "setOption", "(", "options", ",", "name", ",", "value", ")", "{", "if", "(", "typeof", "options", "[", "name", "]", "===", "'undefined'", ")", "options", "[", "name", "]", "=", "value", ";", "else", "{", "if", "(", "!", "Array", ".", "i...
Sets an option on the specified options object. @param {!Object.<string,*>} options @param {string} name @param {string|number|boolean} value @inner
[ "Sets", "an", "option", "on", "the", "specified", "options", "object", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L5447-L5455
41,085
elsehow/signal-protocol
build/components_concat.js
function(builder, parent, name) { /** * Builder reference. * @type {!ProtoBuf.Builder} * @expose */ this.builder = builder; /** * Parent object. * @type {?ProtoBuf.Reflect.T} * @e...
javascript
function(builder, parent, name) { /** * Builder reference. * @type {!ProtoBuf.Builder} * @expose */ this.builder = builder; /** * Parent object. * @type {?ProtoBuf.Reflect.T} * @e...
[ "function", "(", "builder", ",", "parent", ",", "name", ")", "{", "/**\r\n * Builder reference.\r\n * @type {!ProtoBuf.Builder}\r\n * @expose\r\n */", "this", ".", "builder", "=", "builder", ";", "/**\r\n * Parent object.\r\...
Constructs a Reflect base class. @exports ProtoBuf.Reflect.T @constructor @abstract @param {!ProtoBuf.Builder} builder Builder reference @param {?ProtoBuf.Reflect.T} parent Parent object @param {string} name Object name
[ "Constructs", "a", "Reflect", "base", "class", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L5910-L5939
41,086
elsehow/signal-protocol
build/components_concat.js
function(builder, parent, name, options, syntax) { T.call(this, builder, parent, name); /** * @override */ this.className = "Namespace"; /** * Children inside the namespace. * @type {!Array.<ProtoBuf.Reflect....
javascript
function(builder, parent, name, options, syntax) { T.call(this, builder, parent, name); /** * @override */ this.className = "Namespace"; /** * Children inside the namespace. * @type {!Array.<ProtoBuf.Reflect....
[ "function", "(", "builder", ",", "parent", ",", "name", ",", "options", ",", "syntax", ")", "{", "T", ".", "call", "(", "this", ",", "builder", ",", "parent", ",", "name", ")", ";", "/**\r\n * @override\r\n */", "this", ".", "classNam...
Constructs a new Namespace. @exports ProtoBuf.Reflect.Namespace @param {!ProtoBuf.Builder} builder Builder reference @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent @param {string} name Namespace name @param {Object.<string,*>=} options Namespace options @param {string?} syntax The syntax level of this def...
[ "Constructs", "a", "new", "Namespace", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L6000-L6025
41,087
elsehow/signal-protocol
build/components_concat.js
function(type, resolvedType, isMapKey, syntax) { /** * Element type, as a string (e.g., int32). * @type {{name: string, wireType: number}} */ this.type = type; /** * Element type reference to submessage or enum definition...
javascript
function(type, resolvedType, isMapKey, syntax) { /** * Element type, as a string (e.g., int32). * @type {{name: string, wireType: number}} */ this.type = type; /** * Element type reference to submessage or enum definition...
[ "function", "(", "type", ",", "resolvedType", ",", "isMapKey", ",", "syntax", ")", "{", "/**\r\n * Element type, as a string (e.g., int32).\r\n * @type {{name: string, wireType: number}}\r\n */", "this", ".", "type", "=", "type", ";", "/**\r\n ...
Constructs a new Element implementation that checks and converts values for a particular field type, as appropriate. An Element represents a single value: either the value of a singular field, or a value contained in one entry of a repeated field or map field. This class does not implement these higher-level concepts;...
[ "Constructs", "a", "new", "Element", "implementation", "that", "checks", "and", "converts", "values", "for", "a", "particular", "field", "type", "as", "appropriate", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L6218-L6246
41,088
elsehow/signal-protocol
build/components_concat.js
mkLong
function mkLong(value, unsigned) { if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' && value.low === value.low && value.high === value.high) return new ProtoBuf.Long(value.low, value.high, typeof unsigned =...
javascript
function mkLong(value, unsigned) { if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean' && value.low === value.low && value.high === value.high) return new ProtoBuf.Long(value.low, value.high, typeof unsigned =...
[ "function", "mkLong", "(", "value", ",", "unsigned", ")", "{", "if", "(", "value", "&&", "typeof", "value", ".", "low", "===", "'number'", "&&", "typeof", "value", ".", "high", "===", "'number'", "&&", "typeof", "value", ".", "unsigned", "===", "'boolean...
Makes a Long from a value. @param {{low: number, high: number, unsigned: boolean}|string|number} value Value @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for strings and numbers @returns {!Long} @throws {Error} If the value cannot be converted to a Long @i...
[ "Makes", "a", "Long", "from", "a", "value", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L6283-L6292
41,089
elsehow/signal-protocol
build/components_concat.js
function(builder, parent, name, options, isGroup, syntax) { Namespace.call(this, builder, parent, name, options, syntax); /** * @override */ this.className = "Message"; /** * Extensions range. * @type {!Array...
javascript
function(builder, parent, name, options, isGroup, syntax) { Namespace.call(this, builder, parent, name, options, syntax); /** * @override */ this.className = "Message"; /** * Extensions range. * @type {!Array...
[ "function", "(", "builder", ",", "parent", ",", "name", ",", "options", ",", "isGroup", ",", "syntax", ")", "{", "Namespace", ".", "call", "(", "this", ",", "builder", ",", "parent", ",", "name", ",", "options", ",", "syntax", ")", ";", "/**\r\n ...
Constructs a new Message. @exports ProtoBuf.Reflect.Message @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace @param {string} name Message name @param {Object.<string,*>=} options Message options @param {boolean=} isGroup `true` if this is a leg...
[ "Constructs", "a", "new", "Message", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L6786-L6837
41,090
elsehow/signal-protocol
build/components_concat.js
function(values, var_args) { ProtoBuf.Builder.Message.call(this); // Create virtual oneof properties for (var i=0, k=oneofs.length; i<k; ++i) this[oneofs[i].name] = null; // Create fields and set default value...
javascript
function(values, var_args) { ProtoBuf.Builder.Message.call(this); // Create virtual oneof properties for (var i=0, k=oneofs.length; i<k; ++i) this[oneofs[i].name] = null; // Create fields and set default value...
[ "function", "(", "values", ",", "var_args", ")", "{", "ProtoBuf", ".", "Builder", ".", "Message", ".", "call", "(", "this", ")", ";", "// Create virtual oneof properties\r", "for", "(", "var", "i", "=", "0", ",", "k", "=", "oneofs", ".", "length", ";", ...
Constructs a new runtime Message. @name ProtoBuf.Builder.Message @class Barebone of all runtime messages. @param {!Object.<string,*>|string} values Preset values @param {...string} var_args @constructor @throws {Error} If the message cannot be created
[ "Constructs", "a", "new", "runtime", "Message", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L6872-L6905
41,091
elsehow/signal-protocol
build/components_concat.js
cloneRaw
function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { if (obj === null || typeof obj !== 'object') { // Convert enum values to their respective names if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { ...
javascript
function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) { if (obj === null || typeof obj !== 'object') { // Convert enum values to their respective names if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) { ...
[ "function", "cloneRaw", "(", "obj", ",", "binaryAsBase64", ",", "longsAsStrings", ",", "resolvedType", ")", "{", "if", "(", "obj", "===", "null", "||", "typeof", "obj", "!==", "'object'", ")", "{", "// Convert enum values to their respective names\r", "if", "(", ...
Clones a message object or field value to a raw object. @param {*} obj Object to clone @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise @param {boolean} longsAsStrings Whether to encode longs as strings @param {!ProtoBuf.Reflect.T=} resolvedType The resolved fiel...
[ "Clones", "a", "message", "object", "or", "field", "value", "to", "a", "raw", "object", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L7341-L7386
41,092
elsehow/signal-protocol
build/components_concat.js
skipTillGroupEnd
function skipTillGroupEnd(expectedId, buf) { var tag = buf.readVarint32(), // Throws on OOB wireType = tag & 0x07, id = tag >>> 3; switch (wireType) { case ProtoBuf.WIRE_TYPES.VARINT: do tag = buf.readUint8(); ...
javascript
function skipTillGroupEnd(expectedId, buf) { var tag = buf.readVarint32(), // Throws on OOB wireType = tag & 0x07, id = tag >>> 3; switch (wireType) { case ProtoBuf.WIRE_TYPES.VARINT: do tag = buf.readUint8(); ...
[ "function", "skipTillGroupEnd", "(", "expectedId", ",", "buf", ")", "{", "var", "tag", "=", "buf", ".", "readVarint32", "(", ")", ",", "// Throws on OOB\r", "wireType", "=", "tag", "&", "0x07", ",", "id", "=", "tag", ">>>", "3", ";", "switch", "(", "wi...
Skips all data until the end of the specified group has been reached. @param {number} expectedId Expected GROUPEND id @param {!ByteBuffer} buf ByteBuffer @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached @throws {Error} If it wasn't possible to find the end of the group (buffer o...
[ "Skips", "all", "data", "until", "the", "end", "of", "the", "specified", "group", "has", "been", "reached", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L7656-L7687
41,093
elsehow/signal-protocol
build/components_concat.js
function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { T.call(this, builder, message, name); /** * @override */ this.className = "Message.Field"; /** * Message field required flag. ...
javascript
function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) { T.call(this, builder, message, name); /** * @override */ this.className = "Message.Field"; /** * Message field required flag. ...
[ "function", "(", "builder", ",", "message", ",", "rule", ",", "keytype", ",", "type", ",", "name", ",", "id", ",", "options", ",", "oneof", ",", "syntax", ")", "{", "T", ".", "call", "(", "this", ",", "builder", ",", "message", ",", "name", ")", ...
Constructs a new Message Field. @exports ProtoBuf.Reflect.Message.Field @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Message} message Message reference @param {string} rule Rule, one of requried, optional, repeated @param {string?} keytype Key data type, if any. @param {string} type Da...
[ "Constructs", "a", "new", "Message", "Field", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L7791-L7904
41,094
elsehow/signal-protocol
build/components_concat.js
function(builder, message, rule, type, name, id, options) { Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); /** * Extension reference. * @type {!ProtoBuf.Reflect.Extension} * @expose */ ...
javascript
function(builder, message, rule, type, name, id, options) { Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options); /** * Extension reference. * @type {!ProtoBuf.Reflect.Extension} * @expose */ ...
[ "function", "(", "builder", ",", "message", ",", "rule", ",", "type", ",", "name", ",", "id", ",", "options", ")", "{", "Field", ".", "call", "(", "this", ",", "builder", ",", "message", ",", "rule", ",", "/* keytype = */", "null", ",", "type", ",", ...
Constructs a new Message ExtensionField. @exports ProtoBuf.Reflect.Message.ExtensionField @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Message} message Message reference @param {string} rule Rule, one of requried, optional, repeated @param {string} type Data type, e.g. int32 @param {st...
[ "Constructs", "a", "new", "Message", "ExtensionField", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8253-L8262
41,095
elsehow/signal-protocol
build/components_concat.js
function(builder, parent, name, options, syntax) { Namespace.call(this, builder, parent, name, options, syntax); /** * @override */ this.className = "Enum"; /** * Runtime enum object. * @type {Object.<string,...
javascript
function(builder, parent, name, options, syntax) { Namespace.call(this, builder, parent, name, options, syntax); /** * @override */ this.className = "Enum"; /** * Runtime enum object. * @type {Object.<string,...
[ "function", "(", "builder", ",", "parent", ",", "name", ",", "options", ",", "syntax", ")", "{", "Namespace", ".", "call", "(", "this", ",", "builder", ",", "parent", ",", "name", ",", "options", ",", "syntax", ")", ";", "/**\r\n * @override\r\...
Constructs a new Enum. @exports ProtoBuf.Reflect.Enum @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.T} parent Parent Reflect object @param {string} name Enum name @param {Object.<string,*>=} options Enum options @param {string?} syntax The syntax level (e.g., proto3) @constructor @exten...
[ "Constructs", "a", "new", "Enum", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8310-L8324
41,096
elsehow/signal-protocol
build/components_concat.js
function(builder, enm, name, id) { T.call(this, builder, enm, name); /** * @override */ this.className = "Enum.Value"; /** * Unique enum value id. * @type {number} * @expose */ ...
javascript
function(builder, enm, name, id) { T.call(this, builder, enm, name); /** * @override */ this.className = "Enum.Value"; /** * Unique enum value id. * @type {number} * @expose */ ...
[ "function", "(", "builder", ",", "enm", ",", "name", ",", "id", ")", "{", "T", ".", "call", "(", "this", ",", "builder", ",", "enm", ",", "name", ")", ";", "/**\r\n * @override\r\n */", "this", ".", "className", "=", "\"Enum.Value\"",...
Constructs a new Enum Value. @exports ProtoBuf.Reflect.Enum.Value @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Enum} enm Enum reference @param {string} name Field name @param {number} id Unique field id @constructor @extends ProtoBuf.Reflect.T
[ "Constructs", "a", "new", "Enum", "Value", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8384-L8398
41,097
elsehow/signal-protocol
build/components_concat.js
function(builder, root, name, options) { Namespace.call(this, builder, root, name, options); /** * @override */ this.className = "Service"; /** * Built runtime service class. * @type {?function(new:ProtoBuf.B...
javascript
function(builder, root, name, options) { Namespace.call(this, builder, root, name, options); /** * @override */ this.className = "Service"; /** * Built runtime service class. * @type {?function(new:ProtoBuf.B...
[ "function", "(", "builder", ",", "root", ",", "name", ",", "options", ")", "{", "Namespace", ".", "call", "(", "this", ",", "builder", ",", "root", ",", "name", ",", "options", ")", ";", "/**\r\n * @override\r\n */", "this", ".", "cla...
Constructs a new Service. @exports ProtoBuf.Reflect.Service @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Namespace} root Root @param {string} name Service name @param {Object.<string,*>=} options Options @constructor @extends ProtoBuf.Reflect.Namespace
[ "Constructs", "a", "new", "Service", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8448-L8461
41,098
elsehow/signal-protocol
build/components_concat.js
function(rpcImpl) { ProtoBuf.Builder.Service.call(this); /** * Service implementation. * @name ProtoBuf.Builder.Service#rpcImpl * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Buil...
javascript
function(rpcImpl) { ProtoBuf.Builder.Service.call(this); /** * Service implementation. * @name ProtoBuf.Builder.Service#rpcImpl * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Buil...
[ "function", "(", "rpcImpl", ")", "{", "ProtoBuf", ".", "Builder", ".", "Service", ".", "call", "(", "this", ")", ";", "/**\r\n * Service implementation.\r\n * @name ProtoBuf.Builder.Service#rpcImpl\r\n * @type {!function(str...
Constructs a new runtime Service. @name ProtoBuf.Builder.Service @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message @class Barebone of all runtime services. @constructor @throws {Error} If the service cann...
[ "Constructs", "a", "new", "runtime", "Service", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8492-L8507
41,099
elsehow/signal-protocol
build/components_concat.js
function(builder, svc, name, options) { T.call(this, builder, svc, name); /** * @override */ this.className = "Service.Method"; /** * Options. * @type {Object.<string, *>} * @expose ...
javascript
function(builder, svc, name, options) { T.call(this, builder, svc, name); /** * @override */ this.className = "Service.Method"; /** * Options. * @type {Object.<string, *>} * @expose ...
[ "function", "(", "builder", ",", "svc", ",", "name", ",", "options", ")", "{", "T", ".", "call", "(", "this", ",", "builder", ",", "svc", ",", "name", ")", ";", "/**\r\n * @override\r\n */", "this", ".", "className", "=", "\"Service.M...
Abstract service method. @exports ProtoBuf.Reflect.Service.Method @param {!ProtoBuf.Builder} builder Builder reference @param {!ProtoBuf.Reflect.Service} svc Service @param {string} name Method name @param {Object.<string,*>=} options Options @constructor @extends ProtoBuf.Reflect.T
[ "Abstract", "service", "method", "." ]
221be558728f4e1ff35627d68033911dd928b9fa
https://github.com/elsehow/signal-protocol/blob/221be558728f4e1ff35627d68033911dd928b9fa/build/components_concat.js#L8646-L8660