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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36,700 | ocadotechnology/quantumjs | quantum-api/lib/entity-transforms/components/type.js | getType | function getType (str, typeLinks) {
if (str in typeLinks) {
return dom.create('a').class('qm-api-type-link').attr('href', typeLinks[str]).text(str)
} else {
return str
}
} | javascript | function getType (str, typeLinks) {
if (str in typeLinks) {
return dom.create('a').class('qm-api-type-link').attr('href', typeLinks[str]).text(str)
} else {
return str
}
} | [
"function",
"getType",
"(",
"str",
",",
"typeLinks",
")",
"{",
"if",
"(",
"str",
"in",
"typeLinks",
")",
"{",
"return",
"dom",
".",
"create",
"(",
"'a'",
")",
".",
"class",
"(",
"'qm-api-type-link'",
")",
".",
"attr",
"(",
"'href'",
",",
"typeLinks",
... | Lookup the type url from the availble type links | [
"Lookup",
"the",
"type",
"url",
"from",
"the",
"availble",
"type",
"links"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-api/lib/entity-transforms/components/type.js#L6-L12 |
36,701 | misoproject/storyboard | dist/miso.storyboard.r.0.1.0.js | children_to | function children_to( sceneName, argsArr, deferred ) {
var toScene = this.scenes[sceneName],
fromScene = this._current,
args = argsArr ? argsArr : [],
complete = this._complete = deferred || _.Deferred(),
exitComplete = _.Deferred(),
enterComplete = _.Deferred(),
publ... | javascript | function children_to( sceneName, argsArr, deferred ) {
var toScene = this.scenes[sceneName],
fromScene = this._current,
args = argsArr ? argsArr : [],
complete = this._complete = deferred || _.Deferred(),
exitComplete = _.Deferred(),
enterComplete = _.Deferred(),
publ... | [
"function",
"children_to",
"(",
"sceneName",
",",
"argsArr",
",",
"deferred",
")",
"{",
"var",
"toScene",
"=",
"this",
".",
"scenes",
"[",
"sceneName",
"]",
",",
"fromScene",
"=",
"this",
".",
"_current",
",",
"args",
"=",
"argsArr",
"?",
"argsArr",
":",... | Used as the function to scenes that do have children. | [
"Used",
"as",
"the",
"function",
"to",
"scenes",
"that",
"do",
"have",
"children",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.r.0.1.0.js#L377-L446 |
36,702 | ocadotechnology/quantumjs | quantum-markdown/lib/index.js | sluggifyText | function sluggifyText (text) {
const slug = unEscapeHtmlTags(text).toLowerCase()
// Replace 'unsafe' chars with dashes (!!!! is changed to -)
.replace(unsafeCharsRegex, '-')
// Replace multiple concurrent dashes with a single dash
.replace(multiDashRegex, '-')
// Remove trailing -
.replace(las... | javascript | function sluggifyText (text) {
const slug = unEscapeHtmlTags(text).toLowerCase()
// Replace 'unsafe' chars with dashes (!!!! is changed to -)
.replace(unsafeCharsRegex, '-')
// Replace multiple concurrent dashes with a single dash
.replace(multiDashRegex, '-')
// Remove trailing -
.replace(las... | [
"function",
"sluggifyText",
"(",
"text",
")",
"{",
"const",
"slug",
"=",
"unEscapeHtmlTags",
"(",
"text",
")",
".",
"toLowerCase",
"(",
")",
"// Replace 'unsafe' chars with dashes (!!!! is changed to -)",
".",
"replace",
"(",
"unsafeCharsRegex",
",",
"'-'",
")",
"//... | Takes a text string and returns a url-safe string for use when de-duplicating | [
"Takes",
"a",
"text",
"string",
"and",
"returns",
"a",
"url",
"-",
"safe",
"string",
"for",
"use",
"when",
"de",
"-",
"duplicating"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-markdown/lib/index.js#L56-L66 |
36,703 | ocadotechnology/quantumjs | quantum-markdown/lib/index.js | dedupeAndSluggify | function dedupeAndSluggify (sluggify) {
const existingHeadings = {}
return (heading) => {
const sluggifiedText = sluggify(heading)
const existingCount = existingHeadings[sluggifiedText] || 0
existingHeadings[sluggifiedText] = existingCount + 1
return existingCount > 0 ? `${sluggifiedText}-${existing... | javascript | function dedupeAndSluggify (sluggify) {
const existingHeadings = {}
return (heading) => {
const sluggifiedText = sluggify(heading)
const existingCount = existingHeadings[sluggifiedText] || 0
existingHeadings[sluggifiedText] = existingCount + 1
return existingCount > 0 ? `${sluggifiedText}-${existing... | [
"function",
"dedupeAndSluggify",
"(",
"sluggify",
")",
"{",
"const",
"existingHeadings",
"=",
"{",
"}",
"return",
"(",
"heading",
")",
"=>",
"{",
"const",
"sluggifiedText",
"=",
"sluggify",
"(",
"heading",
")",
"const",
"existingCount",
"=",
"existingHeadings",
... | Takes an array and an sluggify function and returns a function that de-duplicates headings | [
"Takes",
"an",
"array",
"and",
"an",
"sluggify",
"function",
"and",
"returns",
"a",
"function",
"that",
"de",
"-",
"duplicates",
"headings"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-markdown/lib/index.js#L69-L77 |
36,704 | retsr/rets.js | lib/client.js | Client | function Client(name, password) {
if (!(this instanceof Client)) {
return new Client(name, password);
}
this.name = name || 'RETS-Connector1/2';
this.password = password || '';
} | javascript | function Client(name, password) {
if (!(this instanceof Client)) {
return new Client(name, password);
}
this.name = name || 'RETS-Connector1/2';
this.password = password || '';
} | [
"function",
"Client",
"(",
"name",
",",
"password",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Client",
")",
")",
"{",
"return",
"new",
"Client",
"(",
"name",
",",
"password",
")",
";",
"}",
"this",
".",
"name",
"=",
"name",
"||",
"'RETS... | Client class encapsulates User Agent instance data.
@param {Object} config
@param {string} config.name - The user agent's name
@param {string} config.password - The user agent's password | [
"Client",
"class",
"encapsulates",
"User",
"Agent",
"instance",
"data",
"."
] | 52f0287390a1d0cb93bbbd7edf630d7ebcb6de26 | https://github.com/retsr/rets.js/blob/52f0287390a1d0cb93bbbd7edf630d7ebcb6de26/lib/client.js#L24-L33 |
36,705 | mariusc23/express-query-int | lib/parse.js | parseNums | function parseNums(obj, options) {
var result = Array.isArray(obj) ? [] : {},
key,
value,
parsedValue;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
value = obj[key];
parsedValue = options.parser.call(null, value, 10, key);
if (typeof value === 'string' && !isNaN(parsed... | javascript | function parseNums(obj, options) {
var result = Array.isArray(obj) ? [] : {},
key,
value,
parsedValue;
for (key in obj) {
if (obj.hasOwnProperty(key)) {
value = obj[key];
parsedValue = options.parser.call(null, value, 10, key);
if (typeof value === 'string' && !isNaN(parsed... | [
"function",
"parseNums",
"(",
"obj",
",",
"options",
")",
"{",
"var",
"result",
"=",
"Array",
".",
"isArray",
"(",
"obj",
")",
"?",
"[",
"]",
":",
"{",
"}",
",",
"key",
",",
"value",
",",
"parsedValue",
";",
"for",
"(",
"key",
"in",
"obj",
")",
... | Attempts to convert object properties recursively to numbers.
@param {Object} obj - Object to iterate over.
@param {Object} options - Options.
@param {Function} options.parser - Parser to process string with. Should return NaN if not a valid number. Defaults to parseInt.
@return {Object} ... | [
"Attempts",
"to",
"convert",
"object",
"properties",
"recursively",
"to",
"numbers",
"."
] | 01aad8c910c006aae7bc87306a742d35c510a0a5 | https://github.com/mariusc23/express-query-int/blob/01aad8c910c006aae7bc87306a742d35c510a0a5/lib/parse.js#L10-L34 |
36,706 | ocadotechnology/quantumjs | quantum-template/lib/index.js | wrapper | function wrapper (fileContent, wrapperOptions) {
const selection = quantum.select({
type: '',
params: [],
content: fileContent.content
})
if (selection.has('template')) {
const template = selection.select('template')
// find out the name of the entity to replace with the page content
con... | javascript | function wrapper (fileContent, wrapperOptions) {
const selection = quantum.select({
type: '',
params: [],
content: fileContent.content
})
if (selection.has('template')) {
const template = selection.select('template')
// find out the name of the entity to replace with the page content
con... | [
"function",
"wrapper",
"(",
"fileContent",
",",
"wrapperOptions",
")",
"{",
"const",
"selection",
"=",
"quantum",
".",
"select",
"(",
"{",
"type",
":",
"''",
",",
"params",
":",
"[",
"]",
",",
"content",
":",
"fileContent",
".",
"content",
"}",
")",
"i... | Processes the page for wrapping templates. | [
"Processes",
"the",
"page",
"for",
"wrapping",
"templates",
"."
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-template/lib/index.js#L233-L267 |
36,707 | gauravchl/ansi-art | webapp/src/index.js | readFile | function readFile(e) {
const file = e.currentTarget.files && e.currentTarget.files[0];
const reader = new FileReader();
reader.onload = event => ArtBoard.loadANSI(event.target.result);
if (file) reader.readAsText(file);
} | javascript | function readFile(e) {
const file = e.currentTarget.files && e.currentTarget.files[0];
const reader = new FileReader();
reader.onload = event => ArtBoard.loadANSI(event.target.result);
if (file) reader.readAsText(file);
} | [
"function",
"readFile",
"(",
"e",
")",
"{",
"const",
"file",
"=",
"e",
".",
"currentTarget",
".",
"files",
"&&",
"e",
".",
"currentTarget",
".",
"files",
"[",
"0",
"]",
";",
"const",
"reader",
"=",
"new",
"FileReader",
"(",
")",
";",
"reader",
".",
... | Init file uploader | [
"Init",
"file",
"uploader"
] | ed23b07320999728d2eeee07872c9e7881a700f9 | https://github.com/gauravchl/ansi-art/blob/ed23b07320999728d2eeee07872c9e7881a700f9/webapp/src/index.js#L14-L20 |
36,708 | Banno/polymer-lint | spec/support/helpers/streamFromString.js | streamFromString | function streamFromString(string) {
const s = new stream.Readable();
s.push(string);
s.push(null);
return s;
} | javascript | function streamFromString(string) {
const s = new stream.Readable();
s.push(string);
s.push(null);
return s;
} | [
"function",
"streamFromString",
"(",
"string",
")",
"{",
"const",
"s",
"=",
"new",
"stream",
".",
"Readable",
"(",
")",
";",
"s",
".",
"push",
"(",
"string",
")",
";",
"s",
".",
"push",
"(",
"null",
")",
";",
"return",
"s",
";",
"}"
] | helpers.streamFromString
@param {string} string
@return {stream.Readable} A Readable stream that will emit the given string | [
"helpers",
".",
"streamFromString"
] | cf4ffdc63837280080b67f496d038d33a3975b6f | https://github.com/Banno/polymer-lint/blob/cf4ffdc63837280080b67f496d038d33a3975b6f/spec/support/helpers/streamFromString.js#L8-L13 |
36,709 | fullstackers/bus.io | demo/chat/public/js/chat.js | share | function share() {
var status = $.trim($('#status').val()),
target = $('#target').val();
// Nothing to share
if(status === '') {
return;
}
// When messaging an individual user, update the target to be the user
// that is being messaged.
if(target === 'user') {
target = ... | javascript | function share() {
var status = $.trim($('#status').val()),
target = $('#target').val();
// Nothing to share
if(status === '') {
return;
}
// When messaging an individual user, update the target to be the user
// that is being messaged.
if(target === 'user') {
target = ... | [
"function",
"share",
"(",
")",
"{",
"var",
"status",
"=",
"$",
".",
"trim",
"(",
"$",
"(",
"'#status'",
")",
".",
"val",
"(",
")",
")",
",",
"target",
"=",
"$",
"(",
"'#target'",
")",
".",
"val",
"(",
")",
";",
"// Nothing to share",
"if",
"(",
... | Call this method when you are ready to send a message to the server. | [
"Call",
"this",
"method",
"when",
"you",
"are",
"ready",
"to",
"send",
"a",
"message",
"to",
"the",
"server",
"."
] | 8bc8f38938925a31f67a9b03cf24f8fdb12f3353 | https://github.com/fullstackers/bus.io/blob/8bc8f38938925a31f67a9b03cf24f8fdb12f3353/demo/chat/public/js/chat.js#L6-L26 |
36,710 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
if( typeof options === 'function' ) {
callback = options
options = null
}
options = options != null ? options : {}
var self = this
var baseUrl = 'airlines/rest/v1/json'
var isCode = options.fs || options.iata || options.icao
var supportsDate = !... | javascript | function( options, callback ) {
if( typeof options === 'function' ) {
callback = options
options = null
}
options = options != null ? options : {}
var self = this
var baseUrl = 'airlines/rest/v1/json'
var isCode = options.fs || options.iata || options.icao
var supportsDate = !... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"'function'",
")",
"{",
"callback",
"=",
"options",
"options",
"=",
"null",
"}",
"options",
"=",
"options",
"!=",
"null",
"?",
"options",
":",
"{",
"}",
"var"... | Retrieve a list of airlines
@param {Object} options
@param {Boolean} [options.all=false] optional
@param {?Date} [options.date] optional
@param {?String} [options.iata] optional
@param {?String} [options.icao] optional
@param {?String} [options.fs] optional
@param {Function} callback
@return {Request} | [
"Retrieve",
"a",
"list",
"of",
"airlines"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L170-L245 | |
36,711 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
if( typeof options === 'function' ) {
callback = options
options = null
}
options = options != null ? options : {}
var self = this
var baseUrl = 'airports/rest/v1/json'
var isCode = options.fs || options.iata || options.icao
var isLocationCode =... | javascript | function( options, callback ) {
if( typeof options === 'function' ) {
callback = options
options = null
}
options = options != null ? options : {}
var self = this
var baseUrl = 'airports/rest/v1/json'
var isCode = options.fs || options.iata || options.icao
var isLocationCode =... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"'function'",
")",
"{",
"callback",
"=",
"options",
"options",
"=",
"null",
"}",
"options",
"=",
"options",
"!=",
"null",
"?",
"options",
":",
"{",
"}",
"var"... | Retrieve a list of airports
@param {Object} options
@param {?Boolean} [options.all=false] optional
@param {?Date} [options.date] optional
@param {?String} [options.iata] optional
@param {?String} [options.icao] optional
@param {?String} [options.fs] optional
@param {?String} [options.city] optional
@param {?String} [op... | [
"Retrieve",
"a",
"list",
"of",
"airports"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L263-L344 | |
36,712 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
debug( 'lookup' )
var now = Date.now()
var target = options.date.getTime()
// NOTE: `.status()` is only available within a window of -7 to +3 days
var timeMin = now - ( 8 * 24 ) * 60 * 60 * 1000
var timeMax = now + ( 3 * 24 ) * 60 * 60 * 1000
var method = ... | javascript | function( options, callback ) {
debug( 'lookup' )
var now = Date.now()
var target = options.date.getTime()
// NOTE: `.status()` is only available within a window of -7 to +3 days
var timeMin = now - ( 8 * 24 ) * 60 * 60 * 1000
var timeMax = now + ( 3 * 24 ) * 60 * 60 * 1000
var method = ... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"debug",
"(",
"'lookup'",
")",
"var",
"now",
"=",
"Date",
".",
"now",
"(",
")",
"var",
"target",
"=",
"options",
".",
"date",
".",
"getTime",
"(",
")",
"// NOTE: `.status()` is only available within a wi... | Look up a flight
@param {Object} options
@param {Date} options.date
@param {String} options.airlineCode
@param {String} options.flightNumber
@param {?String} [options.airport] optional
@param {?String} [options.direction='arr'] optional
@param {?Array<String>} [options.extendedOptions] optional
@param {Function} callba... | [
"Look",
"up",
"a",
"flight"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L358-L378 | |
36,713 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
debug( 'schedule', options )
var self = this
var protocol = options.protocol || 'rest'
var format = options.format || 'json'
var baseUrl = 'schedules/' + protocol + '/v1/' + format + '/flight'
var carrier = options.airlineCode
var flightNumber = options.fl... | javascript | function( options, callback ) {
debug( 'schedule', options )
var self = this
var protocol = options.protocol || 'rest'
var format = options.format || 'json'
var baseUrl = 'schedules/' + protocol + '/v1/' + format + '/flight'
var carrier = options.airlineCode
var flightNumber = options.fl... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"debug",
"(",
"'schedule'",
",",
"options",
")",
"var",
"self",
"=",
"this",
"var",
"protocol",
"=",
"options",
".",
"protocol",
"||",
"'rest'",
"var",
"format",
"=",
"options",
".",
"format",
"||",
... | Get a flight's schedule status information
@param {Object} options - see [.lookup()]{@link FlightStats#lookup}
@param {Function} callback
@return {Request} | [
"Get",
"a",
"flight",
"s",
"schedule",
"status",
"information"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L440-L484 | |
36,714 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
options = Object.assign({ type: 'firstflightin', verb: '/arriving_before/' }, options )
return this.connections( options, callback )
} | javascript | function( options, callback ) {
options = Object.assign({ type: 'firstflightin', verb: '/arriving_before/' }, options )
return this.connections( options, callback )
} | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"options",
"=",
"Object",
".",
"assign",
"(",
"{",
"type",
":",
"'firstflightin'",
",",
"verb",
":",
"'/arriving_before/'",
"}",
",",
"options",
")",
"return",
"this",
".",
"connections",
"(",
"options... | Get the first inbound flight between two airports
@param {Object} options - see [.connections()]{@link FlightStats#connections}
@param {Function} callback
@return {Request} | [
"Get",
"the",
"first",
"inbound",
"flight",
"between",
"two",
"airports"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L492-L495 | |
36,715 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
var self = this
var year = options.date.getFullYear()
var month = options.date.getMonth() + 1
var day = options.date.getDate()
var hour = options.date.getHours()
var minute = options.date.getMinutes()
var url = '/connections/rest/v2/json/' + options.type + ... | javascript | function( options, callback ) {
var self = this
var year = options.date.getFullYear()
var month = options.date.getMonth() + 1
var day = options.date.getDate()
var hour = options.date.getHours()
var minute = options.date.getMinutes()
var url = '/connections/rest/v2/json/' + options.type + ... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"year",
"=",
"options",
".",
"date",
".",
"getFullYear",
"(",
")",
"var",
"month",
"=",
"options",
".",
"date",
".",
"getMonth",
"(",
")",
"+",
"1",
"var",
"d... | Get connecting flights between two airports
@internal used by {first,last}Flight{In,Out} methods
@param {Object} options
@param {?String} [options.type] optional, only used by `.connections()`
@param {String} options.departureAirport
@param {String} options.arrivalAirport
@param {Date} options.date
@param {?Number} [op... | [
"Get",
"connecting",
"flights",
"between",
"two",
"airports"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L554-L601 | |
36,716 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
var self = this
var url = '/ratings/rest/v1/json/flight/' + options.carrier + '/' + options.flightNumber
var extensions = []
if( Array.isArray( options.extendedOptions ) ) {
extensions = extensions.concat( options.extendedOptions )
}
return this._clientR... | javascript | function( options, callback ) {
var self = this
var url = '/ratings/rest/v1/json/flight/' + options.carrier + '/' + options.flightNumber
var extensions = []
if( Array.isArray( options.extendedOptions ) ) {
extensions = extensions.concat( options.extendedOptions )
}
return this._clientR... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"url",
"=",
"'/ratings/rest/v1/json/flight/'",
"+",
"options",
".",
"carrier",
"+",
"'/'",
"+",
"options",
".",
"flightNumber",
"var",
"extensions",
"=",
"[",
"]",
"i... | Get ratings for a specified flight
@param {Object} options
@param {String} options.carrier
@param {String|Number} options.flightNumber
@param {Array<String>} [options.extendedOptions]
@param {Function} callback
@return {Request} | [
"Get",
"ratings",
"for",
"a",
"specified",
"flight"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L612-L634 | |
36,717 | jhermsmeier/node-flightstats | lib/flightstats.js | function( options, callback ) {
debug( 'route', options )
var self = this
var year = options.date.getFullYear()
var month = options.date.getMonth() + 1
var day = options.date.getDate()
var direction = /^dep/i.test( options.direction ) ?
'dep' : 'arr'
var url = 'flightstatus/rest/v2... | javascript | function( options, callback ) {
debug( 'route', options )
var self = this
var year = options.date.getFullYear()
var month = options.date.getMonth() + 1
var day = options.date.getDate()
var direction = /^dep/i.test( options.direction ) ?
'dep' : 'arr'
var url = 'flightstatus/rest/v2... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"debug",
"(",
"'route'",
",",
"options",
")",
"var",
"self",
"=",
"this",
"var",
"year",
"=",
"options",
".",
"date",
".",
"getFullYear",
"(",
")",
"var",
"month",
"=",
"options",
".",
"date",
".... | Get routes between two airports
@param {Object} options
@param {Date} options.date
@param {String} options.departureAirport
@param {String} options.arrivalAirport
@param {String} options.codeType
@param {Number} options.maxFlights
@param {Number} options.numHours
@param {Number} options.hourOfDay
@param {Boolean} optio... | [
"Get",
"routes",
"between",
"two",
"airports"
] | 023d46e11db4f4ba45ed414b1dc23084b1c9749d | https://github.com/jhermsmeier/node-flightstats/blob/023d46e11db4f4ba45ed414b1dc23084b1c9749d/lib/flightstats.js#L752-L789 | |
36,718 | ocadotechnology/quantumjs | quantum-dom/lib/index.js | randomId | function randomId () {
const res = new Array(32)
const alphabet = 'ABCDEF0123456789'
for (let i = 0; i < 32; i++) {
res[i] = alphabet[Math.floor(Math.random() * 16)]
}
return res.join('')
} | javascript | function randomId () {
const res = new Array(32)
const alphabet = 'ABCDEF0123456789'
for (let i = 0; i < 32; i++) {
res[i] = alphabet[Math.floor(Math.random() * 16)]
}
return res.join('')
} | [
"function",
"randomId",
"(",
")",
"{",
"const",
"res",
"=",
"new",
"Array",
"(",
"32",
")",
"const",
"alphabet",
"=",
"'ABCDEF0123456789'",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"32",
";",
"i",
"++",
")",
"{",
"res",
"[",
"i",
"]",
"... | creates a random id | [
"creates",
"a",
"random",
"id"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-dom/lib/index.js#L33-L40 |
36,719 | ocadotechnology/quantumjs | examples/all-modules/src/transforms/custom-transforms.js | signIn | function signIn (selection) {
return dom.create('div').class('sign-in')
.add(dom.create('input').class('username-input'))
.add(dom.create('input').class('password-input'))
.add(dom.create('button').class('sign-in-button').text('Sign in'))
} | javascript | function signIn (selection) {
return dom.create('div').class('sign-in')
.add(dom.create('input').class('username-input'))
.add(dom.create('input').class('password-input'))
.add(dom.create('button').class('sign-in-button').text('Sign in'))
} | [
"function",
"signIn",
"(",
"selection",
")",
"{",
"return",
"dom",
".",
"create",
"(",
"'div'",
")",
".",
"class",
"(",
"'sign-in'",
")",
".",
"add",
"(",
"dom",
".",
"create",
"(",
"'input'",
")",
".",
"class",
"(",
"'username-input'",
")",
")",
"."... | creates a sign in block for the @signIn entity | [
"creates",
"a",
"sign",
"in",
"block",
"for",
"the"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/examples/all-modules/src/transforms/custom-transforms.js#L4-L9 |
36,720 | ocadotechnology/quantumjs | quantum-core/lib/select.js | isEntity | function isEntity (d) {
return isText(d.type) && Array.isArray(d.params) && Array.isArray(d.content)
} | javascript | function isEntity (d) {
return isText(d.type) && Array.isArray(d.params) && Array.isArray(d.content)
} | [
"function",
"isEntity",
"(",
"d",
")",
"{",
"return",
"isText",
"(",
"d",
".",
"type",
")",
"&&",
"Array",
".",
"isArray",
"(",
"d",
".",
"params",
")",
"&&",
"Array",
".",
"isArray",
"(",
"d",
".",
"content",
")",
"}"
] | duck type check for an entity | [
"duck",
"type",
"check",
"for",
"an",
"entity"
] | 5bc684b750472296f186a816529272c36218db04 | https://github.com/ocadotechnology/quantumjs/blob/5bc684b750472296f186a816529272c36218db04/quantum-core/lib/select.js#L17-L19 |
36,721 | Banno/polymer-lint | spec/support/helpers/inspect.js | inspect | function inspect(stringsOrOpts, ...values) {
if (Array.isArray(stringsOrOpts)) {
return DEFAULT_INSPECT(stringsOrOpts, ...values);
}
return inspector(stringsOrOpts);
} | javascript | function inspect(stringsOrOpts, ...values) {
if (Array.isArray(stringsOrOpts)) {
return DEFAULT_INSPECT(stringsOrOpts, ...values);
}
return inspector(stringsOrOpts);
} | [
"function",
"inspect",
"(",
"stringsOrOpts",
",",
"...",
"values",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"stringsOrOpts",
")",
")",
"{",
"return",
"DEFAULT_INSPECT",
"(",
"stringsOrOpts",
",",
"...",
"values",
")",
";",
"}",
"return",
"inspect... | helpers.inspect
A tagged template function that automatically calls `util.inspect` on
interpolated values in template string literals.
If called with an options object, `helpers.inspect` will return a tagged
template function that passes the options to `util.inspect`.
@example
const foo = 'xyz';
const bar = { a: { ... | [
"helpers",
".",
"inspect"
] | cf4ffdc63837280080b67f496d038d33a3975b6f | https://github.com/Banno/polymer-lint/blob/cf4ffdc63837280080b67f496d038d33a3975b6f/spec/support/helpers/inspect.js#L54-L59 |
36,722 | Banno/polymer-lint | spec/lib/util/filterErrorsSpec.js | noisyRule | function noisyRule(context, parser, onError) {
parser.on('startTag', (name, attrs, selfClosing, location) => {
onError({
rule: name,
message: getAttribute(attrs, 'message') || '',
location,
});
});
} | javascript | function noisyRule(context, parser, onError) {
parser.on('startTag', (name, attrs, selfClosing, location) => {
onError({
rule: name,
message: getAttribute(attrs, 'message') || '',
location,
});
});
} | [
"function",
"noisyRule",
"(",
"context",
",",
"parser",
",",
"onError",
")",
"{",
"parser",
".",
"on",
"(",
"'startTag'",
",",
"(",
"name",
",",
"attrs",
",",
"selfClosing",
",",
"location",
")",
"=>",
"{",
"onError",
"(",
"{",
"rule",
":",
"name",
"... | This is a rule that reports an error for every startTag, with the ruleName equal to the startTag's name. | [
"This",
"is",
"a",
"rule",
"that",
"reports",
"an",
"error",
"for",
"every",
"startTag",
"with",
"the",
"ruleName",
"equal",
"to",
"the",
"startTag",
"s",
"name",
"."
] | cf4ffdc63837280080b67f496d038d33a3975b6f | https://github.com/Banno/polymer-lint/blob/cf4ffdc63837280080b67f496d038d33a3975b6f/spec/lib/util/filterErrorsSpec.js#L9-L17 |
36,723 | Banno/polymer-lint | lib/CLI.js | execute | function execute(argv) {
const opts = Options.parse(argv);
if (opts.version) {
/* eslint-disable global-require */
console.log(`v${ require('../package.json').version }`);
return Promise.resolve(0);
}
if (opts.help || !opts._.length) {
console.log(Options.generateHelp());
return Promise.re... | javascript | function execute(argv) {
const opts = Options.parse(argv);
if (opts.version) {
/* eslint-disable global-require */
console.log(`v${ require('../package.json').version }`);
return Promise.resolve(0);
}
if (opts.help || !opts._.length) {
console.log(Options.generateHelp());
return Promise.re... | [
"function",
"execute",
"(",
"argv",
")",
"{",
"const",
"opts",
"=",
"Options",
".",
"parse",
"(",
"argv",
")",
";",
"if",
"(",
"opts",
".",
"version",
")",
"{",
"/* eslint-disable global-require */",
"console",
".",
"log",
"(",
"`",
"${",
"require",
"(",... | Parse the command line arguments and run the linter
@memberof module:lib/CLI
@param {string[]} argv - Command line arguments
@return {number|Promise<number>}
A Promise that resolves with a numeric exit code | [
"Parse",
"the",
"command",
"line",
"arguments",
"and",
"run",
"the",
"linter"
] | cf4ffdc63837280080b67f496d038d33a3975b6f | https://github.com/Banno/polymer-lint/blob/cf4ffdc63837280080b67f496d038d33a3975b6f/lib/CLI.js#L30-L45 |
36,724 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | compareAscending | function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
re... | javascript | function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
re... | [
"function",
"compareAscending",
"(",
"a",
",",
"b",
")",
"{",
"var",
"ai",
"=",
"a",
".",
"index",
",",
"bi",
"=",
"b",
".",
"index",
";",
"a",
"=",
"a",
".",
"criteria",
";",
"b",
"=",
"b",
".",
"criteria",
";",
"// ensure a stable sort in V8 and ot... | Used by `sortBy` to compare transformed `collection` values, stable sorting
them in ascending order.
@private
@param {Object} a The object to compare to `b`.
@param {Object} b The object to compare to `a`.
@returns {Number} Returns the sort order indicator of `1` or `-1`. | [
"Used",
"by",
"sortBy",
"to",
"compare",
"transformed",
"collection",
"values",
"stable",
"sorting",
"them",
"in",
"ascending",
"order",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L423-L441 |
36,725 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | createBound | function createBound(func, thisArg, partialArgs, indicator) {
var isFunc = isFunction(func),
isPartial = !partialArgs,
key = thisArg;
// juggle arguments
if (isPartial) {
var rightIndicator = indicator;
partialArgs = thisArg;
}
else if (!isFunc) {
... | javascript | function createBound(func, thisArg, partialArgs, indicator) {
var isFunc = isFunction(func),
isPartial = !partialArgs,
key = thisArg;
// juggle arguments
if (isPartial) {
var rightIndicator = indicator;
partialArgs = thisArg;
}
else if (!isFunc) {
... | [
"function",
"createBound",
"(",
"func",
",",
"thisArg",
",",
"partialArgs",
",",
"indicator",
")",
"{",
"var",
"isFunc",
"=",
"isFunction",
"(",
"func",
")",
",",
"isPartial",
"=",
"!",
"partialArgs",
",",
"key",
"=",
"thisArg",
";",
"// juggle arguments",
... | Creates a function that, when called, invokes `func` with the `this` binding
of `thisArg` and prepends any `partialArgs` to the arguments passed to the
bound function.
@private
@param {Function|String} func The function to bind or the method name.
@param {Mixed} [thisArg] The `this` binding of `func`.
@param {Array} p... | [
"Creates",
"a",
"function",
"that",
"when",
"called",
"invokes",
"func",
"with",
"the",
"this",
"binding",
"of",
"thisArg",
"and",
"prepends",
"any",
"partialArgs",
"to",
"the",
"arguments",
"passed",
"to",
"the",
"bound",
"function",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L456-L501 |
36,726 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | findKey | function findKey(object, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg);
forOwn(object, function(value, key, object) {
if (callback(value, key, object)) {
result = key;
return false;
}
});
return result;
} | javascript | function findKey(object, callback, thisArg) {
var result;
callback = lodash.createCallback(callback, thisArg);
forOwn(object, function(value, key, object) {
if (callback(value, key, object)) {
result = key;
return false;
}
});
return result;
} | [
"function",
"findKey",
"(",
"object",
",",
"callback",
",",
"thisArg",
")",
"{",
"var",
"result",
";",
"callback",
"=",
"lodash",
".",
"createCallback",
"(",
"callback",
",",
"thisArg",
")",
";",
"forOwn",
"(",
"object",
",",
"function",
"(",
"value",
",... | This method is similar to `_.find`, except that it returns the key of the
element that passes the callback check, instead of the element itself.
@static
@memberOf _
@category Objects
@param {Object} object The object to search.
@param {Function|Object|String} [callback=identity] The function called per
iteration. If a... | [
"This",
"method",
"is",
"similar",
"to",
"_",
".",
"find",
"except",
"that",
"it",
"returns",
"the",
"key",
"of",
"the",
"element",
"that",
"passes",
"the",
"callback",
"check",
"instead",
"of",
"the",
"element",
"itself",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L1027-L1037 |
36,727 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | reduceRight | function reduceRight(collection, callback, accumulator, thisArg) {
var iterable = collection,
length = collection ? collection.length : 0,
noaccum = arguments.length < 3;
if (typeof length != 'number') {
var props = keys(collection);
length = props.length;
}
... | javascript | function reduceRight(collection, callback, accumulator, thisArg) {
var iterable = collection,
length = collection ? collection.length : 0,
noaccum = arguments.length < 3;
if (typeof length != 'number') {
var props = keys(collection);
length = props.length;
}
... | [
"function",
"reduceRight",
"(",
"collection",
",",
"callback",
",",
"accumulator",
",",
"thisArg",
")",
"{",
"var",
"iterable",
"=",
"collection",
",",
"length",
"=",
"collection",
"?",
"collection",
".",
"length",
":",
"0",
",",
"noaccum",
"=",
"arguments",... | This method is similar to `_.reduce`, except that it iterates over a
`collection` from right to left.
@static
@memberOf _
@alias foldr
@category Collections
@param {Array|Object|String} collection The collection to iterate over.
@param {Function} [callback=identity] The function called per iteration.
@param {Mixed} [a... | [
"This",
"method",
"is",
"similar",
"to",
"_",
".",
"reduce",
"except",
"that",
"it",
"iterates",
"over",
"a",
"collection",
"from",
"right",
"to",
"left",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L2731-L2748 |
36,728 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | findIndex | function findIndex(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg);
while (++index < length) {
if (callback(array[index], index, array)) {
return index;
}
}
return -1;
... | javascript | function findIndex(array, callback, thisArg) {
var index = -1,
length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg);
while (++index < length) {
if (callback(array[index], index, array)) {
return index;
}
}
return -1;
... | [
"function",
"findIndex",
"(",
"array",
",",
"callback",
",",
"thisArg",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
";",
"callback",
"=",
"lodash",
".",
"createCallback",
"(",
"callback",... | This method is similar to `_.find`, except that it returns the index of
the element that passes the callback check, instead of the element itself.
@static
@memberOf _
@category Arrays
@param {Array} array The array to search.
@param {Function|Object|String} [callback=identity] The function called per
iteration. If a p... | [
"This",
"method",
"is",
"similar",
"to",
"_",
".",
"find",
"except",
"that",
"it",
"returns",
"the",
"index",
"of",
"the",
"element",
"that",
"passes",
"the",
"callback",
"check",
"instead",
"of",
"the",
"element",
"itself",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L3095-L3106 |
36,729 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | unzip | function unzip(array) {
var index = -1,
length = array ? array.length : 0,
tupleLength = length ? max(pluck(array, 'length')) : 0,
result = Array(tupleLength);
while (++index < length) {
var tupleIndex = -1,
tuple = array[index];
while (++tupleInde... | javascript | function unzip(array) {
var index = -1,
length = array ? array.length : 0,
tupleLength = length ? max(pluck(array, 'length')) : 0,
result = Array(tupleLength);
while (++index < length) {
var tupleIndex = -1,
tuple = array[index];
while (++tupleInde... | [
"function",
"unzip",
"(",
"array",
")",
"{",
"var",
"index",
"=",
"-",
"1",
",",
"length",
"=",
"array",
"?",
"array",
".",
"length",
":",
"0",
",",
"tupleLength",
"=",
"length",
"?",
"max",
"(",
"pluck",
"(",
"array",
",",
"'length'",
")",
")",
... | The inverse of `_.zip`, this method splits groups of elements into arrays
composed of elements from each group at their corresponding indexes.
@static
@memberOf _
@category Arrays
@param {Array} array The array to process.
@returns {Array} Returns a new array of the composed arrays.
@example
_.unzip([['moe', 30, true... | [
"The",
"inverse",
"of",
"_",
".",
"zip",
"this",
"method",
"splits",
"groups",
"of",
"elements",
"into",
"arrays",
"composed",
"of",
"elements",
"from",
"each",
"group",
"at",
"their",
"corresponding",
"indexes",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L3845-L3860 |
36,730 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | bind | function bind(func, thisArg) {
// use `Function#bind` if it exists and is fast
// (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments)
: createBound(func, thisArg, ... | javascript | function bind(func, thisArg) {
// use `Function#bind` if it exists and is fast
// (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments)
: createBound(func, thisArg, ... | [
"function",
"bind",
"(",
"func",
",",
"thisArg",
")",
"{",
"// use `Function#bind` if it exists and is fast",
"// (in V8 `Function#bind` is slower except when partially applied)",
"return",
"support",
".",
"fastBind",
"||",
"(",
"nativeBind",
"&&",
"arguments",
".",
"length",... | Creates a function that, when called, invokes `func` with the `this`
binding of `thisArg` and prepends any additional `bind` arguments to those
passed to the bound function.
@static
@memberOf _
@category Functions
@param {Function} func The function to bind.
@param {Mixed} [thisArg] The `this` binding of `func`.
@para... | [
"Creates",
"a",
"function",
"that",
"when",
"called",
"invokes",
"func",
"with",
"the",
"this",
"binding",
"of",
"thisArg",
"and",
"prepends",
"any",
"additional",
"bind",
"arguments",
"to",
"those",
"passed",
"to",
"the",
"bound",
"function",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L3999-L4005 |
36,731 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | bindAll | function bindAll(object) {
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
index = -1,
length = funcs.length;
while (++index < length) {
var key = funcs[index];
object[key] = bind(object[key], object);
... | javascript | function bindAll(object) {
var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
index = -1,
length = funcs.length;
while (++index < length) {
var key = funcs[index];
object[key] = bind(object[key], object);
... | [
"function",
"bindAll",
"(",
"object",
")",
"{",
"var",
"funcs",
"=",
"arguments",
".",
"length",
">",
"1",
"?",
"concat",
".",
"apply",
"(",
"arrayRef",
",",
"nativeSlice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
")",
":",
"functions",
"(",
"ob... | Binds methods on `object` to `object`, overwriting the existing method.
Method names may be specified as individual arguments or as arrays of method
names. If no method names are provided, all the function properties of `object`
will be bound.
@static
@memberOf _
@category Functions
@param {Object} object The object t... | [
"Binds",
"methods",
"on",
"object",
"to",
"object",
"overwriting",
"the",
"existing",
"method",
".",
"Method",
"names",
"may",
"be",
"specified",
"as",
"individual",
"arguments",
"or",
"as",
"arrays",
"of",
"method",
"names",
".",
"If",
"no",
"method",
"name... | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L4030-L4040 |
36,732 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | defer | function defer(func) {
var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
} | javascript | function defer(func) {
var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1);
} | [
"function",
"defer",
"(",
"func",
")",
"{",
"var",
"args",
"=",
"nativeSlice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"return",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"func",
".",
"apply",
"(",
"undefined",
",",
"args",
")",
";",
... | Defers executing the `func` function until the current call stack has cleared.
Additional arguments will be passed to `func` when it is invoked.
@static
@memberOf _
@category Functions
@param {Function} func The function to defer.
@param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with.
@returns {Number... | [
"Defers",
"executing",
"the",
"func",
"function",
"until",
"the",
"current",
"call",
"stack",
"has",
"cleared",
".",
"Additional",
"arguments",
"will",
"be",
"passed",
"to",
"func",
"when",
"it",
"is",
"invoked",
"."
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L4285-L4288 |
36,733 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | memoize | function memoize(func, resolver) {
var cache = {};
return function() {
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
};
} | javascript | function memoize(func, resolver) {
var cache = {};
return function() {
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
};
} | [
"function",
"memoize",
"(",
"func",
",",
"resolver",
")",
"{",
"var",
"cache",
"=",
"{",
"}",
";",
"return",
"function",
"(",
")",
"{",
"var",
"key",
"=",
"keyPrefix",
"+",
"(",
"resolver",
"?",
"resolver",
".",
"apply",
"(",
"this",
",",
"arguments"... | Creates a function that memoizes the result of `func`. If `resolver` is
passed, it will be used to determine the cache key for storing the result
based on the arguments passed to the memoized function. By default, the first
argument passed to the memoized function is used as the cache key. The `func`
is executed with t... | [
"Creates",
"a",
"function",
"that",
"memoizes",
"the",
"result",
"of",
"func",
".",
"If",
"resolver",
"is",
"passed",
"it",
"will",
"be",
"used",
"to",
"determine",
"the",
"cache",
"key",
"for",
"storing",
"the",
"result",
"based",
"on",
"the",
"arguments"... | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L4335-L4343 |
36,734 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | wrap | function wrap(value, wrapper) {
return function() {
var args = [value];
push.apply(args, arguments);
return wrapper.apply(this, args);
};
} | javascript | function wrap(value, wrapper) {
return function() {
var args = [value];
push.apply(args, arguments);
return wrapper.apply(this, args);
};
} | [
"function",
"wrap",
"(",
"value",
",",
"wrapper",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"args",
"=",
"[",
"value",
"]",
";",
"push",
".",
"apply",
"(",
"args",
",",
"arguments",
")",
";",
"return",
"wrapper",
".",
"apply",
"(",
"thi... | Creates a function that passes `value` to the `wrapper` function as its
first argument. Additional arguments passed to the function are appended
to those passed to the `wrapper` function. The `wrapper` is executed with
the `this` binding of the created function.
@static
@memberOf _
@category Functions
@param {Mixed} v... | [
"Creates",
"a",
"function",
"that",
"passes",
"value",
"to",
"the",
"wrapper",
"function",
"as",
"its",
"first",
"argument",
".",
"Additional",
"arguments",
"passed",
"to",
"the",
"function",
"are",
"appended",
"to",
"those",
"passed",
"to",
"the",
"wrapper",
... | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L4526-L4532 |
36,735 | misoproject/storyboard | dist/miso.storyboard.deps.0.1.0.js | function( obj ) {
_each( slice.call( arguments, 1), function( source ) {
var prop;
for ( prop in source ) {
if ( source[prop] !== void 0 ) {
obj[ prop ] = source[ prop ];
}
}
});
return obj;
} | javascript | function( obj ) {
_each( slice.call( arguments, 1), function( source ) {
var prop;
for ( prop in source ) {
if ( source[prop] !== void 0 ) {
obj[ prop ] = source[ prop ];
}
}
});
return obj;
} | [
"function",
"(",
"obj",
")",
"{",
"_each",
"(",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"function",
"(",
"source",
")",
"{",
"var",
"prop",
";",
"for",
"(",
"prop",
"in",
"source",
")",
"{",
"if",
"(",
"source",
"[",
"prop",
... | _.extend | [
"_",
".",
"extend"
] | 96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec | https://github.com/misoproject/storyboard/blob/96d6cdfe756e0e4f2df7c9a55c414fe93a4c38ec/dist/miso.storyboard.deps.0.1.0.js#L5318-L5330 | |
36,736 | sendanor/json-schema-orm | src/build.js | string_starts_with | function string_starts_with(str, what) {
return (str.substr(0, what.length) === what) ? true : false;
} | javascript | function string_starts_with(str, what) {
return (str.substr(0, what.length) === what) ? true : false;
} | [
"function",
"string_starts_with",
"(",
"str",
",",
"what",
")",
"{",
"return",
"(",
"str",
".",
"substr",
"(",
"0",
",",
"what",
".",
"length",
")",
"===",
"what",
")",
"?",
"true",
":",
"false",
";",
"}"
] | Returns true if `str` starts with same string as `what` | [
"Returns",
"true",
"if",
"str",
"starts",
"with",
"same",
"string",
"as",
"what"
] | c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6 | https://github.com/sendanor/json-schema-orm/blob/c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6/src/build.js#L35-L37 |
36,737 | sendanor/json-schema-orm | src/build.js | create_constructor | function create_constructor(type_name) {
if(Object.prototype.hasOwnProperty.call(constructors, type_name)) {
return constructors[type_name];
}
if(!( Object.prototype.hasOwnProperty.call(_schema.definitions, type_name) && is.def(_schema.definitions[type_name]) )) {
throw new TypeError("No definition for " ... | javascript | function create_constructor(type_name) {
if(Object.prototype.hasOwnProperty.call(constructors, type_name)) {
return constructors[type_name];
}
if(!( Object.prototype.hasOwnProperty.call(_schema.definitions, type_name) && is.def(_schema.definitions[type_name]) )) {
throw new TypeError("No definition for " ... | [
"function",
"create_constructor",
"(",
"type_name",
")",
"{",
"if",
"(",
"Object",
".",
"prototype",
".",
"hasOwnProperty",
".",
"call",
"(",
"constructors",
",",
"type_name",
")",
")",
"{",
"return",
"constructors",
"[",
"type_name",
"]",
";",
"}",
"if",
... | Creates a new constructor unless it's created already | [
"Creates",
"a",
"new",
"constructor",
"unless",
"it",
"s",
"created",
"already"
] | c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6 | https://github.com/sendanor/json-schema-orm/blob/c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6/src/build.js#L40-L132 |
36,738 | sendanor/json-schema-orm | src/build.js | post_user_defines | function post_user_defines(context) {
if(Object.prototype.hasOwnProperty.call(_user_defined_methods, type_name)) {
_user_defined_methods[type_name].call(context, Type, context);
}
} | javascript | function post_user_defines(context) {
if(Object.prototype.hasOwnProperty.call(_user_defined_methods, type_name)) {
_user_defined_methods[type_name].call(context, Type, context);
}
} | [
"function",
"post_user_defines",
"(",
"context",
")",
"{",
"if",
"(",
"Object",
".",
"prototype",
".",
"hasOwnProperty",
".",
"call",
"(",
"_user_defined_methods",
",",
"type_name",
")",
")",
"{",
"_user_defined_methods",
"[",
"type_name",
"]",
".",
"call",
"(... | User-defined methods | [
"User",
"-",
"defined",
"methods"
] | c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6 | https://github.com/sendanor/json-schema-orm/blob/c6d52b3cbefc904e89cab5ad3c4ecfa26aaf4ea6/src/build.js#L123-L127 |
36,739 | cwrc/CWRC-PublicEntityDialogs | src/index.js | setEnabledSources | function setEnabledSources(config) {
for (let source in config) {
setSourceEnabled(source, config[source]);
}
haveSourcesBeenSelected = true;
} | javascript | function setEnabledSources(config) {
for (let source in config) {
setSourceEnabled(source, config[source]);
}
haveSourcesBeenSelected = true;
} | [
"function",
"setEnabledSources",
"(",
"config",
")",
"{",
"for",
"(",
"let",
"source",
"in",
"config",
")",
"{",
"setSourceEnabled",
"(",
"source",
",",
"config",
"[",
"source",
"]",
")",
";",
"}",
"haveSourcesBeenSelected",
"=",
"true",
";",
"}"
] | expects an object whose keys are source names and whose values are boolean | [
"expects",
"an",
"object",
"whose",
"keys",
"are",
"source",
"names",
"and",
"whose",
"values",
"are",
"boolean"
] | 4d828b8f184f8c86f5abbc92cc8e4909ee22b7b4 | https://github.com/cwrc/CWRC-PublicEntityDialogs/blob/4d828b8f184f8c86f5abbc92cc8e4909ee22b7b4/src/index.js#L312-L317 |
36,740 | sehrope/node-pg-spice | index.js | convertParamValues | function convertParamValues(parsedSql, values) {
var ret = [];
_.each(parsedSql.params, function(param) {
if( !_.has(values, param.name) ) {
throw new Error("No value found for parameter: " + param.name);
}
ret.push(values[param.name]);
});
return ret;
} | javascript | function convertParamValues(parsedSql, values) {
var ret = [];
_.each(parsedSql.params, function(param) {
if( !_.has(values, param.name) ) {
throw new Error("No value found for parameter: " + param.name);
}
ret.push(values[param.name]);
});
return ret;
} | [
"function",
"convertParamValues",
"(",
"parsedSql",
",",
"values",
")",
"{",
"var",
"ret",
"=",
"[",
"]",
";",
"_",
".",
"each",
"(",
"parsedSql",
".",
"params",
",",
"function",
"(",
"param",
")",
"{",
"if",
"(",
"!",
"_",
".",
"has",
"(",
"values... | Converts parameter values from object to an array. Parameter value
indexes come from the parsedSql object and a given parameter may
appear in multiple positions. | [
"Converts",
"parameter",
"values",
"from",
"object",
"to",
"an",
"array",
".",
"Parameter",
"value",
"indexes",
"come",
"from",
"the",
"parsedSql",
"object",
"and",
"a",
"given",
"parameter",
"may",
"appear",
"in",
"multiple",
"positions",
"."
] | 943bac3aa0db5c4ac1aa5bc8abb0549950292a63 | https://github.com/sehrope/node-pg-spice/blob/943bac3aa0db5c4ac1aa5bc8abb0549950292a63/index.js#L262-L271 |
36,741 | openmason/cloudd | lib/dag.js | function(links) {
this.dependencies = _buildDependencies(links);
this.tasks = graph.tsort(this.dependencies).reverse();
this.index = 0;
} | javascript | function(links) {
this.dependencies = _buildDependencies(links);
this.tasks = graph.tsort(this.dependencies).reverse();
this.index = 0;
} | [
"function",
"(",
"links",
")",
"{",
"this",
".",
"dependencies",
"=",
"_buildDependencies",
"(",
"links",
")",
";",
"this",
".",
"tasks",
"=",
"graph",
".",
"tsort",
"(",
"this",
".",
"dependencies",
")",
".",
"reverse",
"(",
")",
";",
"this",
".",
"... | DAG - routines related to DAG go here | [
"DAG",
"-",
"routines",
"related",
"to",
"DAG",
"go",
"here"
] | 207bad115a0a4148f35e238fd1121a30b8f0bd5a | https://github.com/openmason/cloudd/blob/207bad115a0a4148f35e238fd1121a30b8f0bd5a/lib/dag.js#L12-L16 | |
36,742 | mozilla/grunt-l10n-lint | lib/check-translation.js | function (tagName, tagAttributes) {
if (this._done) {
return;
}
this._openElementStack.push(tagName);
try {
this._errorIfUnexpectedTag(tagName);
for (var attributeName in tagAttributes) {
var attributeValue = tagAttributes[attributeName];
this._errorIfUnexpectedAttr... | javascript | function (tagName, tagAttributes) {
if (this._done) {
return;
}
this._openElementStack.push(tagName);
try {
this._errorIfUnexpectedTag(tagName);
for (var attributeName in tagAttributes) {
var attributeValue = tagAttributes[attributeName];
this._errorIfUnexpectedAttr... | [
"function",
"(",
"tagName",
",",
"tagAttributes",
")",
"{",
"if",
"(",
"this",
".",
"_done",
")",
"{",
"return",
";",
"}",
"this",
".",
"_openElementStack",
".",
"push",
"(",
"tagName",
")",
";",
"try",
"{",
"this",
".",
"_errorIfUnexpectedTag",
"(",
"... | Check all tags, attributes, and attriute values against
the allowed list in expectedTagsData. | [
"Check",
"all",
"tags",
"attributes",
"and",
"attriute",
"values",
"against",
"the",
"allowed",
"list",
"in",
"expectedTagsData",
"."
] | 287f5cd3b3a6af4fabc524ce4a6086ce8fd17a89 | https://github.com/mozilla/grunt-l10n-lint/blob/287f5cd3b3a6af4fabc524ce4a6086ce8fd17a89/lib/check-translation.js#L212-L231 | |
36,743 | WorldMobileCoin/wmcc-core | src/utils/lru.js | LRUItem | function LRUItem(key, value) {
this.key = key;
this.value = value;
this.next = null;
this.prev = null;
} | javascript | function LRUItem(key, value) {
this.key = key;
this.value = value;
this.next = null;
this.prev = null;
} | [
"function",
"LRUItem",
"(",
"key",
",",
"value",
")",
"{",
"this",
".",
"key",
"=",
"key",
";",
"this",
".",
"value",
"=",
"value",
";",
"this",
".",
"next",
"=",
"null",
";",
"this",
".",
"prev",
"=",
"null",
";",
"}"
] | Represents an LRU item.
@alias module:utils.LRUItem
@constructor
@private
@param {String} key
@param {Object} value | [
"Represents",
"an",
"LRU",
"item",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/lru.js#L424-L429 |
36,744 | WorldMobileCoin/wmcc-core | src/script/scripterror.js | ScriptError | function ScriptError(code, op, ip) {
if (!(this instanceof ScriptError))
return new ScriptError(code, op, ip);
Error.call(this);
this.type = 'ScriptError';
this.code = code;
this.message = code;
this.op = -1;
this.ip = -1;
if (typeof op === 'string') {
this.message = op;
} else if (op) {
... | javascript | function ScriptError(code, op, ip) {
if (!(this instanceof ScriptError))
return new ScriptError(code, op, ip);
Error.call(this);
this.type = 'ScriptError';
this.code = code;
this.message = code;
this.op = -1;
this.ip = -1;
if (typeof op === 'string') {
this.message = op;
} else if (op) {
... | [
"function",
"ScriptError",
"(",
"code",
",",
"op",
",",
"ip",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"ScriptError",
")",
")",
"return",
"new",
"ScriptError",
"(",
"code",
",",
"op",
",",
"ip",
")",
";",
"Error",
".",
"call",
"(",
"thi... | An error thrown from the scripting system,
potentially pertaining to Script execution.
@alias module:script.ScriptError
@constructor
@extends Error
@param {String} code - Error code.
@param {Opcode} op - Opcode.
@param {Number?} ip - Instruction pointer.
@property {String} message - Error message.
@property {String} co... | [
"An",
"error",
"thrown",
"from",
"the",
"scripting",
"system",
"potentially",
"pertaining",
"to",
"Script",
"execution",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/script/scripterror.js#L28-L50 |
36,745 | WorldMobileCoin/wmcc-core | src/protocol/network.js | Network | function Network(options) {
if (!(this instanceof Network))
return new Network(options);
assert(!Network[options.type], 'Cannot create two networks.');
this.type = options.type;
this.seeds = options.seeds;
this.magic = options.magic;
this.port = options.port;
this.checkpointMap = options.checkpointM... | javascript | function Network(options) {
if (!(this instanceof Network))
return new Network(options);
assert(!Network[options.type], 'Cannot create two networks.');
this.type = options.type;
this.seeds = options.seeds;
this.magic = options.magic;
this.port = options.port;
this.checkpointMap = options.checkpointM... | [
"function",
"Network",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Network",
")",
")",
"return",
"new",
"Network",
"(",
"options",
")",
";",
"assert",
"(",
"!",
"Network",
"[",
"options",
".",
"type",
"]",
",",
"'Cannot create... | Represents a network.
@alias module:protocol.Network
@constructor
@param {Object|NetworkType} options - See {@link module:network}. | [
"Represents",
"a",
"network",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/protocol/network.js#L27-L63 |
36,746 | lukebond/json-override | json-override.js | overwriteKeys | function overwriteKeys(baseObject, overrideObject, createNew) {
if (!baseObject) {
baseObject = {};
}
if (createNew) {
baseObject = JSON.parse(JSON.stringify(baseObject));
}
Object.keys(overrideObject).forEach(function(key) {
if (isObjectAndNotArray(baseObject[key]) && isObjectAndNotArray(override... | javascript | function overwriteKeys(baseObject, overrideObject, createNew) {
if (!baseObject) {
baseObject = {};
}
if (createNew) {
baseObject = JSON.parse(JSON.stringify(baseObject));
}
Object.keys(overrideObject).forEach(function(key) {
if (isObjectAndNotArray(baseObject[key]) && isObjectAndNotArray(override... | [
"function",
"overwriteKeys",
"(",
"baseObject",
",",
"overrideObject",
",",
"createNew",
")",
"{",
"if",
"(",
"!",
"baseObject",
")",
"{",
"baseObject",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"createNew",
")",
"{",
"baseObject",
"=",
"JSON",
".",
"parse",
... | 'createNew' defaults to false | [
"createNew",
"defaults",
"to",
"false"
] | 2a3403765de6350a231e7ec41788f71008ca8a17 | https://github.com/lukebond/json-override/blob/2a3403765de6350a231e7ec41788f71008ca8a17/json-override.js#L6-L22 |
36,747 | gsdriver/blackjack-strategy | src/Suggestion.js | ShouldPlayerStand | function ShouldPlayerStand(playerCards, dealerCard, handValue, handCount, options)
{
var shouldStand = false;
if (handValue.soft)
{
// Don't stand until you hit 18
if (handValue.total > 18)
{
shouldStand = true;
}
else if (handValue.total == 18)
{... | javascript | function ShouldPlayerStand(playerCards, dealerCard, handValue, handCount, options)
{
var shouldStand = false;
if (handValue.soft)
{
// Don't stand until you hit 18
if (handValue.total > 18)
{
shouldStand = true;
}
else if (handValue.total == 18)
{... | [
"function",
"ShouldPlayerStand",
"(",
"playerCards",
",",
"dealerCard",
",",
"handValue",
",",
"handCount",
",",
"options",
")",
"{",
"var",
"shouldStand",
"=",
"false",
";",
"if",
"(",
"handValue",
".",
"soft",
")",
"{",
"// Don't stand until you hit 18",
"if",... | Stand Strategy Note that we've already checkd other actions such as double, split, and surrender So at this point we're only assessing whether you should stand as opposed to hitting | [
"Stand",
"Strategy",
"Note",
"that",
"we",
"ve",
"already",
"checkd",
"other",
"actions",
"such",
"as",
"double",
"split",
"and",
"surrender",
"So",
"at",
"this",
"point",
"we",
"re",
"only",
"assessing",
"whether",
"you",
"should",
"stand",
"as",
"opposed",... | dfcb976ab9bb33c74c24c9bacf369e8ffb6506f3 | https://github.com/gsdriver/blackjack-strategy/blob/dfcb976ab9bb33c74c24c9bacf369e8ffb6506f3/src/Suggestion.js#L524-L568 |
36,748 | WorldMobileCoin/wmcc-core | src/net/pool.js | Pool | function Pool(options) {
if (!(this instanceof Pool))
return new Pool(options);
AsyncObject.call(this);
this.options = new PoolOptions(options);
this.network = this.options.network;
this.logger = this.options.logger.context('net');
this.chain = this.options.chain;
this.mempool = this.options.mempoo... | javascript | function Pool(options) {
if (!(this instanceof Pool))
return new Pool(options);
AsyncObject.call(this);
this.options = new PoolOptions(options);
this.network = this.options.network;
this.logger = this.options.logger.context('net');
this.chain = this.options.chain;
this.mempool = this.options.mempoo... | [
"function",
"Pool",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Pool",
")",
")",
"return",
"new",
"Pool",
"(",
"options",
")",
";",
"AsyncObject",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"options",
"=",
"new",
"Po... | A pool of peers for handling all network activity.
@alias module:net.Pool
@constructor
@param {Object} options
@param {Chain} options.chain
@param {Mempool?} options.mempool
@param {Number?} [options.maxOutbound=8] - Maximum number of peers.
@param {Boolean?} options.spv - Do an SPV sync.
@param {Boolean?} options.noRe... | [
"A",
"pool",
"of",
"peers",
"for",
"handling",
"all",
"network",
"activity",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/pool.js#L79-L124 |
36,749 | WorldMobileCoin/wmcc-core | src/primitives/txmeta.js | TXMeta | function TXMeta(options) {
if (!(this instanceof TXMeta))
return new TXMeta(options);
this.tx = new TX();
this.mtime = util.now();
this.height = -1;
this.block = null;
this.time = 0;
this.index = -1;
if (options)
this.fromOptions(options);
} | javascript | function TXMeta(options) {
if (!(this instanceof TXMeta))
return new TXMeta(options);
this.tx = new TX();
this.mtime = util.now();
this.height = -1;
this.block = null;
this.time = 0;
this.index = -1;
if (options)
this.fromOptions(options);
} | [
"function",
"TXMeta",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"TXMeta",
")",
")",
"return",
"new",
"TXMeta",
"(",
"options",
")",
";",
"this",
".",
"tx",
"=",
"new",
"TX",
"(",
")",
";",
"this",
".",
"mtime",
"=",
"ut... | An extended transaction object.
@alias module:primitives.TXMeta
@constructor
@param {Object} options | [
"An",
"extended",
"transaction",
"object",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/primitives/txmeta.js#L26-L39 |
36,750 | WorldMobileCoin/wmcc-core | src/bip70/paymentack.js | PaymentACK | function PaymentACK(options) {
if (!(this instanceof PaymentACK))
return new PaymentACK(options);
this.payment = new Payment();
this.memo = null;
if (options)
this.fromOptions(options);
} | javascript | function PaymentACK(options) {
if (!(this instanceof PaymentACK))
return new PaymentACK(options);
this.payment = new Payment();
this.memo = null;
if (options)
this.fromOptions(options);
} | [
"function",
"PaymentACK",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"PaymentACK",
")",
")",
"return",
"new",
"PaymentACK",
"(",
"options",
")",
";",
"this",
".",
"payment",
"=",
"new",
"Payment",
"(",
")",
";",
"this",
".",
... | Represents a BIP70 payment ack.
@alias module:bip70.PaymentACK
@constructor
@param {Object?} options
@property {Payment} payment
@property {String|null} memo | [
"Represents",
"a",
"BIP70",
"payment",
"ack",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/bip70/paymentack.js#L27-L36 |
36,751 | WorldMobileCoin/wmcc-core | src/crypto/sha256.js | hash256 | function hash256(data) {
const out = Buffer.allocUnsafe(32);
ctx.init();
ctx.update(data);
ctx._finish(out);
ctx.init();
ctx.update(out);
ctx._finish(out);
return out;
} | javascript | function hash256(data) {
const out = Buffer.allocUnsafe(32);
ctx.init();
ctx.update(data);
ctx._finish(out);
ctx.init();
ctx.update(out);
ctx._finish(out);
return out;
} | [
"function",
"hash256",
"(",
"data",
")",
"{",
"const",
"out",
"=",
"Buffer",
".",
"allocUnsafe",
"(",
"32",
")",
";",
"ctx",
".",
"init",
"(",
")",
";",
"ctx",
".",
"update",
"(",
"data",
")",
";",
"ctx",
".",
"_finish",
"(",
"out",
")",
";",
"... | Hash buffer with double sha256.
@alias module:crypto/sha256.hash256
@param {Buffer} data
@returns {Buffer} | [
"Hash",
"buffer",
"with",
"double",
"sha256",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/crypto/sha256.js#L367-L376 |
36,752 | WorldMobileCoin/wmcc-core | src/crypto/sha256.js | hmac | function hmac(data, key) {
mctx.init(key);
mctx.update(data);
return mctx.finish();
} | javascript | function hmac(data, key) {
mctx.init(key);
mctx.update(data);
return mctx.finish();
} | [
"function",
"hmac",
"(",
"data",
",",
"key",
")",
"{",
"mctx",
".",
"init",
"(",
"key",
")",
";",
"mctx",
".",
"update",
"(",
"data",
")",
";",
"return",
"mctx",
".",
"finish",
"(",
")",
";",
"}"
] | Create a sha256 HMAC from buffer and key.
@alias module:crypto/sha256.hmac
@param {Buffer} data
@param {Buffer} key
@returns {Buffer} | [
"Create",
"a",
"sha256",
"HMAC",
"from",
"buffer",
"and",
"key",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/crypto/sha256.js#L386-L390 |
36,753 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | polymod | function polymod(pre) {
const b = pre >>> 25;
return ((pre & 0x1ffffff) << 5)
^ (-((b >> 0) & 1) & 0x3b6a57b2)
^ (-((b >> 1) & 1) & 0x26508e6d)
^ (-((b >> 2) & 1) & 0x1ea119fa)
^ (-((b >> 3) & 1) & 0x3d4233dd)
^ (-((b >> 4) & 1) & 0x2a1462b3);
} | javascript | function polymod(pre) {
const b = pre >>> 25;
return ((pre & 0x1ffffff) << 5)
^ (-((b >> 0) & 1) & 0x3b6a57b2)
^ (-((b >> 1) & 1) & 0x26508e6d)
^ (-((b >> 2) & 1) & 0x1ea119fa)
^ (-((b >> 3) & 1) & 0x3d4233dd)
^ (-((b >> 4) & 1) & 0x2a1462b3);
} | [
"function",
"polymod",
"(",
"pre",
")",
"{",
"const",
"b",
"=",
"pre",
">>>",
"25",
";",
"return",
"(",
"(",
"pre",
"&",
"0x1ffffff",
")",
"<<",
"5",
")",
"^",
"(",
"-",
"(",
"(",
"b",
">>",
"0",
")",
"&",
"1",
")",
"&",
"0x3b6a57b2",
")",
... | Update checksum.
@ignore
@param {Number} chk
@returns {Number} | [
"Update",
"checksum",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L62-L70 |
36,754 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | serialize | function serialize(hrp, data) {
let chk = 1;
let i;
for (i = 0; i < hrp.length; i++) {
const ch = hrp.charCodeAt(i);
if ((ch >> 5) === 0)
throw new Error('Invalid bech32 character.');
chk = polymod(chk) ^ (ch >> 5);
}
if (i + 7 + data.length > 90)
throw new Error('Invalid bech32 data... | javascript | function serialize(hrp, data) {
let chk = 1;
let i;
for (i = 0; i < hrp.length; i++) {
const ch = hrp.charCodeAt(i);
if ((ch >> 5) === 0)
throw new Error('Invalid bech32 character.');
chk = polymod(chk) ^ (ch >> 5);
}
if (i + 7 + data.length > 90)
throw new Error('Invalid bech32 data... | [
"function",
"serialize",
"(",
"hrp",
",",
"data",
")",
"{",
"let",
"chk",
"=",
"1",
";",
"let",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"hrp",
".",
"length",
";",
"i",
"++",
")",
"{",
"const",
"ch",
"=",
"hrp",
".",
"charCodeAt",
... | Encode hrp and data as a bech32 string.
@ignore
@param {String} hrp
@param {Buffer} data
@returns {String} | [
"Encode",
"hrp",
"and",
"data",
"as",
"a",
"bech32",
"string",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L80-L127 |
36,755 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | deserialize | function deserialize(str) {
let dlen = 0;
if (str.length < 8 || str.length > 90)
throw new Error('Invalid bech32 string length.');
while (dlen < str.length && str[(str.length - 1) - dlen] !== '1')
dlen++;
const hlen = str.length - (1 + dlen);
if (hlen < 1 || dlen < 6)
throw new Error('Invalid ... | javascript | function deserialize(str) {
let dlen = 0;
if (str.length < 8 || str.length > 90)
throw new Error('Invalid bech32 string length.');
while (dlen < str.length && str[(str.length - 1) - dlen] !== '1')
dlen++;
const hlen = str.length - (1 + dlen);
if (hlen < 1 || dlen < 6)
throw new Error('Invalid ... | [
"function",
"deserialize",
"(",
"str",
")",
"{",
"let",
"dlen",
"=",
"0",
";",
"if",
"(",
"str",
".",
"length",
"<",
"8",
"||",
"str",
".",
"length",
">",
"90",
")",
"throw",
"new",
"Error",
"(",
"'Invalid bech32 string length.'",
")",
";",
"while",
... | Decode a bech32 string.
@param {String} str
@returns {Array} [hrp, data] | [
"Decode",
"a",
"bech32",
"string",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L135-L210 |
36,756 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | convert | function convert(data, output, frombits, tobits, pad, off) {
const maxv = (1 << tobits) - 1;
let acc = 0;
let bits = 0;
let j = 0;
if (pad !== -1)
output[j++] = pad;
for (let i = off; i < data.length; i++) {
const value = data[i];
if ((value >> frombits) !== 0)
throw new Error('Invalid ... | javascript | function convert(data, output, frombits, tobits, pad, off) {
const maxv = (1 << tobits) - 1;
let acc = 0;
let bits = 0;
let j = 0;
if (pad !== -1)
output[j++] = pad;
for (let i = off; i < data.length; i++) {
const value = data[i];
if ((value >> frombits) !== 0)
throw new Error('Invalid ... | [
"function",
"convert",
"(",
"data",
",",
"output",
",",
"frombits",
",",
"tobits",
",",
"pad",
",",
"off",
")",
"{",
"const",
"maxv",
"=",
"(",
"1",
"<<",
"tobits",
")",
"-",
"1",
";",
"let",
"acc",
"=",
"0",
";",
"let",
"bits",
"=",
"0",
";",
... | Convert serialized data to bits,
suitable to be serialized as bech32.
@param {Buffer} data
@param {Buffer} output
@param {Number} frombits
@param {Number} tobits
@param {Number} pad
@param {Number} off
@returns {Buffer} | [
"Convert",
"serialized",
"data",
"to",
"bits",
"suitable",
"to",
"be",
"serialized",
"as",
"bech32",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L224-L257 |
36,757 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | encode | function encode(hrp, version, hash) {
const output = POOL65;
if (version < 0 || version > 16)
throw new Error('Invalid bech32 version.');
if (hash.length < 2 || hash.length > 40)
throw new Error('Invalid bech32 data length.');
const data = convert(hash, output, 8, 5, version, 0);
return serialize(... | javascript | function encode(hrp, version, hash) {
const output = POOL65;
if (version < 0 || version > 16)
throw new Error('Invalid bech32 version.');
if (hash.length < 2 || hash.length > 40)
throw new Error('Invalid bech32 data length.');
const data = convert(hash, output, 8, 5, version, 0);
return serialize(... | [
"function",
"encode",
"(",
"hrp",
",",
"version",
",",
"hash",
")",
"{",
"const",
"output",
"=",
"POOL65",
";",
"if",
"(",
"version",
"<",
"0",
"||",
"version",
">",
"16",
")",
"throw",
"new",
"Error",
"(",
"'Invalid bech32 version.'",
")",
";",
"if",
... | Serialize data to bech32 address.
@param {String} hrp
@param {Number} version
@param {Buffer} hash
@returns {String} | [
"Serialize",
"data",
"to",
"bech32",
"address",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L267-L279 |
36,758 | WorldMobileCoin/wmcc-core | src/utils/bech32.js | decode | function decode(str) {
const [hrp, data] = deserialize(str);
if (data.length === 0 || data.length > 65)
throw new Error('Invalid bech32 data length.');
if (data[0] > 16)
throw new Error('Invalid bech32 version.');
const version = data[0];
const output = data;
const hash = convert(data, output, 5,... | javascript | function decode(str) {
const [hrp, data] = deserialize(str);
if (data.length === 0 || data.length > 65)
throw new Error('Invalid bech32 data length.');
if (data[0] > 16)
throw new Error('Invalid bech32 version.');
const version = data[0];
const output = data;
const hash = convert(data, output, 5,... | [
"function",
"decode",
"(",
"str",
")",
"{",
"const",
"[",
"hrp",
",",
"data",
"]",
"=",
"deserialize",
"(",
"str",
")",
";",
"if",
"(",
"data",
".",
"length",
"===",
"0",
"||",
"data",
".",
"length",
">",
"65",
")",
"throw",
"new",
"Error",
"(",
... | Deserialize data from bech32 address.
@param {String} str
@returns {Object} | [
"Deserialize",
"data",
"from",
"bech32",
"address",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/bech32.js#L290-L307 |
36,759 | WorldMobileCoin/wmcc-core | src/primitives/netaddress.js | NetAddress | function NetAddress(options) {
if (!(this instanceof NetAddress))
return new NetAddress(options);
this.host = '0.0.0.0';
this.port = 0;
this.services = 0;
this.time = 0;
this.hostname = '0.0.0.0:0';
this.raw = IP.ZERO_IP;
if (options)
this.fromOptions(options);
} | javascript | function NetAddress(options) {
if (!(this instanceof NetAddress))
return new NetAddress(options);
this.host = '0.0.0.0';
this.port = 0;
this.services = 0;
this.time = 0;
this.hostname = '0.0.0.0:0';
this.raw = IP.ZERO_IP;
if (options)
this.fromOptions(options);
} | [
"function",
"NetAddress",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"NetAddress",
")",
")",
"return",
"new",
"NetAddress",
"(",
"options",
")",
";",
"this",
".",
"host",
"=",
"'0.0.0.0'",
";",
"this",
".",
"port",
"=",
"0",
... | Represents a network address.
@alias module:primitives.NetAddress
@constructor
@param {Object} options
@param {Number?} options.time - Timestamp.
@param {Number?} options.services - Service bits.
@param {String?} options.host - IP address (IPv6 or IPv4).
@param {Number?} options.port - Port.
@property {Host} host
@prop... | [
"Represents",
"a",
"network",
"address",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/primitives/netaddress.js#L36-L49 |
36,760 | perfectapi/node-perfectapi | lib/worker.js | function(err, commandName, config, resultFunction) {
//max Number in javascript is 9,007,199,254,740,992. At 10,000 requests per second, that is 28,561 years until we get an overflow on messageId
messageId += 1;
messageStack[messageId] = resultFunction;
//tell the parent process to run t... | javascript | function(err, commandName, config, resultFunction) {
//max Number in javascript is 9,007,199,254,740,992. At 10,000 requests per second, that is 28,561 years until we get an overflow on messageId
messageId += 1;
messageStack[messageId] = resultFunction;
//tell the parent process to run t... | [
"function",
"(",
"err",
",",
"commandName",
",",
"config",
",",
"resultFunction",
")",
"{",
"//max Number in javascript is 9,007,199,254,740,992. At 10,000 requests per second, that is 28,561 years until we get an overflow on messageId",
"messageId",
"+=",
"1",
";",
"messageStack",
... | define a function for the webserver to call when it receives a command | [
"define",
"a",
"function",
"for",
"the",
"webserver",
"to",
"call",
"when",
"it",
"receives",
"a",
"command"
] | aea295ede31994bf7f3c2903cedbe6d316b30062 | https://github.com/perfectapi/node-perfectapi/blob/aea295ede31994bf7f3c2903cedbe6d316b30062/lib/worker.js#L34-L41 | |
36,761 | WorldMobileCoin/wmcc-core | src/utils/murmur3.js | murmur3 | function murmur3(data, seed) {
const tail = data.length - (data.length % 4);
const c1 = 0xcc9e2d51;
const c2 = 0x1b873593;
let h1 = seed;
let k1;
for (let i = 0; i < tail; i += 4) {
k1 = (data[i + 3] << 24)
| (data[i + 2] << 16)
| (data[i + 1] << 8)
| data[i];
k1 = mul32(k1, c1);
... | javascript | function murmur3(data, seed) {
const tail = data.length - (data.length % 4);
const c1 = 0xcc9e2d51;
const c2 = 0x1b873593;
let h1 = seed;
let k1;
for (let i = 0; i < tail; i += 4) {
k1 = (data[i + 3] << 24)
| (data[i + 2] << 16)
| (data[i + 1] << 8)
| data[i];
k1 = mul32(k1, c1);
... | [
"function",
"murmur3",
"(",
"data",
",",
"seed",
")",
"{",
"const",
"tail",
"=",
"data",
".",
"length",
"-",
"(",
"data",
".",
"length",
"%",
"4",
")",
";",
"const",
"c1",
"=",
"0xcc9e2d51",
";",
"const",
"c2",
"=",
"0x1b873593",
";",
"let",
"h1",
... | Murmur3 hash.
@alias module:utils.murmur3
@param {Buffer} data
@param {Number} seed
@returns {Number} | [
"Murmur3",
"hash",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/murmur3.js#L24-L69 |
36,762 | WorldMobileCoin/wmcc-core | src/blockchain/chain.js | Chain | function Chain(options) {
if (!(this instanceof Chain))
return new Chain(options);
AsyncObject.call(this);
this.options = new ChainOptions(options);
this.network = this.options.network;
this.logger = this.options.logger.context('chain');
this.workers = this.options.workers;
this.db = new ChainDB(t... | javascript | function Chain(options) {
if (!(this instanceof Chain))
return new Chain(options);
AsyncObject.call(this);
this.options = new ChainOptions(options);
this.network = this.options.network;
this.logger = this.options.logger.context('chain');
this.workers = this.options.workers;
this.db = new ChainDB(t... | [
"function",
"Chain",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Chain",
")",
")",
"return",
"new",
"Chain",
"(",
"options",
")",
";",
"AsyncObject",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"options",
"=",
"new",
... | Represents a blockchain.
@alias module:blockchain.Chain
@constructor
@param {Object} options
@param {String?} options.name - Database name.
@param {String?} options.location - Database file location.
@param {String?} options.db - Database backend (`"leveldb"` by default).
@param {Number?} options.maxOrphans
@param {Boo... | [
"Represents",
"a",
"blockchain",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/blockchain/chain.js#L68-L103 |
36,763 | WorldMobileCoin/wmcc-core | src/blockchain/chain.js | DeploymentState | function DeploymentState() {
if (!(this instanceof DeploymentState))
return new DeploymentState();
this.flags = Script.flags.MANDATORY_VERIFY_FLAGS;
this.flags &= ~Script.flags.VERIFY_P2SH;
this.lockFlags = common.lockFlags.MANDATORY_LOCKTIME_FLAGS;
this.bip34 = false;
this.bip91 = false;
this.bip148... | javascript | function DeploymentState() {
if (!(this instanceof DeploymentState))
return new DeploymentState();
this.flags = Script.flags.MANDATORY_VERIFY_FLAGS;
this.flags &= ~Script.flags.VERIFY_P2SH;
this.lockFlags = common.lockFlags.MANDATORY_LOCKTIME_FLAGS;
this.bip34 = false;
this.bip91 = false;
this.bip148... | [
"function",
"DeploymentState",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"DeploymentState",
")",
")",
"return",
"new",
"DeploymentState",
"(",
")",
";",
"this",
".",
"flags",
"=",
"Script",
".",
"flags",
".",
"MANDATORY_VERIFY_FLAGS",
";",
... | Represents the deployment state of the chain.
@alias module:blockchain.DeploymentState
@constructor
@property {VerifyFlags} flags
@property {LockFlags} lockFlags
@property {Boolean} bip34 | [
"Represents",
"the",
"deployment",
"state",
"of",
"the",
"chain",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/blockchain/chain.js#L3110-L3120 |
36,764 | Mercateo/less-plugin-bower-resolve | lib/bower-file-manager.js | createVirtualLessFileFromBowerJson | function createVirtualLessFileFromBowerJson(bowerJsonPath) {
return new PromiseConstructor(function(fullfill, reject) {
bowerJson.read(bowerJsonPath, { validate: false }, function(err, bowerJsonData) {
if (err) {
return reject(err);
}
if (!bowerJsonData.main) {
err = bowerJsonPat... | javascript | function createVirtualLessFileFromBowerJson(bowerJsonPath) {
return new PromiseConstructor(function(fullfill, reject) {
bowerJson.read(bowerJsonPath, { validate: false }, function(err, bowerJsonData) {
if (err) {
return reject(err);
}
if (!bowerJsonData.main) {
err = bowerJsonPat... | [
"function",
"createVirtualLessFileFromBowerJson",
"(",
"bowerJsonPath",
")",
"{",
"return",
"new",
"PromiseConstructor",
"(",
"function",
"(",
"fullfill",
",",
"reject",
")",
"{",
"bowerJson",
".",
"read",
"(",
"bowerJsonPath",
",",
"{",
"validate",
":",
"false",
... | Tries to convert a Bower JSON into a virtual Less file.
@param {string} bowerJsonPath
@returns {PromiseConstructor} | [
"Tries",
"to",
"convert",
"a",
"Bower",
"JSON",
"into",
"a",
"virtual",
"Less",
"file",
"."
] | f346cad68e90e4c445ebd3ccc95ed9d18ecaca86 | https://github.com/Mercateo/less-plugin-bower-resolve/blob/f346cad68e90e4c445ebd3ccc95ed9d18ecaca86/lib/bower-file-manager.js#L25-L55 |
36,765 | Karnith/machinepack-sailsgulpify | lib/gulp/index.js | function (cb) {
sails.log.verbose('Loading app Gulpfile...');
// Start task depending on environment
if(sails.config.environment === 'production'){
return this.runTask('prod', cb);
}
this.runTask('default', cb);
} | javascript | function (cb) {
sails.log.verbose('Loading app Gulpfile...');
// Start task depending on environment
if(sails.config.environment === 'production'){
return this.runTask('prod', cb);
}
this.runTask('default', cb);
} | [
"function",
"(",
"cb",
")",
"{",
"sails",
".",
"log",
".",
"verbose",
"(",
"'Loading app Gulpfile...'",
")",
";",
"// Start task depending on environment",
"if",
"(",
"sails",
".",
"config",
".",
"environment",
"===",
"'production'",
")",
"{",
"return",
"this",
... | Initialize this project's Grunt tasks
and execute the environment-specific gulpfile | [
"Initialize",
"this",
"project",
"s",
"Grunt",
"tasks",
"and",
"execute",
"the",
"environment",
"-",
"specific",
"gulpfile"
] | 38424f98d59cac4240e676159bd25e3bc82ad8ac | https://github.com/Karnith/machinepack-sailsgulpify/blob/38424f98d59cac4240e676159bd25e3bc82ad8ac/lib/gulp/index.js#L25-L35 | |
36,766 | Karnith/machinepack-sailsgulpify | lib/gulp/index.js | _sanitize | function _sanitize (chunk) {
if (chunk && typeof chunk === 'object' && chunk.toString) {
chunk = chunk.toString();
}
if (typeof chunk === 'string') {
chunk = chunk.replace(/^[\s\n]*/, '');
chunk = chunk.replace(/[\s\n]*$/, '');
}
return chunk;
} | javascript | function _sanitize (chunk) {
if (chunk && typeof chunk === 'object' && chunk.toString) {
chunk = chunk.toString();
}
if (typeof chunk === 'string') {
chunk = chunk.replace(/^[\s\n]*/, '');
chunk = chunk.replace(/[\s\n]*$/, '');
}
return chunk;
} | [
"function",
"_sanitize",
"(",
"chunk",
")",
"{",
"if",
"(",
"chunk",
"&&",
"typeof",
"chunk",
"===",
"'object'",
"&&",
"chunk",
".",
"toString",
")",
"{",
"chunk",
"=",
"chunk",
".",
"toString",
"(",
")",
";",
"}",
"if",
"(",
"typeof",
"chunk",
"==="... | After ensuring a chunk is a string, trim any leading or
trailing whitespace. If chunk cannot be nicely casted to a string,
pass it straight through.
@param {*} chunk
@return {*} | [
"After",
"ensuring",
"a",
"chunk",
"is",
"a",
"string",
"trim",
"any",
"leading",
"or",
"trailing",
"whitespace",
".",
"If",
"chunk",
"cannot",
"be",
"nicely",
"casted",
"to",
"a",
"string",
"pass",
"it",
"straight",
"through",
"."
] | 38424f98d59cac4240e676159bd25e3bc82ad8ac | https://github.com/Karnith/machinepack-sailsgulpify/blob/38424f98d59cac4240e676159bd25e3bc82ad8ac/lib/gulp/index.js#L203-L213 |
36,767 | jedmao/blink | js/lib/overrides/background.js | background | function background(options) {
options = options || {};
// ReSharper disable once UnusedParameter
return function (config) {
var values = [];
[
'attachment',
'clip',
'color',
'image',
'origin',
'position',
'r... | javascript | function background(options) {
options = options || {};
// ReSharper disable once UnusedParameter
return function (config) {
var values = [];
[
'attachment',
'clip',
'color',
'image',
'origin',
'position',
'r... | [
"function",
"background",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// ReSharper disable once UnusedParameter",
"return",
"function",
"(",
"config",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"[",
"'attachment'",
",",
"'c... | ReSharper disable once UnusedLocals | [
"ReSharper",
"disable",
"once",
"UnusedLocals"
] | f80fb591d33ee0cf063b6d6afae897e69ffcf407 | https://github.com/jedmao/blink/blob/f80fb591d33ee0cf063b6d6afae897e69ffcf407/js/lib/overrides/background.js#L2-L26 |
36,768 | WorldMobileCoin/wmcc-core | src/net/packets.js | PingPacket | function PingPacket(nonce) {
if (!(this instanceof PingPacket))
return new PingPacket(nonce);
Packet.call(this);
this.nonce = nonce || null;
} | javascript | function PingPacket(nonce) {
if (!(this instanceof PingPacket))
return new PingPacket(nonce);
Packet.call(this);
this.nonce = nonce || null;
} | [
"function",
"PingPacket",
"(",
"nonce",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"PingPacket",
")",
")",
"return",
"new",
"PingPacket",
"(",
"nonce",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"nonce",
"=",
"nonc... | Represents a `ping` packet.
@constructor
@param {BN?} nonce
@property {BN|null} nonce | [
"Represents",
"a",
"ping",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L408-L415 |
36,769 | WorldMobileCoin/wmcc-core | src/net/packets.js | PongPacket | function PongPacket(nonce) {
if (!(this instanceof PongPacket))
return new PongPacket(nonce);
Packet.call(this);
this.nonce = nonce || encoding.ZERO_U64;
} | javascript | function PongPacket(nonce) {
if (!(this instanceof PongPacket))
return new PongPacket(nonce);
Packet.call(this);
this.nonce = nonce || encoding.ZERO_U64;
} | [
"function",
"PongPacket",
"(",
"nonce",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"PongPacket",
")",
")",
"return",
"new",
"PongPacket",
"(",
"nonce",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"nonce",
"=",
"nonc... | Represents a `pong` packet.
@constructor
@param {BN?} nonce
@property {BN} nonce | [
"Represents",
"a",
"pong",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L504-L511 |
36,770 | WorldMobileCoin/wmcc-core | src/net/packets.js | GetBlocksPacket | function GetBlocksPacket(locator, stop) {
if (!(this instanceof GetBlocksPacket))
return new GetBlocksPacket(locator, stop);
Packet.call(this);
this.version = common.PROTOCOL_VERSION;
this.locator = locator || [];
this.stop = stop || null;
} | javascript | function GetBlocksPacket(locator, stop) {
if (!(this instanceof GetBlocksPacket))
return new GetBlocksPacket(locator, stop);
Packet.call(this);
this.version = common.PROTOCOL_VERSION;
this.locator = locator || [];
this.stop = stop || null;
} | [
"function",
"GetBlocksPacket",
"(",
"locator",
",",
"stop",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"GetBlocksPacket",
")",
")",
"return",
"new",
"GetBlocksPacket",
"(",
"locator",
",",
"stop",
")",
";",
"Packet",
".",
"call",
"(",
"this",
"... | Represents a `getblocks` packet.
@constructor
@param {Hash[]} locator
@param {Hash?} stop
@property {Hash[]} locator
@property {Hash|null} stop | [
"Represents",
"a",
"getblocks",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L928-L937 |
36,771 | WorldMobileCoin/wmcc-core | src/net/packets.js | GetHeadersPacket | function GetHeadersPacket(locator, stop) {
if (!(this instanceof GetHeadersPacket))
return new GetHeadersPacket(locator, stop);
GetBlocksPacket.call(this, locator, stop);
} | javascript | function GetHeadersPacket(locator, stop) {
if (!(this instanceof GetHeadersPacket))
return new GetHeadersPacket(locator, stop);
GetBlocksPacket.call(this, locator, stop);
} | [
"function",
"GetHeadersPacket",
"(",
"locator",
",",
"stop",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"GetHeadersPacket",
")",
")",
"return",
"new",
"GetHeadersPacket",
"(",
"locator",
",",
"stop",
")",
";",
"GetBlocksPacket",
".",
"call",
"(",
... | Represents a `getheaders` packet.
@extends GetBlocksPacket
@constructor
@param {Hash[]} locator
@param {Hash?} stop | [
"Represents",
"a",
"getheaders",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1042-L1047 |
36,772 | WorldMobileCoin/wmcc-core | src/net/packets.js | BlockPacket | function BlockPacket(block, witness) {
if (!(this instanceof BlockPacket))
return new BlockPacket(block, witness);
Packet.call(this);
this.block = block || new MemBlock();
this.witness = witness || false;
} | javascript | function BlockPacket(block, witness) {
if (!(this instanceof BlockPacket))
return new BlockPacket(block, witness);
Packet.call(this);
this.block = block || new MemBlock();
this.witness = witness || false;
} | [
"function",
"BlockPacket",
"(",
"block",
",",
"witness",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"BlockPacket",
")",
")",
"return",
"new",
"BlockPacket",
"(",
"block",
",",
"witness",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",... | Represents a `block` packet.
@constructor
@param {Block|null} block
@param {Boolean?} witness
@property {Block} block
@property {Boolean} witness | [
"Represents",
"a",
"block",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1229-L1237 |
36,773 | WorldMobileCoin/wmcc-core | src/net/packets.js | TXPacket | function TXPacket(tx, witness) {
if (!(this instanceof TXPacket))
return new TXPacket(tx, witness);
Packet.call(this);
this.tx = tx || new TX();
this.witness = witness || false;
} | javascript | function TXPacket(tx, witness) {
if (!(this instanceof TXPacket))
return new TXPacket(tx, witness);
Packet.call(this);
this.tx = tx || new TX();
this.witness = witness || false;
} | [
"function",
"TXPacket",
"(",
"tx",
",",
"witness",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"TXPacket",
")",
")",
"return",
"new",
"TXPacket",
"(",
"tx",
",",
"witness",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".... | Represents a `tx` packet.
@constructor
@param {TX|null} tx
@param {Boolean?} witness
@property {TX} block
@property {Boolean} witness | [
"Represents",
"a",
"tx",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1331-L1339 |
36,774 | WorldMobileCoin/wmcc-core | src/net/packets.js | FilterLoadPacket | function FilterLoadPacket(filter) {
if (!(this instanceof FilterLoadPacket))
return new FilterLoadPacket(filter);
Packet.call(this);
this.filter = filter || new Bloom();
} | javascript | function FilterLoadPacket(filter) {
if (!(this instanceof FilterLoadPacket))
return new FilterLoadPacket(filter);
Packet.call(this);
this.filter = filter || new Bloom();
} | [
"function",
"FilterLoadPacket",
"(",
"filter",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"FilterLoadPacket",
")",
")",
"return",
"new",
"FilterLoadPacket",
"(",
"filter",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"fi... | Represents a `filterload` packet.
@constructor
@param {Bloom|null} filter | [
"Represents",
"a",
"filterload",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1770-L1777 |
36,775 | WorldMobileCoin/wmcc-core | src/net/packets.js | FilterAddPacket | function FilterAddPacket(data) {
if (!(this instanceof FilterAddPacket))
return new FilterAddPacket(data);
Packet.call(this);
this.data = data || DUMMY;
} | javascript | function FilterAddPacket(data) {
if (!(this instanceof FilterAddPacket))
return new FilterAddPacket(data);
Packet.call(this);
this.data = data || DUMMY;
} | [
"function",
"FilterAddPacket",
"(",
"data",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"FilterAddPacket",
")",
")",
"return",
"new",
"FilterAddPacket",
"(",
"data",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"data",
... | Represents a `filteradd` packet.
@constructor
@param {Buffer?} data
@property {Buffer} data | [
"Represents",
"a",
"filteradd",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1872-L1879 |
36,776 | WorldMobileCoin/wmcc-core | src/net/packets.js | MerkleBlockPacket | function MerkleBlockPacket(block) {
if (!(this instanceof MerkleBlockPacket))
return new MerkleBlockPacket(block);
Packet.call(this);
this.block = block || new MerkleBlock();
} | javascript | function MerkleBlockPacket(block) {
if (!(this instanceof MerkleBlockPacket))
return new MerkleBlockPacket(block);
Packet.call(this);
this.block = block || new MerkleBlock();
} | [
"function",
"MerkleBlockPacket",
"(",
"block",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"MerkleBlockPacket",
")",
")",
"return",
"new",
"MerkleBlockPacket",
"(",
"block",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"b... | Represents a `merkleblock` packet.
@constructor
@param {MerkleBlock?} block
@property {MerkleBlock} block | [
"Represents",
"a",
"merkleblock",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L1986-L1993 |
36,777 | WorldMobileCoin/wmcc-core | src/net/packets.js | SendCmpctPacket | function SendCmpctPacket(mode, version) {
if (!(this instanceof SendCmpctPacket))
return new SendCmpctPacket(mode, version);
Packet.call(this);
this.mode = mode || 0;
this.version = version || 1;
} | javascript | function SendCmpctPacket(mode, version) {
if (!(this instanceof SendCmpctPacket))
return new SendCmpctPacket(mode, version);
Packet.call(this);
this.mode = mode || 0;
this.version = version || 1;
} | [
"function",
"SendCmpctPacket",
"(",
"mode",
",",
"version",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"SendCmpctPacket",
")",
")",
"return",
"new",
"SendCmpctPacket",
"(",
"mode",
",",
"version",
")",
";",
"Packet",
".",
"call",
"(",
"this",
"... | Represents a `sendcmpct` packet.
@constructor
@param {Number|null} mode
@param {Number|null} version
@property {Number} mode
@property {Number} version | [
"Represents",
"a",
"sendcmpct",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2164-L2172 |
36,778 | WorldMobileCoin/wmcc-core | src/net/packets.js | CmpctBlockPacket | function CmpctBlockPacket(block, witness) {
if (!(this instanceof CmpctBlockPacket))
return new CmpctBlockPacket(block, witness);
Packet.call(this);
this.block = block || new bip152.CompactBlock();
this.witness = witness || false;
} | javascript | function CmpctBlockPacket(block, witness) {
if (!(this instanceof CmpctBlockPacket))
return new CmpctBlockPacket(block, witness);
Packet.call(this);
this.block = block || new bip152.CompactBlock();
this.witness = witness || false;
} | [
"function",
"CmpctBlockPacket",
"(",
"block",
",",
"witness",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"CmpctBlockPacket",
")",
")",
"return",
"new",
"CmpctBlockPacket",
"(",
"block",
",",
"witness",
")",
";",
"Packet",
".",
"call",
"(",
"this"... | Represents a `cmpctblock` packet.
@constructor
@param {Block|null} block
@param {Boolean|null} witness
@property {Block} block
@property {Boolean} witness | [
"Represents",
"a",
"cmpctblock",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2272-L2280 |
36,779 | WorldMobileCoin/wmcc-core | src/net/packets.js | GetBlockTxnPacket | function GetBlockTxnPacket(request) {
if (!(this instanceof GetBlockTxnPacket))
return new GetBlockTxnPacket(request);
Packet.call(this);
this.request = request || new bip152.TXRequest();
} | javascript | function GetBlockTxnPacket(request) {
if (!(this instanceof GetBlockTxnPacket))
return new GetBlockTxnPacket(request);
Packet.call(this);
this.request = request || new bip152.TXRequest();
} | [
"function",
"GetBlockTxnPacket",
"(",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"GetBlockTxnPacket",
")",
")",
"return",
"new",
"GetBlockTxnPacket",
"(",
"request",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
... | Represents a `getblocktxn` packet.
@constructor
@param {TXRequest?} request
@property {TXRequest} request | [
"Represents",
"a",
"getblocktxn",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2372-L2379 |
36,780 | WorldMobileCoin/wmcc-core | src/net/packets.js | BlockTxnPacket | function BlockTxnPacket(response, witness) {
if (!(this instanceof BlockTxnPacket))
return new BlockTxnPacket(response, witness);
Packet.call(this);
this.response = response || new bip152.TXResponse();
this.witness = witness || false;
} | javascript | function BlockTxnPacket(response, witness) {
if (!(this instanceof BlockTxnPacket))
return new BlockTxnPacket(response, witness);
Packet.call(this);
this.response = response || new bip152.TXResponse();
this.witness = witness || false;
} | [
"function",
"BlockTxnPacket",
"(",
"response",
",",
"witness",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"BlockTxnPacket",
")",
")",
"return",
"new",
"BlockTxnPacket",
"(",
"response",
",",
"witness",
")",
";",
"Packet",
".",
"call",
"(",
"this"... | Represents a `blocktxn` packet.
@constructor
@param {TXResponse?} response
@param {Boolean?} witness
@property {TXResponse} response
@property {Boolean} witness | [
"Represents",
"a",
"blocktxn",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2467-L2475 |
36,781 | WorldMobileCoin/wmcc-core | src/net/packets.js | EncinitPacket | function EncinitPacket(publicKey, cipher) {
if (!(this instanceof EncinitPacket))
return new EncinitPacket(publicKey, cipher);
Packet.call(this);
this.publicKey = publicKey || encoding.ZERO_KEY;
this.cipher = cipher || 0;
} | javascript | function EncinitPacket(publicKey, cipher) {
if (!(this instanceof EncinitPacket))
return new EncinitPacket(publicKey, cipher);
Packet.call(this);
this.publicKey = publicKey || encoding.ZERO_KEY;
this.cipher = cipher || 0;
} | [
"function",
"EncinitPacket",
"(",
"publicKey",
",",
"cipher",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"EncinitPacket",
")",
")",
"return",
"new",
"EncinitPacket",
"(",
"publicKey",
",",
"cipher",
")",
";",
"Packet",
".",
"call",
"(",
"this",
... | Represents a `encinit` packet.
@constructor
@param {Buffer|null} publicKey
@param {Number|null} cipher
@property {Buffer} publicKey
@property {Number} cipher | [
"Represents",
"a",
"encinit",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2569-L2577 |
36,782 | WorldMobileCoin/wmcc-core | src/net/packets.js | EncackPacket | function EncackPacket(publicKey) {
if (!(this instanceof EncackPacket))
return new EncackPacket(publicKey);
Packet.call(this);
this.publicKey = publicKey || encoding.ZERO_KEY;
} | javascript | function EncackPacket(publicKey) {
if (!(this instanceof EncackPacket))
return new EncackPacket(publicKey);
Packet.call(this);
this.publicKey = publicKey || encoding.ZERO_KEY;
} | [
"function",
"EncackPacket",
"(",
"publicKey",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"EncackPacket",
")",
")",
"return",
"new",
"EncackPacket",
"(",
"publicKey",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"publicKe... | Represents a `encack` packet.
@constructor
@param {Buffer?} publicKey
@property {Buffer} publicKey | [
"Represents",
"a",
"encack",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2665-L2672 |
36,783 | WorldMobileCoin/wmcc-core | src/net/packets.js | AuthChallengePacket | function AuthChallengePacket(hash) {
if (!(this instanceof AuthChallengePacket))
return new AuthChallengePacket(hash);
Packet.call(this);
this.hash = hash || encoding.ZERO_HASH;
} | javascript | function AuthChallengePacket(hash) {
if (!(this instanceof AuthChallengePacket))
return new AuthChallengePacket(hash);
Packet.call(this);
this.hash = hash || encoding.ZERO_HASH;
} | [
"function",
"AuthChallengePacket",
"(",
"hash",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AuthChallengePacket",
")",
")",
"return",
"new",
"AuthChallengePacket",
"(",
"hash",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
... | Represents a `authchallenge` packet.
@constructor
@param {Buffer?} hash
@property {Buffer} hash | [
"Represents",
"a",
"authchallenge",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2758-L2765 |
36,784 | WorldMobileCoin/wmcc-core | src/net/packets.js | AuthReplyPacket | function AuthReplyPacket(signature) {
if (!(this instanceof AuthReplyPacket))
return new AuthReplyPacket(signature);
Packet.call(this);
this.signature = signature || encoding.ZERO_SIG64;
} | javascript | function AuthReplyPacket(signature) {
if (!(this instanceof AuthReplyPacket))
return new AuthReplyPacket(signature);
Packet.call(this);
this.signature = signature || encoding.ZERO_SIG64;
} | [
"function",
"AuthReplyPacket",
"(",
"signature",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AuthReplyPacket",
")",
")",
"return",
"new",
"AuthReplyPacket",
"(",
"signature",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
... | Represents a `authreply` packet.
@constructor
@param {Buffer?} signature
@property {Buffer} signature | [
"Represents",
"a",
"authreply",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2851-L2858 |
36,785 | WorldMobileCoin/wmcc-core | src/net/packets.js | AuthProposePacket | function AuthProposePacket(hash) {
if (!(this instanceof AuthProposePacket))
return new AuthProposePacket(hash);
Packet.call(this);
this.hash = hash || encoding.ZERO_HASH;
} | javascript | function AuthProposePacket(hash) {
if (!(this instanceof AuthProposePacket))
return new AuthProposePacket(hash);
Packet.call(this);
this.hash = hash || encoding.ZERO_HASH;
} | [
"function",
"AuthProposePacket",
"(",
"hash",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"AuthProposePacket",
")",
")",
"return",
"new",
"AuthProposePacket",
"(",
"hash",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"has... | Represents a `authpropose` packet.
@constructor
@param {Hash?} hash
@property {Hash} hash | [
"Represents",
"a",
"authpropose",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L2944-L2951 |
36,786 | WorldMobileCoin/wmcc-core | src/net/packets.js | UnknownPacket | function UnknownPacket(cmd, data) {
if (!(this instanceof UnknownPacket))
return new UnknownPacket(cmd, data);
Packet.call(this);
this.cmd = cmd;
this.data = data;
} | javascript | function UnknownPacket(cmd, data) {
if (!(this instanceof UnknownPacket))
return new UnknownPacket(cmd, data);
Packet.call(this);
this.cmd = cmd;
this.data = data;
} | [
"function",
"UnknownPacket",
"(",
"cmd",
",",
"data",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"UnknownPacket",
")",
")",
"return",
"new",
"UnknownPacket",
"(",
"cmd",
",",
"data",
")",
";",
"Packet",
".",
"call",
"(",
"this",
")",
";",
"... | Represents an unknown packet.
@constructor
@param {String|null} cmd
@param {Buffer|null} data
@property {String} cmd
@property {Buffer} data | [
"Represents",
"an",
"unknown",
"packet",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/net/packets.js#L3039-L3047 |
36,787 | WorldMobileCoin/wmcc-core | src/script/sigcache.js | SigCache | function SigCache(size) {
if (!(this instanceof SigCache))
return new SigCache(size);
if (size == null)
size = 10000;
assert(util.isU32(size));
this.size = size;
this.keys = [];
this.valid = new Map();
} | javascript | function SigCache(size) {
if (!(this instanceof SigCache))
return new SigCache(size);
if (size == null)
size = 10000;
assert(util.isU32(size));
this.size = size;
this.keys = [];
this.valid = new Map();
} | [
"function",
"SigCache",
"(",
"size",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"SigCache",
")",
")",
"return",
"new",
"SigCache",
"(",
"size",
")",
";",
"if",
"(",
"size",
"==",
"null",
")",
"size",
"=",
"10000",
";",
"assert",
"(",
"uti... | Signature cache.
@alias module:script.SigCache
@constructor
@param {Number} [size=10000]
@property {Number} size
@property {Hash[]} keys
@property {Object} valid | [
"Signature",
"cache",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/script/sigcache.js#L27-L39 |
36,788 | WorldMobileCoin/wmcc-core | src/script/sigcache.js | SigCacheEntry | function SigCacheEntry(sig, key) {
this.sig = Buffer.from(sig);
this.key = Buffer.from(key);
} | javascript | function SigCacheEntry(sig, key) {
this.sig = Buffer.from(sig);
this.key = Buffer.from(key);
} | [
"function",
"SigCacheEntry",
"(",
"sig",
",",
"key",
")",
"{",
"this",
".",
"sig",
"=",
"Buffer",
".",
"from",
"(",
"sig",
")",
";",
"this",
".",
"key",
"=",
"Buffer",
".",
"from",
"(",
"key",
")",
";",
"}"
] | Signature cache entry.
@constructor
@ignore
@param {Buffer} sig
@param {Buffer} key
@property {Buffer} sig
@property {Buffer} key | [
"Signature",
"cache",
"entry",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/script/sigcache.js#L133-L136 |
36,789 | blakeembrey/kroute | lib/proto.js | sanitize | function sanitize (fn) {
return function (/* path, ...middleware */) {
var middleware = []
var startindex = 0
var endindex = arguments.length
var path
var options
if (typeof arguments[0] === 'string') {
path = arguments[0]
startindex = 1
}
if (typeof arguments[arguments.l... | javascript | function sanitize (fn) {
return function (/* path, ...middleware */) {
var middleware = []
var startindex = 0
var endindex = arguments.length
var path
var options
if (typeof arguments[0] === 'string') {
path = arguments[0]
startindex = 1
}
if (typeof arguments[arguments.l... | [
"function",
"sanitize",
"(",
"fn",
")",
"{",
"return",
"function",
"(",
"/* path, ...middleware */",
")",
"{",
"var",
"middleware",
"=",
"[",
"]",
"var",
"startindex",
"=",
"0",
"var",
"endindex",
"=",
"arguments",
".",
"length",
"var",
"path",
"var",
"opt... | Sanitize a function to accept an optional path and unlimited middleware.
@param {Function} fn
@return {Function} | [
"Sanitize",
"a",
"function",
"to",
"accept",
"an",
"optional",
"path",
"and",
"unlimited",
"middleware",
"."
] | b39f76fb6402e257a8b4d6b26b6511d16fa22871 | https://github.com/blakeembrey/kroute/blob/b39f76fb6402e257a8b4d6b26b6511d16fa22871/lib/proto.js#L22-L61 |
36,790 | WorldMobileCoin/wmcc-core | src/utils/rbt.js | RBT | function RBT(compare, unique) {
if (!(this instanceof RBT))
return new RBT(compare, unique);
assert(typeof compare === 'function');
this.root = SENTINEL;
this.compare = compare;
this.unique = unique || false;
} | javascript | function RBT(compare, unique) {
if (!(this instanceof RBT))
return new RBT(compare, unique);
assert(typeof compare === 'function');
this.root = SENTINEL;
this.compare = compare;
this.unique = unique || false;
} | [
"function",
"RBT",
"(",
"compare",
",",
"unique",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"RBT",
")",
")",
"return",
"new",
"RBT",
"(",
"compare",
",",
"unique",
")",
";",
"assert",
"(",
"typeof",
"compare",
"===",
"'function'",
")",
";"... | An iterative red black tree.
@alias module:utils.RBT
@constructor
@param {Function} compare - Comparator.
@param {Boolean?} unique | [
"An",
"iterative",
"red",
"black",
"tree",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/rbt.js#L26-L35 |
36,791 | WorldMobileCoin/wmcc-core | src/utils/rbt.js | RBTSentinel | function RBTSentinel() {
this.key = null;
this.value = null;
this.color = BLACK;
this.parent = null;
this.left = null;
this.right = null;
} | javascript | function RBTSentinel() {
this.key = null;
this.value = null;
this.color = BLACK;
this.parent = null;
this.left = null;
this.right = null;
} | [
"function",
"RBTSentinel",
"(",
")",
"{",
"this",
".",
"key",
"=",
"null",
";",
"this",
".",
"value",
"=",
"null",
";",
"this",
".",
"color",
"=",
"BLACK",
";",
"this",
".",
"parent",
"=",
"null",
";",
"this",
".",
"left",
"=",
"null",
";",
"this... | RBT Sentinel Node
@constructor
@ignore
@property {null} key
@property {null} value
@property {Number} [color=BLACK]
@property {null} parent
@property {null} left
@property {null} right | [
"RBT",
"Sentinel",
"Node"
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/utils/rbt.js#L820-L827 |
36,792 | gsdriver/blackjack-strategy | src/ExactComposition.js | function (playerCards, dealerCard, handValue, handCount, dealerCheckedBlackjack, options)
{
// If exactComposition isn't set, no override
if (options.strategyComplexity != "exactComposition")
{
return null;
}
// Now look at strategies based on game options
... | javascript | function (playerCards, dealerCard, handValue, handCount, dealerCheckedBlackjack, options)
{
// If exactComposition isn't set, no override
if (options.strategyComplexity != "exactComposition")
{
return null;
}
// Now look at strategies based on game options
... | [
"function",
"(",
"playerCards",
",",
"dealerCard",
",",
"handValue",
",",
"handCount",
",",
"dealerCheckedBlackjack",
",",
"options",
")",
"{",
"// If exactComposition isn't set, no override",
"if",
"(",
"options",
".",
"strategyComplexity",
"!=",
"\"exactComposition\"",
... | Special-case overrides based on exact composition of cards | [
"Special",
"-",
"case",
"overrides",
"based",
"on",
"exact",
"composition",
"of",
"cards"
] | dfcb976ab9bb33c74c24c9bacf369e8ffb6506f3 | https://github.com/gsdriver/blackjack-strategy/blob/dfcb976ab9bb33c74c24c9bacf369e8ffb6506f3/src/ExactComposition.js#L27-L40 | |
36,793 | eccentric-j/cli-glob | lib/index.js | globcmd | function globcmd(globstr) {
var dir = arguments.length <= 1 || arguments[1] === undefined ? process.cwd() : arguments[1];
return new Promise(function (resolve, reject) {
if (!globstr || !globstr.length) {
return reject(new Error('No glob string given.'));
}
// Use glob to read the files in the d... | javascript | function globcmd(globstr) {
var dir = arguments.length <= 1 || arguments[1] === undefined ? process.cwd() : arguments[1];
return new Promise(function (resolve, reject) {
if (!globstr || !globstr.length) {
return reject(new Error('No glob string given.'));
}
// Use glob to read the files in the d... | [
"function",
"globcmd",
"(",
"globstr",
")",
"{",
"var",
"dir",
"=",
"arguments",
".",
"length",
"<=",
"1",
"||",
"arguments",
"[",
"1",
"]",
"===",
"undefined",
"?",
"process",
".",
"cwd",
"(",
")",
":",
"arguments",
"[",
"1",
"]",
";",
"return",
"... | Globcmd
Returns a promise that will be resolved with an array of files
@param {string} globstr - Glob str to look for
@param {string} [dir=process.cwd()] - Root directory
@returns {Promise} A promise object to be resolved with an array of files
or rejected with an error. | [
"Globcmd",
"Returns",
"a",
"promise",
"that",
"will",
"be",
"resolved",
"with",
"an",
"array",
"of",
"files"
] | a2f5bfdb29e1ccac6a93c509ca1f9172c06939a4 | https://github.com/eccentric-j/cli-glob/blob/a2f5bfdb29e1ccac6a93c509ca1f9172c06939a4/lib/index.js#L31-L57 |
36,794 | Spiffyk/twitch-node-sdk | lib/twitch.init.js | init | function init(options, callback) {
if (!options.clientId) {
throw new Error('client id not specified');
}
core.setClientId(options.clientId);
if (options.nw) {
if (options.nw === true) {
core.log('NW.js 0.13 is experimental.');
gui.setGUIType('nw13');
}
else {
gui.setGUIType(... | javascript | function init(options, callback) {
if (!options.clientId) {
throw new Error('client id not specified');
}
core.setClientId(options.clientId);
if (options.nw) {
if (options.nw === true) {
core.log('NW.js 0.13 is experimental.');
gui.setGUIType('nw13');
}
else {
gui.setGUIType(... | [
"function",
"init",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"options",
".",
"clientId",
")",
"{",
"throw",
"new",
"Error",
"(",
"'client id not specified'",
")",
";",
"}",
"core",
".",
"setClientId",
"(",
"options",
".",
"clientId",
")... | Initializes the SDK.
The `options` parameter can have the following properties (optional if not
stated otherwise):
* `clientId` (**required**) - The client ID of your application
* `session` - If your application has stored the session object somewhere,
you can pass it to the SDK to speed up the login process.
* `e... | [
"Initializes",
"the",
"SDK",
"."
] | e98234ca52b12569298213869439d17169e26f27 | https://github.com/Spiffyk/twitch-node-sdk/blob/e98234ca52b12569298213869439d17169e26f27/lib/twitch.init.js#L31-L52 |
36,795 | WorldMobileCoin/wmcc-core | src/mining/mine.js | mine | function mine(data, target, min, max) {
let nonce = min;
data.writeUInt32LE(nonce, 76, true);
// The heart and soul of the miner: match the target.
while (nonce <= max) {
// Hash and test against the next target.
// if (rcmp(digest.hash256(data), target) <= 0) // cfc
// if (rcmp(powHash(data), tar... | javascript | function mine(data, target, min, max) {
let nonce = min;
data.writeUInt32LE(nonce, 76, true);
// The heart and soul of the miner: match the target.
while (nonce <= max) {
// Hash and test against the next target.
// if (rcmp(digest.hash256(data), target) <= 0) // cfc
// if (rcmp(powHash(data), tar... | [
"function",
"mine",
"(",
"data",
",",
"target",
",",
"min",
",",
"max",
")",
"{",
"let",
"nonce",
"=",
"min",
";",
"data",
".",
"writeUInt32LE",
"(",
"nonce",
",",
"76",
",",
"true",
")",
";",
"// The heart and soul of the miner: match the target.",
"while",... | Hash until the nonce overflows.
@alias module:mining.mine
@param {Buffer} data
@param {Buffer} target - Big endian.
@param {Number} min
@param {Number} max
@returns {Number} Nonce or -1. | [
"Hash",
"until",
"the",
"nonce",
"overflows",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/mining/mine.js#L28-L49 |
36,796 | WorldMobileCoin/wmcc-core | src/bip70/payment.js | Payment | function Payment(options) {
if (!(this instanceof Payment))
return new Payment(options);
this.merchantData = null;
this.transactions = [];
this.refundTo = [];
this.memo = null;
if (options)
this.fromOptions(options);
} | javascript | function Payment(options) {
if (!(this instanceof Payment))
return new Payment(options);
this.merchantData = null;
this.transactions = [];
this.refundTo = [];
this.memo = null;
if (options)
this.fromOptions(options);
} | [
"function",
"Payment",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Payment",
")",
")",
"return",
"new",
"Payment",
"(",
"options",
")",
";",
"this",
".",
"merchantData",
"=",
"null",
";",
"this",
".",
"transactions",
"=",
"[",... | Represents a BIP70 payment.
@alias module:bip70.Payment
@constructor
@param {Object?} options
@property {Buffer} merchantData
@property {TX[]} transactions
@property {Output[]} refundTo
@property {String|null} memo | [
"Represents",
"a",
"BIP70",
"payment",
"."
] | 29c3759a175341cedae6b744c53eda628c669317 | https://github.com/WorldMobileCoin/wmcc-core/blob/29c3759a175341cedae6b744c53eda628c669317/src/bip70/payment.js#L32-L43 |
36,797 | ahtohbi4/postcss-bgimage | src/isNodeIgnored.js | isNodeIgnored | function isNodeIgnored(node) {
const parent = node.parent;
if (!parent) {
// Root was reached.
return false;
}
if (parent.some((child) => (child.type === 'comment' && PATTERN_IGNORE.test(child.text)))) {
// Instruction to ignore the node was detected.
return true;
}... | javascript | function isNodeIgnored(node) {
const parent = node.parent;
if (!parent) {
// Root was reached.
return false;
}
if (parent.some((child) => (child.type === 'comment' && PATTERN_IGNORE.test(child.text)))) {
// Instruction to ignore the node was detected.
return true;
}... | [
"function",
"isNodeIgnored",
"(",
"node",
")",
"{",
"const",
"parent",
"=",
"node",
".",
"parent",
";",
"if",
"(",
"!",
"parent",
")",
"{",
"// Root was reached.",
"return",
"false",
";",
"}",
"if",
"(",
"parent",
".",
"some",
"(",
"(",
"child",
")",
... | Check instruction to ignore the node.
@param {Node} node
@return {boolean} | [
"Check",
"instruction",
"to",
"ignore",
"the",
"node",
"."
] | b955c9f0aa0e24e57b17825c9aaec3016ef3b715 | https://github.com/ahtohbi4/postcss-bgimage/blob/b955c9f0aa0e24e57b17825c9aaec3016ef3b715/src/isNodeIgnored.js#L8-L23 |
36,798 | bunnybones1/threejs-light-probe | lib/three.js | function ( contour, indices ) {
var n = contour.length;
if ( n < 3 ) return null;
var result = [],
verts = [],
vertIndices = [];
/* we want a counter-clockwise polygon in verts */
var u, v, w;
if ( area( contour ) > 0.0 ) {
for ( v = 0; v < n; v ++ ) verts[ v ] = v;
} else {
for ( v =... | javascript | function ( contour, indices ) {
var n = contour.length;
if ( n < 3 ) return null;
var result = [],
verts = [],
vertIndices = [];
/* we want a counter-clockwise polygon in verts */
var u, v, w;
if ( area( contour ) > 0.0 ) {
for ( v = 0; v < n; v ++ ) verts[ v ] = v;
} else {
for ( v =... | [
"function",
"(",
"contour",
",",
"indices",
")",
"{",
"var",
"n",
"=",
"contour",
".",
"length",
";",
"if",
"(",
"n",
"<",
"3",
")",
"return",
"null",
";",
"var",
"result",
"=",
"[",
"]",
",",
"verts",
"=",
"[",
"]",
",",
"vertIndices",
"=",
"[... | takes in an contour array and returns | [
"takes",
"in",
"an",
"contour",
"array",
"and",
"returns"
] | 1d74986ef4477cb7c2d667522855c04cbc0edcb0 | https://github.com/bunnybones1/threejs-light-probe/blob/1d74986ef4477cb7c2d667522855c04cbc0edcb0/lib/three.js#L26695-L26789 | |
36,799 | ucd-cws/calvin-network-tools | nodejs/pri/debugger/parser.js | parseNode | function parseNode(line) {
current = {
is : 'NODE',
type : 'NODE',
id : line.substr(10, 10).trim().toLowerCase(),
initialStorage : line.substr(20, 10).trim(),
areaCapfactor : line.substr(30, 10).trim(),
endingStorage : line.substr(40, 10).trim()
};
} | javascript | function parseNode(line) {
current = {
is : 'NODE',
type : 'NODE',
id : line.substr(10, 10).trim().toLowerCase(),
initialStorage : line.substr(20, 10).trim(),
areaCapfactor : line.substr(30, 10).trim(),
endingStorage : line.substr(40, 10).trim()
};
} | [
"function",
"parseNode",
"(",
"line",
")",
"{",
"current",
"=",
"{",
"is",
":",
"'NODE'",
",",
"type",
":",
"'NODE'",
",",
"id",
":",
"line",
".",
"substr",
"(",
"10",
",",
"10",
")",
".",
"trim",
"(",
")",
".",
"toLowerCase",
"(",
")",
",",
"i... | LINK DIVR DIVR SR_SCC | [
"LINK",
"DIVR",
"DIVR",
"SR_SCC"
] | 9c276972394878dfb6927b56303fca4c4a2bf8f5 | https://github.com/ucd-cws/calvin-network-tools/blob/9c276972394878dfb6927b56303fca4c4a2bf8f5/nodejs/pri/debugger/parser.js#L45-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.