id int32 0 58k | repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36,100 | oskosk/node-wms-client | index.js | function( queryOptions, callback ) {
var _this = this;
if ( typeof queryOptions === 'function' ) {
callback = queryOptions;
this.capabilities( function( err, capabilities ) {
if ( err ) {
debug( 'Error getting layers: %j', err );
return callback( err );
}
if ( _this.version === '1.3.0' )... | javascript | function( queryOptions, callback ) {
var _this = this;
if ( typeof queryOptions === 'function' ) {
callback = queryOptions;
this.capabilities( function( err, capabilities ) {
if ( err ) {
debug( 'Error getting layers: %j', err );
return callback( err );
}
if ( _this.version === '1.3.0' )... | [
"function",
"(",
"queryOptions",
",",
"callback",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"typeof",
"queryOptions",
"===",
"'function'",
")",
"{",
"callback",
"=",
"queryOptions",
";",
"this",
".",
"capabilities",
"(",
"function",
"(",
"err"... | Gets the WMS supported Coordinate reference systems reported in the capabilities as an array
@param {Object} [Optional] queryOptions. Options passed as GET parameters
@param {Function} callback.
- {Error} null if nothing bad happened
- {Array} CRSs as an array strings | [
"Gets",
"the",
"WMS",
"supported",
"Coordinate",
"reference",
"systems",
"reported",
"in",
"the",
"capabilities",
"as",
"an",
"array"
] | 86aaa8ed7eedbed7fb33c72a8607387a2b130933 | https://github.com/oskosk/node-wms-client/blob/86aaa8ed7eedbed7fb33c72a8607387a2b130933/index.js#L117-L145 | |
36,101 | oskosk/node-wms-client | index.js | function( queryOptions, callback ) {
if ( typeof queryOptions === 'function' ) {
callback = queryOptions;
queryOptions = {};
}
this.capabilities( queryOptions, function( err, capabilities ) {
if ( err ) {
debug( 'Error getting service metadata: %j', err );
return callback( err );
}
callback... | javascript | function( queryOptions, callback ) {
if ( typeof queryOptions === 'function' ) {
callback = queryOptions;
queryOptions = {};
}
this.capabilities( queryOptions, function( err, capabilities ) {
if ( err ) {
debug( 'Error getting service metadata: %j', err );
return callback( err );
}
callback... | [
"function",
"(",
"queryOptions",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"queryOptions",
"===",
"'function'",
")",
"{",
"callback",
"=",
"queryOptions",
";",
"queryOptions",
"=",
"{",
"}",
";",
"}",
"this",
".",
"capabilities",
"(",
"queryOptions",
... | Gets the WMS service metadata reported in the capabilities as a plain object
@param {Object} [Optional] queryOptions. Options passed as GET parameters
@param {Function} callback.
- {Error} null if nothing bad happened
- {Array} WMS Service metadata as a Plain Object | [
"Gets",
"the",
"WMS",
"service",
"metadata",
"reported",
"in",
"the",
"capabilities",
"as",
"a",
"plain",
"object"
] | 86aaa8ed7eedbed7fb33c72a8607387a2b130933 | https://github.com/oskosk/node-wms-client/blob/86aaa8ed7eedbed7fb33c72a8607387a2b130933/index.js#L154-L166 | |
36,102 | oskosk/node-wms-client | index.js | function( wmsBaseUrl, queryOptions ) {
queryOptions = extend( {
request: 'GetCapabilities',
version: this.version,
service: 'WMS'
}, queryOptions );
// Append user provided GET parameters in the URL to required queryOptions
var urlQueryParams = new urijs( wmsBaseUrl ).search( true );
queryOptions = e... | javascript | function( wmsBaseUrl, queryOptions ) {
queryOptions = extend( {
request: 'GetCapabilities',
version: this.version,
service: 'WMS'
}, queryOptions );
// Append user provided GET parameters in the URL to required queryOptions
var urlQueryParams = new urijs( wmsBaseUrl ).search( true );
queryOptions = e... | [
"function",
"(",
"wmsBaseUrl",
",",
"queryOptions",
")",
"{",
"queryOptions",
"=",
"extend",
"(",
"{",
"request",
":",
"'GetCapabilities'",
",",
"version",
":",
"this",
".",
"version",
",",
"service",
":",
"'WMS'",
"}",
",",
"queryOptions",
")",
";",
"// A... | Formats an URL to include specific GET parameters
required for a GETCAPABILITIES WMS method request | [
"Formats",
"an",
"URL",
"to",
"include",
"specific",
"GET",
"parameters",
"required",
"for",
"a",
"GETCAPABILITIES",
"WMS",
"method",
"request"
] | 86aaa8ed7eedbed7fb33c72a8607387a2b130933 | https://github.com/oskosk/node-wms-client/blob/86aaa8ed7eedbed7fb33c72a8607387a2b130933/index.js#L318-L331 | |
36,103 | oskosk/node-wms-client | index.js | function( minx, miny, maxx, maxy ) {
var bbox = '';
if ( this.version === '1.3.0' ) {
bbox = [minx, miny, maxx, maxy].join( ',' );
} else {
bbox = [miny, minx, maxy, maxx].join( ',' );
}
return bbox;
} | javascript | function( minx, miny, maxx, maxy ) {
var bbox = '';
if ( this.version === '1.3.0' ) {
bbox = [minx, miny, maxx, maxy].join( ',' );
} else {
bbox = [miny, minx, maxy, maxx].join( ',' );
}
return bbox;
} | [
"function",
"(",
"minx",
",",
"miny",
",",
"maxx",
",",
"maxy",
")",
"{",
"var",
"bbox",
"=",
"''",
";",
"if",
"(",
"this",
".",
"version",
"===",
"'1.3.0'",
")",
"{",
"bbox",
"=",
"[",
"minx",
",",
"miny",
",",
"maxx",
",",
"maxy",
"]",
".",
... | Returns a bbox WMS string.
@param {Float} minx left bound of the bounding box in CRS units
@param {Float} miny lower bound of the bounding box in CRUS units
@param {Float} maxx right bound of the bounding box in CRUS units
@param {Float} maxy upper bound of the bounding box in CRUS units | [
"Returns",
"a",
"bbox",
"WMS",
"string",
"."
] | 86aaa8ed7eedbed7fb33c72a8607387a2b130933 | https://github.com/oskosk/node-wms-client/blob/86aaa8ed7eedbed7fb33c72a8607387a2b130933/index.js#L371-L379 | |
36,104 | rricard/koa-swagger | lib/checkers.js | checkParameter | function checkParameter(validator, def, context) {
var value = match.fromContext(def.name, def.in, context);
// Check requirement
if(def.required && !value) {
throw new ValidationError(def.name + " is required");
} else if(!value) {
return def.default;
}
// Select the right schema according to the... | javascript | function checkParameter(validator, def, context) {
var value = match.fromContext(def.name, def.in, context);
// Check requirement
if(def.required && !value) {
throw new ValidationError(def.name + " is required");
} else if(!value) {
return def.default;
}
// Select the right schema according to the... | [
"function",
"checkParameter",
"(",
"validator",
",",
"def",
",",
"context",
")",
"{",
"var",
"value",
"=",
"match",
".",
"fromContext",
"(",
"def",
".",
"name",
",",
"def",
".",
"in",
",",
"context",
")",
";",
"// Check requirement",
"if",
"(",
"def",
... | Check if the context carries the parameter correctly
@param validator {function(object, Schema)} JSON-Schema validator function
@param def {Parameter} The parameter's definition
@param context {Context} A koa context
@return {*} The cleaned value
@throws {ValidationError} A possible validation error | [
"Check",
"if",
"the",
"context",
"carries",
"the",
"parameter",
"correctly"
] | 1c2d6cef6fa594a4b5a7697192b28df512c0ed73 | https://github.com/rricard/koa-swagger/blob/1c2d6cef6fa594a4b5a7697192b28df512c0ed73/lib/checkers.js#L41-L91 |
36,105 | cb1kenobi/cli-kit | src/lib/errors.js | createError | function createError(code, type, desc) {
errors[code] = function (msg, meta) {
const err = new type(msg);
if (desc) {
if (!meta) {
meta = {};
}
meta.desc = desc;
}
return Object.defineProperties(err, {
code: {
configurable: true,
enumerable: true,
writable: true,
value: `ERR_$... | javascript | function createError(code, type, desc) {
errors[code] = function (msg, meta) {
const err = new type(msg);
if (desc) {
if (!meta) {
meta = {};
}
meta.desc = desc;
}
return Object.defineProperties(err, {
code: {
configurable: true,
enumerable: true,
writable: true,
value: `ERR_$... | [
"function",
"createError",
"(",
"code",
",",
"type",
",",
"desc",
")",
"{",
"errors",
"[",
"code",
"]",
"=",
"function",
"(",
"msg",
",",
"meta",
")",
"{",
"const",
"err",
"=",
"new",
"type",
"(",
"msg",
")",
";",
"if",
"(",
"desc",
")",
"{",
"... | Creates an the error object and populates the message, code, and metadata.
@param {String} code - The error code.
@param {Error|RangeError|TypeError} type - An instantiable error object.
@param {String} desc - A generic error description. | [
"Creates",
"an",
"the",
"error",
"object",
"and",
"populates",
"the",
"message",
"code",
"and",
"metadata",
"."
] | 6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734 | https://github.com/cb1kenobi/cli-kit/blob/6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734/src/lib/errors.js#L39-L79 |
36,106 | cb1kenobi/cli-kit | site/semantic/tasks/config/project/config.js | function(config) {
config = config || extend(false, {}, defaults);
/*--------------
File Paths
---------------*/
var
configPath = this.getPath(),
sourcePaths = {},
outputPaths = {},
folder
;
// resolve paths (config location + base + path)
for(folder in con... | javascript | function(config) {
config = config || extend(false, {}, defaults);
/*--------------
File Paths
---------------*/
var
configPath = this.getPath(),
sourcePaths = {},
outputPaths = {},
folder
;
// resolve paths (config location + base + path)
for(folder in con... | [
"function",
"(",
"config",
")",
"{",
"config",
"=",
"config",
"||",
"extend",
"(",
"false",
",",
"{",
"}",
",",
"defaults",
")",
";",
"/*--------------\n File Paths\n ---------------*/",
"var",
"configPath",
"=",
"this",
".",
"getPath",
"(",
")",
",",... | adds additional derived values to a config object | [
"adds",
"additional",
"derived",
"values",
"to",
"a",
"config",
"object"
] | 6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734 | https://github.com/cb1kenobi/cli-kit/blob/6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734/site/semantic/tasks/config/project/config.js#L52-L138 | |
36,107 | jtrussell/svn-npm-crutch | lib/svn-npm-crutch.js | function(exists, cb) {
if(!exists) {
fs.mkdir(rootDir + '/node_modules', function(error) {
cb(error);
});
} else {
cb(null);
}
} | javascript | function(exists, cb) {
if(!exists) {
fs.mkdir(rootDir + '/node_modules', function(error) {
cb(error);
});
} else {
cb(null);
}
} | [
"function",
"(",
"exists",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"exists",
")",
"{",
"fs",
".",
"mkdir",
"(",
"rootDir",
"+",
"'/node_modules'",
",",
"function",
"(",
"error",
")",
"{",
"cb",
"(",
"error",
")",
";",
"}",
")",
";",
"}",
"else",
"... | Make the node_modules folder if we need to | [
"Make",
"the",
"node_modules",
"folder",
"if",
"we",
"need",
"to"
] | 162df18cbb1c20a75bd3d30e73beb4839f10154a | https://github.com/jtrussell/svn-npm-crutch/blob/162df18cbb1c20a75bd3d30e73beb4839f10154a/lib/svn-npm-crutch.js#L40-L48 | |
36,108 | keymetrics/trassingue | src/span-data.js | SpanData | function SpanData(agent, trace, name, parentSpanId, isRoot, skipFrames) {
var spanId = uid++;
this.agent = agent;
var spanName = traceUtil.truncate(name, constants.TRACE_SERVICE_SPAN_NAME_LIMIT);
this.span = new TraceSpan(spanName, spanId, parentSpanId);
this.trace = trace;
this.isRoot = isRoot;
trace.spa... | javascript | function SpanData(agent, trace, name, parentSpanId, isRoot, skipFrames) {
var spanId = uid++;
this.agent = agent;
var spanName = traceUtil.truncate(name, constants.TRACE_SERVICE_SPAN_NAME_LIMIT);
this.span = new TraceSpan(spanName, spanId, parentSpanId);
this.trace = trace;
this.isRoot = isRoot;
trace.spa... | [
"function",
"SpanData",
"(",
"agent",
",",
"trace",
",",
"name",
",",
"parentSpanId",
",",
"isRoot",
",",
"skipFrames",
")",
"{",
"var",
"spanId",
"=",
"uid",
"++",
";",
"this",
".",
"agent",
"=",
"agent",
";",
"var",
"spanName",
"=",
"traceUtil",
".",... | Creates a trace context object.
@param {Trace} trace The object holding the spans comprising this trace.
@param {string} name The name of the span.
@param {number} parentSpanId The id of the parent span, 0 for root spans.
@param {boolean} isRoot Whether this is a root span.
@param {number} skipFrames the number of fram... | [
"Creates",
"a",
"trace",
"context",
"object",
"."
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/span-data.js#L38-L87 |
36,109 | keymetrics/trassingue | src/plugins/plugin-mongodb-core.js | wrapCallback | function wrapCallback(api, span, done) {
var fn = function(err, res) {
if (api.enhancedDatabaseReportingEnabled()) {
if (err) {
// Errors may contain sensitive query parameters.
span.addLabel('mongoError', err);
}
if (res) {
var result = res.result ? res.result : res;
... | javascript | function wrapCallback(api, span, done) {
var fn = function(err, res) {
if (api.enhancedDatabaseReportingEnabled()) {
if (err) {
// Errors may contain sensitive query parameters.
span.addLabel('mongoError', err);
}
if (res) {
var result = res.result ? res.result : res;
... | [
"function",
"wrapCallback",
"(",
"api",
",",
"span",
",",
"done",
")",
"{",
"var",
"fn",
"=",
"function",
"(",
"err",
",",
"res",
")",
"{",
"if",
"(",
"api",
".",
"enhancedDatabaseReportingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"err",
")",
"{",
"... | Wraps the provided callback so that the provided span will
be closed immediately after the callback is invoked.
@param {Span} span The span to be closed.
@param {Function} done The callback to be wrapped.
@return {Function} The wrapped function. | [
"Wraps",
"the",
"provided",
"callback",
"so",
"that",
"the",
"provided",
"span",
"will",
"be",
"closed",
"immediately",
"after",
"the",
"callback",
"is",
"invoked",
"."
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/plugins/plugin-mongodb-core.js#L68-L86 |
36,110 | keymetrics/trassingue | src/trace-span.js | TraceSpan | function TraceSpan(name, spanId, parentSpanId) {
this.name = name;
this.parentSpanId = parentSpanId;
this.spanId = spanId;
this.kind = 'RPC_CLIENT';
this.labels = {};
this.startTime = (new Date()).toISOString();
this.endTime = '';
} | javascript | function TraceSpan(name, spanId, parentSpanId) {
this.name = name;
this.parentSpanId = parentSpanId;
this.spanId = spanId;
this.kind = 'RPC_CLIENT';
this.labels = {};
this.startTime = (new Date()).toISOString();
this.endTime = '';
} | [
"function",
"TraceSpan",
"(",
"name",
",",
"spanId",
",",
"parentSpanId",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"parentSpanId",
"=",
"parentSpanId",
";",
"this",
".",
"spanId",
"=",
"spanId",
";",
"this",
".",
"kind",
"=",
"'RPC... | Creates a trace span object.
@constructor | [
"Creates",
"a",
"trace",
"span",
"object",
"."
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/trace-span.js#L23-L31 |
36,111 | psiphi75/compass-hmc5883l | example.js | printHeadingCB | function printHeadingCB(err, heading) {
if (err) {
console.log(err);
return;
}
console.log(heading * 180 / Math.PI);
} | javascript | function printHeadingCB(err, heading) {
if (err) {
console.log(err);
return;
}
console.log(heading * 180 / Math.PI);
} | [
"function",
"printHeadingCB",
"(",
"err",
",",
"heading",
")",
"{",
"if",
"(",
"err",
")",
"{",
"console",
".",
"log",
"(",
"err",
")",
";",
"return",
";",
"}",
"console",
".",
"log",
"(",
"heading",
"*",
"180",
"/",
"Math",
".",
"PI",
")",
";",
... | Gets called every time we get the values. | [
"Gets",
"called",
"every",
"time",
"we",
"get",
"the",
"values",
"."
] | 72b25ef2c2d2a8c0d67ab14befea93a346b9086f | https://github.com/psiphi75/compass-hmc5883l/blob/72b25ef2c2d2a8c0d67ab14befea93a346b9086f/example.js#L30-L36 |
36,112 | keymetrics/trassingue | src/trace-api.js | ChildSpan | function ChildSpan(agent, span) {
this.agent_ = agent;
this.span_ = span;
this.serializedTraceContext_ = agent.generateTraceContext(span, true);
} | javascript | function ChildSpan(agent, span) {
this.agent_ = agent;
this.span_ = span;
this.serializedTraceContext_ = agent.generateTraceContext(span, true);
} | [
"function",
"ChildSpan",
"(",
"agent",
",",
"span",
")",
"{",
"this",
".",
"agent_",
"=",
"agent",
";",
"this",
".",
"span_",
"=",
"span",
";",
"this",
".",
"serializedTraceContext_",
"=",
"agent",
".",
"generateTraceContext",
"(",
"span",
",",
"true",
"... | This file describes an interface for third-party plugins to enable tracing
for arbitrary modules.
An object that represents a single child span. It exposes functions for
adding labels to or closing the span.
@param {TraceAgent} agent The underlying trace agent object.
@param {SpanData} span The internal data structur... | [
"This",
"file",
"describes",
"an",
"interface",
"for",
"third",
"-",
"party",
"plugins",
"to",
"enable",
"tracing",
"for",
"arbitrary",
"modules",
".",
"An",
"object",
"that",
"represents",
"a",
"single",
"child",
"span",
".",
"It",
"exposes",
"functions",
"... | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/trace-api.js#L35-L39 |
36,113 | keymetrics/trassingue | src/trace-api.js | RootSpan | function RootSpan(agent, span) {
this.agent_ = agent;
this.span_ = span;
this.serializedTraceContext_ = agent.generateTraceContext(span, true);
} | javascript | function RootSpan(agent, span) {
this.agent_ = agent;
this.span_ = span;
this.serializedTraceContext_ = agent.generateTraceContext(span, true);
} | [
"function",
"RootSpan",
"(",
"agent",
",",
"span",
")",
"{",
"this",
".",
"agent_",
"=",
"agent",
";",
"this",
".",
"span_",
"=",
"span",
";",
"this",
".",
"serializedTraceContext_",
"=",
"agent",
".",
"generateTraceContext",
"(",
"span",
",",
"true",
")... | An object that represents a single root span. It exposes functions for adding
labels to or closing the span.
@param {TraceAgent} agent The underlying trace agent object.
@param {SpanData} span The internal data structure backing the root span. | [
"An",
"object",
"that",
"represents",
"a",
"single",
"root",
"span",
".",
"It",
"exposes",
"functions",
"for",
"adding",
"labels",
"to",
"or",
"closing",
"the",
"span",
"."
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/trace-api.js#L72-L76 |
36,114 | keymetrics/trassingue | src/trace-api.js | TraceApiImplementation | function TraceApiImplementation(agent, pluginName) {
this.agent_ = agent;
this.logger_ = agent.logger;
this.pluginName_ = pluginName;
} | javascript | function TraceApiImplementation(agent, pluginName) {
this.agent_ = agent;
this.logger_ = agent.logger;
this.pluginName_ = pluginName;
} | [
"function",
"TraceApiImplementation",
"(",
"agent",
",",
"pluginName",
")",
"{",
"this",
".",
"agent_",
"=",
"agent",
";",
"this",
".",
"logger_",
"=",
"agent",
".",
"logger",
";",
"this",
".",
"pluginName_",
"=",
"pluginName",
";",
"}"
] | The functional implementation of the Trace API | [
"The",
"functional",
"implementation",
"of",
"the",
"Trace",
"API"
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/trace-api.js#L109-L113 |
36,115 | keymetrics/trassingue | src/trace-api.js | createRootSpan_ | function createRootSpan_(api, options, skipFrames) {
options = options || {};
// If the options object passed in has the getTraceContext field set,
// try to retrieve the header field containing incoming trace metadata.
var incomingTraceContext;
if (is.string(options.traceContext)) {
incomingTraceContext ... | javascript | function createRootSpan_(api, options, skipFrames) {
options = options || {};
// If the options object passed in has the getTraceContext field set,
// try to retrieve the header field containing incoming trace metadata.
var incomingTraceContext;
if (is.string(options.traceContext)) {
incomingTraceContext ... | [
"function",
"createRootSpan_",
"(",
"api",
",",
"options",
",",
"skipFrames",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"// If the options object passed in has the getTraceContext field set,",
"// try to retrieve the header field containing incoming trace metadata... | Module-private functions | [
"Module",
"-",
"private",
"functions"
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/trace-api.js#L322-L340 |
36,116 | cb1kenobi/cli-kit | src/parser/option.js | processAliases | function processAliases(aliases) {
const result = {
long: {},
short: {}
};
if (!aliases) {
return result;
}
if (!Array.isArray(aliases)) {
if (typeof aliases === 'object') {
if (aliases.long && typeof aliases.long === 'object') {
Object.assign(result.long, aliases.long);
}
if (aliases.short ... | javascript | function processAliases(aliases) {
const result = {
long: {},
short: {}
};
if (!aliases) {
return result;
}
if (!Array.isArray(aliases)) {
if (typeof aliases === 'object') {
if (aliases.long && typeof aliases.long === 'object') {
Object.assign(result.long, aliases.long);
}
if (aliases.short ... | [
"function",
"processAliases",
"(",
"aliases",
")",
"{",
"const",
"result",
"=",
"{",
"long",
":",
"{",
"}",
",",
"short",
":",
"{",
"}",
"}",
";",
"if",
"(",
"!",
"aliases",
")",
"{",
"return",
"result",
";",
"}",
"if",
"(",
"!",
"Array",
".",
... | Processes aliases into sorted buckets for faster lookup.
@param {Array.<String>|String} aliases - An array, object, or string containing aliases.
@returns {Object} | [
"Processes",
"aliases",
"into",
"sorted",
"buckets",
"for",
"faster",
"lookup",
"."
] | 6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734 | https://github.com/cb1kenobi/cli-kit/blob/6d0d5ebb17cfbd11a8ec25ce8e4251f72cdc7734/src/parser/option.js#L221-L266 |
36,117 | ryejs/rye | lib/query.js | getClosestNode | function getClosestNode (element, method, selector) {
do {
element = element[method]
} while (element && ((selector && !matches(element, selector)) || !util.isElement(element)))
return element
} | javascript | function getClosestNode (element, method, selector) {
do {
element = element[method]
} while (element && ((selector && !matches(element, selector)) || !util.isElement(element)))
return element
} | [
"function",
"getClosestNode",
"(",
"element",
",",
"method",
",",
"selector",
")",
"{",
"do",
"{",
"element",
"=",
"element",
"[",
"method",
"]",
"}",
"while",
"(",
"element",
"&&",
"(",
"(",
"selector",
"&&",
"!",
"matches",
"(",
"element",
",",
"sele... | Walks the DOM tree using `method`, returns when an element node is found | [
"Walks",
"the",
"DOM",
"tree",
"using",
"method",
"returns",
"when",
"an",
"element",
"node",
"is",
"found"
] | 24fd6728d055a1d2285b789c697a4578051f542d | https://github.com/ryejs/rye/blob/24fd6728d055a1d2285b789c697a4578051f542d/lib/query.js#L79-L84 |
36,118 | ryejs/rye | lib/query.js | _create | function _create (elements, selector) {
return selector == null ? new Rye(elements) : new Rye(elements).filter(selector)
} | javascript | function _create (elements, selector) {
return selector == null ? new Rye(elements) : new Rye(elements).filter(selector)
} | [
"function",
"_create",
"(",
"elements",
",",
"selector",
")",
"{",
"return",
"selector",
"==",
"null",
"?",
"new",
"Rye",
"(",
"elements",
")",
":",
"new",
"Rye",
"(",
"elements",
")",
".",
"filter",
"(",
"selector",
")",
"}"
] | Creates a new Rye instance applying a filter if necessary | [
"Creates",
"a",
"new",
"Rye",
"instance",
"applying",
"a",
"filter",
"if",
"necessary"
] | 24fd6728d055a1d2285b789c697a4578051f542d | https://github.com/ryejs/rye/blob/24fd6728d055a1d2285b789c697a4578051f542d/lib/query.js#L87-L89 |
36,119 | keymetrics/trassingue | src/plugins/plugin-redis.js | createCreateStreamWrap | function createCreateStreamWrap(api) {
return function createStreamWrap(create_stream) {
return function create_stream_trace() {
if (!this.stream) {
Object.defineProperty(this, 'stream', {
get: function () { return this._google_trace_stream; },
set: function (val) {
a... | javascript | function createCreateStreamWrap(api) {
return function createStreamWrap(create_stream) {
return function create_stream_trace() {
if (!this.stream) {
Object.defineProperty(this, 'stream', {
get: function () { return this._google_trace_stream; },
set: function (val) {
a... | [
"function",
"createCreateStreamWrap",
"(",
"api",
")",
"{",
"return",
"function",
"createStreamWrap",
"(",
"create_stream",
")",
"{",
"return",
"function",
"create_stream_trace",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"stream",
")",
"{",
"Object",
".",
... | Used for redis version > 2.3 | [
"Used",
"for",
"redis",
"version",
">",
"2",
".",
"3"
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/plugins/plugin-redis.js#L32-L47 |
36,120 | keymetrics/trassingue | src/plugins/plugin-redis.js | createStreamListenersWrap | function createStreamListenersWrap(api) {
return function streamListenersWrap(install_stream_listeners) {
return function install_stream_listeners_trace() {
api.wrapEmitter(this.stream);
return install_stream_listeners.apply(this, arguments);
};
};
} | javascript | function createStreamListenersWrap(api) {
return function streamListenersWrap(install_stream_listeners) {
return function install_stream_listeners_trace() {
api.wrapEmitter(this.stream);
return install_stream_listeners.apply(this, arguments);
};
};
} | [
"function",
"createStreamListenersWrap",
"(",
"api",
")",
"{",
"return",
"function",
"streamListenersWrap",
"(",
"install_stream_listeners",
")",
"{",
"return",
"function",
"install_stream_listeners_trace",
"(",
")",
"{",
"api",
".",
"wrapEmitter",
"(",
"this",
".",
... | Used for redis version <= 2.3 | [
"Used",
"for",
"redis",
"version",
"<",
"=",
"2",
".",
"3"
] | 1d283858b45e5fb42519dc1f39cffaaade601931 | https://github.com/keymetrics/trassingue/blob/1d283858b45e5fb42519dc1f39cffaaade601931/src/plugins/plugin-redis.js#L50-L57 |
36,121 | Squarespace/pouchdb-lru-cache | index.js | getDocWithDefault | function getDocWithDefault(db, id, defaultDoc) {
return db.get(id).catch(function (err) {
/* istanbul ignore if */
if (err.status !== 404) {
throw err;
}
defaultDoc._id = id;
return db.put(defaultDoc).catch(function (err) {
/* istanbul ignore if */
if (err.status !== 409) { // co... | javascript | function getDocWithDefault(db, id, defaultDoc) {
return db.get(id).catch(function (err) {
/* istanbul ignore if */
if (err.status !== 404) {
throw err;
}
defaultDoc._id = id;
return db.put(defaultDoc).catch(function (err) {
/* istanbul ignore if */
if (err.status !== 409) { // co... | [
"function",
"getDocWithDefault",
"(",
"db",
",",
"id",
",",
"defaultDoc",
")",
"{",
"return",
"db",
".",
"get",
"(",
"id",
")",
".",
"catch",
"(",
"function",
"(",
"err",
")",
"{",
"/* istanbul ignore if */",
"if",
"(",
"err",
".",
"status",
"!==",
"40... | Create the doc if it doesn't exist | [
"Create",
"the",
"doc",
"if",
"it",
"doesn",
"t",
"exist"
] | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L18-L34 |
36,122 | Squarespace/pouchdb-lru-cache | index.js | getMainDoc | function getMainDoc(db) {
return getDocWithDefault(db, MAIN_DOC_ID, {}).then(function (doc) {
if (!doc._attachments) {
doc._attachments = {};
}
return doc;
});
} | javascript | function getMainDoc(db) {
return getDocWithDefault(db, MAIN_DOC_ID, {}).then(function (doc) {
if (!doc._attachments) {
doc._attachments = {};
}
return doc;
});
} | [
"function",
"getMainDoc",
"(",
"db",
")",
"{",
"return",
"getDocWithDefault",
"(",
"db",
",",
"MAIN_DOC_ID",
",",
"{",
"}",
")",
".",
"then",
"(",
"function",
"(",
"doc",
")",
"{",
"if",
"(",
"!",
"doc",
".",
"_attachments",
")",
"{",
"doc",
".",
"... | Store all attachments in a single doc. Since attachments
are deduped, and unless the attachment metadata can't all fit
in memory at once, there's no reason not to do this. | [
"Store",
"all",
"attachments",
"in",
"a",
"single",
"doc",
".",
"Since",
"attachments",
"are",
"deduped",
"and",
"unless",
"the",
"attachment",
"metadata",
"can",
"t",
"all",
"fit",
"in",
"memory",
"at",
"once",
"there",
"s",
"no",
"reason",
"not",
"to",
... | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L41-L48 |
36,123 | Squarespace/pouchdb-lru-cache | index.js | calculateTotalSize | function calculateTotalSize(mainDoc) {
var digestsToSizes = {};
// dedup by digest, since that's what Pouch does under the hood
Object.keys(mainDoc._attachments).forEach(function (attName) {
var att = mainDoc._attachments[attName];
digestsToSizes[att.digest] = att.length;
});
var total = 0;
Object... | javascript | function calculateTotalSize(mainDoc) {
var digestsToSizes = {};
// dedup by digest, since that's what Pouch does under the hood
Object.keys(mainDoc._attachments).forEach(function (attName) {
var att = mainDoc._attachments[attName];
digestsToSizes[att.digest] = att.length;
});
var total = 0;
Object... | [
"function",
"calculateTotalSize",
"(",
"mainDoc",
")",
"{",
"var",
"digestsToSizes",
"=",
"{",
"}",
";",
"// dedup by digest, since that's what Pouch does under the hood",
"Object",
".",
"keys",
"(",
"mainDoc",
".",
"_attachments",
")",
".",
"forEach",
"(",
"function"... | Get the total size of the LRU cache, taking duplicate digests into account | [
"Get",
"the",
"total",
"size",
"of",
"the",
"LRU",
"cache",
"taking",
"duplicate",
"digests",
"into",
"account"
] | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L81-L95 |
36,124 | Squarespace/pouchdb-lru-cache | index.js | synchronous | function synchronous(promiseFactory) {
return function () {
var promise = queue.then(promiseFactory);
queue = promise.catch(noop); // squelch
return promise;
};
} | javascript | function synchronous(promiseFactory) {
return function () {
var promise = queue.then(promiseFactory);
queue = promise.catch(noop); // squelch
return promise;
};
} | [
"function",
"synchronous",
"(",
"promiseFactory",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"promise",
"=",
"queue",
".",
"then",
"(",
"promiseFactory",
")",
";",
"queue",
"=",
"promise",
".",
"catch",
"(",
"noop",
")",
";",
"// squelch",
"re... | To mitigate 409s, we synchronize certain things that need to be
done in a "transaction". So whatever promise is given to this
function will execute sequentially. | [
"To",
"mitigate",
"409s",
"we",
"synchronize",
"certain",
"things",
"that",
"need",
"to",
"be",
"done",
"in",
"a",
"transaction",
".",
"So",
"whatever",
"promise",
"is",
"given",
"to",
"this",
"function",
"will",
"execute",
"sequentially",
"."
] | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L102-L108 |
36,125 | Squarespace/pouchdb-lru-cache | index.js | getDigestsToLastUsed | function getDigestsToLastUsed(mainDoc, lastUsedDoc) {
var result = {};
// dedup by digest, use the most recent date
Object.keys(mainDoc._attachments).forEach(function (attName) {
var att = mainDoc._attachments[attName];
var existing = result[att.digest] || 0;
result[att.digest] = Math.max(existing, ... | javascript | function getDigestsToLastUsed(mainDoc, lastUsedDoc) {
var result = {};
// dedup by digest, use the most recent date
Object.keys(mainDoc._attachments).forEach(function (attName) {
var att = mainDoc._attachments[attName];
var existing = result[att.digest] || 0;
result[att.digest] = Math.max(existing, ... | [
"function",
"getDigestsToLastUsed",
"(",
"mainDoc",
",",
"lastUsedDoc",
")",
"{",
"var",
"result",
"=",
"{",
"}",
";",
"// dedup by digest, use the most recent date",
"Object",
".",
"keys",
"(",
"mainDoc",
".",
"_attachments",
")",
".",
"forEach",
"(",
"function",... | Get a map of unique digests to when they were last used. | [
"Get",
"a",
"map",
"of",
"unique",
"digests",
"to",
"when",
"they",
"were",
"last",
"used",
"."
] | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L113-L124 |
36,126 | Squarespace/pouchdb-lru-cache | index.js | getLeastRecentlyUsed | function getLeastRecentlyUsed(mainDoc, lastUsedDoc) {
var digestsToLastUsed = getDigestsToLastUsed(mainDoc, lastUsedDoc);
var min;
var minDigest;
Object.keys(digestsToLastUsed).forEach(function (digest) {
var lastUsed = digestsToLastUsed[digest];
if (typeof min === 'undefined' || min > lastUsed) {
... | javascript | function getLeastRecentlyUsed(mainDoc, lastUsedDoc) {
var digestsToLastUsed = getDigestsToLastUsed(mainDoc, lastUsedDoc);
var min;
var minDigest;
Object.keys(digestsToLastUsed).forEach(function (digest) {
var lastUsed = digestsToLastUsed[digest];
if (typeof min === 'undefined' || min > lastUsed) {
... | [
"function",
"getLeastRecentlyUsed",
"(",
"mainDoc",
",",
"lastUsedDoc",
")",
"{",
"var",
"digestsToLastUsed",
"=",
"getDigestsToLastUsed",
"(",
"mainDoc",
",",
"lastUsedDoc",
")",
";",
"var",
"min",
";",
"var",
"minDigest",
";",
"Object",
".",
"keys",
"(",
"di... | Get the digest that's the least recently used. If a digest was used
by more than one attachment, then favor the more recent usage date. | [
"Get",
"the",
"digest",
"that",
"s",
"the",
"least",
"recently",
"used",
".",
"If",
"a",
"digest",
"was",
"used",
"by",
"more",
"than",
"one",
"attachment",
"then",
"favor",
"the",
"more",
"recent",
"usage",
"date",
"."
] | dcb35db4771b469be9bfe08bec0cdff71ae0a925 | https://github.com/Squarespace/pouchdb-lru-cache/blob/dcb35db4771b469be9bfe08bec0cdff71ae0a925/index.js#L130-L143 |
36,127 | BBVAEngineering/ember-task-scheduler | addon/services/scheduler.js | scheduleFrame | function scheduleFrame(context, method) {
method = context[method];
return requestAnimationFrame(method.bind(context));
} | javascript | function scheduleFrame(context, method) {
method = context[method];
return requestAnimationFrame(method.bind(context));
} | [
"function",
"scheduleFrame",
"(",
"context",
",",
"method",
")",
"{",
"method",
"=",
"context",
"[",
"method",
"]",
";",
"return",
"requestAnimationFrame",
"(",
"method",
".",
"bind",
"(",
"context",
")",
")",
";",
"}"
] | Bind context to method and call requestAnimationFrame with generated function.
@method scheduleFrame
@param {Object} context
@param {String} method
@return Number
@private | [
"Bind",
"context",
"to",
"method",
"and",
"call",
"requestAnimationFrame",
"with",
"generated",
"function",
"."
] | a6c35916e7e5f9e57c8d646062b15f9ae8164147 | https://github.com/BBVAEngineering/ember-task-scheduler/blob/a6c35916e7e5f9e57c8d646062b15f9ae8164147/addon/services/scheduler.js#L26-L30 |
36,128 | BBVAEngineering/ember-task-scheduler | addon/services/scheduler.js | exec | function exec(target, method, args, onError, stack) {
try {
method.apply(target, args);
} catch (e) {
if (onError) {
onError(e, stack);
}
}
} | javascript | function exec(target, method, args, onError, stack) {
try {
method.apply(target, args);
} catch (e) {
if (onError) {
onError(e, stack);
}
}
} | [
"function",
"exec",
"(",
"target",
",",
"method",
",",
"args",
",",
"onError",
",",
"stack",
")",
"{",
"try",
"{",
"method",
".",
"apply",
"(",
"target",
",",
"args",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"if",
"(",
"onError",
")",
"{",
"... | Try to exec a function with target and args.
When function throws an error it calls onError function with error and stack.
@method exec
@param {Object} target
@param {Function|String} method
@param {Array} args
@param {Function} onError
@param {Error} stack
@private | [
"Try",
"to",
"exec",
"a",
"function",
"with",
"target",
"and",
"args",
"."
] | a6c35916e7e5f9e57c8d646062b15f9ae8164147 | https://github.com/BBVAEngineering/ember-task-scheduler/blob/a6c35916e7e5f9e57c8d646062b15f9ae8164147/addon/services/scheduler.js#L45-L53 |
36,129 | BBVAEngineering/ember-task-scheduler | addon/services/scheduler.js | _logWarn | function _logWarn(title, stack, test = false, options = {}) {
if (test) {
return;
}
const { groupCollapsed, log, trace, groupEnd } = console;
if (groupCollapsed && trace && groupEnd) {
groupCollapsed(title);
log(options.id);
trace(stack.stack);
groupEnd(title);
} else {
warn(`${title}\n${stack.stack}... | javascript | function _logWarn(title, stack, test = false, options = {}) {
if (test) {
return;
}
const { groupCollapsed, log, trace, groupEnd } = console;
if (groupCollapsed && trace && groupEnd) {
groupCollapsed(title);
log(options.id);
trace(stack.stack);
groupEnd(title);
} else {
warn(`${title}\n${stack.stack}... | [
"function",
"_logWarn",
"(",
"title",
",",
"stack",
",",
"test",
"=",
"false",
",",
"options",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"test",
")",
"{",
"return",
";",
"}",
"const",
"{",
"groupCollapsed",
",",
"log",
",",
"trace",
",",
"groupEnd",
"}",... | Logs a grouped stack trace.
Fallback to warn() from @ember/debug
@param {String} title Group title
@param {Object} stack Stack trace
@param {Boolean} test An optional boolean. If falsy, the warning will be displayed.
@param {Object} options Can be used to pass a unique `id` for this warning.
/* istanbul ig... | [
"Logs",
"a",
"grouped",
"stack",
"trace",
"."
] | a6c35916e7e5f9e57c8d646062b15f9ae8164147 | https://github.com/BBVAEngineering/ember-task-scheduler/blob/a6c35916e7e5f9e57c8d646062b15f9ae8164147/addon/services/scheduler.js#L66-L81 |
36,130 | nomocas/min-history | lib/min-history.js | function(id, location) {
var search = "?"+ (location.search || "") + "&hid=" + id;
return (location.pathname || '/')
+ search
+ (location.hash ? ("#" + location.hash) : "");
} | javascript | function(id, location) {
var search = "?"+ (location.search || "") + "&hid=" + id;
return (location.pathname || '/')
+ search
+ (location.hash ? ("#" + location.hash) : "");
} | [
"function",
"(",
"id",
",",
"location",
")",
"{",
"var",
"search",
"=",
"\"?\"",
"+",
"(",
"location",
".",
"search",
"||",
"\"\"",
")",
"+",
"\"&hid=\"",
"+",
"id",
";",
"return",
"(",
"location",
".",
"pathname",
"||",
"'/'",
")",
"+",
"search",
... | produce href with hid in search part | [
"produce",
"href",
"with",
"hid",
"in",
"search",
"part"
] | d4e3514bf08982eb43aa0e1512294c767b8dea03 | https://github.com/nomocas/min-history/blob/d4e3514bf08982eb43aa0e1512294c767b8dea03/lib/min-history.js#L120-L125 | |
36,131 | nomocas/min-history | lib/min-history.js | function(location) {
if (!location.search)
return;
location.search = location.search.replace(/&hid=([^&]+)/gi, function(c, v) {
location.hid = v;
return "";
});
location.path = location.pathname + (location.search ? ("?" + location.search) : "");
location.relative = location.path + (location.hash ? (... | javascript | function(location) {
if (!location.search)
return;
location.search = location.search.replace(/&hid=([^&]+)/gi, function(c, v) {
location.hid = v;
return "";
});
location.path = location.pathname + (location.search ? ("?" + location.search) : "");
location.relative = location.path + (location.hash ? (... | [
"function",
"(",
"location",
")",
"{",
"if",
"(",
"!",
"location",
".",
"search",
")",
"return",
";",
"location",
".",
"search",
"=",
"location",
".",
"search",
".",
"replace",
"(",
"/",
"&hid=([^&]+)",
"/",
"gi",
",",
"function",
"(",
"c",
",",
"v",... | remove hid from location parts. store hid in location. | [
"remove",
"hid",
"from",
"location",
"parts",
".",
"store",
"hid",
"in",
"location",
"."
] | d4e3514bf08982eb43aa0e1512294c767b8dea03 | https://github.com/nomocas/min-history/blob/d4e3514bf08982eb43aa0e1512294c767b8dea03/lib/min-history.js#L128-L138 | |
36,132 | caohanyang/json_diff_rfc6902 | lib/deepEquals.js | _equals | function _equals(a, b) {
switch (typeof a) {
case 'undefined':
case 'boolean':
case 'string':
case 'number':
return a === b;
case 'object':
if (a === null)
{return b === null;}
if (_isArray(a)) {
i... | javascript | function _equals(a, b) {
switch (typeof a) {
case 'undefined':
case 'boolean':
case 'string':
case 'number':
return a === b;
case 'object':
if (a === null)
{return b === null;}
if (_isArray(a)) {
i... | [
"function",
"_equals",
"(",
"a",
",",
"b",
")",
"{",
"switch",
"(",
"typeof",
"a",
")",
"{",
"case",
"'undefined'",
":",
"case",
"'boolean'",
":",
"case",
"'string'",
":",
"case",
"'number'",
":",
"return",
"a",
"===",
"b",
";",
"case",
"'object'",
"... | _equals - This can save a lot of time 5 ms
@param {type} a description
@param {type} b description
@return {type} description | [
"_equals",
"-",
"This",
"can",
"save",
"a",
"lot",
"of",
"time",
"5",
"ms"
] | cb23e4adafb86156409c72790c593881f7685dc1 | https://github.com/caohanyang/json_diff_rfc6902/blob/cb23e4adafb86156409c72790c593881f7685dc1/lib/deepEquals.js#L40-L78 |
36,133 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | function (prototype) {
if (!_.isObject(prototype)) return {};
if (nativeCreate) return nativeCreate(prototype);
Ctor.prototype = prototype;
var result = new Ctor();
Ctor.prototype = null;
return result;
} | javascript | function (prototype) {
if (!_.isObject(prototype)) return {};
if (nativeCreate) return nativeCreate(prototype);
Ctor.prototype = prototype;
var result = new Ctor();
Ctor.prototype = null;
return result;
} | [
"function",
"(",
"prototype",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isObject",
"(",
"prototype",
")",
")",
"return",
"{",
"}",
";",
"if",
"(",
"nativeCreate",
")",
"return",
"nativeCreate",
"(",
"prototype",
")",
";",
"Ctor",
".",
"prototype",
"=",
"p... | An internal function for creating a new object that inherits from another. | [
"An",
"internal",
"function",
"for",
"creating",
"a",
"new",
"object",
"that",
"inherits",
"from",
"another",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L140-L147 | |
36,134 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | omit | function omit(obj, blackList) {
var newObj = {};
Object.keys(obj || {}).forEach(function (key) {
if (blackList.indexOf(key) === -1) {
newObj[key] = obj[key];
}
});
return newObj;
} | javascript | function omit(obj, blackList) {
var newObj = {};
Object.keys(obj || {}).forEach(function (key) {
if (blackList.indexOf(key) === -1) {
newObj[key] = obj[key];
}
});
return newObj;
} | [
"function",
"omit",
"(",
"obj",
",",
"blackList",
")",
"{",
"var",
"newObj",
"=",
"{",
"}",
";",
"Object",
".",
"keys",
"(",
"obj",
"||",
"{",
"}",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"if",
"(",
"blackList",
".",
"indexOf"... | Return a copy of the object, filtered to omit the blacklisted array of keys. | [
"Return",
"a",
"copy",
"of",
"the",
"object",
"filtered",
"to",
"omit",
"the",
"blacklisted",
"array",
"of",
"keys",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L5578-L5586 |
36,135 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | parseStartKey | function parseStartKey(key, restOfLine) {
// When a new key is encountered, the rest of the line is immediately added as
// its value, by calling `flushBuffer`.
flushBuffer();
incrementArrayElement(key);
if (stackScope && stackScope.flags.indexOf('+') > -1) key = 'value';
... | javascript | function parseStartKey(key, restOfLine) {
// When a new key is encountered, the rest of the line is immediately added as
// its value, by calling `flushBuffer`.
flushBuffer();
incrementArrayElement(key);
if (stackScope && stackScope.flags.indexOf('+') > -1) key = 'value';
... | [
"function",
"parseStartKey",
"(",
"key",
",",
"restOfLine",
")",
"{",
"// When a new key is encountered, the rest of the line is immediately added as",
"// its value, by calling `flushBuffer`.",
"flushBuffer",
"(",
")",
";",
"incrementArrayElement",
"(",
"key",
")",
";",
"if",
... | The following parse functions add to the global `data` object and update scoping variables to keep track of what we're parsing. | [
"The",
"following",
"parse",
"functions",
"add",
"to",
"the",
"global",
"data",
"object",
"and",
"update",
"scoping",
"variables",
"to",
"keep",
"track",
"of",
"what",
"we",
"re",
"parsing",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L5667-L5680 |
36,136 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | getParser | function getParser(delimiterOrParser) {
var parser;
if (typeof delimiterOrParser === 'string') {
parser = discernParser(delimiterOrParser, { delimiter: true });
} else if (typeof delimiterOrParser === 'function' || (typeof delimiterOrParser === 'undefined' ? 'undefined' : _typeof(delimiterOrParser)) === 'obje... | javascript | function getParser(delimiterOrParser) {
var parser;
if (typeof delimiterOrParser === 'string') {
parser = discernParser(delimiterOrParser, { delimiter: true });
} else if (typeof delimiterOrParser === 'function' || (typeof delimiterOrParser === 'undefined' ? 'undefined' : _typeof(delimiterOrParser)) === 'obje... | [
"function",
"getParser",
"(",
"delimiterOrParser",
")",
"{",
"var",
"parser",
";",
"if",
"(",
"typeof",
"delimiterOrParser",
"===",
"'string'",
")",
"{",
"parser",
"=",
"discernParser",
"(",
"delimiterOrParser",
",",
"{",
"delimiter",
":",
"true",
"}",
")",
... | Our `readData` fns can take either a delimiter to parse a file, or a full blown parser Determine what they passed in with this handy function | [
"Our",
"readData",
"fns",
"can",
"take",
"either",
"a",
"delimiter",
"to",
"parse",
"a",
"file",
"or",
"a",
"full",
"blown",
"parser",
"Determine",
"what",
"they",
"passed",
"in",
"with",
"this",
"handy",
"function"
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L6098-L6106 |
36,137 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | formattingPreflight | function formattingPreflight(file, format) {
if (file === '') {
return [];
} else if (!Array.isArray(file)) {
notListError(format);
}
return file;
} | javascript | function formattingPreflight(file, format) {
if (file === '') {
return [];
} else if (!Array.isArray(file)) {
notListError(format);
}
return file;
} | [
"function",
"formattingPreflight",
"(",
"file",
",",
"format",
")",
"{",
"if",
"(",
"file",
"===",
"''",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"file",
")",
")",
"{",
"notListError",
"(",
"form... | Some shared data integrity checks for formatters | [
"Some",
"shared",
"data",
"integrity",
"checks",
"for",
"formatters"
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L6603-L6610 |
36,138 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readDbf | function readDbf(filePath, opts_, cb) {
var parserOptions = {
map: identity
};
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, parserOptions, cb);
} | javascript | function readDbf(filePath, opts_, cb) {
var parserOptions = {
map: identity
};
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, parserOptions, cb);
} | [
"function",
"readDbf",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
"=",
"{",
"map",
":",
"identity",
"}",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"pa... | Asynchronously read a dbf file. Returns an empty array if file is empty.
@function readDbf
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must return the transformed... | [
"Asynchronously",
"read",
"a",
"dbf",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L7247-L7257 |
36,139 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readdirFilter | function readdirFilter(dirPath, opts_, cb) {
if (typeof cb === 'undefined') {
cb = opts_;
opts_ = undefined;
}
readdir({ async: true }, dirPath, opts_, cb);
} | javascript | function readdirFilter(dirPath, opts_, cb) {
if (typeof cb === 'undefined') {
cb = opts_;
opts_ = undefined;
}
readdir({ async: true }, dirPath, opts_, cb);
} | [
"function",
"readdirFilter",
"(",
"dirPath",
",",
"opts_",
",",
"cb",
")",
"{",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"opts_",
"=",
"undefined",
";",
"}",
"readdir",
"(",
"{",
"async",
":",
"true",
"}",
... | Asynchronously get a list of a directory's files and folders if certain critera are met.
@function readdirFilter
@param {String} dirPath The directory to read from
@param {Object} options Filter options, see below
@param {Boolean} [options.fullPath=false] If `true`, return the full path of the file, otherwise just ret... | [
"Asynchronously",
"get",
"a",
"list",
"of",
"a",
"directory",
"s",
"files",
"and",
"folders",
"if",
"certain",
"critera",
"are",
"met",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L7978-L7985 |
36,140 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readAml | function readAml(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserAml, parserOptions: parserOptions }, cb);
} | javascript | function readAml(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserAml, parserOptions: parserOptions }, cb);
} | [
"function",
"readAml",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"==="... | Asynchronously read an ArchieMl file. Returns an empty object if file is empty.
@function readAml
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Takes the parsed file (usually an object) and must return the modified file. Se... | [
"Asynchronously",
"read",
"an",
"ArchieMl",
"file",
".",
"Returns",
"an",
"empty",
"object",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8041-L8049 |
36,141 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readAmlSync | function readAmlSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserAml, parserOptions: parserOptions });
} | javascript | function readAmlSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserAml, parserOptions: parserOptions });
} | [
"function",
"readAmlSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}",... | Synchronously read an ArchieML file. Returns an empty object if file is empty.
@function readAmlSync
@param {String} filePath Input file path
@param {Function} [map] Optional map function. Takes the parsed file (usually an object) and must return the modified file. See example below.
@returns {Object} The parsed file
... | [
"Synchronously",
"read",
"an",
"ArchieML",
"file",
".",
"Returns",
"an",
"empty",
"object",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8069-L8075 |
36,142 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readCsv | function readCsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserCsv, parserOptions: parserOptions }, cb);
} | javascript | function readCsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserCsv, parserOptions: parserOptions }, cb);
} | [
"function",
"readCsv",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"==="... | Asynchronously read a comma-separated value file. Returns an empty array if file is empty.
@function readCsv
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must retu... | [
"Asynchronously",
"read",
"a",
"comma",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8108-L8116 |
36,143 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readCsvSync | function readCsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserCsv, parserOptions: parserOptions });
} | javascript | function readCsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserCsv, parserOptions: parserOptions });
} | [
"function",
"readCsvSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}",... | Synchronously read a comma-separated value file. Returns an empty array if file is empty.
@function readCsvSync
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must r... | [
"Synchronously",
"read",
"a",
"comma",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8146-L8152 |
36,144 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readJson | function readJson(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserJson, parserOptions: parserOptions }, cb);
} | javascript | function readJson(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserJson, parserOptions: parserOptions }, cb);
} | [
"function",
"readJson",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===... | Asynchronously read a JSON file. Returns an empty array if file is empty.
@function readJson
@param {String} filePath Input file path
@param {Function|Object} [parserOptions] Optional map function or an object specifying the optional options below.
@param {Function} [parserOptions.map] Map function. Called once for ea... | [
"Asynchronously",
"read",
"a",
"JSON",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8220-L8228 |
36,145 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readJsonSync | function readJsonSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserJson, parserOptions: parserOptions });
} | javascript | function readJsonSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserJson, parserOptions: parserOptions });
} | [
"function",
"readJsonSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}"... | Synchronously read a JSON file. Returns an empty array if file is empty.
@function readJsonSync
@param {String} filePath Input file path
@param {Function|Object} [parserOptions] Optional map function or an object specifying the optional options below.
@param {Function} [parserOptions.map] Map function. Called once for... | [
"Synchronously",
"read",
"a",
"JSON",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8271-L8277 |
36,146 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readPsv | function readPsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserPsv, parserOptions: parserOptions }, cb);
} | javascript | function readPsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserPsv, parserOptions: parserOptions }, cb);
} | [
"function",
"readPsv",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"==="... | Asynchronously read a pipe-separated value file. Returns an empty array if file is empty.
@function readPsv
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must retur... | [
"Asynchronously",
"read",
"a",
"pipe",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8301-L8309 |
36,147 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readPsvSync | function readPsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserPsv, parserOptions: parserOptions });
} | javascript | function readPsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserPsv, parserOptions: parserOptions });
} | [
"function",
"readPsvSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}",... | Synchronously read a pipe-separated value file. Returns an empty array if file is empty.
@function readPsvSync
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must re... | [
"Synchronously",
"read",
"a",
"pipe",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8330-L8336 |
36,148 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readTsv | function readTsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserTsv, parserOptions: parserOptions }, cb);
} | javascript | function readTsv(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserTsv, parserOptions: parserOptions }, cb);
} | [
"function",
"readTsv",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"==="... | Asynchronously read a tab-separated value file. Returns an empty array if file is empty.
@function readTsv
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Called once for each row with the signature `(row, i)` and must return... | [
"Asynchronously",
"read",
"a",
"tab",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8360-L8368 |
36,149 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readTsvSync | function readTsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserTsv, parserOptions: parserOptions });
} | javascript | function readTsvSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserTsv, parserOptions: parserOptions });
} | [
"function",
"readTsvSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}",... | Synchronously read a tab-separated value file. Returns an empty array if file is empty.
@function readTsvSync
@param {String} filePath Input file path
@param {Function} [map] Optional map function, called once for each row (header row skipped). Has signature `(row, i, columns)` and must return the transformed row. See... | [
"Synchronously",
"read",
"a",
"tab",
"-",
"separated",
"value",
"file",
".",
"Returns",
"an",
"empty",
"array",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8390-L8396 |
36,150 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readTxt | function readTxt(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserTxt, parserOptions: parserOptions }, cb);
} | javascript | function readTxt(filePath, opts_, cb) {
var parserOptions;
if (typeof cb === 'undefined') {
cb = opts_;
} else {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
readData(filePath, { parser: parserTxt, parserOptions: parserOptions }, cb);
} | [
"function",
"readTxt",
"(",
"filePath",
",",
"opts_",
",",
"cb",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"cb",
"===",
"'undefined'",
")",
"{",
"cb",
"=",
"opts_",
";",
"}",
"else",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"==="... | Asynchronously read a text file. Returns an empty string if file is empty.
@function readTxt
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Takes the file read in as text and return the modified file. See example below.
@par... | [
"Asynchronously",
"read",
"a",
"text",
"file",
".",
"Returns",
"an",
"empty",
"string",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8417-L8425 |
36,151 | mhkeller/indian-ocean | dist/indian-ocean.cjs.js | readTxtSync | function readTxtSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserTxt, parserOptions: parserOptions });
} | javascript | function readTxtSync(filePath, opts_) {
var parserOptions;
if (typeof opts_ !== 'undefined') {
parserOptions = typeof opts_ === 'function' ? { map: opts_ } : opts_;
}
return readDataSync(filePath, { parser: parserTxt, parserOptions: parserOptions });
} | [
"function",
"readTxtSync",
"(",
"filePath",
",",
"opts_",
")",
"{",
"var",
"parserOptions",
";",
"if",
"(",
"typeof",
"opts_",
"!==",
"'undefined'",
")",
"{",
"parserOptions",
"=",
"typeof",
"opts_",
"===",
"'function'",
"?",
"{",
"map",
":",
"opts_",
"}",... | Synchronously read a text file. Returns an empty string if file is empty.
@function readTxtSync
@param {String} filePath Input file path
@param {Function|Object} [map] Optional map function or an object with `map` key that is a function. Takes the file read in as text and must return the modified file. See example bel... | [
"Synchronously",
"read",
"a",
"text",
"file",
".",
"Returns",
"an",
"empty",
"string",
"if",
"file",
"is",
"empty",
"."
] | 32b5b5799341370452b17ec2ac18529c849f3916 | https://github.com/mhkeller/indian-ocean/blob/32b5b5799341370452b17ec2ac18529c849f3916/dist/indian-ocean.cjs.js#L8444-L8450 |
36,152 | ascartabelli/lamb | src/privates/_getInsertionIndex.js | _getInsertionIndex | function _getInsertionIndex (array, element, comparer, start, end) {
if (array.length === 0) {
return 0;
}
var pivot = (start + end) >> 1;
var result = comparer(
{ value: element, index: pivot },
{ value: array[pivot], index: pivot }
);
if (end - start <= 1) {
r... | javascript | function _getInsertionIndex (array, element, comparer, start, end) {
if (array.length === 0) {
return 0;
}
var pivot = (start + end) >> 1;
var result = comparer(
{ value: element, index: pivot },
{ value: array[pivot], index: pivot }
);
if (end - start <= 1) {
r... | [
"function",
"_getInsertionIndex",
"(",
"array",
",",
"element",
",",
"comparer",
",",
"start",
",",
"end",
")",
"{",
"if",
"(",
"array",
".",
"length",
"===",
"0",
")",
"{",
"return",
"0",
";",
"}",
"var",
"pivot",
"=",
"(",
"start",
"+",
"end",
")... | Establishes at which index an element should be inserted in a sorted array to respect
the array order. Needs the comparer used to sort the array.
@private
@param {Array} array
@param {*} element
@param {Function} comparer
@param {Number} start
@param {Number} end
@returns {Number} | [
"Establishes",
"at",
"which",
"index",
"an",
"element",
"should",
"be",
"inserted",
"in",
"a",
"sorted",
"array",
"to",
"respect",
"the",
"array",
"order",
".",
"Needs",
"the",
"comparer",
"used",
"to",
"sort",
"the",
"array",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_getInsertionIndex.js#L12-L32 |
36,153 | ascartabelli/lamb | src/privates/_getNumConsecutiveHits.js | _getNumConsecutiveHits | function _getNumConsecutiveHits (arrayLike, predicate) {
var idx = 0;
var len = arrayLike.length;
while (idx < len && predicate(arrayLike[idx], idx, arrayLike)) {
idx++;
}
return idx;
} | javascript | function _getNumConsecutiveHits (arrayLike, predicate) {
var idx = 0;
var len = arrayLike.length;
while (idx < len && predicate(arrayLike[idx], idx, arrayLike)) {
idx++;
}
return idx;
} | [
"function",
"_getNumConsecutiveHits",
"(",
"arrayLike",
",",
"predicate",
")",
"{",
"var",
"idx",
"=",
"0",
";",
"var",
"len",
"=",
"arrayLike",
".",
"length",
";",
"while",
"(",
"idx",
"<",
"len",
"&&",
"predicate",
"(",
"arrayLike",
"[",
"idx",
"]",
... | Gets the number of consecutive elements satisfying a predicate in an array-like object.
@private
@param {ArrayLike} arrayLike
@param {ListIteratorCallback} predicate
@returns {Number} | [
"Gets",
"the",
"number",
"of",
"consecutive",
"elements",
"satisfying",
"a",
"predicate",
"in",
"an",
"array",
"-",
"like",
"object",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_getNumConsecutiveHits.js#L8-L17 |
36,154 | AvrahamO/he-date | HeDate.js | function(src, dest) {
var i = 0;
var len = Math.min(src.length, dest.length);
while(i < len) {
dest[i] = src[i];
i++;
}
return dest;
} | javascript | function(src, dest) {
var i = 0;
var len = Math.min(src.length, dest.length);
while(i < len) {
dest[i] = src[i];
i++;
}
return dest;
} | [
"function",
"(",
"src",
",",
"dest",
")",
"{",
"var",
"i",
"=",
"0",
";",
"var",
"len",
"=",
"Math",
".",
"min",
"(",
"src",
".",
"length",
",",
"dest",
".",
"length",
")",
";",
"while",
"(",
"i",
"<",
"len",
")",
"{",
"dest",
"[",
"i",
"]"... | src - Array || Argument object
dest - Array | [
"src",
"-",
"Array",
"||",
"Argument",
"object",
"dest",
"-",
"Array"
] | 942049a4f39e3f57e44ed6f2bef1caa274e21b80 | https://github.com/AvrahamO/he-date/blob/942049a4f39e3f57e44ed6f2bef1caa274e21b80/HeDate.js#L49-L57 | |
36,155 | AvrahamO/he-date | HeDate.js | function(month, year1, year2) {
var leap1 = isLeap(year1 - 1);
var leap2 = isLeap(year2 - 1);
if(month < 5 + leap1) return 0;
return leap2 - leap1;
} | javascript | function(month, year1, year2) {
var leap1 = isLeap(year1 - 1);
var leap2 = isLeap(year2 - 1);
if(month < 5 + leap1) return 0;
return leap2 - leap1;
} | [
"function",
"(",
"month",
",",
"year1",
",",
"year2",
")",
"{",
"var",
"leap1",
"=",
"isLeap",
"(",
"year1",
"-",
"1",
")",
";",
"var",
"leap2",
"=",
"isLeap",
"(",
"year2",
"-",
"1",
")",
";",
"if",
"(",
"month",
"<",
"5",
"+",
"leap1",
")",
... | returns 0, 1 or -1 | [
"returns",
"0",
"1",
"or",
"-",
"1"
] | 942049a4f39e3f57e44ed6f2bef1caa274e21b80 | https://github.com/AvrahamO/he-date/blob/942049a4f39e3f57e44ed6f2bef1caa274e21b80/HeDate.js#L218-L224 | |
36,156 | ILLGrenoble/guacamole-common-js | src/Keyboard.js | function() {
/**
* Reference to this key event.
*/
var key_event = this;
/**
* An arbitrary timestamp in milliseconds, indicating this event's
* position in time relative to other events.
*
* @type {Number}
*/
this.timestam... | javascript | function() {
/**
* Reference to this key event.
*/
var key_event = this;
/**
* An arbitrary timestamp in milliseconds, indicating this event's
* position in time relative to other events.
*
* @type {Number}
*/
this.timestam... | [
"function",
"(",
")",
"{",
"/**\n * Reference to this key event.\n */",
"var",
"key_event",
"=",
"this",
";",
"/**\n * An arbitrary timestamp in milliseconds, indicating this event's\n * position in time relative to other events.\n *\n * @type {Num... | A key event having a corresponding timestamp. This event is non-specific.
Its subclasses should be used instead when recording specific key
events.
@private
@constructor | [
"A",
"key",
"event",
"having",
"a",
"corresponding",
"timestamp",
".",
"This",
"event",
"is",
"non",
"-",
"specific",
".",
"Its",
"subclasses",
"should",
"be",
"used",
"instead",
"when",
"recording",
"specific",
"key",
"events",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Keyboard.js#L66-L117 | |
36,157 | ILLGrenoble/guacamole-common-js | src/Keyboard.js | function(charCode) {
// We extend KeyEvent
KeyEvent.apply(this);
/**
* The Unicode codepoint of the character that would be typed by the
* key pressed.
*
* @type {Number}
*/
this.charCode = charCode;
// Pull keysym from char code
... | javascript | function(charCode) {
// We extend KeyEvent
KeyEvent.apply(this);
/**
* The Unicode codepoint of the character that would be typed by the
* key pressed.
*
* @type {Number}
*/
this.charCode = charCode;
// Pull keysym from char code
... | [
"function",
"(",
"charCode",
")",
"{",
"// We extend KeyEvent",
"KeyEvent",
".",
"apply",
"(",
"this",
")",
";",
"/**\n * The Unicode codepoint of the character that would be typed by the\n * key pressed.\n *\n * @type {Number}\n */",
"this",
"."... | Information related to the pressing of a key, which MUST be
associated with a printable character. The presence or absence of any
information within this object is browser-dependent.
@private
@constructor
@augments Guacamole.Keyboard.KeyEvent
@param {Number} charCode The Unicode codepoint of the character that
would b... | [
"Information",
"related",
"to",
"the",
"pressing",
"of",
"a",
"key",
"which",
"MUST",
"be",
"associated",
"with",
"a",
"printable",
"character",
".",
"The",
"presence",
"or",
"absence",
"of",
"any",
"information",
"within",
"this",
"object",
"is",
"browser",
... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Keyboard.js#L220-L239 | |
36,158 | ILLGrenoble/guacamole-common-js | src/Keyboard.js | update_modifier_state | function update_modifier_state(e) {
// Get state
var state = Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);
// Release alt if implicitly released
if (guac_keyboard.modifiers.alt && state.alt === false) {
guac_keyboard.release(0xFFE9); // Left alt
guac_ke... | javascript | function update_modifier_state(e) {
// Get state
var state = Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);
// Release alt if implicitly released
if (guac_keyboard.modifiers.alt && state.alt === false) {
guac_keyboard.release(0xFFE9); // Left alt
guac_ke... | [
"function",
"update_modifier_state",
"(",
"e",
")",
"{",
"// Get state",
"var",
"state",
"=",
"Guacamole",
".",
"Keyboard",
".",
"ModifierState",
".",
"fromKeyboardEvent",
"(",
"e",
")",
";",
"// Release alt if implicitly released",
"if",
"(",
"guac_keyboard",
".",
... | Given a keyboard event, updates the local modifier state and remote
key state based on the modifier flags within the event. This function
pays no attention to keycodes.
@private
@param {KeyboardEvent} e
The keyboard event containing the flags to update. | [
"Given",
"a",
"keyboard",
"event",
"updates",
"the",
"local",
"modifier",
"state",
"and",
"remote",
"key",
"state",
"based",
"on",
"the",
"modifier",
"flags",
"within",
"the",
"event",
".",
"This",
"function",
"pays",
"no",
"attention",
"to",
"keycodes",
"."... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Keyboard.js#L811-L850 |
36,159 | ILLGrenoble/guacamole-common-js | src/Keyboard.js | release_simulated_altgr | function release_simulated_altgr(keysym) {
// Both Ctrl+Alt must be pressed if simulated AltGr is in use
if (!guac_keyboard.modifiers.ctrl || !guac_keyboard.modifiers.alt)
return;
// Assume [A-Z] never require AltGr
if (keysym >= 0x0041 && keysym <= 0x005A)
retu... | javascript | function release_simulated_altgr(keysym) {
// Both Ctrl+Alt must be pressed if simulated AltGr is in use
if (!guac_keyboard.modifiers.ctrl || !guac_keyboard.modifiers.alt)
return;
// Assume [A-Z] never require AltGr
if (keysym >= 0x0041 && keysym <= 0x005A)
retu... | [
"function",
"release_simulated_altgr",
"(",
"keysym",
")",
"{",
"// Both Ctrl+Alt must be pressed if simulated AltGr is in use",
"if",
"(",
"!",
"guac_keyboard",
".",
"modifiers",
".",
"ctrl",
"||",
"!",
"guac_keyboard",
".",
"modifiers",
".",
"alt",
")",
"return",
";... | Releases Ctrl+Alt, if both are currently pressed and the given keysym
looks like a key that may require AltGr.
@private
@param {Number} keysym The key that was just pressed. | [
"Releases",
"Ctrl",
"+",
"Alt",
"if",
"both",
"are",
"currently",
"pressed",
"and",
"the",
"given",
"keysym",
"looks",
"like",
"a",
"key",
"that",
"may",
"require",
"AltGr",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Keyboard.js#L886-L908 |
36,160 | ILLGrenoble/guacamole-common-js | src/Keyboard.js | interpret_event | function interpret_event() {
// Peek at first event in log
var first = eventLog[0];
if (!first)
return null;
// Keydown event
if (first instanceof KeydownEvent) {
var keysym = null;
var accepted_events = [];
// If event itself i... | javascript | function interpret_event() {
// Peek at first event in log
var first = eventLog[0];
if (!first)
return null;
// Keydown event
if (first instanceof KeydownEvent) {
var keysym = null;
var accepted_events = [];
// If event itself i... | [
"function",
"interpret_event",
"(",
")",
"{",
"// Peek at first event in log",
"var",
"first",
"=",
"eventLog",
"[",
"0",
"]",
";",
"if",
"(",
"!",
"first",
")",
"return",
"null",
";",
"// Keydown event",
"if",
"(",
"first",
"instanceof",
"KeydownEvent",
")",
... | Reads through the event log, interpreting the first event, if possible,
and returning that event. If no events can be interpreted, due to a
total lack of events or the need for more events, null is returned. Any
interpreted events are automatically removed from the log.
@private
@return {KeyEvent}
The first key event ... | [
"Reads",
"through",
"the",
"event",
"log",
"interpreting",
"the",
"first",
"event",
"if",
"possible",
"and",
"returning",
"that",
"event",
".",
"If",
"no",
"events",
"can",
"be",
"interpreted",
"due",
"to",
"a",
"total",
"lack",
"of",
"events",
"or",
"the"... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Keyboard.js#L921-L1008 |
36,161 | the-simian/gulp-concat-filenames | index.js | function(str) {
var output;
try {
output = opts.template(str);
} catch (e) {
e.message = error.badTemplate + ': ' + e.message;
return this.emit('error', new PluginError('gulp-concat-filenames', e));
}
i... | javascript | function(str) {
var output;
try {
output = opts.template(str);
} catch (e) {
e.message = error.badTemplate + ': ' + e.message;
return this.emit('error', new PluginError('gulp-concat-filenames', e));
}
i... | [
"function",
"(",
"str",
")",
"{",
"var",
"output",
";",
"try",
"{",
"output",
"=",
"opts",
".",
"template",
"(",
"str",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"e",
".",
"message",
"=",
"error",
".",
"badTemplate",
"+",
"': '",
"+",
"e",
".... | Make sure template errors reach the output | [
"Make",
"sure",
"template",
"errors",
"reach",
"the",
"output"
] | 5b521d82b7867623e43e41647ad7cac6ca2f11b8 | https://github.com/the-simian/gulp-concat-filenames/blob/5b521d82b7867623e43e41647ad7cac6ca2f11b8/index.js#L39-L52 | |
36,162 | kibertoad/objection-swagger | lib/transformers/query-param.schema.transformer.js | transformIntoQueryParamSchema | function transformIntoQueryParamSchema(processedSchema) {
return _.transform(
processedSchema.items.properties,
(result, value, key) => {
const parameter = Object.assign(
{
name: key
},
value,
{
type: Array.isArray(value.type) ? value.type[0]... | javascript | function transformIntoQueryParamSchema(processedSchema) {
return _.transform(
processedSchema.items.properties,
(result, value, key) => {
const parameter = Object.assign(
{
name: key
},
value,
{
type: Array.isArray(value.type) ? value.type[0]... | [
"function",
"transformIntoQueryParamSchema",
"(",
"processedSchema",
")",
"{",
"return",
"_",
".",
"transform",
"(",
"processedSchema",
".",
"items",
".",
"properties",
",",
"(",
"result",
",",
"value",
",",
"key",
")",
"=>",
"{",
"const",
"parameter",
"=",
... | Transforms JSON-Schema to be usable as Swagger endpoint query param schema
@param {Object} processedSchema
@returns {*} | [
"Transforms",
"JSON",
"-",
"Schema",
"to",
"be",
"usable",
"as",
"Swagger",
"endpoint",
"query",
"param",
"schema"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/transformers/query-param.schema.transformer.js#L8-L26 |
36,163 | jorisvervuurt/JVSDisplayOTron | lib/dothat/dothat.js | DOTHAT | function DOTHAT() {
if (!(this instanceof DOTHAT)) {
return new DOTHAT();
}
this.displayOTron = new DisplayOTron('HAT');
this.lcd = new LCD(this.displayOTron);
this.backlight = new Backlight(this.displayOTron);
this.barGraph = new BarGraph(this.displayOTron);
this.touch = new To... | javascript | function DOTHAT() {
if (!(this instanceof DOTHAT)) {
return new DOTHAT();
}
this.displayOTron = new DisplayOTron('HAT');
this.lcd = new LCD(this.displayOTron);
this.backlight = new Backlight(this.displayOTron);
this.barGraph = new BarGraph(this.displayOTron);
this.touch = new To... | [
"function",
"DOTHAT",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"DOTHAT",
")",
")",
"{",
"return",
"new",
"DOTHAT",
"(",
")",
";",
"}",
"this",
".",
"displayOTron",
"=",
"new",
"DisplayOTron",
"(",
"'HAT'",
")",
";",
"this",
".",
"l... | Creates a new `DOTHAT` object.
@constructor | [
"Creates",
"a",
"new",
"DOTHAT",
"object",
"."
] | c8f9bfdbf4e2658bb12fc83bbf49853c938e7dcc | https://github.com/jorisvervuurt/JVSDisplayOTron/blob/c8f9bfdbf4e2658bb12fc83bbf49853c938e7dcc/lib/dothat/dothat.js#L44-L54 |
36,164 | Accela-Inc/accela-rest-nodejs | lib/rest-client.js | setAuthType | function setAuthType(auth_type) {
var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
if (auth_type == 'AccessToken') {
headers['Authorization'] = _config.access_token;
}
else if (auth_type == 'AppCredentials') {
headers['x-accela-appi... | javascript | function setAuthType(auth_type) {
var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
if (auth_type == 'AccessToken') {
headers['Authorization'] = _config.access_token;
}
else if (auth_type == 'AppCredentials') {
headers['x-accela-appi... | [
"function",
"setAuthType",
"(",
"auth_type",
")",
"{",
"var",
"headers",
"=",
"{",
"'Content-Type'",
":",
"'application/json'",
",",
"'Accept'",
":",
"'application/json'",
"}",
";",
"if",
"(",
"auth_type",
"==",
"'AccessToken'",
")",
"{",
"headers",
"[",
"'Aut... | Method to set authorization type. | [
"Method",
"to",
"set",
"authorization",
"type",
"."
] | 8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e | https://github.com/Accela-Inc/accela-rest-nodejs/blob/8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e/lib/rest-client.js#L133-L152 |
36,165 | Accela-Inc/accela-rest-nodejs | lib/rest-client.js | escapeCharacters | function escapeCharacters(params) {
return params;
var find = new Array('.','-','%','/','\\\\',':','*','\\','<','>','|','?',' ','&','#');
var replace = new Array('.0','.1','.2','.3','.4','.5','.6','.7','.8','.9','.a','.b','.c','.d','.e');
var escaped = {};
for (var param in params) {
if(typ... | javascript | function escapeCharacters(params) {
return params;
var find = new Array('.','-','%','/','\\\\',':','*','\\','<','>','|','?',' ','&','#');
var replace = new Array('.0','.1','.2','.3','.4','.5','.6','.7','.8','.9','.a','.b','.c','.d','.e');
var escaped = {};
for (var param in params) {
if(typ... | [
"function",
"escapeCharacters",
"(",
"params",
")",
"{",
"return",
"params",
";",
"var",
"find",
"=",
"new",
"Array",
"(",
"'.'",
",",
"'-'",
",",
"'%'",
",",
"'/'",
",",
"'\\\\\\\\'",
",",
"':'",
",",
"'*'",
",",
"'\\\\'",
",",
"'<'",
",",
"'>'",
... | Method to escape special characters. | [
"Method",
"to",
"escape",
"special",
"characters",
"."
] | 8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e | https://github.com/Accela-Inc/accela-rest-nodejs/blob/8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e/lib/rest-client.js#L155-L169 |
36,166 | Accela-Inc/accela-rest-nodejs | lib/rest-client.js | replaceCharacter | function replaceCharacter(search, replace, subject, count) {
var i = 0, j = 0, temp = '', repl = '', sl = 0,
fl = 0, f = [].concat(search), r = [].concat(replace),
s = subject, ra = Object.prototype.toString.call(r) === '[object Array]',
sa = Object.prototype.toString.call(s) === '[object Array]', s = [].... | javascript | function replaceCharacter(search, replace, subject, count) {
var i = 0, j = 0, temp = '', repl = '', sl = 0,
fl = 0, f = [].concat(search), r = [].concat(replace),
s = subject, ra = Object.prototype.toString.call(r) === '[object Array]',
sa = Object.prototype.toString.call(s) === '[object Array]', s = [].... | [
"function",
"replaceCharacter",
"(",
"search",
",",
"replace",
",",
"subject",
",",
"count",
")",
"{",
"var",
"i",
"=",
"0",
",",
"j",
"=",
"0",
",",
"temp",
"=",
"''",
",",
"repl",
"=",
"''",
",",
"sl",
"=",
"0",
",",
"fl",
"=",
"0",
",",
"f... | Method for character replacement. | [
"Method",
"for",
"character",
"replacement",
"."
] | 8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e | https://github.com/Accela-Inc/accela-rest-nodejs/blob/8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e/lib/rest-client.js#L172-L209 |
36,167 | Accela-Inc/accela-rest-nodejs | lib/rest-client.js | buildQueryString | function buildQueryString(params) {
var querystring = '';
for(param in params) {
querystring += '&' + param + '=' + params[param];
}
return querystring;
} | javascript | function buildQueryString(params) {
var querystring = '';
for(param in params) {
querystring += '&' + param + '=' + params[param];
}
return querystring;
} | [
"function",
"buildQueryString",
"(",
"params",
")",
"{",
"var",
"querystring",
"=",
"''",
";",
"for",
"(",
"param",
"in",
"params",
")",
"{",
"querystring",
"+=",
"'&'",
"+",
"param",
"+",
"'='",
"+",
"params",
"[",
"param",
"]",
";",
"}",
"return",
... | Utility function to build querystring parameters for API call. | [
"Utility",
"function",
"to",
"build",
"querystring",
"parameters",
"for",
"API",
"call",
"."
] | 8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e | https://github.com/Accela-Inc/accela-rest-nodejs/blob/8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e/lib/rest-client.js#L220-L226 |
36,168 | Accela-Inc/accela-rest-nodejs | lib/rest-client.js | makeRequest | function makeRequest(options, callback) {
request(options, function (error, response, body){
if (error) {
callback(error, null);
}
else if (response.statusCode == 200) {
callback( null, JSON.parse(body));
}
else {
callback(new Error('HTTP R... | javascript | function makeRequest(options, callback) {
request(options, function (error, response, body){
if (error) {
callback(error, null);
}
else if (response.statusCode == 200) {
callback( null, JSON.parse(body));
}
else {
callback(new Error('HTTP R... | [
"function",
"makeRequest",
"(",
"options",
",",
"callback",
")",
"{",
"request",
"(",
"options",
",",
"function",
"(",
"error",
",",
"response",
",",
"body",
")",
"{",
"if",
"(",
"error",
")",
"{",
"callback",
"(",
"error",
",",
"null",
")",
";",
"}"... | Private method to make API call. | [
"Private",
"method",
"to",
"make",
"API",
"call",
"."
] | 8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e | https://github.com/Accela-Inc/accela-rest-nodejs/blob/8f79d5f48d1244b3ab9afd958e7c9ae1f7ecbb0e/lib/rest-client.js#L229-L241 |
36,169 | aMarCruz/jspreproc | lib/options.js | _setFilter | function _setFilter(filt) {
filt = filt.trim()
if (filt === 'all')
this.filter = filt
else if (filt in _filters) {
if (this.filter !== 'all' && this.filter.indexOf(filt) < 0)
this.filter.push(filt)
}
else this.invalid('filter', filt)
} | javascript | function _setFilter(filt) {
filt = filt.trim()
if (filt === 'all')
this.filter = filt
else if (filt in _filters) {
if (this.filter !== 'all' && this.filter.indexOf(filt) < 0)
this.filter.push(filt)
}
else this.invalid('filter', filt)
} | [
"function",
"_setFilter",
"(",
"filt",
")",
"{",
"filt",
"=",
"filt",
".",
"trim",
"(",
")",
"if",
"(",
"filt",
"===",
"'all'",
")",
"this",
".",
"filter",
"=",
"filt",
"else",
"if",
"(",
"filt",
"in",
"_filters",
")",
"{",
"if",
"(",
"this",
"."... | Enable filters for comments, 'all' enable all filters | [
"Enable",
"filters",
"for",
"comments",
"all",
"enable",
"all",
"filters"
] | 5f31820d702a329e8aa25f0f3983f13097610250 | https://github.com/aMarCruz/jspreproc/blob/5f31820d702a329e8aa25f0f3983f13097610250/lib/options.js#L175-L184 |
36,170 | aMarCruz/jspreproc | lib/options.js | _createFilter | function _createFilter(res) {
for (var i = 0; i < res.length; ++i) {
var f = res[i]
if (f instanceof RegExp)
custfilt.push(f)
else {
//console.log('--- creating regex with `' + str + '`')
try {
f = new RegExp(f)
custfilt.push(f)
}
catch ... | javascript | function _createFilter(res) {
for (var i = 0; i < res.length; ++i) {
var f = res[i]
if (f instanceof RegExp)
custfilt.push(f)
else {
//console.log('--- creating regex with `' + str + '`')
try {
f = new RegExp(f)
custfilt.push(f)
}
catch ... | [
"function",
"_createFilter",
"(",
"res",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"res",
".",
"length",
";",
"++",
"i",
")",
"{",
"var",
"f",
"=",
"res",
"[",
"i",
"]",
"if",
"(",
"f",
"instanceof",
"RegExp",
")",
"custfilt",
... | Creates a custom filter | [
"Creates",
"a",
"custom",
"filter"
] | 5f31820d702a329e8aa25f0f3983f13097610250 | https://github.com/aMarCruz/jspreproc/blob/5f31820d702a329e8aa25f0f3983f13097610250/lib/options.js#L187-L205 |
36,171 | ascartabelli/lamb | src/privates/_getPathKey.js | _getPathKey | function _getPathKey (target, key, includeNonEnumerables) {
if (includeNonEnumerables && key in Object(target) || _isEnumerable(target, key)) {
return key;
}
var n = +key;
var len = target && target.length;
return n >= -len && n < len ? n < 0 ? n + len : n : void 0;
} | javascript | function _getPathKey (target, key, includeNonEnumerables) {
if (includeNonEnumerables && key in Object(target) || _isEnumerable(target, key)) {
return key;
}
var n = +key;
var len = target && target.length;
return n >= -len && n < len ? n < 0 ? n + len : n : void 0;
} | [
"function",
"_getPathKey",
"(",
"target",
",",
"key",
",",
"includeNonEnumerables",
")",
"{",
"if",
"(",
"includeNonEnumerables",
"&&",
"key",
"in",
"Object",
"(",
"target",
")",
"||",
"_isEnumerable",
"(",
"target",
",",
"key",
")",
")",
"{",
"return",
"k... | Helper to retrieve the correct key while evaluating a path.
@private
@param {Object} target
@param {String} key
@param {Boolean} includeNonEnumerables
@returns {String|Number|Undefined} | [
"Helper",
"to",
"retrieve",
"the",
"correct",
"key",
"while",
"evaluating",
"a",
"path",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_getPathKey.js#L11-L20 |
36,172 | ascartabelli/lamb | src/privates/_sorter.js | _sorter | function _sorter (reader, isDescending, comparer) {
if (typeof reader !== "function" || reader === identity) {
reader = null;
}
if (typeof comparer !== "function") {
comparer = _comparer;
}
return {
isDescending: isDescending === true,
compare: function (a, b) {
... | javascript | function _sorter (reader, isDescending, comparer) {
if (typeof reader !== "function" || reader === identity) {
reader = null;
}
if (typeof comparer !== "function") {
comparer = _comparer;
}
return {
isDescending: isDescending === true,
compare: function (a, b) {
... | [
"function",
"_sorter",
"(",
"reader",
",",
"isDescending",
",",
"comparer",
")",
"{",
"if",
"(",
"typeof",
"reader",
"!==",
"\"function\"",
"||",
"reader",
"===",
"identity",
")",
"{",
"reader",
"=",
"null",
";",
"}",
"if",
"(",
"typeof",
"comparer",
"!=... | Builds a sorting criterion. If the comparer function is missing, the default
comparer will be used instead.
@private
@param {Function} reader
@param {Boolean} isDescending
@param {Function} [comparer]
@returns {Sorter} | [
"Builds",
"a",
"sorting",
"criterion",
".",
"If",
"the",
"comparer",
"function",
"is",
"missing",
"the",
"default",
"comparer",
"will",
"be",
"used",
"instead",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_sorter.js#L13-L33 |
36,173 | ascartabelli/lamb | src/privates/_merge.js | _merge | function _merge (getKeys, a, b) {
return reduce([a, b], function (result, source) {
forEach(getKeys(source), function (key) {
result[key] = source[key];
});
return result;
}, {});
} | javascript | function _merge (getKeys, a, b) {
return reduce([a, b], function (result, source) {
forEach(getKeys(source), function (key) {
result[key] = source[key];
});
return result;
}, {});
} | [
"function",
"_merge",
"(",
"getKeys",
",",
"a",
",",
"b",
")",
"{",
"return",
"reduce",
"(",
"[",
"a",
",",
"b",
"]",
",",
"function",
"(",
"result",
",",
"source",
")",
"{",
"forEach",
"(",
"getKeys",
"(",
"source",
")",
",",
"function",
"(",
"k... | Merges the received objects using the provided function to retrieve their keys.
@private
@param {Function} getKeys
@param {Object} a
@param {Object} b
@returns {Function} | [
"Merges",
"the",
"received",
"objects",
"using",
"the",
"provided",
"function",
"to",
"retrieve",
"their",
"keys",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_merge.js#L12-L20 |
36,174 | wearefractal/recorder | recorder.js | trigger | function trigger(el, name, options){
var event, type;
type = eventTypes[name];
if (!type) {
throw new SyntaxError('Unknown event type: '+type);
}
options = options || {};
inherit(defaults, options);
if (document.createEvent) {
// Standard Event
event = document.createEvent(type);
... | javascript | function trigger(el, name, options){
var event, type;
type = eventTypes[name];
if (!type) {
throw new SyntaxError('Unknown event type: '+type);
}
options = options || {};
inherit(defaults, options);
if (document.createEvent) {
// Standard Event
event = document.createEvent(type);
... | [
"function",
"trigger",
"(",
"el",
",",
"name",
",",
"options",
")",
"{",
"var",
"event",
",",
"type",
";",
"type",
"=",
"eventTypes",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"type",
")",
"{",
"throw",
"new",
"SyntaxError",
"(",
"'Unknown event type: '",... | Trigger a DOM event.
trigger(document.body, "click", {clientX: 10, clientY: 35});
Where sensible, sane defaults will be filled in. See the list of event
types for supported events.
Loosely based on:
https://github.com/kangax/protolicious/blob/master/event.simulate.js | [
"Trigger",
"a",
"DOM",
"event",
"."
] | 527cca4f66560ea68b769f24ae1393f095c494f0 | https://github.com/wearefractal/recorder/blob/527cca4f66560ea68b769f24ae1393f095c494f0/recorder.js#L447-L471 |
36,175 | aMarCruz/jspreproc | spec/helpers/SpecHelper.js | function (util) {
function printable(str) {
return ('' + str).replace(/\n/g, '\\n').replace(/\r/g, '\\r')
}
function compare(actual, expected) {
var pass = actual === expected
return {
pass: pass,
message: util.buildFailureMessage(
'toHasLinesLi... | javascript | function (util) {
function printable(str) {
return ('' + str).replace(/\n/g, '\\n').replace(/\r/g, '\\r')
}
function compare(actual, expected) {
var pass = actual === expected
return {
pass: pass,
message: util.buildFailureMessage(
'toHasLinesLi... | [
"function",
"(",
"util",
")",
"{",
"function",
"printable",
"(",
"str",
")",
"{",
"return",
"(",
"''",
"+",
"str",
")",
".",
"replace",
"(",
"/",
"\\n",
"/",
"g",
",",
"'\\\\n'",
")",
".",
"replace",
"(",
"/",
"\\r",
"/",
"g",
",",
"'\\\\r'",
"... | simple string comparator, mainly for easy visualization of eols | [
"simple",
"string",
"comparator",
"mainly",
"for",
"easy",
"visualization",
"of",
"eols"
] | 5f31820d702a329e8aa25f0f3983f13097610250 | https://github.com/aMarCruz/jspreproc/blob/5f31820d702a329e8aa25f0f3983f13097610250/spec/helpers/SpecHelper.js#L6-L21 | |
36,176 | aMarCruz/jspreproc | spec/helpers/SpecHelper.js | function (/*util*/) {
function compare(actual, expected) {
return {
pass: actual instanceof Error && ('' + actual).indexOf(expected) >= 0
}
}
return {compare: compare}
} | javascript | function (/*util*/) {
function compare(actual, expected) {
return {
pass: actual instanceof Error && ('' + actual).indexOf(expected) >= 0
}
}
return {compare: compare}
} | [
"function",
"(",
"/*util*/",
")",
"{",
"function",
"compare",
"(",
"actual",
",",
"expected",
")",
"{",
"return",
"{",
"pass",
":",
"actual",
"instanceof",
"Error",
"&&",
"(",
"''",
"+",
"actual",
")",
".",
"indexOf",
"(",
"expected",
")",
">=",
"0",
... | actual has to be an Error instance, and contain the expected string | [
"actual",
"has",
"to",
"be",
"an",
"Error",
"instance",
"and",
"contain",
"the",
"expected",
"string"
] | 5f31820d702a329e8aa25f0f3983f13097610250 | https://github.com/aMarCruz/jspreproc/blob/5f31820d702a329e8aa25f0f3983f13097610250/spec/helpers/SpecHelper.js#L24-L33 | |
36,177 | ILLGrenoble/guacamole-common-js | src/Mouse.js | mousewheel_handler | function mousewheel_handler(e) {
// Determine approximate scroll amount (in pixels)
var delta = e.deltaY || -e.wheelDeltaY || -e.wheelDelta;
// If successfully retrieved scroll amount, convert to pixels if not
// already in pixels
if (delta) {
// Convert to pixels ... | javascript | function mousewheel_handler(e) {
// Determine approximate scroll amount (in pixels)
var delta = e.deltaY || -e.wheelDeltaY || -e.wheelDelta;
// If successfully retrieved scroll amount, convert to pixels if not
// already in pixels
if (delta) {
// Convert to pixels ... | [
"function",
"mousewheel_handler",
"(",
"e",
")",
"{",
"// Determine approximate scroll amount (in pixels)",
"var",
"delta",
"=",
"e",
".",
"deltaY",
"||",
"-",
"e",
".",
"wheelDeltaY",
"||",
"-",
"e",
".",
"wheelDelta",
";",
"// If successfully retrieved scroll amount... | Scroll wheel support | [
"Scroll",
"wheel",
"support"
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L249-L327 |
36,178 | ILLGrenoble/guacamole-common-js | src/Mouse.js | press_button | function press_button(button) {
if (!guac_touchscreen.currentState[button]) {
guac_touchscreen.currentState[button] = true;
if (guac_touchscreen.onmousedown)
guac_touchscreen.onmousedown(guac_touchscreen.currentState);
}
} | javascript | function press_button(button) {
if (!guac_touchscreen.currentState[button]) {
guac_touchscreen.currentState[button] = true;
if (guac_touchscreen.onmousedown)
guac_touchscreen.onmousedown(guac_touchscreen.currentState);
}
} | [
"function",
"press_button",
"(",
"button",
")",
"{",
"if",
"(",
"!",
"guac_touchscreen",
".",
"currentState",
"[",
"button",
"]",
")",
"{",
"guac_touchscreen",
".",
"currentState",
"[",
"button",
"]",
"=",
"true",
";",
"if",
"(",
"guac_touchscreen",
".",
"... | Presses the given mouse button, if it isn't already pressed. Valid
button values are "left", "middle", "right", "up", and "down".
@private
@param {String} button The mouse button to press. | [
"Presses",
"the",
"given",
"mouse",
"button",
"if",
"it",
"isn",
"t",
"already",
"pressed",
".",
"Valid",
"button",
"values",
"are",
"left",
"middle",
"right",
"up",
"and",
"down",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L898-L904 |
36,179 | ILLGrenoble/guacamole-common-js | src/Mouse.js | release_button | function release_button(button) {
if (guac_touchscreen.currentState[button]) {
guac_touchscreen.currentState[button] = false;
if (guac_touchscreen.onmouseup)
guac_touchscreen.onmouseup(guac_touchscreen.currentState);
}
} | javascript | function release_button(button) {
if (guac_touchscreen.currentState[button]) {
guac_touchscreen.currentState[button] = false;
if (guac_touchscreen.onmouseup)
guac_touchscreen.onmouseup(guac_touchscreen.currentState);
}
} | [
"function",
"release_button",
"(",
"button",
")",
"{",
"if",
"(",
"guac_touchscreen",
".",
"currentState",
"[",
"button",
"]",
")",
"{",
"guac_touchscreen",
".",
"currentState",
"[",
"button",
"]",
"=",
"false",
";",
"if",
"(",
"guac_touchscreen",
".",
"onmo... | Releases the given mouse button, if it isn't already released. Valid
button values are "left", "middle", "right", "up", and "down".
@private
@param {String} button The mouse button to release. | [
"Releases",
"the",
"given",
"mouse",
"button",
"if",
"it",
"isn",
"t",
"already",
"released",
".",
"Valid",
"button",
"values",
"are",
"left",
"middle",
"right",
"up",
"and",
"down",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L913-L919 |
36,180 | ILLGrenoble/guacamole-common-js | src/Mouse.js | move_mouse | function move_mouse(x, y) {
guac_touchscreen.currentState.fromClientPosition(element, x, y);
if (guac_touchscreen.onmousemove)
guac_touchscreen.onmousemove(guac_touchscreen.currentState);
} | javascript | function move_mouse(x, y) {
guac_touchscreen.currentState.fromClientPosition(element, x, y);
if (guac_touchscreen.onmousemove)
guac_touchscreen.onmousemove(guac_touchscreen.currentState);
} | [
"function",
"move_mouse",
"(",
"x",
",",
"y",
")",
"{",
"guac_touchscreen",
".",
"currentState",
".",
"fromClientPosition",
"(",
"element",
",",
"x",
",",
"y",
")",
";",
"if",
"(",
"guac_touchscreen",
".",
"onmousemove",
")",
"guac_touchscreen",
".",
"onmous... | Moves the mouse to the given coordinates. These coordinates must be
relative to the browser window, as they will be translated based on
the touch event target's location within the browser window.
@private
@param {Number} x The X coordinate of the mouse pointer.
@param {Number} y The Y coordinate of the mouse pointer. | [
"Moves",
"the",
"mouse",
"to",
"the",
"given",
"coordinates",
".",
"These",
"coordinates",
"must",
"be",
"relative",
"to",
"the",
"browser",
"window",
"as",
"they",
"will",
"be",
"translated",
"based",
"on",
"the",
"touch",
"event",
"target",
"s",
"location"... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L942-L946 |
36,181 | ILLGrenoble/guacamole-common-js | src/Mouse.js | finger_moved | function finger_moved(e) {
var touch = e.touches[0] || e.changedTouches[0];
var delta_x = touch.clientX - gesture_start_x;
var delta_y = touch.clientY - gesture_start_y;
return Math.sqrt(delta_x*delta_x + delta_y*delta_y) >= guac_touchscreen.clickMoveThreshold;
} | javascript | function finger_moved(e) {
var touch = e.touches[0] || e.changedTouches[0];
var delta_x = touch.clientX - gesture_start_x;
var delta_y = touch.clientY - gesture_start_y;
return Math.sqrt(delta_x*delta_x + delta_y*delta_y) >= guac_touchscreen.clickMoveThreshold;
} | [
"function",
"finger_moved",
"(",
"e",
")",
"{",
"var",
"touch",
"=",
"e",
".",
"touches",
"[",
"0",
"]",
"||",
"e",
".",
"changedTouches",
"[",
"0",
"]",
";",
"var",
"delta_x",
"=",
"touch",
".",
"clientX",
"-",
"gesture_start_x",
";",
"var",
"delta_... | Returns whether the given touch event exceeds the movement threshold for
clicking, based on where the touch gesture began.
@private
@param {TouchEvent} e The touch event to check.
@return {Boolean} true if the movement threshold is exceeded, false
otherwise. | [
"Returns",
"whether",
"the",
"given",
"touch",
"event",
"exceeds",
"the",
"movement",
"threshold",
"for",
"clicking",
"based",
"on",
"where",
"the",
"touch",
"gesture",
"began",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L957-L962 |
36,182 | ILLGrenoble/guacamole-common-js | src/Mouse.js | begin_gesture | function begin_gesture(e) {
var touch = e.touches[0];
gesture_in_progress = true;
gesture_start_x = touch.clientX;
gesture_start_y = touch.clientY;
} | javascript | function begin_gesture(e) {
var touch = e.touches[0];
gesture_in_progress = true;
gesture_start_x = touch.clientX;
gesture_start_y = touch.clientY;
} | [
"function",
"begin_gesture",
"(",
"e",
")",
"{",
"var",
"touch",
"=",
"e",
".",
"touches",
"[",
"0",
"]",
";",
"gesture_in_progress",
"=",
"true",
";",
"gesture_start_x",
"=",
"touch",
".",
"clientX",
";",
"gesture_start_y",
"=",
"touch",
".",
"clientY",
... | Begins a new gesture at the location of the first touch in the given
touch event.
@private
@param {TouchEvent} e The touch event beginning this new gesture. | [
"Begins",
"a",
"new",
"gesture",
"at",
"the",
"location",
"of",
"the",
"first",
"touch",
"in",
"the",
"given",
"touch",
"event",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Mouse.js#L971-L976 |
36,183 | tooleks/shevchenko-js | src/api.js | shevchenko | function shevchenko(anthroponym, inflectionCase) {
return anthroponymInflector.inflect(new Anthroponym(anthroponym), new InflectionCase(inflectionCase)).toObject();
} | javascript | function shevchenko(anthroponym, inflectionCase) {
return anthroponymInflector.inflect(new Anthroponym(anthroponym), new InflectionCase(inflectionCase)).toObject();
} | [
"function",
"shevchenko",
"(",
"anthroponym",
",",
"inflectionCase",
")",
"{",
"return",
"anthroponymInflector",
".",
"inflect",
"(",
"new",
"Anthroponym",
"(",
"anthroponym",
")",
",",
"new",
"InflectionCase",
"(",
"inflectionCase",
")",
")",
".",
"toObject",
"... | Inflects the anthroponym.
@param {object} anthroponym
@param {string} anthroponym.firstName
@param {string} anthroponym.lastName
@param {string} anthroponym.middleName
@param {string} anthroponym.gender
@param {string} inflectionCase | [
"Inflects",
"the",
"anthroponym",
"."
] | 6c0b9543065585876dac5799bf90aa69ec48e0bc | https://github.com/tooleks/shevchenko-js/blob/6c0b9543065585876dac5799bf90aa69ec48e0bc/src/api.js#L16-L18 |
36,184 | ILLGrenoble/guacamole-common-js | src/Object.js | dequeueBodyCallback | function dequeueBodyCallback(name) {
// If no callbacks defined, simply return null
var callbacks = bodyCallbacks[name];
if (!callbacks)
return null;
// Otherwise, pull off first callback, deleting the queue if empty
var callback = callbacks.shift();
if (cal... | javascript | function dequeueBodyCallback(name) {
// If no callbacks defined, simply return null
var callbacks = bodyCallbacks[name];
if (!callbacks)
return null;
// Otherwise, pull off first callback, deleting the queue if empty
var callback = callbacks.shift();
if (cal... | [
"function",
"dequeueBodyCallback",
"(",
"name",
")",
"{",
"// If no callbacks defined, simply return null",
"var",
"callbacks",
"=",
"bodyCallbacks",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"callbacks",
")",
"return",
"null",
";",
"// Otherwise, pull off first callback, ... | Removes and returns the callback at the head of the callback queue for
the stream having the given name. If no such callbacks exist, null is
returned.
@private
@param {String} name
The name of the stream to retrieve a callback for.
@returns {Function}
The next callback associated with the stream having the given name... | [
"Removes",
"and",
"returns",
"the",
"callback",
"at",
"the",
"head",
"of",
"the",
"callback",
"queue",
"for",
"the",
"stream",
"having",
"the",
"given",
"name",
".",
"If",
"no",
"such",
"callbacks",
"exist",
"null",
"is",
"returned",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Object.js#L65-L80 |
36,185 | ILLGrenoble/guacamole-common-js | src/Object.js | enqueueBodyCallback | function enqueueBodyCallback(name, callback) {
// Get callback queue by name, creating first if necessary
var callbacks = bodyCallbacks[name];
if (!callbacks) {
callbacks = [];
bodyCallbacks[name] = callbacks;
}
// Add callback to end of queue
ca... | javascript | function enqueueBodyCallback(name, callback) {
// Get callback queue by name, creating first if necessary
var callbacks = bodyCallbacks[name];
if (!callbacks) {
callbacks = [];
bodyCallbacks[name] = callbacks;
}
// Add callback to end of queue
ca... | [
"function",
"enqueueBodyCallback",
"(",
"name",
",",
"callback",
")",
"{",
"// Get callback queue by name, creating first if necessary",
"var",
"callbacks",
"=",
"bodyCallbacks",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"callbacks",
")",
"{",
"callbacks",
"=",
"[",
... | Adds the given callback to the tail of the callback queue for the stream
having the given name.
@private
@param {String} name
The name of the stream to associate with the given callback.
@param {Function} callback
The callback to add to the queue of the stream with the given name. | [
"Adds",
"the",
"given",
"callback",
"to",
"the",
"tail",
"of",
"the",
"callback",
"queue",
"for",
"the",
"stream",
"having",
"the",
"given",
"name",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Object.js#L93-L105 |
36,186 | ILLGrenoble/guacamole-common-js | src/Client.js | getLayer | function getLayer(index) {
// Get layer, create if necessary
var layer = layers[index];
if (!layer) {
// Create layer based on index
if (index === 0)
layer = display.getDefaultLayer();
else if (index > 0)
layer = display.creat... | javascript | function getLayer(index) {
// Get layer, create if necessary
var layer = layers[index];
if (!layer) {
// Create layer based on index
if (index === 0)
layer = display.getDefaultLayer();
else if (index > 0)
layer = display.creat... | [
"function",
"getLayer",
"(",
"index",
")",
"{",
"// Get layer, create if necessary",
"var",
"layer",
"=",
"layers",
"[",
"index",
"]",
";",
"if",
"(",
"!",
"layer",
")",
"{",
"// Create layer based on index",
"if",
"(",
"index",
"===",
"0",
")",
"layer",
"="... | Returns the layer with the given index, creating it if necessary.
Positive indices refer to visible layers, an index of zero refers to
the default layer, and negative indices refer to buffers.
@private
@param {Number} index
The index of the layer to retrieve.
@return {Guacamole.Display.VisibleLayer|Guacamole.Layer}
T... | [
"Returns",
"the",
"layer",
"with",
"the",
"given",
"index",
"creating",
"it",
"if",
"necessary",
".",
"Positive",
"indices",
"refer",
"to",
"visible",
"layers",
"an",
"index",
"of",
"zero",
"refers",
"to",
"the",
"default",
"layer",
"and",
"negative",
"indic... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/Client.js#L723-L744 |
36,187 | ILLGrenoble/guacamole-common-js | src/SessionRecording.js | findFrame | function findFrame(minIndex, maxIndex, timestamp) {
// Do not search if the region contains only one element
if (minIndex === maxIndex)
return minIndex;
// Split search region into two halves
var midIndex = Math.floor((minIndex + maxIndex) / 2);
var midTimestamp = t... | javascript | function findFrame(minIndex, maxIndex, timestamp) {
// Do not search if the region contains only one element
if (minIndex === maxIndex)
return minIndex;
// Split search region into two halves
var midIndex = Math.floor((minIndex + maxIndex) / 2);
var midTimestamp = t... | [
"function",
"findFrame",
"(",
"minIndex",
",",
"maxIndex",
",",
"timestamp",
")",
"{",
"// Do not search if the region contains only one element",
"if",
"(",
"minIndex",
"===",
"maxIndex",
")",
"return",
"minIndex",
";",
"// Split search region into two halves",
"var",
"m... | Searches through the given region of frames for the frame having a
relative timestamp closest to the timestamp given.
@private
@param {Number} minIndex
The index of the first frame in the region (the frame having the
smallest timestamp).
@param {Number} maxIndex
The index of the last frame in the region (the frame ha... | [
"Searches",
"through",
"the",
"given",
"region",
"of",
"frames",
"for",
"the",
"frame",
"having",
"a",
"relative",
"timestamp",
"closest",
"to",
"the",
"timestamp",
"given",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/SessionRecording.js#L254-L276 |
36,188 | ILLGrenoble/guacamole-common-js | src/SessionRecording.js | replayFrame | function replayFrame(index) {
var frame = frames[index];
// Replay all instructions within the retrieved frame
for (var i = 0; i < frame.instructions.length; i++) {
var instruction = frame.instructions[i];
playbackTunnel.receiveInstruction(instruction.opcode, instructio... | javascript | function replayFrame(index) {
var frame = frames[index];
// Replay all instructions within the retrieved frame
for (var i = 0; i < frame.instructions.length; i++) {
var instruction = frame.instructions[i];
playbackTunnel.receiveInstruction(instruction.opcode, instructio... | [
"function",
"replayFrame",
"(",
"index",
")",
"{",
"var",
"frame",
"=",
"frames",
"[",
"index",
"]",
";",
"// Replay all instructions within the retrieved frame",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"frame",
".",
"instructions",
".",
"length",
"... | Replays the instructions associated with the given frame, sending those
instructions to the playback client.
@private
@param {Number} index
The index of the frame within the frames array which should be
replayed. | [
"Replays",
"the",
"instructions",
"associated",
"with",
"the",
"given",
"frame",
"sending",
"those",
"instructions",
"to",
"the",
"playback",
"client",
"."
] | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/SessionRecording.js#L287-L304 |
36,189 | ILLGrenoble/guacamole-common-js | src/SessionRecording.js | seekToFrame | function seekToFrame(index, callback, delay) {
// Abort any in-progress seek
abortSeek();
// Replay frames asynchronously
seekTimeout = window.setTimeout(function continueSeek() {
var startIndex;
// Back up until startIndex represents current state
... | javascript | function seekToFrame(index, callback, delay) {
// Abort any in-progress seek
abortSeek();
// Replay frames asynchronously
seekTimeout = window.setTimeout(function continueSeek() {
var startIndex;
// Back up until startIndex represents current state
... | [
"function",
"seekToFrame",
"(",
"index",
",",
"callback",
",",
"delay",
")",
"{",
"// Abort any in-progress seek",
"abortSeek",
"(",
")",
";",
"// Replay frames asynchronously",
"seekTimeout",
"=",
"window",
".",
"setTimeout",
"(",
"function",
"continueSeek",
"(",
"... | Moves the playback position to the given frame, resetting the state of
the playback client and replaying frames as necessary. The seek
operation will proceed asynchronously. If a seek operation is already in
progress, that seek is first aborted. The progress of the seek operation
can be observed through the onseek hand... | [
"Moves",
"the",
"playback",
"position",
"to",
"the",
"given",
"frame",
"resetting",
"the",
"state",
"of",
"the",
"playback",
"client",
"and",
"replaying",
"frames",
"as",
"necessary",
".",
"The",
"seek",
"operation",
"will",
"proceed",
"asynchronously",
".",
"... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/SessionRecording.js#L325-L388 |
36,190 | ILLGrenoble/guacamole-common-js | src/SessionRecording.js | continuePlayback | function continuePlayback() {
// If frames remain after advancing, schedule next frame
if (currentFrame + 1 < frames.length) {
// Pull the upcoming frame
var next = frames[currentFrame + 1];
// Calculate the real timestamp corresponding to when the next
... | javascript | function continuePlayback() {
// If frames remain after advancing, schedule next frame
if (currentFrame + 1 < frames.length) {
// Pull the upcoming frame
var next = frames[currentFrame + 1];
// Calculate the real timestamp corresponding to when the next
... | [
"function",
"continuePlayback",
"(",
")",
"{",
"// If frames remain after advancing, schedule next frame",
"if",
"(",
"currentFrame",
"+",
"1",
"<",
"frames",
".",
"length",
")",
"{",
"// Pull the upcoming frame",
"var",
"next",
"=",
"frames",
"[",
"currentFrame",
"+"... | Advances playback to the next frame in the frames array and schedules
playback of the frame following that frame based on their associated
timestamps. If no frames exist after the next frame, playback is paused.
@private | [
"Advances",
"playback",
"to",
"the",
"next",
"frame",
"in",
"the",
"frames",
"array",
"and",
"schedules",
"playback",
"of",
"the",
"frame",
"following",
"that",
"frame",
"based",
"on",
"their",
"associated",
"timestamps",
".",
"If",
"no",
"frames",
"exist",
... | 71925794155ea3fc37d2a125adbca6f8be532887 | https://github.com/ILLGrenoble/guacamole-common-js/blob/71925794155ea3fc37d2a125adbca6f8be532887/src/SessionRecording.js#L407-L434 |
36,191 | etpinard/sane-topojson | bin/shp2geo.js | getCmd | function getCmd(program, opt) {
var cmd,
expr;
if(program==='ogr2ogr') {
if(opt==='where') {
expr = [
'-where ',
"\"", specs.key, " IN ",
"('", specs.val, "')\" ",
... | javascript | function getCmd(program, opt) {
var cmd,
expr;
if(program==='ogr2ogr') {
if(opt==='where') {
expr = [
'-where ',
"\"", specs.key, " IN ",
"('", specs.val, "')\" ",
... | [
"function",
"getCmd",
"(",
"program",
",",
"opt",
")",
"{",
"var",
"cmd",
",",
"expr",
";",
"if",
"(",
"program",
"===",
"'ogr2ogr'",
")",
"{",
"if",
"(",
"opt",
"===",
"'where'",
")",
"{",
"expr",
"=",
"[",
"'-where '",
",",
"\"\\\"\"",
",",
"spec... | use ogr2ogr for clip around bound use mapshaper for clip around shapefile polygons | [
"use",
"ogr2ogr",
"for",
"clip",
"around",
"bound",
"use",
"mapshaper",
"for",
"clip",
"around",
"shapefile",
"polygons"
] | 3efc5797df570fc7143a121d0ca9903defb8a8d5 | https://github.com/etpinard/sane-topojson/blob/3efc5797df570fc7143a121d0ca9903defb8a8d5/bin/shp2geo.js#L69-L114 |
36,192 | kibertoad/objection-swagger | lib/converters/query-params-to-json-schema.converter.js | swaggerQueryParamsToSchema | function swaggerQueryParamsToSchema(queryModel) {
const requiredFields = [];
const transformedProperties = {};
_.forOwn(queryModel.items.properties, (value, key) => {
if (value.required) {
requiredFields.push(key);
}
transformedProperties[key] = {
...value
};
if (!_.isNil(transfor... | javascript | function swaggerQueryParamsToSchema(queryModel) {
const requiredFields = [];
const transformedProperties = {};
_.forOwn(queryModel.items.properties, (value, key) => {
if (value.required) {
requiredFields.push(key);
}
transformedProperties[key] = {
...value
};
if (!_.isNil(transfor... | [
"function",
"swaggerQueryParamsToSchema",
"(",
"queryModel",
")",
"{",
"const",
"requiredFields",
"=",
"[",
"]",
";",
"const",
"transformedProperties",
"=",
"{",
"}",
";",
"_",
".",
"forOwn",
"(",
"queryModel",
".",
"items",
".",
"properties",
",",
"(",
"val... | Transforms Swagger query params into correct JSON Schema
@param {Object} queryModel - Swagger query params model
@returns {Object} JSON Schema object | [
"Transforms",
"Swagger",
"query",
"params",
"into",
"correct",
"JSON",
"Schema"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/converters/query-params-to-json-schema.converter.js#L9-L32 |
36,193 | kibertoad/objection-swagger | lib/objection-swagger.js | generateSchemaRaw | function generateSchemaRaw(modelParam, opts = {}) {
validate.notNil(modelParam, "modelParam is mandatory");
let models;
if (_.isArray(modelParam)) {
models = modelParam;
} else if (_.isObject(modelParam)) {
models = [modelParam];
} else {
throw new Error("modelParam should be an object or an arra... | javascript | function generateSchemaRaw(modelParam, opts = {}) {
validate.notNil(modelParam, "modelParam is mandatory");
let models;
if (_.isArray(modelParam)) {
models = modelParam;
} else if (_.isObject(modelParam)) {
models = [modelParam];
} else {
throw new Error("modelParam should be an object or an arra... | [
"function",
"generateSchemaRaw",
"(",
"modelParam",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"validate",
".",
"notNil",
"(",
"modelParam",
",",
"\"modelParam is mandatory\"",
")",
";",
"let",
"models",
";",
"if",
"(",
"_",
".",
"isArray",
"(",
"modelParam",
"... | Generates JSON schemas from Objection.js models
@param {Model|Model[]} modelParam - model(s) to generate schemas for
@param {Options} opts
@returns {GeneratedSwagger[]} generated JSON schemas as objects | [
"Generates",
"JSON",
"schemas",
"from",
"Objection",
".",
"js",
"models"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/objection-swagger.js#L44-L67 |
36,194 | kibertoad/objection-swagger | lib/objection-swagger.js | saveSchema | function saveSchema(modelParam, targetDir, opts = {}) {
validate.notNil(modelParam, "modelParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
const yamlSchemaContainers = generateSchema(modelParam, opts);
return yamlWriter.writeYamlsToFs(yamlSchemaContainers, targetDir, opts);
} | javascript | function saveSchema(modelParam, targetDir, opts = {}) {
validate.notNil(modelParam, "modelParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
const yamlSchemaContainers = generateSchema(modelParam, opts);
return yamlWriter.writeYamlsToFs(yamlSchemaContainers, targetDir, opts);
} | [
"function",
"saveSchema",
"(",
"modelParam",
",",
"targetDir",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"validate",
".",
"notNil",
"(",
"modelParam",
",",
"\"modelParam is mandatory\"",
")",
";",
"validate",
".",
"notNil",
"(",
"targetDir",
",",
"\"targetDir is m... | Generates and saves into specified directory JSON schema files for inclusion in Swagger specifications from given
Objection.js models
@param {Model|Model[]} modelParam - model(s) to generate schemas for
@param {string} targetDir - directory to write generated schemas to. Do not add '/' to the end.
@param {Options} opts... | [
"Generates",
"and",
"saves",
"into",
"specified",
"directory",
"JSON",
"schema",
"files",
"for",
"inclusion",
"in",
"Swagger",
"specifications",
"from",
"given",
"Objection",
".",
"js",
"models"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/objection-swagger.js#L77-L83 |
36,195 | kibertoad/objection-swagger | lib/objection-swagger.js | saveNonModelSchema | function saveNonModelSchema(schemaParam, targetDir, opts = {}) {
validate.notNil(schemaParam, "schemaParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
if (!Array.isArray(schemaParam)) {
schemaParam = [schemaParam];
}
const yamlSchemaContainers = schemaParam.map(schema => {
c... | javascript | function saveNonModelSchema(schemaParam, targetDir, opts = {}) {
validate.notNil(schemaParam, "schemaParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
if (!Array.isArray(schemaParam)) {
schemaParam = [schemaParam];
}
const yamlSchemaContainers = schemaParam.map(schema => {
c... | [
"function",
"saveNonModelSchema",
"(",
"schemaParam",
",",
"targetDir",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"validate",
".",
"notNil",
"(",
"schemaParam",
",",
"\"schemaParam is mandatory\"",
")",
";",
"validate",
".",
"notNil",
"(",
"targetDir",
",",
"\"tar... | Generates and saves into specified directory JSON-schema YAML files for inclusion in Swagger specifications from
given JSON-schemas
@param {Object|Object[]} schemaParam - JSON-Schema(s) to generate yamls for. Title param is used as a filename
@param {string} targetDir - directory to write generated schemas to. Do not a... | [
"Generates",
"and",
"saves",
"into",
"specified",
"directory",
"JSON",
"-",
"schema",
"YAML",
"files",
"for",
"inclusion",
"in",
"Swagger",
"specifications",
"from",
"given",
"JSON",
"-",
"schemas"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/objection-swagger.js#L93-L110 |
36,196 | kibertoad/objection-swagger | lib/objection-swagger.js | saveQueryParamSchema | function saveQueryParamSchema(schemaParam, targetDir, opts = {}) {
validate.notNil(schemaParam, "schemaParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
if (!Array.isArray(schemaParam)) {
schemaParam = [schemaParam];
}
const yamlSchemaContainers = schemaParam.map(schema => {
... | javascript | function saveQueryParamSchema(schemaParam, targetDir, opts = {}) {
validate.notNil(schemaParam, "schemaParam is mandatory");
validate.notNil(targetDir, "targetDir is mandatory");
if (!Array.isArray(schemaParam)) {
schemaParam = [schemaParam];
}
const yamlSchemaContainers = schemaParam.map(schema => {
... | [
"function",
"saveQueryParamSchema",
"(",
"schemaParam",
",",
"targetDir",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"validate",
".",
"notNil",
"(",
"schemaParam",
",",
"\"schemaParam is mandatory\"",
")",
";",
"validate",
".",
"notNil",
"(",
"targetDir",
",",
"\"t... | Generates and saves into specified directory JSON-schema YAML files for inclusion in Swagger query param
specifications from given JSON-schemas
@param {Object|Object[]} schemaParam - JSON-Schema(s) to generate yamls for. Title param is used as a filename
@param {string} targetDir - directory to write generated schemas ... | [
"Generates",
"and",
"saves",
"into",
"specified",
"directory",
"JSON",
"-",
"schema",
"YAML",
"files",
"for",
"inclusion",
"in",
"Swagger",
"query",
"param",
"specifications",
"from",
"given",
"JSON",
"-",
"schemas"
] | 2109b58ce323e78252729a46bcc94e617035b541 | https://github.com/kibertoad/objection-swagger/blob/2109b58ce323e78252729a46bcc94e617035b541/lib/objection-swagger.js#L120-L140 |
36,197 | ascartabelli/lamb | src/privates/_toInteger.js | _toInteger | function _toInteger (value) {
var n = +value;
if (n !== n) { // eslint-disable-line no-self-compare
return 0;
} else if (n % 1 === 0) {
return n;
} else {
return Math.floor(Math.abs(n)) * (n < 0 ? -1 : 1);
}
} | javascript | function _toInteger (value) {
var n = +value;
if (n !== n) { // eslint-disable-line no-self-compare
return 0;
} else if (n % 1 === 0) {
return n;
} else {
return Math.floor(Math.abs(n)) * (n < 0 ? -1 : 1);
}
} | [
"function",
"_toInteger",
"(",
"value",
")",
"{",
"var",
"n",
"=",
"+",
"value",
";",
"if",
"(",
"n",
"!==",
"n",
")",
"{",
"// eslint-disable-line no-self-compare",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"n",
"%",
"1",
"===",
"0",
")",
"{",
"... | Converts a value to an integer.
@private
@param {*} value
@returns {Number} | [
"Converts",
"a",
"value",
"to",
"an",
"integer",
"."
] | d36e45945c4789e4f1a2d8805936514b53f32362 | https://github.com/ascartabelli/lamb/blob/d36e45945c4789e4f1a2d8805936514b53f32362/src/privates/_toInteger.js#L7-L17 |
36,198 | sven-piller/eslint-formatter-markdown | markdown.js | renderStats | function renderStats(stats) {
/**
* Creates table Header if necessary
* @param {string} type error or warning
* @returns {string} The formatted string
*/
function injectHeader(type) {
return (stats[type]) ? '| rule | count | visual |\n| --- | --- | --- |\n' : '';
}
/**
* renders templates f... | javascript | function renderStats(stats) {
/**
* Creates table Header if necessary
* @param {string} type error or warning
* @returns {string} The formatted string
*/
function injectHeader(type) {
return (stats[type]) ? '| rule | count | visual |\n| --- | --- | --- |\n' : '';
}
/**
* renders templates f... | [
"function",
"renderStats",
"(",
"stats",
")",
"{",
"/**\n * Creates table Header if necessary\n * @param {string} type error or warning\n * @returns {string} The formatted string\n */",
"function",
"injectHeader",
"(",
"type",
")",
"{",
"return",
"(",
"stats",
"[",
"type",
... | Renders MARKDOWN for stats
@param {Object} stats the rules and their stats
@returns {string} The formatted string, pluralized where necessary | [
"Renders",
"MARKDOWN",
"for",
"stats"
] | 46fc4cb074b1f599f02df67d814a6a83b37de060 | https://github.com/sven-piller/eslint-formatter-markdown/blob/46fc4cb074b1f599f02df67d814a6a83b37de060/markdown.js#L64-L109 |
36,199 | sven-piller/eslint-formatter-markdown | markdown.js | output | function output(type) {
var statstype = stats[type];
return injectHeader(type) + lodash.map(statstype, function (ruleStats, ruleId) {
return statsRowTemplate({
ruleId: ruleId,
ruleCount: ruleStats,
visual: lodash.repeat('X', lodash.min([ruleStats, 20]))
});
}, '').join(''... | javascript | function output(type) {
var statstype = stats[type];
return injectHeader(type) + lodash.map(statstype, function (ruleStats, ruleId) {
return statsRowTemplate({
ruleId: ruleId,
ruleCount: ruleStats,
visual: lodash.repeat('X', lodash.min([ruleStats, 20]))
});
}, '').join(''... | [
"function",
"output",
"(",
"type",
")",
"{",
"var",
"statstype",
"=",
"stats",
"[",
"type",
"]",
";",
"return",
"injectHeader",
"(",
"type",
")",
"+",
"lodash",
".",
"map",
"(",
"statstype",
",",
"function",
"(",
"ruleStats",
",",
"ruleId",
")",
"{",
... | renders templates for each rule
@param {string} type error or warning
@returns {string} The formatted string, pluralized where necessary | [
"renders",
"templates",
"for",
"each",
"rule"
] | 46fc4cb074b1f599f02df67d814a6a83b37de060 | https://github.com/sven-piller/eslint-formatter-markdown/blob/46fc4cb074b1f599f02df67d814a6a83b37de060/markdown.js#L80-L89 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.