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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
49,600 | gethuman/pancakes-angular | lib/transformers/ng.uipart.transformer.js | parseNames | function parseNames(filePath, prefix, defaultAppName) {
var appName = this.getAppName(filePath, defaultAppName);
var names = {
appShortName: appName,
appName: this.getAppModuleName(prefix, appName),
isPartial: !!filePath.match(/^.*\.partial\.js/)
};
names.isPage = !names.isPa... | javascript | function parseNames(filePath, prefix, defaultAppName) {
var appName = this.getAppName(filePath, defaultAppName);
var names = {
appShortName: appName,
appName: this.getAppModuleName(prefix, appName),
isPartial: !!filePath.match(/^.*\.partial\.js/)
};
names.isPage = !names.isPa... | [
"function",
"parseNames",
"(",
"filePath",
",",
"prefix",
",",
"defaultAppName",
")",
"{",
"var",
"appName",
"=",
"this",
".",
"getAppName",
"(",
"filePath",
",",
"defaultAppName",
")",
";",
"var",
"names",
"=",
"{",
"appShortName",
":",
"appName",
",",
"a... | Using the file path, parse out all the names needed for the UI part template
@param filePath
@param prefix
@param defaultAppName | [
"Using",
"the",
"file",
"path",
"parse",
"out",
"all",
"the",
"names",
"needed",
"for",
"the",
"UI",
"part",
"template"
] | 9589b7ba09619843e271293088005c62ed23f355 | https://github.com/gethuman/pancakes-angular/blob/9589b7ba09619843e271293088005c62ed23f355/lib/transformers/ng.uipart.transformer.js#L63-L90 |
49,601 | gethuman/pancakes-angular | lib/transformers/ng.uipart.transformer.js | getHtml | function getHtml(uipart, options) {
options = options || {};
var me = this;
// if any subviews, add them as dependencies
var model = {
isMobile: options.isMobile,
appName: options.appName,
pageCssId: options.appName + 'PageCssId'
};
var deps = _.extend({
subviews... | javascript | function getHtml(uipart, options) {
options = options || {};
var me = this;
// if any subviews, add them as dependencies
var model = {
isMobile: options.isMobile,
appName: options.appName,
pageCssId: options.appName + 'PageCssId'
};
var deps = _.extend({
subviews... | [
"function",
"getHtml",
"(",
"uipart",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"me",
"=",
"this",
";",
"// if any subviews, add them as dependencies",
"var",
"model",
"=",
"{",
"isMobile",
":",
"options",
".",
"isMobil... | Get the HTML for a given ui part
@param uipart
@param options
@returns {string} | [
"Get",
"the",
"HTML",
"for",
"a",
"given",
"ui",
"part"
] | 9589b7ba09619843e271293088005c62ed23f355 | https://github.com/gethuman/pancakes-angular/blob/9589b7ba09619843e271293088005c62ed23f355/lib/transformers/ng.uipart.transformer.js#L195-L224 |
49,602 | flacnut/npm-dependencies-spreadsheet | index.js | ensureRowsDeleted | function ensureRowsDeleted(rows) {
async.whilst(
() => rows.length,
(cb) => {
rows[0].del(() => {
sheet.getRows(query_options, (err, _rows) => {
rows = _rows;
cb();
});
});
},
next);
} | javascript | function ensureRowsDeleted(rows) {
async.whilst(
() => rows.length,
(cb) => {
rows[0].del(() => {
sheet.getRows(query_options, (err, _rows) => {
rows = _rows;
cb();
});
});
},
next);
} | [
"function",
"ensureRowsDeleted",
"(",
"rows",
")",
"{",
"async",
".",
"whilst",
"(",
"(",
")",
"=>",
"rows",
".",
"length",
",",
"(",
"cb",
")",
"=>",
"{",
"rows",
"[",
"0",
"]",
".",
"del",
"(",
"(",
")",
"=>",
"{",
"sheet",
".",
"getRows",
"(... | Once you delete a row, google API may incorrectly delete future rows. The only garuntee is to fetch a single row then delete it. | [
"Once",
"you",
"delete",
"a",
"row",
"google",
"API",
"may",
"incorrectly",
"delete",
"future",
"rows",
".",
"The",
"only",
"garuntee",
"is",
"to",
"fetch",
"a",
"single",
"row",
"then",
"delete",
"it",
"."
] | 691f5f93aae2cd868ee34d0ee597d87df7d0a4e6 | https://github.com/flacnut/npm-dependencies-spreadsheet/blob/691f5f93aae2cd868ee34d0ee597d87df7d0a4e6/index.js#L139-L151 |
49,603 | xiamidaxia/xiami | meteor/livedata/server/livedata_server.js | function () {
var self = this;
// Already destroyed.
if (!self.inQueue)
return;
if (self.heartbeat) {
self.heartbeat.stop();
self.heartbeat = null;
}
if (self.socket) {
self.socket.close();
self.socket._meteorSession = null;
}
// Drop the merge box data ... | javascript | function () {
var self = this;
// Already destroyed.
if (!self.inQueue)
return;
if (self.heartbeat) {
self.heartbeat.stop();
self.heartbeat = null;
}
if (self.socket) {
self.socket.close();
self.socket._meteorSession = null;
}
// Drop the merge box data ... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Already destroyed.",
"if",
"(",
"!",
"self",
".",
"inQueue",
")",
"return",
";",
"if",
"(",
"self",
".",
"heartbeat",
")",
"{",
"self",
".",
"heartbeat",
".",
"stop",
"(",
")",
";",
"s... | Destroy this session. Stop all processing and tear everything down. If a socket was attached, close it. | [
"Destroy",
"this",
"session",
".",
"Stop",
"all",
"processing",
"and",
"tear",
"everything",
"down",
".",
"If",
"a",
"socket",
"was",
"attached",
"close",
"it",
"."
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/livedata/server/livedata_server.js#L424-L460 | |
49,604 | xiamidaxia/xiami | meteor/livedata/server/livedata_server.js | function () {
var self = this;
// For the reported client address for a connection to be correct,
// the developer must set the HTTP_FORWARDED_COUNT environment
// variable to an integer representing the number of hops they
// expect in the `x-forwarded-for` header. E.g., set to "1" if the
// s... | javascript | function () {
var self = this;
// For the reported client address for a connection to be correct,
// the developer must set the HTTP_FORWARDED_COUNT environment
// variable to an integer representing the number of hops they
// expect in the `x-forwarded-for` header. E.g., set to "1" if the
// s... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// For the reported client address for a connection to be correct,",
"// the developer must set the HTTP_FORWARDED_COUNT environment",
"// variable to an integer representing the number of hops they",
"// expect in the `x-forwarded... | Determine the remote client's IP address, based on the HTTP_FORWARDED_COUNT environment variable representing how many proxies the server is behind. | [
"Determine",
"the",
"remote",
"client",
"s",
"IP",
"address",
"based",
"on",
"the",
"HTTP_FORWARDED_COUNT",
"environment",
"variable",
"representing",
"how",
"many",
"proxies",
"the",
"server",
"is",
"behind",
"."
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/livedata/server/livedata_server.js#L827-L860 | |
49,605 | xiamidaxia/xiami | meteor/livedata/server/livedata_server.js | function (name, handler, options) {
var self = this;
options = options || {};
if (name && name in self.publish_handlers) {
Meteor._debug("Ignoring duplicate publish named '" + name + "'");
return;
}
if (Package.autopublish && !options.is_auto) {
// They have autopublish on, yet ... | javascript | function (name, handler, options) {
var self = this;
options = options || {};
if (name && name in self.publish_handlers) {
Meteor._debug("Ignoring duplicate publish named '" + name + "'");
return;
}
if (Package.autopublish && !options.is_auto) {
// They have autopublish on, yet ... | [
"function",
"(",
"name",
",",
"handler",
",",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"name",
"&&",
"name",
"in",
"self",
".",
"publish_handlers",
")",
"{",
"Meteor",
".",
"_d... | Register a publish handler function.
@param name {String} identifier for query
@param handler {Function} publish handler
@param options {Object}
Server will call handler function on each new subscription,
either when receiving DDP sub message for a named subscription, or on
DDP connect for a universal subscription.
... | [
"Register",
"a",
"publish",
"handler",
"function",
"."
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/livedata/server/livedata_server.js#L1290-L1340 | |
49,606 | xiamidaxia/xiami | meteor/livedata/server/livedata_server.js | function (exception, context) {
if (!exception || exception instanceof Meteor.Error)
return exception;
// Did the error contain more details that could have been useful if caught in
// server code (or if thrown from non-client-originated code), but also
// provided a "sanitized" version with more context t... | javascript | function (exception, context) {
if (!exception || exception instanceof Meteor.Error)
return exception;
// Did the error contain more details that could have been useful if caught in
// server code (or if thrown from non-client-originated code), but also
// provided a "sanitized" version with more context t... | [
"function",
"(",
"exception",
",",
"context",
")",
"{",
"if",
"(",
"!",
"exception",
"||",
"exception",
"instanceof",
"Meteor",
".",
"Error",
")",
"return",
"exception",
";",
"// Did the error contain more details that could have been useful if caught in",
"// server code... | "blind" exceptions other than those that were deliberately thrown to signal errors to the client | [
"blind",
"exceptions",
"other",
"than",
"those",
"that",
"were",
"deliberately",
"thrown",
"to",
"signal",
"errors",
"to",
"the",
"client"
] | 6fcee92c493c12bf8fd67c7068e67fa6a72a306b | https://github.com/xiamidaxia/xiami/blob/6fcee92c493c12bf8fd67c7068e67fa6a72a306b/meteor/livedata/server/livedata_server.js#L1472-L1493 | |
49,607 | zeropaper/git-beat | lib/git-beat.js | GitBeat | function GitBeat(options) {
var self = this;
var url;
options = options || {};
if (typeof options === 'string') {
url = options;
options = {};
}
this.cwd = path.resolve(options.cwd || '');
this.logger = options.logger || noop;
url = url || options.url;
this.isCloned = false;
if (url) {
... | javascript | function GitBeat(options) {
var self = this;
var url;
options = options || {};
if (typeof options === 'string') {
url = options;
options = {};
}
this.cwd = path.resolve(options.cwd || '');
this.logger = options.logger || noop;
url = url || options.url;
this.isCloned = false;
if (url) {
... | [
"function",
"GitBeat",
"(",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"url",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"typeof",
"options",
"===",
"'string'",
")",
"{",
"url",
"=",
"options",
";",
"options",
... | GitBeat is aimed to take the pulse of Git repositories.
@param {Object|String} options is either an object or the URL of a repository
@param {String} [options.cwd] to set the working directory path
@param {Function} [options.logger] a function to log | [
"GitBeat",
"is",
"aimed",
"to",
"take",
"the",
"pulse",
"of",
"Git",
"repositories",
"."
] | 380e8af87b527287380345303566bd7b27e6c799 | https://github.com/zeropaper/git-beat/blob/380e8af87b527287380345303566bd7b27e6c799/lib/git-beat.js#L23-L44 |
49,608 | wunderbyte/grunt-spiritual-dox | src/js/guidox@wunderbyte.com/spirits/aside/dox.FormSpirit.js | function () {
this._super.onenter ();
this.element.action = "javascript:void(0)";
this._scrollbar ( gui.Client.scrollBarSize );
this._flexboxerize (
this.dom.q ( "label" ),
this.dom.q ( "input" )
);
} | javascript | function () {
this._super.onenter ();
this.element.action = "javascript:void(0)";
this._scrollbar ( gui.Client.scrollBarSize );
this._flexboxerize (
this.dom.q ( "label" ),
this.dom.q ( "input" )
);
} | [
"function",
"(",
")",
"{",
"this",
".",
"_super",
".",
"onenter",
"(",
")",
";",
"this",
".",
"element",
".",
"action",
"=",
"\"javascript:void(0)\"",
";",
"this",
".",
"_scrollbar",
"(",
"gui",
".",
"Client",
".",
"scrollBarSize",
")",
";",
"this",
".... | Layout fixes on startup. | [
"Layout",
"fixes",
"on",
"startup",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/aside/dox.FormSpirit.js#L10-L18 | |
49,609 | wunderbyte/grunt-spiritual-dox | src/js/guidox@wunderbyte.com/spirits/aside/dox.FormSpirit.js | function ( label, input ) {
var avail = this.box.width - label.offsetWidth;
var space = gui.Client.isGecko ? 6 : 4;
input.style.width = avail - space + "px";
} | javascript | function ( label, input ) {
var avail = this.box.width - label.offsetWidth;
var space = gui.Client.isGecko ? 6 : 4;
input.style.width = avail - space + "px";
} | [
"function",
"(",
"label",
",",
"input",
")",
"{",
"var",
"avail",
"=",
"this",
".",
"box",
".",
"width",
"-",
"label",
".",
"offsetWidth",
";",
"var",
"space",
"=",
"gui",
".",
"Client",
".",
"isGecko",
"?",
"6",
":",
"4",
";",
"input",
".",
"sty... | Something that should go to CSS.
@param {HTMLLabelElement} label
@param {HTMLInputElement} input | [
"Something",
"that",
"should",
"go",
"to",
"CSS",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/aside/dox.FormSpirit.js#L40-L44 | |
49,610 | alexpods/ClazzJS | src/components/meta/Base.js | function(clazz, metaData) {
// Apply clazz interface
if (!clazz.__isClazz) {
_.extend(clazz, this.clazz_interface);
}
// Apply interface common for clazz and its prototype
if (!clazz.__interfaces) {
clazz.__interfaces = [];
clazz.prototype.__... | javascript | function(clazz, metaData) {
// Apply clazz interface
if (!clazz.__isClazz) {
_.extend(clazz, this.clazz_interface);
}
// Apply interface common for clazz and its prototype
if (!clazz.__interfaces) {
clazz.__interfaces = [];
clazz.prototype.__... | [
"function",
"(",
"clazz",
",",
"metaData",
")",
"{",
"// Apply clazz interface",
"if",
"(",
"!",
"clazz",
".",
"__isClazz",
")",
"{",
"_",
".",
"extend",
"(",
"clazz",
",",
"this",
".",
"clazz_interface",
")",
";",
"}",
"// Apply interface common for clazz and... | Process meta data for specified clazz
@param {clazz} clazz Clazz
@param {object} metaData Meta data
@throw {Error} if wrong meta data are passed
@this {metaProcessor} | [
"Process",
"meta",
"data",
"for",
"specified",
"clazz"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L29-L69 | |
49,611 | alexpods/ClazzJS | src/components/meta/Base.js | function() {
var processors = this._processors;
_.each(processors, function(processor, name) {
if (_.isString(processor)) {
processors[name] = meta(processor);
}
});
return processors;
} | javascript | function() {
var processors = this._processors;
_.each(processors, function(processor, name) {
if (_.isString(processor)) {
processors[name] = meta(processor);
}
});
return processors;
} | [
"function",
"(",
")",
"{",
"var",
"processors",
"=",
"this",
".",
"_processors",
";",
"_",
".",
"each",
"(",
"processors",
",",
"function",
"(",
"processor",
",",
"name",
")",
"{",
"if",
"(",
"_",
".",
"isString",
"(",
"processor",
")",
")",
"{",
"... | Gets sub processors
@returns {array} Sub processors
@this {metaProcessor} | [
"Gets",
"sub",
"processors"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L78-L88 | |
49,612 | alexpods/ClazzJS | src/components/meta/Base.js | function(processors) {
var that = this;
_.each(processors, function(processor, name) {
if (name in that._processors) {
throw new Error('Processor "' + name + '" already exists!');
}
that._processors[name] = processor;
});
return this;
... | javascript | function(processors) {
var that = this;
_.each(processors, function(processor, name) {
if (name in that._processors) {
throw new Error('Processor "' + name + '" already exists!');
}
that._processors[name] = processor;
});
return this;
... | [
"function",
"(",
"processors",
")",
"{",
"var",
"that",
"=",
"this",
";",
"_",
".",
"each",
"(",
"processors",
",",
"function",
"(",
"processor",
",",
"name",
")",
"{",
"if",
"(",
"name",
"in",
"that",
".",
"_processors",
")",
"{",
"throw",
"new",
... | Sets sub processors
@param {array} processors Sub processors
@returns {metaProcessor} this
@throws {Error} if sub processor already exist
@this {metaProcessor} | [
"Sets",
"sub",
"processors"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L100-L110 | |
49,613 | alexpods/ClazzJS | src/components/meta/Base.js | function(parent) {
var clazzParent = this;
while (clazzParent) {
if (clazzParent === parent || clazzParent.__name === parent) {
return true;
}
clazzParent = clazzParent.__parent;
}
return false;
... | javascript | function(parent) {
var clazzParent = this;
while (clazzParent) {
if (clazzParent === parent || clazzParent.__name === parent) {
return true;
}
clazzParent = clazzParent.__parent;
}
return false;
... | [
"function",
"(",
"parent",
")",
"{",
"var",
"clazzParent",
"=",
"this",
";",
"while",
"(",
"clazzParent",
")",
"{",
"if",
"(",
"clazzParent",
"===",
"parent",
"||",
"clazzParent",
".",
"__name",
"===",
"parent",
")",
"{",
"return",
"true",
";",
"}",
"c... | Checks whether this clazz is sub clazz of specified one
@param {clazz|string} parent Parent clazz
@returns {boolean} true if this clazz is sub clazz of specified one
@this {clazz} | [
"Checks",
"whether",
"this",
"clazz",
"is",
"sub",
"clazz",
"of",
"specified",
"one"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L184-L195 | |
49,614 | alexpods/ClazzJS | src/components/meta/Base.js | function(property) {
if (this.hasOwnProperty(property) && !_.isUndefined(this[property])) {
return this[property];
}
if (this.__proto && this.__proto.hasOwnProperty(property) && !_.isUndefined(this.__proto[property])) {
return this.__proto[property];
... | javascript | function(property) {
if (this.hasOwnProperty(property) && !_.isUndefined(this[property])) {
return this[property];
}
if (this.__proto && this.__proto.hasOwnProperty(property) && !_.isUndefined(this.__proto[property])) {
return this.__proto[property];
... | [
"function",
"(",
"property",
")",
"{",
"if",
"(",
"this",
".",
"hasOwnProperty",
"(",
"property",
")",
"&&",
"!",
"_",
".",
"isUndefined",
"(",
"this",
"[",
"property",
"]",
")",
")",
"{",
"return",
"this",
"[",
"property",
"]",
";",
"}",
"if",
"("... | Collects all property value from current and parent clazzes
@param {string} property Property name
@returns {*} Property value
@this {clazz|object} | [
"Collects",
"all",
"property",
"value",
"from",
"current",
"and",
"parent",
"clazzes"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L241-L258 | |
49,615 | alexpods/ClazzJS | src/components/meta/Base.js | function(property, level /* fields */) {
var propertyContainers = [];
if (this.hasOwnProperty(property)) {
propertyContainers.push(this[property]);
}
if (this.__proto && this.__proto.hasOwnProperty(property)) {
propertyContainers.push(th... | javascript | function(property, level /* fields */) {
var propertyContainers = [];
if (this.hasOwnProperty(property)) {
propertyContainers.push(this[property]);
}
if (this.__proto && this.__proto.hasOwnProperty(property)) {
propertyContainers.push(th... | [
"function",
"(",
"property",
",",
"level",
"/* fields */",
")",
"{",
"var",
"propertyContainers",
"=",
"[",
"]",
";",
"if",
"(",
"this",
".",
"hasOwnProperty",
"(",
"property",
")",
")",
"{",
"propertyContainers",
".",
"push",
"(",
"this",
"[",
"property",... | Collect all property values from current and parent clazzes
@param {string} property Property name
@param {number} level Level of property search depth
@returns {*} Collected property values
@this {clazz|object} | [
"Collect",
"all",
"property",
"values",
"from",
"current",
"and",
"parent",
"clazzes"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L269-L298 | |
49,616 | alexpods/ClazzJS | src/components/meta/Base.js | self | function self(collector, container, level, fields, reverse) {
fields = [].concat(fields || []);
_.each(container, function(value, name) {
if (fields[0] && (name !== fields[0])) {
return;
}
if (level > 1 && _.isSimpleObject(val... | javascript | function self(collector, container, level, fields, reverse) {
fields = [].concat(fields || []);
_.each(container, function(value, name) {
if (fields[0] && (name !== fields[0])) {
return;
}
if (level > 1 && _.isSimpleObject(val... | [
"function",
"self",
"(",
"collector",
",",
"container",
",",
"level",
",",
"fields",
",",
"reverse",
")",
"{",
"fields",
"=",
"[",
"]",
".",
"concat",
"(",
"fields",
"||",
"[",
"]",
")",
";",
"_",
".",
"each",
"(",
"container",
",",
"function",
"("... | Collect values to specified collector
@param {object} collector Collected values will be added to it
@param {object} container Searched for specified fields
@param {number} level Lever of property search depth
@param {array} fields Searching
@param {boolean} reverse If true overwrite collector property v... | [
"Collect",
"values",
"to",
"specified",
"collector"
] | 2f94496019669813c8246d48fcceb12a3e68a870 | https://github.com/alexpods/ClazzJS/blob/2f94496019669813c8246d48fcceb12a3e68a870/src/components/meta/Base.js#L313-L332 |
49,617 | JamesMGreene/node-playerglobal-latest | index.js | function(FLEX_HOME, done) {
var playersDir = path.join(FLEX_HOME, 'frameworks', 'libs', 'player');
if (fs.existsSync(playersDir) && fs.statSync(playersDir).isDirectory()) {
var tmpDirRoot = os.tmpdir ? os.tmpdir() : os.tmpDir();
var tmpOldPlayersDir = path.join(tmpDirRoot, 'node-playerglobal');
... | javascript | function(FLEX_HOME, done) {
var playersDir = path.join(FLEX_HOME, 'frameworks', 'libs', 'player');
if (fs.existsSync(playersDir) && fs.statSync(playersDir).isDirectory()) {
var tmpDirRoot = os.tmpdir ? os.tmpdir() : os.tmpDir();
var tmpOldPlayersDir = path.join(tmpDirRoot, 'node-playerglobal');
... | [
"function",
"(",
"FLEX_HOME",
",",
"done",
")",
"{",
"var",
"playersDir",
"=",
"path",
".",
"join",
"(",
"FLEX_HOME",
",",
"'frameworks'",
",",
"'libs'",
",",
"'player'",
")",
";",
"if",
"(",
"fs",
".",
"existsSync",
"(",
"playersDir",
")",
"&&",
"fs",... | Install these "playerglobal.swc" files into the appropriate location within a Flex SDK directory | [
"Install",
"these",
"playerglobal",
".",
"swc",
"files",
"into",
"the",
"appropriate",
"location",
"within",
"a",
"Flex",
"SDK",
"directory"
] | 600426fb30f62f013f9bcf966115c5cce90a076d | https://github.com/JamesMGreene/node-playerglobal-latest/blob/600426fb30f62f013f9bcf966115c5cce90a076d/index.js#L24-L87 | |
49,618 | wunderbyte/grunt-spiritual-dox | src/js/guidox@wunderbyte.com/spirits/main/dox.MainSpirit.js | function () {
this._super.onready ();
this.element.tabIndex = 0;
this._doctitle ( location.hash );
this.event.add ( "hashchange", window );
} | javascript | function () {
this._super.onready ();
this.element.tabIndex = 0;
this._doctitle ( location.hash );
this.event.add ( "hashchange", window );
} | [
"function",
"(",
")",
"{",
"this",
".",
"_super",
".",
"onready",
"(",
")",
";",
"this",
".",
"element",
".",
"tabIndex",
"=",
"0",
";",
"this",
".",
"_doctitle",
"(",
"location",
".",
"hash",
")",
";",
"this",
".",
"event",
".",
"add",
"(",
"\"h... | Support focus transfer to MAIN
whenever the ASIDE gets closed. | [
"Support",
"focus",
"transfer",
"to",
"MAIN",
"whenever",
"the",
"ASIDE",
"gets",
"closed",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/guidox@wunderbyte.com/spirits/main/dox.MainSpirit.js#L10-L15 | |
49,619 | junosuarez/prometido | index.js | when | function when(promises) {
promises = arrayify(promises);
var whenPromise = new PromiseFactory();
var pending = promises.length;
var results = [];
var resolve = function (i) {
return function (val) {
results[i] = val;
pending--;
if (pending === 0) {
whenPromise.resolve(results);
}
};
};
pr... | javascript | function when(promises) {
promises = arrayify(promises);
var whenPromise = new PromiseFactory();
var pending = promises.length;
var results = [];
var resolve = function (i) {
return function (val) {
results[i] = val;
pending--;
if (pending === 0) {
whenPromise.resolve(results);
}
};
};
pr... | [
"function",
"when",
"(",
"promises",
")",
"{",
"promises",
"=",
"arrayify",
"(",
"promises",
")",
";",
"var",
"whenPromise",
"=",
"new",
"PromiseFactory",
"(",
")",
";",
"var",
"pending",
"=",
"promises",
".",
"length",
";",
"var",
"results",
"=",
"[",
... | Aggregates an array of promises into one promise which is resolved
when every constituent promise is resolved or rejected when some
constituent promise is rejected
@param {Promise|Array.<Promise>} promises
@return {Promise} | [
"Aggregates",
"an",
"array",
"of",
"promises",
"into",
"one",
"promise",
"which",
"is",
"resolved",
"when",
"every",
"constituent",
"promise",
"is",
"resolved",
"or",
"rejected",
"when",
"some",
"constituent",
"promise",
"is",
"rejected"
] | 20ff7a41b355e60d13859770956090cd098ac5c2 | https://github.com/junosuarez/prometido/blob/20ff7a41b355e60d13859770956090cd098ac5c2/index.js#L20-L45 |
49,620 | junosuarez/prometido | index.js | PromiseFactory | function PromiseFactory() {
var deferred = whenjs.defer();
//var timeout = setTimeout(function () { console.log(t, 'Promise timed out')}, 3000);
this.reject = function (err) {
deferred.reject(err);
};
this.resolve = function (val) {
// clearTimeout(timeout);
deferred.resolve(val);
};
this.promise = functio... | javascript | function PromiseFactory() {
var deferred = whenjs.defer();
//var timeout = setTimeout(function () { console.log(t, 'Promise timed out')}, 3000);
this.reject = function (err) {
deferred.reject(err);
};
this.resolve = function (val) {
// clearTimeout(timeout);
deferred.resolve(val);
};
this.promise = functio... | [
"function",
"PromiseFactory",
"(",
")",
"{",
"var",
"deferred",
"=",
"whenjs",
".",
"defer",
"(",
")",
";",
"//var timeout = setTimeout(function () { console.log(t, 'Promise timed out')}, 3000);",
"this",
".",
"reject",
"=",
"function",
"(",
"err",
")",
"{",
"deferred... | Make an object with properly-bound `resolve` and `reject` | [
"Make",
"an",
"object",
"with",
"properly",
"-",
"bound",
"resolve",
"and",
"reject"
] | 20ff7a41b355e60d13859770956090cd098ac5c2 | https://github.com/junosuarez/prometido/blob/20ff7a41b355e60d13859770956090cd098ac5c2/index.js#L92-L106 |
49,621 | junosuarez/prometido | index.js | asPromise | function asPromise (val) {
if (val && typeof val.then === 'function') {
return val;
}
var deferred = new PromiseFactory();
deferred.resolve(val);
return deferred.promise();
} | javascript | function asPromise (val) {
if (val && typeof val.then === 'function') {
return val;
}
var deferred = new PromiseFactory();
deferred.resolve(val);
return deferred.promise();
} | [
"function",
"asPromise",
"(",
"val",
")",
"{",
"if",
"(",
"val",
"&&",
"typeof",
"val",
".",
"then",
"===",
"'function'",
")",
"{",
"return",
"val",
";",
"}",
"var",
"deferred",
"=",
"new",
"PromiseFactory",
"(",
")",
";",
"deferred",
".",
"resolve",
... | Helper function to return a resolved promise with a given value | [
"Helper",
"function",
"to",
"return",
"a",
"resolved",
"promise",
"with",
"a",
"given",
"value"
] | 20ff7a41b355e60d13859770956090cd098ac5c2 | https://github.com/junosuarez/prometido/blob/20ff7a41b355e60d13859770956090cd098ac5c2/index.js#L111-L118 |
49,622 | lisplate/lisplate | spec/lib/jsreporter.js | failures | function failures (items) {
var fs = [], i, v;
for (i = 0; i < items.length; i += 1) {
v = items[i];
if (!v.passed_) {
fs.push(v);
}
}
return fs;
} | javascript | function failures (items) {
var fs = [], i, v;
for (i = 0; i < items.length; i += 1) {
v = items[i];
if (!v.passed_) {
fs.push(v);
}
}
return fs;
} | [
"function",
"failures",
"(",
"items",
")",
"{",
"var",
"fs",
"=",
"[",
"]",
",",
"i",
",",
"v",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"items",
".",
"length",
";",
"i",
"+=",
"1",
")",
"{",
"v",
"=",
"items",
"[",
"i",
"]",
";",
... | Create a new array which contains only the failed items.
@param items Items which will be filtered
@returns {Array} of failed items | [
"Create",
"a",
"new",
"array",
"which",
"contains",
"only",
"the",
"failed",
"items",
"."
] | 75ae58facbe52158270fd40bb9a9d650c97d2ed9 | https://github.com/lisplate/lisplate/blob/75ae58facbe52158270fd40bb9a9d650c97d2ed9/spec/lib/jsreporter.js#L64-L73 |
49,623 | wbyoung/corazon | lib/mixin.js | function() {
return this.__all__.reduce(function(all, mixin) {
return mixin instanceof Mixin.__class__ ?
all.concat(mixin.__flatten__()) :
all.concat([mixin]);
}, []);
} | javascript | function() {
return this.__all__.reduce(function(all, mixin) {
return mixin instanceof Mixin.__class__ ?
all.concat(mixin.__flatten__()) :
all.concat([mixin]);
}, []);
} | [
"function",
"(",
")",
"{",
"return",
"this",
".",
"__all__",
".",
"reduce",
"(",
"function",
"(",
"all",
",",
"mixin",
")",
"{",
"return",
"mixin",
"instanceof",
"Mixin",
".",
"__class__",
"?",
"all",
".",
"concat",
"(",
"mixin",
".",
"__flatten__",
"(... | Create a flattened array of properties are required to be mixed into a
class in the order in which they should be mixed in.
@method
@private
@return {Array.<Object>} The properties | [
"Create",
"a",
"flattened",
"array",
"of",
"properties",
"are",
"required",
"to",
"be",
"mixed",
"into",
"a",
"class",
"in",
"the",
"order",
"in",
"which",
"they",
"should",
"be",
"mixed",
"in",
"."
] | c3cc87f3de28f8e40ab091c8f215479c9e61f379 | https://github.com/wbyoung/corazon/blob/c3cc87f3de28f8e40ab091c8f215479c9e61f379/lib/mixin.js#L38-L44 | |
49,624 | wbyoung/corazon | lib/mixin.js | function(reopen, name) {
return function() {
// the `reopen` function that was passed in to this function will continue
// the process of reopening to the function that this is monkey-patching.
// it is not a recursive call.
// the `recursiveReopen` function, on the other hand, is the reopen
// f... | javascript | function(reopen, name) {
return function() {
// the `reopen` function that was passed in to this function will continue
// the process of reopening to the function that this is monkey-patching.
// it is not a recursive call.
// the `recursiveReopen` function, on the other hand, is the reopen
// f... | [
"function",
"(",
"reopen",
",",
"name",
")",
"{",
"return",
"function",
"(",
")",
"{",
"// the `reopen` function that was passed in to this function will continue",
"// the process of reopening to the function that this is monkey-patching.",
"// it is not a recursive call.",
"// the `r... | Shared function for supporting mixins via `reopen` and `reopenClass`.
@memberof Mixin~ClassPatching
@type function
@private | [
"Shared",
"function",
"for",
"supporting",
"mixins",
"via",
"reopen",
"and",
"reopenClass",
"."
] | c3cc87f3de28f8e40ab091c8f215479c9e61f379 | https://github.com/wbyoung/corazon/blob/c3cc87f3de28f8e40ab091c8f215479c9e61f379/lib/mixin.js#L100-L124 | |
49,625 | loomio/router | docs/traceur-package/services/atParser.js | parseModule | function parseModule(fileInfo) {
var moduleName = file2modulename(fileInfo.relativePath);
var sourceFile = new SourceFile(moduleName, fileInfo.content);
var comments = [];
var moduleTree;
var parser = new Parser(sourceFile);
// Configure the parser
parser.handleComment = function(range) {
... | javascript | function parseModule(fileInfo) {
var moduleName = file2modulename(fileInfo.relativePath);
var sourceFile = new SourceFile(moduleName, fileInfo.content);
var comments = [];
var moduleTree;
var parser = new Parser(sourceFile);
// Configure the parser
parser.handleComment = function(range) {
... | [
"function",
"parseModule",
"(",
"fileInfo",
")",
"{",
"var",
"moduleName",
"=",
"file2modulename",
"(",
"fileInfo",
".",
"relativePath",
")",
";",
"var",
"sourceFile",
"=",
"new",
"SourceFile",
"(",
"moduleName",
",",
"fileInfo",
".",
"content",
")",
";",
"v... | Parse the contents of the file using traceur | [
"Parse",
"the",
"contents",
"of",
"the",
"file",
"using",
"traceur"
] | 4af3b95674216b6a415b802322f5e44b78351d06 | https://github.com/loomio/router/blob/4af3b95674216b6a415b802322f5e44b78351d06/docs/traceur-package/services/atParser.js#L30-L64 |
49,626 | dalekjs/dalek-driver-sauce | lib/commands/cookie.js | function (name, contents, hash) {
this.actionQueue.push(this.webdriverClient.setCookie.bind(this.webdriverClient, {name: name, value: contents}));
this.actionQueue.push(this._setCookieCb.bind(this, name, contents, hash));
return this;
} | javascript | function (name, contents, hash) {
this.actionQueue.push(this.webdriverClient.setCookie.bind(this.webdriverClient, {name: name, value: contents}));
this.actionQueue.push(this._setCookieCb.bind(this, name, contents, hash));
return this;
} | [
"function",
"(",
"name",
",",
"contents",
",",
"hash",
")",
"{",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
".",
"webdriverClient",
".",
"setCookie",
".",
"bind",
"(",
"this",
".",
"webdriverClient",
",",
"{",
"name",
":",
"name",
",",
"valu... | Sets an cookie
@method setCookie
@param {string} name Name of the cookie
@param {string} contents Contents of the cookie
@param {string} hash Unique hash of that fn call
@chainable | [
"Sets",
"an",
"cookie"
] | 4b3ef87a0c35a91db8456d074b0d47a3e0df58f7 | https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/cookie.js#L50-L54 | |
49,627 | dalekjs/dalek-driver-sauce | lib/commands/cookie.js | function (name, cookie, hash) {
this.actionQueue.push(this.webdriverClient.getCookie.bind(this.webdriverClient, name));
this.actionQueue.push(this._cookieCb.bind(this, name, hash));
return this;
} | javascript | function (name, cookie, hash) {
this.actionQueue.push(this.webdriverClient.getCookie.bind(this.webdriverClient, name));
this.actionQueue.push(this._cookieCb.bind(this, name, hash));
return this;
} | [
"function",
"(",
"name",
",",
"cookie",
",",
"hash",
")",
"{",
"this",
".",
"actionQueue",
".",
"push",
"(",
"this",
".",
"webdriverClient",
".",
"getCookie",
".",
"bind",
"(",
"this",
".",
"webdriverClient",
",",
"name",
")",
")",
";",
"this",
".",
... | Retrieves an cookie
@method cookie
@param {string} name Name of the cookie
@param {string} cookie Expected contents of the cookie
@param {string} hash Unique hash of that fn call
@chainable | [
"Retrieves",
"an",
"cookie"
] | 4b3ef87a0c35a91db8456d074b0d47a3e0df58f7 | https://github.com/dalekjs/dalek-driver-sauce/blob/4b3ef87a0c35a91db8456d074b0d47a3e0df58f7/lib/commands/cookie.js#L84-L88 | |
49,628 | jgnewman/brightsocket.io | src/socketpool.js | send | function send(pool, id, event, message) {
const socket = pool.sockets.connected[id];
if (socket) {
return socket.emit(event, message);
} else {
console.log(`Cannot send ${event} to disconnected socket ${id}`);
}
} | javascript | function send(pool, id, event, message) {
const socket = pool.sockets.connected[id];
if (socket) {
return socket.emit(event, message);
} else {
console.log(`Cannot send ${event} to disconnected socket ${id}`);
}
} | [
"function",
"send",
"(",
"pool",
",",
"id",
",",
"event",
",",
"message",
")",
"{",
"const",
"socket",
"=",
"pool",
".",
"sockets",
".",
"connected",
"[",
"id",
"]",
";",
"if",
"(",
"socket",
")",
"{",
"return",
"socket",
".",
"emit",
"(",
"event",... | Sends a message to a single socket connected to socket.io.
@param {Object} pool The socket.io connection pool.
@param {String} id The socket's ID.
@param {String} event The name of the event to emit.
@param {Any} message The serializable message to send.
@return {undefined} | [
"Sends",
"a",
"message",
"to",
"a",
"single",
"socket",
"connected",
"to",
"socket",
".",
"io",
"."
] | 19ec67d69946ab09ca389143ebbdcb0a7f22f950 | https://github.com/jgnewman/brightsocket.io/blob/19ec67d69946ab09ca389143ebbdcb0a7f22f950/src/socketpool.js#L59-L66 |
49,629 | pdubroy/jsjoins | index.js | newChannel | function newChannel() {
let chan = new Channel();
let result = chan.send.bind(chan);
result._inst = chan;
return result;
} | javascript | function newChannel() {
let chan = new Channel();
let result = chan.send.bind(chan);
result._inst = chan;
return result;
} | [
"function",
"newChannel",
"(",
")",
"{",
"let",
"chan",
"=",
"new",
"Channel",
"(",
")",
";",
"let",
"result",
"=",
"chan",
".",
"send",
".",
"bind",
"(",
"chan",
")",
";",
"result",
".",
"_inst",
"=",
"chan",
";",
"return",
"result",
";",
"}"
] | Create a new synchronous channel, and return a function which sends a message on that channel. | [
"Create",
"a",
"new",
"synchronous",
"channel",
"and",
"return",
"a",
"function",
"which",
"sends",
"a",
"message",
"on",
"that",
"channel",
"."
] | 5848fe6e9695f4af7254be8cb7f6b5c61db577eb | https://github.com/pdubroy/jsjoins/blob/5848fe6e9695f4af7254be8cb7f6b5c61db577eb/index.js#L249-L254 |
49,630 | yefremov/aggregatejs | variance.js | variance | function variance(array) {
var length = array.length;
if (length === 0) {
throw new RangeError('Error');
}
var index = -1;
var mean = 0;
while (++index < length) {
mean += array[index] / length;
}
var result = 0;
for (var i = 0; i < length; i++) {
result += Math.pow(array[i] - mean, 2... | javascript | function variance(array) {
var length = array.length;
if (length === 0) {
throw new RangeError('Error');
}
var index = -1;
var mean = 0;
while (++index < length) {
mean += array[index] / length;
}
var result = 0;
for (var i = 0; i < length; i++) {
result += Math.pow(array[i] - mean, 2... | [
"function",
"variance",
"(",
"array",
")",
"{",
"var",
"length",
"=",
"array",
".",
"length",
";",
"if",
"(",
"length",
"===",
"0",
")",
"{",
"throw",
"new",
"RangeError",
"(",
"'Error'",
")",
";",
"}",
"var",
"index",
"=",
"-",
"1",
";",
"var",
... | Returns the variance population of the numbers in `array`.
@param {Array} array
@return {number}
@example
variance([2, 4, 4, 4, 5, 5, 7, 9]);
// => 4 | [
"Returns",
"the",
"variance",
"population",
"of",
"the",
"numbers",
"in",
"array",
"."
] | 932b28a15a5707135e7095950000a838db409511 | https://github.com/yefremov/aggregatejs/blob/932b28a15a5707135e7095950000a838db409511/variance.js#L19-L40 |
49,631 | derdesign/protos | engines/swig.js | Swig | function Swig() {
var opts = (app.config.engines && app.config.engines.swig) || {};
this.options = protos.extend({
cache: false
}, opts);
swig.setDefaults(this.options); // Set options for swig
this.module = swig;
this.multiPart = true;
this.extensions = ['swig', 'swig.html'];
} | javascript | function Swig() {
var opts = (app.config.engines && app.config.engines.swig) || {};
this.options = protos.extend({
cache: false
}, opts);
swig.setDefaults(this.options); // Set options for swig
this.module = swig;
this.multiPart = true;
this.extensions = ['swig', 'swig.html'];
} | [
"function",
"Swig",
"(",
")",
"{",
"var",
"opts",
"=",
"(",
"app",
".",
"config",
".",
"engines",
"&&",
"app",
".",
"config",
".",
"engines",
".",
"swig",
")",
"||",
"{",
"}",
";",
"this",
".",
"options",
"=",
"protos",
".",
"extend",
"(",
"{",
... | Swig engine class
https://github.com/paularmstrong/swig | [
"Swig",
"engine",
"class"
] | 0b679b2a7581dfbb5d065fd4b0914436ef4ef2c9 | https://github.com/derdesign/protos/blob/0b679b2a7581dfbb5d065fd4b0914436ef4ef2c9/engines/swig.js#L14-L28 |
49,632 | warmsea/WarmseaJS | src/debug.js | function(name) {
if (debuggers[name]) {
return debuggers[name];
}
var dbg = function(fmt) {
// if this debugger is not enabled, do nothing.
// Check it every time so we can enable or disable a debugger at runtime.
// It won't be slow.
if (!enableStatus[this._nam... | javascript | function(name) {
if (debuggers[name]) {
return debuggers[name];
}
var dbg = function(fmt) {
// if this debugger is not enabled, do nothing.
// Check it every time so we can enable or disable a debugger at runtime.
// It won't be slow.
if (!enableStatus[this._nam... | [
"function",
"(",
"name",
")",
"{",
"if",
"(",
"debuggers",
"[",
"name",
"]",
")",
"{",
"return",
"debuggers",
"[",
"name",
"]",
";",
"}",
"var",
"dbg",
"=",
"function",
"(",
"fmt",
")",
"{",
"// if this debugger is not enabled, do nothing.",
"// Check it eve... | Create a debugger function with a name.
@param {string} name
@return {function} | [
"Create",
"a",
"debugger",
"function",
"with",
"a",
"name",
"."
] | 58c32c75b26647bbec39dc401a78b0fdb5896c8d | https://github.com/warmsea/WarmseaJS/blob/58c32c75b26647bbec39dc401a78b0fdb5896c8d/src/debug.js#L81-L116 | |
49,633 | warmsea/WarmseaJS | src/debug.js | function(fmt) {
if (fmt instanceof Error) {
return fmt.stack || fmt.message;
} else {
return w.format.apply(this, arguments);
}
} | javascript | function(fmt) {
if (fmt instanceof Error) {
return fmt.stack || fmt.message;
} else {
return w.format.apply(this, arguments);
}
} | [
"function",
"(",
"fmt",
")",
"{",
"if",
"(",
"fmt",
"instanceof",
"Error",
")",
"{",
"return",
"fmt",
".",
"stack",
"||",
"fmt",
".",
"message",
";",
"}",
"else",
"{",
"return",
"w",
".",
"format",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
... | Coerce `fmt`. | [
"Coerce",
"fmt",
"."
] | 58c32c75b26647bbec39dc401a78b0fdb5896c8d | https://github.com/warmsea/WarmseaJS/blob/58c32c75b26647bbec39dc401a78b0fdb5896c8d/src/debug.js#L121-L127 | |
49,634 | warmsea/WarmseaJS | src/debug.js | function(ms) {
var sec = 1000;
var min = 60 * 1000;
var hour = 60 * min;
if (ms >= hour) {
return (ms / hour).toFixed(1) + 'h';
}
if (ms >= min) {
return (ms / min).toFixed(1) + 'm';
}
if (ms >= sec) {
return (ms / sec | 0) + 's';
}
re... | javascript | function(ms) {
var sec = 1000;
var min = 60 * 1000;
var hour = 60 * min;
if (ms >= hour) {
return (ms / hour).toFixed(1) + 'h';
}
if (ms >= min) {
return (ms / min).toFixed(1) + 'm';
}
if (ms >= sec) {
return (ms / sec | 0) + 's';
}
re... | [
"function",
"(",
"ms",
")",
"{",
"var",
"sec",
"=",
"1000",
";",
"var",
"min",
"=",
"60",
"*",
"1000",
";",
"var",
"hour",
"=",
"60",
"*",
"min",
";",
"if",
"(",
"ms",
">=",
"hour",
")",
"{",
"return",
"(",
"ms",
"/",
"hour",
")",
".",
"toF... | Humanize the given milliseconds.
@param {number} ms number of milliseconds.
@return {string} A human readable representation. | [
"Humanize",
"the",
"given",
"milliseconds",
"."
] | 58c32c75b26647bbec39dc401a78b0fdb5896c8d | https://github.com/warmsea/WarmseaJS/blob/58c32c75b26647bbec39dc401a78b0fdb5896c8d/src/debug.js#L141-L156 | |
49,635 | rabbitlive/rabbitpack | src/entry.js | wxappEntry | function wxappEntry() {
const regex = /src\/pages\/([^\/]+)\/[^\.]+.js/;
return {
entry: () => {
let pages = {}
let core = []
glob.sync(`./src/pages/**/*.js`).forEach(x => {
const name = x.match(regex)[1]
const key = `pages/${name}/${name}`
pages[key] = x
})... | javascript | function wxappEntry() {
const regex = /src\/pages\/([^\/]+)\/[^\.]+.js/;
return {
entry: () => {
let pages = {}
let core = []
glob.sync(`./src/pages/**/*.js`).forEach(x => {
const name = x.match(regex)[1]
const key = `pages/${name}/${name}`
pages[key] = x
})... | [
"function",
"wxappEntry",
"(",
")",
"{",
"const",
"regex",
"=",
"/",
"src\\/pages\\/([^\\/]+)\\/[^\\.]+.js",
"/",
";",
"return",
"{",
"entry",
":",
"(",
")",
"=>",
"{",
"let",
"pages",
"=",
"{",
"}",
"let",
"core",
"=",
"[",
"]",
"glob",
".",
"sync",
... | WeChat app looks like multi entries app.
@see https://github.com/rabbitlive/rabbitinit/tree/master/wxapp | [
"WeChat",
"app",
"looks",
"like",
"multi",
"entries",
"app",
"."
] | 8d572a88e660cc4bcf67a39f9c877f8213ded845 | https://github.com/rabbitlive/rabbitpack/blob/8d572a88e660cc4bcf67a39f9c877f8213ded845/src/entry.js#L70-L95 |
49,636 | SebastianOsuna/configure.js | bin/configure.js | setup | function setup() {
// check if config directory is given
if( _config_path !== -1 ) {
// get path
var config_path = path.resolve( process.argv[ _config_path + 1 ] );
// check if directory exists and is a valid directory
fs.stat( config_path, function( err, stats ) {
if( err && ... | javascript | function setup() {
// check if config directory is given
if( _config_path !== -1 ) {
// get path
var config_path = path.resolve( process.argv[ _config_path + 1 ] );
// check if directory exists and is a valid directory
fs.stat( config_path, function( err, stats ) {
if( err && ... | [
"function",
"setup",
"(",
")",
"{",
"// check if config directory is given",
"if",
"(",
"_config_path",
"!==",
"-",
"1",
")",
"{",
"// get path",
"var",
"config_path",
"=",
"path",
".",
"resolve",
"(",
"process",
".",
"argv",
"[",
"_config_path",
"+",
"1",
"... | Starts the config files setup process. It first asks for the configuration file directory. It then fetches for all
configuration files in the given directory and starts asking for the user values of each entry in each found file. | [
"Starts",
"the",
"config",
"files",
"setup",
"process",
".",
"It",
"first",
"asks",
"for",
"the",
"configuration",
"file",
"directory",
".",
"It",
"then",
"fetches",
"for",
"all",
"configuration",
"files",
"in",
"the",
"given",
"directory",
"and",
"starts",
... | 39551c58d92a4ce065df25e6b9999b8495ca4833 | https://github.com/SebastianOsuna/configure.js/blob/39551c58d92a4ce065df25e6b9999b8495ca4833/bin/configure.js#L106-L135 |
49,637 | SebastianOsuna/configure.js | bin/configure.js | handleConfigEntry | function handleConfigEntry ( defaults, values, parent_name, cb ) {
var entries = Object.keys( defaults ),
c = 0;
var cont = function () { // entry handling function
if( c < entries.length ) {
var key = entries[ c ],
entry = defaults[ key ];
if ( typeof... | javascript | function handleConfigEntry ( defaults, values, parent_name, cb ) {
var entries = Object.keys( defaults ),
c = 0;
var cont = function () { // entry handling function
if( c < entries.length ) {
var key = entries[ c ],
entry = defaults[ key ];
if ( typeof... | [
"function",
"handleConfigEntry",
"(",
"defaults",
",",
"values",
",",
"parent_name",
",",
"cb",
")",
"{",
"var",
"entries",
"=",
"Object",
".",
"keys",
"(",
"defaults",
")",
",",
"c",
"=",
"0",
";",
"var",
"cont",
"=",
"function",
"(",
")",
"{",
"// ... | Recursive handling of config object. It asks the user for values of the each attribute of the config.defaults object.
If the user skips an attribute, the default value is taken.
@param defaults Configuration default values.
@param values Configuration user given values.
@param parent_name Current config object parent n... | [
"Recursive",
"handling",
"of",
"config",
"object",
".",
"It",
"asks",
"the",
"user",
"for",
"values",
"of",
"the",
"each",
"attribute",
"of",
"the",
"config",
".",
"defaults",
"object",
".",
"If",
"the",
"user",
"skips",
"an",
"attribute",
"the",
"default"... | 39551c58d92a4ce065df25e6b9999b8495ca4833 | https://github.com/SebastianOsuna/configure.js/blob/39551c58d92a4ce065df25e6b9999b8495ca4833/bin/configure.js#L145-L209 |
49,638 | beeblebrox3/super-helpers | src/object/index.js | function (paths, obj, defaultValue = null) {
if (!Array.isArray(paths)) {
throw new Error("paths must be an array of strings");
}
let res = defaultValue;
paths.some(path => {
const result = this.getFlattened(path, obj, defaultValue);
if (result !== de... | javascript | function (paths, obj, defaultValue = null) {
if (!Array.isArray(paths)) {
throw new Error("paths must be an array of strings");
}
let res = defaultValue;
paths.some(path => {
const result = this.getFlattened(path, obj, defaultValue);
if (result !== de... | [
"function",
"(",
"paths",
",",
"obj",
",",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"paths",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"paths must be an array of strings\"",
")",
";",
"}",
"let",
"res",
... | Receives a list of paths and use getFlattened to get the first existent value
@param {String[]} paths
@param {Object} obj
@param {any} defaultValue
@return {any}
@see getFlattened
@memberof object | [
"Receives",
"a",
"list",
"of",
"paths",
"and",
"use",
"getFlattened",
"to",
"get",
"the",
"first",
"existent",
"value"
] | 15deaf3509bfe47817e6dd3ecd3e6879743b7dd9 | https://github.com/beeblebrox3/super-helpers/blob/15deaf3509bfe47817e6dd3ecd3e6879743b7dd9/src/object/index.js#L49-L65 | |
49,639 | beeblebrox3/super-helpers | src/object/index.js | function (obj) {
"use strict";
if (Object.getPrototypeOf(obj) !== Object.prototype) {
throw Error("obj must be an Object");
}
return Object.keys(obj)[0] || null;
} | javascript | function (obj) {
"use strict";
if (Object.getPrototypeOf(obj) !== Object.prototype) {
throw Error("obj must be an Object");
}
return Object.keys(obj)[0] || null;
} | [
"function",
"(",
"obj",
")",
"{",
"\"use strict\"",
";",
"if",
"(",
"Object",
".",
"getPrototypeOf",
"(",
"obj",
")",
"!==",
"Object",
".",
"prototype",
")",
"{",
"throw",
"Error",
"(",
"\"obj must be an Object\"",
")",
";",
"}",
"return",
"Object",
".",
... | Get first key of an object or null if it doesn't have keys
@param {Object} obj
@return {*}
@memberof object | [
"Get",
"first",
"key",
"of",
"an",
"object",
"or",
"null",
"if",
"it",
"doesn",
"t",
"have",
"keys"
] | 15deaf3509bfe47817e6dd3ecd3e6879743b7dd9 | https://github.com/beeblebrox3/super-helpers/blob/15deaf3509bfe47817e6dd3ecd3e6879743b7dd9/src/object/index.js#L106-L114 | |
49,640 | vkiding/jud-vue-render | src/render/vue/modules/dom.js | function (key, styles) {
key = camelToKebab(key)
let stylesText = ''
for (const k in styles) {
if (styles.hasOwnProperty(k)) {
stylesText += camelToKebab(k) + ':' + styles[k] + ';'
}
}
const styleText = `@${key}{${stylesText}}`
appendCss(styleText, 'dom-added-rules')
} | javascript | function (key, styles) {
key = camelToKebab(key)
let stylesText = ''
for (const k in styles) {
if (styles.hasOwnProperty(k)) {
stylesText += camelToKebab(k) + ':' + styles[k] + ';'
}
}
const styleText = `@${key}{${stylesText}}`
appendCss(styleText, 'dom-added-rules')
} | [
"function",
"(",
"key",
",",
"styles",
")",
"{",
"key",
"=",
"camelToKebab",
"(",
"key",
")",
"let",
"stylesText",
"=",
"''",
"for",
"(",
"const",
"k",
"in",
"styles",
")",
"{",
"if",
"(",
"styles",
".",
"hasOwnProperty",
"(",
"k",
")",
")",
"{",
... | for adding fontFace
@param {string} key fontFace
@param {object} styles rules | [
"for",
"adding",
"fontFace"
] | 07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47 | https://github.com/vkiding/jud-vue-render/blob/07d8ab08d0ef86cf2819e5f2bf1f4b06381f4d47/src/render/vue/modules/dom.js#L139-L149 | |
49,641 | lightningtgc/grunt-at-csstidy | tasks/csstidy.js | preHandleSrc | function preHandleSrc (cssSrc) {
/*
* fix like: .a{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e6529dda', endColorstr='#e6529dda', GradientType=0)\9;}
* which has two semicolon( : ) will cause parse error.
*/
cssSrc = cssSrc.replac... | javascript | function preHandleSrc (cssSrc) {
/*
* fix like: .a{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e6529dda', endColorstr='#e6529dda', GradientType=0)\9;}
* which has two semicolon( : ) will cause parse error.
*/
cssSrc = cssSrc.replac... | [
"function",
"preHandleSrc",
"(",
"cssSrc",
")",
"{",
"/* \n * fix like: .a{ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e6529dda', endColorstr='#e6529dda', GradientType=0)\\9;}\n * which has two semicolon( : ) will cause parse error.\n */",
"c... | Handle special case | [
"Handle",
"special",
"case"
] | efdcf07f7e49b910be289e52834c6e2022b7dd97 | https://github.com/lightningtgc/grunt-at-csstidy/blob/efdcf07f7e49b910be289e52834c6e2022b7dd97/tasks/csstidy.js#L25-L88 |
49,642 | huafu/ember-marked | addon/components/code-section.js | function (code, language, bare) {
var result;
if (typeof hljs !== 'undefined') {
if (language) {
try {
result = hljs.highlight(language, code, true);
}
catch (e) {
Ember.warn(
'[marked] Failing to highlight some code with language `' + language +
... | javascript | function (code, language, bare) {
var result;
if (typeof hljs !== 'undefined') {
if (language) {
try {
result = hljs.highlight(language, code, true);
}
catch (e) {
Ember.warn(
'[marked] Failing to highlight some code with language `' + language +
... | [
"function",
"(",
"code",
",",
"language",
",",
"bare",
")",
"{",
"var",
"result",
";",
"if",
"(",
"typeof",
"hljs",
"!==",
"'undefined'",
")",
"{",
"if",
"(",
"language",
")",
"{",
"try",
"{",
"result",
"=",
"hljs",
".",
"highlight",
"(",
"language",... | Highlighter function, using highlight.js if available
@method highlight
@param {String} code
@param {String} [language]
@param {Boolean} [bare=false]
@returns {String|{value: String, language: String}} | [
"Highlighter",
"function",
"using",
"highlight",
".",
"js",
"if",
"available"
] | 372f7aad36cfc5fd6fd9faaef8f561d692852d23 | https://github.com/huafu/ember-marked/blob/372f7aad36cfc5fd6fd9faaef8f561d692852d23/addon/components/code-section.js#L88-L123 | |
49,643 | Antyfive/teo-logger | lib/logger.js | _parseErrors | function _parseErrors() {
let errors = [].slice.call(arguments);
let parsed = [];
errors.forEach(err => {
let message = (err instanceof Error) ? err.stack : err.toString();
parsed.push(message);
});
return parsed;
} | javascript | function _parseErrors() {
let errors = [].slice.call(arguments);
let parsed = [];
errors.forEach(err => {
let message = (err instanceof Error) ? err.stack : err.toString();
parsed.push(message);
});
return parsed;
} | [
"function",
"_parseErrors",
"(",
")",
"{",
"let",
"errors",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
";",
"let",
"parsed",
"=",
"[",
"]",
";",
"errors",
".",
"forEach",
"(",
"err",
"=>",
"{",
"let",
"message",
"=",
"(",
"e... | Parses errors. Expects Error instance, or string with message
@returns {Array}
@private | [
"Parses",
"errors",
".",
"Expects",
"Error",
"instance",
"or",
"string",
"with",
"message"
] | 5b632e1ddb939dc839181313ab2e23061d6c2db8 | https://github.com/Antyfive/teo-logger/blob/5b632e1ddb939dc839181313ab2e23061d6c2db8/lib/logger.js#L18-L28 |
49,644 | Antyfive/teo-logger | lib/logger.js | _log | function _log(message) {
if (cluster.isMaster) {
// write directly to the log file
console.log(_format(message));
}
else {
// send to master
cluster.worker.process.send({
type: "logging",
data: {
message: message,
worker... | javascript | function _log(message) {
if (cluster.isMaster) {
// write directly to the log file
console.log(_format(message));
}
else {
// send to master
cluster.worker.process.send({
type: "logging",
data: {
message: message,
worker... | [
"function",
"_log",
"(",
"message",
")",
"{",
"if",
"(",
"cluster",
".",
"isMaster",
")",
"{",
"// write directly to the log file",
"console",
".",
"log",
"(",
"_format",
"(",
"message",
")",
")",
";",
"}",
"else",
"{",
"// send to master",
"cluster",
".",
... | Logs message. Forwards message from child process to master
@param {String} message
@private | [
"Logs",
"message",
".",
"Forwards",
"message",
"from",
"child",
"process",
"to",
"master"
] | 5b632e1ddb939dc839181313ab2e23061d6c2db8 | https://github.com/Antyfive/teo-logger/blob/5b632e1ddb939dc839181313ab2e23061d6c2db8/lib/logger.js#L56-L72 |
49,645 | crcn/mojo-views | lib/views/base/index.js | BaseView | function BaseView (properties, application) {
// note that if application is not defined, this.application will
// default to the default, global application.
this.application = application;
this._onParent = _.bind(this._onParent, this);
SubindableObject.call(this, properties);
/**
* The main app... | javascript | function BaseView (properties, application) {
// note that if application is not defined, this.application will
// default to the default, global application.
this.application = application;
this._onParent = _.bind(this._onParent, this);
SubindableObject.call(this, properties);
/**
* The main app... | [
"function",
"BaseView",
"(",
"properties",
",",
"application",
")",
"{",
"// note that if application is not defined, this.application will",
"// default to the default, global application.",
"this",
".",
"application",
"=",
"application",
";",
"this",
".",
"_onParent",
"=",
... | Called when the view is rendered
@event render
Called when the view is remove
@event remove | [
"Called",
"when",
"the",
"view",
"is",
"rendered"
] | 5c4899fb8f117f98ad02a34b714ebb0cc646caba | https://github.com/crcn/mojo-views/blob/5c4899fb8f117f98ad02a34b714ebb0cc646caba/lib/views/base/index.js#L31-L51 |
49,646 | crcn/mojo-views | lib/views/base/index.js | function (data) {
this.on("change:parent", this._onParent);
// copy the data to this object. Note this shaves a TON
// of time off initializing any view, especially list items if we
// use this method over @setProperties data
if (false) {
for(var key in data) {
this[key] = data[key];
... | javascript | function (data) {
this.on("change:parent", this._onParent);
// copy the data to this object. Note this shaves a TON
// of time off initializing any view, especially list items if we
// use this method over @setProperties data
if (false) {
for(var key in data) {
this[key] = data[key];
... | [
"function",
"(",
"data",
")",
"{",
"this",
".",
"on",
"(",
"\"change:parent\"",
",",
"this",
".",
"_onParent",
")",
";",
"// copy the data to this object. Note this shaves a TON",
"// of time off initializing any view, especially list items if we",
"// use this method over @setPr... | Called when the view is instantiated
@method initialize
@param {Object} options options passed when creating the view | [
"Called",
"when",
"the",
"view",
"is",
"instantiated"
] | 5c4899fb8f117f98ad02a34b714ebb0cc646caba | https://github.com/crcn/mojo-views/blob/5c4899fb8f117f98ad02a34b714ebb0cc646caba/lib/views/base/index.js#L96-L110 | |
49,647 | crcn/mojo-views | lib/views/base/index.js | function () {
var path = [], cp = this;
while (cp) {
path.unshift(cp.name || cp.constructor.name);
cp = cp.parent;
}
return path.join(".");
} | javascript | function () {
var path = [], cp = this;
while (cp) {
path.unshift(cp.name || cp.constructor.name);
cp = cp.parent;
}
return path.join(".");
} | [
"function",
"(",
")",
"{",
"var",
"path",
"=",
"[",
"]",
",",
"cp",
"=",
"this",
";",
"while",
"(",
"cp",
")",
"{",
"path",
".",
"unshift",
"(",
"cp",
".",
"name",
"||",
"cp",
".",
"constructor",
".",
"name",
")",
";",
"cp",
"=",
"cp",
".",
... | Returns the path to the view
@method path | [
"Returns",
"the",
"path",
"to",
"the",
"view"
] | 5c4899fb8f117f98ad02a34b714ebb0cc646caba | https://github.com/crcn/mojo-views/blob/5c4899fb8f117f98ad02a34b714ebb0cc646caba/lib/views/base/index.js#L144-L153 | |
49,648 | crcn/mojo-views | lib/views/base/index.js | function () {
// if rendered, then just return the fragment
if (this._rendered) {
return this.section.render();
}
this._rendered = true;
if (this._cleanupJanitor) {
this._cleanupJanitor.dispose();
}
if (!this.section) {
this._createSection();
}
this.willRender(... | javascript | function () {
// if rendered, then just return the fragment
if (this._rendered) {
return this.section.render();
}
this._rendered = true;
if (this._cleanupJanitor) {
this._cleanupJanitor.dispose();
}
if (!this.section) {
this._createSection();
}
this.willRender(... | [
"function",
"(",
")",
"{",
"// if rendered, then just return the fragment",
"if",
"(",
"this",
".",
"_rendered",
")",
"{",
"return",
"this",
".",
"section",
".",
"render",
"(",
")",
";",
"}",
"this",
".",
"_rendered",
"=",
"true",
";",
"if",
"(",
"this",
... | Renders the view
@method render
@return {Object} document fragment | [
"Renders",
"the",
"view"
] | 5c4899fb8f117f98ad02a34b714ebb0cc646caba | https://github.com/crcn/mojo-views/blob/5c4899fb8f117f98ad02a34b714ebb0cc646caba/lib/views/base/index.js#L161-L187 | |
49,649 | crcn/mojo-views | lib/views/base/index.js | function (search) {
if (!this.section) this.render();
var el = noselector(this.section.getChildNodes());
if (arguments.length) {
return el.find(search).andSelf().filter(search);
}
return el;
} | javascript | function (search) {
if (!this.section) this.render();
var el = noselector(this.section.getChildNodes());
if (arguments.length) {
return el.find(search).andSelf().filter(search);
}
return el;
} | [
"function",
"(",
"search",
")",
"{",
"if",
"(",
"!",
"this",
".",
"section",
")",
"this",
".",
"render",
"(",
")",
";",
"var",
"el",
"=",
"noselector",
"(",
"this",
".",
"section",
".",
"getChildNodes",
"(",
")",
")",
";",
"if",
"(",
"arguments",
... | jquery selector for elements owned by the view
@method $
@param {String} selector | [
"jquery",
"selector",
"for",
"elements",
"owned",
"by",
"the",
"view"
] | 5c4899fb8f117f98ad02a34b714ebb0cc646caba | https://github.com/crcn/mojo-views/blob/5c4899fb8f117f98ad02a34b714ebb0cc646caba/lib/views/base/index.js#L248-L258 | |
49,650 | benderjs/dom-combiner | lib/combiner.js | merge | function merge( elem, callback ) {
var old = find( destChildren, elem.name ),
nl;
// merge with old element
if ( old ) {
if ( typeof callback == 'function' ) {
return callback( old );
}
_.merge( old.attribs, elem.attribs );
if ( elem.children ) {
combine( old, elem );
}
// append n... | javascript | function merge( elem, callback ) {
var old = find( destChildren, elem.name ),
nl;
// merge with old element
if ( old ) {
if ( typeof callback == 'function' ) {
return callback( old );
}
_.merge( old.attribs, elem.attribs );
if ( elem.children ) {
combine( old, elem );
}
// append n... | [
"function",
"merge",
"(",
"elem",
",",
"callback",
")",
"{",
"var",
"old",
"=",
"find",
"(",
"destChildren",
",",
"elem",
".",
"name",
")",
",",
"nl",
";",
"// merge with old element",
"if",
"(",
"old",
")",
"{",
"if",
"(",
"typeof",
"callback",
"==",
... | Merge element with equivalent found in destination
@param {Object} elem Source element
@param {Function} callback Callback called when equivalent found | [
"Merge",
"element",
"with",
"equivalent",
"found",
"in",
"destination"
] | 6971337fff22668664906da757fc29b8a6f4cad1 | https://github.com/benderjs/dom-combiner/blob/6971337fff22668664906da757fc29b8a6f4cad1/lib/combiner.js#L57-L84 |
49,651 | benderjs/dom-combiner | lib/combiner.js | mergeDoctype | function mergeDoctype( elem ) {
merge( elem, function( old ) {
utils.replaceElement( old, elem );
destChildren[ destChildren.indexOf( old ) ] = elem;
} );
} | javascript | function mergeDoctype( elem ) {
merge( elem, function( old ) {
utils.replaceElement( old, elem );
destChildren[ destChildren.indexOf( old ) ] = elem;
} );
} | [
"function",
"mergeDoctype",
"(",
"elem",
")",
"{",
"merge",
"(",
"elem",
",",
"function",
"(",
"old",
")",
"{",
"utils",
".",
"replaceElement",
"(",
"old",
",",
"elem",
")",
";",
"destChildren",
"[",
"destChildren",
".",
"indexOf",
"(",
"old",
")",
"]"... | Merge doctype directives
@param {Object} elem New doctype directive | [
"Merge",
"doctype",
"directives"
] | 6971337fff22668664906da757fc29b8a6f4cad1 | https://github.com/benderjs/dom-combiner/blob/6971337fff22668664906da757fc29b8a6f4cad1/lib/combiner.js#L90-L95 |
49,652 | the-labo/the-resource-user | example/example-usage.js | signup | async function signup (username, password, options = {}) {
let { email = null, profile = {}, roles = [] } = options
let user = await User.create({ username, email })
user.sign = await UserSign.create({ user, password })
user.profile = await UserProfile.create({ user, profile })
user.roles = await Us... | javascript | async function signup (username, password, options = {}) {
let { email = null, profile = {}, roles = [] } = options
let user = await User.create({ username, email })
user.sign = await UserSign.create({ user, password })
user.profile = await UserProfile.create({ user, profile })
user.roles = await Us... | [
"async",
"function",
"signup",
"(",
"username",
",",
"password",
",",
"options",
"=",
"{",
"}",
")",
"{",
"let",
"{",
"email",
"=",
"null",
",",
"profile",
"=",
"{",
"}",
",",
"roles",
"=",
"[",
"]",
"}",
"=",
"options",
"let",
"user",
"=",
"awai... | Signup an user | [
"Signup",
"an",
"user"
] | c11b720e7e29325bef8299729f7b29d638cb4888 | https://github.com/the-labo/the-resource-user/blob/c11b720e7e29325bef8299729f7b29d638cb4888/example/example-usage.js#L29-L37 |
49,653 | the-labo/the-resource-user | example/example-usage.js | signin | async function signin (username, password, options = {}) {
let { agent } = options
let user = await User.only({ username })
let sign = user && await UserSign.only({ user })
let valid = sign && await sign.testPassword(password)
if (!valid) {
throw new Error('Signin failed!')
}
await use... | javascript | async function signin (username, password, options = {}) {
let { agent } = options
let user = await User.only({ username })
let sign = user && await UserSign.only({ user })
let valid = sign && await sign.testPassword(password)
if (!valid) {
throw new Error('Signin failed!')
}
await use... | [
"async",
"function",
"signin",
"(",
"username",
",",
"password",
",",
"options",
"=",
"{",
"}",
")",
"{",
"let",
"{",
"agent",
"}",
"=",
"options",
"let",
"user",
"=",
"await",
"User",
".",
"only",
"(",
"{",
"username",
"}",
")",
"let",
"sign",
"="... | Start user session | [
"Start",
"user",
"session"
] | c11b720e7e29325bef8299729f7b29d638cb4888 | https://github.com/the-labo/the-resource-user/blob/c11b720e7e29325bef8299729f7b29d638cb4888/example/example-usage.js#L40-L51 |
49,654 | wunderbyte/grunt-spiritual-edbml | tasks/things/compiler.js | FunctionCompiler | function FunctionCompiler() {
var _this;
_classCallCheck(this, FunctionCompiler);
_this = _possibleConstructorReturn(this, _getPrototypeOf(FunctionCompiler).call(this));
/**
* Compile sequence.
* @type {Array<function>}
*/
_this._sequence = [_this._uncomment, _this._validate, _this... | javascript | function FunctionCompiler() {
var _this;
_classCallCheck(this, FunctionCompiler);
_this = _possibleConstructorReturn(this, _getPrototypeOf(FunctionCompiler).call(this));
/**
* Compile sequence.
* @type {Array<function>}
*/
_this._sequence = [_this._uncomment, _this._validate, _this... | [
"function",
"FunctionCompiler",
"(",
")",
"{",
"var",
"_this",
";",
"_classCallCheck",
"(",
"this",
",",
"FunctionCompiler",
")",
";",
"_this",
"=",
"_possibleConstructorReturn",
"(",
"this",
",",
"_getPrototypeOf",
"(",
"FunctionCompiler",
")",
".",
"call",
"("... | Construction time again. | [
"Construction",
"time",
"again",
"."
] | 2ba0aa8042eceee917f1ee48c7881345df3bce46 | https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/tasks/things/compiler.js#L523-L578 |
49,655 | wunderbyte/grunt-spiritual-edbml | tasks/things/compiler.js | ScriptCompiler | function ScriptCompiler() {
var _this4;
_classCallCheck(this, ScriptCompiler);
_this4 = _possibleConstructorReturn(this, _getPrototypeOf(ScriptCompiler).call(this));
_this4.inputs = {};
return _this4;
} | javascript | function ScriptCompiler() {
var _this4;
_classCallCheck(this, ScriptCompiler);
_this4 = _possibleConstructorReturn(this, _getPrototypeOf(ScriptCompiler).call(this));
_this4.inputs = {};
return _this4;
} | [
"function",
"ScriptCompiler",
"(",
")",
"{",
"var",
"_this4",
";",
"_classCallCheck",
"(",
"this",
",",
"ScriptCompiler",
")",
";",
"_this4",
"=",
"_possibleConstructorReturn",
"(",
"this",
",",
"_getPrototypeOf",
"(",
"ScriptCompiler",
")",
".",
"call",
"(",
... | Map observed types.
Add custom sequence.
@param {string} key | [
"Map",
"observed",
"types",
".",
"Add",
"custom",
"sequence",
"."
] | 2ba0aa8042eceee917f1ee48c7881345df3bce46 | https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/tasks/things/compiler.js#L802-L810 |
49,656 | wunderbyte/grunt-spiritual-edbml | tasks/things/compiler.js | strip | function strip(script) {
script = this._stripout(script, '<!--', '-->');
script = this._stripout(script, '/*', '*/');
script = this._stripout(script, '^//', '\n');
return script;
} | javascript | function strip(script) {
script = this._stripout(script, '<!--', '-->');
script = this._stripout(script, '/*', '*/');
script = this._stripout(script, '^//', '\n');
return script;
} | [
"function",
"strip",
"(",
"script",
")",
"{",
"script",
"=",
"this",
".",
"_stripout",
"(",
"script",
",",
"'<!--'",
",",
"'-->'",
")",
";",
"script",
"=",
"this",
".",
"_stripout",
"(",
"script",
",",
"'/*'",
",",
"'*/'",
")",
";",
"script",
"=",
... | Strip HTML and JS comments.
@param {string} script
@returns {string} | [
"Strip",
"HTML",
"and",
"JS",
"comments",
"."
] | 2ba0aa8042eceee917f1ee48c7881345df3bce46 | https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/tasks/things/compiler.js#L941-L946 |
49,657 | wunderbyte/grunt-spiritual-edbml | tasks/things/compiler.js | Runner | function Runner() {
_classCallCheck(this, Runner);
this.firstline = false;
this.lastline = false;
this.firstchar = false;
this.lastchar = false;
this._line = null;
this._index = -1;
} | javascript | function Runner() {
_classCallCheck(this, Runner);
this.firstline = false;
this.lastline = false;
this.firstchar = false;
this.lastchar = false;
this._line = null;
this._index = -1;
} | [
"function",
"Runner",
"(",
")",
"{",
"_classCallCheck",
"(",
"this",
",",
"Runner",
")",
";",
"this",
".",
"firstline",
"=",
"false",
";",
"this",
".",
"lastline",
"=",
"false",
";",
"this",
".",
"firstchar",
"=",
"false",
";",
"this",
".",
"lastchar",... | Let's go. | [
"Let",
"s",
"go",
"."
] | 2ba0aa8042eceee917f1ee48c7881345df3bce46 | https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/tasks/things/compiler.js#L1061-L1070 |
49,658 | wunderbyte/grunt-spiritual-edbml | tasks/things/compiler.js | Output | function Output() {
var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
_classCallCheck(this, Output);
this.body = body;
this.temp = null;
} | javascript | function Output() {
var body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
_classCallCheck(this, Output);
this.body = body;
this.temp = null;
} | [
"function",
"Output",
"(",
")",
"{",
"var",
"body",
"=",
"arguments",
".",
"length",
">",
"0",
"&&",
"arguments",
"[",
"0",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"0",
"]",
":",
"''",
";",
"_classCallCheck",
"(",
"this",
",",
"Output",
")",
... | Collecting JS code. | [
"Collecting",
"JS",
"code",
"."
] | 2ba0aa8042eceee917f1ee48c7881345df3bce46 | https://github.com/wunderbyte/grunt-spiritual-edbml/blob/2ba0aa8042eceee917f1ee48c7881345df3bce46/tasks/things/compiler.js#L1722-L1729 |
49,659 | andrewscwei/requiem | src/dom/getState.js | getState | function getState(element) {
assertType(element, Node, false, 'Invalid element specified');
let state = element.state || element.getAttribute(Directive.STATE);
if (!state || state === '')
return null;
else
return state;
} | javascript | function getState(element) {
assertType(element, Node, false, 'Invalid element specified');
let state = element.state || element.getAttribute(Directive.STATE);
if (!state || state === '')
return null;
else
return state;
} | [
"function",
"getState",
"(",
"element",
")",
"{",
"assertType",
"(",
"element",
",",
"Node",
",",
"false",
",",
"'Invalid element specified'",
")",
";",
"let",
"state",
"=",
"element",
".",
"state",
"||",
"element",
".",
"getAttribute",
"(",
"Directive",
"."... | Gets the current state of a DOM element as defined by Directive.STATE.
@param {Node} element - Target element.
@return {string} State of the target element.
@alias module:requiem~dom.getState | [
"Gets",
"the",
"current",
"state",
"of",
"a",
"DOM",
"element",
"as",
"defined",
"by",
"Directive",
".",
"STATE",
"."
] | c4182bfffc9841c6de5718f689ad3c2060511777 | https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/dom/getState.js#L17-L26 |
49,660 | bertez/quenda | dist/quenda.js | function(step) {
if (!step) {
throw new Error('Not enough arguments');
}
if (Array.isArray(step)) {
step.forEach(function(s) {
this.add(s);
}, this);
} else {
if (step.nextDelay && step.... | javascript | function(step) {
if (!step) {
throw new Error('Not enough arguments');
}
if (Array.isArray(step)) {
step.forEach(function(s) {
this.add(s);
}, this);
} else {
if (step.nextDelay && step.... | [
"function",
"(",
"step",
")",
"{",
"if",
"(",
"!",
"step",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Not enough arguments'",
")",
";",
"}",
"if",
"(",
"Array",
".",
"isArray",
"(",
"step",
")",
")",
"{",
"step",
".",
"forEach",
"(",
"function",
"("... | Adds a new step to this queue
@param {Object} Step definition
@return {Object} This queue instance | [
"Adds",
"a",
"new",
"step",
"to",
"this",
"queue"
] | 63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3 | https://github.com/bertez/quenda/blob/63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3/dist/quenda.js#L28-L58 | |
49,661 | bertez/quenda | dist/quenda.js | function(index) {
var step;
if (!this.steps[index]) {
if (this.config.loop && this._loops < this.config.maxLoops) {
this._loops++;
step = this.steps[this._current = 0];
} else {
return false;
... | javascript | function(index) {
var step;
if (!this.steps[index]) {
if (this.config.loop && this._loops < this.config.maxLoops) {
this._loops++;
step = this.steps[this._current = 0];
} else {
return false;
... | [
"function",
"(",
"index",
")",
"{",
"var",
"step",
";",
"if",
"(",
"!",
"this",
".",
"steps",
"[",
"index",
"]",
")",
"{",
"if",
"(",
"this",
".",
"config",
".",
"loop",
"&&",
"this",
".",
"_loops",
"<",
"this",
".",
"config",
".",
"maxLoops",
... | Executes one element of the queue
@param {number} index the element index | [
"Executes",
"one",
"element",
"of",
"the",
"queue"
] | 63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3 | https://github.com/bertez/quenda/blob/63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3/dist/quenda.js#L118-L156 | |
49,662 | bertez/quenda | dist/quenda.js | function(nextDelay) {
var delay = nextDelay || this.config.defaultDelay;
if (delay && this._playing) {
this._currentTimeout = setTimeout(function() {
this._executeStep(++this._current);
}.bind(this), delay);
}
} | javascript | function(nextDelay) {
var delay = nextDelay || this.config.defaultDelay;
if (delay && this._playing) {
this._currentTimeout = setTimeout(function() {
this._executeStep(++this._current);
}.bind(this), delay);
}
} | [
"function",
"(",
"nextDelay",
")",
"{",
"var",
"delay",
"=",
"nextDelay",
"||",
"this",
".",
"config",
".",
"defaultDelay",
";",
"if",
"(",
"delay",
"&&",
"this",
".",
"_playing",
")",
"{",
"this",
".",
"_currentTimeout",
"=",
"setTimeout",
"(",
"functio... | Sets the execution timeout of the next element in the queue
@param {number} nextDelay the delay in ms | [
"Sets",
"the",
"execution",
"timeout",
"of",
"the",
"next",
"element",
"in",
"the",
"queue"
] | 63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3 | https://github.com/bertez/quenda/blob/63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3/dist/quenda.js#L161-L169 | |
49,663 | bertez/quenda | dist/quenda.js | function(images, callback) {
var loaded = 0;
images.forEach(function(src) {
var image = new Image();
image.onload = function() {
++loaded;
loaded === images.length && callback();
};
image.src ... | javascript | function(images, callback) {
var loaded = 0;
images.forEach(function(src) {
var image = new Image();
image.onload = function() {
++loaded;
loaded === images.length && callback();
};
image.src ... | [
"function",
"(",
"images",
",",
"callback",
")",
"{",
"var",
"loaded",
"=",
"0",
";",
"images",
".",
"forEach",
"(",
"function",
"(",
"src",
")",
"{",
"var",
"image",
"=",
"new",
"Image",
"(",
")",
";",
"image",
".",
"onload",
"=",
"function",
"(",... | Handles the image preload
@param {Array} images array of image urls
@param {Function} callback callback to execute after all the images are loaded | [
"Handles",
"the",
"image",
"preload"
] | 63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3 | https://github.com/bertez/quenda/blob/63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3/dist/quenda.js#L175-L185 | |
49,664 | bertez/quenda | dist/quenda.js | function(config, name) {
if (config && config !== Object(config)) {
throw new Error('Config object should be a key/value object.');
}
var defaultConfig = {
loop: false,
maxLoops: Infinity
};
var instance = Obje... | javascript | function(config, name) {
if (config && config !== Object(config)) {
throw new Error('Config object should be a key/value object.');
}
var defaultConfig = {
loop: false,
maxLoops: Infinity
};
var instance = Obje... | [
"function",
"(",
"config",
",",
"name",
")",
"{",
"if",
"(",
"config",
"&&",
"config",
"!==",
"Object",
"(",
"config",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Config object should be a key/value object.'",
")",
";",
"}",
"var",
"defaultConfig",
"=",
... | Create a new queue
@param {Object} [config] The queue configuration
@param {[type]} [name] The queue name
@return {[type]} The queue instance | [
"Create",
"a",
"new",
"queue"
] | 63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3 | https://github.com/bertez/quenda/blob/63d9adf3e5c22b9417b6fefd4d78f2cce58afbb3/dist/quenda.js#L230-L255 | |
49,665 | cli-kit/cli-help | lib/doc/doc.js | function(program) {
this.cli = program;
this.cmd = this.cli;
if(process.env.CLI_TOOLKIT_HELP_CMD) {
var alias = this.cli.finder.getCommandByName;
var cmd = alias(process.env.CLI_TOOLKIT_HELP_CMD, this.cli.commands());
if(cmd) {
this.cmd = cmd;
}
}
this.eol = eol;
this.format = fmt.TEXT... | javascript | function(program) {
this.cli = program;
this.cmd = this.cli;
if(process.env.CLI_TOOLKIT_HELP_CMD) {
var alias = this.cli.finder.getCommandByName;
var cmd = alias(process.env.CLI_TOOLKIT_HELP_CMD, this.cli.commands());
if(cmd) {
this.cmd = cmd;
}
}
this.eol = eol;
this.format = fmt.TEXT... | [
"function",
"(",
"program",
")",
"{",
"this",
".",
"cli",
"=",
"program",
";",
"this",
".",
"cmd",
"=",
"this",
".",
"cli",
";",
"if",
"(",
"process",
".",
"env",
".",
"CLI_TOOLKIT_HELP_CMD",
")",
"{",
"var",
"alias",
"=",
"this",
".",
"cli",
".",
... | Abstract super class for help documents.
@param program The program instance. | [
"Abstract",
"super",
"class",
"for",
"help",
"documents",
"."
] | 09613efdd753452b466d4deb7c5391c4926e3f04 | https://github.com/cli-kit/cli-help/blob/09613efdd753452b466d4deb7c5391c4926e3f04/lib/doc/doc.js#L27-L87 | |
49,666 | Nazariglez/perenquen | lib/pixi/src/core/renderers/webgl/filters/AbstractFilter.js | AbstractFilter | function AbstractFilter(vertexSrc, fragmentSrc, uniforms)
{
/**
* An array of shaders
* @member {Shader[]}
* @private
*/
this.shaders = [];
/**
* The extra padding that the filter might need
* @member {number}
*/
this.padding = 0;
/**
* The uniforms as an o... | javascript | function AbstractFilter(vertexSrc, fragmentSrc, uniforms)
{
/**
* An array of shaders
* @member {Shader[]}
* @private
*/
this.shaders = [];
/**
* The extra padding that the filter might need
* @member {number}
*/
this.padding = 0;
/**
* The uniforms as an o... | [
"function",
"AbstractFilter",
"(",
"vertexSrc",
",",
"fragmentSrc",
",",
"uniforms",
")",
"{",
"/**\n * An array of shaders\n * @member {Shader[]}\n * @private\n */",
"this",
".",
"shaders",
"=",
"[",
"]",
";",
"/**\n * The extra padding that the filter might ... | This is the base class for creating a PIXI filter. Currently only WebGL supports filters.
If you want to make a custom filter this should be your base class.
@class
@memberof PIXI
@param vertexSrc {string|string[]} The vertex shader source as an array of strings.
@param fragmentSrc {string|string[]} The fragment shade... | [
"This",
"is",
"the",
"base",
"class",
"for",
"creating",
"a",
"PIXI",
"filter",
".",
"Currently",
"only",
"WebGL",
"supports",
"filters",
".",
"If",
"you",
"want",
"to",
"make",
"a",
"custom",
"filter",
"this",
"should",
"be",
"your",
"base",
"class",
".... | e023964d05afeefebdcac4e2044819fdfa3899ae | https://github.com/Nazariglez/perenquen/blob/e023964d05afeefebdcac4e2044819fdfa3899ae/lib/pixi/src/core/renderers/webgl/filters/AbstractFilter.js#L13-L55 |
49,667 | sourcegraph/defnode.js | defnode.js | function(type, node) {
return seen.indexOf(node) == -1 && ((type == 'AssignmentExpression' && node.right == expr) || (type == 'VariableDeclarator' && node.init == expr));
} | javascript | function(type, node) {
return seen.indexOf(node) == -1 && ((type == 'AssignmentExpression' && node.right == expr) || (type == 'VariableDeclarator' && node.init == expr));
} | [
"function",
"(",
"type",
",",
"node",
")",
"{",
"return",
"seen",
".",
"indexOf",
"(",
"node",
")",
"==",
"-",
"1",
"&&",
"(",
"(",
"type",
"==",
"'AssignmentExpression'",
"&&",
"node",
".",
"right",
"==",
"expr",
")",
"||",
"(",
"type",
"==",
"'Va... | Traverse to parent AssignmentExpressions to return all names in chained assignments. | [
"Traverse",
"to",
"parent",
"AssignmentExpressions",
"to",
"return",
"all",
"names",
"in",
"chained",
"assignments",
"."
] | 8808c966b813d1887f9aaf40643f5a196aafa71d | https://github.com/sourcegraph/defnode.js/blob/8808c966b813d1887f9aaf40643f5a196aafa71d/defnode.js#L170-L172 | |
49,668 | creationix/culvert | wrap-node-socket.js | wrapNodeSocket | function wrapNodeSocket(socket, reportError) {
// Data traveling from node socket to consumer
var incoming = makeChannel();
// Data traveling from consumer to node socket
var outgoing = makeChannel();
var onDrain2 = wrapHandler(onReadable, onError);
onTake = wrapHandler(onTake, onError);
var paused = fa... | javascript | function wrapNodeSocket(socket, reportError) {
// Data traveling from node socket to consumer
var incoming = makeChannel();
// Data traveling from consumer to node socket
var outgoing = makeChannel();
var onDrain2 = wrapHandler(onReadable, onError);
onTake = wrapHandler(onTake, onError);
var paused = fa... | [
"function",
"wrapNodeSocket",
"(",
"socket",
",",
"reportError",
")",
"{",
"// Data traveling from node socket to consumer",
"var",
"incoming",
"=",
"makeChannel",
"(",
")",
";",
"// Data traveling from consumer to node socket",
"var",
"outgoing",
"=",
"makeChannel",
"(",
... | Given a duplex node stream, return a culvert duplex channel. | [
"Given",
"a",
"duplex",
"node",
"stream",
"return",
"a",
"culvert",
"duplex",
"channel",
"."
] | 42b83894041cd7f8ee3993af0df65c1afe17b2c5 | https://github.com/creationix/culvert/blob/42b83894041cd7f8ee3993af0df65c1afe17b2c5/wrap-node-socket.js#L6-L78 |
49,669 | tylerwalters/aias | dist/aias.js | request | function request (type, url, data) {
return new Promise(function (fulfill, reject) {
// Set ajax to correct XHR type. Source: https://gist.github.com/jed/993585
var Xhr = window.XMLHttpRequest||ActiveXObject,
req = new Xhr('MSXML2.XMLHTTP.3.0');
req.open(type, url, true);
req.setRequestHeader('Conte... | javascript | function request (type, url, data) {
return new Promise(function (fulfill, reject) {
// Set ajax to correct XHR type. Source: https://gist.github.com/jed/993585
var Xhr = window.XMLHttpRequest||ActiveXObject,
req = new Xhr('MSXML2.XMLHTTP.3.0');
req.open(type, url, true);
req.setRequestHeader('Conte... | [
"function",
"request",
"(",
"type",
",",
"url",
",",
"data",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"fulfill",
",",
"reject",
")",
"{",
"// Set ajax to correct XHR type. Source: https://gist.github.com/jed/993585",
"var",
"Xhr",
"=",
"window",
... | Attempts to parse the response as JSON otherwise returns it untouched.
@param {string} type The HTTP verb to be used.
@param {string} url The url for the XHR request.
@param {object} data Optional. The data to be passed with a POST or PUT request.
@memberof aias | [
"Attempts",
"to",
"parse",
"the",
"response",
"as",
"JSON",
"otherwise",
"returns",
"it",
"untouched",
"."
] | 798011b6e3585296a8ead80f74b1f9f05ce02cdf | https://github.com/tylerwalters/aias/blob/798011b6e3585296a8ead80f74b1f9f05ce02cdf/dist/aias.js#L38-L59 |
49,670 | PointSource/cordova-browsersync-primitives | startBrowserSync.js | monkeyPatch | function monkeyPatch() {
var script = function() {
window.__karma__ = true;
(function patch() {
if (typeof window.__bs === 'undefined') {
window.setTimeout(patch, 500);
} else {
var oldCanSync = window.__bs.prototype.canSync;
window.__bs.prototype.canSync = function(data, optPath) {
data.url... | javascript | function monkeyPatch() {
var script = function() {
window.__karma__ = true;
(function patch() {
if (typeof window.__bs === 'undefined') {
window.setTimeout(patch, 500);
} else {
var oldCanSync = window.__bs.prototype.canSync;
window.__bs.prototype.canSync = function(data, optPath) {
data.url... | [
"function",
"monkeyPatch",
"(",
")",
"{",
"var",
"script",
"=",
"function",
"(",
")",
"{",
"window",
".",
"__karma__",
"=",
"true",
";",
"(",
"function",
"patch",
"(",
")",
"{",
"if",
"(",
"typeof",
"window",
".",
"__bs",
"===",
"'undefined'",
")",
"... | Private function that adds the code snippet to deal with reloading
files when they are served from platform folders | [
"Private",
"function",
"that",
"adds",
"the",
"code",
"snippet",
"to",
"deal",
"with",
"reloading",
"files",
"when",
"they",
"are",
"served",
"from",
"platform",
"folders"
] | 2117d846d45d1d4a8978847ef6fd1708f33f0e20 | https://github.com/PointSource/cordova-browsersync-primitives/blob/2117d846d45d1d4a8978847ef6fd1708f33f0e20/startBrowserSync.js#L12-L28 |
49,671 | PointSource/cordova-browsersync-primitives | startBrowserSync.js | startBrowserSync | function startBrowserSync(cordovaDir, platforms, opts, cb) {
var defaults = {
logFileChanges: true,
logConnections: true,
open: false,
snippetOptions: {
rule: {
match: /<\/body>/i,
fn: function(snippet, match) {
return monkeyPatch() + snippet + match;
}
}
},
minify: false,
watchOpt... | javascript | function startBrowserSync(cordovaDir, platforms, opts, cb) {
var defaults = {
logFileChanges: true,
logConnections: true,
open: false,
snippetOptions: {
rule: {
match: /<\/body>/i,
fn: function(snippet, match) {
return monkeyPatch() + snippet + match;
}
}
},
minify: false,
watchOpt... | [
"function",
"startBrowserSync",
"(",
"cordovaDir",
",",
"platforms",
",",
"opts",
",",
"cb",
")",
"{",
"var",
"defaults",
"=",
"{",
"logFileChanges",
":",
"true",
",",
"logConnections",
":",
"true",
",",
"open",
":",
"false",
",",
"snippetOptions",
":",
"{... | Starts the browser sync server.
@param {String} cordovaDir - File path to the root of the cordova project (where the platforms/ directory can be found)
@param {Array} platforms - Array of strings, each of which is a Cordova platform name to serve.
@param {Object} opts - Options Object to be passed to browserSync. If th... | [
"Starts",
"the",
"browser",
"sync",
"server",
"."
] | 2117d846d45d1d4a8978847ef6fd1708f33f0e20 | https://github.com/PointSource/cordova-browsersync-primitives/blob/2117d846d45d1d4a8978847ef6fd1708f33f0e20/startBrowserSync.js#L38-L92 |
49,672 | danillouz/product-hunt | src/index.js | productHunt | function productHunt() {
let queryParams = { };
return {
/**
* Sets the request query parameters to fetch the
* most popular products from Product Hunt.
*
* @return {Object} `productHunt` module
*/
popular() {
queryParams.filter = 'popular';
return this;
},
/**
* Sets the request q... | javascript | function productHunt() {
let queryParams = { };
return {
/**
* Sets the request query parameters to fetch the
* most popular products from Product Hunt.
*
* @return {Object} `productHunt` module
*/
popular() {
queryParams.filter = 'popular';
return this;
},
/**
* Sets the request q... | [
"function",
"productHunt",
"(",
")",
"{",
"let",
"queryParams",
"=",
"{",
"}",
";",
"return",
"{",
"/**\n\t\t * Sets the request query parameters to fetch the\n\t\t * most popular products from Product Hunt.\n\t\t *\n\t\t * @return {Object} `productHunt` module\n\t\t */",
"popular",
"(... | Creates interface to build requests to retrieve products
from the public Product Hunt API.
@return {Object} `productHunt` module | [
"Creates",
"interface",
"to",
"build",
"requests",
"to",
"retrieve",
"products",
"from",
"the",
"public",
"Product",
"Hunt",
"API",
"."
] | de7196db39365874055ad363cf3736de6de13856 | https://github.com/danillouz/product-hunt/blob/de7196db39365874055ad363cf3736de6de13856/src/index.js#L17-L107 |
49,673 | LaxarJS/karma-laxar | lib/index.js | readRequireConfig | function readRequireConfig( file ) {
'use strict';
var config = fs.readFileSync( file );
/*jshint -W054*/
var evaluate = new Function( 'var window = this;' + config + '; return require || window.require;' );
return evaluate.call( {} );
} | javascript | function readRequireConfig( file ) {
'use strict';
var config = fs.readFileSync( file );
/*jshint -W054*/
var evaluate = new Function( 'var window = this;' + config + '; return require || window.require;' );
return evaluate.call( {} );
} | [
"function",
"readRequireConfig",
"(",
"file",
")",
"{",
"'use strict'",
";",
"var",
"config",
"=",
"fs",
".",
"readFileSync",
"(",
"file",
")",
";",
"/*jshint -W054*/",
"var",
"evaluate",
"=",
"new",
"Function",
"(",
"'var window = this;'",
"+",
"config",
"+",... | Evaluate the require_config.js file and return the configuration. | [
"Evaluate",
"the",
"require_config",
".",
"js",
"file",
"and",
"return",
"the",
"configuration",
"."
] | 959680d5ae6336bb0ca86ce77eab70fde087ae9b | https://github.com/LaxarJS/karma-laxar/blob/959680d5ae6336bb0ca86ce77eab70fde087ae9b/lib/index.js#L23-L29 |
49,674 | ctrees/msfeature | lib/utils/detect-series.js | _detect | function _detect(eachFn, arr, iterator, mainCallback) {
eachFn(arr, function (x, index, callback) {
iterator(x, function (v, result) {
if (v) {
mainCallback(result || x);
mainCallback = async.noop;
} else {
callback();
}
});
}, function () {
mainCallback();
})... | javascript | function _detect(eachFn, arr, iterator, mainCallback) {
eachFn(arr, function (x, index, callback) {
iterator(x, function (v, result) {
if (v) {
mainCallback(result || x);
mainCallback = async.noop;
} else {
callback();
}
});
}, function () {
mainCallback();
})... | [
"function",
"_detect",
"(",
"eachFn",
",",
"arr",
",",
"iterator",
",",
"mainCallback",
")",
"{",
"eachFn",
"(",
"arr",
",",
"function",
"(",
"x",
",",
"index",
",",
"callback",
")",
"{",
"iterator",
"(",
"x",
",",
"function",
"(",
"v",
",",
"result"... | From async.js, modified to return an optional result.
@param eachFn
@param arr
@param iterator
@param mainCallback
@private | [
"From",
"async",
".",
"js",
"modified",
"to",
"return",
"an",
"optional",
"result",
"."
] | 5ee14fe11ade502ab2b47467717094ea9ea7b6ec | https://github.com/ctrees/msfeature/blob/5ee14fe11ade502ab2b47467717094ea9ea7b6ec/lib/utils/detect-series.js#L20-L33 |
49,675 | tolokoban/ToloFrameWork | ker/mod/tfw.pointer-events.js | getCurrentTarget | function getCurrentTarget( slot ) {
if( !G.target ) return null;
for( var i = 0 ; i < G.target.length ; i++ ) {
var target = G.target[i];
if( !slot || typeof target.slots[slot] === 'function' ) return target;
}
return null;
} | javascript | function getCurrentTarget( slot ) {
if( !G.target ) return null;
for( var i = 0 ; i < G.target.length ; i++ ) {
var target = G.target[i];
if( !slot || typeof target.slots[slot] === 'function' ) return target;
}
return null;
} | [
"function",
"getCurrentTarget",
"(",
"slot",
")",
"{",
"if",
"(",
"!",
"G",
".",
"target",
")",
"return",
"null",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"G",
".",
"target",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"target"... | Return the first taget listening on this `slot`. | [
"Return",
"the",
"first",
"taget",
"listening",
"on",
"this",
"slot",
"."
] | 730845a833a9660ebfdb60ad027ebaab5ac871b6 | https://github.com/tolokoban/ToloFrameWork/blob/730845a833a9660ebfdb60ad027ebaab5ac871b6/ker/mod/tfw.pointer-events.js#L359-L366 |
49,676 | MeldCE/skemer | src/lib/skemer.js | validateNew | function validateNew(options) {
options = validateOptions(options);
//console.log('options after validation', util.inspect(options, {depth: null}));
//return;
//console.log('skemer.validateAdd called', arguments);
return validateData.apply(this, [options,
undefined].concat(Array.prototype.slice.call(... | javascript | function validateNew(options) {
options = validateOptions(options);
//console.log('options after validation', util.inspect(options, {depth: null}));
//return;
//console.log('skemer.validateAdd called', arguments);
return validateData.apply(this, [options,
undefined].concat(Array.prototype.slice.call(... | [
"function",
"validateNew",
"(",
"options",
")",
"{",
"options",
"=",
"validateOptions",
"(",
"options",
")",
";",
"//console.log('options after validation', util.inspect(options, {depth: null}));",
"//return;",
"//console.log('skemer.validateAdd called', arguments);",
"return",
"va... | Validate and merge new data based on the given schema.
@param {Object} options An object containing the validation
[`options`]{@link #options}, including the [`schema`]{@link #schema}
@param {...*} newData Data to validate, merge and return
@returns {*} Validated and merged data | [
"Validate",
"and",
"merge",
"new",
"data",
"based",
"on",
"the",
"given",
"schema",
"."
] | 9ef7b00c7c96db5d13c368180b2f660e571de44c | https://github.com/MeldCE/skemer/blob/9ef7b00c7c96db5d13c368180b2f660e571de44c/src/lib/skemer.js#L740-L749 |
49,677 | MeldCE/skemer | src/lib/skemer.js | function () {
return validateData.apply(this, [this.options,
undefined].concat(Array.prototype.slice.call(arguments)));
} | javascript | function () {
return validateData.apply(this, [this.options,
undefined].concat(Array.prototype.slice.call(arguments)));
} | [
"function",
"(",
")",
"{",
"return",
"validateData",
".",
"apply",
"(",
"this",
",",
"[",
"this",
".",
"options",
",",
"undefined",
"]",
".",
"concat",
"(",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
")",
")",
";",
... | Validate and merge new data based on the stored schema.
@param {...*} newData Data to validate, merge and return. If no data is
given, a variable containing any default values, if configured,
will be returned.
@returns {*} Validated and merged data | [
"Validate",
"and",
"merge",
"new",
"data",
"based",
"on",
"the",
"stored",
"schema",
"."
] | 9ef7b00c7c96db5d13c368180b2f660e571de44c | https://github.com/MeldCE/skemer/blob/9ef7b00c7c96db5d13c368180b2f660e571de44c/src/lib/skemer.js#L955-L958 | |
49,678 | redisjs/jsr-server | lib/command/server/slowlog.js | reset | function reset(req, res) {
this.state.slowlog.reset();
res.send(null, Constants.OK);
} | javascript | function reset(req, res) {
this.state.slowlog.reset();
res.send(null, Constants.OK);
} | [
"function",
"reset",
"(",
"req",
",",
"res",
")",
"{",
"this",
".",
"state",
".",
"slowlog",
".",
"reset",
"(",
")",
";",
"res",
".",
"send",
"(",
"null",
",",
"Constants",
".",
"OK",
")",
";",
"}"
] | Respond to the RESET subcommand. | [
"Respond",
"to",
"the",
"RESET",
"subcommand",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/slowlog.js#L34-L37 |
49,679 | redisjs/jsr-server | lib/command/server/slowlog.js | validate | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
var sub = info.command.sub
, scmd = ('' + sub.cmd)
, args = sub.args
, amount;
if(scmd === Constants.SUBCOMMAND.slowlog.get.name && args.length) {
if(args.length > 1) {
throw new CommandArgLength... | javascript | function validate(cmd, args, info) {
AbstractCommand.prototype.validate.apply(this, arguments);
var sub = info.command.sub
, scmd = ('' + sub.cmd)
, args = sub.args
, amount;
if(scmd === Constants.SUBCOMMAND.slowlog.get.name && args.length) {
if(args.length > 1) {
throw new CommandArgLength... | [
"function",
"validate",
"(",
"cmd",
",",
"args",
",",
"info",
")",
"{",
"AbstractCommand",
".",
"prototype",
".",
"validate",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"var",
"sub",
"=",
"info",
".",
"command",
".",
"sub",
",",
"scmd",
"... | Validate the SLOWLOG subcommands. | [
"Validate",
"the",
"SLOWLOG",
"subcommands",
"."
] | 49413052d3039524fbdd2ade0ef9bae26cb4d647 | https://github.com/redisjs/jsr-server/blob/49413052d3039524fbdd2ade0ef9bae26cb4d647/lib/command/server/slowlog.js#L42-L59 |
49,680 | freeqaz/sassify-object | sassify.js | sassifyFn | function sassifyFn(rawObject) {
var sassified = '';
Object.keys(rawObject).forEach(function iterateVariables(key) {
var variable = rawObject[key];
var stringified = JSON.stringify(variable);
// Trim off double quotes for CSS variables.
stringified = stringified.substring(1, stringified.length - 1... | javascript | function sassifyFn(rawObject) {
var sassified = '';
Object.keys(rawObject).forEach(function iterateVariables(key) {
var variable = rawObject[key];
var stringified = JSON.stringify(variable);
// Trim off double quotes for CSS variables.
stringified = stringified.substring(1, stringified.length - 1... | [
"function",
"sassifyFn",
"(",
"rawObject",
")",
"{",
"var",
"sassified",
"=",
"''",
";",
"Object",
".",
"keys",
"(",
"rawObject",
")",
".",
"forEach",
"(",
"function",
"iterateVariables",
"(",
"key",
")",
"{",
"var",
"variable",
"=",
"rawObject",
"[",
"k... | Converts a single-depth javascript object into SASS variables.
@param {Object} rawObject Object to convert to SASS variables.
@returns {string} Sass content with variables defined. | [
"Converts",
"a",
"single",
"-",
"depth",
"javascript",
"object",
"into",
"SASS",
"variables",
"."
] | a828e884dd7b588d7b7cf3f7b4c7302a7d9b789f | https://github.com/freeqaz/sassify-object/blob/a828e884dd7b588d7b7cf3f7b4c7302a7d9b789f/sassify.js#L10-L25 |
49,681 | andrewscwei/requiem | src/helpers/noval.js | noval | function noval(value, recursive) {
assertType(recursive, 'boolean', true, 'Invalid parameter: recursive');
if (recursive === undefined) recursive = false;
if (value === undefined || value === null) {
return true;
}
else if (typeof value === 'string') {
return (value === '');
}
else if (recursive... | javascript | function noval(value, recursive) {
assertType(recursive, 'boolean', true, 'Invalid parameter: recursive');
if (recursive === undefined) recursive = false;
if (value === undefined || value === null) {
return true;
}
else if (typeof value === 'string') {
return (value === '');
}
else if (recursive... | [
"function",
"noval",
"(",
"value",
",",
"recursive",
")",
"{",
"assertType",
"(",
"recursive",
",",
"'boolean'",
",",
"true",
",",
"'Invalid parameter: recursive'",
")",
";",
"if",
"(",
"recursive",
"===",
"undefined",
")",
"recursive",
"=",
"false",
";",
"i... | Checks if a given value is equal to null. Option to specify recursion, which
would further evaluate inner elements, such as when an Array or Object is
specified.
@param {*} value - Value to evaluate.
@param {boolean} [recursive=false] - Specifies whether to recursively
evaluate the supplied value's inner
values (i.e. ... | [
"Checks",
"if",
"a",
"given",
"value",
"is",
"equal",
"to",
"null",
".",
"Option",
"to",
"specify",
"recursion",
"which",
"would",
"further",
"evaluate",
"inner",
"elements",
"such",
"as",
"when",
"an",
"Array",
"or",
"Object",
"is",
"specified",
"."
] | c4182bfffc9841c6de5718f689ad3c2060511777 | https://github.com/andrewscwei/requiem/blob/c4182bfffc9841c6de5718f689ad3c2060511777/src/helpers/noval.js#L21-L51 |
49,682 | Psychopoulet/node-promfs | lib/extends/_filesToStream.js | _readContent | function _readContent (files, writeStream, separator) {
return 0 >= files.length ? Promise.resolve() : Promise.resolve().then(() => {
const file = files.shift().trim();
return isFileProm(file).then((exists) => {
const isPattern = -1 < separator.indexOf("{{filename}}");
return !exists ? _readCo... | javascript | function _readContent (files, writeStream, separator) {
return 0 >= files.length ? Promise.resolve() : Promise.resolve().then(() => {
const file = files.shift().trim();
return isFileProm(file).then((exists) => {
const isPattern = -1 < separator.indexOf("{{filename}}");
return !exists ? _readCo... | [
"function",
"_readContent",
"(",
"files",
",",
"writeStream",
",",
"separator",
")",
"{",
"return",
"0",
">=",
"files",
".",
"length",
"?",
"Promise",
".",
"resolve",
"(",
")",
":",
"Promise",
".",
"resolve",
"(",
")",
".",
"then",
"(",
"(",
")",
"=>... | methods
Specific to "filesToString" method, read all files content
@param {Array} files : files to read
@param {stream.Transform} writeStream : stream to send data
@param {string} separator : used to separate content (can be "")
@returns {Promise} Operation's result | [
"methods",
"Specific",
"to",
"filesToString",
"method",
"read",
"all",
"files",
"content"
] | 016e272fc58c6ef6eae5ea551a0e8873f0ac20cc | https://github.com/Psychopoulet/node-promfs/blob/016e272fc58c6ef6eae5ea551a0e8873f0ac20cc/lib/extends/_filesToStream.js#L24-L92 |
49,683 | redisjs/jsr-store | lib/command/hash.js | hsetnx | function hsetnx(key, field, value, req) {
var val = this.getKey(key, req)
, exists = this.hexists(key, field, req);
if(!val) {
val = new HashMap();
this.setKey(key, val, undefined, undefined, undefined, req);
}
if(!exists) {
// set on the hashmap
val.setKey(field, value);
}
return exists... | javascript | function hsetnx(key, field, value, req) {
var val = this.getKey(key, req)
, exists = this.hexists(key, field, req);
if(!val) {
val = new HashMap();
this.setKey(key, val, undefined, undefined, undefined, req);
}
if(!exists) {
// set on the hashmap
val.setKey(field, value);
}
return exists... | [
"function",
"hsetnx",
"(",
"key",
",",
"field",
",",
"value",
",",
"req",
")",
"{",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
",",
"exists",
"=",
"this",
".",
"hexists",
"(",
"key",
",",
"field",
",",
"req",
")",
";... | Sets field in the hash stored at key to value, only
if field does not yet exist. | [
"Sets",
"field",
"in",
"the",
"hash",
"stored",
"at",
"key",
"to",
"value",
"only",
"if",
"field",
"does",
"not",
"yet",
"exist",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L34-L46 |
49,684 | redisjs/jsr-store | lib/command/hash.js | hget | function hget(key, field, req) {
// get at db level
var val = this.getKey(key, req);
if(!val) return null;
// get at hash level
val = val.getKey(field)
if(!val) return null;
return val;
} | javascript | function hget(key, field, req) {
// get at db level
var val = this.getKey(key, req);
if(!val) return null;
// get at hash level
val = val.getKey(field)
if(!val) return null;
return val;
} | [
"function",
"hget",
"(",
"key",
",",
"field",
",",
"req",
")",
"{",
"// get at db level",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
";",
"if",
"(",
"!",
"val",
")",
"return",
"null",
";",
"// get at hash level",
"val",
"=... | Get the value of a hash field. | [
"Get",
"the",
"value",
"of",
"a",
"hash",
"field",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L51-L59 |
49,685 | redisjs/jsr-store | lib/command/hash.js | hexists | function hexists(key, field, req) {
var val = this.getKey(key, req);
if(!val) return 0;
return val.keyExists(field);
} | javascript | function hexists(key, field, req) {
var val = this.getKey(key, req);
if(!val) return 0;
return val.keyExists(field);
} | [
"function",
"hexists",
"(",
"key",
",",
"field",
",",
"req",
")",
"{",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
";",
"if",
"(",
"!",
"val",
")",
"return",
"0",
";",
"return",
"val",
".",
"keyExists",
"(",
"field",
... | Determine if a hash field exists. | [
"Determine",
"if",
"a",
"hash",
"field",
"exists",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L64-L68 |
49,686 | redisjs/jsr-store | lib/command/hash.js | hgetall | function hgetall(key, req) {
var val = this.getKey(key, req)
, list = [];
if(!val) return list;
val.getKeys().forEach(function(k) {
list.push(k, '' + val.getKey(k));
});
return list;
} | javascript | function hgetall(key, req) {
var val = this.getKey(key, req)
, list = [];
if(!val) return list;
val.getKeys().forEach(function(k) {
list.push(k, '' + val.getKey(k));
});
return list;
} | [
"function",
"hgetall",
"(",
"key",
",",
"req",
")",
"{",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
",",
"list",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"val",
")",
"return",
"list",
";",
"val",
".",
"getKeys",
"(",
")... | Get all the fields and values in a hash. | [
"Get",
"all",
"the",
"fields",
"and",
"values",
"in",
"a",
"hash",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L73-L82 |
49,687 | redisjs/jsr-store | lib/command/hash.js | hkeys | function hkeys(key, req) {
var val = this.getKey(key, req);
if(!val) return [];
return val.getKeys();
} | javascript | function hkeys(key, req) {
var val = this.getKey(key, req);
if(!val) return [];
return val.getKeys();
} | [
"function",
"hkeys",
"(",
"key",
",",
"req",
")",
"{",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
";",
"if",
"(",
"!",
"val",
")",
"return",
"[",
"]",
";",
"return",
"val",
".",
"getKeys",
"(",
")",
";",
"}"
] | Get all the fields in a hash. | [
"Get",
"all",
"the",
"fields",
"in",
"a",
"hash",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L87-L91 |
49,688 | redisjs/jsr-store | lib/command/hash.js | hlen | function hlen(key, req) {
var val = this.getKey(key, req);
if(!val) return 0;
return val.hlen();
} | javascript | function hlen(key, req) {
var val = this.getKey(key, req);
if(!val) return 0;
return val.hlen();
} | [
"function",
"hlen",
"(",
"key",
",",
"req",
")",
"{",
"var",
"val",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
";",
"if",
"(",
"!",
"val",
")",
"return",
"0",
";",
"return",
"val",
".",
"hlen",
"(",
")",
";",
"}"
] | Get the number of fields in a hash. | [
"Get",
"the",
"number",
"of",
"fields",
"in",
"a",
"hash",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L96-L100 |
49,689 | redisjs/jsr-store | lib/command/hash.js | hdel | function hdel(key /* field-1, field-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, deleted = 0
, i;
// nothing at key
if(!val) return 0;
for(i = 0;i < args.length;i++) {
deleted ... | javascript | function hdel(key /* field-1, field-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, deleted = 0
, i;
// nothing at key
if(!val) return 0;
for(i = 0;i < args.length;i++) {
deleted ... | [
"function",
"hdel",
"(",
"key",
"/* field-1, field-N, req */",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"req",
"=",
"typeof",
"args",
"[",
"args",
".",
"length",
"-",
"1",
"]",
"===",
"'object'",
"?",
... | Delete one or more hash fields. | [
"Delete",
"one",
"or",
"more",
"hash",
"fields",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L118-L138 |
49,690 | redisjs/jsr-store | lib/command/hash.js | hmget | function hmget(key /* field-1, field-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, value
, list = []
, i;
for(i = 0;i < args.length;i++) {
if(!val) {
list.push(null);
... | javascript | function hmget(key /* field-1, field-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, value
, list = []
, i;
for(i = 0;i < args.length;i++) {
if(!val) {
list.push(null);
... | [
"function",
"hmget",
"(",
"key",
"/* field-1, field-N, req */",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"req",
"=",
"typeof",
"args",
"[",
"args",
".",
"length",
"-",
"1",
"]",
"===",
"'object'",
"?",
... | Returns the values associated with the specified fields in
the hash stored at key. | [
"Returns",
"the",
"values",
"associated",
"with",
"the",
"specified",
"fields",
"in",
"the",
"hash",
"stored",
"at",
"key",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L144-L161 |
49,691 | redisjs/jsr-store | lib/command/hash.js | hmset | function hmset(key /* field-1, value-1, field-N, value-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, i;
if(!val) {
val = new HashMap();
this.setKey(key, val, undefined, undefined, un... | javascript | function hmset(key /* field-1, value-1, field-N, value-N, req */) {
var args = slice.call(arguments, 1)
, req = typeof args[args.length - 1] === 'object'
? args.pop() : null
, val = this.getKey(key, req)
, i;
if(!val) {
val = new HashMap();
this.setKey(key, val, undefined, undefined, un... | [
"function",
"hmset",
"(",
"key",
"/* field-1, value-1, field-N, value-N, req */",
")",
"{",
"var",
"args",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
",",
"req",
"=",
"typeof",
"args",
"[",
"args",
".",
"length",
"-",
"1",
"]",
"===",
"'... | Sets the specified fields to their respective values in
the hash stored at key. | [
"Sets",
"the",
"specified",
"fields",
"to",
"their",
"respective",
"values",
"in",
"the",
"hash",
"stored",
"at",
"key",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L167-L182 |
49,692 | redisjs/jsr-store | lib/command/hash.js | hincrbyfloat | function hincrbyfloat(key, field, amount, req) {
var map = this.getKey(key, req)
, val;
if(!map) {
map = new HashMap();
this.setKey(key, map, undefined, undefined, undefined, req);
}
val = utils.strtofloat(map.getKey(field));
amount = utils.strtofloat(amount);
val += amount;
map.setKey(field, ... | javascript | function hincrbyfloat(key, field, amount, req) {
var map = this.getKey(key, req)
, val;
if(!map) {
map = new HashMap();
this.setKey(key, map, undefined, undefined, undefined, req);
}
val = utils.strtofloat(map.getKey(field));
amount = utils.strtofloat(amount);
val += amount;
map.setKey(field, ... | [
"function",
"hincrbyfloat",
"(",
"key",
",",
"field",
",",
"amount",
",",
"req",
")",
"{",
"var",
"map",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
",",
"val",
";",
"if",
"(",
"!",
"map",
")",
"{",
"map",
"=",
"new",
"HashMap",
"(... | Increment the specified field of hash stored at key, and
representing a floating point number, by the specified increment. | [
"Increment",
"the",
"specified",
"field",
"of",
"hash",
"stored",
"at",
"key",
"and",
"representing",
"a",
"floating",
"point",
"number",
"by",
"the",
"specified",
"increment",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L188-L203 |
49,693 | redisjs/jsr-store | lib/command/hash.js | hincrby | function hincrby(key, field, amount, req) {
var map = this.getKey(key, req)
, val;
if(!map) {
map = new HashMap();
this.setKey(key, map, undefined, undefined, undefined, req);
}
val = utils.strtoint(map.getKey(field));
amount = utils.strtoint(amount);
val += amount;
map.setKey(field, val);
r... | javascript | function hincrby(key, field, amount, req) {
var map = this.getKey(key, req)
, val;
if(!map) {
map = new HashMap();
this.setKey(key, map, undefined, undefined, undefined, req);
}
val = utils.strtoint(map.getKey(field));
amount = utils.strtoint(amount);
val += amount;
map.setKey(field, val);
r... | [
"function",
"hincrby",
"(",
"key",
",",
"field",
",",
"amount",
",",
"req",
")",
"{",
"var",
"map",
"=",
"this",
".",
"getKey",
"(",
"key",
",",
"req",
")",
",",
"val",
";",
"if",
"(",
"!",
"map",
")",
"{",
"map",
"=",
"new",
"HashMap",
"(",
... | Increments the number stored at field in the
hash stored at key by increment. | [
"Increments",
"the",
"number",
"stored",
"at",
"field",
"in",
"the",
"hash",
"stored",
"at",
"key",
"by",
"increment",
"."
] | b2b5c5b0347819f8a388b5d67e121ee8d73f328c | https://github.com/redisjs/jsr-store/blob/b2b5c5b0347819f8a388b5d67e121ee8d73f328c/lib/command/hash.js#L209-L221 |
49,694 | nanowizard/vec23 | src/Vec3.js | function(v) {
if (v instanceof Vec3) {
return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);
}
else if(v instanceof Vec2){
return new Vec3(this.x + v.x, this.y + v.y, this.z);
}
else if(typeof v === 'number') {
return new Vec3(this.x + v, ... | javascript | function(v) {
if (v instanceof Vec3) {
return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);
}
else if(v instanceof Vec2){
return new Vec3(this.x + v.x, this.y + v.y, this.z);
}
else if(typeof v === 'number') {
return new Vec3(this.x + v, ... | [
"function",
"(",
"v",
")",
"{",
"if",
"(",
"v",
"instanceof",
"Vec3",
")",
"{",
"return",
"new",
"Vec3",
"(",
"this",
".",
"x",
"+",
"v",
".",
"x",
",",
"this",
".",
"y",
"+",
"v",
".",
"y",
",",
"this",
".",
"z",
"+",
"v",
".",
"z",
")",... | Adds the vector to a vector or Number and returns a new vector.
@memberof Vec3#
@param {Vec3|Vec2|Number} v vector or Number to add.
@returns {Vec3} resulting vector | [
"Adds",
"the",
"vector",
"to",
"a",
"vector",
"or",
"Number",
"and",
"returns",
"a",
"new",
"vector",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L38-L51 | |
49,695 | nanowizard/vec23 | src/Vec3.js | function() {
return {
theta: Math.atan2(this.z, this.x),
phi: Math.asin(this.y / this.length())
};
} | javascript | function() {
return {
theta: Math.atan2(this.z, this.x),
phi: Math.asin(this.y / this.length())
};
} | [
"function",
"(",
")",
"{",
"return",
"{",
"theta",
":",
"Math",
".",
"atan2",
"(",
"this",
".",
"z",
",",
"this",
".",
"x",
")",
",",
"phi",
":",
"Math",
".",
"asin",
"(",
"this",
".",
"y",
"/",
"this",
".",
"length",
"(",
")",
")",
"}",
";... | Computes the theta & phi angles of the vector.
@memberof Vec3#
@returns {object} ret
@returns {Number} ret.theta - angle from the xz plane
@returns {Number} ret.phi - angle from the y axis | [
"Computes",
"the",
"theta",
"&",
"phi",
"angles",
"of",
"the",
"vector",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L359-L364 | |
49,696 | nanowizard/vec23 | src/Vec3.js | function(dec) {
if(!dec){
dec = 2;
}
return '{x: ' + this.x.toFixed(dec) + ', y: ' + this.y.toFixed(dec) + ', z: ' + this.z.toFixed(dec) + '}';
} | javascript | function(dec) {
if(!dec){
dec = 2;
}
return '{x: ' + this.x.toFixed(dec) + ', y: ' + this.y.toFixed(dec) + ', z: ' + this.z.toFixed(dec) + '}';
} | [
"function",
"(",
"dec",
")",
"{",
"if",
"(",
"!",
"dec",
")",
"{",
"dec",
"=",
"2",
";",
"}",
"return",
"'{x: '",
"+",
"this",
".",
"x",
".",
"toFixed",
"(",
"dec",
")",
"+",
"', y: '",
"+",
"this",
".",
"y",
".",
"toFixed",
"(",
"dec",
")",
... | Converts the vector to a string representation.
@memberof Vec3#
@param {Number} [dec=2] - number of decimal places to round to (default is 2)
@returns {string} string of the form {x: <x value>, y: <y value>, z: <z value>} | [
"Converts",
"the",
"vector",
"to",
"a",
"string",
"representation",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L399-L404 | |
49,697 | nanowizard/vec23 | src/Vec3.js | function() {
return new Vec3(Math.round(this.x), Math.round(this.y), Math.round(this.z));
} | javascript | function() {
return new Vec3(Math.round(this.x), Math.round(this.y), Math.round(this.z));
} | [
"function",
"(",
")",
"{",
"return",
"new",
"Vec3",
"(",
"Math",
".",
"round",
"(",
"this",
".",
"x",
")",
",",
"Math",
".",
"round",
"(",
"this",
".",
"y",
")",
",",
"Math",
".",
"round",
"(",
"this",
".",
"z",
")",
")",
";",
"}"
] | Creates a new vector with each of the current x, y and z components rounded to the nearest whole Number.
@memberof Vec3#
@returns {Vec3} | [
"Creates",
"a",
"new",
"vector",
"with",
"each",
"of",
"the",
"current",
"x",
"y",
"and",
"z",
"components",
"rounded",
"to",
"the",
"nearest",
"whole",
"Number",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L418-L420 | |
49,698 | nanowizard/vec23 | src/Vec3.js | function(m){
return new Vec3(
this.x*m[0][0]+this.y*m[0][1]+this.z*m[0][2],
this.x*m[1][0]+this.y*m[1][1]+this.z*m[1][2],
this.x*m[2][0]+this.y*m[2][1]+this.z*m[2][2]
);
} | javascript | function(m){
return new Vec3(
this.x*m[0][0]+this.y*m[0][1]+this.z*m[0][2],
this.x*m[1][0]+this.y*m[1][1]+this.z*m[1][2],
this.x*m[2][0]+this.y*m[2][1]+this.z*m[2][2]
);
} | [
"function",
"(",
"m",
")",
"{",
"return",
"new",
"Vec3",
"(",
"this",
".",
"x",
"*",
"m",
"[",
"0",
"]",
"[",
"0",
"]",
"+",
"this",
".",
"y",
"*",
"m",
"[",
"0",
"]",
"[",
"1",
"]",
"+",
"this",
".",
"z",
"*",
"m",
"[",
"0",
"]",
"["... | Creates a new vector converting the vector to a new coordinate frame.
@memberof Vec3#
@param {Array} m - Coordinate system matrix of the form [[xx,xy,xz],[yx,yy,yz],[zx,zy,zz]]
@returns {Vec3} | [
"Creates",
"a",
"new",
"vector",
"converting",
"the",
"vector",
"to",
"a",
"new",
"coordinate",
"frame",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L454-L460 | |
49,699 | nanowizard/vec23 | src/Vec3.js | function(m){
var x = this.x;
var y = this.y;
var z = this.z;
this.x = x*m[0][0]+y*m[0][1]+z*m[0][2];
this.y = x*m[1][0]+y*m[1][1]+z*m[1][2];
this.z = x*m[2][0]+y*m[2][1]+z*m[2][2];
return this;
} | javascript | function(m){
var x = this.x;
var y = this.y;
var z = this.z;
this.x = x*m[0][0]+y*m[0][1]+z*m[0][2];
this.y = x*m[1][0]+y*m[1][1]+z*m[1][2];
this.z = x*m[2][0]+y*m[2][1]+z*m[2][2];
return this;
} | [
"function",
"(",
"m",
")",
"{",
"var",
"x",
"=",
"this",
".",
"x",
";",
"var",
"y",
"=",
"this",
".",
"y",
";",
"var",
"z",
"=",
"this",
".",
"z",
";",
"this",
".",
"x",
"=",
"x",
"*",
"m",
"[",
"0",
"]",
"[",
"0",
"]",
"+",
"y",
"*",... | Converts this vector to a new coordinate frame.
@memberof Vec3#
@param {Array} m - Coordinate system matrix of the form [[Xx,Xy,Xz],[Yx,Yy,Yz],[Zx,Zy,Zz]]
@returns {Vec3} | [
"Converts",
"this",
"vector",
"to",
"a",
"new",
"coordinate",
"frame",
"."
] | e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364 | https://github.com/nanowizard/vec23/blob/e9ac7698d7cf96aeabd3d67cb48b8b1e5b6e8364/src/Vec3.js#L467-L475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.