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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
43,500 | dsfields/radargun | lib/report.js | header | function header(dimensions) {
return divider(dimensions, 'top')
+ BORDER_VERT
+ BOLD + padEnd(' NAME', dimensions.name) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' AVG', dimensions.avg) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' MIN', dimensions.min) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' MA... | javascript | function header(dimensions) {
return divider(dimensions, 'top')
+ BORDER_VERT
+ BOLD + padEnd(' NAME', dimensions.name) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' AVG', dimensions.avg) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' MIN', dimensions.min) + RESET
+ BORDER_VERT
+ BOLD + padEnd(' MA... | [
"function",
"header",
"(",
"dimensions",
")",
"{",
"return",
"divider",
"(",
"dimensions",
",",
"'top'",
")",
"+",
"BORDER_VERT",
"+",
"BOLD",
"+",
"padEnd",
"(",
"' NAME'",
",",
"dimensions",
".",
"name",
")",
"+",
"RESET",
"+",
"BORDER_VERT",
"+",
"BOL... | Generates the header for a report table.
@param {Dimensions} dimensions
@returns {string} | [
"Generates",
"the",
"header",
"for",
"a",
"report",
"table",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/report.js#L173-L186 |
43,501 | dsfields/radargun | lib/report.js | row | function row(metric, dimensions, isTarget) {
let left = '';
let right = '';
if (isTarget) {
left = HIGHLIGHT;
right = RESET;
}
return BORDER_VERT
+ left + padEnd(' ' + metric.label, dimensions.name) + right
+ BORDER_VERT
+ left + padEnd(' ' + metric.avg + UNIT, dimensions.avg) + right
... | javascript | function row(metric, dimensions, isTarget) {
let left = '';
let right = '';
if (isTarget) {
left = HIGHLIGHT;
right = RESET;
}
return BORDER_VERT
+ left + padEnd(' ' + metric.label, dimensions.name) + right
+ BORDER_VERT
+ left + padEnd(' ' + metric.avg + UNIT, dimensions.avg) + right
... | [
"function",
"row",
"(",
"metric",
",",
"dimensions",
",",
"isTarget",
")",
"{",
"let",
"left",
"=",
"''",
";",
"let",
"right",
"=",
"''",
";",
"if",
"(",
"isTarget",
")",
"{",
"left",
"=",
"HIGHLIGHT",
";",
"right",
"=",
"RESET",
";",
"}",
"return"... | Generates a report table row.
@param {@link FunctionMetrics} metric
@param {Dimensions} dimensions
@param {boolean} isTarget
@returns {string} | [
"Generates",
"a",
"report",
"table",
"row",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/report.js#L198-L217 |
43,502 | dsfields/radargun | lib/report.js | report | function report(stream, metrics, thresholds) {
const target = (!elv(thresholds)) ? -1 : thresholds.target;
const dimensions = tableDimensions(metrics);
const border = divider(dimensions);
let value = header(dimensions);
for (let i = 0; i < metrics.length; i++) {
if (i > 0) value += border;
const metr... | javascript | function report(stream, metrics, thresholds) {
const target = (!elv(thresholds)) ? -1 : thresholds.target;
const dimensions = tableDimensions(metrics);
const border = divider(dimensions);
let value = header(dimensions);
for (let i = 0; i < metrics.length; i++) {
if (i > 0) value += border;
const metr... | [
"function",
"report",
"(",
"stream",
",",
"metrics",
",",
"thresholds",
")",
"{",
"const",
"target",
"=",
"(",
"!",
"elv",
"(",
"thresholds",
")",
")",
"?",
"-",
"1",
":",
"thresholds",
".",
"target",
";",
"const",
"dimensions",
"=",
"tableDimensions",
... | REPORTER
Generates a report table.
@param {@link Stream} stream
@param {@link FunctionMetrics[]} metrics
@param {@link Thresholds} thresholds | [
"REPORTER",
"Generates",
"a",
"report",
"table",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/report.js#L232-L248 |
43,503 | partyka95/graph-type-orm | dist/find-many.js | findMany | function findMany(repository, options) {
const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
const entityManyToOneRelationColumns = repository
.metadata
.relations
.filter((relationMetadata) => relationMetadata.relationType === 'many-to... | javascript | function findMany(repository, options) {
const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
const entityManyToOneRelationColumns = repository
.metadata
.relations
.filter((relationMetadata) => relationMetadata.relationType === 'many-to... | [
"function",
"findMany",
"(",
"repository",
",",
"options",
")",
"{",
"const",
"entityColumns",
"=",
"repository",
".",
"metadata",
".",
"columns",
".",
"map",
"(",
"(",
"columnMetadata",
")",
"=>",
"columnMetadata",
".",
"propertyName",
")",
";",
"const",
"e... | Method to find many entity records.
@param {Repository<Entity>} repository
@param {FindManyOptions} options
@returns {(source, args, context, info) => Promise<Entity[]>} | [
"Method",
"to",
"find",
"many",
"entity",
"records",
"."
] | c2c1d93c091ad8fb5d3015cabe6edb20dccfa225 | https://github.com/partyka95/graph-type-orm/blob/c2c1d93c091ad8fb5d3015cabe6edb20dccfa225/dist/find-many.js#L27-L72 |
43,504 | robinpowered/robin-js-sdk-public | lib/api/modules/events.js | function (data) {
var path;
if (data) {
path = this.constructPath(constants.EVENTS);
return this.Places.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required.');
}
} | javascript | function (data) {
var path;
if (data) {
path = this.constructPath(constants.EVENTS);
return this.Places.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required.');
}
} | [
"function",
"(",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"EVENTS",
")",
";",
"return",
"this",
".",
"Places",
".",
"POST",
"(",
"path",
",",
"data",
")",
... | Create an event
@param {Object} data A data object
@return {Function} A promise | [
"Create",
"an",
"event"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/events.js#L19-L27 | |
43,505 | jeffrose/emitter | dist/emitter.js | listenEmpty | function listenEmpty( handler, isFunction, emitter ){
const errors = [];
if( isFunction ){
try {
handler.call( emitter );
} catch( error ){
errors.push( error );
}
} else {
const length = handler.length,
listeners = handler.slice();
... | javascript | function listenEmpty( handler, isFunction, emitter ){
const errors = [];
if( isFunction ){
try {
handler.call( emitter );
} catch( error ){
errors.push( error );
}
} else {
const length = handler.length,
listeners = handler.slice();
... | [
"function",
"listenEmpty",
"(",
"handler",
",",
"isFunction",
",",
"emitter",
")",
"{",
"const",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"isFunction",
")",
"{",
"try",
"{",
"handler",
".",
"call",
"(",
"emitter",
")",
";",
"}",
"catch",
"(",
"error"... | Execute a listener with no arguments.
@function Emitter~listenEmpty
@param {EventListener|Array<EventListener>} handler One or more {@link EventListener|listeners} that will be executed on the `emitter`.
@param {external:boolean} isFunction Whether or not the `handler` is a {@link external:Function|function}.
@param {E... | [
"Execute",
"a",
"listener",
"with",
"no",
"arguments",
"."
] | c6d8d1702ff60ca4f5100d13480914e4bd17183f | https://github.com/jeffrose/emitter/blob/c6d8d1702ff60ca4f5100d13480914e4bd17183f/dist/emitter.js#L450-L477 |
43,506 | jeffrose/emitter | dist/emitter.js | toEmitter | function toEmitter( selection, target ){
// Apply the entire Emitter API
if( selection === API ){
asEmitter.call( target );
// Apply only the selected API methods
} else {
let index, key, mapping, names, value;
if( typeof selection === 'string' ){
n... | javascript | function toEmitter( selection, target ){
// Apply the entire Emitter API
if( selection === API ){
asEmitter.call( target );
// Apply only the selected API methods
} else {
let index, key, mapping, names, value;
if( typeof selection === 'string' ){
n... | [
"function",
"toEmitter",
"(",
"selection",
",",
"target",
")",
"{",
"// Apply the entire Emitter API",
"if",
"(",
"selection",
"===",
"API",
")",
"{",
"asEmitter",
".",
"call",
"(",
"target",
")",
";",
"// Apply only the selected API methods",
"}",
"else",
"{",
... | Applies a `selection` of the Emitter.js API to the `target`.
@function Emitter~toEmitter
@param {APIReference} [selection] A selection of the Emitter.js API.
@param {external:Object} target The object on which the API will be applied. | [
"Applies",
"a",
"selection",
"of",
"the",
"Emitter",
".",
"js",
"API",
"to",
"the",
"target",
"."
] | c6d8d1702ff60ca4f5100d13480914e4bd17183f | https://github.com/jeffrose/emitter/blob/c6d8d1702ff60ca4f5100d13480914e4bd17183f/dist/emitter.js#L731-L760 |
43,507 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (identifier, params) {
var path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.GET(path, params);
} | javascript | function (identifier, params) {
var path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.GET(path, params);
} | [
"function",
"(",
"identifier",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
... | Get all the device manifests or a particular device manifest identified by the `identifier` parameter
@param {String|Integer|undefined} identifier A Robin device manifest identifier
@param {Object|undefined} params A querystring object
@return {Function} A Promise | [
"Get",
"all",
"the",
"device",
"manifests",
"or",
"a",
"particular",
"device",
"manifest",
"identified",
"by",
"the",
"identifier",
"parameter"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L20-L23 | |
43,508 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (data) {
var path;
if (data) {
path = this.constructPath(constants.DEVICE_MANIFESTS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required');
}
} | javascript | function (data) {
var path;
if (data) {
path = this.constructPath(constants.DEVICE_MANIFESTS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required');
}
} | [
"function",
"(",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
")",
";",
"return",
"this",
".",
"Core",
".",
"POST",
"(",
"path",
",",
"data",
... | Create a device manifest
@param {Object} data A data object
@return {Function} A Promise | [
"Create",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L30-L38 | |
43,509 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (identifier, data) {
var path;
if (identifier && data) {
path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: A device manifest identifier and a data object are required.');
}
... | javascript | function (identifier, data) {
var path;
if (identifier && data) {
path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: A device manifest identifier and a data object are required.');
}
... | [
"function",
"(",
"identifier",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"identifier",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"identifier",
")",
";",
"return",
"this"... | Update a device manifest
@param {String|Integer|undefined} identifier A Robin device manifest identifier
@param {Object} data A data object
@return {Function} A Promise | [
"Update",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L46-L54 | |
43,510 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A device manifest identifier is required.');
}
} | javascript | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A device manifest identifier is required.');
}
} | [
"function",
"(",
"identifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"identifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE... | Delete a device manifest
@param {String|Integer|undefined} identifier A Robin device manifest identifier
@return {Function} A Promise | [
"Delete",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L61-L69 | |
43,511 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (deviceManifestIdentifier, feedIdentifier, params) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
return this.Core.GET(path, params);
... | javascript | function (deviceManifestIdentifier, feedIdentifier, params) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
return this.Core.GET(path, params);
... | [
"function",
"(",
"deviceManifestIdentifier",
",",
"feedIdentifier",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceManifestIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"deviceMa... | Get all the feeds for a device manifest or a particular feed identified by `feedIdentifier`
@param {String|Integer} deviceManifestIdentifier A Robin device manifest identifier
@param {String|Integer|undefined} feedIdentifier A Robin feed identifier
@param {Object|undefined} params ... | [
"Get",
"all",
"the",
"feeds",
"for",
"a",
"device",
"manifest",
"or",
"a",
"particular",
"feed",
"identified",
"by",
"feedIdentifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L83-L92 | |
43,512 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (deviceManifestIdentifier, data) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier, constants.FEEDS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A device m... | javascript | function (deviceManifestIdentifier, data) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier, constants.FEEDS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A device m... | [
"function",
"(",
"deviceManifestIdentifier",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceManifestIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"deviceManifestIdentifier",
",",
"... | Add a feed to a device manifest
@param {String|Integer} deviceManifestIdentifier A Robin device manifest identifier
@param {Object} data A querystring object
@return {Function} A Promise | [
"Add",
"a",
"feed",
"to",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L100-L108 | |
43,513 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (deviceManifestIdentifier, feedIdentifier, data) {
var path,
rejectMsg;
if (deviceManifestIdentifier && feedIdentifier && data) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
... | javascript | function (deviceManifestIdentifier, feedIdentifier, data) {
var path,
rejectMsg;
if (deviceManifestIdentifier && feedIdentifier && data) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
... | [
"function",
"(",
"deviceManifestIdentifier",
",",
"feedIdentifier",
",",
"data",
")",
"{",
"var",
"path",
",",
"rejectMsg",
";",
"if",
"(",
"deviceManifestIdentifier",
"&&",
"feedIdentifier",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"... | Update a feed on a device manifest
@param {String|Integer} deviceManifestIdentifier A Robin device manifest identifier
@param {String|Integer} feedIdentifier A Robin feed identifier
@param {Object} data A querystring object
@return {Function} A Pro... | [
"Update",
"a",
"feed",
"on",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L117-L128 | |
43,514 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (deviceManifestIdentifier, feedIdentifier) {
var path;
if (deviceManifestIdentifier && feedIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
return this.Core.DELETE(path);... | javascript | function (deviceManifestIdentifier, feedIdentifier) {
var path;
if (deviceManifestIdentifier && feedIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.FEEDS, feedIdentifier);
return this.Core.DELETE(path);... | [
"function",
"(",
"deviceManifestIdentifier",
",",
"feedIdentifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceManifestIdentifier",
"&&",
"feedIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
... | Delete a feed from a device manifest
@param {String|Integer} deviceManifestIdentifier A Robin device manifest identifier
@param {String|Integer} feedIdentifier A Robin feed identifier
@return {Function} A Promise | [
"Delete",
"a",
"feed",
"from",
"a",
"device",
"manifest"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L136-L145 | |
43,515 | robinpowered/robin-js-sdk-public | lib/api/modules/devicemanifests.js | function (deviceManifestIdentifier, deviceIdentifier, params) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.DEVICES, deviceIdentifier);
return this.Core.GET(path, params)... | javascript | function (deviceManifestIdentifier, deviceIdentifier, params) {
var path;
if (deviceManifestIdentifier) {
path = this.constructPath(constants.DEVICE_MANIFESTS, deviceManifestIdentifier,
constants.DEVICES, deviceIdentifier);
return this.Core.GET(path, params)... | [
"function",
"(",
"deviceManifestIdentifier",
",",
"deviceIdentifier",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceManifestIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICE_MANIFESTS",
",",
"device... | Get all the devices for a device manifest or a particular device identified by `deviceIdentifier`
@param {String|Integer} deviceManifestIdentifier A Robin device manifest identifier
@param {String|Integer|undefined} deviceIdentifier A Robin device identifier
@param {Object|undefined} params... | [
"Get",
"all",
"the",
"devices",
"for",
"a",
"device",
"manifest",
"or",
"a",
"particular",
"device",
"identified",
"by",
"deviceIdentifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devicemanifests.js#L160-L169 | |
43,516 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (identifier, params) {
var path = this.constructPath(constants.DEVICES, identifier);
return this.Core.GET(path, params);
} | javascript | function (identifier, params) {
var path = this.constructPath(constants.DEVICES, identifier);
return this.Core.GET(path, params);
} | [
"function",
"(",
"identifier",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
";",
... | Get all the devices or a particular device identified by the `identifier` parameter
@param {String|Integer|undefined} identifier A Robin device identifier
@param {Object|undefined} params A querystring object
@return {Function} A Promise | [
"Get",
"all",
"the",
"devices",
"or",
"a",
"particular",
"device",
"identified",
"by",
"the",
"identifier",
"parameter"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L20-L23 | |
43,517 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.DEVICES, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A device identifier is required.');
}
} | javascript | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.DEVICES, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A device identifier is required.');
}
} | [
"function",
"(",
"identifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"identifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE",
"(",... | Delete a device
@param {String|Integer} identifier A Robin device identifier
@return {Function} A Promise | [
"Delete",
"a",
"device"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L61-L69 | |
43,518 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, identifierURN, params) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierURN);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: A de... | javascript | function (deviceIdentifier, identifierURN, params) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierURN);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: A de... | [
"function",
"(",
"deviceIdentifier",
",",
"identifierURN",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",
",",
"const... | Get all the identifiers for a device or a particular identifier identified by `identifierURN`
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer|undefined} identifierURN A Robin feed identifier
@param {Object|undefined} params A querystring object... | [
"Get",
"all",
"the",
"identifiers",
"for",
"a",
"device",
"or",
"a",
"particular",
"identifier",
"identified",
"by",
"identifierURN"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L83-L91 | |
43,519 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, data) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A device identifier and a data object... | javascript | function (deviceIdentifier, data) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A device identifier and a data object... | [
"function",
"(",
"deviceIdentifier",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",
",",
"constants",
".",
"IDENTIFIERS... | Create an identifier for a device
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {Object} data A querystring object
@return {Function} A Promise | [
"Create",
"an",
"identifier",
"for",
"a",
"device"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L99-L107 | |
43,520 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, identifierUrn, data) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierUrn);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: A devi... | javascript | function (deviceIdentifier, identifierUrn, data) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierUrn);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: A devi... | [
"function",
"(",
"deviceIdentifier",
",",
"identifierUrn",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",
",",
"constan... | Add an identifier for a device
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer} identifierUrn A Robin identifier URN
@param {Object} data A querystring object
@return {Function} A Promise | [
"Add",
"an",
"identifier",
"for",
"a",
"device"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L116-L124 | |
43,521 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, identifierUrn) {
var path;
if (deviceIdentifier && identifierUrn) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierUrn);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: ... | javascript | function (deviceIdentifier, identifierUrn) {
var path;
if (deviceIdentifier && identifierUrn) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.IDENTIFIERS, identifierUrn);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: ... | [
"function",
"(",
"deviceIdentifier",
",",
"identifierUrn",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
"&&",
"identifierUrn",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",
",",
... | Delete an identifier from a device
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer} identifierUrn A Robin identifier URN
@return {Function} A Promise | [
"Delete",
"an",
"identifier",
"from",
"a",
"device"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L132-L140 | |
43,522 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, channelIdentifier, params) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request:... | javascript | function (deviceIdentifier, channelIdentifier, params) {
var path;
if (deviceIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request:... | [
"function",
"(",
"deviceIdentifier",
",",
"channelIdentifier",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",
",",
"c... | Get all the channels for a device or a particular channel identified by `channelIdentifier`
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer|undefined} channelIdentifier A Robin channel identifier
@param {Object|undefined} params A querystring ob... | [
"Get",
"all",
"the",
"channels",
"for",
"a",
"device",
"or",
"a",
"particular",
"channel",
"identified",
"by",
"channelIdentifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L155-L163 | |
43,523 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, channelIdentifier, data) {
var path,
rejectMsg;
if (deviceIdentifier && channelIdentifier && data) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.PATCH(path, data);
} else {... | javascript | function (deviceIdentifier, channelIdentifier, data) {
var path,
rejectMsg;
if (deviceIdentifier && channelIdentifier && data) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.PATCH(path, data);
} else {... | [
"function",
"(",
"deviceIdentifier",
",",
"channelIdentifier",
",",
"data",
")",
"{",
"var",
"path",
",",
"rejectMsg",
";",
"if",
"(",
"deviceIdentifier",
"&&",
"channelIdentifier",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"con... | Update a feed on a channel
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {Object} data A querystring object
@return {Function} A promise | [
"Update",
"a",
"feed",
"on",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L188-L198 | |
43,524 | robinpowered/robin-js-sdk-public | lib/api/modules/devices.js | function (deviceIdentifier, channelIdentifier) {
var path;
if (deviceIdentifier && channelIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad ... | javascript | function (deviceIdentifier, channelIdentifier) {
var path;
if (deviceIdentifier && channelIdentifier) {
path = this.constructPath(constants.DEVICES, deviceIdentifier, constants.CHANNELS, channelIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad ... | [
"function",
"(",
"deviceIdentifier",
",",
"channelIdentifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"deviceIdentifier",
"&&",
"channelIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"DEVICES",
",",
"deviceIdentifier",... | Delete a channel from a device
@param {String|Integer} deviceIdentifier A Robin device identifier
@param {String|Integer} channelIdentifier A Robin channel identifier
@return {Function} A Promise | [
"Delete",
"a",
"channel",
"from",
"a",
"device"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/devices.js#L206-L214 | |
43,525 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (identifier, params) {
var path = this.constructPath(constants.CHANNELS, identifier);
return this.Core.GET(path, params);
} | javascript | function (identifier, params) {
var path = this.constructPath(constants.CHANNELS, identifier);
return this.Core.GET(path, params);
} | [
"function",
"(",
"identifier",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
";",
... | Get all the channels or a particular channel identified by the `identifier` parameter
@param {String|Integer|undefined} identifier A Robin channel identifier
@param {Object|undefined} params A querystring object
@return {Function} A Promise | [
"Get",
"all",
"the",
"channels",
"or",
"a",
"particular",
"channel",
"identified",
"by",
"the",
"identifier",
"parameter"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L20-L23 | |
43,526 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (data) {
var path;
if (data) {
path = this.constructPath(constants.CHANNELS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required.');
}
} | javascript | function (data) {
var path;
if (data) {
path = this.constructPath(constants.CHANNELS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A data object is required.');
}
} | [
"function",
"(",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
")",
";",
"return",
"this",
".",
"Core",
".",
"POST",
"(",
"path",
",",
"data",
")",
... | Create a channel
@param {Object} data A data object
@return {Function} A Promise | [
"Create",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L30-L38 | |
43,527 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.CHANNELS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A channel identifier is required.');
}
} | javascript | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.CHANNELS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A channel identifier is required.');
}
} | [
"function",
"(",
"identifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"identifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE",
"("... | Delete a channel
@param {String|Integer} identifier A Robin channel identifier
@return {Function} A Promise | [
"Delete",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L61-L69 | |
43,528 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, dataIdentifier, params) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.DATA, dataIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: A cha... | javascript | function (channelIdentifier, dataIdentifier, params) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.DATA, dataIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: A cha... | [
"function",
"(",
"channelIdentifier",
",",
"dataIdentifier",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"channelIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"channelIdentifier",
",",
"... | Get all the data from a channel or a particular channel data point identified by `dataIdentifier`
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {String|Integer|undefined} dataIdentifier A Robin channel data point identifier
@param {Object|undefined} params ... | [
"Get",
"all",
"the",
"data",
"from",
"a",
"channel",
"or",
"a",
"particular",
"channel",
"data",
"point",
"identified",
"by",
"dataIdentifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L83-L91 | |
43,529 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, dataIdentifier) {
var path;
if (channelIdentifier && dataIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.DATA, dataIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: ... | javascript | function (channelIdentifier, dataIdentifier) {
var path;
if (channelIdentifier && dataIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.DATA, dataIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: ... | [
"function",
"(",
"channelIdentifier",
",",
"dataIdentifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"channelIdentifier",
"&&",
"dataIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"channelIdentifier",
... | Delete a data point from a channel
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {String|Integer} dataIdentifier A Robin channel data point identifier
@return {Function} A Promise | [
"Delete",
"a",
"data",
"point",
"from",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L115-L123 | |
43,530 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, triggerIdentifier, params) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Requ... | javascript | function (channelIdentifier, triggerIdentifier, params) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Requ... | [
"function",
"(",
"channelIdentifier",
",",
"triggerIdentifier",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"channelIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"channelIdentifier",
",",
... | Get all the triggers on a channel or a particular channel trigger identified by `triggerIdentifier`
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {String|Integer|undefined} triggerIdentifier A Robin channel trigger identifier
@param {Object|undefined} params ... | [
"Get",
"all",
"the",
"triggers",
"on",
"a",
"channel",
"or",
"a",
"particular",
"channel",
"trigger",
"identified",
"by",
"triggerIdentifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L138-L146 | |
43,531 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, data) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A channel identifier and a data obje... | javascript | function (channelIdentifier, data) {
var path;
if (channelIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: A channel identifier and a data obje... | [
"function",
"(",
"channelIdentifier",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"channelIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"channelIdentifier",
",",
"constants",
".",
"TRIGGER... | Add a trigger to a channel
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {Object} data A querystring object
@return {Function} A Promise | [
"Add",
"a",
"trigger",
"to",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L154-L162 | |
43,532 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, triggerIdentifier, data) {
var path,
rejectMsg;
if (channelIdentifier && triggerIdentifier && data) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.PATCH(path, data);
} el... | javascript | function (channelIdentifier, triggerIdentifier, data) {
var path,
rejectMsg;
if (channelIdentifier && triggerIdentifier && data) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.PATCH(path, data);
} el... | [
"function",
"(",
"channelIdentifier",
",",
"triggerIdentifier",
",",
"data",
")",
"{",
"var",
"path",
",",
"rejectMsg",
";",
"if",
"(",
"channelIdentifier",
"&&",
"triggerIdentifier",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"c... | Update a trigger on a channel
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {String|Integer} triggerIdentifier A Robin channel trigger identifier
@param {Object} data A querystring object
@return {Function} A Promise | [
"Update",
"a",
"trigger",
"on",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L171-L181 | |
43,533 | robinpowered/robin-js-sdk-public | lib/api/modules/channels.js | function (channelIdentifier, triggerIdentifier) {
var path;
if (channelIdentifier && triggerIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('... | javascript | function (channelIdentifier, triggerIdentifier) {
var path;
if (channelIdentifier && triggerIdentifier) {
path = this.constructPath(constants.CHANNELS, channelIdentifier, constants.TRIGGERS, triggerIdentifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('... | [
"function",
"(",
"channelIdentifier",
",",
"triggerIdentifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"channelIdentifier",
"&&",
"triggerIdentifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"CHANNELS",
",",
"channelIdentifi... | Delete a trigger from a channel
@param {String|Integer} channelIdentifier A Robin channel identifier
@param {String|Integer} triggerIdentifier A Robin channel data point identifier
@return {Function} A Promise | [
"Delete",
"a",
"trigger",
"from",
"a",
"channel"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/channels.js#L189-L197 | |
43,534 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug, params) {
var path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.GET(path, params);
} | javascript | function (orgIdOrSlug, params) {
var path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.GET(path, params);
} | [
"function",
"(",
"orgIdOrSlug",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS",
",",
"orgIdOrSlug",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
... | Get all the organizations or a particular organization identified by the `orgIdOrSlug` parameter
@param {String|Integer|undefined} orgIdOrSlug A Robin organization id or slug
@param {Object|undefined} params A querystring object
@return {Function} A Promise | [
"Get",
"all",
"the",
"organizations",
"or",
"a",
"particular",
"organization",
"identified",
"by",
"the",
"orgIdOrSlug",
"parameter"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L20-L23 | |
43,535 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug, data) {
var path;
if (orgIdOrSlug && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: An organization id or slug and a data object are required.');
}
} | javascript | function (orgIdOrSlug, data) {
var path;
if (orgIdOrSlug && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.PATCH(path, data);
} else {
return this.rejectRequest('Bad Request: An organization id or slug and a data object are required.');
}
} | [
"function",
"(",
"orgIdOrSlug",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"orgIdOrSlug",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS",
",",
"orgIdOrSlug",
")",
";",
"return",
"this"... | Update an organization
@param {String|Integer|undefined} orgIdOrSlug A Robin organization id or slug
@param {Object} data A data object
@return {Function} A Promise | [
"Update",
"an",
"organization"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L46-L54 | |
43,536 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug) {
var path;
if (orgIdOrSlug) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: An organization id or slug is required.');
}
} | javascript | function (orgIdOrSlug) {
var path;
if (orgIdOrSlug) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: An organization id or slug is required.');
}
} | [
"function",
"(",
"orgIdOrSlug",
")",
"{",
"var",
"path",
";",
"if",
"(",
"orgIdOrSlug",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS",
",",
"orgIdOrSlug",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE... | Delete an organization
@param {String|Integer} orgIdOrSlug A Robin organization id or slug
@return {Function} A Promise | [
"Delete",
"an",
"organization"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L61-L69 | |
43,537 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug, userId, params) {
var path;
if (orgIdOrSlug) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS, userId);
return this.Core.GET(path);
} else {
return this.rejectRequest('Bad Request: An organization id or slug is required.')... | javascript | function (orgIdOrSlug, userId, params) {
var path;
if (orgIdOrSlug) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS, userId);
return this.Core.GET(path);
} else {
return this.rejectRequest('Bad Request: An organization id or slug is required.')... | [
"function",
"(",
"orgIdOrSlug",
",",
"userId",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"orgIdOrSlug",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS",
",",
"orgIdOrSlug",
",",
"constants",
".",
... | Get an organizations users or a particular user identified by `userId`
@param {String|Integer} orgIdOrSlug A Robin organization id or slug
@param {String|Integer|undefined} userId A Robin user id
@param {Object|undefined} params A querystring object
@return {Function} ... | [
"Get",
"an",
"organizations",
"users",
"or",
"a",
"particular",
"user",
"identified",
"by",
"userId"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L83-L91 | |
43,538 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug, userId, data) {
var path,
rejectMsg;
if (orgIdOrSlug && userId && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS, userId);
return this.Core.PATCH(path, data);
} else {
rejectMsg = 'Bad Request: An organiz... | javascript | function (orgIdOrSlug, userId, data) {
var path,
rejectMsg;
if (orgIdOrSlug && userId && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS, userId);
return this.Core.PATCH(path, data);
} else {
rejectMsg = 'Bad Request: An organiz... | [
"function",
"(",
"orgIdOrSlug",
",",
"userId",
",",
"data",
")",
"{",
"var",
"path",
",",
"rejectMsg",
";",
"if",
"(",
"orgIdOrSlug",
"&&",
"userId",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS... | Update a user in an organization
@param {String|Integer} orgIdOrSlug A Robin organization id or slug
@param {String|Integer} userId A Robin user id
@param {Object} data A data object
@return {Function} A promise | [
"Update",
"a",
"user",
"in",
"an",
"organization"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L116-L126 | |
43,539 | robinpowered/robin-js-sdk-public | lib/api/modules/organizations.js | function (orgIdOrSlug, data) {
var path,
rejectMsg;
if (orgIdOrSlug && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS);
return this.Core.POST(path, data);
} else {
rejectMsg = 'Bad Request: An organization id or slug and data i... | javascript | function (orgIdOrSlug, data) {
var path,
rejectMsg;
if (orgIdOrSlug && data) {
path = this.constructPath(constants.ORGANIZATIONS, orgIdOrSlug, constants.USERS);
return this.Core.POST(path, data);
} else {
rejectMsg = 'Bad Request: An organization id or slug and data i... | [
"function",
"(",
"orgIdOrSlug",
",",
"data",
")",
"{",
"var",
"path",
",",
"rejectMsg",
";",
"if",
"(",
"orgIdOrSlug",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ORGANIZATIONS",
",",
"orgIdOrSlug",
",",
"co... | Create a channel in an organization
@param {String|Integer} orgIdOrSlug A Robin organization id or slug
@param {Object} data A data object
@return {Function} A promise | [
"Create",
"a",
"channel",
"in",
"an",
"organization"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/organizations.js#L324-L334 | |
43,540 | TooTallNate/node-stream-parser | index.js | _bytes | function _bytes (n, fn) {
assert(!this._parserCallback, 'there is already a "callback" set!');
assert(isFinite(n) && n > 0, 'can only buffer a finite number of bytes > 0, got "' + n + '"');
if (!this._parserInit) init(this);
debug('buffering %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = f... | javascript | function _bytes (n, fn) {
assert(!this._parserCallback, 'there is already a "callback" set!');
assert(isFinite(n) && n > 0, 'can only buffer a finite number of bytes > 0, got "' + n + '"');
if (!this._parserInit) init(this);
debug('buffering %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = f... | [
"function",
"_bytes",
"(",
"n",
",",
"fn",
")",
"{",
"assert",
"(",
"!",
"this",
".",
"_parserCallback",
",",
"'there is already a \"callback\" set!'",
")",
";",
"assert",
"(",
"isFinite",
"(",
"n",
")",
"&&",
"n",
">",
"0",
",",
"'can only buffer a finite n... | Buffers `n` bytes and then invokes `fn` once that amount has been collected.
@param {Number} n the number of bytes to buffer
@param {Function} fn callback function to invoke when `n` bytes are buffered
@api public | [
"Buffers",
"n",
"bytes",
"and",
"then",
"invokes",
"fn",
"once",
"that",
"amount",
"has",
"been",
"collected",
"."
] | b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9 | https://github.com/TooTallNate/node-stream-parser/blob/b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9/index.js#L96-L104 |
43,541 | TooTallNate/node-stream-parser | index.js | _skipBytes | function _skipBytes (n, fn) {
assert(!this._parserCallback, 'there is already a "callback" set!');
assert(n > 0, 'can only skip > 0 bytes, got "' + n + '"');
if (!this._parserInit) init(this);
debug('skipping %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = fn;
this._parserState = SKIPPING... | javascript | function _skipBytes (n, fn) {
assert(!this._parserCallback, 'there is already a "callback" set!');
assert(n > 0, 'can only skip > 0 bytes, got "' + n + '"');
if (!this._parserInit) init(this);
debug('skipping %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = fn;
this._parserState = SKIPPING... | [
"function",
"_skipBytes",
"(",
"n",
",",
"fn",
")",
"{",
"assert",
"(",
"!",
"this",
".",
"_parserCallback",
",",
"'there is already a \"callback\" set!'",
")",
";",
"assert",
"(",
"n",
">",
"0",
",",
"'can only skip > 0 bytes, got \"'",
"+",
"n",
"+",
"'\"'",... | Skips over the next `n` bytes, then invokes `fn` once that amount has
been discarded.
@param {Number} n the number of bytes to discard
@param {Function} fn callback function to invoke when `n` bytes have been skipped
@api public | [
"Skips",
"over",
"the",
"next",
"n",
"bytes",
"then",
"invokes",
"fn",
"once",
"that",
"amount",
"has",
"been",
"discarded",
"."
] | b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9 | https://github.com/TooTallNate/node-stream-parser/blob/b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9/index.js#L115-L123 |
43,542 | TooTallNate/node-stream-parser | index.js | _passthrough | function _passthrough (n, fn) {
assert(!this._parserCallback, 'There is already a "callback" set!');
assert(n > 0, 'can only pass through > 0 bytes, got "' + n + '"');
if (!this._parserInit) init(this);
debug('passing through %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = fn;
this._parse... | javascript | function _passthrough (n, fn) {
assert(!this._parserCallback, 'There is already a "callback" set!');
assert(n > 0, 'can only pass through > 0 bytes, got "' + n + '"');
if (!this._parserInit) init(this);
debug('passing through %o bytes', n);
this._parserBytesLeft = n;
this._parserCallback = fn;
this._parse... | [
"function",
"_passthrough",
"(",
"n",
",",
"fn",
")",
"{",
"assert",
"(",
"!",
"this",
".",
"_parserCallback",
",",
"'There is already a \"callback\" set!'",
")",
";",
"assert",
"(",
"n",
">",
"0",
",",
"'can only pass through > 0 bytes, got \"'",
"+",
"n",
"+",... | Passes through `n` bytes to the readable side of this stream untouched,
then invokes `fn` once that amount has been passed through.
@param {Number} n the number of bytes to pass through
@param {Function} fn callback function to invoke when `n` bytes have passed through
@api public | [
"Passes",
"through",
"n",
"bytes",
"to",
"the",
"readable",
"side",
"of",
"this",
"stream",
"untouched",
"then",
"invokes",
"fn",
"once",
"that",
"amount",
"has",
"been",
"passed",
"through",
"."
] | b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9 | https://github.com/TooTallNate/node-stream-parser/blob/b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9/index.js#L134-L142 |
43,543 | TooTallNate/node-stream-parser | index.js | process | function process (stream, chunk, output, fn) {
stream._parserBytesLeft -= chunk.length;
debug('%o bytes left for stream piece', stream._parserBytesLeft);
if (stream._parserState === BUFFERING) {
// buffer
stream._parserBuffers.push(chunk);
stream._parserBuffered += chunk.length;
} else if (stream._... | javascript | function process (stream, chunk, output, fn) {
stream._parserBytesLeft -= chunk.length;
debug('%o bytes left for stream piece', stream._parserBytesLeft);
if (stream._parserState === BUFFERING) {
// buffer
stream._parserBuffers.push(chunk);
stream._parserBuffered += chunk.length;
} else if (stream._... | [
"function",
"process",
"(",
"stream",
",",
"chunk",
",",
"output",
",",
"fn",
")",
"{",
"stream",
".",
"_parserBytesLeft",
"-=",
"chunk",
".",
"length",
";",
"debug",
"(",
"'%o bytes left for stream piece'",
",",
"stream",
".",
"_parserBytesLeft",
")",
";",
... | The internal `process` function gets called by the `data` function when
something "interesting" happens. This function takes care of buffering the
bytes when buffering, passing through the bytes when doing that, and invoking
the user callback when the number of bytes has been reached.
@api private | [
"The",
"internal",
"process",
"function",
"gets",
"called",
"by",
"the",
"data",
"function",
"when",
"something",
"interesting",
"happens",
".",
"This",
"function",
"takes",
"care",
"of",
"buffering",
"the",
"bytes",
"when",
"buffering",
"passing",
"through",
"t... | b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9 | https://github.com/TooTallNate/node-stream-parser/blob/b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9/index.js#L225-L277 |
43,544 | TooTallNate/node-stream-parser | index.js | trampoline | function trampoline (fn) {
return function () {
var result = fn.apply(this, arguments);
while ('function' == typeof result) {
result = result();
}
return result;
};
} | javascript | function trampoline (fn) {
return function () {
var result = fn.apply(this, arguments);
while ('function' == typeof result) {
result = result();
}
return result;
};
} | [
"function",
"trampoline",
"(",
"fn",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"result",
"=",
"fn",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"while",
"(",
"'function'",
"==",
"typeof",
"result",
")",
"{",
"result",
"=",
"res... | Generic thunk-based "trampoline" helper function.
@param {Function} input function
@return {Function} "trampolined" function
@api private | [
"Generic",
"thunk",
"-",
"based",
"trampoline",
"helper",
"function",
"."
] | b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9 | https://github.com/TooTallNate/node-stream-parser/blob/b829e8a8d85f2504ed9092e7aa20e2e3855c2ee9/index.js#L289-L299 |
43,545 | robinpowered/robin-js-sdk-public | lib/api/api.js | RobinApi | function RobinApi (accessToken, coreUrl, placesUrl) {
if (accessToken) {
RobinApi.super_.apply(this, arguments);
this.setAccessToken(accessToken);
this.setupCore(coreUrl);
this.setupPlaces(placesUrl);
this.loadApiModules();
} else {
throw new TypeError('The access token is mi... | javascript | function RobinApi (accessToken, coreUrl, placesUrl) {
if (accessToken) {
RobinApi.super_.apply(this, arguments);
this.setAccessToken(accessToken);
this.setupCore(coreUrl);
this.setupPlaces(placesUrl);
this.loadApiModules();
} else {
throw new TypeError('The access token is mi... | [
"function",
"RobinApi",
"(",
"accessToken",
",",
"coreUrl",
",",
"placesUrl",
")",
"{",
"if",
"(",
"accessToken",
")",
"{",
"RobinApi",
".",
"super_",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"this",
".",
"setAccessToken",
"(",
"accessToken",... | The Robin API constructor
@param {String} accessToken A Robin Access Token
@param {String} coreUrl The Base URL for the Core API.
@param {String} placesUrl The Base URL for the Places API | [
"The",
"Robin",
"API",
"constructor"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/api.js#L40-L50 |
43,546 | robinpowered/robin-js-sdk-public | lib/api/modules/apps.js | function (appIdOrSlug, params) {
var path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.GET(path, params);
} | javascript | function (appIdOrSlug, params) {
var path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.GET(path, params);
} | [
"function",
"(",
"appIdOrSlug",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"APPS",
",",
"appIdOrSlug",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
";",
"... | Get an app
@param {String|Integer|undefined} appIdOrSlug A Robin app identifier or slug
@param {Object|undefnied} params A querystring object
@return {Function} A Promise | [
"Get",
"an",
"app"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/apps.js#L20-L23 | |
43,547 | robinpowered/robin-js-sdk-public | lib/api/modules/apps.js | function (appIdOrSlug, data) {
var path;
if (appIdOrSlug && data) {
path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: An app id or slug and a data object are required.');
}
} | javascript | function (appIdOrSlug, data) {
var path;
if (appIdOrSlug && data) {
path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.POST(path, data);
} else {
return this.rejectRequest('Bad Request: An app id or slug and a data object are required.');
}
} | [
"function",
"(",
"appIdOrSlug",
",",
"data",
")",
"{",
"var",
"path",
";",
"if",
"(",
"appIdOrSlug",
"&&",
"data",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"APPS",
",",
"appIdOrSlug",
")",
";",
"return",
"this",
".",
... | Update an app
@param {String|Integer} appIdOrSlug A Robin app identifier or slug
@param {Object} data A data object
@return {Function} A Promise | [
"Update",
"an",
"app"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/apps.js#L31-L39 | |
43,548 | robinpowered/robin-js-sdk-public | lib/api/modules/apps.js | function (appIdOrSlug) {
var path;
if (appIdOrSlug) {
path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: An app id or slug is required.');
}
} | javascript | function (appIdOrSlug) {
var path;
if (appIdOrSlug) {
path = this.constructPath(constants.APPS, appIdOrSlug);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: An app id or slug is required.');
}
} | [
"function",
"(",
"appIdOrSlug",
")",
"{",
"var",
"path",
";",
"if",
"(",
"appIdOrSlug",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"APPS",
",",
"appIdOrSlug",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE",
"(",... | Delete an app
@param {String|Integer} appIdOrSlug A Robin app identifier or slug
@return {Function} A Promise | [
"Delete",
"an",
"app"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/apps.js#L46-L54 | |
43,549 | jimf/jasmine-diff | index.js | getType | function getType (val) {
if (val === null) {
return 'null'
} else if (val === void 0) {
return 'undefined'
}
return Object.prototype.toString.call(val)
.replace(/^\[.+\s(.+?)]$/, '$1')
.toLowerCase()
} | javascript | function getType (val) {
if (val === null) {
return 'null'
} else if (val === void 0) {
return 'undefined'
}
return Object.prototype.toString.call(val)
.replace(/^\[.+\s(.+?)]$/, '$1')
.toLowerCase()
} | [
"function",
"getType",
"(",
"val",
")",
"{",
"if",
"(",
"val",
"===",
"null",
")",
"{",
"return",
"'null'",
"}",
"else",
"if",
"(",
"val",
"===",
"void",
"0",
")",
"{",
"return",
"'undefined'",
"}",
"return",
"Object",
".",
"prototype",
".",
"toStrin... | Return type of given value.
@param {*} val Value to identify
@return {string} | [
"Return",
"type",
"of",
"given",
"value",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L9-L18 |
43,550 | jimf/jasmine-diff | index.js | Value | function Value (val, parent, opts) {
var obj = Object.create(Value.prototype)
opts = opts || {}
obj.value = val
obj.parent = parent
obj.type = getType(val)
obj.key = opts.key
obj.length = opts.length !== undefined ? opts.length : (val && val.length)
return obj
} | javascript | function Value (val, parent, opts) {
var obj = Object.create(Value.prototype)
opts = opts || {}
obj.value = val
obj.parent = parent
obj.type = getType(val)
obj.key = opts.key
obj.length = opts.length !== undefined ? opts.length : (val && val.length)
return obj
} | [
"function",
"Value",
"(",
"val",
",",
"parent",
",",
"opts",
")",
"{",
"var",
"obj",
"=",
"Object",
".",
"create",
"(",
"Value",
".",
"prototype",
")",
"opts",
"=",
"opts",
"||",
"{",
"}",
"obj",
".",
"value",
"=",
"val",
"obj",
".",
"parent",
"=... | Value wrapper to contain state.
@param {*} val Value to wrap
@param {Value|null} parent Parent value
@param {object} [opts] Options
@param {string|number} [opts.key] Key/index if value is contained in an object/array
@param {number} [opts.length] Length if value is an object/array
@return {Value} | [
"Value",
"wrapper",
"to",
"contain",
"state",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L30-L39 |
43,551 | jimf/jasmine-diff | index.js | traverse | function traverse (value, v) {
var state = {}
var visitor = v.visitor
var seen = []
/**
* Recursively walk the value, dispatching visitor methods as values are encountered.
*
* @param {*} val Value
* @param {Value|null} parent Parent value
* @param {object} [opts] Additional options
*/
func... | javascript | function traverse (value, v) {
var state = {}
var visitor = v.visitor
var seen = []
/**
* Recursively walk the value, dispatching visitor methods as values are encountered.
*
* @param {*} val Value
* @param {Value|null} parent Parent value
* @param {object} [opts] Additional options
*/
func... | [
"function",
"traverse",
"(",
"value",
",",
"v",
")",
"{",
"var",
"state",
"=",
"{",
"}",
"var",
"visitor",
"=",
"v",
".",
"visitor",
"var",
"seen",
"=",
"[",
"]",
"/**\n * Recursively walk the value, dispatching visitor methods as values are encountered.\n *\n *... | Traverse a value with a visitor object.
@param {*} value Value to traverse
@param {Visitor} visitor Visitor instance | [
"Traverse",
"a",
"value",
"with",
"a",
"visitor",
"object",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L47-L117 |
43,552 | jimf/jasmine-diff | index.js | prettyPrintVisitor | function prettyPrintVisitor (pp, spaces) {
var visitor = {}
visitor.pre = function (state) {
state.result = ''
state.depth = 0
}
visitor.visitor = {
arrayEnter: function (val, state) {
if (val.key !== undefined) {
state.result += repeat(state.depth * spaces, ' ')
if (val.parent... | javascript | function prettyPrintVisitor (pp, spaces) {
var visitor = {}
visitor.pre = function (state) {
state.result = ''
state.depth = 0
}
visitor.visitor = {
arrayEnter: function (val, state) {
if (val.key !== undefined) {
state.result += repeat(state.depth * spaces, ' ')
if (val.parent... | [
"function",
"prettyPrintVisitor",
"(",
"pp",
",",
"spaces",
")",
"{",
"var",
"visitor",
"=",
"{",
"}",
"visitor",
".",
"pre",
"=",
"function",
"(",
"state",
")",
"{",
"state",
".",
"result",
"=",
"''",
"state",
".",
"depth",
"=",
"0",
"}",
"visitor",... | Visitor factory for pretty printing a JavaScript value.
@param {function} pp Fallback pretty printer
@param {number} spaces Number of spaces for indentation
@return {object} Visitor instance | [
"Visitor",
"factory",
"for",
"pretty",
"printing",
"a",
"JavaScript",
"value",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L142-L216 |
43,553 | jimf/jasmine-diff | index.js | createStringifier | function createStringifier (pp, spaces) {
return function stringify (value) {
var visitor = prettyPrintVisitor(pp, spaces)
traverse(value, visitor)
return visitor.result
}
} | javascript | function createStringifier (pp, spaces) {
return function stringify (value) {
var visitor = prettyPrintVisitor(pp, spaces)
traverse(value, visitor)
return visitor.result
}
} | [
"function",
"createStringifier",
"(",
"pp",
",",
"spaces",
")",
"{",
"return",
"function",
"stringify",
"(",
"value",
")",
"{",
"var",
"visitor",
"=",
"prettyPrintVisitor",
"(",
"pp",
",",
"spaces",
")",
"traverse",
"(",
"value",
",",
"visitor",
")",
"retu... | Stringifier factory.
@param {function} pp Fallback pretty printer
@param {number} spaces Number of spaces for indentation
@return {function} | [
"Stringifier",
"factory",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L225-L231 |
43,554 | jimf/jasmine-diff | index.js | isDiffable | function isDiffable (val) {
switch (getType(val)) {
case 'array':
case 'object':
return true
case 'string':
return val.length >= 40 || (val.trim().match(/\n/g) || []).length >= 1
default:
return false
}
} | javascript | function isDiffable (val) {
switch (getType(val)) {
case 'array':
case 'object':
return true
case 'string':
return val.length >= 40 || (val.trim().match(/\n/g) || []).length >= 1
default:
return false
}
} | [
"function",
"isDiffable",
"(",
"val",
")",
"{",
"switch",
"(",
"getType",
"(",
"val",
")",
")",
"{",
"case",
"'array'",
":",
"case",
"'object'",
":",
"return",
"true",
"case",
"'string'",
":",
"return",
"val",
".",
"length",
">=",
"40",
"||",
"(",
"v... | Return whether value should be diffed.
@param {*} val Value to test
@return {boolean} | [
"Return",
"whether",
"value",
"should",
"be",
"diffed",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L239-L251 |
43,555 | jimf/jasmine-diff | index.js | lpad | function lpad (str, width) {
while (String(str).length < width) {
str = ' ' + str
}
return str
} | javascript | function lpad (str, width) {
while (String(str).length < width) {
str = ' ' + str
}
return str
} | [
"function",
"lpad",
"(",
"str",
",",
"width",
")",
"{",
"while",
"(",
"String",
"(",
"str",
")",
".",
"length",
"<",
"width",
")",
"{",
"str",
"=",
"' '",
"+",
"str",
"}",
"return",
"str",
"}"
] | Left-pad utility.
@param {string} str String to pad
@param {number} width Total desired width of string
@return {string} | [
"Left",
"-",
"pad",
"utility",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L260-L265 |
43,556 | jimf/jasmine-diff | index.js | unifiedDiff | function unifiedDiff (actual, expected, formatAdd, formatRem) {
return [
formatAdd('+ expected'),
formatRem('- actual'),
''
]
.concat(
diff.createPatch('string', actual, expected)
.split('\n')
.slice(4)
.filter(function (line) {
return line[0] === '+' || line[... | javascript | function unifiedDiff (actual, expected, formatAdd, formatRem) {
return [
formatAdd('+ expected'),
formatRem('- actual'),
''
]
.concat(
diff.createPatch('string', actual, expected)
.split('\n')
.slice(4)
.filter(function (line) {
return line[0] === '+' || line[... | [
"function",
"unifiedDiff",
"(",
"actual",
",",
"expected",
",",
"formatAdd",
",",
"formatRem",
")",
"{",
"return",
"[",
"formatAdd",
"(",
"'+ expected'",
")",
",",
"formatRem",
"(",
"'- actual'",
")",
",",
"''",
"]",
".",
"concat",
"(",
"diff",
".",
"cre... | Return unified diff of actual vs expected.
@param {*} actual Actual value
@param {*} expected Expected value
@param {function} formatAdd Addition formatter
@param {function} formatRem Removal formatter
@return {string} | [
"Return",
"unified",
"diff",
"of",
"actual",
"vs",
"expected",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L318-L336 |
43,557 | jimf/jasmine-diff | index.js | formatLinesWith | function formatLinesWith (formatter, str) {
return str
.split('\n')
.map(function (line) {
return line.length ? formatter(line) : ''
})
.join('\n')
} | javascript | function formatLinesWith (formatter, str) {
return str
.split('\n')
.map(function (line) {
return line.length ? formatter(line) : ''
})
.join('\n')
} | [
"function",
"formatLinesWith",
"(",
"formatter",
",",
"str",
")",
"{",
"return",
"str",
".",
"split",
"(",
"'\\n'",
")",
".",
"map",
"(",
"function",
"(",
"line",
")",
"{",
"return",
"line",
".",
"length",
"?",
"formatter",
"(",
"line",
")",
":",
"''... | Run a transformation function over the lines within a string and return the
result.
@param {function} formatter Formatter function
@param {string} str String to format
@return {string} | [
"Run",
"a",
"transformation",
"function",
"over",
"the",
"lines",
"within",
"a",
"string",
"and",
"return",
"the",
"result",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L346-L353 |
43,558 | jimf/jasmine-diff | index.js | inlineDiff | function inlineDiff (actual, expected, formatAdd, formatRem) {
var result = diff.diffWordsWithSpace(actual, expected)
.map(function (line, idx) {
if (line.added) { return formatLinesWith(formatAdd, line.value) }
return line.removed
? formatLinesWith(formatRem, line.value)
: line.value
... | javascript | function inlineDiff (actual, expected, formatAdd, formatRem) {
var result = diff.diffWordsWithSpace(actual, expected)
.map(function (line, idx) {
if (line.added) { return formatLinesWith(formatAdd, line.value) }
return line.removed
? formatLinesWith(formatRem, line.value)
: line.value
... | [
"function",
"inlineDiff",
"(",
"actual",
",",
"expected",
",",
"formatAdd",
",",
"formatRem",
")",
"{",
"var",
"result",
"=",
"diff",
".",
"diffWordsWithSpace",
"(",
"actual",
",",
"expected",
")",
".",
"map",
"(",
"function",
"(",
"line",
",",
"idx",
")... | Return inline diff of actual vs expected.
@param {*} actual Actual value
@param {*} expected Expected value
@param {function} formatAdd Addition formatter
@param {function} formatRem Removal formatter
@return {string} | [
"Return",
"inline",
"diff",
"of",
"actual",
"vs",
"expected",
"."
] | 3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82 | https://github.com/jimf/jasmine-diff/blob/3e9095d00bd6a87fcd6f52eab6b9afcc9c993d82/index.js#L364-L384 |
43,559 | iceddev/matchmedia | index.js | Mql | function Mql(query, values){
var self = this;
if(dynamicMatch){
var mql = dynamicMatch.call(window, query);
this.matches = mql.matches;
this.media = mql.media;
// TODO: is there a time it makes sense to remove this listener?
mql.addListener(update);
} else {
this.matches = staticMatch(quer... | javascript | function Mql(query, values){
var self = this;
if(dynamicMatch){
var mql = dynamicMatch.call(window, query);
this.matches = mql.matches;
this.media = mql.media;
// TODO: is there a time it makes sense to remove this listener?
mql.addListener(update);
} else {
this.matches = staticMatch(quer... | [
"function",
"Mql",
"(",
"query",
",",
"values",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"dynamicMatch",
")",
"{",
"var",
"mql",
"=",
"dynamicMatch",
".",
"call",
"(",
"window",
",",
"query",
")",
";",
"this",
".",
"matches",
"=",
"mql... | our fake MediaQueryList | [
"our",
"fake",
"MediaQueryList"
] | 96eee43707a7414dca326c6527a75a78b1c71010 | https://github.com/iceddev/matchmedia/blob/96eee43707a7414dca326c6527a75a78b1c71010/index.js#L7-L45 |
43,560 | dsfields/radargun | lib/bench.js | assertThresholds | function assertThresholds(thresholds) {
if (!elv(thresholds)) return null;
if (typeof thresholds !== 'object') {
throw new TypeError(msg.argThresholds);
}
const avg = elv.coalesce(thresholds.avg, false);
const max = elv.coalesce(thresholds.max, false);
const min = elv.coalesce(thresholds.min, false);
... | javascript | function assertThresholds(thresholds) {
if (!elv(thresholds)) return null;
if (typeof thresholds !== 'object') {
throw new TypeError(msg.argThresholds);
}
const avg = elv.coalesce(thresholds.avg, false);
const max = elv.coalesce(thresholds.max, false);
const min = elv.coalesce(thresholds.min, false);
... | [
"function",
"assertThresholds",
"(",
"thresholds",
")",
"{",
"if",
"(",
"!",
"elv",
"(",
"thresholds",
")",
")",
"return",
"null",
";",
"if",
"(",
"typeof",
"thresholds",
"!==",
"'object'",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"msg",
".",
"argThre... | Validates threshold options. If it is invalid a TypeError is thrown.
Otherwise, a normalized thresholds object or null is returned.
@param {object} thresholds
@returns {object} | [
"Validates",
"threshold",
"options",
".",
"If",
"it",
"is",
"invalid",
"a",
"TypeError",
"is",
"thrown",
".",
"Otherwise",
"a",
"normalized",
"thresholds",
"object",
"or",
"null",
"is",
"returned",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/bench.js#L172-L206 |
43,561 | dsfields/radargun | lib/bench.js | assertThreshold | function assertThreshold(value, other, threshold) {
if (!threshold && value > other) throw new ThresholdError();
const ratio = 1 - (value / other);
if (ratio < threshold) throw new ThresholdError();
} | javascript | function assertThreshold(value, other, threshold) {
if (!threshold && value > other) throw new ThresholdError();
const ratio = 1 - (value / other);
if (ratio < threshold) throw new ThresholdError();
} | [
"function",
"assertThreshold",
"(",
"value",
",",
"other",
",",
"threshold",
")",
"{",
"if",
"(",
"!",
"threshold",
"&&",
"value",
">",
"other",
")",
"throw",
"new",
"ThresholdError",
"(",
")",
";",
"const",
"ratio",
"=",
"1",
"-",
"(",
"value",
"/",
... | CHECK THRESHOLDS
Throws if a given threshold ratio is not met.
@param {number} value
@param {number} other
@param {?number} threshold | [
"CHECK",
"THRESHOLDS",
"Throws",
"if",
"a",
"given",
"threshold",
"ratio",
"is",
"not",
"met",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/bench.js#L271-L275 |
43,562 | dsfields/radargun | lib/bench.js | checkThresholds | function checkThresholds(metrics, thresholds) {
if (!elv(thresholds)) return;
const target = metrics[thresholds.target];
for (let i = 0; i < metrics.length; i++) {
if (i === thresholds.target) continue;
const other = metrics[i];
assertThreshold(target.avg, other.avg, thresholds.avg);
assertThre... | javascript | function checkThresholds(metrics, thresholds) {
if (!elv(thresholds)) return;
const target = metrics[thresholds.target];
for (let i = 0; i < metrics.length; i++) {
if (i === thresholds.target) continue;
const other = metrics[i];
assertThreshold(target.avg, other.avg, thresholds.avg);
assertThre... | [
"function",
"checkThresholds",
"(",
"metrics",
",",
"thresholds",
")",
"{",
"if",
"(",
"!",
"elv",
"(",
"thresholds",
")",
")",
"return",
";",
"const",
"target",
"=",
"metrics",
"[",
"thresholds",
".",
"target",
"]",
";",
"for",
"(",
"let",
"i",
"=",
... | Validates results of a benchmarking run against a given set of thresholds. If
the target function's metrics are outside of the given thresholds, an error
is thrown.
@param {FunctionMetrics[]} metrics
@param {Thresholds} thresholds | [
"Validates",
"results",
"of",
"a",
"benchmarking",
"run",
"against",
"a",
"given",
"set",
"of",
"thresholds",
".",
"If",
"the",
"target",
"function",
"s",
"metrics",
"are",
"outside",
"of",
"the",
"given",
"thresholds",
"an",
"error",
"is",
"thrown",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/bench.js#L286-L299 |
43,563 | dsfields/radargun | lib/bench.js | bench | function bench(functions, options) {
const funcs = assertFunctions(functions);
const opts = assertOptions(options);
const metrics = [];
const totalRuns = funcs.length * opts.runs;
let runCount = 0;
for (let i = 0; i < funcs.length; i++) {
const func = funcs[i];
const totals = [0, 0];
let max = ... | javascript | function bench(functions, options) {
const funcs = assertFunctions(functions);
const opts = assertOptions(options);
const metrics = [];
const totalRuns = funcs.length * opts.runs;
let runCount = 0;
for (let i = 0; i < funcs.length; i++) {
const func = funcs[i];
const totals = [0, 0];
let max = ... | [
"function",
"bench",
"(",
"functions",
",",
"options",
")",
"{",
"const",
"funcs",
"=",
"assertFunctions",
"(",
"functions",
")",
";",
"const",
"opts",
"=",
"assertOptions",
"(",
"options",
")",
";",
"const",
"metrics",
"=",
"[",
"]",
";",
"const",
"tota... | BENCHMARKING
Runs a benchmark analysis for a given array of functions, and generates a
report.
@param {(function|FunctionConfiguration)[]} functions
@param {BenchOptions} options
@returns {FunctionMetrics[]} | [
"BENCHMARKING",
"Runs",
"a",
"benchmark",
"analysis",
"for",
"a",
"given",
"array",
"of",
"functions",
"and",
"generates",
"a",
"report",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/bench.js#L316-L360 |
43,564 | robinpowered/robin-js-sdk-public | lib/api/modules/accounts.js | function (accountIdOrSlug, params) {
var path;
if (accountIdOrSlug) {
path = this.constructPath(constants.ACCOUNTS, accountIdOrSlug);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: An account id or slug must be supplied for this operation');
}
} | javascript | function (accountIdOrSlug, params) {
var path;
if (accountIdOrSlug) {
path = this.constructPath(constants.ACCOUNTS, accountIdOrSlug);
return this.Core.GET(path, params);
} else {
return this.rejectRequest('Bad Request: An account id or slug must be supplied for this operation');
}
} | [
"function",
"(",
"accountIdOrSlug",
",",
"params",
")",
"{",
"var",
"path",
";",
"if",
"(",
"accountIdOrSlug",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"ACCOUNTS",
",",
"accountIdOrSlug",
")",
";",
"return",
"this",
".",
... | Get an account
@param {String|Integer} accountIdOrSlug A Robin account identifier or slug
@param {Object} params A querystring object
@return {Function} A Promise | [
"Get",
"an",
"account"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/accounts.js#L20-L28 | |
43,565 | Beh01der/node-docker-monitor | lib/index.js | updateContainers | function updateContainers(next) {
monitor.docker.listContainers(function(err, list) {
if (err) {
console.log('Error listing running containers: %s', err.message, err);
return next(err);
}
if (!monitor.started) {
if (handler.onMonitorStarted) {
handler.onMonitorSt... | javascript | function updateContainers(next) {
monitor.docker.listContainers(function(err, list) {
if (err) {
console.log('Error listing running containers: %s', err.message, err);
return next(err);
}
if (!monitor.started) {
if (handler.onMonitorStarted) {
handler.onMonitorSt... | [
"function",
"updateContainers",
"(",
"next",
")",
"{",
"monitor",
".",
"docker",
".",
"listContainers",
"(",
"function",
"(",
"err",
",",
"list",
")",
"{",
"if",
"(",
"err",
")",
"{",
"console",
".",
"log",
"(",
"'Error listing running containers: %s'",
",",... | initially populate container map | [
"initially",
"populate",
"container",
"map"
] | 4e81eb12081c1fb91b5b91e0683e4cc1c0b05a43 | https://github.com/Beh01der/node-docker-monitor/blob/4e81eb12081c1fb91b5b91e0683e4cc1c0b05a43/lib/index.js#L136-L159 |
43,566 | Beh01der/node-docker-monitor | lib/index.js | processDockerEvent | function processDockerEvent(event, stop) {
if (trackedEvents.indexOf(event.status) !== -1) {
var container = containerById.get(event.id);
if (container) {
if (positiveEvents.indexOf(event.status) !== -1) {
updateContainer(container);
} else {
removeContainer(container... | javascript | function processDockerEvent(event, stop) {
if (trackedEvents.indexOf(event.status) !== -1) {
var container = containerById.get(event.id);
if (container) {
if (positiveEvents.indexOf(event.status) !== -1) {
updateContainer(container);
} else {
removeContainer(container... | [
"function",
"processDockerEvent",
"(",
"event",
",",
"stop",
")",
"{",
"if",
"(",
"trackedEvents",
".",
"indexOf",
"(",
"event",
".",
"status",
")",
"!==",
"-",
"1",
")",
"{",
"var",
"container",
"=",
"containerById",
".",
"get",
"(",
"event",
".",
"id... | start monitoring docker events | [
"start",
"monitoring",
"docker",
"events"
] | 4e81eb12081c1fb91b5b91e0683e4cc1c0b05a43 | https://github.com/Beh01der/node-docker-monitor/blob/4e81eb12081c1fb91b5b91e0683e4cc1c0b05a43/lib/index.js#L162-L182 |
43,567 | mwild1/xmppjs | lib/xmpp.js | function (attr) {
this.debug("STREAM: opened.");
this._setStatus(xmpp.Status.AUTHENTICATING);
var handshake = sha1.hex(attr.id + this.password);
this.debug("Calculated authentication token " + handshake
+ " from stream id '" + attr.id
+ "' and password '" + this.password + "'");
this.debug("Sending auth... | javascript | function (attr) {
this.debug("STREAM: opened.");
this._setStatus(xmpp.Status.AUTHENTICATING);
var handshake = sha1.hex(attr.id + this.password);
this.debug("Calculated authentication token " + handshake
+ " from stream id '" + attr.id
+ "' and password '" + this.password + "'");
this.debug("Sending auth... | [
"function",
"(",
"attr",
")",
"{",
"this",
".",
"debug",
"(",
"\"STREAM: opened.\"",
")",
";",
"this",
".",
"_setStatus",
"(",
"xmpp",
".",
"Status",
".",
"AUTHENTICATING",
")",
";",
"var",
"handshake",
"=",
"sha1",
".",
"hex",
"(",
"attr",
".",
"id",
... | Stream listeners, called on XMPP-level events | [
"Stream",
"listeners",
"called",
"on",
"XMPP",
"-",
"level",
"events"
] | 35cfa5b004058942d9c91d3df0afd81a4c987a02 | https://github.com/mwild1/xmppjs/blob/35cfa5b004058942d9c91d3df0afd81a4c987a02/lib/xmpp.js#L206-L215 | |
43,568 | jeffrose/emitter | dist/emitter-umd.js | addConditionalEventListener | function addConditionalEventListener(emitter, type, listener) {
function conditionalListener() {
var done = listener.apply(emitter, arguments);
if (done === true) {
removeEventListener(emitter, type, conditionalListener);
}
}
// TODO Check be... | javascript | function addConditionalEventListener(emitter, type, listener) {
function conditionalListener() {
var done = listener.apply(emitter, arguments);
if (done === true) {
removeEventListener(emitter, type, conditionalListener);
}
}
// TODO Check be... | [
"function",
"addConditionalEventListener",
"(",
"emitter",
",",
"type",
",",
"listener",
")",
"{",
"function",
"conditionalListener",
"(",
")",
"{",
"var",
"done",
"=",
"listener",
".",
"apply",
"(",
"emitter",
",",
"arguments",
")",
";",
"if",
"(",
"done",
... | Many of these functions are broken out from the prototype for the sake of optimization. The functions on the protoytype take a variable number of arguments and can be deoptimized as a result. These functions have a fixed number of arguments and therefore do not get deoptimized.
@function Emitter~addConditionalEventLis... | [
"Many",
"of",
"these",
"functions",
"are",
"broken",
"out",
"from",
"the",
"prototype",
"for",
"the",
"sake",
"of",
"optimization",
".",
"The",
"functions",
"on",
"the",
"protoytype",
"take",
"a",
"variable",
"number",
"of",
"arguments",
"and",
"can",
"be",
... | c6d8d1702ff60ca4f5100d13480914e4bd17183f | https://github.com/jeffrose/emitter/blob/c6d8d1702ff60ca4f5100d13480914e4bd17183f/dist/emitter-umd.js#L172-L185 |
43,569 | jeffrose/emitter | dist/emitter-umd.js | listenMany | function listenMany(handler, isFunction, emitter, args) {
var errors = [];
if (isFunction) {
try {
handler.apply(emitter, args);
} catch (error) {
errors.push(error);
}
} else {
var length = handler.length,
... | javascript | function listenMany(handler, isFunction, emitter, args) {
var errors = [];
if (isFunction) {
try {
handler.apply(emitter, args);
} catch (error) {
errors.push(error);
}
} else {
var length = handler.length,
... | [
"function",
"listenMany",
"(",
"handler",
",",
"isFunction",
",",
"emitter",
",",
"args",
")",
"{",
"var",
"errors",
"=",
"[",
"]",
";",
"if",
"(",
"isFunction",
")",
"{",
"try",
"{",
"handler",
".",
"apply",
"(",
"emitter",
",",
"args",
")",
";",
... | Execute a listener with four or more arguments.
@function Emitter~listenMany
@param {EventListener|Array<EventListener>} handler One or more {@link EventListener|listeners} that will be executed on the `emitter`.
@param {external:boolean} isFunction Whether or not the `handler` is a {@link external:Function|function}.
... | [
"Execute",
"a",
"listener",
"with",
"four",
"or",
"more",
"arguments",
"."
] | c6d8d1702ff60ca4f5100d13480914e4bd17183f | https://github.com/jeffrose/emitter/blob/c6d8d1702ff60ca4f5100d13480914e4bd17183f/dist/emitter-umd.js#L621-L648 |
43,570 | jeffrose/emitter | dist/emitter-umd.js | spliceList | function spliceList(list, index) {
for (var i = index, j = i + 1, length = list.length; j < length; i += 1, j += 1) {
list[i] = list[j];
}
list.pop();
} | javascript | function spliceList(list, index) {
for (var i = index, j = i + 1, length = list.length; j < length; i += 1, j += 1) {
list[i] = list[j];
}
list.pop();
} | [
"function",
"spliceList",
"(",
"list",
",",
"index",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"index",
",",
"j",
"=",
"i",
"+",
"1",
",",
"length",
"=",
"list",
".",
"length",
";",
"j",
"<",
"length",
";",
"i",
"+=",
"1",
",",
"j",
"+=",
"1",
... | Faster than `Array.prototype.splice`
@function Emitter~spliceList
@param {external:Array} list
@param {external:number} index | [
"Faster",
"than",
"Array",
".",
"prototype",
".",
"splice"
] | c6d8d1702ff60ca4f5100d13480914e4bd17183f | https://github.com/jeffrose/emitter/blob/c6d8d1702ff60ca4f5100d13480914e4bd17183f/dist/emitter-umd.js#L713-L719 |
43,571 | brochington/Akkad | lib/Oimo.js | function(){
this.randX=65535;
while(this.joints!==null){
this.removeJoint(this.joints);
}
while(this.contacts!==null){
this.removeContact(this.contacts);
}
while(this.rigidBodies!==null){
this.removeRigidBody(this.rigidBodies);
... | javascript | function(){
this.randX=65535;
while(this.joints!==null){
this.removeJoint(this.joints);
}
while(this.contacts!==null){
this.removeContact(this.contacts);
}
while(this.rigidBodies!==null){
this.removeRigidBody(this.rigidBodies);
... | [
"function",
"(",
")",
"{",
"this",
".",
"randX",
"=",
"65535",
";",
"while",
"(",
"this",
".",
"joints",
"!==",
"null",
")",
"{",
"this",
".",
"removeJoint",
"(",
"this",
".",
"joints",
")",
";",
"}",
"while",
"(",
"this",
".",
"contacts",
"!==",
... | Reset the randomizer and remove all rigid bodies, shapes, joints and any object from the world. | [
"Reset",
"the",
"randomizer",
"and",
"remove",
"all",
"rigid",
"bodies",
"shapes",
"joints",
"and",
"any",
"object",
"from",
"the",
"world",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L110-L122 | |
43,572 | brochington/Akkad | lib/Oimo.js | function(rigidBody){
if(rigidBody.parent){
throw new Error("It is not possible to be added to more than one world one of the rigid body");
}
rigidBody.parent=this;
rigidBody.awake();
for(var shape=rigidBody.shapes; shape!==null; shape=shape.next){
this.add... | javascript | function(rigidBody){
if(rigidBody.parent){
throw new Error("It is not possible to be added to more than one world one of the rigid body");
}
rigidBody.parent=this;
rigidBody.awake();
for(var shape=rigidBody.shapes; shape!==null; shape=shape.next){
this.add... | [
"function",
"(",
"rigidBody",
")",
"{",
"if",
"(",
"rigidBody",
".",
"parent",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"It is not possible to be added to more than one world one of the rigid body\"",
")",
";",
"}",
"rigidBody",
".",
"parent",
"=",
"this",
";",
"... | I'll add a rigid body to the world.
Rigid body that has been added will be the operands of each step.
@param rigidBody Rigid body that you want to add | [
"I",
"ll",
"add",
"a",
"rigid",
"body",
"to",
"the",
"world",
".",
"Rigid",
"body",
"that",
"has",
"been",
"added",
"will",
"be",
"the",
"operands",
"of",
"each",
"step",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L128-L140 | |
43,573 | brochington/Akkad | lib/Oimo.js | function(rigidBody){
var remove=rigidBody;
if(remove.parent!==this)return;
remove.awake();
var js=remove.jointLink;
while(js!=null){
var joint=js.joint;
js=js.next;
this.removeJoint(joint);
}
for(var shape=rigidBody.shapes; shape!==null;... | javascript | function(rigidBody){
var remove=rigidBody;
if(remove.parent!==this)return;
remove.awake();
var js=remove.jointLink;
while(js!=null){
var joint=js.joint;
js=js.next;
this.removeJoint(joint);
}
for(var shape=rigidBody.shapes; shape!==null;... | [
"function",
"(",
"rigidBody",
")",
"{",
"var",
"remove",
"=",
"rigidBody",
";",
"if",
"(",
"remove",
".",
"parent",
"!==",
"this",
")",
"return",
";",
"remove",
".",
"awake",
"(",
")",
";",
"var",
"js",
"=",
"remove",
".",
"jointLink",
";",
"while",
... | I will remove the rigid body from the world.
Rigid body that has been deleted is excluded from the calculation on a step-by-step basis.
@param rigidBody Rigid body to be removed | [
"I",
"will",
"remove",
"the",
"rigid",
"body",
"from",
"the",
"world",
".",
"Rigid",
"body",
"that",
"has",
"been",
"deleted",
"is",
"excluded",
"from",
"the",
"calculation",
"on",
"a",
"step",
"-",
"by",
"-",
"step",
"basis",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L146-L168 | |
43,574 | brochington/Akkad | lib/Oimo.js | function(shape){
if(!shape.parent || !shape.parent.parent){
throw new Error("It is not possible to be added alone to shape world");
}
shape.proxy = this.broadPhase.createProxy(shape);
shape.updateProxy();
this.broadPhase.addProxy(shape.proxy);
} | javascript | function(shape){
if(!shape.parent || !shape.parent.parent){
throw new Error("It is not possible to be added alone to shape world");
}
shape.proxy = this.broadPhase.createProxy(shape);
shape.updateProxy();
this.broadPhase.addProxy(shape.proxy);
} | [
"function",
"(",
"shape",
")",
"{",
"if",
"(",
"!",
"shape",
".",
"parent",
"||",
"!",
"shape",
".",
"parent",
".",
"parent",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"It is not possible to be added alone to shape world\"",
")",
";",
"}",
"shape",
".",
"p... | I'll add a shape to the world..
Add to the rigid world, and if you add a shape to a rigid body that has been added to the world,
Shape will be added to the world automatically, please do not call from outside this method.
@param shape Shape you want to add | [
"I",
"ll",
"add",
"a",
"shape",
"to",
"the",
"world",
"..",
"Add",
"to",
"the",
"rigid",
"world",
"and",
"if",
"you",
"add",
"a",
"shape",
"to",
"a",
"rigid",
"body",
"that",
"has",
"been",
"added",
"to",
"the",
"world",
"Shape",
"will",
"be",
"add... | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L190-L197 | |
43,575 | brochington/Akkad | lib/Oimo.js | function(joint){
if(joint.parent){
throw new Error("It is not possible to be added to more than one world one of the joint");
}
if(this.joints!=null)(this.joints.prev=joint).next=this.joints;
this.joints=joint;
joint.parent=this;
this.numJoints++;
join... | javascript | function(joint){
if(joint.parent){
throw new Error("It is not possible to be added to more than one world one of the joint");
}
if(this.joints!=null)(this.joints.prev=joint).next=this.joints;
this.joints=joint;
joint.parent=this;
this.numJoints++;
join... | [
"function",
"(",
"joint",
")",
"{",
"if",
"(",
"joint",
".",
"parent",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"It is not possible to be added to more than one world one of the joint\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"joints",
"!=",
"null",
")",
"("... | I'll add a joint to the world.
Joint that has been added will be the operands of each step.
@param shape Joint to be added | [
"I",
"ll",
"add",
"a",
"joint",
"to",
"the",
"world",
".",
"Joint",
"that",
"has",
"been",
"added",
"will",
"be",
"the",
"operands",
"of",
"each",
"step",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L215-L225 | |
43,576 | brochington/Akkad | lib/Oimo.js | function(joint){
var remove=joint;
var prev=remove.prev;
var next=remove.next;
if(prev!==null)prev.next=next;
if(next!==null)next.prev=prev;
if(this.joints==remove)this.joints=next;
remove.prev=null;
remove.next=null;
this.numJoints--;
remo... | javascript | function(joint){
var remove=joint;
var prev=remove.prev;
var next=remove.next;
if(prev!==null)prev.next=next;
if(next!==null)next.prev=prev;
if(this.joints==remove)this.joints=next;
remove.prev=null;
remove.next=null;
this.numJoints--;
remo... | [
"function",
"(",
"joint",
")",
"{",
"var",
"remove",
"=",
"joint",
";",
"var",
"prev",
"=",
"remove",
".",
"prev",
";",
"var",
"next",
"=",
"remove",
".",
"next",
";",
"if",
"(",
"prev",
"!==",
"null",
")",
"prev",
".",
"next",
"=",
"next",
";",
... | I will remove the joint from the world.
Joint that has been added will be the operands of each step.
@param shape Joint to be deleted | [
"I",
"will",
"remove",
"the",
"joint",
"from",
"the",
"world",
".",
"Joint",
"that",
"has",
"been",
"added",
"will",
"be",
"the",
"operands",
"of",
"each",
"step",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L232-L245 | |
43,577 | brochington/Akkad | lib/Oimo.js | function(shape){
if(shape.parent){
throw new Error("It is not possible that you add to the multi-rigid body the shape of one");
}
if(this.shapes!=null)(this.shapes.prev=shape).next=this.shapes;
this.shapes=shape;
shape.parent=this;
if(this.parent)this.parent.a... | javascript | function(shape){
if(shape.parent){
throw new Error("It is not possible that you add to the multi-rigid body the shape of one");
}
if(this.shapes!=null)(this.shapes.prev=shape).next=this.shapes;
this.shapes=shape;
shape.parent=this;
if(this.parent)this.parent.a... | [
"function",
"(",
"shape",
")",
"{",
"if",
"(",
"shape",
".",
"parent",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"It is not possible that you add to the multi-rigid body the shape of one\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"shapes",
"!=",
"null",
")",
"... | I'll add a shape to rigid body.
If you add a shape, please call the setupMass method to step up to the start of the next.
@param shape shape to Add | [
"I",
"ll",
"add",
"a",
"shape",
"to",
"rigid",
"body",
".",
"If",
"you",
"add",
"a",
"shape",
"please",
"call",
"the",
"setupMass",
"method",
"to",
"step",
"up",
"to",
"the",
"start",
"of",
"the",
"next",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L759-L768 | |
43,578 | brochington/Akkad | lib/Oimo.js | function(shape){
var remove=shape;
if(remove.parent!=this)return;
var prev=remove.prev;
var next=remove.next;
if(prev!=null)prev.next=next;
if(next!=null)next.prev=prev;
if(this.shapes==remove)this.shapes=next;
remove.prev=null;
remove.next=null;
... | javascript | function(shape){
var remove=shape;
if(remove.parent!=this)return;
var prev=remove.prev;
var next=remove.next;
if(prev!=null)prev.next=next;
if(next!=null)next.prev=prev;
if(this.shapes==remove)this.shapes=next;
remove.prev=null;
remove.next=null;
... | [
"function",
"(",
"shape",
")",
"{",
"var",
"remove",
"=",
"shape",
";",
"if",
"(",
"remove",
".",
"parent",
"!=",
"this",
")",
"return",
";",
"var",
"prev",
"=",
"remove",
".",
"prev",
";",
"var",
"next",
"=",
"remove",
".",
"next",
";",
"if",
"(... | I will delete the shape from the rigid body.
If you delete a shape, please call the setupMass method to step up to the start of the next.
@param shape shape to Delete | [
"I",
"will",
"delete",
"the",
"shape",
"from",
"the",
"rigid",
"body",
".",
"If",
"you",
"delete",
"a",
"shape",
"please",
"call",
"the",
"setupMass",
"method",
"to",
"step",
"up",
"to",
"the",
"start",
"of",
"the",
"next",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L774-L787 | |
43,579 | brochington/Akkad | lib/Oimo.js | function(){
if(!this.allowSleep||!this.sleeping)return;
this.sleeping=false;
this.sleepTime=0;
// awake connected constraints
var cs=this.contactLink;
while(cs!=null){
cs.body.sleepTime=0;
cs.body.sleeping=false;
cs=cs.next;
}
... | javascript | function(){
if(!this.allowSleep||!this.sleeping)return;
this.sleeping=false;
this.sleepTime=0;
// awake connected constraints
var cs=this.contactLink;
while(cs!=null){
cs.body.sleepTime=0;
cs.body.sleeping=false;
cs=cs.next;
}
... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"allowSleep",
"||",
"!",
"this",
".",
"sleeping",
")",
"return",
";",
"this",
".",
"sleeping",
"=",
"false",
";",
"this",
".",
"sleepTime",
"=",
"0",
";",
"// awake connected constraints",
"var",
... | Awake the rigid body. | [
"Awake",
"the",
"rigid",
"body",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L873-L893 | |
43,580 | brochington/Akkad | lib/Oimo.js | function(){
if(!this.allowSleep||this.sleeping)return;
this.linearVelocity.init();
this.angularVelocity.init();
this.sleepPosition.copy(this.position);
this.sleepOrientation.copy(this.orientation);
/*this.linearVelocity.x=0;
this.linearVelocity.y=0;
this.l... | javascript | function(){
if(!this.allowSleep||this.sleeping)return;
this.linearVelocity.init();
this.angularVelocity.init();
this.sleepPosition.copy(this.position);
this.sleepOrientation.copy(this.orientation);
/*this.linearVelocity.x=0;
this.linearVelocity.y=0;
this.l... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"allowSleep",
"||",
"this",
".",
"sleeping",
")",
"return",
";",
"this",
".",
"linearVelocity",
".",
"init",
"(",
")",
";",
"this",
".",
"angularVelocity",
".",
"init",
"(",
")",
";",
"this",
... | Sleep the rigid body. | [
"Sleep",
"the",
"rigid",
"body",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L897-L922 | |
43,581 | brochington/Akkad | lib/Oimo.js | function(timeStep){
switch(this.type){
case this.BODY_STATIC:
this.linearVelocity.init();
this.angularVelocity.init();
// ONLY FOR TEST
if(this.controlPos){
this.position.copy(this.newPosition);
t... | javascript | function(timeStep){
switch(this.type){
case this.BODY_STATIC:
this.linearVelocity.init();
this.angularVelocity.init();
// ONLY FOR TEST
if(this.controlPos){
this.position.copy(this.newPosition);
t... | [
"function",
"(",
"timeStep",
")",
"{",
"switch",
"(",
"this",
".",
"type",
")",
"{",
"case",
"this",
".",
"BODY_STATIC",
":",
"this",
".",
"linearVelocity",
".",
"init",
"(",
")",
";",
"this",
".",
"angularVelocity",
".",
"init",
"(",
")",
";",
"// O... | The time integration of the motion of a rigid body, you can update the information such as the shape.
This method is invoked automatically when calling the step of the World,
There is no need to call from outside usually.
@param timeStep time | [
"The",
"time",
"integration",
"of",
"the",
"motion",
"of",
"a",
"rigid",
"body",
"you",
"can",
"update",
"the",
"information",
"such",
"as",
"the",
"shape",
".",
"This",
"method",
"is",
"invoked",
"automatically",
"when",
"calling",
"the",
"step",
"of",
"t... | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L938-L998 | |
43,582 | brochington/Akkad | lib/Oimo.js | function(){
var prev=this.s1Link.prev;
var next=this.s1Link.next;
if(prev!==null)prev.next=next;
if(next!==null)next.prev=prev;
if(this.shape1.contactLink==this.s1Link)this.shape1.contactLink=next;
this.s1Link.prev=null;
this.s1Link.next=null;
this.s1Link.... | javascript | function(){
var prev=this.s1Link.prev;
var next=this.s1Link.next;
if(prev!==null)prev.next=next;
if(next!==null)next.prev=prev;
if(this.shape1.contactLink==this.s1Link)this.shape1.contactLink=next;
this.s1Link.prev=null;
this.s1Link.next=null;
this.s1Link.... | [
"function",
"(",
")",
"{",
"var",
"prev",
"=",
"this",
".",
"s1Link",
".",
"prev",
";",
"var",
"next",
"=",
"this",
".",
"s1Link",
".",
"next",
";",
"if",
"(",
"prev",
"!==",
"null",
")",
"prev",
".",
"next",
"=",
"next",
";",
"if",
"(",
"next"... | Detach the contact from the shapes. | [
"Detach",
"the",
"contact",
"from",
"the",
"shapes",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L5804-L5859 | |
43,583 | brochington/Akkad | lib/Oimo.js | function(x,y,z,normalX,normalY,normalZ,penetration,flip){
var p=this.points[this.numPoints++];
p.position.x=x;
p.position.y=y;
p.position.z=z;
var r=this.body1.rotation;
var rx=x-this.body1.position.x;
var ry=y-this.body1.position.y;
var rz=z-this.body1.po... | javascript | function(x,y,z,normalX,normalY,normalZ,penetration,flip){
var p=this.points[this.numPoints++];
p.position.x=x;
p.position.y=y;
p.position.z=z;
var r=this.body1.rotation;
var rx=x-this.body1.position.x;
var ry=y-this.body1.position.y;
var rz=z-this.body1.po... | [
"function",
"(",
"x",
",",
"y",
",",
"z",
",",
"normalX",
",",
"normalY",
",",
"normalZ",
",",
"penetration",
",",
"flip",
")",
"{",
"var",
"p",
"=",
"this",
".",
"points",
"[",
"this",
".",
"numPoints",
"++",
"]",
";",
"p",
".",
"position",
".",... | Add a point into this manifold.
@param x
@param y
@param z
@param normalX
@param normalY
@param normalZ
@param penetration
@param flip | [
"Add",
"a",
"point",
"into",
"this",
"manifold",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L6390-L6424 | |
43,584 | brochington/Akkad | lib/Oimo.js | function(aabb1,aabb2){
this.minX = (aabb1.minX<aabb2.minX) ? aabb1.minX : aabb2.minX;
this.maxX = (aabb1.maxX>aabb2.maxX) ? aabb1.maxX : aabb2.maxX;
this.minY = (aabb1.minY<aabb2.minY) ? aabb1.minY : aabb2.minY;
this.maxY = (aabb1.maxY>aabb2.maxY) ? aabb1.maxY : aabb2.maxY;
this.... | javascript | function(aabb1,aabb2){
this.minX = (aabb1.minX<aabb2.minX) ? aabb1.minX : aabb2.minX;
this.maxX = (aabb1.maxX>aabb2.maxX) ? aabb1.maxX : aabb2.maxX;
this.minY = (aabb1.minY<aabb2.minY) ? aabb1.minY : aabb2.minY;
this.maxY = (aabb1.maxY>aabb2.maxY) ? aabb1.maxY : aabb2.maxY;
this.... | [
"function",
"(",
"aabb1",
",",
"aabb2",
")",
"{",
"this",
".",
"minX",
"=",
"(",
"aabb1",
".",
"minX",
"<",
"aabb2",
".",
"minX",
")",
"?",
"aabb1",
".",
"minX",
":",
"aabb2",
".",
"minX",
";",
"this",
".",
"maxX",
"=",
"(",
"aabb1",
".",
"maxX... | Set this AABB to the combined AABB of aabb1 and aabb2.
@param aabb1
@param aabb2 | [
"Set",
"this",
"AABB",
"to",
"the",
"combined",
"AABB",
"of",
"aabb1",
"and",
"aabb2",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L8435-L8451 | |
43,585 | brochington/Akkad | lib/Oimo.js | function(){
var h=this.maxY-this.minY;
var d=this.maxZ-this.minZ;
return 2*((this.maxX-this.minX)*(h+d)+h*d);
} | javascript | function(){
var h=this.maxY-this.minY;
var d=this.maxZ-this.minZ;
return 2*((this.maxX-this.minX)*(h+d)+h*d);
} | [
"function",
"(",
")",
"{",
"var",
"h",
"=",
"this",
".",
"maxY",
"-",
"this",
".",
"minY",
";",
"var",
"d",
"=",
"this",
".",
"maxZ",
"-",
"this",
".",
"minZ",
";",
"return",
"2",
"*",
"(",
"(",
"this",
".",
"maxX",
"-",
"this",
".",
"minX",
... | Get the surface area.
@return | [
"Get",
"the",
"surface",
"area",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L8456-L8460 | |
43,586 | brochington/Akkad | lib/Oimo.js | function(x,y,z){
return x>=this.minX&&x<=this.maxX&&y>=this.minY&&y<=this.maxY&&z>=this.minZ&&z<=this.maxZ;
} | javascript | function(x,y,z){
return x>=this.minX&&x<=this.maxX&&y>=this.minY&&y<=this.maxY&&z>=this.minZ&&z<=this.maxZ;
} | [
"function",
"(",
"x",
",",
"y",
",",
"z",
")",
"{",
"return",
"x",
">=",
"this",
".",
"minX",
"&&",
"x",
"<=",
"this",
".",
"maxX",
"&&",
"y",
">=",
"this",
".",
"minY",
"&&",
"y",
"<=",
"this",
".",
"maxY",
"&&",
"z",
">=",
"this",
".",
"m... | Get whether the AABB intersects with the point or not.
@param x
@param y
@param z
@return | [
"Get",
"whether",
"the",
"AABB",
"intersects",
"with",
"the",
"point",
"or",
"not",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L8468-L8470 | |
43,587 | brochington/Akkad | lib/Oimo.js | function(s1,s2){
var b1=s1.parent;
var b2=s2.parent;
if( b1==b2 || // same parents
(!b1.isDynamic&&!b2.isDynamic) || // static or kinematic object
(s1.belongsTo&s2.collidesWith)==0 ||
(s2.belongsTo&s1.collidesWith)==0 // collision filtering
){ return ... | javascript | function(s1,s2){
var b1=s1.parent;
var b2=s2.parent;
if( b1==b2 || // same parents
(!b1.isDynamic&&!b2.isDynamic) || // static or kinematic object
(s1.belongsTo&s2.collidesWith)==0 ||
(s2.belongsTo&s1.collidesWith)==0 // collision filtering
){ return ... | [
"function",
"(",
"s1",
",",
"s2",
")",
"{",
"var",
"b1",
"=",
"s1",
".",
"parent",
";",
"var",
"b2",
"=",
"s2",
".",
"parent",
";",
"if",
"(",
"b1",
"==",
"b2",
"||",
"// same parents",
"(",
"!",
"b1",
".",
"isDynamic",
"&&",
"!",
"b2",
".",
... | Returns whether the pair is available or not.
@param s1
@param s2
@return | [
"Returns",
"whether",
"the",
"pair",
"is",
"available",
"or",
"not",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L8552-L8569 | |
43,588 | brochington/Akkad | lib/Oimo.js | function(){
while(this.numPairs>0){
var pair=this.pairs[--this.numPairs];
pair.shape1=null;
pair.shape2=null;
}
this.numPairChecks=0;
this.collectPairs();
} | javascript | function(){
while(this.numPairs>0){
var pair=this.pairs[--this.numPairs];
pair.shape1=null;
pair.shape2=null;
}
this.numPairChecks=0;
this.collectPairs();
} | [
"function",
"(",
")",
"{",
"while",
"(",
"this",
".",
"numPairs",
">",
"0",
")",
"{",
"var",
"pair",
"=",
"this",
".",
"pairs",
"[",
"--",
"this",
".",
"numPairs",
"]",
";",
"pair",
".",
"shape1",
"=",
"null",
";",
"pair",
".",
"shape2",
"=",
"... | Detect overlapping pairs. | [
"Detect",
"overlapping",
"pairs",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L8571-L8579 | |
43,589 | brochington/Akkad | lib/Oimo.js | function(leaf){
if(this.root==null){
this.root=leaf;
return;
}
var lb=leaf.aabb;
var sibling=this.root;
var oldArea;
var newArea;
while(sibling.proxy==null){ // descend the node to search the best pair
var c1=sibling.child1;
... | javascript | function(leaf){
if(this.root==null){
this.root=leaf;
return;
}
var lb=leaf.aabb;
var sibling=this.root;
var oldArea;
var newArea;
while(sibling.proxy==null){ // descend the node to search the best pair
var c1=sibling.child1;
... | [
"function",
"(",
"leaf",
")",
"{",
"if",
"(",
"this",
".",
"root",
"==",
"null",
")",
"{",
"this",
".",
"root",
"=",
"leaf",
";",
"return",
";",
"}",
"var",
"lb",
"=",
"leaf",
".",
"aabb",
";",
"var",
"sibling",
"=",
"this",
".",
"root",
";",
... | Insert a leaf to the tree.
@param node | [
"Insert",
"a",
"leaf",
"to",
"the",
"tree",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L9112-L9195 | |
43,590 | brochington/Akkad | lib/Oimo.js | function(leaf){
if(leaf==this.root){
this.root=null;
return;
}
var parent=leaf.parent;
var sibling;
if(parent.child1==leaf){
sibling=parent.child2;
}else{
sibling=parent.child1;
}
if(parent==this.root){
... | javascript | function(leaf){
if(leaf==this.root){
this.root=null;
return;
}
var parent=leaf.parent;
var sibling;
if(parent.child1==leaf){
sibling=parent.child2;
}else{
sibling=parent.child1;
}
if(parent==this.root){
... | [
"function",
"(",
"leaf",
")",
"{",
"if",
"(",
"leaf",
"==",
"this",
".",
"root",
")",
"{",
"this",
".",
"root",
"=",
"null",
";",
"return",
";",
"}",
"var",
"parent",
"=",
"leaf",
".",
"parent",
";",
"var",
"sibling",
";",
"if",
"(",
"parent",
... | Delete a leaf from the tree.
@param node | [
"Delete",
"a",
"leaf",
"from",
"the",
"tree",
"."
] | ccc3bb33f27e4c922a559320461fe3d21bc53f4a | https://github.com/brochington/Akkad/blob/ccc3bb33f27e4c922a559320461fe3d21bc53f4a/lib/Oimo.js#L9214-L9246 | |
43,591 | evansiroky/gtfs-sequelize | lib/gtfsLoader.js | function (timeString) {
if (!timeString) {
return null
}
var timeArr = timeString.split(':')
return parseInt(timeArr[0], 10) * 3600 +
parseInt(timeArr[1], 10) * 60 +
parseInt(timeArr[2])
} | javascript | function (timeString) {
if (!timeString) {
return null
}
var timeArr = timeString.split(':')
return parseInt(timeArr[0], 10) * 3600 +
parseInt(timeArr[1], 10) * 60 +
parseInt(timeArr[2])
} | [
"function",
"(",
"timeString",
")",
"{",
"if",
"(",
"!",
"timeString",
")",
"{",
"return",
"null",
"}",
"var",
"timeArr",
"=",
"timeString",
".",
"split",
"(",
"':'",
")",
"return",
"parseInt",
"(",
"timeArr",
"[",
"0",
"]",
",",
"10",
")",
"*",
"3... | convert timeString to int of seconds past midnight | [
"convert",
"timeString",
"to",
"int",
"of",
"seconds",
"past",
"midnight"
] | ba101fa82e730694c536c43e615ff38fd264a65b | https://github.com/evansiroky/gtfs-sequelize/blob/ba101fa82e730694c536c43e615ff38fd264a65b/lib/gtfsLoader.js#L25-L33 | |
43,592 | evansiroky/gtfs-sequelize | lib/gtfsLoader.js | function () {
insertCfg.model.sync({force: true}).then(function () {
var streamInserterCfg = util.makeStreamerConfig(insertCfg.model)
var inserter = dbStreamer.getInserter(streamInserterCfg)
inserter.connect(function (err) {
if (err) return callback(err)
csv()
.fromFile(... | javascript | function () {
insertCfg.model.sync({force: true}).then(function () {
var streamInserterCfg = util.makeStreamerConfig(insertCfg.model)
var inserter = dbStreamer.getInserter(streamInserterCfg)
inserter.connect(function (err) {
if (err) return callback(err)
csv()
.fromFile(... | [
"function",
"(",
")",
"{",
"insertCfg",
".",
"model",
".",
"sync",
"(",
"{",
"force",
":",
"true",
"}",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"var",
"streamInserterCfg",
"=",
"util",
".",
"makeStreamerConfig",
"(",
"insertCfg",
".",
"model"... | prepare processing function, but don't run it until file existance is confirmed | [
"prepare",
"processing",
"function",
"but",
"don",
"t",
"run",
"it",
"until",
"file",
"existance",
"is",
"confirmed"
] | ba101fa82e730694c536c43e615ff38fd264a65b | https://github.com/evansiroky/gtfs-sequelize/blob/ba101fa82e730694c536c43e615ff38fd264a65b/lib/gtfsLoader.js#L329-L348 | |
43,593 | kgryte/github-create-issue | lib/create.js | done | function done( error, data, info ) {
error = error || null;
data = data || null;
info = info || null;
clbk( error, data, info );
} | javascript | function done( error, data, info ) {
error = error || null;
data = data || null;
info = info || null;
clbk( error, data, info );
} | [
"function",
"done",
"(",
"error",
",",
"data",
",",
"info",
")",
"{",
"error",
"=",
"error",
"||",
"null",
";",
"data",
"=",
"data",
"||",
"null",
";",
"info",
"=",
"info",
"||",
"null",
";",
"clbk",
"(",
"error",
",",
"data",
",",
"info",
")",
... | Callback invoked after receiving an API response.
@private
@param {(Error|null)} error - error object
@param {Object} data - query data
@param {Object} info - response info | [
"Callback",
"invoked",
"after",
"receiving",
"an",
"API",
"response",
"."
] | 40612361f618ac0d0b52b23f641d78ca6342b19a | https://github.com/kgryte/github-create-issue/blob/40612361f618ac0d0b52b23f641d78ca6342b19a/lib/create.js#L68-L73 |
43,594 | robinpowered/robin-js-sdk-public | lib/api/modules/identifiers.js | function (identifierUrn, params) {
var path = this.constructPath(constants.IDENTIFIERS, identifierUrn);
return this.Core.GET(path, params);
} | javascript | function (identifierUrn, params) {
var path = this.constructPath(constants.IDENTIFIERS, identifierUrn);
return this.Core.GET(path, params);
} | [
"function",
"(",
"identifierUrn",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"IDENTIFIERS",
",",
"identifierUrn",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",... | Get all the identifiers or a particular identifier identified by the `identifierUrn` parameter
@param {String|Integer|undefined} identifierUrn A Robin identifier URN
@param {Object|undefined} params A querystring object
@return {Function} A Promise | [
"Get",
"all",
"the",
"identifiers",
"or",
"a",
"particular",
"identifier",
"identified",
"by",
"the",
"identifierUrn",
"parameter"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/identifiers.js#L20-L23 | |
43,595 | robinpowered/robin-js-sdk-public | lib/api/modules/identifiers.js | function (identifierUrn) {
if (identifierUrn) {
var path = this.constructPath(constants.IDENTIFIERS, identifierUrn);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad request: An identifier URN is required.');
}
} | javascript | function (identifierUrn) {
if (identifierUrn) {
var path = this.constructPath(constants.IDENTIFIERS, identifierUrn);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad request: An identifier URN is required.');
}
} | [
"function",
"(",
"identifierUrn",
")",
"{",
"if",
"(",
"identifierUrn",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"IDENTIFIERS",
",",
"identifierUrn",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE",
"(",
"... | Delete an identifier
@param {String|Integer} identifierUrn A Robin identifier URN
@return {Function} A Promise | [
"Delete",
"an",
"identifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/identifiers.js#L30-L37 | |
43,596 | partyka95/graph-type-orm | dist/find-one.js | findOne | function findOne(repository, options) {
const entityPrimaryKeyColumn = lodash_1.find(repository.metadata.columns, (columnMetadata) => columnMetadata.isPrimary).propertyName;
const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
const entityManyToOneOrOneToOn... | javascript | function findOne(repository, options) {
const entityPrimaryKeyColumn = lodash_1.find(repository.metadata.columns, (columnMetadata) => columnMetadata.isPrimary).propertyName;
const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
const entityManyToOneOrOneToOn... | [
"function",
"findOne",
"(",
"repository",
",",
"options",
")",
"{",
"const",
"entityPrimaryKeyColumn",
"=",
"lodash_1",
".",
"find",
"(",
"repository",
".",
"metadata",
".",
"columns",
",",
"(",
"columnMetadata",
")",
"=>",
"columnMetadata",
".",
"isPrimary",
... | Method to find the entity record.
@param {Repository<Entity>} repository
@param {FindOneOptions<Entity>} options
@returns {(source, args, context, info) => Promise<Entity>} | [
"Method",
"to",
"find",
"the",
"entity",
"record",
"."
] | c2c1d93c091ad8fb5d3015cabe6edb20dccfa225 | https://github.com/partyka95/graph-type-orm/blob/c2c1d93c091ad8fb5d3015cabe6edb20dccfa225/dist/find-one.js#L25-L75 |
43,597 | dsfields/radargun | lib/update-status.js | updateStatus | function updateStatus(runCount, totalRuns, stream) {
if (runCount % 10 !== 0) return;
const percent = Math.floor((runCount / totalRuns) * 100);
const blocks = Math.floor(percent / 2);
const empty = 50 - blocks;
const value =
'|'
+ '\u2588'.repeat(blocks)
+ '\u2591'.repeat(empty)
+ '| '
+ ... | javascript | function updateStatus(runCount, totalRuns, stream) {
if (runCount % 10 !== 0) return;
const percent = Math.floor((runCount / totalRuns) * 100);
const blocks = Math.floor(percent / 2);
const empty = 50 - blocks;
const value =
'|'
+ '\u2588'.repeat(blocks)
+ '\u2591'.repeat(empty)
+ '| '
+ ... | [
"function",
"updateStatus",
"(",
"runCount",
",",
"totalRuns",
",",
"stream",
")",
"{",
"if",
"(",
"runCount",
"%",
"10",
"!==",
"0",
")",
"return",
";",
"const",
"percent",
"=",
"Math",
".",
"floor",
"(",
"(",
"runCount",
"/",
"totalRuns",
")",
"*",
... | Renders the progress bar.
@param {number} runCount
@param {number} totalRuns | [
"Renders",
"the",
"progress",
"bar",
"."
] | c0cf2730441e1e454355603c2fd7539b9d552f1a | https://github.com/dsfields/radargun/blob/c0cf2730441e1e454355603c2fd7539b9d552f1a/lib/update-status.js#L12-L33 |
43,598 | robinpowered/robin-js-sdk-public | lib/api/modules/locations.js | function (identifier, params) {
var path = this.constructPath(constants.LOCATIONS, identifier);
return this.Core.GET(path, params);
} | javascript | function (identifier, params) {
var path = this.constructPath(constants.LOCATIONS, identifier);
return this.Core.GET(path, params);
} | [
"function",
"(",
"identifier",
",",
"params",
")",
"{",
"var",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"LOCATIONS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"GET",
"(",
"path",
",",
"params",
")",
";",
... | Get all the locations or a particular location identified by `identifier`
@param {String|Integer|undefined} identifier A location identifier
@param {Object} params A querystring object
@return {Function} A promise | [
"Get",
"all",
"the",
"locations",
"or",
"a",
"particular",
"location",
"identified",
"by",
"identifier"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/locations.js#L20-L23 | |
43,599 | robinpowered/robin-js-sdk-public | lib/api/modules/locations.js | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.LOCATIONS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A location identifier is required.');
}
} | javascript | function (identifier) {
var path;
if (identifier) {
path = this.constructPath(constants.LOCATIONS, identifier);
return this.Core.DELETE(path);
} else {
return this.rejectRequest('Bad Request: A location identifier is required.');
}
} | [
"function",
"(",
"identifier",
")",
"{",
"var",
"path",
";",
"if",
"(",
"identifier",
")",
"{",
"path",
"=",
"this",
".",
"constructPath",
"(",
"constants",
".",
"LOCATIONS",
",",
"identifier",
")",
";",
"return",
"this",
".",
"Core",
".",
"DELETE",
"(... | Delete a location
@param {String|Integer} identifier A Robin location identifier
@return {Function} A Promise | [
"Delete",
"a",
"location"
] | c3119f8340a728a2fba607c353893559376dd490 | https://github.com/robinpowered/robin-js-sdk-public/blob/c3119f8340a728a2fba607c353893559376dd490/lib/api/modules/locations.js#L46-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.