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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,600 | salesforce/refocus-collector-eval | src/RefocusCollectorEval.js | acceptMatcher | function acceptMatcher(acc, actual) {
/* Exact match or full wildcard match on both type and subtype */
if (actual.contentType === acc.item || acc.item === '*/*') return true;
/* Otherwise check for "*" wildcard matches */
const a = acc.item.split(MIME_SUBTYPE_SEPARATOR);
const accepted = {
type: a[0],
... | javascript | function acceptMatcher(acc, actual) {
/* Exact match or full wildcard match on both type and subtype */
if (actual.contentType === acc.item || acc.item === '*/*') return true;
/* Otherwise check for "*" wildcard matches */
const a = acc.item.split(MIME_SUBTYPE_SEPARATOR);
const accepted = {
type: a[0],
... | [
"function",
"acceptMatcher",
"(",
"acc",
",",
"actual",
")",
"{",
"/* Exact match or full wildcard match on both type and subtype */",
"if",
"(",
"actual",
".",
"contentType",
"===",
"acc",
".",
"item",
"||",
"acc",
".",
"item",
"===",
"'*/*'",
")",
"return",
"tru... | Checks whether the actual content type matches this particular accepted
type.
@param {Object} acc - one of the array elements returned by parsing the
Accept headers using "accept-parser"
@param {Object} actual - An object representing the actual content type
received, with attributes ["contentType", "type", "subtype"]... | [
"Checks",
"whether",
"the",
"actual",
"content",
"type",
"matches",
"this",
"particular",
"accepted",
"type",
"."
] | 9d657a7e1627775ef44e84d532f9d50bb52d24e1 | https://github.com/salesforce/refocus-collector-eval/blob/9d657a7e1627775ef44e84d532f9d50bb52d24e1/src/RefocusCollectorEval.js#L39-L59 |
39,601 | crcn/bindable.js | lib/object/index.js | function (property) {
var isString;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
return this[property];
}
// avoid split if possible
var chain = isString ? property.split(".") : property,
currentValue = this,
currentProperty;
/... | javascript | function (property) {
var isString;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
return this[property];
}
// avoid split if possible
var chain = isString ? property.split(".") : property,
currentValue = this,
currentProperty;
/... | [
"function",
"(",
"property",
")",
"{",
"var",
"isString",
";",
"// optimal",
"if",
"(",
"(",
"isString",
"=",
"(",
"typeof",
"property",
"===",
"\"string\"",
")",
")",
"&&",
"!",
"~",
"property",
".",
"indexOf",
"(",
"\".\"",
")",
")",
"{",
"return",
... | Returns a property stored in the bindable object context
@method get
@param {String} path path to the value. Can be something like `person.city.name`. | [
"Returns",
"a",
"property",
"stored",
"in",
"the",
"bindable",
"object",
"context"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/object/index.js#L130-L154 | |
39,602 | crcn/bindable.js | lib/object/index.js | function (property, value) {
var isString, hasChanged, oldValue, chain;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
hasChanged = (oldValue = this[property]) !== value;
if (hasChanged) this[property] = value;
} else {
// avoid split if pos... | javascript | function (property, value) {
var isString, hasChanged, oldValue, chain;
// optimal
if ((isString = (typeof property === "string")) && !~property.indexOf(".")) {
hasChanged = (oldValue = this[property]) !== value;
if (hasChanged) this[property] = value;
} else {
// avoid split if pos... | [
"function",
"(",
"property",
",",
"value",
")",
"{",
"var",
"isString",
",",
"hasChanged",
",",
"oldValue",
",",
"chain",
";",
"// optimal",
"if",
"(",
"(",
"isString",
"=",
"(",
"typeof",
"property",
"===",
"\"string\"",
")",
")",
"&&",
"!",
"~",
"pro... | Sets a property on the bindable object's context
@method set
@param {String} path path to the value. Can be something like `person.city.name`. | [
"Sets",
"a",
"property",
"on",
"the",
"bindable",
"object",
"s",
"context"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/object/index.js#L176-L235 | |
39,603 | crcn/bindable.js | lib/object/index.js | function () {
var obj = {}, value;
var keys = Object.keys(this);
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
if (key.substr(0, 2) === "__") continue;
value = this[key];
if(value && value.__isBindable) {
value = value.toJSON();
}
obj[key] ... | javascript | function () {
var obj = {}, value;
var keys = Object.keys(this);
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
if (key.substr(0, 2) === "__") continue;
value = this[key];
if(value && value.__isBindable) {
value = value.toJSON();
}
obj[key] ... | [
"function",
"(",
")",
"{",
"var",
"obj",
"=",
"{",
"}",
",",
"value",
";",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"this",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"n",
"=",
"keys",
".",
"length",
";",
"i",
"<",
"n",
";",
... | Converts the context to a JSON object
@method toJSON | [
"Converts",
"the",
"context",
"to",
"a",
"JSON",
"object"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/object/index.js#L264-L282 | |
39,604 | ofzza/enTT | dist/entt.js | cast | function cast(data, EntityClass) {
// Check if/how EntityClass is defined or implied
if (!EntityClass && !_lodash2.default.isArray(data)) {
// No explicit class definition, casting data not array
return _dataManagement2.default.cast(data, this);
} else if (!EntityClass && _lodash2.defa... | javascript | function cast(data, EntityClass) {
// Check if/how EntityClass is defined or implied
if (!EntityClass && !_lodash2.default.isArray(data)) {
// No explicit class definition, casting data not array
return _dataManagement2.default.cast(data, this);
} else if (!EntityClass && _lodash2.defa... | [
"function",
"cast",
"(",
"data",
",",
"EntityClass",
")",
"{",
"// Check if/how EntityClass is defined or implied",
"if",
"(",
"!",
"EntityClass",
"&&",
"!",
"_lodash2",
".",
"default",
".",
"isArray",
"(",
"data",
")",
")",
"{",
"// No explicit class definition, ca... | Casts provided data as a EnTT instance of given type
@export
@param {any} data Data to cast
@param {any} EntityClass Extended EnTT class to cast as
- if not provided, will cast to EnTT class this static method is being called from
- if empty array provided, will cast to array of instances of EnTT class this static meth... | [
"Casts",
"provided",
"data",
"as",
"a",
"EnTT",
"instance",
"of",
"given",
"type"
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/entt.js#L74-L92 |
39,605 | ofzza/enTT | dist/entt.js | getClassExtensions | function getClassExtensions(classes) {
// Extract property definitions from all inherited classes' static ".props" property
var extensions = _lodash2.default.reduceRight(classes, function (extensions, current) {
var extensionsArray = current.includes ? _lodash2.default.isArray(current.includes) ? current.inclu... | javascript | function getClassExtensions(classes) {
// Extract property definitions from all inherited classes' static ".props" property
var extensions = _lodash2.default.reduceRight(classes, function (extensions, current) {
var extensionsArray = current.includes ? _lodash2.default.isArray(current.includes) ? current.inclu... | [
"function",
"getClassExtensions",
"(",
"classes",
")",
"{",
"// Extract property definitions from all inherited classes' static \".props\" property",
"var",
"extensions",
"=",
"_lodash2",
".",
"default",
".",
"reduceRight",
"(",
"classes",
",",
"function",
"(",
"extensions",
... | Gets class extensions by traversing and merging static ".includes" property of the instance's class and it's inherited classes
@param {any} classes Array of inherited from classes
@returns {any} Array of extensions applied to the class | [
"Gets",
"class",
"extensions",
"by",
"traversing",
"and",
"merging",
"static",
".",
"includes",
"property",
"of",
"the",
"instance",
"s",
"class",
"and",
"it",
"s",
"inherited",
"classes"
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/entt.js#L229-L242 |
39,606 | ofzza/enTT | dist/entt.js | getClassProperties | function getClassProperties(classes) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
extensionsManager = _ref.extensionsManager;
// Define checks for shorthand casting configurations
var isPropertyShorthandCastAsSingleEntity = function isPropertyShorthandCastAsSingleEnt... | javascript | function getClassProperties(classes) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
extensionsManager = _ref.extensionsManager;
// Define checks for shorthand casting configurations
var isPropertyShorthandCastAsSingleEntity = function isPropertyShorthandCastAsSingleEnt... | [
"function",
"getClassProperties",
"(",
"classes",
")",
"{",
"var",
"_ref",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"{",
"}",
",",
"extensionsManager",
"=",
"... | Gets class properties configuration by traversing and merging static ".props" property of the instance's class and all it's inherited classes
@param {any} classes Array of inherited from classes
@param {any} extensionsManager Extensions manager
@returns {any} Property configuration for all class' properties | [
"Gets",
"class",
"properties",
"configuration",
"by",
"traversing",
"and",
"merging",
"static",
".",
"props",
"property",
"of",
"the",
"instance",
"s",
"class",
"and",
"all",
"it",
"s",
"inherited",
"classes"
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/entt.js#L250-L335 |
39,607 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ( settings, opts ) {
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.1' ) ) {
throw 'DataTables Responsive requires DataTables 1.10.1 or newer';
}
this.s = {
dt: new DataTable.Api( settings ),
columns: []
};
// Check if r... | javascript | function ( settings, opts ) {
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.1' ) ) {
throw 'DataTables Responsive requires DataTables 1.10.1 or newer';
}
this.s = {
dt: new DataTable.Api( settings ),
columns: []
};
// Check if r... | [
"function",
"(",
"settings",
",",
"opts",
")",
"{",
"// Sanity check that we are using DataTables 1.10 or newer",
"if",
"(",
"!",
"DataTable",
".",
"versionCheck",
"||",
"!",
"DataTable",
".",
"versionCheck",
"(",
"'1.10.1'",
")",
")",
"{",
"throw",
"'DataTables Res... | Responsive is a plug-in for the DataTables library that makes use of
DataTables' ability to change the visibility of columns, changing the
visibility of columns so the displayed columns fit into the table container.
The end result is that complex tables will be dynamically adjusted to fit
into the viewport, be it on a ... | [
"Responsive",
"is",
"a",
"plug",
"-",
"in",
"for",
"the",
"DataTables",
"library",
"that",
"makes",
"use",
"of",
"DataTables",
"ability",
"to",
"change",
"the",
"visibility",
"of",
"columns",
"changing",
"the",
"visibility",
"of",
"columns",
"so",
"the",
"di... | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L75-L99 | |
39,608 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ( colIdx, name ) {
var includeIn = columns[ colIdx ].includeIn;
if ( $.inArray( name, includeIn ) === -1 ) {
includeIn.push( name );
}
} | javascript | function ( colIdx, name ) {
var includeIn = columns[ colIdx ].includeIn;
if ( $.inArray( name, includeIn ) === -1 ) {
includeIn.push( name );
}
} | [
"function",
"(",
"colIdx",
",",
"name",
")",
"{",
"var",
"includeIn",
"=",
"columns",
"[",
"colIdx",
"]",
".",
"includeIn",
";",
"if",
"(",
"$",
".",
"inArray",
"(",
"name",
",",
"includeIn",
")",
"===",
"-",
"1",
")",
"{",
"includeIn",
".",
"push"... | Simply add a breakpoint to `includeIn` array, ensuring that there are no duplicates | [
"Simply",
"add",
"a",
"breakpoint",
"to",
"includeIn",
"array",
"ensuring",
"that",
"there",
"are",
"no",
"duplicates"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L314-L320 | |
39,609 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ()
{
var that = this;
var dt = this.s.dt;
var details = this.c.details;
// The inline type always uses the first child as the target
if ( details.type === 'inline' ) {
details.target = 'td:first-child';
}
// type.target can be a string jQuery selector or a column index
var target ... | javascript | function ()
{
var that = this;
var dt = this.s.dt;
var details = this.c.details;
// The inline type always uses the first child as the target
if ( details.type === 'inline' ) {
details.target = 'td:first-child';
}
// type.target can be a string jQuery selector or a column index
var target ... | [
"function",
"(",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"dt",
"=",
"this",
".",
"s",
".",
"dt",
";",
"var",
"details",
"=",
"this",
".",
"c",
".",
"details",
";",
"// The inline type always uses the first child as the target",
"if",
"(",
"detail... | Initialisation for the details handler
@private | [
"Initialisation",
"for",
"the",
"details",
"handler"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L426-L479 | |
39,610 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ()
{
var that = this;
var dt = this.s.dt;
// Find how many columns are hidden
var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
var col = dt.column( idx );
if ( col.visible() ) {
return null;
}
// Only counts as hidden if it doesn't have the `never` class
retu... | javascript | function ()
{
var that = this;
var dt = this.s.dt;
// Find how many columns are hidden
var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
var col = dt.column( idx );
if ( col.visible() ) {
return null;
}
// Only counts as hidden if it doesn't have the `never` class
retu... | [
"function",
"(",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"dt",
"=",
"this",
".",
"s",
".",
"dt",
";",
"// Find how many columns are hidden",
"var",
"hiddenColumns",
"=",
"dt",
".",
"columns",
"(",
")",
".",
"indexes",
"(",
")",
".",
"filter",... | Update the child rows in the table whenever the column visibility changes
@private | [
"Update",
"the",
"child",
"rows",
"in",
"the",
"table",
"whenever",
"the",
"column",
"visibility",
"changes"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L487-L533 | |
39,611 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ( name )
{
var breakpoints = this.c.breakpoints;
for ( var i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].name === name ) {
return breakpoints[i];
}
}
} | javascript | function ( name )
{
var breakpoints = this.c.breakpoints;
for ( var i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].name === name ) {
return breakpoints[i];
}
}
} | [
"function",
"(",
"name",
")",
"{",
"var",
"breakpoints",
"=",
"this",
".",
"c",
".",
"breakpoints",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"ien",
"=",
"breakpoints",
".",
"length",
";",
"i",
"<",
"ien",
";",
"i",
"++",
")",
"{",
"if",
"(",... | Find a breakpoint object from a name
@param {string} name Breakpoint name to find
@return {object} Breakpoint description object | [
"Find",
"a",
"breakpoint",
"object",
"from",
"a",
"name"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L541-L550 | |
39,612 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ()
{
var dt = this.s.dt;
var width = $(window).width();
var breakpoints = this.c.breakpoints;
var breakpoint = breakpoints[0].name;
var columns = this.s.columns;
var i, ien;
// Determine what breakpoint we are currently at
for ( i=breakpoints.length-1 ; i>=0 ; i-- ) {
if ( width <= breakpo... | javascript | function ()
{
var dt = this.s.dt;
var width = $(window).width();
var breakpoints = this.c.breakpoints;
var breakpoint = breakpoints[0].name;
var columns = this.s.columns;
var i, ien;
// Determine what breakpoint we are currently at
for ( i=breakpoints.length-1 ; i>=0 ; i-- ) {
if ( width <= breakpo... | [
"function",
"(",
")",
"{",
"var",
"dt",
"=",
"this",
".",
"s",
".",
"dt",
";",
"var",
"width",
"=",
"$",
"(",
"window",
")",
".",
"width",
"(",
")",
";",
"var",
"breakpoints",
"=",
"this",
".",
"c",
".",
"breakpoints",
";",
"var",
"breakpoint",
... | Alter the table display for a resized viewport. This involves first
determining what breakpoint the window currently is in, getting the
column visibilities to apply and then setting them.
@private | [
"Alter",
"the",
"table",
"display",
"for",
"a",
"resized",
"viewport",
".",
"This",
"involves",
"first",
"determining",
"what",
"breakpoint",
"the",
"window",
"currently",
"is",
"in",
"getting",
"the",
"column",
"visibilities",
"to",
"apply",
"and",
"then",
"s... | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L560-L596 | |
39,613 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js | function ()
{
var dt = this.s.dt;
var columns = this.s.columns;
// Are we allowed to do auto sizing?
if ( ! this.c.auto ) {
return;
}
// Are there any columns that actually need auto-sizing, or do they all
// have classes defined
if ( $.inArray( true, $.map( columns, function (c) { return c.auto; ... | javascript | function ()
{
var dt = this.s.dt;
var columns = this.s.columns;
// Are we allowed to do auto sizing?
if ( ! this.c.auto ) {
return;
}
// Are there any columns that actually need auto-sizing, or do they all
// have classes defined
if ( $.inArray( true, $.map( columns, function (c) { return c.auto; ... | [
"function",
"(",
")",
"{",
"var",
"dt",
"=",
"this",
".",
"s",
".",
"dt",
";",
"var",
"columns",
"=",
"this",
".",
"s",
".",
"columns",
";",
"// Are we allowed to do auto sizing?",
"if",
"(",
"!",
"this",
".",
"c",
".",
"auto",
")",
"{",
"return",
... | Determine the width of each column in the table so the auto column hiding
has that information to work with. This method is never going to be 100%
perfect since column widths can change slightly per page, but without
seriously compromising performance this is quite effective.
@private | [
"Determine",
"the",
"width",
"of",
"each",
"column",
"in",
"the",
"table",
"so",
"the",
"auto",
"column",
"hiding",
"has",
"that",
"information",
"to",
"work",
"with",
".",
"This",
"method",
"is",
"never",
"going",
"to",
"be",
"100%",
"perfect",
"since",
... | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js#L607-L675 | |
39,614 | MaddHacker/server-lite | lib/sl-content.js | Content | function Content(mimeType, content) {
var obj = {};
obj.type = mimeType + '; charset=utf-8';
obj.value = content;
obj.length = content.length;
return obj;
} | javascript | function Content(mimeType, content) {
var obj = {};
obj.type = mimeType + '; charset=utf-8';
obj.value = content;
obj.length = content.length;
return obj;
} | [
"function",
"Content",
"(",
"mimeType",
",",
"content",
")",
"{",
"var",
"obj",
"=",
"{",
"}",
";",
"obj",
".",
"type",
"=",
"mimeType",
"+",
"'; charset=utf-8'",
";",
"obj",
".",
"value",
"=",
"content",
";",
"obj",
".",
"length",
"=",
"content",
".... | Generic concept of a Content-Type model => all content is assumed to have charset = 'utf-8'
@param {String} mimeType => how the client should read the content
@param {Object} content => actual content (file, image, etc)
@returns {Content} content wrapper for given payload. | [
"Generic",
"concept",
"of",
"a",
"Content",
"-",
"Type",
"model",
"=",
">",
"all",
"content",
"is",
"assumed",
"to",
"have",
"charset",
"=",
"utf",
"-",
"8"
] | 5cf606503bb7c434c5a29b3bbbf39fab1cb24fa8 | https://github.com/MaddHacker/server-lite/blob/5cf606503bb7c434c5a29b3bbbf39fab1cb24fa8/lib/sl-content.js#L26-L34 |
39,615 | adrai/node-cqs | lib/domain/domain.js | function(cmdPointer, next) {
// Publish it now...
commandDispatcher.dispatch(cmdPointer.command, function(err) {
if (cmdPointer.callback) cmdPointer.callback(null);
... | javascript | function(cmdPointer, next) {
// Publish it now...
commandDispatcher.dispatch(cmdPointer.command, function(err) {
if (cmdPointer.callback) cmdPointer.callback(null);
... | [
"function",
"(",
"cmdPointer",
",",
"next",
")",
"{",
"// Publish it now...",
"commandDispatcher",
".",
"dispatch",
"(",
"cmdPointer",
".",
"command",
",",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"cmdPointer",
".",
"callback",
")",
"cmdPointer",
".",
"c... | dipatch one command in queue and call the _next_ callback, which will call _process_ for the next command in queue. | [
"dipatch",
"one",
"command",
"in",
"queue",
"and",
"call",
"the",
"_next_",
"callback",
"which",
"will",
"call",
"_process_",
"for",
"the",
"next",
"command",
"in",
"queue",
"."
] | 1691670a6e35d0b20904a5bd1b74adbe92f496eb | https://github.com/adrai/node-cqs/blob/1691670a6e35d0b20904a5bd1b74adbe92f496eb/lib/domain/domain.js#L163-L170 | |
39,616 | bBlocks/dom | dom.js | function(selector, all) {
if (!this.querySelector) {bb.warn('Find should be used with DOM elements'); return;}
return all && this.querySelectorAll(selector) || this.querySelector(selector);
} | javascript | function(selector, all) {
if (!this.querySelector) {bb.warn('Find should be used with DOM elements'); return;}
return all && this.querySelectorAll(selector) || this.querySelector(selector);
} | [
"function",
"(",
"selector",
",",
"all",
")",
"{",
"if",
"(",
"!",
"this",
".",
"querySelector",
")",
"{",
"bb",
".",
"warn",
"(",
"'Find should be used with DOM elements'",
")",
";",
"return",
";",
"}",
"return",
"all",
"&&",
"this",
".",
"querySelectorAl... | Finds child element matching provided selector
@param {string} selector - Selector has limitations based on the browser support.
@param {boolean} all - Flag to find all matching elements. Otherwise fist found element is returned.
@return {element|array|undefined} - Found element or array of elements | [
"Finds",
"child",
"element",
"matching",
"provided",
"selector"
] | 3381b3bf3a0415a852f60d8f53c7cac2765ee9b6 | https://github.com/bBlocks/dom/blob/3381b3bf3a0415a852f60d8f53c7cac2765ee9b6/dom.js#L40-L43 | |
39,617 | bBlocks/dom | dom.js | function(html, tag) {
var el = document.createElement(tag || 'div');
el.innerHTML = html;
return el;
} | javascript | function(html, tag) {
var el = document.createElement(tag || 'div');
el.innerHTML = html;
return el;
} | [
"function",
"(",
"html",
",",
"tag",
")",
"{",
"var",
"el",
"=",
"document",
".",
"createElement",
"(",
"tag",
"||",
"'div'",
")",
";",
"el",
".",
"innerHTML",
"=",
"html",
";",
"return",
"el",
";",
"}"
] | Creates a new HTMLElement with provided contents
@param {string} html - HTML contents
@param {string=} tag - Optional tag of the element to create | [
"Creates",
"a",
"new",
"HTMLElement",
"with",
"provided",
"contents"
] | 3381b3bf3a0415a852f60d8f53c7cac2765ee9b6 | https://github.com/bBlocks/dom/blob/3381b3bf3a0415a852f60d8f53c7cac2765ee9b6/dom.js#L103-L107 | |
39,618 | enquirer/terminal-paginator | index.js | Paginator | function Paginator(options) {
debug('initializing from <%s>', __filename);
this.options = options || {};
this.footer = this.options.footer;
if (typeof this.footer !== 'string') {
this.footer = '(Move up and down to reveal more choices)';
}
this.firstRender = true;
this.lastIndex = 0;
this.position =... | javascript | function Paginator(options) {
debug('initializing from <%s>', __filename);
this.options = options || {};
this.footer = this.options.footer;
if (typeof this.footer !== 'string') {
this.footer = '(Move up and down to reveal more choices)';
}
this.firstRender = true;
this.lastIndex = 0;
this.position =... | [
"function",
"Paginator",
"(",
"options",
")",
"{",
"debug",
"(",
"'initializing from <%s>'",
",",
"__filename",
")",
";",
"this",
".",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"footer",
"=",
"this",
".",
"options",
".",
"footer",
";",... | The paginator keeps track of a position index in a list
and returns a subset of the choices if the list is too
long. | [
"The",
"paginator",
"keeps",
"track",
"of",
"a",
"position",
"index",
"in",
"a",
"list",
"and",
"returns",
"a",
"subset",
"of",
"the",
"choices",
"if",
"the",
"list",
"is",
"too",
"long",
"."
] | 56413bd88a0870ee6c1d6ba897c0fc4111fc9bea | https://github.com/enquirer/terminal-paginator/blob/56413bd88a0870ee6c1d6ba897c0fc4111fc9bea/index.js#L13-L23 |
39,619 | mongodb-js/electron-installer-run | lib/index.js | getBinPath | function getBinPath(cmd, fn) {
which(cmd, function(err, bin) {
if (err) {
return fn(err);
}
fs.exists(bin, function(exists) {
if (!exists) {
return fn(new Error(format(
'Expected file for `%s` does not exist at `%s`',
cmd, bin)));
}
fn(null, bin);
}... | javascript | function getBinPath(cmd, fn) {
which(cmd, function(err, bin) {
if (err) {
return fn(err);
}
fs.exists(bin, function(exists) {
if (!exists) {
return fn(new Error(format(
'Expected file for `%s` does not exist at `%s`',
cmd, bin)));
}
fn(null, bin);
}... | [
"function",
"getBinPath",
"(",
"cmd",
",",
"fn",
")",
"{",
"which",
"(",
"cmd",
",",
"function",
"(",
"err",
",",
"bin",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"fn",
"(",
"err",
")",
";",
"}",
"fs",
".",
"exists",
"(",
"bin",
",",
"f... | Gets the absolute path for a `cmd`.
@param {String} cmd - e.g. `codesign`.
@param {Function} fn - Callback which receives `(err, binPath)`.
@return {void} | [
"Gets",
"the",
"absolute",
"path",
"for",
"a",
"cmd",
"."
] | dc47ecac35d5dd945cadb306a6a12975bf2c4ded | https://github.com/mongodb-js/electron-installer-run/blob/dc47ecac35d5dd945cadb306a6a12975bf2c4ded/lib/index.js#L13-L28 |
39,620 | mongodb-js/electron-installer-run | lib/index.js | run | function run(cmd, args, opts, fn) {
if (typeof opts === 'function') {
fn = opts;
opts = {};
}
if (typeof args === 'function') {
fn = args;
args = [];
opts = {};
}
getBinPath(cmd, function(err, bin) {
if (err) {
return fn(err);
}
debug('running', {
cmd: cmd,
... | javascript | function run(cmd, args, opts, fn) {
if (typeof opts === 'function') {
fn = opts;
opts = {};
}
if (typeof args === 'function') {
fn = args;
args = [];
opts = {};
}
getBinPath(cmd, function(err, bin) {
if (err) {
return fn(err);
}
debug('running', {
cmd: cmd,
... | [
"function",
"run",
"(",
"cmd",
",",
"args",
",",
"opts",
",",
"fn",
")",
"{",
"if",
"(",
"typeof",
"opts",
"===",
"'function'",
")",
"{",
"fn",
"=",
"opts",
";",
"opts",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"typeof",
"args",
"===",
"'function'",
... | Use me when you want to run an external command instead
of using `child_process` directly because I'll handle
lots of platform edge cases for you and provide
nice debugging output when things go wrong!
@example
var run = require('electron-installer-run');
var args = ['--verify', process.env.APP_PATH];
run('codesign', ... | [
"Use",
"me",
"when",
"you",
"want",
"to",
"run",
"an",
"external",
"command",
"instead",
"of",
"using",
"child_process",
"directly",
"because",
"I",
"ll",
"handle",
"lots",
"of",
"platform",
"edge",
"cases",
"for",
"you",
"and",
"provide",
"nice",
"debugging... | dc47ecac35d5dd945cadb306a6a12975bf2c4ded | https://github.com/mongodb-js/electron-installer-run/blob/dc47ecac35d5dd945cadb306a6a12975bf2c4ded/lib/index.js#L52-L114 |
39,621 | balderdashy/mast | newExample/bootstrap.js | bootstrap | function bootstrap(options, cb) {
var adapters = options.adapters || {};
var connections = options.connections || {};
var collections = options.collections || {};
Object.keys(adapters).forEach(function(identity) {
var def = adapters[identity];
// Make sure our adapter defs have `identity` properties
def.... | javascript | function bootstrap(options, cb) {
var adapters = options.adapters || {};
var connections = options.connections || {};
var collections = options.collections || {};
Object.keys(adapters).forEach(function(identity) {
var def = adapters[identity];
// Make sure our adapter defs have `identity` properties
def.... | [
"function",
"bootstrap",
"(",
"options",
",",
"cb",
")",
"{",
"var",
"adapters",
"=",
"options",
".",
"adapters",
"||",
"{",
"}",
";",
"var",
"connections",
"=",
"options",
".",
"connections",
"||",
"{",
"}",
";",
"var",
"collections",
"=",
"options",
... | Simple bootstrap to set up Waterline given some
collection, connection, and adapter definitions.
@param options
:: {Object} adapters [i.e. a dictionary]
:: {Object} connections [i.e. a dictionary]
:: {Object} collections [i.e. a dictionary]
@param {Function} cb
() {Error} err
() ontology
:: {Object} coll... | [
"Simple",
"bootstrap",
"to",
"set",
"up",
"Waterline",
"given",
"some",
"collection",
"connection",
"and",
"adapter",
"definitions",
"."
] | 6fc2b07849ec6a6fe15f66e456e556e5270ed37f | https://github.com/balderdashy/mast/blob/6fc2b07849ec6a6fe15f66e456e556e5270ed37f/newExample/bootstrap.js#L19-L64 |
39,622 | spyfu/spyfu-vue-factory | dist/spyfu-vue-factory.esm.js | function (name) {
return {
name: name,
component: {
render: function render(h) {
return h('div');
},
functional: true
},
path: '/' + name.replace(/[^\w]/g, "-")
};
} | javascript | function (name) {
return {
name: name,
component: {
render: function render(h) {
return h('div');
},
functional: true
},
path: '/' + name.replace(/[^\w]/g, "-")
};
} | [
"function",
"(",
"name",
")",
"{",
"return",
"{",
"name",
":",
"name",
",",
"component",
":",
"{",
"render",
":",
"function",
"render",
"(",
"h",
")",
"{",
"return",
"h",
"(",
"'div'",
")",
";",
"}",
",",
"functional",
":",
"true",
"}",
",",
"pat... | Stub a named route.
@param {string} name the name of the route being stubbed
@return {Array} | [
"Stub",
"a",
"named",
"route",
"."
] | 9d0513ecbd7f56ab082ded01bb17a28ac4f72430 | https://github.com/spyfu/spyfu-vue-factory/blob/9d0513ecbd7f56ab082ded01bb17a28ac4f72430/dist/spyfu-vue-factory.esm.js#L156-L167 | |
39,623 | spyfu/spyfu-vue-factory | dist/spyfu-vue-factory.esm.js | normalizeModules | function normalizeModules(modules) {
var normalized = {};
Object.keys(modules).forEach(function (key) {
var module = modules[key];
// make sure each vuex module has all keys defined
normalized[key] = {
actions: module.actions || {},
getters: module.getters || {}... | javascript | function normalizeModules(modules) {
var normalized = {};
Object.keys(modules).forEach(function (key) {
var module = modules[key];
// make sure each vuex module has all keys defined
normalized[key] = {
actions: module.actions || {},
getters: module.getters || {}... | [
"function",
"normalizeModules",
"(",
"modules",
")",
"{",
"var",
"normalized",
"=",
"{",
"}",
";",
"Object",
".",
"keys",
"(",
"modules",
")",
".",
"forEach",
"(",
"function",
"(",
"key",
")",
"{",
"var",
"module",
"=",
"modules",
"[",
"key",
"]",
";... | helper function to evaluate the state functions of vuex modules | [
"helper",
"function",
"to",
"evaluate",
"the",
"state",
"functions",
"of",
"vuex",
"modules"
] | 9d0513ecbd7f56ab082ded01bb17a28ac4f72430 | https://github.com/spyfu/spyfu-vue-factory/blob/9d0513ecbd7f56ab082ded01bb17a28ac4f72430/dist/spyfu-vue-factory.esm.js#L289-L314 |
39,624 | spyfu/spyfu-vue-factory | dist/spyfu-vue-factory.esm.js | findModule | function findModule(store, namespace) {
return namespace.split('/').reduce(function (obj, key) {
// root modules will exist directly on the store
if (obj && obj[key]) {
return obj[key];
}
// child stores will exist in a modules object
if (obj && obj.modules && ob... | javascript | function findModule(store, namespace) {
return namespace.split('/').reduce(function (obj, key) {
// root modules will exist directly on the store
if (obj && obj[key]) {
return obj[key];
}
// child stores will exist in a modules object
if (obj && obj.modules && ob... | [
"function",
"findModule",
"(",
"store",
",",
"namespace",
")",
"{",
"return",
"namespace",
".",
"split",
"(",
"'/'",
")",
".",
"reduce",
"(",
"function",
"(",
"obj",
",",
"key",
")",
"{",
"// root modules will exist directly on the store",
"if",
"(",
"obj",
... | helper to find vuex modules via their namespace | [
"helper",
"to",
"find",
"vuex",
"modules",
"via",
"their",
"namespace"
] | 9d0513ecbd7f56ab082ded01bb17a28ac4f72430 | https://github.com/spyfu/spyfu-vue-factory/blob/9d0513ecbd7f56ab082ded01bb17a28ac4f72430/dist/spyfu-vue-factory.esm.js#L317-L333 |
39,625 | express-bem/express-bem | lib/view-lookup.js | patchView | function patchView (ExpressView, opts) {
var proto = ExpressView.prototype;
function View (name, options) {
options = options || {};
this.name = name;
this.root = options.root;
var engines = options.engines;
this.defaultEngine = options.defaultEngine;
var extensio... | javascript | function patchView (ExpressView, opts) {
var proto = ExpressView.prototype;
function View (name, options) {
options = options || {};
this.name = name;
this.root = options.root;
var engines = options.engines;
this.defaultEngine = options.defaultEngine;
var extensio... | [
"function",
"patchView",
"(",
"ExpressView",
",",
"opts",
")",
"{",
"var",
"proto",
"=",
"ExpressView",
".",
"prototype",
";",
"function",
"View",
"(",
"name",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"name... | Patches express view to lookup in another directories
@api
@param {Function} ExpressView
@param {{path: String, extensions: String[]|Function}} opts | [
"Patches",
"express",
"view",
"to",
"lookup",
"in",
"another",
"directories"
] | 6ea49e5ecdd8e949dd5051ecc5762e40cbcead9c | https://github.com/express-bem/express-bem/blob/6ea49e5ecdd8e949dd5051ecc5762e40cbcead9c/lib/view-lookup.js#L20-L59 |
39,626 | ofzza/enTT | dist/ext/validation.js | ValidationExtension | function ValidationExtension() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$reject = _ref.reject,
reject = _ref$reject === undefined ? false : _ref$reject;
_classCallCheck(this, ValidationExtension);
// Store configuration
var _this = _possi... | javascript | function ValidationExtension() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$reject = _ref.reject,
reject = _ref$reject === undefined ? false : _ref$reject;
_classCallCheck(this, ValidationExtension);
// Store configuration
var _this = _possi... | [
"function",
"ValidationExtension",
"(",
")",
"{",
"var",
"_ref",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"{",
"}",
",",
"_ref$reject",
"=",
"_ref",
".",
"r... | Creates an instance of ValidationExtension.
@param {bool} reject If true, invalid values won't be assigned to the property
@memberof ValidationExtension | [
"Creates",
"an",
"instance",
"of",
"ValidationExtension",
"."
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/ext/validation.js#L48-L63 |
39,627 | ofzza/enTT | dist/ext/validation.js | validateProperties | function validateProperties(entity, properties, changedPropertyName, changedPropertyValue, currentPropertyValue) {
var _this2 = this;
// Validate default property values
_lodash2.default.forEach(properties, function (propertyConfiguration, propertyName) {
if (isValidationProperty(propertyConfiguration)) {
... | javascript | function validateProperties(entity, properties, changedPropertyName, changedPropertyValue, currentPropertyValue) {
var _this2 = this;
// Validate default property values
_lodash2.default.forEach(properties, function (propertyConfiguration, propertyName) {
if (isValidationProperty(propertyConfiguration)) {
... | [
"function",
"validateProperties",
"(",
"entity",
",",
"properties",
",",
"changedPropertyName",
",",
"changedPropertyValue",
",",
"currentPropertyValue",
")",
"{",
"var",
"_this2",
"=",
"this",
";",
"// Validate default property values",
"_lodash2",
".",
"default",
".",... | Performs property validation and outputs results to errors object
@param {any} entity Entity instance
@param {any} properties Entity's properties' configuration
@param {any} changedPropertyName Name of the property being validated
@param {any} changedPropertyValue Value being validated
@param {any} currentPropertyValue... | [
"Performs",
"property",
"validation",
"and",
"outputs",
"results",
"to",
"errors",
"object"
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/ext/validation.js#L136-L165 |
39,628 | mongodb-js/precommit | index.js | resolve | function resolve(opts, done) {
debug('resolving paths for globs:\n', JSON.stringify(opts.globs));
var tasks = opts.globs.map(function(pattern) {
return function(cb) {
debug('resolving `%s`...', pattern);
glob(pattern, {}, function(err, files) {
if (err) {
return cb(err);
}
... | javascript | function resolve(opts, done) {
debug('resolving paths for globs:\n', JSON.stringify(opts.globs));
var tasks = opts.globs.map(function(pattern) {
return function(cb) {
debug('resolving `%s`...', pattern);
glob(pattern, {}, function(err, files) {
if (err) {
return cb(err);
}
... | [
"function",
"resolve",
"(",
"opts",
",",
"done",
")",
"{",
"debug",
"(",
"'resolving paths for globs:\\n'",
",",
"JSON",
".",
"stringify",
"(",
"opts",
".",
"globs",
")",
")",
";",
"var",
"tasks",
"=",
"opts",
".",
"globs",
".",
"map",
"(",
"function",
... | Expand globs into paths.
@param {Object} opts
@param {Function} done | [
"Expand",
"globs",
"into",
"paths",
"."
] | 28d7d6a972b57ce364aed6f21ba5d328199befff | https://github.com/mongodb-js/precommit/blob/28d7d6a972b57ce364aed6f21ba5d328199befff/index.js#L21-L47 |
39,629 | onechiporenko/eslint-plugin-ember-cleanup | lib/utils/node.js | getPropertyNamesInParentObjectExpression | function getPropertyNamesInParentObjectExpression(node) {
var objectExpression = obj.get(node, "parent.parent");
var ret = [];
if (!objectExpression) {
return ret;
}
objectExpression.properties.forEach(function (p) {
if (p.value !== node) {
ret.push(p.key.name);
}
});
return ret;
} | javascript | function getPropertyNamesInParentObjectExpression(node) {
var objectExpression = obj.get(node, "parent.parent");
var ret = [];
if (!objectExpression) {
return ret;
}
objectExpression.properties.forEach(function (p) {
if (p.value !== node) {
ret.push(p.key.name);
}
});
return ret;
} | [
"function",
"getPropertyNamesInParentObjectExpression",
"(",
"node",
")",
"{",
"var",
"objectExpression",
"=",
"obj",
".",
"get",
"(",
"node",
",",
"\"parent.parent\"",
")",
";",
"var",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"objectExpression",
")",
"{",... | Get list of all properties in the Object Expression node
Object - is a "grand parent" for the provided node
Result doesn't contain name of the `node` property
@param {ASTNode} node
@returns {string[]} | [
"Get",
"list",
"of",
"all",
"properties",
"in",
"the",
"Object",
"Expression",
"node",
"Object",
"-",
"is",
"a",
"grand",
"parent",
"for",
"the",
"provided",
"node",
"Result",
"doesn",
"t",
"contain",
"name",
"of",
"the",
"node",
"property"
] | 83618c6ba242d6349f4d724d793bb6e05f057b88 | https://github.com/onechiporenko/eslint-plugin-ember-cleanup/blob/83618c6ba242d6349f4d724d793bb6e05f057b88/lib/utils/node.js#L49-L61 |
39,630 | yoshuawuyts/wayfarer-to-server | index.js | toServer | function toServer (router) {
assert.equal(typeof router, 'function')
const syms = getOwnSymbols(router)
const sym = syms.length ? syms[0] : router._sym
assert.ok(sym, 'router should be an instance of wayfarer')
emit._subrouters = router._subrouters
emit._routes = router._routes
emit[sym] = true
emit.e... | javascript | function toServer (router) {
assert.equal(typeof router, 'function')
const syms = getOwnSymbols(router)
const sym = syms.length ? syms[0] : router._sym
assert.ok(sym, 'router should be an instance of wayfarer')
emit._subrouters = router._subrouters
emit._routes = router._routes
emit[sym] = true
emit.e... | [
"function",
"toServer",
"(",
"router",
")",
"{",
"assert",
".",
"equal",
"(",
"typeof",
"router",
",",
"'function'",
")",
"const",
"syms",
"=",
"getOwnSymbols",
"(",
"router",
")",
"const",
"sym",
"=",
"syms",
".",
"length",
"?",
"syms",
"[",
"0",
"]",... | wrap req, res, wayfarer to create new server obj -> obj | [
"wrap",
"req",
"res",
"wayfarer",
"to",
"create",
"new",
"server",
"obj",
"-",
">",
"obj"
] | 55df6e33111753e952b9655ac9ec8d38ad41c698 | https://github.com/yoshuawuyts/wayfarer-to-server/blob/55df6e33111753e952b9655ac9ec8d38ad41c698/index.js#L12-L77 |
39,631 | ply-ct/ply | lib/retrieval.js | function(location, name) {
this.location = location;
this.name = name;
if (this.isUrl(location)) {
if (this.name)
this.name = require('sanitize-filename')(this.name, {replacement: '_'});
if (typeof window === 'undefined')
this.request = require('request').defaults({headers: {'User... | javascript | function(location, name) {
this.location = location;
this.name = name;
if (this.isUrl(location)) {
if (this.name)
this.name = require('sanitize-filename')(this.name, {replacement: '_'});
if (typeof window === 'undefined')
this.request = require('request').defaults({headers: {'User... | [
"function",
"(",
"location",
",",
"name",
")",
"{",
"this",
".",
"location",
"=",
"location",
";",
"this",
".",
"name",
"=",
"name",
";",
"if",
"(",
"this",
".",
"isUrl",
"(",
"location",
")",
")",
"{",
"if",
"(",
"this",
".",
"name",
")",
"this"... | Abstraction that uses either URL retrieval or storage. name is optional | [
"Abstraction",
"that",
"uses",
"either",
"URL",
"retrieval",
"or",
"storage",
".",
"name",
"is",
"optional"
] | 1d4146829845fedd917f5f0626cd74cc3845d0c8 | https://github.com/ply-ct/ply/blob/1d4146829845fedd917f5f0626cd74cc3845d0c8/lib/retrieval.js#L8-L28 | |
39,632 | janus-toendering/options-parser | src/parser.js | function(opts, argv, error)
{
var parser = new Parser(opts, argv, error);
return parser.parse();
} | javascript | function(opts, argv, error)
{
var parser = new Parser(opts, argv, error);
return parser.parse();
} | [
"function",
"(",
"opts",
",",
"argv",
",",
"error",
")",
"{",
"var",
"parser",
"=",
"new",
"Parser",
"(",
"opts",
",",
"argv",
",",
"error",
")",
";",
"return",
"parser",
".",
"parse",
"(",
")",
";",
"}"
] | Parses command-line arguments
@param {object} opts
@param {Array} argv argument array
@param {Function} error callback handler for missing options etc (default: throw exception)
@returns {{opt: {}, args: Array}} | [
"Parses",
"command",
"-",
"line",
"arguments"
] | f1e39aac203f26e7e4e67fadba63c8dce1c7d70e | https://github.com/janus-toendering/options-parser/blob/f1e39aac203f26e7e4e67fadba63c8dce1c7d70e/src/parser.js#L195-L199 | |
39,633 | cflynn07/power-radix | lib/index.js | PowerRadix | function PowerRadix (digits, sourceRadix) {
sourceRadix = Array.isArray(sourceRadix) ? sourceRadix : B62.slice(0, sourceRadix);
this._digits = Array.isArray(digits) ? digits : (digits+'').split('');
this._sourceRadixLength = new BigInt(sourceRadix.length+'');
this._sourceRadixMap = sourceRadix.reduce(function (... | javascript | function PowerRadix (digits, sourceRadix) {
sourceRadix = Array.isArray(sourceRadix) ? sourceRadix : B62.slice(0, sourceRadix);
this._digits = Array.isArray(digits) ? digits : (digits+'').split('');
this._sourceRadixLength = new BigInt(sourceRadix.length+'');
this._sourceRadixMap = sourceRadix.reduce(function (... | [
"function",
"PowerRadix",
"(",
"digits",
",",
"sourceRadix",
")",
"{",
"sourceRadix",
"=",
"Array",
".",
"isArray",
"(",
"sourceRadix",
")",
"?",
"sourceRadix",
":",
"B62",
".",
"slice",
"(",
"0",
",",
"sourceRadix",
")",
";",
"this",
".",
"_digits",
"="... | Creates a new instance of PowerRadix
@class
@throws {InvalidArgumentException}
@param {Array|String} digits
@param {Array|Number} sourceRadix | [
"Creates",
"a",
"new",
"instance",
"of",
"PowerRadix"
] | 90a800fce273a8281ba3c784bde026826aab29ce | https://github.com/cflynn07/power-radix/blob/90a800fce273a8281ba3c784bde026826aab29ce/lib/index.js#L31-L39 |
39,634 | quase/quasejs | .pnp.js | makeError | function makeError(code, message, data = {}) {
const error = new Error(message);
return Object.assign(error, {code, data});
} | javascript | function makeError(code, message, data = {}) {
const error = new Error(message);
return Object.assign(error, {code, data});
} | [
"function",
"makeError",
"(",
"code",
",",
"message",
",",
"data",
"=",
"{",
"}",
")",
"{",
"const",
"error",
"=",
"new",
"Error",
"(",
"message",
")",
";",
"return",
"Object",
".",
"assign",
"(",
"error",
",",
"{",
"code",
",",
"data",
"}",
")",
... | Simple helper function that assign an error code to an error, so that it can more easily be caught and used
by third-parties. | [
"Simple",
"helper",
"function",
"that",
"assign",
"an",
"error",
"code",
"to",
"an",
"error",
"so",
"that",
"it",
"can",
"more",
"easily",
"be",
"caught",
"and",
"used",
"by",
"third",
"-",
"parties",
"."
] | a8f46d6648db13abf30bbb4800fe63b25e49e1b3 | https://github.com/quase/quasejs/blob/a8f46d6648db13abf30bbb4800fe63b25e49e1b3/.pnp.js#L54-L57 |
39,635 | quase/quasejs | .pnp.js | getIssuerModule | function getIssuerModule(parent) {
let issuer = parent;
while (issuer && (issuer.id === '[eval]' || issuer.id === '<repl>' || !issuer.filename)) {
issuer = issuer.parent;
}
return issuer;
} | javascript | function getIssuerModule(parent) {
let issuer = parent;
while (issuer && (issuer.id === '[eval]' || issuer.id === '<repl>' || !issuer.filename)) {
issuer = issuer.parent;
}
return issuer;
} | [
"function",
"getIssuerModule",
"(",
"parent",
")",
"{",
"let",
"issuer",
"=",
"parent",
";",
"while",
"(",
"issuer",
"&&",
"(",
"issuer",
".",
"id",
"===",
"'[eval]'",
"||",
"issuer",
".",
"id",
"===",
"'<repl>'",
"||",
"!",
"issuer",
".",
"filename",
... | Returns the module that should be used to resolve require calls. It's usually the direct parent, except if we're
inside an eval expression. | [
"Returns",
"the",
"module",
"that",
"should",
"be",
"used",
"to",
"resolve",
"require",
"calls",
".",
"It",
"s",
"usually",
"the",
"direct",
"parent",
"except",
"if",
"we",
"re",
"inside",
"an",
"eval",
"expression",
"."
] | a8f46d6648db13abf30bbb4800fe63b25e49e1b3 | https://github.com/quase/quasejs/blob/a8f46d6648db13abf30bbb4800fe63b25e49e1b3/.pnp.js#L12567-L12575 |
39,636 | quase/quasejs | .pnp.js | applyNodeExtensionResolution | function applyNodeExtensionResolution(unqualifiedPath, {extensions}) {
// We use this "infinite while" so that we can restart the process as long as we hit package folders
while (true) {
let stat;
try {
stat = statSync(unqualifiedPath);
} catch (error) {}
// If the file exists and is a file,... | javascript | function applyNodeExtensionResolution(unqualifiedPath, {extensions}) {
// We use this "infinite while" so that we can restart the process as long as we hit package folders
while (true) {
let stat;
try {
stat = statSync(unqualifiedPath);
} catch (error) {}
// If the file exists and is a file,... | [
"function",
"applyNodeExtensionResolution",
"(",
"unqualifiedPath",
",",
"{",
"extensions",
"}",
")",
"{",
"// We use this \"infinite while\" so that we can restart the process as long as we hit package folders",
"while",
"(",
"true",
")",
"{",
"let",
"stat",
";",
"try",
"{",... | Implements the node resolution for folder access and extension selection | [
"Implements",
"the",
"node",
"resolution",
"for",
"folder",
"access",
"and",
"extension",
"selection"
] | a8f46d6648db13abf30bbb4800fe63b25e49e1b3 | https://github.com/quase/quasejs/blob/a8f46d6648db13abf30bbb4800fe63b25e49e1b3/.pnp.js#L12598-L12689 |
39,637 | quase/quasejs | .pnp.js | normalizePath | function normalizePath(fsPath) {
fsPath = path.normalize(fsPath);
if (process.platform === 'win32') {
fsPath = fsPath.replace(backwardSlashRegExp, '/');
}
return fsPath;
} | javascript | function normalizePath(fsPath) {
fsPath = path.normalize(fsPath);
if (process.platform === 'win32') {
fsPath = fsPath.replace(backwardSlashRegExp, '/');
}
return fsPath;
} | [
"function",
"normalizePath",
"(",
"fsPath",
")",
"{",
"fsPath",
"=",
"path",
".",
"normalize",
"(",
"fsPath",
")",
";",
"if",
"(",
"process",
".",
"platform",
"===",
"'win32'",
")",
"{",
"fsPath",
"=",
"fsPath",
".",
"replace",
"(",
"backwardSlashRegExp",
... | Normalize path to posix format. | [
"Normalize",
"path",
"to",
"posix",
"format",
"."
] | a8f46d6648db13abf30bbb4800fe63b25e49e1b3 | https://github.com/quase/quasejs/blob/a8f46d6648db13abf30bbb4800fe63b25e49e1b3/.pnp.js#L12711-L12719 |
39,638 | intesso/connect-locale | server.js | cleanupArray | function cleanupArray(obj, name) {
var arr = obj[name];
if (!arr) throw new Error(name + ' option is missing');
if (Array.isArray(arr)) {
arr = arr.join(',');
}
if (typeof arr !== 'string') throw new Error(name + ' option must be an Array or a comma separated String');
arr = arr.replace(/_... | javascript | function cleanupArray(obj, name) {
var arr = obj[name];
if (!arr) throw new Error(name + ' option is missing');
if (Array.isArray(arr)) {
arr = arr.join(',');
}
if (typeof arr !== 'string') throw new Error(name + ' option must be an Array or a comma separated String');
arr = arr.replace(/_... | [
"function",
"cleanupArray",
"(",
"obj",
",",
"name",
")",
"{",
"var",
"arr",
"=",
"obj",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"arr",
")",
"throw",
"new",
"Error",
"(",
"name",
"+",
"' option is missing'",
")",
";",
"if",
"(",
"Array",
".",
"isArr... | helper function to trim, lowerCase the comma separated string or array | [
"helper",
"function",
"to",
"trim",
"lowerCase",
"the",
"comma",
"separated",
"string",
"or",
"array"
] | 87e08bfe30f98b7cac8333f86cddecfb7161d67e | https://github.com/intesso/connect-locale/blob/87e08bfe30f98b7cac8333f86cddecfb7161d67e/server.js#L51-L60 |
39,639 | intesso/connect-locale | server.js | matchLocale | function matchLocale(locale) {
var found = false;
if (!locale) return false;
locale = locale.replace(/_/g, '-').toLowerCase();
if (localesLookup[locale]) return localesLookup[locale];
if (options.matchSubTags) {
while (~locale.indexOf('-')) {
var index = locale.lastIndexOf('-');
... | javascript | function matchLocale(locale) {
var found = false;
if (!locale) return false;
locale = locale.replace(/_/g, '-').toLowerCase();
if (localesLookup[locale]) return localesLookup[locale];
if (options.matchSubTags) {
while (~locale.indexOf('-')) {
var index = locale.lastIndexOf('-');
... | [
"function",
"matchLocale",
"(",
"locale",
")",
"{",
"var",
"found",
"=",
"false",
";",
"if",
"(",
"!",
"locale",
")",
"return",
"false",
";",
"locale",
"=",
"locale",
".",
"replace",
"(",
"/",
"_",
"/",
"g",
",",
"'-'",
")",
".",
"toLowerCase",
"("... | helper function to detect locale or sublocale | [
"helper",
"function",
"to",
"detect",
"locale",
"or",
"sublocale"
] | 87e08bfe30f98b7cac8333f86cddecfb7161d67e | https://github.com/intesso/connect-locale/blob/87e08bfe30f98b7cac8333f86cddecfb7161d67e/server.js#L64-L80 |
39,640 | crcn/bindable.js | lib/collection/index.js | BindableCollection | function BindableCollection (source) {
BindableObject.call(this, this);
this.source = source || [];
this._updateInfo();
this.bind("source", _.bind(this._onSourceChange, this));
} | javascript | function BindableCollection (source) {
BindableObject.call(this, this);
this.source = source || [];
this._updateInfo();
this.bind("source", _.bind(this._onSourceChange, this));
} | [
"function",
"BindableCollection",
"(",
"source",
")",
"{",
"BindableObject",
".",
"call",
"(",
"this",
",",
"this",
")",
";",
"this",
".",
"source",
"=",
"source",
"||",
"[",
"]",
";",
"this",
".",
"_updateInfo",
"(",
")",
";",
"this",
".",
"bind",
"... | Emitted when an item is removed
@event remove
@param {Object} item removed
Emitted when items are replaced
@event replace
@param {Array} newItems
@param {Array} oldItems | [
"Emitted",
"when",
"an",
"item",
"is",
"removed"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/collection/index.js#L39-L44 |
39,641 | crcn/bindable.js | lib/collection/index.js | function () {
var items = Array.prototype.slice.call(arguments);
this.source.push.apply(this.source, items);
this._updateInfo();
// DEPRECATED
this.emit("insert", items[0], this.length - 1);
this.emit("update", { insert: items, index: this.length - 1});
} | javascript | function () {
var items = Array.prototype.slice.call(arguments);
this.source.push.apply(this.source, items);
this._updateInfo();
// DEPRECATED
this.emit("insert", items[0], this.length - 1);
this.emit("update", { insert: items, index: this.length - 1});
} | [
"function",
"(",
")",
"{",
"var",
"items",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
";",
"this",
".",
"source",
".",
"push",
".",
"apply",
"(",
"this",
".",
"source",
",",
"items",
")",
";",
"this",
".",
"... | Pushes an item onto the collection
@method push
@param {Object} item | [
"Pushes",
"an",
"item",
"onto",
"the",
"collection"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/collection/index.js#L142-L150 | |
39,642 | crcn/bindable.js | lib/collection/index.js | function () {
var items = Array.prototype.slice.call(arguments);
this.source.unshift.apply(this.source, items);
this._updateInfo();
// DEPRECATED
this.emit("insert", items[0], 0);
this.emit("update", { insert: items });
} | javascript | function () {
var items = Array.prototype.slice.call(arguments);
this.source.unshift.apply(this.source, items);
this._updateInfo();
// DEPRECATED
this.emit("insert", items[0], 0);
this.emit("update", { insert: items });
} | [
"function",
"(",
")",
"{",
"var",
"items",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
";",
"this",
".",
"source",
".",
"unshift",
".",
"apply",
"(",
"this",
".",
"source",
",",
"items",
")",
";",
"this",
".",
... | Unshifts an item onto the collection
@method unshift
@param {Object} item | [
"Unshifts",
"an",
"item",
"onto",
"the",
"collection"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/collection/index.js#L158-L167 | |
39,643 | crcn/bindable.js | lib/collection/index.js | function (index, count) {
var newItems = Array.prototype.slice.call(arguments, 2),
oldItems = this.source.splice.apply(this.source, arguments);
this._updateInfo();
// DEPRECATED
this.emit("replace", newItems, oldItems, index);
this.emit("update", { insert: newItems, remove: oldItems });
... | javascript | function (index, count) {
var newItems = Array.prototype.slice.call(arguments, 2),
oldItems = this.source.splice.apply(this.source, arguments);
this._updateInfo();
// DEPRECATED
this.emit("replace", newItems, oldItems, index);
this.emit("update", { insert: newItems, remove: oldItems });
... | [
"function",
"(",
"index",
",",
"count",
")",
"{",
"var",
"newItems",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"2",
")",
",",
"oldItems",
"=",
"this",
".",
"source",
".",
"splice",
".",
"apply",
"(",
"this",
... | Removes N Number of items
@method splice
@param {Number} index start index
@param {Number} count number of items to remove | [
"Removes",
"N",
"Number",
"of",
"items"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/collection/index.js#L176-L185 | |
39,644 | crcn/bindable.js | lib/collection/index.js | function (item) {
var i = this.indexOf(item);
if (!~i) return false;
this.source.splice(i, 1);
this._updateInfo();
this.emit("remove", item, i);
this.emit("update", { remove: [item] });
return item;
} | javascript | function (item) {
var i = this.indexOf(item);
if (!~i) return false;
this.source.splice(i, 1);
this._updateInfo();
this.emit("remove", item, i);
this.emit("update", { remove: [item] });
return item;
} | [
"function",
"(",
"item",
")",
"{",
"var",
"i",
"=",
"this",
".",
"indexOf",
"(",
"item",
")",
";",
"if",
"(",
"!",
"~",
"i",
")",
"return",
"false",
";",
"this",
".",
"source",
".",
"splice",
"(",
"i",
",",
"1",
")",
";",
"this",
".",
"_updat... | Removes an item from the collection
@method remove
@param {Object} item item to remove | [
"Removes",
"an",
"item",
"from",
"the",
"collection"
] | 562dcd4a0e208e2a11ac7613654b32b01c7d92ac | https://github.com/crcn/bindable.js/blob/562dcd4a0e208e2a11ac7613654b32b01c7d92ac/lib/collection/index.js#L193-L202 | |
39,645 | techninja/robopaint-mode-example | example.js | paperLoadedInit | function paperLoadedInit() {
console.log('Paper ready!');
// Set center adjusters based on size of canvas
$('#hcenter').attr({
value: 0,
min: -(robopaint.canvas.width / 2),
max: robopaint.canvas.width / 2
});
$('#vcenter').attr({
value: 0,
min: -(robopaint.canvas.height / 2),
max: ro... | javascript | function paperLoadedInit() {
console.log('Paper ready!');
// Set center adjusters based on size of canvas
$('#hcenter').attr({
value: 0,
min: -(robopaint.canvas.width / 2),
max: robopaint.canvas.width / 2
});
$('#vcenter').attr({
value: 0,
min: -(robopaint.canvas.height / 2),
max: ro... | [
"function",
"paperLoadedInit",
"(",
")",
"{",
"console",
".",
"log",
"(",
"'Paper ready!'",
")",
";",
"// Set center adjusters based on size of canvas",
"$",
"(",
"'#hcenter'",
")",
".",
"attr",
"(",
"{",
"value",
":",
"0",
",",
"min",
":",
"-",
"(",
"robopa... | Callback that tells us that our Paper.js canvas is ready! | [
"Callback",
"that",
"tells",
"us",
"that",
"our",
"Paper",
".",
"js",
"canvas",
"is",
"ready!"
] | 9af42cbe3e27f404185b812c0a91d8a354ba970b | https://github.com/techninja/robopaint-mode-example/blob/9af42cbe3e27f404185b812c0a91d8a354ba970b/example.js#L36-L60 |
39,646 | smbape/node-umd-builder | lib/appenders/file.js | fileAppender | function fileAppender(config, layout) {
const appender = new FileAppender(config, layout);
// push file to the stack of open handlers
appenderList.push(appender);
return appender.write;
} | javascript | function fileAppender(config, layout) {
const appender = new FileAppender(config, layout);
// push file to the stack of open handlers
appenderList.push(appender);
return appender.write;
} | [
"function",
"fileAppender",
"(",
"config",
",",
"layout",
")",
"{",
"const",
"appender",
"=",
"new",
"FileAppender",
"(",
"config",
",",
"layout",
")",
";",
"// push file to the stack of open handlers",
"appenderList",
".",
"push",
"(",
"appender",
")",
";",
"re... | File Appender writing the logs to a text file. Supports rolling of logs by size.
@param file file log messages will be written to
@param layout a function that takes a logevent and returns a string * (defaults to basicLayout).
@param logSize - the maximum size (in bytes) for a log file, * if not provided then logs... | [
"File",
"Appender",
"writing",
"the",
"logs",
"to",
"a",
"text",
"file",
".",
"Supports",
"rolling",
"of",
"logs",
"by",
"size",
"."
] | 73b03e8c985f2660948f5df71140e4a8fb162549 | https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/lib/appenders/file.js#L29-L36 |
39,647 | S3bb1/ah-dashboard-plugin | public/dashboard/app/angular-ui-dashboard.js | function (widgets) {
if (!this.storage) {
return true;
}
var serialized = _.map(widgets, function (widget) {
var widgetObject = {
title: widget.title,
name: widget.name,
style: widget.style,
dataModelOptions:... | javascript | function (widgets) {
if (!this.storage) {
return true;
}
var serialized = _.map(widgets, function (widget) {
var widgetObject = {
title: widget.title,
name: widget.name,
style: widget.style,
dataModelOptions:... | [
"function",
"(",
"widgets",
")",
"{",
"if",
"(",
"!",
"this",
".",
"storage",
")",
"{",
"return",
"true",
";",
"}",
"var",
"serialized",
"=",
"_",
".",
"map",
"(",
"widgets",
",",
"function",
"(",
"widget",
")",
"{",
"var",
"widgetObject",
"=",
"{"... | Takes array of widget instance objects, serializes,
and saves state.
@param {Array} widgets scope.widgets from dashboard directive
@return {Boolean} true on success, false on failure | [
"Takes",
"array",
"of",
"widget",
"instance",
"objects",
"serializes",
"and",
"saves",
"state",
"."
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/app/angular-ui-dashboard.js#L786-L813 | |
39,648 | S3bb1/ah-dashboard-plugin | public/dashboard/app/angular-ui-dashboard.js | function () {
if (!this.storage) {
return null;
}
var serialized;
// try loading storage item
serialized = this.storage.getItem(this.id);
if (serialized) {
// check for promise
if (typeof serialized === 'object' && typeo... | javascript | function () {
if (!this.storage) {
return null;
}
var serialized;
// try loading storage item
serialized = this.storage.getItem(this.id);
if (serialized) {
// check for promise
if (typeof serialized === 'object' && typeo... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"storage",
")",
"{",
"return",
"null",
";",
"}",
"var",
"serialized",
";",
"// try loading storage item",
"serialized",
"=",
"this",
".",
"storage",
".",
"getItem",
"(",
"this",
".",
"id",
")",
";... | Loads dashboard state from the storage object.
Can handle a synchronous response or a promise.
@return {Array|Promise} Array of widget definitions or a promise | [
"Loads",
"dashboard",
"state",
"from",
"the",
"storage",
"object",
".",
"Can",
"handle",
"a",
"synchronous",
"response",
"or",
"a",
"promise",
"."
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/app/angular-ui-dashboard.js#L821-L842 | |
39,649 | S3bb1/ah-dashboard-plugin | public/dashboard/app/angular-ui-dashboard.js | WidgetModel | function WidgetModel(Class, overrides) {
var defaults = {
title: 'Widget',
name: Class.name,
attrs: Class.attrs,
dataAttrName: Class.dataAttrName,
dataModelType: Class.dataModelType,
dataModelArgs: Class.dataModelArgs, // used in data model constructor... | javascript | function WidgetModel(Class, overrides) {
var defaults = {
title: 'Widget',
name: Class.name,
attrs: Class.attrs,
dataAttrName: Class.dataAttrName,
dataModelType: Class.dataModelType,
dataModelArgs: Class.dataModelArgs, // used in data model constructor... | [
"function",
"WidgetModel",
"(",
"Class",
",",
"overrides",
")",
"{",
"var",
"defaults",
"=",
"{",
"title",
":",
"'Widget'",
",",
"name",
":",
"Class",
".",
"name",
",",
"attrs",
":",
"Class",
".",
"attrs",
",",
"dataAttrName",
":",
"Class",
".",
"dataA... | constructor for widget model instances | [
"constructor",
"for",
"widget",
"model",
"instances"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/app/angular-ui-dashboard.js#L1044-L1072 |
39,650 | S3bb1/ah-dashboard-plugin | public/dashboard/app/angular-ui-dashboard.js | function (e) {
var curX = e.clientX;
var pixelChange = curX - initX;
var newWidth = pixelWidth + pixelChange;
$marquee.css('width', newWidth + 'px');
} | javascript | function (e) {
var curX = e.clientX;
var pixelChange = curX - initX;
var newWidth = pixelWidth + pixelChange;
$marquee.css('width', newWidth + 'px');
} | [
"function",
"(",
"e",
")",
"{",
"var",
"curX",
"=",
"e",
".",
"clientX",
";",
"var",
"pixelChange",
"=",
"curX",
"-",
"initX",
";",
"var",
"newWidth",
"=",
"pixelWidth",
"+",
"pixelChange",
";",
"$marquee",
".",
"css",
"(",
"'width'",
",",
"newWidth",
... | updates marquee with preview of new width | [
"updates",
"marquee",
"with",
"preview",
"of",
"new",
"width"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/app/angular-ui-dashboard.js#L1234-L1239 | |
39,651 | S3bb1/ah-dashboard-plugin | public/dashboard/app/angular-ui-dashboard.js | function (e) {
// remove listener and marquee
jQuery($window).off('mousemove', mousemove);
$marquee.remove();
// calculate change in units
var curX = e.clientX;
var pixelChange = curX - initX;
var unitChange = Math.round(pixelChange * transformMulti... | javascript | function (e) {
// remove listener and marquee
jQuery($window).off('mousemove', mousemove);
$marquee.remove();
// calculate change in units
var curX = e.clientX;
var pixelChange = curX - initX;
var unitChange = Math.round(pixelChange * transformMulti... | [
"function",
"(",
"e",
")",
"{",
"// remove listener and marquee",
"jQuery",
"(",
"$window",
")",
".",
"off",
"(",
"'mousemove'",
",",
"mousemove",
")",
";",
"$marquee",
".",
"remove",
"(",
")",
";",
"// calculate change in units",
"var",
"curX",
"=",
"e",
".... | sets new widget width on mouseup | [
"sets",
"new",
"widget",
"width",
"on",
"mouseup"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/app/angular-ui-dashboard.js#L1242-L1257 | |
39,652 | techninja/robopaint-mode-example | example.ps.js | onMouseMove | function onMouseMove(event) {
project.deselectAll();
if (event.item) {
event.item.selected = true;
}
} | javascript | function onMouseMove(event) {
project.deselectAll();
if (event.item) {
event.item.selected = true;
}
} | [
"function",
"onMouseMove",
"(",
"event",
")",
"{",
"project",
".",
"deselectAll",
"(",
")",
";",
"if",
"(",
"event",
".",
"item",
")",
"{",
"event",
".",
"item",
".",
"selected",
"=",
"true",
";",
"}",
"}"
] | Show preview paths | [
"Show",
"preview",
"paths"
] | 9af42cbe3e27f404185b812c0a91d8a354ba970b | https://github.com/techninja/robopaint-mode-example/blob/9af42cbe3e27f404185b812c0a91d8a354ba970b/example.ps.js#L24-L30 |
39,653 | bigpipe/backtrace | index.js | Stack | function Stack(trace, options) {
if (!(this instanceof Stack)) return new Stack(trace, options);
if ('object' === typeof trace && !trace.length) {
options = trace;
trace = null;
}
options = options || {};
options.guess = 'guess' in options ? options.guess : true;
if (!trace) {
var imp = new s... | javascript | function Stack(trace, options) {
if (!(this instanceof Stack)) return new Stack(trace, options);
if ('object' === typeof trace && !trace.length) {
options = trace;
trace = null;
}
options = options || {};
options.guess = 'guess' in options ? options.guess : true;
if (!trace) {
var imp = new s... | [
"function",
"Stack",
"(",
"trace",
",",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Stack",
")",
")",
"return",
"new",
"Stack",
"(",
"trace",
",",
"options",
")",
";",
"if",
"(",
"'object'",
"===",
"typeof",
"trace",
"&&",
"!",
... | Representation of a stack trace.
Options:
- **guess**: Guess the names of anonymous functions.
@constructor
@param {Array} trace Array of traces.
@param {Object} err
@api private | [
"Representation",
"of",
"a",
"stack",
"trace",
"."
] | f9a5dfda5574d4660769d8dfa0ed2c491313837a | https://github.com/bigpipe/backtrace/blob/f9a5dfda5574d4660769d8dfa0ed2c491313837a/index.js#L17-L38 |
39,654 | markfinger/cyclic-dependency-graph | src/graph.js | traceFromNode | function traceFromNode(name) {
const job = {
node: name,
isValid: true
};
invalidatePendingJobsForNode(pendingJobs, name);
// Ensure the job can be tracked
pendingJobs.push(job);
// Force an asynchronous start to the tracing so that other parts of a
// codebase can synchronous... | javascript | function traceFromNode(name) {
const job = {
node: name,
isValid: true
};
invalidatePendingJobsForNode(pendingJobs, name);
// Ensure the job can be tracked
pendingJobs.push(job);
// Force an asynchronous start to the tracing so that other parts of a
// codebase can synchronous... | [
"function",
"traceFromNode",
"(",
"name",
")",
"{",
"const",
"job",
"=",
"{",
"node",
":",
"name",
",",
"isValid",
":",
"true",
"}",
";",
"invalidatePendingJobsForNode",
"(",
"pendingJobs",
",",
"name",
")",
";",
"// Ensure the job can be tracked",
"pendingJobs"... | Invoke the specified `getDependencies` function and build the
graph by recursively traversing unknown nodes
@param {String} name | [
"Invoke",
"the",
"specified",
"getDependencies",
"function",
"and",
"build",
"the",
"graph",
"by",
"recursively",
"traversing",
"unknown",
"nodes"
] | fac9249ec3a9d29199bed9fedcf99267b2c61c44 | https://github.com/markfinger/cyclic-dependency-graph/blob/fac9249ec3a9d29199bed9fedcf99267b2c61c44/src/graph.js#L56-L158 |
39,655 | markfinger/cyclic-dependency-graph | src/graph.js | pruneNode | function pruneNode(name) {
const previousState = state;
// If the node is still pending, invalidate the associated job so
// that it becomes a no-op
if (isNodePending(pendingJobs, name)) {
invalidatePendingJobsForNode(pendingJobs, name);
}
if (isNodeDefined(state, name)) {
let upda... | javascript | function pruneNode(name) {
const previousState = state;
// If the node is still pending, invalidate the associated job so
// that it becomes a no-op
if (isNodePending(pendingJobs, name)) {
invalidatePendingJobsForNode(pendingJobs, name);
}
if (isNodeDefined(state, name)) {
let upda... | [
"function",
"pruneNode",
"(",
"name",
")",
"{",
"const",
"previousState",
"=",
"state",
";",
"// If the node is still pending, invalidate the associated job so",
"// that it becomes a no-op",
"if",
"(",
"isNodePending",
"(",
"pendingJobs",
",",
"name",
")",
")",
"{",
"i... | Removes a node and its edges from the graph. Any pending jobs for the
node will be invalidated.
Be aware that pruning a single node may leave other nodes disconnected
from an entry node. You may want to call `pruneDisconnectedNodes` to
clean the graph of unwanted dependencies.
@param {String} name
@returns {Diff} | [
"Removes",
"a",
"node",
"and",
"its",
"edges",
"from",
"the",
"graph",
".",
"Any",
"pending",
"jobs",
"for",
"the",
"node",
"will",
"be",
"invalidated",
"."
] | fac9249ec3a9d29199bed9fedcf99267b2c61c44 | https://github.com/markfinger/cyclic-dependency-graph/blob/fac9249ec3a9d29199bed9fedcf99267b2c61c44/src/graph.js#L171-L204 |
39,656 | markfinger/cyclic-dependency-graph | src/graph.js | pruneDisconnectedNodes | function pruneDisconnectedNodes() {
const previousState = state;
const disconnected = findNodesDisconnectedFromEntryNodes(state);
let updatedState = previousState;
disconnected.forEach(name => {
if (updatedState.has(name)) {
const data = pruneNodeAndUniqueDependencies(updatedState, name)... | javascript | function pruneDisconnectedNodes() {
const previousState = state;
const disconnected = findNodesDisconnectedFromEntryNodes(state);
let updatedState = previousState;
disconnected.forEach(name => {
if (updatedState.has(name)) {
const data = pruneNodeAndUniqueDependencies(updatedState, name)... | [
"function",
"pruneDisconnectedNodes",
"(",
")",
"{",
"const",
"previousState",
"=",
"state",
";",
"const",
"disconnected",
"=",
"findNodesDisconnectedFromEntryNodes",
"(",
"state",
")",
";",
"let",
"updatedState",
"=",
"previousState",
";",
"disconnected",
".",
"for... | There are edge-cases where particular circular graphs may not have
been pruned completely, so we may still be persisting references to
nodes which are disconnected to the entry nodes.
An easy example of a situation that can cause this is a tournament.
https://en.wikipedia.org/wiki/Tournament_(graph_theory)
To get aro... | [
"There",
"are",
"edge",
"-",
"cases",
"where",
"particular",
"circular",
"graphs",
"may",
"not",
"have",
"been",
"pruned",
"completely",
"so",
"we",
"may",
"still",
"be",
"persisting",
"references",
"to",
"nodes",
"which",
"are",
"disconnected",
"to",
"the",
... | fac9249ec3a9d29199bed9fedcf99267b2c61c44 | https://github.com/markfinger/cyclic-dependency-graph/blob/fac9249ec3a9d29199bed9fedcf99267b2c61c44/src/graph.js#L219-L237 |
39,657 | markfinger/cyclic-dependency-graph | src/graph.js | setNodeAsEntry | function setNodeAsEntry(name) {
const previousState = state;
if (!isNodeDefined(state, name)) {
state = addNode(state, name);
}
state = defineEntryNode(state, name);
return Diff({
from: previousState,
to: state
});
} | javascript | function setNodeAsEntry(name) {
const previousState = state;
if (!isNodeDefined(state, name)) {
state = addNode(state, name);
}
state = defineEntryNode(state, name);
return Diff({
from: previousState,
to: state
});
} | [
"function",
"setNodeAsEntry",
"(",
"name",
")",
"{",
"const",
"previousState",
"=",
"state",
";",
"if",
"(",
"!",
"isNodeDefined",
"(",
"state",
",",
"name",
")",
")",
"{",
"state",
"=",
"addNode",
"(",
"state",
",",
"name",
")",
";",
"}",
"state",
"... | Dependency graphs emerge from one or more entry nodes. The ability to
distinguish an entry node from a normal dependency node allows us to
aggressively prune a node and all of its dependencies.
As a basic example of why the concept is important, if `a -> b -> c`
and we want to prune `b`, we know that we can safely pru... | [
"Dependency",
"graphs",
"emerge",
"from",
"one",
"or",
"more",
"entry",
"nodes",
".",
"The",
"ability",
"to",
"distinguish",
"an",
"entry",
"node",
"from",
"a",
"normal",
"dependency",
"node",
"allows",
"us",
"to",
"aggressively",
"prune",
"a",
"node",
"and"... | fac9249ec3a9d29199bed9fedcf99267b2c61c44 | https://github.com/markfinger/cyclic-dependency-graph/blob/fac9249ec3a9d29199bed9fedcf99267b2c61c44/src/graph.js#L264-L277 |
39,658 | Neil-G/redux-mastermind | lib/createUpdaterParts.js | processActionGroup | function processActionGroup(_ref2) {
var _ref2$updateSchemaNam = _ref2.updateSchemaName,
updateSchemaName = _ref2$updateSchemaNam === undefined ? undefined : _ref2$updateSchemaNam,
_ref2$store = _ref2.store,
store = _ref2$store === undefined ? _store : _ref2$store,
_ref2$error = _ref2.err... | javascript | function processActionGroup(_ref2) {
var _ref2$updateSchemaNam = _ref2.updateSchemaName,
updateSchemaName = _ref2$updateSchemaNam === undefined ? undefined : _ref2$updateSchemaNam,
_ref2$store = _ref2.store,
store = _ref2$store === undefined ? _store : _ref2$store,
_ref2$error = _ref2.err... | [
"function",
"processActionGroup",
"(",
"_ref2",
")",
"{",
"var",
"_ref2$updateSchemaNam",
"=",
"_ref2",
".",
"updateSchemaName",
",",
"updateSchemaName",
"=",
"_ref2$updateSchemaNam",
"===",
"undefined",
"?",
"undefined",
":",
"_ref2$updateSchemaNam",
",",
"_ref2$store"... | this will process an object full of actions | [
"this",
"will",
"process",
"an",
"object",
"full",
"of",
"actions"
] | 669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef | https://github.com/Neil-G/redux-mastermind/blob/669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef/lib/createUpdaterParts.js#L18-L94 |
39,659 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.mayan.js | function(year) {
var date = this._validate(year, this.minMonth, this.minDay, $.calendars.local.invalidYear);
year = date.year();
var baktun = Math.floor(year / 400);
year = year % 400;
year += (year < 0 ? 400 : 0);
var katun = Math.floor(year / 20);
return baktun + '.' + katun + '.' + (year % 20);
... | javascript | function(year) {
var date = this._validate(year, this.minMonth, this.minDay, $.calendars.local.invalidYear);
year = date.year();
var baktun = Math.floor(year / 400);
year = year % 400;
year += (year < 0 ? 400 : 0);
var katun = Math.floor(year / 20);
return baktun + '.' + katun + '.' + (year % 20);
... | [
"function",
"(",
"year",
")",
"{",
"var",
"date",
"=",
"this",
".",
"_validate",
"(",
"year",
",",
"this",
".",
"minMonth",
",",
"this",
".",
"minDay",
",",
"$",
".",
"calendars",
".",
"local",
".",
"invalidYear",
")",
";",
"year",
"=",
"date",
"."... | Format the year, if not a simple sequential number.
@memberof MayanCalendar
@param year {CDate|number} The date to format or the year to format.
@return {string} The formatted year.
@throws Error if an invalid year or a different calendar used. | [
"Format",
"the",
"year",
"if",
"not",
"a",
"simple",
"sequential",
"number",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.mayan.js#L96-L104 | |
39,660 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.mayan.js | function(years) {
years = years.split('.');
if (years.length < 3) {
throw 'Invalid Mayan year';
}
var year = 0;
for (var i = 0; i < years.length; i++) {
var y = parseInt(years[i], 10);
if (Math.abs(y) > 19 || (i > 0 && y < 0)) {
throw 'Invalid Mayan year';
}
year = year * 20 + y;... | javascript | function(years) {
years = years.split('.');
if (years.length < 3) {
throw 'Invalid Mayan year';
}
var year = 0;
for (var i = 0; i < years.length; i++) {
var y = parseInt(years[i], 10);
if (Math.abs(y) > 19 || (i > 0 && y < 0)) {
throw 'Invalid Mayan year';
}
year = year * 20 + y;... | [
"function",
"(",
"years",
")",
"{",
"years",
"=",
"years",
".",
"split",
"(",
"'.'",
")",
";",
"if",
"(",
"years",
".",
"length",
"<",
"3",
")",
"{",
"throw",
"'Invalid Mayan year'",
";",
"}",
"var",
"year",
"=",
"0",
";",
"for",
"(",
"var",
"i",... | Convert from the formatted year back to a single number.
@memberof MayanCalendar
@param years {string} The year as n.n.n.
@return {number} The sequential year.
@throws Error if an invalid value is supplied. | [
"Convert",
"from",
"the",
"formatted",
"year",
"back",
"to",
"a",
"single",
"number",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.mayan.js#L111-L125 | |
39,661 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.mayan.js | function(year, month, day) {
var date = this._validate(year, month, day, $.calendars.local.invalidDate);
var jd = date.toJD();
var haab = this._toHaab(jd);
var tzolkin = this._toTzolkin(jd);
return {haabMonthName: this.local.haabMonths[haab[0] - 1],
haabMonth: haab[0], haabDay: haab[1],
tzolkinDa... | javascript | function(year, month, day) {
var date = this._validate(year, month, day, $.calendars.local.invalidDate);
var jd = date.toJD();
var haab = this._toHaab(jd);
var tzolkin = this._toTzolkin(jd);
return {haabMonthName: this.local.haabMonths[haab[0] - 1],
haabMonth: haab[0], haabDay: haab[1],
tzolkinDa... | [
"function",
"(",
"year",
",",
"month",
",",
"day",
")",
"{",
"var",
"date",
"=",
"this",
".",
"_validate",
"(",
"year",
",",
"month",
",",
"day",
",",
"$",
".",
"calendars",
".",
"local",
".",
"invalidDate",
")",
";",
"var",
"jd",
"=",
"date",
".... | Retrieve additional information about a date - Haab and Tzolkin equivalents.
@memberof MayanCalendar
@param year {CDate|number} The date to examine or the year to examine.
@param [month] {number} The month to examine.
@param [day] {number} The day to examine.
@return {object} Additional information - contents depends o... | [
"Retrieve",
"additional",
"information",
"about",
"a",
"date",
"-",
"Haab",
"and",
"Tzolkin",
"equivalents",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.mayan.js#L208-L217 | |
39,662 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.mayan.js | function(jd) {
jd -= this.jdEpoch;
var day = mod(jd + 8 + ((18 - 1) * 20), 365);
return [Math.floor(day / 20) + 1, mod(day, 20)];
} | javascript | function(jd) {
jd -= this.jdEpoch;
var day = mod(jd + 8 + ((18 - 1) * 20), 365);
return [Math.floor(day / 20) + 1, mod(day, 20)];
} | [
"function",
"(",
"jd",
")",
"{",
"jd",
"-=",
"this",
".",
"jdEpoch",
";",
"var",
"day",
"=",
"mod",
"(",
"jd",
"+",
"8",
"+",
"(",
"(",
"18",
"-",
"1",
")",
"*",
"20",
")",
",",
"365",
")",
";",
"return",
"[",
"Math",
".",
"floor",
"(",
"... | Retrieve Haab date from a Julian date.
@memberof MayanCalendar
@private
@param jd {number} The Julian date.
@return {number[]} Corresponding Haab month and day. | [
"Retrieve",
"Haab",
"date",
"from",
"a",
"Julian",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.mayan.js#L224-L228 | |
39,663 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js | function ( source, dest )
{
var that = this;
if ( source.nodeName.toUpperCase() === "TR" || source.nodeName.toUpperCase() === "TH" ||
source.nodeName.toUpperCase() === "TD" || source.nodeName.toUpperCase() === "SPAN" )
{
dest.className = source.className;
}
$(source).children().each( function (i) {
... | javascript | function ( source, dest )
{
var that = this;
if ( source.nodeName.toUpperCase() === "TR" || source.nodeName.toUpperCase() === "TH" ||
source.nodeName.toUpperCase() === "TD" || source.nodeName.toUpperCase() === "SPAN" )
{
dest.className = source.className;
}
$(source).children().each( function (i) {
... | [
"function",
"(",
"source",
",",
"dest",
")",
"{",
"var",
"that",
"=",
"this",
";",
"if",
"(",
"source",
".",
"nodeName",
".",
"toUpperCase",
"(",
")",
"===",
"\"TR\"",
"||",
"source",
".",
"nodeName",
".",
"toUpperCase",
"(",
")",
"===",
"\"TH\"",
"|... | Copy the classes of all child nodes from one element to another. This implies
that the two have identical structure - no error checking is performed to that
fact.
@param {element} source Node to copy classes from
@param {element} dest Node to copy classes too | [
"Copy",
"the",
"classes",
"of",
"all",
"child",
"nodes",
"from",
"one",
"element",
"to",
"another",
".",
"This",
"implies",
"that",
"the",
"two",
"have",
"identical",
"structure",
"-",
"no",
"error",
"checking",
"is",
"performed",
"to",
"that",
"fact",
"."... | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js#L669-L682 | |
39,664 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js | function ( parent, original, clone )
{
var that = this;
var originals = $(parent +' tr', original);
var height;
$(parent+' tr', clone).each( function (k) {
height = originals.eq( k ).css('height');
// This is nasty :-(. IE has a sub-pixel error even when setting
// the height below (the Firefox fix)... | javascript | function ( parent, original, clone )
{
var that = this;
var originals = $(parent +' tr', original);
var height;
$(parent+' tr', clone).each( function (k) {
height = originals.eq( k ).css('height');
// This is nasty :-(. IE has a sub-pixel error even when setting
// the height below (the Firefox fix)... | [
"function",
"(",
"parent",
",",
"original",
",",
"clone",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"originals",
"=",
"$",
"(",
"parent",
"+",
"' tr'",
",",
"original",
")",
";",
"var",
"height",
";",
"$",
"(",
"parent",
"+",
"' tr'",
",",
... | Equalise the heights of the rows in a given table node in a cross browser way. Note that this
is more or less lifted as is from FixedColumns
@method fnEqualiseHeights
@returns void
@param {string} parent Node type - thead, tbody or tfoot
@param {element} original Original node to take the heights from
@param {el... | [
"Equalise",
"the",
"heights",
"of",
"the",
"rows",
"in",
"a",
"given",
"table",
"node",
"in",
"a",
"cross",
"browser",
"way",
".",
"Note",
"that",
"this",
"is",
"more",
"or",
"less",
"lifted",
"as",
"is",
"from",
"FixedColumns"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js#L894-L918 | |
39,665 | apigee-internal/rbac-abacus | npm/bizancio.js | getCollector | function getCollector() {
var collector = new Collector();
if (global['__coverage__']) {
collector.add(global['__coverage__']);
} else {
console.error('No global coverage found for the node process');
}
return collector;
} | javascript | function getCollector() {
var collector = new Collector();
if (global['__coverage__']) {
collector.add(global['__coverage__']);
} else {
console.error('No global coverage found for the node process');
}
return collector;
} | [
"function",
"getCollector",
"(",
")",
"{",
"var",
"collector",
"=",
"new",
"Collector",
"(",
")",
";",
"if",
"(",
"global",
"[",
"'__coverage__'",
"]",
")",
"{",
"collector",
".",
"add",
"(",
"global",
"[",
"'__coverage__'",
"]",
")",
";",
"}",
"else",... | returns the coverage collector, creating one and automatically
adding the contents of the global coverage object. You can use this method
in an exit handler to get the accumulated coverage. | [
"returns",
"the",
"coverage",
"collector",
"creating",
"one",
"and",
"automatically",
"adding",
"the",
"contents",
"of",
"the",
"global",
"coverage",
"object",
".",
"You",
"can",
"use",
"this",
"method",
"in",
"an",
"exit",
"handler",
"to",
"get",
"the",
"ac... | 6b3929194c0adf5adf3b9571fe0f25390c981f88 | https://github.com/apigee-internal/rbac-abacus/blob/6b3929194c0adf5adf3b9571fe0f25390c981f88/npm/bizancio.js#L33-L42 |
39,666 | smbape/node-umd-builder | lib/compilers/jst/template.js | template | function template(string, options, otherOptions) {
// Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
const settings = templateSettings;
if (otherOptions && isIterateeCall(string, options, o... | javascript | function template(string, options, otherOptions) {
// Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
// and Laura Doktorova's doT.js (https://github.com/olado/doT).
const settings = templateSettings;
if (otherOptions && isIterateeCall(string, options, o... | [
"function",
"template",
"(",
"string",
",",
"options",
",",
"otherOptions",
")",
"{",
"// Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)",
"// and Laura Doktorova's doT.js (https://github.com/olado/doT).",
"const",
"settings",
"=",
"tem... | Creates a compiled template function that can interpolate data properties
in "interpolate" delimiters, HTML-escape interpolated data properties in
"escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
properties may be accessed as free variables in the template. If a setting
object is provided it t... | [
"Creates",
"a",
"compiled",
"template",
"function",
"that",
"can",
"interpolate",
"data",
"properties",
"in",
"interpolate",
"delimiters",
"HTML",
"-",
"escape",
"interpolated",
"data",
"properties",
"in",
"escape",
"delimiters",
"and",
"execute",
"JavaScript",
"in"... | 73b03e8c985f2660948f5df71140e4a8fb162549 | https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/lib/compilers/jst/template.js#L258-L360 |
39,667 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/fancytree/dist/src/jquery.fancytree.debug.js | function(ctx, force, deep, collapsed){
// ctx.tree.debug("**** PROFILER nodeRender");
var s = this.options.prefix + "render '" + ctx.node + "'";
/*jshint expr:true */
window.console && window.console.time && window.console.time(s);
this._super(ctx, force, deep, collapsed);
window.console && window.con... | javascript | function(ctx, force, deep, collapsed){
// ctx.tree.debug("**** PROFILER nodeRender");
var s = this.options.prefix + "render '" + ctx.node + "'";
/*jshint expr:true */
window.console && window.console.time && window.console.time(s);
this._super(ctx, force, deep, collapsed);
window.console && window.con... | [
"function",
"(",
"ctx",
",",
"force",
",",
"deep",
",",
"collapsed",
")",
"{",
"// ctx.tree.debug(\"**** PROFILER nodeRender\");",
"var",
"s",
"=",
"this",
".",
"options",
".",
"prefix",
"+",
"\"render '\"",
"+",
"ctx",
".",
"node",
"+",
"\"'\"",
";",
"/*jsh... | Overide virtual methods for this extension | [
"Overide",
"virtual",
"methods",
"for",
"this",
"extension"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/fancytree/dist/src/jquery.fancytree.debug.js#L133-L140 | |
39,668 | tentwentyfour/helpbox | source/create-error-type.js | createErrorType | function createErrorType(initialize = undefined, ErrorClass = undefined, prototype = undefined) {
ErrorClass = ErrorClass || Error;
let Constructor = function (message) {
let error = Object.create(Constructor.prototype);
error.message = message;
error.stack = (new Error).stack;
... | javascript | function createErrorType(initialize = undefined, ErrorClass = undefined, prototype = undefined) {
ErrorClass = ErrorClass || Error;
let Constructor = function (message) {
let error = Object.create(Constructor.prototype);
error.message = message;
error.stack = (new Error).stack;
... | [
"function",
"createErrorType",
"(",
"initialize",
"=",
"undefined",
",",
"ErrorClass",
"=",
"undefined",
",",
"prototype",
"=",
"undefined",
")",
"{",
"ErrorClass",
"=",
"ErrorClass",
"||",
"Error",
";",
"let",
"Constructor",
"=",
"function",
"(",
"message",
"... | Return a constructor for a new error type.
@function createErrorType
@param initialize {Function} A function that gets passed the constructed error and the passed message and
runs during the construction of new instances.
@param ErrorClass {Function} An error class you wish to subclass. Defaults to Error.
@param prot... | [
"Return",
"a",
"constructor",
"for",
"a",
"new",
"error",
"type",
"."
] | 94b802016d81391b486f02bd61f7ec89ff5fe8e7 | https://github.com/tentwentyfour/helpbox/blob/94b802016d81391b486f02bd61f7ec89ff5fe8e7/source/create-error-type.js#L15-L34 |
39,669 | joelvh/Sysmo.js | lib/sysmo.js | function(target, namespace, graph) {
//if the first param is a string,
//we are including the namespace on Sysmo
if (typeof target == 'string') {
graph = namespace;
namespace = target;
target = Sysmo;
}
//create namespace on target
Sysmo.namespa... | javascript | function(target, namespace, graph) {
//if the first param is a string,
//we are including the namespace on Sysmo
if (typeof target == 'string') {
graph = namespace;
namespace = target;
target = Sysmo;
}
//create namespace on target
Sysmo.namespa... | [
"function",
"(",
"target",
",",
"namespace",
",",
"graph",
")",
"{",
"//if the first param is a string, ",
"//we are including the namespace on Sysmo",
"if",
"(",
"typeof",
"target",
"==",
"'string'",
")",
"{",
"graph",
"=",
"namespace",
";",
"namespace",
"=",
"targ... | include an object graph in another | [
"include",
"an",
"object",
"graph",
"in",
"another"
] | 0487e562437c3933f66f4c29505d0c50ccb3e8e9 | https://github.com/joelvh/Sysmo.js/blob/0487e562437c3933f66f4c29505d0c50ccb3e8e9/lib/sysmo.js#L69-L86 | |
39,670 | joelvh/Sysmo.js | lib/sysmo.js | function(namespace, target) {
target = target || {};
var names = namespace.split('.'),
context = target;
for (var i = 0; i < names.length; i++) {
var name = names[i];
context = (name in context) ? context[name] : (context[name] = {});
}
... | javascript | function(namespace, target) {
target = target || {};
var names = namespace.split('.'),
context = target;
for (var i = 0; i < names.length; i++) {
var name = names[i];
context = (name in context) ? context[name] : (context[name] = {});
}
... | [
"function",
"(",
"namespace",
",",
"target",
")",
"{",
"target",
"=",
"target",
"||",
"{",
"}",
";",
"var",
"names",
"=",
"namespace",
".",
"split",
"(",
"'.'",
")",
",",
"context",
"=",
"target",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
... | build an object graph from a namespace. adds properties to the target object or returns a new object graph. | [
"build",
"an",
"object",
"graph",
"from",
"a",
"namespace",
".",
"adds",
"properties",
"to",
"the",
"target",
"object",
"or",
"returns",
"a",
"new",
"object",
"graph",
"."
] | 0487e562437c3933f66f4c29505d0c50ccb3e8e9 | https://github.com/joelvh/Sysmo.js/blob/0487e562437c3933f66f4c29505d0c50ccb3e8e9/lib/sysmo.js#L90-L103 | |
39,671 | joelvh/Sysmo.js | lib/sysmo.js | function (target, path, traverseArrays) {
// if traversing arrays is enabled and this is an array, loop
// may be a "array-like" node list (or similar), in which case it needs to be converted
if (traverseArrays && Sysmo.isArrayLike(target)) {
target = Sysmo.makeArray(target);
... | javascript | function (target, path, traverseArrays) {
// if traversing arrays is enabled and this is an array, loop
// may be a "array-like" node list (or similar), in which case it needs to be converted
if (traverseArrays && Sysmo.isArrayLike(target)) {
target = Sysmo.makeArray(target);
... | [
"function",
"(",
"target",
",",
"path",
",",
"traverseArrays",
")",
"{",
"// if traversing arrays is enabled and this is an array, loop",
"// may be a \"array-like\" node list (or similar), in which case it needs to be converted",
"if",
"(",
"traverseArrays",
"&&",
"Sysmo",
".",
"i... | get the value of a property deeply nested in an object hierarchy | [
"get",
"the",
"value",
"of",
"a",
"property",
"deeply",
"nested",
"in",
"an",
"object",
"hierarchy"
] | 0487e562437c3933f66f4c29505d0c50ccb3e8e9 | https://github.com/joelvh/Sysmo.js/blob/0487e562437c3933f66f4c29505d0c50ccb3e8e9/lib/sysmo.js#L105-L166 | |
39,672 | alv-ch/styleguide | src/assets/fabricator/scripts/fabricator.js | function () {
var href = window.location.href,
items = parsedItems(),
id, index;
// get window 'id'
if (href.indexOf('#') > -1) {
id = window.location.hash.replace('#', '');
} else {
id = window.location.pathname.split('/').pop().replace(/\.[^/.]+$/, '');
}
// In case the first menu item isn'... | javascript | function () {
var href = window.location.href,
items = parsedItems(),
id, index;
// get window 'id'
if (href.indexOf('#') > -1) {
id = window.location.hash.replace('#', '');
} else {
id = window.location.pathname.split('/').pop().replace(/\.[^/.]+$/, '');
}
// In case the first menu item isn'... | [
"function",
"(",
")",
"{",
"var",
"href",
"=",
"window",
".",
"location",
".",
"href",
",",
"items",
"=",
"parsedItems",
"(",
")",
",",
"id",
",",
"index",
";",
"// get window 'id'",
"if",
"(",
"href",
".",
"indexOf",
"(",
"'#'",
")",
">",
"-",
"1"... | Match the 'id' in the window location with the menu item, set menu item as active | [
"Match",
"the",
"id",
"in",
"the",
"window",
"location",
"with",
"the",
"menu",
"item",
"set",
"menu",
"item",
"as",
"active"
] | 197269a8d80fdc760c1bf2b39f82cbc539c861d8 | https://github.com/alv-ch/styleguide/blob/197269a8d80fdc760c1bf2b39f82cbc539c861d8/src/assets/fabricator/scripts/fabricator.js#L133-L157 | |
39,673 | ofzza/enTT | tasks/task-3-script-babel.js | sourceRootFn | function sourceRootFn (file) {
let sourcePath = file.history[0],
targetPath = path.join(__dirname, '../src/'),
relativePath = path.join(path.relative(sourcePath, targetPath), './src');
return relativePath;
} | javascript | function sourceRootFn (file) {
let sourcePath = file.history[0],
targetPath = path.join(__dirname, '../src/'),
relativePath = path.join(path.relative(sourcePath, targetPath), './src');
return relativePath;
} | [
"function",
"sourceRootFn",
"(",
"file",
")",
"{",
"let",
"sourcePath",
"=",
"file",
".",
"history",
"[",
"0",
"]",
",",
"targetPath",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../src/'",
")",
",",
"relativePath",
"=",
"path",
".",
"join",
"("... | Composes source-maps' sourceRoot property for a file
@param {any} file File being processed
@returns {any} sourceRoot value | [
"Composes",
"source",
"-",
"maps",
"sourceRoot",
"property",
"for",
"a",
"file"
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/tasks/task-3-script-babel.js#L45-L50 |
39,674 | ofzza/enTT | dist/ext/dynamic-properties.js | DynamicPropertiesExtension | function DynamicPropertiesExtension() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$deferred = _ref.deferred,
deferred = _ref$deferred === undefined ? false : _ref$deferred;
_classCallCheck(this, DynamicPropertiesExtension);
return _possibleConst... | javascript | function DynamicPropertiesExtension() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$deferred = _ref.deferred,
deferred = _ref$deferred === undefined ? false : _ref$deferred;
_classCallCheck(this, DynamicPropertiesExtension);
return _possibleConst... | [
"function",
"DynamicPropertiesExtension",
"(",
")",
"{",
"var",
"_ref",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"{",
"}",
",",
"_ref$deferred",
"=",
"_ref",
... | Creates an instance of DynamicPropertiesExtension.
@param {any} deferred If true, the dynamic property value will be generated each time the property getter is called instead of on change detection
@memberof DynamicPropertiesExtension | [
"Creates",
"an",
"instance",
"of",
"DynamicPropertiesExtension",
"."
] | fdf27de4142b3c65a3e51dee70e0d7625dff897c | https://github.com/ofzza/enTT/blob/fdf27de4142b3c65a3e51dee70e0d7625dff897c/dist/ext/dynamic-properties.js#L54-L70 |
39,675 | expo/project-repl | index.js | readFileAsync | async function readFileAsync(...args) {
return new Promise((resolve, reject) => {
fs.readFile(...args, (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
});
});
} | javascript | async function readFileAsync(...args) {
return new Promise((resolve, reject) => {
fs.readFile(...args, (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
});
});
} | [
"async",
"function",
"readFileAsync",
"(",
"...",
"args",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"fs",
".",
"readFile",
"(",
"...",
"args",
",",
"(",
"err",
",",
"result",
")",
"=>",
"{",
"if",
"("... | Promise interface for `fs.readFile`
@param {<string> | <Buffer> | <URL> | <integer>} p filename or file descriptor
@param {<Object> | <string>} options | [
"Promise",
"interface",
"for",
"fs",
".",
"readFile"
] | 9c4c91d6cbe9ce2c42a82329505b1148d06d6d44 | https://github.com/expo/project-repl/blob/9c4c91d6cbe9ce2c42a82329505b1148d06d6d44/index.js#L12-L22 |
39,676 | ggarek/debug-dude | lib/index.js | createLoggers | function createLoggers(ns) {
var debug = (0, _debug2['default'])(ns + ':debug');
debug.log = function () {
return console.log.apply(console, arguments);
};
var log = (0, _debug2['default'])(ns + ':log');
log.log = function () {
return console.log.apply(console, arguments);
};
var info = (0, _deb... | javascript | function createLoggers(ns) {
var debug = (0, _debug2['default'])(ns + ':debug');
debug.log = function () {
return console.log.apply(console, arguments);
};
var log = (0, _debug2['default'])(ns + ':log');
log.log = function () {
return console.log.apply(console, arguments);
};
var info = (0, _deb... | [
"function",
"createLoggers",
"(",
"ns",
")",
"{",
"var",
"debug",
"=",
"(",
"0",
",",
"_debug2",
"[",
"'default'",
"]",
")",
"(",
"ns",
"+",
"':debug'",
")",
";",
"debug",
".",
"log",
"=",
"function",
"(",
")",
"{",
"return",
"console",
".",
"log",... | Create debug instances and bind log method to specific console method | [
"Create",
"debug",
"instances",
"and",
"bind",
"log",
"method",
"to",
"specific",
"console",
"method"
] | c6ddca34863630a7d257f22b9ea332110cdb60c5 | https://github.com/ggarek/debug-dude/blob/c6ddca34863630a7d257f22b9ea332110cdb60c5/lib/index.js#L18-L51 |
39,677 | mikolalysenko/red-blue-line-segment-intersect | rblsi.js | BruteForceList | function BruteForceList(capacity) {
this.intervals = pool.mallocDouble(2 * capacity)
this.index = pool.mallocInt32(capacity)
this.count = 0
} | javascript | function BruteForceList(capacity) {
this.intervals = pool.mallocDouble(2 * capacity)
this.index = pool.mallocInt32(capacity)
this.count = 0
} | [
"function",
"BruteForceList",
"(",
"capacity",
")",
"{",
"this",
".",
"intervals",
"=",
"pool",
".",
"mallocDouble",
"(",
"2",
"*",
"capacity",
")",
"this",
".",
"index",
"=",
"pool",
".",
"mallocInt32",
"(",
"capacity",
")",
"this",
".",
"count",
"=",
... | It is silly, but this is faster than doing the right thing for up to a few thousand segments, which hardly occurs in practice. | [
"It",
"is",
"silly",
"but",
"this",
"is",
"faster",
"than",
"doing",
"the",
"right",
"thing",
"for",
"up",
"to",
"a",
"few",
"thousand",
"segments",
"which",
"hardly",
"occurs",
"in",
"practice",
"."
] | d8ecd805e1846d8f3644ef84b410cb6110c1c00f | https://github.com/mikolalysenko/red-blue-line-segment-intersect/blob/d8ecd805e1846d8f3644ef84b410cb6110c1c00f/rblsi.js#L55-L59 |
39,678 | yaniswang/PromiseClass | lib/promiseclass.js | chaiSupportChainPromise | function chaiSupportChainPromise(chai, utils){
function copyChainPromise(promise, assertion){
let protoPromise = Object.getPrototypeOf(promise);
let protoNames = Object.getOwnPropertyNames(protoPromise);
let protoAssertion = Object.getPrototypeOf(assertion);
protoNames.forEach(functi... | javascript | function chaiSupportChainPromise(chai, utils){
function copyChainPromise(promise, assertion){
let protoPromise = Object.getPrototypeOf(promise);
let protoNames = Object.getOwnPropertyNames(protoPromise);
let protoAssertion = Object.getPrototypeOf(assertion);
protoNames.forEach(functi... | [
"function",
"chaiSupportChainPromise",
"(",
"chai",
",",
"utils",
")",
"{",
"function",
"copyChainPromise",
"(",
"promise",
",",
"assertion",
")",
"{",
"let",
"protoPromise",
"=",
"Object",
".",
"getPrototypeOf",
"(",
"promise",
")",
";",
"let",
"protoNames",
... | support ChainPromise for chai | [
"support",
"ChainPromise",
"for",
"chai"
] | 3ead8295500618eb7730eecb71ebcbb3294b9729 | https://github.com/yaniswang/PromiseClass/blob/3ead8295500618eb7730eecb71ebcbb3294b9729/lib/promiseclass.js#L161-L237 |
39,679 | tcardoso2/vermon | PluginManager.js | RemovePlugin | function RemovePlugin (ext_module_id) {
let copy = plugins[ext_module_id]
let runPreWorkflowFunctions = function () {
if (!plugins[ext_module_id].PreRemovePlugin) throw new Error('Error: PreRemovePlugin function must be implemented.')
plugins[ext_module_id].PreRemovePlugin()
}
let runPostWorkflowFunct... | javascript | function RemovePlugin (ext_module_id) {
let copy = plugins[ext_module_id]
let runPreWorkflowFunctions = function () {
if (!plugins[ext_module_id].PreRemovePlugin) throw new Error('Error: PreRemovePlugin function must be implemented.')
plugins[ext_module_id].PreRemovePlugin()
}
let runPostWorkflowFunct... | [
"function",
"RemovePlugin",
"(",
"ext_module_id",
")",
"{",
"let",
"copy",
"=",
"plugins",
"[",
"ext_module_id",
"]",
"let",
"runPreWorkflowFunctions",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"!",
"plugins",
"[",
"ext_module_id",
"]",
".",
"PreRemovePlugin"... | Removes an existing Extention plugin from the library
@param {string} ext_module_id is the id of the module to remove.
@return {boolean} True the plugin was successfully removed. | [
"Removes",
"an",
"existing",
"Extention",
"plugin",
"from",
"the",
"library"
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/PluginManager.js#L54-L73 |
39,680 | tcardoso2/vermon | main.js | _InternalAddEnvironment | function _InternalAddEnvironment (env = new ent.Environment()) {
if (env instanceof ent.Environment) {
em.SetEnvironment(env)
return true
} else {
log.warning("'environment' object is not of type Environment")
}
return false
} | javascript | function _InternalAddEnvironment (env = new ent.Environment()) {
if (env instanceof ent.Environment) {
em.SetEnvironment(env)
return true
} else {
log.warning("'environment' object is not of type Environment")
}
return false
} | [
"function",
"_InternalAddEnvironment",
"(",
"env",
"=",
"new",
"ent",
".",
"Environment",
"(",
")",
")",
"{",
"if",
"(",
"env",
"instanceof",
"ent",
".",
"Environment",
")",
"{",
"em",
".",
"SetEnvironment",
"(",
"env",
")",
"return",
"true",
"}",
"else"... | Adds an Environment into the current context. The environment needs to be if instance Environment, if not
if fails silently, logs the error in the logger and returns false.
@param {object} env is the Environment object to add. This function is internal
@internal
@returns {Boolean} true if the environment is successfull... | [
"Adds",
"an",
"Environment",
"into",
"the",
"current",
"context",
".",
"The",
"environment",
"needs",
"to",
"be",
"if",
"instance",
"Environment",
"if",
"not",
"if",
"fails",
"silently",
"logs",
"the",
"error",
"in",
"the",
"logger",
"and",
"returns",
"false... | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L69-L77 |
39,681 | tcardoso2/vermon | main.js | AddDetectorToSubEnvironmentOnly | function AddDetectorToSubEnvironmentOnly (detector, force = false, subEnvironment) {
return em.AddDetectorToSubEnvironmentOnly(detector, force, subEnvironment)
} | javascript | function AddDetectorToSubEnvironmentOnly (detector, force = false, subEnvironment) {
return em.AddDetectorToSubEnvironmentOnly(detector, force, subEnvironment)
} | [
"function",
"AddDetectorToSubEnvironmentOnly",
"(",
"detector",
",",
"force",
"=",
"false",
",",
"subEnvironment",
")",
"{",
"return",
"em",
".",
"AddDetectorToSubEnvironmentOnly",
"(",
"detector",
",",
"force",
",",
"subEnvironment",
")",
"}"
] | Adds a detector to a SubEnvironment. Assumes that the main Environment is a MultiEnvironment.
@param {object} detector is the MotionDetector object to add.
@param {boolean} force can be set to true to push the detector even if not of {MotionDetector} instance
@param {string} subEnvironment is the Environment to add to... | [
"Adds",
"a",
"detector",
"to",
"a",
"SubEnvironment",
".",
"Assumes",
"that",
"the",
"main",
"Environment",
"is",
"a",
"MultiEnvironment",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L167-L169 |
39,682 | tcardoso2/vermon | main.js | RemoveNotifier | function RemoveNotifier (notifier, silent = false) {
let index = em.GetNotifiers().indexOf(notifier)
log.info('Removing Notifier...')
if (index > -1) {
if (!silent) {
em.GetNotifiers()[index].notify('Removing Notifier...')
}
em.GetNotifiers().splice(index, 1)
return true
} else {
log.i... | javascript | function RemoveNotifier (notifier, silent = false) {
let index = em.GetNotifiers().indexOf(notifier)
log.info('Removing Notifier...')
if (index > -1) {
if (!silent) {
em.GetNotifiers()[index].notify('Removing Notifier...')
}
em.GetNotifiers().splice(index, 1)
return true
} else {
log.i... | [
"function",
"RemoveNotifier",
"(",
"notifier",
",",
"silent",
"=",
"false",
")",
"{",
"let",
"index",
"=",
"em",
".",
"GetNotifiers",
"(",
")",
".",
"indexOf",
"(",
"notifier",
")",
"log",
".",
"info",
"(",
"'Removing Notifier...'",
")",
"if",
"(",
"inde... | Removes an existing notifier from the context.
Does not fail if the notifier is not found.
@param {object} notifier is the notifier instance to remove.
@param {booleal} sileng states if = true the removal should not send a notification
@returns true if the notifier was found (and subsequently removed).
@public | [
"Removes",
"an",
"existing",
"notifier",
"from",
"the",
"context",
".",
"Does",
"not",
"fail",
"if",
"the",
"notifier",
"is",
"not",
"found",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L203-L216 |
39,683 | tcardoso2/vermon | main.js | RemoveDetector | function RemoveDetector (detector) {
let index = motionDetectors.indexOf(detector)
log.info('Removing Detector...')
if (index > -1) {
em.GetEnvironment().unbindDetector(detector)
motionDetectors.splice(index, 1)
// Redundant: Motion detectors are also copied to environment!
em.GetEnvironment().mot... | javascript | function RemoveDetector (detector) {
let index = motionDetectors.indexOf(detector)
log.info('Removing Detector...')
if (index > -1) {
em.GetEnvironment().unbindDetector(detector)
motionDetectors.splice(index, 1)
// Redundant: Motion detectors are also copied to environment!
em.GetEnvironment().mot... | [
"function",
"RemoveDetector",
"(",
"detector",
")",
"{",
"let",
"index",
"=",
"motionDetectors",
".",
"indexOf",
"(",
"detector",
")",
"log",
".",
"info",
"(",
"'Removing Detector...'",
")",
"if",
"(",
"index",
">",
"-",
"1",
")",
"{",
"em",
".",
"GetEnv... | Removes an existing MotionDetector from the context, including its event listeners.
Does not fail if the detector is not found.
@param {object} detector is the MotionDetector instance to remove.
@returns true if the detector was found (and subsequently removed).
@public | [
"Removes",
"an",
"existing",
"MotionDetector",
"from",
"the",
"context",
"including",
"its",
"event",
"listeners",
".",
"Does",
"not",
"fail",
"if",
"the",
"detector",
"is",
"not",
"found",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L225-L238 |
39,684 | tcardoso2/vermon | main.js | GetSubEnvironment | function GetSubEnvironment (subEnvironmentName) {
let e = GetSubEnvironments()[subEnvironmentName]
if (!e) {
throw new Error('SubEnvironment does not exist.')
}
if (!(e instanceof ent.Environment)) {
throw new Error('SubEnvironment is invalid.')
}
return e
} | javascript | function GetSubEnvironment (subEnvironmentName) {
let e = GetSubEnvironments()[subEnvironmentName]
if (!e) {
throw new Error('SubEnvironment does not exist.')
}
if (!(e instanceof ent.Environment)) {
throw new Error('SubEnvironment is invalid.')
}
return e
} | [
"function",
"GetSubEnvironment",
"(",
"subEnvironmentName",
")",
"{",
"let",
"e",
"=",
"GetSubEnvironments",
"(",
")",
"[",
"subEnvironmentName",
"]",
"if",
"(",
"!",
"e",
")",
"{",
"throw",
"new",
"Error",
"(",
"'SubEnvironment does not exist.'",
")",
"}",
"i... | Gets a particular sub-Environments of the context, raises error if it's not of type Environment.
@returns Environment object.
@public | [
"Gets",
"a",
"particular",
"sub",
"-",
"Environments",
"of",
"the",
"context",
"raises",
"error",
"if",
"it",
"s",
"not",
"of",
"type",
"Environment",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L273-L282 |
39,685 | tcardoso2/vermon | main.js | GetMotionDetector | function GetMotionDetector (name) {
// It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency
console.log("Attention! this function GetMotionDetectors returns a singleton of motion detectors! If you are running several instances only one instance ... | javascript | function GetMotionDetector (name) {
// It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency
console.log("Attention! this function GetMotionDetectors returns a singleton of motion detectors! If you are running several instances only one instance ... | [
"function",
"GetMotionDetector",
"(",
"name",
")",
"{",
"// It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency",
"console",
".",
"log",
"(",
"\"Attention! this function GetMotionDetectors returns a singleton of motion det... | Gets the Motion Detectors with the given name.
Will throw an exception if there is no Motion detector with such name.
@param {string} name is the name of the MotionDetector instance to get.
@returns a MotionDetector objects.
Attention! motion detectors is a singleton!
@public | [
"Gets",
"the",
"Motion",
"Detectors",
"with",
"the",
"given",
"name",
".",
"Will",
"throw",
"an",
"exception",
"if",
"there",
"is",
"no",
"Motion",
"detector",
"with",
"such",
"name",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L313-L318 |
39,686 | tcardoso2/vermon | main.js | GetFilters | function GetFilters () {
let result = []
log.debug(`Fetching filters in the existing ${motionDetectors.length} detector(s)...`)
for (let i in motionDetectors) {
result = result.concat(motionDetectors[i].filters)
}
log.debug(`Getting ${result.length} filters...`)
return result
} | javascript | function GetFilters () {
let result = []
log.debug(`Fetching filters in the existing ${motionDetectors.length} detector(s)...`)
for (let i in motionDetectors) {
result = result.concat(motionDetectors[i].filters)
}
log.debug(`Getting ${result.length} filters...`)
return result
} | [
"function",
"GetFilters",
"(",
")",
"{",
"let",
"result",
"=",
"[",
"]",
"log",
".",
"debug",
"(",
"`",
"${",
"motionDetectors",
".",
"length",
"}",
"`",
")",
"for",
"(",
"let",
"i",
"in",
"motionDetectors",
")",
"{",
"result",
"=",
"result",
".",
... | Gets all the existing Filters present in the current context.
@returns {object} an Array of Filter objects.
@public | [
"Gets",
"all",
"the",
"existing",
"Filters",
"present",
"in",
"the",
"current",
"context",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L325-L333 |
39,687 | tcardoso2/vermon | main.js | Reset | function Reset () {
log.info('Reseting environment...')
for (let m in motionDetectors) {
RemoveDetector(motionDetectors[m])
}
for (let n in em.GetNotifiers()) {
RemoveNotifier(em.GetNotifiers()[n], true)
}
em.SetNotifiers([])
if (em.GetEnvironment()) {
em.GetEnvironment().removeAllListeners('c... | javascript | function Reset () {
log.info('Reseting environment...')
for (let m in motionDetectors) {
RemoveDetector(motionDetectors[m])
}
for (let n in em.GetNotifiers()) {
RemoveNotifier(em.GetNotifiers()[n], true)
}
em.SetNotifiers([])
if (em.GetEnvironment()) {
em.GetEnvironment().removeAllListeners('c... | [
"function",
"Reset",
"(",
")",
"{",
"log",
".",
"info",
"(",
"'Reseting environment...'",
")",
"for",
"(",
"let",
"m",
"in",
"motionDetectors",
")",
"{",
"RemoveDetector",
"(",
"motionDetectors",
"[",
"m",
"]",
")",
"}",
"for",
"(",
"let",
"n",
"in",
"... | Resets the current context environment, notifiers and motion detectors.
@public | [
"Resets",
"the",
"current",
"context",
"environment",
"notifiers",
"and",
"motion",
"detectors",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L339-L365 |
39,688 | tcardoso2/vermon | main.js | _StartPlugins | function _StartPlugins (e, m, n, f) {
log.info(`Checking if any plugin exists which should be started...`)
let plugins = pm.GetPlugins()
Object.keys(plugins).forEach(function (key) {
let p = plugins[key]
log.info(` Plugin found. Checking plugin signature methods ShouldStart and Start for plugin ${key}...... | javascript | function _StartPlugins (e, m, n, f) {
log.info(`Checking if any plugin exists which should be started...`)
let plugins = pm.GetPlugins()
Object.keys(plugins).forEach(function (key) {
let p = plugins[key]
log.info(` Plugin found. Checking plugin signature methods ShouldStart and Start for plugin ${key}...... | [
"function",
"_StartPlugins",
"(",
"e",
",",
"m",
",",
"n",
",",
"f",
")",
"{",
"log",
".",
"info",
"(",
"`",
"`",
")",
"let",
"plugins",
"=",
"pm",
".",
"GetPlugins",
"(",
")",
"Object",
".",
"keys",
"(",
"plugins",
")",
".",
"forEach",
"(",
"f... | Internal function which Starts all the Plugins, ran when StartWithConfir is called.
Throws an Error if any of the plugins does not implement the "Start" method.
@param {e} The current Environment.
@param {m} The current MotionDetectors.
@param {n} The current Notifiers.
@param {f} The current Filters. | [
"Internal",
"function",
"which",
"Starts",
"all",
"the",
"Plugins",
"ran",
"when",
"StartWithConfir",
"is",
"called",
".",
"Throws",
"an",
"Error",
"if",
"any",
"of",
"the",
"plugins",
"does",
"not",
"implement",
"the",
"Start",
"method",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L417-L435 |
39,689 | tcardoso2/vermon | main.js | SaveAllToConfig | function SaveAllToConfig (src, callback, force = false) {
let status = 1
let message
let resultError = function (message) {
message = `Error: ${message}`
log.error(message)
callback(1, message)
}
let resultWarning = function (message) {
message = `Warn: ${message}`
log.warning(message)
... | javascript | function SaveAllToConfig (src, callback, force = false) {
let status = 1
let message
let resultError = function (message) {
message = `Error: ${message}`
log.error(message)
callback(1, message)
}
let resultWarning = function (message) {
message = `Warn: ${message}`
log.warning(message)
... | [
"function",
"SaveAllToConfig",
"(",
"src",
",",
"callback",
",",
"force",
"=",
"false",
")",
"{",
"let",
"status",
"=",
"1",
"let",
"message",
"let",
"resultError",
"=",
"function",
"(",
"message",
")",
"{",
"message",
"=",
"`",
"${",
"message",
"}",
"... | Saves all the Environment, Detector, Notifiers and Filters information into a config file
@param {String} src is the path of the config file to use
@param {Function} callback is the callback function to call once the Save is all done, it passes
status and message as arguments to the function: \m
status = 0: Successfull... | [
"Saves",
"all",
"the",
"Environment",
"Detector",
"Notifiers",
"and",
"Filters",
"information",
"into",
"a",
"config",
"file"
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L710-L747 |
39,690 | tcardoso2/vermon | main.js | _InternalSerializeCurrentContext | function _InternalSerializeCurrentContext () {
let profile = { default: {} }
// Separate this function into another utils library.
let serializeEntity = function (ent) {
if (ent.constructor.name === 'Array') {
serializeArray()
} else {
profile.default[ent.constructor.name] = ent
}
}
... | javascript | function _InternalSerializeCurrentContext () {
let profile = { default: {} }
// Separate this function into another utils library.
let serializeEntity = function (ent) {
if (ent.constructor.name === 'Array') {
serializeArray()
} else {
profile.default[ent.constructor.name] = ent
}
}
... | [
"function",
"_InternalSerializeCurrentContext",
"(",
")",
"{",
"let",
"profile",
"=",
"{",
"default",
":",
"{",
"}",
"}",
"// Separate this function into another utils library.",
"let",
"serializeEntity",
"=",
"function",
"(",
"ent",
")",
"{",
"if",
"(",
"ent",
".... | Internal function which serializes the current Context into the format matching the "profile" object
of the config file.
@returns {object} Returns a "profile" object in JSON.stringify format
@internal | [
"Internal",
"function",
"which",
"serializes",
"the",
"current",
"Context",
"into",
"the",
"format",
"matching",
"the",
"profile",
"object",
"of",
"the",
"config",
"file",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L755-L788 |
39,691 | tcardoso2/vermon | main.js | function (ent) {
if (ent.constructor.name === 'Array') {
serializeArray()
} else {
profile.default[ent.constructor.name] = ent
}
} | javascript | function (ent) {
if (ent.constructor.name === 'Array') {
serializeArray()
} else {
profile.default[ent.constructor.name] = ent
}
} | [
"function",
"(",
"ent",
")",
"{",
"if",
"(",
"ent",
".",
"constructor",
".",
"name",
"===",
"'Array'",
")",
"{",
"serializeArray",
"(",
")",
"}",
"else",
"{",
"profile",
".",
"default",
"[",
"ent",
".",
"constructor",
".",
"name",
"]",
"=",
"ent",
... | Separate this function into another utils library. | [
"Separate",
"this",
"function",
"into",
"another",
"utils",
"library",
"."
] | 8fccd8fe87de98bdc77cd2cbe91e85118dc71a16 | https://github.com/tcardoso2/vermon/blob/8fccd8fe87de98bdc77cd2cbe91e85118dc71a16/main.js#L759-L765 | |
39,692 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.ext.js | function(onHover) {
return function(picker, calendar, inst) {
if ($.isFunction(onHover)) {
var target = this;
var renderer = inst.options.renderer;
picker.find(renderer.daySelector + ' a, ' + renderer.daySelector + ' span').
hover(function() {
onHover.apply(target, [$(target).calendar... | javascript | function(onHover) {
return function(picker, calendar, inst) {
if ($.isFunction(onHover)) {
var target = this;
var renderer = inst.options.renderer;
picker.find(renderer.daySelector + ' a, ' + renderer.daySelector + ' span').
hover(function() {
onHover.apply(target, [$(target).calendar... | [
"function",
"(",
"onHover",
")",
"{",
"return",
"function",
"(",
"picker",
",",
"calendar",
",",
"inst",
")",
"{",
"if",
"(",
"$",
".",
"isFunction",
"(",
"onHover",
")",
")",
"{",
"var",
"target",
"=",
"this",
";",
"var",
"renderer",
"=",
"inst",
... | A function to call when a date is hovered.
@callback CalendarsPickerOnHover
@param date {CDate} The date being hovered or <code>null</code> on exit.
@param selectable {boolean} <code>true</code> if this date is selectable, <code>false</code> if not.
@example function showHovered(date, selectable) {
$('#feedback').text(... | [
"A",
"function",
"to",
"call",
"when",
"a",
"date",
"is",
"hovered",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.ext.js#L111-L124 | |
39,693 | ImAdamTM/actions-ai-app | bin/lib/store.js | Store | function Store(context, app, data) {
const state = Object.assign({}, defaultState, data);
return {
dispatch(key, payload) {
const reducers = context.reducers[key];
/* istanbul ignore next */
if (!reducers) return;
for (let i = 0, len = reducers.length; i < len; i += 1) {
const ... | javascript | function Store(context, app, data) {
const state = Object.assign({}, defaultState, data);
return {
dispatch(key, payload) {
const reducers = context.reducers[key];
/* istanbul ignore next */
if (!reducers) return;
for (let i = 0, len = reducers.length; i < len; i += 1) {
const ... | [
"function",
"Store",
"(",
"context",
",",
"app",
",",
"data",
")",
"{",
"const",
"state",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"defaultState",
",",
"data",
")",
";",
"return",
"{",
"dispatch",
"(",
"key",
",",
"payload",
")",
"{",
"con... | The data `Store` is used to manage the session data for the application.
We do not want to manipulate `app.data` directly as it becomes
un-managable as things expand. Instead, we use a `redux` style approach
where the data is managed via state.
To learn more, read the [redux docs](http://redux.js.org/docs/basics/)
@p... | [
"The",
"data",
"Store",
"is",
"used",
"to",
"manage",
"the",
"session",
"data",
"for",
"the",
"application",
".",
"We",
"do",
"not",
"want",
"to",
"manipulate",
"app",
".",
"data",
"directly",
"as",
"it",
"becomes",
"un",
"-",
"managable",
"as",
"things"... | 2a236dde0508610ad38654c22669eab949260777 | https://github.com/ImAdamTM/actions-ai-app/blob/2a236dde0508610ad38654c22669eab949260777/bin/lib/store.js#L22-L50 |
39,694 | dinoboff/firebase-json | index.js | error | function error(original, fileName) {
if (
original == null ||
original.location == null ||
original.location.start == null
) {
return original;
}
const start = original.location.start;
const lineNumber = start.line == null ? 1 : start.line;
const columnNumber = start.column == null ? 1 : st... | javascript | function error(original, fileName) {
if (
original == null ||
original.location == null ||
original.location.start == null
) {
return original;
}
const start = original.location.start;
const lineNumber = start.line == null ? 1 : start.line;
const columnNumber = start.column == null ? 1 : st... | [
"function",
"error",
"(",
"original",
",",
"fileName",
")",
"{",
"if",
"(",
"original",
"==",
"null",
"||",
"original",
".",
"location",
"==",
"null",
"||",
"original",
".",
"location",
".",
"start",
"==",
"null",
")",
"{",
"return",
"original",
";",
"... | Create a SyntaxError with fileName, lineNumber, columnNumber and stack
pointing to the syntax error in the the json file.
@param {Error} original Pegjs syntax error
@param {string} fileName JSON file name
@return {Error} | [
"Create",
"a",
"SyntaxError",
"with",
"fileName",
"lineNumber",
"columnNumber",
"and",
"stack",
"pointing",
"to",
"the",
"syntax",
"error",
"in",
"the",
"the",
"json",
"file",
"."
] | 9f9c34e0167510916223bb4045127a81e02fd39f | https://github.com/dinoboff/firebase-json/blob/9f9c34e0167510916223bb4045127a81e02fd39f/index.js#L14-L39 |
39,695 | dinoboff/firebase-json | index.js | astValue | function astValue(node) {
switch (node.type) {
case 'ExpressionStatement':
return astValue(node.expression);
case 'ObjectExpression':
return node.properties.reduce(
(obj, prop) => Object.assign(obj, {[prop.key.value]: astValue(prop.value)}),
{}
);
case 'ArrayExpression':
return n... | javascript | function astValue(node) {
switch (node.type) {
case 'ExpressionStatement':
return astValue(node.expression);
case 'ObjectExpression':
return node.properties.reduce(
(obj, prop) => Object.assign(obj, {[prop.key.value]: astValue(prop.value)}),
{}
);
case 'ArrayExpression':
return n... | [
"function",
"astValue",
"(",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"type",
")",
"{",
"case",
"'ExpressionStatement'",
":",
"return",
"astValue",
"(",
"node",
".",
"expression",
")",
";",
"case",
"'ObjectExpression'",
":",
"return",
"node",
".",
"pr... | Evaluate AST node to a value.
@param {object} node Node to evaluate
@return {any} | [
"Evaluate",
"AST",
"node",
"to",
"a",
"value",
"."
] | 9f9c34e0167510916223bb4045127a81e02fd39f | https://github.com/dinoboff/firebase-json/blob/9f9c34e0167510916223bb4045127a81e02fd39f/index.js#L47-L70 |
39,696 | smbape/node-umd-builder | build.js | remove | function remove(file, options, done) {
if (arguments.length === 2 && 'function' === typeof options) {
done = options;
options = {};
}
if ('function' !== typeof done) {
done = function() {};
}
function callfile(file, stats, done) {
fs.unlink(file, done);
}
f... | javascript | function remove(file, options, done) {
if (arguments.length === 2 && 'function' === typeof options) {
done = options;
options = {};
}
if ('function' !== typeof done) {
done = function() {};
}
function callfile(file, stats, done) {
fs.unlink(file, done);
}
f... | [
"function",
"remove",
"(",
"file",
",",
"options",
",",
"done",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"2",
"&&",
"'function'",
"===",
"typeof",
"options",
")",
"{",
"done",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
... | rm -rf. Symlink are not resolved by default, avoiding unwanted deep deletion
there should be a way to do it with rimraf, but too much options digging to find a way to do it
@param {String} file or folder to remove
@param {Function} done called on end | [
"rm",
"-",
"rf",
".",
"Symlink",
"are",
"not",
"resolved",
"by",
"default",
"avoiding",
"unwanted",
"deep",
"deletion",
"there",
"should",
"be",
"a",
"way",
"to",
"do",
"it",
"with",
"rimraf",
"but",
"too",
"much",
"options",
"digging",
"to",
"find",
"a"... | 73b03e8c985f2660948f5df71140e4a8fb162549 | https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/build.js#L111-L157 |
39,697 | sat-utils/sat-api-lib | libs/ingest-csv.js | processFiles | function processFiles(bucket, key, transform, cb, currentFileNum=0, lastFileNum=0, arn=null, retries=0) {
const maxRetries = 5
var nextFileNum = (currentFileNum < lastFileNum) ? currentFileNum + 1 : null
//invokeLambda(bucket, key, currentFileNum, lastFileNum, arn)
processFile(
bucket, `${key}${currentFil... | javascript | function processFiles(bucket, key, transform, cb, currentFileNum=0, lastFileNum=0, arn=null, retries=0) {
const maxRetries = 5
var nextFileNum = (currentFileNum < lastFileNum) ? currentFileNum + 1 : null
//invokeLambda(bucket, key, currentFileNum, lastFileNum, arn)
processFile(
bucket, `${key}${currentFil... | [
"function",
"processFiles",
"(",
"bucket",
",",
"key",
",",
"transform",
",",
"cb",
",",
"currentFileNum",
"=",
"0",
",",
"lastFileNum",
"=",
"0",
",",
"arn",
"=",
"null",
",",
"retries",
"=",
"0",
")",
"{",
"const",
"maxRetries",
"=",
"5",
"var",
"n... | Process 1 or more CSV files by processing one at a time, then invoking the next | [
"Process",
"1",
"or",
"more",
"CSV",
"files",
"by",
"processing",
"one",
"at",
"a",
"time",
"then",
"invoking",
"the",
"next"
] | 74ef1cb09789ecc9c18512781a95eada6fdc3813 | https://github.com/sat-utils/sat-api-lib/blob/74ef1cb09789ecc9c18512781a95eada6fdc3813/libs/ingest-csv.js#L123-L145 |
39,698 | sat-utils/sat-api-lib | libs/ingest-csv.js | processFile | function processFile(bucket, key, transform) {
// get the csv file s3://${bucket}/${key}
console.log(`Processing s3://${bucket}/${key}`)
const s3 = new AWS.S3()
const csvStream = csv.parse({ headers: true, objectMode: true })
s3.getObject({Bucket: bucket, Key: key}).createReadStream().pipe(csvStream)
return... | javascript | function processFile(bucket, key, transform) {
// get the csv file s3://${bucket}/${key}
console.log(`Processing s3://${bucket}/${key}`)
const s3 = new AWS.S3()
const csvStream = csv.parse({ headers: true, objectMode: true })
s3.getObject({Bucket: bucket, Key: key}).createReadStream().pipe(csvStream)
return... | [
"function",
"processFile",
"(",
"bucket",
",",
"key",
",",
"transform",
")",
"{",
"// get the csv file s3://${bucket}/${key}",
"console",
".",
"log",
"(",
"`",
"${",
"bucket",
"}",
"${",
"key",
"}",
"`",
")",
"const",
"s3",
"=",
"new",
"AWS",
".",
"S3",
... | Process single CSV file | [
"Process",
"single",
"CSV",
"file"
] | 74ef1cb09789ecc9c18512781a95eada6fdc3813 | https://github.com/sat-utils/sat-api-lib/blob/74ef1cb09789ecc9c18512781a95eada6fdc3813/libs/ingest-csv.js#L149-L156 |
39,699 | sat-utils/sat-api-lib | libs/ingest-csv.js | invokeLambda | function invokeLambda(bucket, key, nextFileNum, lastFileNum, arn, retries) {
// figure out if there's a next file to process
if (nextFileNum && arn) {
const stepfunctions = new AWS.StepFunctions()
const params = {
stateMachineArn: arn,
input: JSON.stringify({ bucket, key, currentFile... | javascript | function invokeLambda(bucket, key, nextFileNum, lastFileNum, arn, retries) {
// figure out if there's a next file to process
if (nextFileNum && arn) {
const stepfunctions = new AWS.StepFunctions()
const params = {
stateMachineArn: arn,
input: JSON.stringify({ bucket, key, currentFile... | [
"function",
"invokeLambda",
"(",
"bucket",
",",
"key",
",",
"nextFileNum",
",",
"lastFileNum",
",",
"arn",
",",
"retries",
")",
"{",
"// figure out if there's a next file to process",
"if",
"(",
"nextFileNum",
"&&",
"arn",
")",
"{",
"const",
"stepfunctions",
"=",
... | kick off processing next CSV file | [
"kick",
"off",
"processing",
"next",
"CSV",
"file"
] | 74ef1cb09789ecc9c18512781a95eada6fdc3813 | https://github.com/sat-utils/sat-api-lib/blob/74ef1cb09789ecc9c18512781a95eada6fdc3813/libs/ingest-csv.js#L160-L177 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.