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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
45,100 | evsheffield/node-donedone-api | lib/donedone-api.js | function(releaseBuildInfo, cb) {
orderNumbers = releaseBuildInfo.order_numbers_ready_for_next_release.join(',');
// Trigger an error when there are no issues that are ready to release
if('' === orderNumbers) {
cb('Cannot create release build, there are no issues marked as "Ready for Next Relea... | javascript | function(releaseBuildInfo, cb) {
orderNumbers = releaseBuildInfo.order_numbers_ready_for_next_release.join(',');
// Trigger an error when there are no issues that are ready to release
if('' === orderNumbers) {
cb('Cannot create release build, there are no issues marked as "Ready for Next Relea... | [
"function",
"(",
"releaseBuildInfo",
",",
"cb",
")",
"{",
"orderNumbers",
"=",
"releaseBuildInfo",
".",
"order_numbers_ready_for_next_release",
".",
"join",
"(",
"','",
")",
";",
"// Trigger an error when there are no issues that are ready to release",
"if",
"(",
"''",
"=... | Get people in the project | [
"Get",
"people",
"in",
"the",
"project"
] | 9b1d8ddb86c4fe654509e9191fc7d666334c4a03 | https://github.com/evsheffield/node-donedone-api/blob/9b1d8ddb86c4fe654509e9191fc7d666334c4a03/lib/donedone-api.js#L311-L322 | |
45,101 | evsheffield/node-donedone-api | lib/donedone-api.js | function(peopleInProject, cb) {
userIdsToCc = _.pluck(peopleInProject, 'id').join(',');
exports.getProject(subdomain, username, passwordOrAPIToken, id, function(err, respData) {
cb(err, respData);
});
} | javascript | function(peopleInProject, cb) {
userIdsToCc = _.pluck(peopleInProject, 'id').join(',');
exports.getProject(subdomain, username, passwordOrAPIToken, id, function(err, respData) {
cb(err, respData);
});
} | [
"function",
"(",
"peopleInProject",
",",
"cb",
")",
"{",
"userIdsToCc",
"=",
"_",
".",
"pluck",
"(",
"peopleInProject",
",",
"'id'",
")",
".",
"join",
"(",
"','",
")",
";",
"exports",
".",
"getProject",
"(",
"subdomain",
",",
"username",
",",
"passwordOr... | Get project information so we can include the project title in the email body. | [
"Get",
"project",
"information",
"so",
"we",
"can",
"include",
"the",
"project",
"title",
"in",
"the",
"email",
"body",
"."
] | 9b1d8ddb86c4fe654509e9191fc7d666334c4a03 | https://github.com/evsheffield/node-donedone-api/blob/9b1d8ddb86c4fe654509e9191fc7d666334c4a03/lib/donedone-api.js#L324-L329 | |
45,102 | evsheffield/node-donedone-api | lib/donedone-api.js | function(projectInfo, cb) {
projectTitle = projectInfo.title;
if(projectTitle) {
emailBody = emailBody.replace('{{Project Name}}', projectTitle);
}
exports.createReleaseBuildForProject(subdomain, username, passwordOrAPIToken, id, orderNumbers, title, description, emailBody, userIdsToCc, ... | javascript | function(projectInfo, cb) {
projectTitle = projectInfo.title;
if(projectTitle) {
emailBody = emailBody.replace('{{Project Name}}', projectTitle);
}
exports.createReleaseBuildForProject(subdomain, username, passwordOrAPIToken, id, orderNumbers, title, description, emailBody, userIdsToCc, ... | [
"function",
"(",
"projectInfo",
",",
"cb",
")",
"{",
"projectTitle",
"=",
"projectInfo",
".",
"title",
";",
"if",
"(",
"projectTitle",
")",
"{",
"emailBody",
"=",
"emailBody",
".",
"replace",
"(",
"'{{Project Name}}'",
",",
"projectTitle",
")",
";",
"}",
"... | Create a release build for the retrieved items, sent to the indicated people | [
"Create",
"a",
"release",
"build",
"for",
"the",
"retrieved",
"items",
"sent",
"to",
"the",
"indicated",
"people"
] | 9b1d8ddb86c4fe654509e9191fc7d666334c4a03 | https://github.com/evsheffield/node-donedone-api/blob/9b1d8ddb86c4fe654509e9191fc7d666334c4a03/lib/donedone-api.js#L331-L339 | |
45,103 | emmetio/math-expression | lib/parser.js | op1 | function op1(value, priority) {
if (value === MINUS) {
priority += 2;
}
return new Token(OP1, value, priority);
} | javascript | function op1(value, priority) {
if (value === MINUS) {
priority += 2;
}
return new Token(OP1, value, priority);
} | [
"function",
"op1",
"(",
"value",
",",
"priority",
")",
"{",
"if",
"(",
"value",
"===",
"MINUS",
")",
"{",
"priority",
"+=",
"2",
";",
"}",
"return",
"new",
"Token",
"(",
"OP1",
",",
"value",
",",
"priority",
")",
";",
"}"
] | Unary operator factory
@param {Number} value Operator character code
@param {Number} priority Operator execution priority
@return {Token[]} | [
"Unary",
"operator",
"factory"
] | 31dc028f80c27b5b00be9395e35ebd07c9cd8862 | https://github.com/emmetio/math-expression/blob/31dc028f80c27b5b00be9395e35ebd07c9cd8862/lib/parser.js#L285-L290 |
45,104 | emmetio/math-expression | lib/parser.js | op2 | function op2(value, priority) {
if (value === MULTIPLY) {
priority += 1;
} else if (value === DIVIDE || value === INT_DIVIDE) {
priority += 2;
}
return new Token(OP2, value, priority);
} | javascript | function op2(value, priority) {
if (value === MULTIPLY) {
priority += 1;
} else if (value === DIVIDE || value === INT_DIVIDE) {
priority += 2;
}
return new Token(OP2, value, priority);
} | [
"function",
"op2",
"(",
"value",
",",
"priority",
")",
"{",
"if",
"(",
"value",
"===",
"MULTIPLY",
")",
"{",
"priority",
"+=",
"1",
";",
"}",
"else",
"if",
"(",
"value",
"===",
"DIVIDE",
"||",
"value",
"===",
"INT_DIVIDE",
")",
"{",
"priority",
"+=",... | Binary operator factory
@param {Number} value Operator character code
@param {Number} priority Operator execution priority
@return {Token[]} | [
"Binary",
"operator",
"factory"
] | 31dc028f80c27b5b00be9395e35ebd07c9cd8862 | https://github.com/emmetio/math-expression/blob/31dc028f80c27b5b00be9395e35ebd07c9cd8862/lib/parser.js#L298-L306 |
45,105 | throneteki/throneteki-deck-helper | lib/formatDeckAsShortCards.js | formatDeckAsShortCards | function formatDeckAsShortCards(deck) {
var newDeck = {
_id: deck._id,
name: deck.name,
username: deck.username,
lastUpdated: deck.lastUpdated,
faction: { name: deck.faction.name, value: deck.faction.value }
};
if (deck.agenda) {
newDeck.agenda = { code: deck... | javascript | function formatDeckAsShortCards(deck) {
var newDeck = {
_id: deck._id,
name: deck.name,
username: deck.username,
lastUpdated: deck.lastUpdated,
faction: { name: deck.faction.name, value: deck.faction.value }
};
if (deck.agenda) {
newDeck.agenda = { code: deck... | [
"function",
"formatDeckAsShortCards",
"(",
"deck",
")",
"{",
"var",
"newDeck",
"=",
"{",
"_id",
":",
"deck",
".",
"_id",
",",
"name",
":",
"deck",
".",
"name",
",",
"username",
":",
"deck",
".",
"username",
",",
"lastUpdated",
":",
"deck",
".",
"lastUp... | Creates a clone of the existing deck with only card codes instead of full
card data. | [
"Creates",
"a",
"clone",
"of",
"the",
"existing",
"deck",
"with",
"only",
"card",
"codes",
"instead",
"of",
"full",
"card",
"data",
"."
] | 700280f5747b99d626c8ea6033064bd01f93da60 | https://github.com/throneteki/throneteki-deck-helper/blob/700280f5747b99d626c8ea6033064bd01f93da60/lib/formatDeckAsShortCards.js#L7-L28 |
45,106 | goliatone/core.io-express-server | lib/middleware/poweredBy.js | poweredBy | function poweredBy(app, config) {
config = extend({}, defaults, config);
if(config.disablePoweredBy) {
return app.disable('x-powered-by');
}
if(config.poweredBy === false) {
return;
}
app.use(function xPoweredBy(req, res, next) {
res.header('x-powered-by', config.... | javascript | function poweredBy(app, config) {
config = extend({}, defaults, config);
if(config.disablePoweredBy) {
return app.disable('x-powered-by');
}
if(config.poweredBy === false) {
return;
}
app.use(function xPoweredBy(req, res, next) {
res.header('x-powered-by', config.... | [
"function",
"poweredBy",
"(",
"app",
",",
"config",
")",
"{",
"config",
"=",
"extend",
"(",
"{",
"}",
",",
"defaults",
",",
"config",
")",
";",
"if",
"(",
"config",
".",
"disablePoweredBy",
")",
"{",
"return",
"app",
".",
"disable",
"(",
"'x-powered-by... | The configuration object will be the module's
configuration object.
We probably want to create an entry for this
specific middleware...
@param {Express} app Express application
@param {Object} config Configuration object | [
"The",
"configuration",
"object",
"will",
"be",
"the",
"module",
"s",
"configuration",
"object",
".",
"We",
"probably",
"want",
"to",
"create",
"an",
"entry",
"for",
"this",
"specific",
"middleware",
"..."
] | 920225b923eaf1f142cd0ee1db78a208f8ecdbe2 | https://github.com/goliatone/core.io-express-server/blob/920225b923eaf1f142cd0ee1db78a208f8ecdbe2/lib/middleware/poweredBy.js#L17-L33 |
45,107 | mesmotronic/conbo | lib/conbo.js | function(namespace)
{
if (!namespace || !conbo.isString(namespace))
{
conbo.warn('First parameter must be the namespace string, received', namespace);
return;
}
if (!__namespaces[namespace])
{
__namespaces[namespace] = new conbo.Namespace();
}
var ns = __namespaces[namespace],
params = c... | javascript | function(namespace)
{
if (!namespace || !conbo.isString(namespace))
{
conbo.warn('First parameter must be the namespace string, received', namespace);
return;
}
if (!__namespaces[namespace])
{
__namespaces[namespace] = new conbo.Namespace();
}
var ns = __namespaces[namespace],
params = c... | [
"function",
"(",
"namespace",
")",
"{",
"if",
"(",
"!",
"namespace",
"||",
"!",
"conbo",
".",
"isString",
"(",
"namespace",
")",
")",
"{",
"conbo",
".",
"warn",
"(",
"'First parameter must be the namespace string, received'",
",",
"namespace",
")",
";",
"retur... | ConboJS is a lightweight MVx application framework for JavaScript featuring
dependency injection, context and encapsulation, data binding, command
pattern and an event model which enables callback scoping and consistent
event handling
All ConboJS classes, methods and properties live within the conbo namespace
@namesp... | [
"ConboJS",
"is",
"a",
"lightweight",
"MVx",
"application",
"framework",
"for",
"JavaScript",
"featuring",
"dependency",
"injection",
"context",
"and",
"encapsulation",
"data",
"binding",
"command",
"pattern",
"and",
"an",
"event",
"model",
"which",
"enables",
"callb... | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L84-L113 | |
45,108 | mesmotronic/conbo | lib/conbo.js | function(obj, propName, value)
{
if (conbo.isAccessor(obj, propName)) return;
if (arguments.length < 3) value = obj[propName];
var enumerable = propName.indexOf('_') != 0;
var internalName = '__'+propName;
__definePrivateProperty(obj, internalName, value);
var getter = function()
{
return this... | javascript | function(obj, propName, value)
{
if (conbo.isAccessor(obj, propName)) return;
if (arguments.length < 3) value = obj[propName];
var enumerable = propName.indexOf('_') != 0;
var internalName = '__'+propName;
__definePrivateProperty(obj, internalName, value);
var getter = function()
{
return this... | [
"function",
"(",
"obj",
",",
"propName",
",",
"value",
")",
"{",
"if",
"(",
"conbo",
".",
"isAccessor",
"(",
"obj",
",",
"propName",
")",
")",
"return",
";",
"if",
"(",
"arguments",
".",
"length",
"<",
"3",
")",
"value",
"=",
"obj",
"[",
"propName"... | Creates a property which can be bound to DOM elements and others
@param {Object} obj - The EventDispatcher object on which the property will be defined
@param {string} propName - The name of the property to be defined
@param {*} [value] - The initial value of the property (optional)
@private | [
"Creates",
"a",
"property",
"which",
"can",
"be",
"bound",
"to",
"DOM",
"elements",
"and",
"others"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L365-L390 | |
45,109 | mesmotronic/conbo | lib/conbo.js | function(obj)
{
var regExp = arguments[1];
var keys = regExp instanceof RegExp
? conbo.filter(conbo.keys(obj), function(key) { return regExp.test(key); })
: (arguments.length > 1 ? conbo.rest(arguments) : conbo.keys(obj));
keys.forEach(function(key)
{
var descriptor = Object.getOwnPropertyDescri... | javascript | function(obj)
{
var regExp = arguments[1];
var keys = regExp instanceof RegExp
? conbo.filter(conbo.keys(obj), function(key) { return regExp.test(key); })
: (arguments.length > 1 ? conbo.rest(arguments) : conbo.keys(obj));
keys.forEach(function(key)
{
var descriptor = Object.getOwnPropertyDescri... | [
"function",
"(",
"obj",
")",
"{",
"var",
"regExp",
"=",
"arguments",
"[",
"1",
"]",
";",
"var",
"keys",
"=",
"regExp",
"instanceof",
"RegExp",
"?",
"conbo",
".",
"filter",
"(",
"conbo",
".",
"keys",
"(",
"obj",
")",
",",
"function",
"(",
"key",
")"... | Convert enumerable properties of the specified object into non-enumerable ones
@private | [
"Convert",
"enumerable",
"properties",
"of",
"the",
"specified",
"object",
"into",
"non",
"-",
"enumerable",
"ones"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L424-L440 | |
45,110 | mesmotronic/conbo | lib/conbo.js | function(value)
{
if (value == undefined) return conbo.identity;
if (conbo.isFunction(value)) return value;
return conbo.property(value);
} | javascript | function(value)
{
if (value == undefined) return conbo.identity;
if (conbo.isFunction(value)) return value;
return conbo.property(value);
} | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"undefined",
")",
"return",
"conbo",
".",
"identity",
";",
"if",
"(",
"conbo",
".",
"isFunction",
"(",
"value",
")",
")",
"return",
"value",
";",
"return",
"conbo",
".",
"property",
"(",
"... | An internal function to generate lookup iterators.
@private | [
"An",
"internal",
"function",
"to",
"generate",
"lookup",
"iterators",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L847-L852 | |
45,111 | mesmotronic/conbo | lib/conbo.js | function(type, handler, scope)
{
if (!this.__queue || !(type in this.__queue) || !this.__queue[type].length)
{
return false;
}
var filtered = this.__queue[type].filter(function(queued)
{
return (!handler || queued.handler == handler) && (!scope || queued.scope == scope);
});
... | javascript | function(type, handler, scope)
{
if (!this.__queue || !(type in this.__queue) || !this.__queue[type].length)
{
return false;
}
var filtered = this.__queue[type].filter(function(queued)
{
return (!handler || queued.handler == handler) && (!scope || queued.scope == scope);
});
... | [
"function",
"(",
"type",
",",
"handler",
",",
"scope",
")",
"{",
"if",
"(",
"!",
"this",
".",
"__queue",
"||",
"!",
"(",
"type",
"in",
"this",
".",
"__queue",
")",
"||",
"!",
"this",
".",
"__queue",
"[",
"type",
"]",
".",
"length",
")",
"{",
"r... | Does this object have an event listener of the specified type?
@param {string} type - Type of event (e.g. 'change')
@param {Function} [handler] - Function that should be called
@param {Object} [scope] - The scope in which the handler is set to run
@returns {boolean} True if this object has the specified event list... | [
"Does",
"this",
"object",
"have",
"an",
"event",
"listener",
"of",
"the",
"specified",
"type?"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L3994-L4007 | |
45,112 | mesmotronic/conbo | lib/conbo.js | function(event)
{
if (!(event instanceof conbo.Event))
{
throw new Error('event parameter is not an instance of conbo.Event');
}
if (!this.__queue || (!(event.type in this.__queue) && !this.__queue.all)) return this;
if (!event.target) event.target = this;
event.currentTarget =... | javascript | function(event)
{
if (!(event instanceof conbo.Event))
{
throw new Error('event parameter is not an instance of conbo.Event');
}
if (!this.__queue || (!(event.type in this.__queue) && !this.__queue.all)) return this;
if (!event.target) event.target = this;
event.currentTarget =... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"(",
"event",
"instanceof",
"conbo",
".",
"Event",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"'event parameter is not an instance of conbo.Event'",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"__queue"... | Dispatch the event to listeners
@param {conbo.Event} event - The event to dispatch
@returns {conbo.EventDispatcher} A reference to this class instance | [
"Dispatch",
"the",
"event",
"to",
"listeners"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4014-L4038 | |
45,113 | mesmotronic/conbo | lib/conbo.js | function(contextClass, cloneSingletons, cloneCommands)
{
contextClass || (contextClass = conbo.Context);
return new contextClass
({
context: this,
app: this.app,
namespace: this.namespace,
commands: cloneCommands ? conbo.clone(this.__commands) : undefined,
singletons: cloneSingletons ? co... | javascript | function(contextClass, cloneSingletons, cloneCommands)
{
contextClass || (contextClass = conbo.Context);
return new contextClass
({
context: this,
app: this.app,
namespace: this.namespace,
commands: cloneCommands ? conbo.clone(this.__commands) : undefined,
singletons: cloneSingletons ? co... | [
"function",
"(",
"contextClass",
",",
"cloneSingletons",
",",
"cloneCommands",
")",
"{",
"contextClass",
"||",
"(",
"contextClass",
"=",
"conbo",
".",
"Context",
")",
";",
"return",
"new",
"contextClass",
"(",
"{",
"context",
":",
"this",
",",
"app",
":",
... | Create a new subcontext that shares the same application
and namespace as this one
@param {class} [contextClass] - The context class to use (default: conbo.Context)
@param {boolean} [cloneSingletons] - Should this Context's singletons be duplicated on the new subcontext? (default: false)
@param {boolean} [cloneCommand... | [
"Create",
"a",
"new",
"subcontext",
"that",
"shares",
"the",
"same",
"application",
"and",
"namespace",
"as",
"this",
"one"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4288-L4299 | |
45,114 | mesmotronic/conbo | lib/conbo.js | function(eventType, commandClass)
{
if (!eventType) throw new Error('eventType cannot be undefined');
if (!commandClass) throw new Error('commandClass for '+eventType+' cannot be undefined');
if (this.__commands[eventType] && this.__commands[eventType].indexOf(commandClass) != -1)
{
return this;
... | javascript | function(eventType, commandClass)
{
if (!eventType) throw new Error('eventType cannot be undefined');
if (!commandClass) throw new Error('commandClass for '+eventType+' cannot be undefined');
if (this.__commands[eventType] && this.__commands[eventType].indexOf(commandClass) != -1)
{
return this;
... | [
"function",
"(",
"eventType",
",",
"commandClass",
")",
"{",
"if",
"(",
"!",
"eventType",
")",
"throw",
"new",
"Error",
"(",
"'eventType cannot be undefined'",
")",
";",
"if",
"(",
"!",
"commandClass",
")",
"throw",
"new",
"Error",
"(",
"'commandClass for '",
... | Map specified Command class the given event
@param {string} eventType - The name of the event
@param {class} commandClass - The command class to instantiate when the event is dispatched | [
"Map",
"specified",
"Command",
"class",
"the",
"given",
"event"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4306-L4320 | |
45,115 | mesmotronic/conbo | lib/conbo.js | function(eventType, commandClass)
{
if (!eventType) throw new Error('eventType cannot be undefined');
if (commandClass === undefined)
{
delete this.__commands[eventType];
return this;
}
if (!this.__commands[eventType]) return;
var index = this.__commands[eventType].indexOf(commandCla... | javascript | function(eventType, commandClass)
{
if (!eventType) throw new Error('eventType cannot be undefined');
if (commandClass === undefined)
{
delete this.__commands[eventType];
return this;
}
if (!this.__commands[eventType]) return;
var index = this.__commands[eventType].indexOf(commandCla... | [
"function",
"(",
"eventType",
",",
"commandClass",
")",
"{",
"if",
"(",
"!",
"eventType",
")",
"throw",
"new",
"Error",
"(",
"'eventType cannot be undefined'",
")",
";",
"if",
"(",
"commandClass",
"===",
"undefined",
")",
"{",
"delete",
"this",
".",
"__comma... | Unmap specified Command class from given event | [
"Unmap",
"specified",
"Command",
"class",
"from",
"given",
"event"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4325-L4341 | |
45,116 | mesmotronic/conbo | lib/conbo.js | function(propertyName, singletonClass)
{
if (!propertyName) throw new Error('propertyName cannot be undefined');
if (singletonClass === undefined)
{
conbo.warn('singletonClass for '+propertyName+' is undefined');
}
if (conbo.isClass(singletonClass))
{
var args = conbo.rest(arguments);
... | javascript | function(propertyName, singletonClass)
{
if (!propertyName) throw new Error('propertyName cannot be undefined');
if (singletonClass === undefined)
{
conbo.warn('singletonClass for '+propertyName+' is undefined');
}
if (conbo.isClass(singletonClass))
{
var args = conbo.rest(arguments);
... | [
"function",
"(",
"propertyName",
",",
"singletonClass",
")",
"{",
"if",
"(",
"!",
"propertyName",
")",
"throw",
"new",
"Error",
"(",
"'propertyName cannot be undefined'",
")",
";",
"if",
"(",
"singletonClass",
"===",
"undefined",
")",
"{",
"conbo",
".",
"warn"... | Map class instance to a property name
To inject a property into a class, register the property name
with the Context and declare the value as undefined in your class
to enable it to be injected at run time
@example context.mapSingleton('myProperty', MyModel);
@example myProperty: undefined | [
"Map",
"class",
"instance",
"to",
"a",
"property",
"name"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4353-L4379 | |
45,117 | mesmotronic/conbo | lib/conbo.js | function(obj)
{
var scope = this;
for (var a in scope.__singletons)
{
if (a in obj)
{
(function(value)
{
Object.defineProperty(obj, a,
{
configurable: true,
get: function() { return value; }
});
})(scope.__singletons[a]);
}
}
return this;... | javascript | function(obj)
{
var scope = this;
for (var a in scope.__singletons)
{
if (a in obj)
{
(function(value)
{
Object.defineProperty(obj, a,
{
configurable: true,
get: function() { return value; }
});
})(scope.__singletons[a]);
}
}
return this;... | [
"function",
"(",
"obj",
")",
"{",
"var",
"scope",
"=",
"this",
";",
"for",
"(",
"var",
"a",
"in",
"scope",
".",
"__singletons",
")",
"{",
"if",
"(",
"a",
"in",
"obj",
")",
"{",
"(",
"function",
"(",
"value",
")",
"{",
"Object",
".",
"defineProper... | Inject singleton instances into specified object
@param obj {Object} The object to inject singletons into | [
"Inject",
"singleton",
"instances",
"into",
"specified",
"object"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4431-L4451 | |
45,118 | mesmotronic/conbo | lib/conbo.js | function(obj)
{
for (var a in this.__singletons)
{
if (a in obj)
{
Object.defineProperty(obj, a,
{
configurable: true,
value: undefined
});
}
}
return this;
} | javascript | function(obj)
{
for (var a in this.__singletons)
{
if (a in obj)
{
Object.defineProperty(obj, a,
{
configurable: true,
value: undefined
});
}
}
return this;
} | [
"function",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"a",
"in",
"this",
".",
"__singletons",
")",
"{",
"if",
"(",
"a",
"in",
"obj",
")",
"{",
"Object",
".",
"defineProperty",
"(",
"obj",
",",
"a",
",",
"{",
"configurable",
":",
"true",
",",
"valu... | Set all singleton instances on the specified object to undefined
@param obj {Object} The object to remove singletons from | [
"Set",
"all",
"singleton",
"instances",
"on",
"the",
"specified",
"object",
"to",
"undefined"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4458-L4473 | |
45,119 | mesmotronic/conbo | lib/conbo.js | function()
{
conbo.assign(this,
{
__commands: undefined,
__singletons: undefined,
__app: undefined,
__namespace: undefined,
__parentContext: undefined
});
this.removeEventListener();
return this;
} | javascript | function()
{
conbo.assign(this,
{
__commands: undefined,
__singletons: undefined,
__app: undefined,
__namespace: undefined,
__parentContext: undefined
});
this.removeEventListener();
return this;
} | [
"function",
"(",
")",
"{",
"conbo",
".",
"assign",
"(",
"this",
",",
"{",
"__commands",
":",
"undefined",
",",
"__singletons",
":",
"undefined",
",",
"__app",
":",
"undefined",
",",
"__namespace",
":",
"undefined",
",",
"__parentContext",
":",
"undefined",
... | Clears all commands and singletons, and removes all listeners | [
"Clears",
"all",
"commands",
"and",
"singletons",
"and",
"removes",
"all",
"listeners"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4478-L4492 | |
45,120 | mesmotronic/conbo | lib/conbo.js | function(item)
{
var items = conbo.toArray(arguments);
if (items.length)
{
this.source.push.apply(this.source, this.__applyItemClass(items));
this.__updateBindings(items);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ADD));
this.dispatchChange('length');
}
return thi... | javascript | function(item)
{
var items = conbo.toArray(arguments);
if (items.length)
{
this.source.push.apply(this.source, this.__applyItemClass(items));
this.__updateBindings(items);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.ADD));
this.dispatchChange('length');
}
return thi... | [
"function",
"(",
"item",
")",
"{",
"var",
"items",
"=",
"conbo",
".",
"toArray",
"(",
"arguments",
")",
";",
"if",
"(",
"items",
".",
"length",
")",
"{",
"this",
".",
"source",
".",
"push",
".",
"apply",
"(",
"this",
".",
"source",
",",
"this",
"... | Add an item to the end of the collection. | [
"Add",
"an",
"item",
"to",
"the",
"end",
"of",
"the",
"collection",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4731-L4744 | |
45,121 | mesmotronic/conbo | lib/conbo.js | function()
{
if (!this.length) return;
var item = this.source.pop();
this.__updateBindings(item, false);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.REMOVE));
this.dispatchChange('length');
return item;
} | javascript | function()
{
if (!this.length) return;
var item = this.source.pop();
this.__updateBindings(item, false);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.REMOVE));
this.dispatchChange('length');
return item;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"length",
")",
"return",
";",
"var",
"item",
"=",
"this",
".",
"source",
".",
"pop",
"(",
")",
";",
"this",
".",
"__updateBindings",
"(",
"item",
",",
"false",
")",
";",
"this",
".",
"dispat... | Remove an item from the end of the collection. | [
"Remove",
"an",
"item",
"from",
"the",
"end",
"of",
"the",
"collection",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4749-L4760 | |
45,122 | mesmotronic/conbo | lib/conbo.js | function(begin, length)
{
begin || (begin = 0);
if (conbo.isUndefined(length)) length = this.length;
return new conbo.List({source:this.source.slice(begin, length)});
} | javascript | function(begin, length)
{
begin || (begin = 0);
if (conbo.isUndefined(length)) length = this.length;
return new conbo.List({source:this.source.slice(begin, length)});
} | [
"function",
"(",
"begin",
",",
"length",
")",
"{",
"begin",
"||",
"(",
"begin",
"=",
"0",
")",
";",
"if",
"(",
"conbo",
".",
"isUndefined",
"(",
"length",
")",
")",
"length",
"=",
"this",
".",
"length",
";",
"return",
"new",
"conbo",
".",
"List",
... | Slice out a sub-array of items from the collection. | [
"Slice",
"out",
"a",
"sub",
"-",
"array",
"of",
"items",
"from",
"the",
"collection",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4797-L4803 | |
45,123 | mesmotronic/conbo | lib/conbo.js | function(begin, length)
{
begin || (begin = 0);
if (conbo.isUndefined(length)) length = this.length;
var inserts = conbo.rest(arguments,2);
var items = this.source.splice.apply(this.source, [begin, length].concat(inserts));
if (items.length) this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEv... | javascript | function(begin, length)
{
begin || (begin = 0);
if (conbo.isUndefined(length)) length = this.length;
var inserts = conbo.rest(arguments,2);
var items = this.source.splice.apply(this.source, [begin, length].concat(inserts));
if (items.length) this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEv... | [
"function",
"(",
"begin",
",",
"length",
")",
"{",
"begin",
"||",
"(",
"begin",
"=",
"0",
")",
";",
"if",
"(",
"conbo",
".",
"isUndefined",
"(",
"length",
")",
")",
"length",
"=",
"this",
".",
"length",
";",
"var",
"inserts",
"=",
"conbo",
".",
"... | Splice out a sub-array of items from the collection. | [
"Splice",
"out",
"a",
"sub",
"-",
"array",
"of",
"items",
"from",
"the",
"collection",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4808-L4825 | |
45,124 | mesmotronic/conbo | lib/conbo.js | function(compareFunction)
{
this.source.sort(compareFunction);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.CHANGE));
return this;
} | javascript | function(compareFunction)
{
this.source.sort(compareFunction);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.CHANGE));
return this;
} | [
"function",
"(",
"compareFunction",
")",
"{",
"this",
".",
"source",
".",
"sort",
"(",
"compareFunction",
")",
";",
"this",
".",
"dispatchEvent",
"(",
"new",
"conbo",
".",
"ConboEvent",
"(",
"conbo",
".",
"ConboEvent",
".",
"CHANGE",
")",
")",
";",
"retu... | Force the collection to re-sort itself.
@param {Function} [compareFunction] - Compare function to determine sort order | [
"Force",
"the",
"collection",
"to",
"re",
"-",
"sort",
"itself",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4864-L4870 | |
45,125 | mesmotronic/conbo | lib/conbo.js | function(items, enabled)
{
var method = enabled === false ? 'removeEventListener' : 'addEventListener';
items = (conbo.isArray(items) ? items : [items]).slice();
while (items.length)
{
var item = items.pop();
if (item instanceof conbo.EventDispatcher)
{
item[method](conbo.Con... | javascript | function(items, enabled)
{
var method = enabled === false ? 'removeEventListener' : 'addEventListener';
items = (conbo.isArray(items) ? items : [items]).slice();
while (items.length)
{
var item = items.pop();
if (item instanceof conbo.EventDispatcher)
{
item[method](conbo.Con... | [
"function",
"(",
"items",
",",
"enabled",
")",
"{",
"var",
"method",
"=",
"enabled",
"===",
"false",
"?",
"'removeEventListener'",
":",
"'addEventListener'",
";",
"items",
"=",
"(",
"conbo",
".",
"isArray",
"(",
"items",
")",
"?",
"items",
":",
"[",
"ite... | Listen to the events of Bindable values so we can detect changes
@param {any} models
@param {Boolean} enabled
@private | [
"Listen",
"to",
"the",
"events",
"of",
"Bindable",
"values",
"so",
"we",
"can",
"detect",
"changes"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L4904-L4919 | |
45,126 | mesmotronic/conbo | lib/conbo.js | function()
{
var el = this.__obj;
var a = {};
if (el)
{
conbo.forEach(el.attributes, function(p)
{
a[conbo.toCamelCase(p.name)] = p.value;
});
}
return a;
} | javascript | function()
{
var el = this.__obj;
var a = {};
if (el)
{
conbo.forEach(el.attributes, function(p)
{
a[conbo.toCamelCase(p.name)] = p.value;
});
}
return a;
} | [
"function",
"(",
")",
"{",
"var",
"el",
"=",
"this",
".",
"__obj",
";",
"var",
"a",
"=",
"{",
"}",
";",
"if",
"(",
"el",
")",
"{",
"conbo",
".",
"forEach",
"(",
"el",
".",
"attributes",
",",
"function",
"(",
"p",
")",
"{",
"a",
"[",
"conbo",
... | Returns object containing the value of all attributes on a DOM element
@returns {Object}
@example
ep.attributes; // results in something like {src:"foo/bar.jpg"} | [
"Returns",
"object",
"containing",
"the",
"value",
"of",
"all",
"attributes",
"on",
"a",
"DOM",
"element"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7103-L7117 | |
45,127 | mesmotronic/conbo | lib/conbo.js | function(obj)
{
var el = this.__obj;
if (el && obj)
{
conbo.forEach(obj, function(value, name)
{
el.setAttribute(conbo.toKebabCase(name), value);
});
}
return this;
} | javascript | function(obj)
{
var el = this.__obj;
if (el && obj)
{
conbo.forEach(obj, function(value, name)
{
el.setAttribute(conbo.toKebabCase(name), value);
});
}
return this;
} | [
"function",
"(",
"obj",
")",
"{",
"var",
"el",
"=",
"this",
".",
"__obj",
";",
"if",
"(",
"el",
"&&",
"obj",
")",
"{",
"conbo",
".",
"forEach",
"(",
"obj",
",",
"function",
"(",
"value",
",",
"name",
")",
"{",
"el",
".",
"setAttribute",
"(",
"c... | Sets the attributes on a DOM element from an Object, converting camelCase to kebab-case, if needed
@param {Element} obj - Object containing the attributes to set
@returns {conbo.ElementProxy}
@example
ep.setAttributes({foo:1, bar:"red"}); | [
"Sets",
"the",
"attributes",
"on",
"a",
"DOM",
"element",
"from",
"an",
"Object",
"converting",
"camelCase",
"to",
"kebab",
"-",
"case",
"if",
"needed"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7128-L7141 | |
45,128 | mesmotronic/conbo | lib/conbo.js | function(className)
{
var el = this.__obj;
return el instanceof Element && className
? el.classList.contains(className)
: false;
} | javascript | function(className)
{
var el = this.__obj;
return el instanceof Element && className
? el.classList.contains(className)
: false;
} | [
"function",
"(",
"className",
")",
"{",
"var",
"el",
"=",
"this",
".",
"__obj",
";",
"return",
"el",
"instanceof",
"Element",
"&&",
"className",
"?",
"el",
".",
"classList",
".",
"contains",
"(",
"className",
")",
":",
"false",
";",
"}"
] | Is this element using the specified CSS class?
@param {string} className - CSS class name
@returns {boolean} | [
"Is",
"this",
"element",
"using",
"the",
"specified",
"CSS",
"class?"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7245-L7252 | |
45,129 | mesmotronic/conbo | lib/conbo.js | function(selector)
{
var el = this.__obj;
if (el)
{
var matchesFn;
['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn)
{
if (typeof document.body[fn] == 'function')
{
matchesFn = fn;
return true;
}... | javascript | function(selector)
{
var el = this.__obj;
if (el)
{
var matchesFn;
['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn)
{
if (typeof document.body[fn] == 'function')
{
matchesFn = fn;
return true;
}... | [
"function",
"(",
"selector",
")",
"{",
"var",
"el",
"=",
"this",
".",
"__obj",
";",
"if",
"(",
"el",
")",
"{",
"var",
"matchesFn",
";",
"[",
"'matches'",
",",
"'webkitMatchesSelector'",
",",
"'mozMatchesSelector'",
",",
"'msMatchesSelector'",
",",
"'oMatches... | Finds the closest parent element matching the specified selector
@param {string} selector - Query selector
@returns {Element} | [
"Finds",
"the",
"closest",
"parent",
"element",
"matching",
"the",
"specified",
"selector"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7260-L7294 | |
45,130 | mesmotronic/conbo | lib/conbo.js | function(el)
{
var attrs = conbo.assign({}, this.attributes);
if (this.id && !el.id)
{
attrs.id = this.id;
}
el.classList.add('cb-glimpse');
el.cbGlimpse = this;
for (var attr in attrs)
{
el.setAttribute(conbo.toKebabCase(attr), attrs[attr]);
}
if (this.style... | javascript | function(el)
{
var attrs = conbo.assign({}, this.attributes);
if (this.id && !el.id)
{
attrs.id = this.id;
}
el.classList.add('cb-glimpse');
el.cbGlimpse = this;
for (var attr in attrs)
{
el.setAttribute(conbo.toKebabCase(attr), attrs[attr]);
}
if (this.style... | [
"function",
"(",
"el",
")",
"{",
"var",
"attrs",
"=",
"conbo",
".",
"assign",
"(",
"{",
"}",
",",
"this",
".",
"attributes",
")",
";",
"if",
"(",
"this",
".",
"id",
"&&",
"!",
"el",
".",
"id",
")",
"{",
"attrs",
".",
"id",
"=",
"this",
".",
... | Set this View's element
@private | [
"Set",
"this",
"View",
"s",
"element"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7410-L7435 | |
45,131 | mesmotronic/conbo | lib/conbo.js | function(selector, deep)
{
if (this.el)
{
var results = conbo.toArray(this.el.querySelectorAll(selector));
if (!deep)
{
var views = this.el.querySelectorAll('.cb-view, [cb-view], [cb-app]');
// Remove elements in child Views
conbo.forEach(views, function(el)
{
va... | javascript | function(selector, deep)
{
if (this.el)
{
var results = conbo.toArray(this.el.querySelectorAll(selector));
if (!deep)
{
var views = this.el.querySelectorAll('.cb-view, [cb-view], [cb-app]');
// Remove elements in child Views
conbo.forEach(views, function(el)
{
va... | [
"function",
"(",
"selector",
",",
"deep",
")",
"{",
"if",
"(",
"this",
".",
"el",
")",
"{",
"var",
"results",
"=",
"conbo",
".",
"toArray",
"(",
"this",
".",
"el",
".",
"querySelectorAll",
"(",
"selector",
")",
")",
";",
"if",
"(",
"!",
"deep",
"... | Uses querySelectorAll to find all matching elements contained within the
current View's element, but not within the elements of child Views
@param {string} selector - The selector to use
@param {boolean} deep - Include elements in child Views?
@returns {Array} All elements matching the selector | [
"Uses",
"querySelectorAll",
"to",
"find",
"all",
"matching",
"elements",
"contained",
"within",
"the",
"current",
"View",
"s",
"element",
"but",
"not",
"within",
"the",
"elements",
"of",
"child",
"Views"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7706-L7728 | |
45,132 | mesmotronic/conbo | lib/conbo.js | function()
{
try
{
var el = this.el;
if (el.parentNode)
{
el.parentNode.removeChild(el);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.DETACH));
}
}
catch(e) {}
return this;
} | javascript | function()
{
try
{
var el = this.el;
if (el.parentNode)
{
el.parentNode.removeChild(el);
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.DETACH));
}
}
catch(e) {}
return this;
} | [
"function",
"(",
")",
"{",
"try",
"{",
"var",
"el",
"=",
"this",
".",
"el",
";",
"if",
"(",
"el",
".",
"parentNode",
")",
"{",
"el",
".",
"parentNode",
".",
"removeChild",
"(",
"el",
")",
";",
"this",
".",
"dispatchEvent",
"(",
"new",
"conbo",
".... | Take the View's element element out of the DOM
@returns {this} | [
"Take",
"the",
"View",
"s",
"element",
"element",
"out",
"of",
"the",
"DOM"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7734-L7749 | |
45,133 | mesmotronic/conbo | lib/conbo.js | function()
{
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.REMOVE));
if (this.data)
{
this.data = undefined;
}
if (this.subcontext && this.subcontext != this.context)
{
this.subcontext.destroy();
this.subcontext = undefined;
}
if (this.context)
{
this.... | javascript | function()
{
this.dispatchEvent(new conbo.ConboEvent(conbo.ConboEvent.REMOVE));
if (this.data)
{
this.data = undefined;
}
if (this.subcontext && this.subcontext != this.context)
{
this.subcontext.destroy();
this.subcontext = undefined;
}
if (this.context)
{
this.... | [
"function",
"(",
")",
"{",
"this",
".",
"dispatchEvent",
"(",
"new",
"conbo",
".",
"ConboEvent",
"(",
"conbo",
".",
"ConboEvent",
".",
"REMOVE",
")",
")",
";",
"if",
"(",
"this",
".",
"data",
")",
"{",
"this",
".",
"data",
"=",
"undefined",
";",
"}... | Remove and destroy this View by taking the element out of the DOM,
unbinding it, removing all event listeners and removing the View from
its Context.
You should use a REMOVE event handler to destroy any event listeners,
timers or other persistent code you may have added.
@returns {this} | [
"Remove",
"and",
"destroy",
"this",
"View",
"by",
"taking",
"the",
"element",
"out",
"of",
"the",
"DOM",
"unbinding",
"it",
"removing",
"all",
"event",
"listeners",
"and",
"removing",
"the",
"View",
"from",
"its",
"Context",
"."
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7761-L7803 | |
45,134 | mesmotronic/conbo | lib/conbo.js | function(view)
{
if (arguments.length > 1)
{
conbo.forEach(arguments, function(view, index, list)
{
this.appendView(view);
},
this);
return this;
}
if (typeof view === 'function')
{
view = new view(this.context);
}
if (!(view instanceof conbo.View))
{
... | javascript | function(view)
{
if (arguments.length > 1)
{
conbo.forEach(arguments, function(view, index, list)
{
this.appendView(view);
},
this);
return this;
}
if (typeof view === 'function')
{
view = new view(this.context);
}
if (!(view instanceof conbo.View))
{
... | [
"function",
"(",
"view",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
">",
"1",
")",
"{",
"conbo",
".",
"forEach",
"(",
"arguments",
",",
"function",
"(",
"view",
",",
"index",
",",
"list",
")",
"{",
"this",
".",
"appendView",
"(",
"view",
")",... | Append this DOM element from one View class instance this class
instances DOM element
@param {conbo.View|Function} view - The View instance to append
@returns {this} | [
"Append",
"this",
"DOM",
"element",
"from",
"one",
"View",
"class",
"instance",
"this",
"class",
"instances",
"DOM",
"element"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7812-L7838 | |
45,135 | mesmotronic/conbo | lib/conbo.js | function(view)
{
if (arguments.length > 1)
{
conbo.forEach(arguments, function(view, index, list)
{
this.prependView(view);
},
this);
return this;
}
if (typeof view === 'function')
{
view = new view(this.context);
}
if (!(view instanceof conbo.View))
... | javascript | function(view)
{
if (arguments.length > 1)
{
conbo.forEach(arguments, function(view, index, list)
{
this.prependView(view);
},
this);
return this;
}
if (typeof view === 'function')
{
view = new view(this.context);
}
if (!(view instanceof conbo.View))
... | [
"function",
"(",
"view",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
">",
"1",
")",
"{",
"conbo",
".",
"forEach",
"(",
"arguments",
",",
"function",
"(",
"view",
",",
"index",
",",
"list",
")",
"{",
"this",
".",
"prependView",
"(",
"view",
")"... | Prepend this DOM element from one View class instance this class
instances DOM element
@param {conbo.View} view - The View instance to preppend
@returns {this} | [
"Prepend",
"this",
"DOM",
"element",
"from",
"one",
"View",
"class",
"instance",
"this",
"class",
"instances",
"DOM",
"element"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7847-L7877 | |
45,136 | mesmotronic/conbo | lib/conbo.js | function()
{
var template = this.template;
if (!!this.templateUrl)
{
this.loadTemplate();
}
else
{
if (conbo.isFunction(template))
{
template = template(this);
}
var el = this.el;
if (conbo.isString(template))
{
el.innerHTML = this.__parseTemplate(... | javascript | function()
{
var template = this.template;
if (!!this.templateUrl)
{
this.loadTemplate();
}
else
{
if (conbo.isFunction(template))
{
template = template(this);
}
var el = this.el;
if (conbo.isString(template))
{
el.innerHTML = this.__parseTemplate(... | [
"function",
"(",
")",
"{",
"var",
"template",
"=",
"this",
".",
"template",
";",
"if",
"(",
"!",
"!",
"this",
".",
"templateUrl",
")",
"{",
"this",
".",
"loadTemplate",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"conbo",
".",
"isFunction",
"(",
... | Initialize the View's template, either by loading the templateUrl
or using the contents of the template property, if either exist
@returns {this} | [
"Initialize",
"the",
"View",
"s",
"template",
"either",
"by",
"loading",
"the",
"templateUrl",
"or",
"using",
"the",
"contents",
"of",
"the",
"template",
"property",
"if",
"either",
"exist"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7908-L7938 | |
45,137 | mesmotronic/conbo | lib/conbo.js | function(url)
{
url || (url = this.templateUrl);
var el = this.body;
this.unbindView();
if (this.templateCacheEnabled !== false && View__templateCache[url])
{
el.innerHTML = View__templateCache[url];
this.__initView();
return this;
}
var resultHandler = function(e... | javascript | function(url)
{
url || (url = this.templateUrl);
var el = this.body;
this.unbindView();
if (this.templateCacheEnabled !== false && View__templateCache[url])
{
el.innerHTML = View__templateCache[url];
this.__initView();
return this;
}
var resultHandler = function(e... | [
"function",
"(",
"url",
")",
"{",
"url",
"||",
"(",
"url",
"=",
"this",
".",
"templateUrl",
")",
";",
"var",
"el",
"=",
"this",
".",
"body",
";",
"this",
".",
"unbindView",
"(",
")",
";",
"if",
"(",
"this",
".",
"templateCacheEnabled",
"!==",
"fals... | Load HTML template and use it to populate this View's element
@param {string} [url] - The URL to which the request is sent
@returns {this} | [
"Load",
"HTML",
"template",
"and",
"use",
"it",
"to",
"populate",
"this",
"View",
"s",
"element"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L7946-L7989 | |
45,138 | mesmotronic/conbo | lib/conbo.js | function(command, data, method, resultClass)
{
var scope = this;
data = conbo.clone(data || {});
command = this.parseUrl(command, data);
data = this.encodeFunction(data, method);
return new Promise(function(resolve, reject)
{
conbo.httpRequest
({
data: data,
type: method || '... | javascript | function(command, data, method, resultClass)
{
var scope = this;
data = conbo.clone(data || {});
command = this.parseUrl(command, data);
data = this.encodeFunction(data, method);
return new Promise(function(resolve, reject)
{
conbo.httpRequest
({
data: data,
type: method || '... | [
"function",
"(",
"command",
",",
"data",
",",
"method",
",",
"resultClass",
")",
"{",
"var",
"scope",
"=",
"this",
";",
"data",
"=",
"conbo",
".",
"clone",
"(",
"data",
"||",
"{",
"}",
")",
";",
"command",
"=",
"this",
".",
"parseUrl",
"(",
"comman... | Call a method of the web service using the specified verb
@param {string} command - The name of the command
@param {Object} [data] - Object containing the data to send to the web service
@param {string} [method=GET] - GET, POST, etc (default: GET)
@param {Class} [resultClass] - Optional
@returns {Promise} | [
"Call",
"a",
"method",
"of",
"the",
"web",
"service",
"using",
"the",
"specified",
"verb"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L8695-L8728 | |
45,139 | mesmotronic/conbo | lib/conbo.js | function(command, method, resultClass)
{
if (conbo.isObject(command))
{
method = command.method;
resultClass = command.resultClass;
command = command.command;
}
this[conbo.toCamelCase(command)] = function(data)
{
return this.call(command, data, method, resultClass);
};
ret... | javascript | function(command, method, resultClass)
{
if (conbo.isObject(command))
{
method = command.method;
resultClass = command.resultClass;
command = command.command;
}
this[conbo.toCamelCase(command)] = function(data)
{
return this.call(command, data, method, resultClass);
};
ret... | [
"function",
"(",
"command",
",",
"method",
",",
"resultClass",
")",
"{",
"if",
"(",
"conbo",
".",
"isObject",
"(",
"command",
")",
")",
"{",
"method",
"=",
"command",
".",
"method",
";",
"resultClass",
"=",
"command",
".",
"resultClass",
";",
"command",
... | Call a method of the web service using the DELETE verb
@memberof conbo.HttpService.prototype
@method delete
@param {string} command - The name of the command
@param {Object} [data] - Object containing the data to send to the web service
@param {Class} [resultClass] - Optional
@returns {Promise}
Add one or more... | [
"Call",
"a",
"method",
"of",
"the",
"web",
"service",
"using",
"the",
"DELETE",
"verb"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L8791-L8806 | |
45,140 | mesmotronic/conbo | lib/conbo.js | function(url, data)
{
var parsedUrl = url,
matches = parsedUrl.match(/:\b\w+\b/g);
if (!!matches)
{
matches.forEach(function(key)
{
key = key.substr(1);
if (!(key in data))
{
throw new Error('Property "'+key+'" required but not found in data');
}
});
}
... | javascript | function(url, data)
{
var parsedUrl = url,
matches = parsedUrl.match(/:\b\w+\b/g);
if (!!matches)
{
matches.forEach(function(key)
{
key = key.substr(1);
if (!(key in data))
{
throw new Error('Property "'+key+'" required but not found in data');
}
});
}
... | [
"function",
"(",
"url",
",",
"data",
")",
"{",
"var",
"parsedUrl",
"=",
"url",
",",
"matches",
"=",
"parsedUrl",
".",
"match",
"(",
"/",
":\\b\\w+\\b",
"/",
"g",
")",
";",
"if",
"(",
"!",
"!",
"matches",
")",
"{",
"matches",
".",
"forEach",
"(",
... | Splice data into URL and remove spliced properties from data object | [
"Splice",
"data",
"into",
"URL",
"and",
"remove",
"spliced",
"properties",
"from",
"data",
"object"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L8842-L8872 | |
45,141 | mesmotronic/conbo | lib/conbo.js | function(fragment, options)
{
options || (options = {});
fragment = this.__getFragment(fragment);
if (this.fragment === fragment)
{
return;
}
var location = this.location;
this.fragment = fragment;
if (options.replace)
{
var href = location.href.replace(/(javascript... | javascript | function(fragment, options)
{
options || (options = {});
fragment = this.__getFragment(fragment);
if (this.fragment === fragment)
{
return;
}
var location = this.location;
this.fragment = fragment;
if (options.replace)
{
var href = location.href.replace(/(javascript... | [
"function",
"(",
"fragment",
",",
"options",
")",
"{",
"options",
"||",
"(",
"options",
"=",
"{",
"}",
")",
";",
"fragment",
"=",
"this",
".",
"__getFragment",
"(",
"fragment",
")",
";",
"if",
"(",
"this",
".",
"fragment",
"===",
"fragment",
")",
"{"... | Set the current path
@param {string} path - The path
@param {} | [
"Set",
"the",
"current",
"path"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L9111-L9141 | |
45,142 | mesmotronic/conbo | lib/conbo.js | function(fragmentOverride)
{
var fragment = this.fragment = this.__getFragment(fragmentOverride);
var matched = conbo.some(this.handlers, function(handler)
{
if (handler.route.test(fragment))
{
handler.callback(fragment);
return true;
}
});
if (!matched)
{
this.disp... | javascript | function(fragmentOverride)
{
var fragment = this.fragment = this.__getFragment(fragmentOverride);
var matched = conbo.some(this.handlers, function(handler)
{
if (handler.route.test(fragment))
{
handler.callback(fragment);
return true;
}
});
if (!matched)
{
this.disp... | [
"function",
"(",
"fragmentOverride",
")",
"{",
"var",
"fragment",
"=",
"this",
".",
"fragment",
"=",
"this",
".",
"__getFragment",
"(",
"fragmentOverride",
")",
";",
"var",
"matched",
"=",
"conbo",
".",
"some",
"(",
"this",
".",
"handlers",
",",
"function"... | Attempt to load the current URL fragment
@private
@returns {boolean} Whether or not the path is a valid route | [
"Attempt",
"to",
"load",
"the",
"current",
"URL",
"fragment"
] | 339df613eefc48e054e115337079573ad842f717 | https://github.com/mesmotronic/conbo/blob/339df613eefc48e054e115337079573ad842f717/lib/conbo.js#L9173-L9192 | |
45,143 | openmason/aonx | lib/aonx.js | _postHandlers | function _postHandlers() {
// any authentication checks first
if(config.authentication.enabled) {
logger.info(pkgname + " authentication to API's enabled");
app.all(config.api.path, function(req, res, next) {
if(config.authentication.ignores && req.params) {
// check if the params is in ignor... | javascript | function _postHandlers() {
// any authentication checks first
if(config.authentication.enabled) {
logger.info(pkgname + " authentication to API's enabled");
app.all(config.api.path, function(req, res, next) {
if(config.authentication.ignores && req.params) {
// check if the params is in ignor... | [
"function",
"_postHandlers",
"(",
")",
"{",
"// any authentication checks first",
"if",
"(",
"config",
".",
"authentication",
".",
"enabled",
")",
"{",
"logger",
".",
"info",
"(",
"pkgname",
"+",
"\" authentication to API's enabled\"",
")",
";",
"app",
".",
"all"... | all post handlers go here | [
"all",
"post",
"handlers",
"go",
"here"
] | e224668b6f5a3e939535e82218e17e00412cc39a | https://github.com/openmason/aonx/blob/e224668b6f5a3e939535e82218e17e00412cc39a/lib/aonx.js#L205-L271 |
45,144 | openmason/aonx | lib/aonx.js | _errorHandlers | function _errorHandlers() {
// middleware with an arity of 4 are considered
// error handling middleware. When you next(err)
// it will be passed through the defined middleware
// in order, but ONLY those with an arity of 4, ignoring
// regular middleware.
app.use(function(err, req, res, next){
logger.e... | javascript | function _errorHandlers() {
// middleware with an arity of 4 are considered
// error handling middleware. When you next(err)
// it will be passed through the defined middleware
// in order, but ONLY those with an arity of 4, ignoring
// regular middleware.
app.use(function(err, req, res, next){
logger.e... | [
"function",
"_errorHandlers",
"(",
")",
"{",
"// middleware with an arity of 4 are considered",
"// error handling middleware. When you next(err)",
"// it will be passed through the defined middleware",
"// in order, but ONLY those with an arity of 4, ignoring",
"// regular middleware.",
"app",
... | register these error handlers in the express configuration | [
"register",
"these",
"error",
"handlers",
"in",
"the",
"express",
"configuration"
] | e224668b6f5a3e939535e82218e17e00412cc39a | https://github.com/openmason/aonx/blob/e224668b6f5a3e939535e82218e17e00412cc39a/lib/aonx.js#L287-L317 |
45,145 | voorhoede/voorhoede-ocelot-formatter | lib/render-code.js | getCode | function getCode(code, language) {
if (prism.languages.hasOwnProperty(language)) {
code = prism.highlight(code, prism.languages[language]);
return `<pre class="language-${language}"><code>${code}</code></pre>`;
} else {
return `<pre class="language-unknown"><code>${code}</code></pre>`;
... | javascript | function getCode(code, language) {
if (prism.languages.hasOwnProperty(language)) {
code = prism.highlight(code, prism.languages[language]);
return `<pre class="language-${language}"><code>${code}</code></pre>`;
} else {
return `<pre class="language-unknown"><code>${code}</code></pre>`;
... | [
"function",
"getCode",
"(",
"code",
",",
"language",
")",
"{",
"if",
"(",
"prism",
".",
"languages",
".",
"hasOwnProperty",
"(",
"language",
")",
")",
"{",
"code",
"=",
"prism",
".",
"highlight",
"(",
"code",
",",
"prism",
".",
"languages",
"[",
"langu... | adds `json` to global `prism.languages` instance | [
"adds",
"json",
"to",
"global",
"prism",
".",
"languages",
"instance"
] | b0dc3c6cd0d1e956974a51129def29ce9d27d030 | https://github.com/voorhoede/voorhoede-ocelot-formatter/blob/b0dc3c6cd0d1e956974a51129def29ce9d27d030/lib/render-code.js#L4-L11 |
45,146 | socialally/air | lib/air/children.js | children | function children(selector) {
var arr = [], slice = this.slice, nodes, matches;
this.each(function(el) {
nodes = slice.call(el.childNodes);
// only include elements
nodes = nodes.filter(function(n) {
if(n instanceof Element) { return n;}
})
// filter direct descendants by selector
if(s... | javascript | function children(selector) {
var arr = [], slice = this.slice, nodes, matches;
this.each(function(el) {
nodes = slice.call(el.childNodes);
// only include elements
nodes = nodes.filter(function(n) {
if(n instanceof Element) { return n;}
})
// filter direct descendants by selector
if(s... | [
"function",
"children",
"(",
"selector",
")",
"{",
"var",
"arr",
"=",
"[",
"]",
",",
"slice",
"=",
"this",
".",
"slice",
",",
"nodes",
",",
"matches",
";",
"this",
".",
"each",
"(",
"function",
"(",
"el",
")",
"{",
"nodes",
"=",
"slice",
".",
"ca... | Get the children of each element in the set of matched elements,
optionally filtering by selector. | [
"Get",
"the",
"children",
"of",
"each",
"element",
"in",
"the",
"set",
"of",
"matched",
"elements",
"optionally",
"filtering",
"by",
"selector",
"."
] | a3d94de58aaa4930a425fbcc7266764bf6ca8ca6 | https://github.com/socialally/air/blob/a3d94de58aaa4930a425fbcc7266764bf6ca8ca6/lib/air/children.js#L5-L27 |
45,147 | mchalapuk/hyper-text-slider | lib/utils/dom.spec-helper.js | getSibling | function getSibling(node, relativeIndex) {
var parent = node.parentNode;
if (parent === null) {
return null;
}
var currentIndex = parent.childNodes.indexOf(node);
var siblingIndex = currentIndex + relativeIndex;
if (siblingIndex < 0 || siblingIndex > parent.childNodes.length - 1) {
return null;
}
... | javascript | function getSibling(node, relativeIndex) {
var parent = node.parentNode;
if (parent === null) {
return null;
}
var currentIndex = parent.childNodes.indexOf(node);
var siblingIndex = currentIndex + relativeIndex;
if (siblingIndex < 0 || siblingIndex > parent.childNodes.length - 1) {
return null;
}
... | [
"function",
"getSibling",
"(",
"node",
",",
"relativeIndex",
")",
"{",
"var",
"parent",
"=",
"node",
".",
"parentNode",
";",
"if",
"(",
"parent",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"var",
"currentIndex",
"=",
"parent",
".",
"childNodes"... | returns a sibling of given node | [
"returns",
"a",
"sibling",
"of",
"given",
"node"
] | 2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4 | https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/utils/dom.spec-helper.js#L115-L126 |
45,148 | wmluke/grunt-inline-angular-templates | tasks/inline_angular_templates.js | function (rawHtml) {
var matchKeys = Object.keys(options.unescape);
if (matchKeys.length === 0) {
return rawHtml;
}
var pattern = new RegExp('(' + matchKeys.join('|') + ')', 'g');
return rawHtml.replace(pattern, function (match) {
... | javascript | function (rawHtml) {
var matchKeys = Object.keys(options.unescape);
if (matchKeys.length === 0) {
return rawHtml;
}
var pattern = new RegExp('(' + matchKeys.join('|') + ')', 'g');
return rawHtml.replace(pattern, function (match) {
... | [
"function",
"(",
"rawHtml",
")",
"{",
"var",
"matchKeys",
"=",
"Object",
".",
"keys",
"(",
"options",
".",
"unescape",
")",
";",
"if",
"(",
"matchKeys",
".",
"length",
"===",
"0",
")",
"{",
"return",
"rawHtml",
";",
"}",
"var",
"pattern",
"=",
"new",... | Replace characters according to 'unescape' option | [
"Replace",
"characters",
"according",
"to",
"unescape",
"option"
] | 335ddff1e5c12e1526579936939211f9b8f37f28 | https://github.com/wmluke/grunt-inline-angular-templates/blob/335ddff1e5c12e1526579936939211f9b8f37f28/tasks/inline_angular_templates.js#L26-L35 | |
45,149 | renancouto/json2sass | lib/json2sass.js | readFile | function readFile(file) {
try {
file = require(path.relative(__dirname, file));
} catch (err) {
return err;
}
return file;
} | javascript | function readFile(file) {
try {
file = require(path.relative(__dirname, file));
} catch (err) {
return err;
}
return file;
} | [
"function",
"readFile",
"(",
"file",
")",
"{",
"try",
"{",
"file",
"=",
"require",
"(",
"path",
".",
"relative",
"(",
"__dirname",
",",
"file",
")",
")",
";",
"}",
"catch",
"(",
"err",
")",
"{",
"return",
"err",
";",
"}",
"return",
"file",
";",
"... | read json file
@param {string} file [json file]
@return {string} [json content] | [
"read",
"json",
"file"
] | dda57d99a1d7d031fd8dba8b28f3b304019f5983 | https://github.com/renancouto/json2sass/blob/dda57d99a1d7d031fd8dba8b28f3b304019f5983/lib/json2sass.js#L14-L22 |
45,150 | renancouto/json2sass | lib/json2sass.js | writeFile | function writeFile(input, output, type) {
var json = readFile(input),
content = getContent(json, type);
fs.writeFile(output, content, function (err) {
if (err) {
throw err;
}
console.log('The file "' + output + '" was written successfully!');
});
} | javascript | function writeFile(input, output, type) {
var json = readFile(input),
content = getContent(json, type);
fs.writeFile(output, content, function (err) {
if (err) {
throw err;
}
console.log('The file "' + output + '" was written successfully!');
});
} | [
"function",
"writeFile",
"(",
"input",
",",
"output",
",",
"type",
")",
"{",
"var",
"json",
"=",
"readFile",
"(",
"input",
")",
",",
"content",
"=",
"getContent",
"(",
"json",
",",
"type",
")",
";",
"fs",
".",
"writeFile",
"(",
"output",
",",
"conten... | write json content to file
@param {string} input [input file]
@param {string} output [output file]
@param {string} type [file type: sass || scss] | [
"write",
"json",
"content",
"to",
"file"
] | dda57d99a1d7d031fd8dba8b28f3b304019f5983 | https://github.com/renancouto/json2sass/blob/dda57d99a1d7d031fd8dba8b28f3b304019f5983/lib/json2sass.js#L84-L95 |
45,151 | theboyWhoCriedWoolf/transition-manager | src/parsers/dataParser.js | _extractActions | function _extractActions( opts )
{
// main properties
const data = opts.data,
configState = opts.stateData,
stateView = opts.stateView,
stateName = opts.stateName;
// new defined properties
let stateTransitions = [],
viewData = opts.viewData,
appDataView,
action,
statePrefix;
... | javascript | function _extractActions( opts )
{
// main properties
const data = opts.data,
configState = opts.stateData,
stateView = opts.stateView,
stateName = opts.stateName;
// new defined properties
let stateTransitions = [],
viewData = opts.viewData,
appDataView,
action,
statePrefix;
... | [
"function",
"_extractActions",
"(",
"opts",
")",
"{",
"// main properties",
"const",
"data",
"=",
"opts",
".",
"data",
",",
"configState",
"=",
"opts",
".",
"stateData",
",",
"stateView",
"=",
"opts",
".",
"stateView",
",",
"stateName",
"=",
"opts",
".",
"... | extract the actual transition data for the state
@param {object} configState - state data
@return {array} transition array - FSM | [
"extract",
"the",
"actual",
"transition",
"data",
"for",
"the",
"state"
] | a20fda0bb07c0098bf709ea03770b1ee2a855655 | https://github.com/theboyWhoCriedWoolf/transition-manager/blob/a20fda0bb07c0098bf709ea03770b1ee2a855655/src/parsers/dataParser.js#L14-L54 |
45,152 | theboyWhoCriedWoolf/transition-manager | src/parsers/dataParser.js | _extractTransitions | function _extractTransitions( prop, stateView, nextView )
{
var groupedTransitions = [];
if( prop.transitions ) { // if more transitions exist, add them
groupedTransitions = prop.transitions.map( ( transitionObject ) => {
return transitionObject;
});
}
prop.views = unique( prop.views, [ stateVie... | javascript | function _extractTransitions( prop, stateView, nextView )
{
var groupedTransitions = [];
if( prop.transitions ) { // if more transitions exist, add them
groupedTransitions = prop.transitions.map( ( transitionObject ) => {
return transitionObject;
});
}
prop.views = unique( prop.views, [ stateVie... | [
"function",
"_extractTransitions",
"(",
"prop",
",",
"stateView",
",",
"nextView",
")",
"{",
"var",
"groupedTransitions",
"=",
"[",
"]",
";",
"if",
"(",
"prop",
".",
"transitions",
")",
"{",
"// if more transitions exist, add them",
"groupedTransitions",
"=",
"pro... | extract transition information
and extract data if transition information is
an array of transitions
@param {onbject} prop
@param {string} stateView - id of state view
@param {string} nextView - id of view this transition goes to
@return {array} array of transitions fot this action | [
"extract",
"transition",
"information",
"and",
"extract",
"data",
"if",
"transition",
"information",
"is",
"an",
"array",
"of",
"transitions"
] | a20fda0bb07c0098bf709ea03770b1ee2a855655 | https://github.com/theboyWhoCriedWoolf/transition-manager/blob/a20fda0bb07c0098bf709ea03770b1ee2a855655/src/parsers/dataParser.js#L65-L76 |
45,153 | bline/remix | lib/remix.js | ReMix | function ReMix(name) {
var args = _.flatten(_.toArray(arguments));
if (_.isString(name) || _.isNull(name) || _.isUndefined(name))
args = args.slice(1);
else
name = undefined;
/**
* Unique id used for storing data in RegExp objects
* @private
*/
this._id = genguid... | javascript | function ReMix(name) {
var args = _.flatten(_.toArray(arguments));
if (_.isString(name) || _.isNull(name) || _.isUndefined(name))
args = args.slice(1);
else
name = undefined;
/**
* Unique id used for storing data in RegExp objects
* @private
*/
this._id = genguid... | [
"function",
"ReMix",
"(",
"name",
")",
"{",
"var",
"args",
"=",
"_",
".",
"flatten",
"(",
"_",
".",
"toArray",
"(",
"arguments",
")",
")",
";",
"if",
"(",
"_",
".",
"isString",
"(",
"name",
")",
"||",
"_",
".",
"isNull",
"(",
"name",
")",
"||",... | Construct a new `ReMix` object.
The name sets this ReMix's name. The name is used when
returning matches. All sub-child matches are namespaced based
on the hierarchy of names. `name` is optional.
Any arguments after `name` are passed to {@link ReMix#add}.
@constructor
@alias ReMix
@public
@param {ReMix~Name} [name] -... | [
"Construct",
"a",
"new",
"ReMix",
"object",
"."
] | 0b8a00b95d0c9b756e8451d2f1be7d69451236b8 | https://github.com/bline/remix/blob/0b8a00b95d0c9b756e8451d2f1be7d69451236b8/lib/remix.js#L51-L97 |
45,154 | vid/SenseBase | lib/form-query.js | shouldFilter | function shouldFilter(filters, anno) {
for (var i = filters.length - 1; i > -1; i--) {
var filter = filters[i];
if (filter.type === anno.type) {
if (_.isEqual(filter.position, anno.position)) {
if (anno.isA && anno.isA === 'Date') {
var filterDate = new Date(filter.value), fieldDate = ... | javascript | function shouldFilter(filters, anno) {
for (var i = filters.length - 1; i > -1; i--) {
var filter = filters[i];
if (filter.type === anno.type) {
if (_.isEqual(filter.position, anno.position)) {
if (anno.isA && anno.isA === 'Date') {
var filterDate = new Date(filter.value), fieldDate = ... | [
"function",
"shouldFilter",
"(",
"filters",
",",
"anno",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"filters",
".",
"length",
"-",
"1",
";",
"i",
">",
"-",
"1",
";",
"i",
"--",
")",
"{",
"var",
"filter",
"=",
"filters",
"[",
"i",
"]",
";",
"if",
... | Return true if this field should be filtered out | [
"Return",
"true",
"if",
"this",
"field",
"should",
"be",
"filtered",
"out"
] | d60bcf28239e7dde437d8a6bdae41a6921dcd05b | https://github.com/vid/SenseBase/blob/d60bcf28239e7dde437d8a6bdae41a6921dcd05b/lib/form-query.js#L36-L57 |
45,155 | leoselig/grunt-concat-deps | tasks/concat_deps.js | function(name) {
var match = null;
list.forEach(function(file) {
if(_.indexOf(file.modules, name) >= 0) {
match = file;
return false;
}
});
return match;
} | javascript | function(name) {
var match = null;
list.forEach(function(file) {
if(_.indexOf(file.modules, name) >= 0) {
match = file;
return false;
}
});
return match;
} | [
"function",
"(",
"name",
")",
"{",
"var",
"match",
"=",
"null",
";",
"list",
".",
"forEach",
"(",
"function",
"(",
"file",
")",
"{",
"if",
"(",
"_",
".",
"indexOf",
"(",
"file",
".",
"modules",
",",
"name",
")",
">=",
"0",
")",
"{",
"match",
"=... | Gets the file object info for one of its modules name | [
"Gets",
"the",
"file",
"object",
"info",
"for",
"one",
"of",
"its",
"modules",
"name"
] | 9ad4964f4396b48b994684ae08bb73c0e62a69ea | https://github.com/leoselig/grunt-concat-deps/blob/9ad4964f4396b48b994684ae08bb73c0e62a69ea/tasks/concat_deps.js#L63-L72 | |
45,156 | leoselig/grunt-concat-deps | tasks/concat_deps.js | function(module) {
if (!module) {
return;
}
var file = fileByModules(module);
Array.prototype.push.apply(seen, file.modules);
file.requires.forEach(function(module) {
// Ignore resoled modules and dependencies in own file
if((_.indexOf(resolved, module) < 0) &&
(_.indexOf(file.modules... | javascript | function(module) {
if (!module) {
return;
}
var file = fileByModules(module);
Array.prototype.push.apply(seen, file.modules);
file.requires.forEach(function(module) {
// Ignore resoled modules and dependencies in own file
if((_.indexOf(resolved, module) < 0) &&
(_.indexOf(file.modules... | [
"function",
"(",
"module",
")",
"{",
"if",
"(",
"!",
"module",
")",
"{",
"return",
";",
"}",
"var",
"file",
"=",
"fileByModules",
"(",
"module",
")",
";",
"Array",
".",
"prototype",
".",
"push",
".",
"apply",
"(",
"seen",
",",
"file",
".",
"modules... | Resolves a module and its dependencies | [
"Resolves",
"a",
"module",
"and",
"its",
"dependencies"
] | 9ad4964f4396b48b994684ae08bb73c0e62a69ea | https://github.com/leoselig/grunt-concat-deps/blob/9ad4964f4396b48b994684ae08bb73c0e62a69ea/tasks/concat_deps.js#L75-L98 | |
45,157 | warehouseai/warehouse-models | lib/index.js | WarehouseModels | function WarehouseModels(datastar) {
this.Build = require('./build')(datastar, this);
this.BuildFile = require('./build-file')(datastar, this);
this.BuildHead = require('./build-head')(datastar, this);
this.Package = require('./package')(datastar, this);
this.PackageCache = require('./package-cache')(datastar... | javascript | function WarehouseModels(datastar) {
this.Build = require('./build')(datastar, this);
this.BuildFile = require('./build-file')(datastar, this);
this.BuildHead = require('./build-head')(datastar, this);
this.Package = require('./package')(datastar, this);
this.PackageCache = require('./package-cache')(datastar... | [
"function",
"WarehouseModels",
"(",
"datastar",
")",
"{",
"this",
".",
"Build",
"=",
"require",
"(",
"'./build'",
")",
"(",
"datastar",
",",
"this",
")",
";",
"this",
".",
"BuildFile",
"=",
"require",
"(",
"'./build-file'",
")",
"(",
"datastar",
",",
"th... | Make a predictable constructor based object and pass in the context with datastar
because we are adding all of the models to this parent `WarehouseModels` constructor
and they should have access to each other if needed
@param {Datastar} datastar Instance of Datastar | [
"Make",
"a",
"predictable",
"constructor",
"based",
"object",
"and",
"pass",
"in",
"the",
"context",
"with",
"datastar",
"because",
"we",
"are",
"adding",
"all",
"of",
"the",
"models",
"to",
"this",
"parent",
"WarehouseModels",
"constructor",
"and",
"they",
"s... | ee65aa759adc6a7f83f4b02608a4e74fe562aa89 | https://github.com/warehouseai/warehouse-models/blob/ee65aa759adc6a7f83f4b02608a4e74fe562aa89/lib/index.js#L24-L36 |
45,158 | KyperTech/matter | lib/utils/token.js | _delete | function _delete() {
// Remove string token
cookiesUtil.deleteCookie(_config2.default.tokenName);
// Remove user data
envStorage.removeItem(_config2.default.tokenDataName);
_logger2.default.log({
description: 'Token was removed.',
func: 'delete', obj: 'token'
});
} | javascript | function _delete() {
// Remove string token
cookiesUtil.deleteCookie(_config2.default.tokenName);
// Remove user data
envStorage.removeItem(_config2.default.tokenDataName);
_logger2.default.log({
description: 'Token was removed.',
func: 'delete', obj: 'token'
});
} | [
"function",
"_delete",
"(",
")",
"{",
"// Remove string token",
"cookiesUtil",
".",
"deleteCookie",
"(",
"_config2",
".",
"default",
".",
"tokenName",
")",
";",
"// Remove user data",
"envStorage",
".",
"removeItem",
"(",
"_config2",
".",
"default",
".",
"tokenDat... | Delete token data | [
"Delete",
"token",
"data"
] | 2a8f2fce565fd66d3718a40f35ed857b044e6483 | https://github.com/KyperTech/matter/blob/2a8f2fce565fd66d3718a40f35ed857b044e6483/lib/utils/token.js#L104-L113 |
45,159 | vadr-vr/VR-Analytics-JSCore | index.js | initVadRAnalytics | function initVadRAnalytics(params){
timeManager.init();
dataCollector.init();
dataManager.init();
deviceData.init();
user.init();
initState = true;
// set initial params if provided
_setParams(params);
} | javascript | function initVadRAnalytics(params){
timeManager.init();
dataCollector.init();
dataManager.init();
deviceData.init();
user.init();
initState = true;
// set initial params if provided
_setParams(params);
} | [
"function",
"initVadRAnalytics",
"(",
"params",
")",
"{",
"timeManager",
".",
"init",
"(",
")",
";",
"dataCollector",
".",
"init",
"(",
")",
";",
"dataManager",
".",
"init",
"(",
")",
";",
"deviceData",
".",
"init",
"(",
")",
";",
"user",
".",
"init",
... | inits the vadr analytics core for a new application
@param {*} params default event configuration and extra session metadata | [
"inits",
"the",
"vadr",
"analytics",
"core",
"for",
"a",
"new",
"application"
] | 7e4a493c824c2c1716360dcb6a3bfecfede5df3b | https://github.com/vadr-vr/VR-Analytics-JSCore/blob/7e4a493c824c2c1716360dcb6a3bfecfede5df3b/index.js#L26-L39 |
45,160 | vadr-vr/VR-Analytics-JSCore | index.js | _setParams | function _setParams(params){
if(params){
// set the data collection params
if(params.defaultEvents){
for (let i = 0; i < params.defaultEvents.length; i++){
dataCollector.configureEventCollection(
params.defaultEvents[i].name,
pa... | javascript | function _setParams(params){
if(params){
// set the data collection params
if(params.defaultEvents){
for (let i = 0; i < params.defaultEvents.length; i++){
dataCollector.configureEventCollection(
params.defaultEvents[i].name,
pa... | [
"function",
"_setParams",
"(",
"params",
")",
"{",
"if",
"(",
"params",
")",
"{",
"// set the data collection params",
"if",
"(",
"params",
".",
"defaultEvents",
")",
"{",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"defaultEvents",
"... | set the params for the application
@param {Object} params
@param {Object[]} params.defaultEvents array containing the configuretion for default events
@param {Object[]} params.sessionInfo array containing the meta data for session | [
"set",
"the",
"params",
"for",
"the",
"application"
] | 7e4a493c824c2c1716360dcb6a3bfecfede5df3b | https://github.com/vadr-vr/VR-Analytics-JSCore/blob/7e4a493c824c2c1716360dcb6a3bfecfede5df3b/index.js#L46-L88 |
45,161 | vid/SenseBase | lib/auth.js | authedByUsername | function authedByUsername(username) {
return _.first(_.where(context.authed, { username: username}));
} | javascript | function authedByUsername(username) {
return _.first(_.where(context.authed, { username: username}));
} | [
"function",
"authedByUsername",
"(",
"username",
")",
"{",
"return",
"_",
".",
"first",
"(",
"_",
".",
"where",
"(",
"context",
".",
"authed",
",",
"{",
"username",
":",
"username",
"}",
")",
")",
";",
"}"
] | Retrieve a user record by their username. | [
"Retrieve",
"a",
"user",
"record",
"by",
"their",
"username",
"."
] | d60bcf28239e7dde437d8a6bdae41a6921dcd05b | https://github.com/vid/SenseBase/blob/d60bcf28239e7dde437d8a6bdae41a6921dcd05b/lib/auth.js#L71-L73 |
45,162 | serg-io/backbone-sdb | backbone-sdb.js | httpRequest | function httpRequest(options, body, callback) {
// The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1)
// say that a 'close' event can be fired after the 'end' event has been fired. To ensure that the `processResponse` callback
// is calle... | javascript | function httpRequest(options, body, callback) {
// The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1)
// say that a 'close' event can be fired after the 'end' event has been fired. To ensure that the `processResponse` callback
// is calle... | [
"function",
"httpRequest",
"(",
"options",
",",
"body",
",",
"callback",
")",
"{",
"// The `processResponse` callback should only be called once. The [http docs](http://nodejs.org/api/http.html#http_event_close_1)",
"// say that a 'close' event can be fired after the 'end' event has been fired... | This is the method that send the actual HTTP requests, caches the response, and executes the callback after the response has been received.
@method httpRequest
@private
@param {Object} options The [HTTP options](http://nodejs.org/api/http.html#http_http_request_options_callback) to use when sending the request.
@param... | [
"This",
"is",
"the",
"method",
"that",
"send",
"the",
"actual",
"HTTP",
"requests",
"caches",
"the",
"response",
"and",
"executes",
"the",
"callback",
"after",
"the",
"response",
"has",
"been",
"received",
"."
] | aa43a854470aa28d72d8b4d19c603d91283788b9 | https://github.com/serg-io/backbone-sdb/blob/aa43a854470aa28d72d8b4d19c603d91283788b9/backbone-sdb.js#L513-L535 |
45,163 | serg-io/backbone-sdb | backbone-sdb.js | getEC2IAMRole | function getEC2IAMRole(callback) {
httpRequest({host: EC2_METADATA_HOST, path: SECURITY_CREDENTIALS_RESOURCE}, null, function(error, role, httpResponse) {
callback(error, _.isString(role) ? role.trim() : role, httpResponse);
});
} | javascript | function getEC2IAMRole(callback) {
httpRequest({host: EC2_METADATA_HOST, path: SECURITY_CREDENTIALS_RESOURCE}, null, function(error, role, httpResponse) {
callback(error, _.isString(role) ? role.trim() : role, httpResponse);
});
} | [
"function",
"getEC2IAMRole",
"(",
"callback",
")",
"{",
"httpRequest",
"(",
"{",
"host",
":",
"EC2_METADATA_HOST",
",",
"path",
":",
"SECURITY_CREDENTIALS_RESOURCE",
"}",
",",
"null",
",",
"function",
"(",
"error",
",",
"role",
",",
"httpResponse",
")",
"{",
... | Gets the EC2 IAM role name from the metadata service.
@method getEC2IAMRole
@private
@param {Function} callback Callback function that receives the role returned by the metadata service. | [
"Gets",
"the",
"EC2",
"IAM",
"role",
"name",
"from",
"the",
"metadata",
"service",
"."
] | aa43a854470aa28d72d8b4d19c603d91283788b9 | https://github.com/serg-io/backbone-sdb/blob/aa43a854470aa28d72d8b4d19c603d91283788b9/backbone-sdb.js#L544-L548 |
45,164 | serg-io/backbone-sdb | backbone-sdb.js | getEC2IAMSecurityCredentials | function getEC2IAMSecurityCredentials(role, callback) {
httpRequest({host: EC2_METADATA_HOST, path: SECURITY_CREDENTIALS_RESOURCE + role}, null, function(error, jsonStr, httpResponse) {
var credentials;
try {
credentials = JSON.parse(jsonStr);
} catch (parseError) {
if (!error) error = parseError;
... | javascript | function getEC2IAMSecurityCredentials(role, callback) {
httpRequest({host: EC2_METADATA_HOST, path: SECURITY_CREDENTIALS_RESOURCE + role}, null, function(error, jsonStr, httpResponse) {
var credentials;
try {
credentials = JSON.parse(jsonStr);
} catch (parseError) {
if (!error) error = parseError;
... | [
"function",
"getEC2IAMSecurityCredentials",
"(",
"role",
",",
"callback",
")",
"{",
"httpRequest",
"(",
"{",
"host",
":",
"EC2_METADATA_HOST",
",",
"path",
":",
"SECURITY_CREDENTIALS_RESOURCE",
"+",
"role",
"}",
",",
"null",
",",
"function",
"(",
"error",
",",
... | Gets the security credentials from the metadata service.
@method getEC2IAMSecurityCredentials
@private
@param {String} role IAM role name.
@param {Function} callback Callback function that receives the parsed credentials object returned by the metadata service. | [
"Gets",
"the",
"security",
"credentials",
"from",
"the",
"metadata",
"service",
"."
] | aa43a854470aa28d72d8b4d19c603d91283788b9 | https://github.com/serg-io/backbone-sdb/blob/aa43a854470aa28d72d8b4d19c603d91283788b9/backbone-sdb.js#L558-L569 |
45,165 | serg-io/backbone-sdb | backbone-sdb.js | needsToLoadEC2IAMRoleCredentials | function needsToLoadEC2IAMRoleCredentials() {
if (!accessKey || !secretKey) return true;
if (credentialsExpiration === null) return false;
return (credentialsExpiration.getTime() - Date.now()) < CREDENTIALS_EXPIRATION_THRESHOLD;
} | javascript | function needsToLoadEC2IAMRoleCredentials() {
if (!accessKey || !secretKey) return true;
if (credentialsExpiration === null) return false;
return (credentialsExpiration.getTime() - Date.now()) < CREDENTIALS_EXPIRATION_THRESHOLD;
} | [
"function",
"needsToLoadEC2IAMRoleCredentials",
"(",
")",
"{",
"if",
"(",
"!",
"accessKey",
"||",
"!",
"secretKey",
")",
"return",
"true",
";",
"if",
"(",
"credentialsExpiration",
"===",
"null",
")",
"return",
"false",
";",
"return",
"(",
"credentialsExpiration"... | Helper function that returns `true` if getting the security credentials from the metadata service is needed or `false` otherwise.
@method needsToLoadEC2IAMRoleCredentials
@private | [
"Helper",
"function",
"that",
"returns",
"true",
"if",
"getting",
"the",
"security",
"credentials",
"from",
"the",
"metadata",
"service",
"is",
"needed",
"or",
"false",
"otherwise",
"."
] | aa43a854470aa28d72d8b4d19c603d91283788b9 | https://github.com/serg-io/backbone-sdb/blob/aa43a854470aa28d72d8b4d19c603d91283788b9/backbone-sdb.js#L577-L581 |
45,166 | jriecken/asset-smasher | lib/asset-smasher.js | function (cb) {
this.reset();
var bundle = this.bundle;
var self = this;
async.waterfall([
function (wfCb) {
if (self.noclean) {
wfCb();
} else {
// Remove the output directory if it exists
existsCompat(self.outputTo, function (exists) {
if... | javascript | function (cb) {
this.reset();
var bundle = this.bundle;
var self = this;
async.waterfall([
function (wfCb) {
if (self.noclean) {
wfCb();
} else {
// Remove the output directory if it exists
existsCompat(self.outputTo, function (exists) {
if... | [
"function",
"(",
"cb",
")",
"{",
"this",
".",
"reset",
"(",
")",
";",
"var",
"bundle",
"=",
"this",
".",
"bundle",
";",
"var",
"self",
"=",
"this",
";",
"async",
".",
"waterfall",
"(",
"[",
"function",
"(",
"wfCb",
")",
"{",
"if",
"(",
"self",
... | Compile all the assets according to the options | [
"Compile",
"all",
"the",
"assets",
"according",
"to",
"the",
"options"
] | c627449b01f5da892683895915f74baa9994a475 | https://github.com/jriecken/asset-smasher/blob/c627449b01f5da892683895915f74baa9994a475/lib/asset-smasher.js#L168-L230 | |
45,167 | jriecken/asset-smasher | lib/asset-smasher.js | function (cb) {
this.reset();
var bundle = this.bundle;
var self = this;
async.waterfall([
function (wfCb) {
if (self.verbose) {
console.log('findAssets: starting discovery phase');
}
executePhase(self.phases.discovery, bundle, wfCb);
},
function (b, w... | javascript | function (cb) {
this.reset();
var bundle = this.bundle;
var self = this;
async.waterfall([
function (wfCb) {
if (self.verbose) {
console.log('findAssets: starting discovery phase');
}
executePhase(self.phases.discovery, bundle, wfCb);
},
function (b, w... | [
"function",
"(",
"cb",
")",
"{",
"this",
".",
"reset",
"(",
")",
";",
"var",
"bundle",
"=",
"this",
".",
"bundle",
";",
"var",
"self",
"=",
"this",
";",
"async",
".",
"waterfall",
"(",
"[",
"function",
"(",
"wfCb",
")",
"{",
"if",
"(",
"self",
... | Find, but do not compile all the assets according to the options. | [
"Find",
"but",
"do",
"not",
"compile",
"all",
"the",
"assets",
"according",
"to",
"the",
"options",
"."
] | c627449b01f5da892683895915f74baa9994a475 | https://github.com/jriecken/asset-smasher/blob/c627449b01f5da892683895915f74baa9994a475/lib/asset-smasher.js#L292-L312 | |
45,168 | jriecken/asset-smasher | lib/asset-smasher.js | function () {
var bundle = this.bundle;
var order = bundle.getProcessingOrder();
return order.map(function (file ) {
return bundle.getAsset(file).logicalPath;
});
} | javascript | function () {
var bundle = this.bundle;
var order = bundle.getProcessingOrder();
return order.map(function (file ) {
return bundle.getAsset(file).logicalPath;
});
} | [
"function",
"(",
")",
"{",
"var",
"bundle",
"=",
"this",
".",
"bundle",
";",
"var",
"order",
"=",
"bundle",
".",
"getProcessingOrder",
"(",
")",
";",
"return",
"order",
".",
"map",
"(",
"function",
"(",
"file",
")",
"{",
"return",
"bundle",
".",
"get... | Get a list of logical paths in the order that the assets will be processed in | [
"Get",
"a",
"list",
"of",
"logical",
"paths",
"in",
"the",
"order",
"that",
"the",
"assets",
"will",
"be",
"processed",
"in"
] | c627449b01f5da892683895915f74baa9994a475 | https://github.com/jriecken/asset-smasher/blob/c627449b01f5da892683895915f74baa9994a475/lib/asset-smasher.js#L346-L352 | |
45,169 | binduwavell/generator-alfresco-common | lib/mem-fs-utils.js | function (storeOrEditor, path) {
debug('Checking if ' + path + ' exists in the in-memory store.');
var retv = false;
this.processInMemoryStore(storeOrEditor, file => {
debug('Evaluating ' + file.path + ' in state ' + file.state + ' with content length ' + (file && file.contents ? file.contents.length ... | javascript | function (storeOrEditor, path) {
debug('Checking if ' + path + ' exists in the in-memory store.');
var retv = false;
this.processInMemoryStore(storeOrEditor, file => {
debug('Evaluating ' + file.path + ' in state ' + file.state + ' with content length ' + (file && file.contents ? file.contents.length ... | [
"function",
"(",
"storeOrEditor",
",",
"path",
")",
"{",
"debug",
"(",
"'Checking if '",
"+",
"path",
"+",
"' exists in the in-memory store.'",
")",
";",
"var",
"retv",
"=",
"false",
";",
"this",
".",
"processInMemoryStore",
"(",
"storeOrEditor",
",",
"file",
... | Check if a path exists in the provided memfs Store.
As memfs only stores files (and not paths) we simply make sure we find at least one valid file
with the provided path as a prefix (or complete match). I'm not aware of
@param {!Store|!EditionInterface} storeOrEditor
@param {string} file path or folder path | [
"Check",
"if",
"a",
"path",
"exists",
"in",
"the",
"provided",
"memfs",
"Store",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/mem-fs-utils.js#L16-L28 | |
45,170 | binduwavell/generator-alfresco-common | lib/mem-fs-utils.js | function (storeOrEditor, from, to) {
debug('Performing inMemoryCopy from ' + from + ' to ' + to + '.');
var fromLen = from.length;
this.processInMemoryStore(storeOrEditor, (file, store) => {
var idx = file.path.indexOf(from);
if (idx === 0 && file.contents !== null && file.state !== 'deleted') {... | javascript | function (storeOrEditor, from, to) {
debug('Performing inMemoryCopy from ' + from + ' to ' + to + '.');
var fromLen = from.length;
this.processInMemoryStore(storeOrEditor, (file, store) => {
var idx = file.path.indexOf(from);
if (idx === 0 && file.contents !== null && file.state !== 'deleted') {... | [
"function",
"(",
"storeOrEditor",
",",
"from",
",",
"to",
")",
"{",
"debug",
"(",
"'Performing inMemoryCopy from '",
"+",
"from",
"+",
"' to '",
"+",
"to",
"+",
"'.'",
")",
";",
"var",
"fromLen",
"=",
"from",
".",
"length",
";",
"this",
".",
"processInMe... | Given the path for a virtual file or folder and a destination path perform a copy
completely within mem-fs.
@param {!Store|!EditionInterface} storeOrEditor
@param {string} from - file path or folder path
@param {string} to - folder path | [
"Given",
"the",
"path",
"for",
"a",
"virtual",
"file",
"or",
"folder",
"and",
"a",
"destination",
"path",
"perform",
"a",
"copy",
"completely",
"within",
"mem",
"-",
"fs",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/mem-fs-utils.js#L38-L56 | |
45,171 | binduwavell/generator-alfresco-common | lib/mem-fs-utils.js | function (storeOrEditor, from, to) {
debug('Performing inMemoryMove from ' + from + ' to ' + to);
var store = (storeOrEditor && storeOrEditor.store ? storeOrEditor.store : storeOrEditor);
var memFsEditor = require('mem-fs-editor').create(store);
var fromLen = from.length;
store.each(function (file) ... | javascript | function (storeOrEditor, from, to) {
debug('Performing inMemoryMove from ' + from + ' to ' + to);
var store = (storeOrEditor && storeOrEditor.store ? storeOrEditor.store : storeOrEditor);
var memFsEditor = require('mem-fs-editor').create(store);
var fromLen = from.length;
store.each(function (file) ... | [
"function",
"(",
"storeOrEditor",
",",
"from",
",",
"to",
")",
"{",
"debug",
"(",
"'Performing inMemoryMove from '",
"+",
"from",
"+",
"' to '",
"+",
"to",
")",
";",
"var",
"store",
"=",
"(",
"storeOrEditor",
"&&",
"storeOrEditor",
".",
"store",
"?",
"stor... | Given the path for a virtual file or folder and a destination path perform a move
completely within mem-fs.
@param {!Store|!EditionInterface} storeOrEditor
@param {string} from - file path or folder path
@param {string} to - folder path | [
"Given",
"the",
"path",
"for",
"a",
"virtual",
"file",
"or",
"folder",
"and",
"a",
"destination",
"path",
"perform",
"a",
"move",
"completely",
"within",
"mem",
"-",
"fs",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/mem-fs-utils.js#L66-L83 | |
45,172 | binduwavell/generator-alfresco-common | lib/mem-fs-utils.js | function (storeOrEditor, logFn) {
debug('Dumping contents of in-memory store.');
var logFunc = logFn || console.log;
this.processInMemoryStore(storeOrEditor, file => {
logFunc.call(this, file.path + ' [STATE:' + file.state + ']');
/*
logFunc.call(this, JSON.stringify(file, function (k, v)... | javascript | function (storeOrEditor, logFn) {
debug('Dumping contents of in-memory store.');
var logFunc = logFn || console.log;
this.processInMemoryStore(storeOrEditor, file => {
logFunc.call(this, file.path + ' [STATE:' + file.state + ']');
/*
logFunc.call(this, JSON.stringify(file, function (k, v)... | [
"function",
"(",
"storeOrEditor",
",",
"logFn",
")",
"{",
"debug",
"(",
"'Dumping contents of in-memory store.'",
")",
";",
"var",
"logFunc",
"=",
"logFn",
"||",
"console",
".",
"log",
";",
"this",
".",
"processInMemoryStore",
"(",
"storeOrEditor",
",",
"file",
... | Log file path and sate information via a log function or console.log if not provided.
@param {!Store|!EditionInterface} storeOrEditor
@param {(Function|undefined)} logFn | [
"Log",
"file",
"path",
"and",
"sate",
"information",
"via",
"a",
"log",
"function",
"or",
"console",
".",
"log",
"if",
"not",
"provided",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/mem-fs-utils.js#L91-L107 | |
45,173 | vid/SenseBase | web/dashboard/dashboard.js | processReconcile | function processReconcile(field, toSet, setSep, reconcileSet) {
// process validated updates
if (reconcileSet) {
reconcileSet.forEach(function(t) {
var s = { uri: t.uri };
s[toSet] = t.setVal;
context.pubsub.item.save(s);
});
return;
}
} | javascript | function processReconcile(field, toSet, setSep, reconcileSet) {
// process validated updates
if (reconcileSet) {
reconcileSet.forEach(function(t) {
var s = { uri: t.uri };
s[toSet] = t.setVal;
context.pubsub.item.save(s);
});
return;
}
} | [
"function",
"processReconcile",
"(",
"field",
",",
"toSet",
",",
"setSep",
",",
"reconcileSet",
")",
"{",
"// process validated updates",
"if",
"(",
"reconcileSet",
")",
"{",
"reconcileSet",
".",
"forEach",
"(",
"function",
"(",
"t",
")",
"{",
"var",
"s",
"=... | process validated updates | [
"process",
"validated",
"updates"
] | d60bcf28239e7dde437d8a6bdae41a6921dcd05b | https://github.com/vid/SenseBase/blob/d60bcf28239e7dde437d8a6bdae41a6921dcd05b/web/dashboard/dashboard.js#L190-L200 |
45,174 | jonschlinkert/question-cache | index.js | Questions | function Questions(options) {
if (!(this instanceof Questions)) {
return new Questions(options);
}
debug('initializing from <%s>', __filename);
Options.call(this, utils.omitEmpty(options || {}));
use(this);
this.initQuestions(this.options);
} | javascript | function Questions(options) {
if (!(this instanceof Questions)) {
return new Questions(options);
}
debug('initializing from <%s>', __filename);
Options.call(this, utils.omitEmpty(options || {}));
use(this);
this.initQuestions(this.options);
} | [
"function",
"Questions",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Questions",
")",
")",
"{",
"return",
"new",
"Questions",
"(",
"options",
")",
";",
"}",
"debug",
"(",
"'initializing from <%s>'",
",",
"__filename",
")",
";",
... | Create an instance of `Questions` with the given `options`.
```js
var Questions = new Questions(options);
```
@param {Object} `options` question cache options
@api public | [
"Create",
"an",
"instance",
"of",
"Questions",
"with",
"the",
"given",
"options",
"."
] | 85e4f1e00be1f230c435101f70c5da4227ce51ff | https://github.com/jonschlinkert/question-cache/blob/85e4f1e00be1f230c435101f70c5da4227ce51ff/index.js#L27-L35 |
45,175 | usecanvas/share-js-stream | index.js | ShareJSStream | function ShareJSStream(ws, options) {
options = options || {};
options.keepAlive = options.keepAlive !== undefined ?
options.keepAlive : KEEP_ALIVE;
this.debug = options.debug === true;
this.ws = ws;
this.headers = this.ws.upgradeReq.headers;
this.remoteAddress = this.ws.upgrad... | javascript | function ShareJSStream(ws, options) {
options = options || {};
options.keepAlive = options.keepAlive !== undefined ?
options.keepAlive : KEEP_ALIVE;
this.debug = options.debug === true;
this.ws = ws;
this.headers = this.ws.upgradeReq.headers;
this.remoteAddress = this.ws.upgrad... | [
"function",
"ShareJSStream",
"(",
"ws",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"options",
".",
"keepAlive",
"=",
"options",
".",
"keepAlive",
"!==",
"undefined",
"?",
"options",
".",
"keepAlive",
":",
"KEEP_ALIVE",
";",
... | A Stream for managing communication between a ShareJS client and a ws client
var ShareJSStream = require('share-js-stream');
var WsServer = require('ws').Server;
var http = require('http');
var livedb = require('livedb');
var shareServer = require('share').server.createClient({
backend: livedb.c... | [
"A",
"Stream",
"for",
"managing",
"communication",
"between",
"a",
"ShareJS",
"client",
"and",
"a",
"ws",
"client"
] | 6fae58dcbab7d15b22efe0e19c7f510b48de231c | https://github.com/usecanvas/share-js-stream/blob/6fae58dcbab7d15b22efe0e19c7f510b48de231c/index.js#L41-L151 |
45,176 | tombenke/datafile | dist/schemas/index.js | loadSchema | function loadSchema(schemaBasePath, fullSchemaFileName) {
var scfPath = fullSchemaFileName.split('/');
var schemaFileName = scfPath[scfPath.length - 1];
var mainSchema = null;
// First, register() the main schemas you plan to use.
try {
mainSchema = _jsYaml2.default.load(_fs2.default.readFi... | javascript | function loadSchema(schemaBasePath, fullSchemaFileName) {
var scfPath = fullSchemaFileName.split('/');
var schemaFileName = scfPath[scfPath.length - 1];
var mainSchema = null;
// First, register() the main schemas you plan to use.
try {
mainSchema = _jsYaml2.default.load(_fs2.default.readFi... | [
"function",
"loadSchema",
"(",
"schemaBasePath",
",",
"fullSchemaFileName",
")",
"{",
"var",
"scfPath",
"=",
"fullSchemaFileName",
".",
"split",
"(",
"'/'",
")",
";",
"var",
"schemaFileName",
"=",
"scfPath",
"[",
"scfPath",
".",
"length",
"-",
"1",
"]",
";",... | Load the named JSON schema
@arg {String} schemaFileName - The name of the schema file
@return {Object} - The loaded schema
@function
Load the JSON schema validator module and create a validator object | [
"Load",
"the",
"named",
"JSON",
"schema"
] | 658a02142a9f80cc889e5074e91fc19d5ffc6f1a | https://github.com/tombenke/datafile/blob/658a02142a9f80cc889e5074e91fc19d5ffc6f1a/dist/schemas/index.js#L44-L63 |
45,177 | briancsparks/serverassist | ra-scripts/models/partner.js | function(argv, context, callback) {
return MongoClient.connect(mongoHost, function(err, db) {
if (err) { return sg.die(err, callback, 'upsertPartner.MongoClient.connect'); }
var partnersDb = db.collection('partners');
var partnerId = argvGet(argv, 'partner-id,partner');
var item = {};
_.each... | javascript | function(argv, context, callback) {
return MongoClient.connect(mongoHost, function(err, db) {
if (err) { return sg.die(err, callback, 'upsertPartner.MongoClient.connect'); }
var partnersDb = db.collection('partners');
var partnerId = argvGet(argv, 'partner-id,partner');
var item = {};
_.each... | [
"function",
"(",
"argv",
",",
"context",
",",
"callback",
")",
"{",
"return",
"MongoClient",
".",
"connect",
"(",
"mongoHost",
",",
"function",
"(",
"err",
",",
"db",
")",
"{",
"if",
"(",
"err",
")",
"{",
"return",
"sg",
".",
"die",
"(",
"err",
","... | Just insert one partner without any intelligence on inserting a project | [
"Just",
"insert",
"one",
"partner",
"without",
"any",
"intelligence",
"on",
"inserting",
"a",
"project"
] | f966832aae287f502cce53a71f5129b962ada8a3 | https://github.com/briancsparks/serverassist/blob/f966832aae287f502cce53a71f5129b962ada8a3/ra-scripts/models/partner.js#L26-L47 | |
45,178 | chapmanu/hb | lib/services/instagram/stream.js | function(service, credentials, accounts, keywords) {
Stream.call(this, service, credentials, accounts, keywords);
// Set up instagram-node-lib
Insta.set('client_id', credentials.client_id);
Insta.set('client_secret', credentials.client_secret);
// Set api endpoint URL for subscriber
this.api_end... | javascript | function(service, credentials, accounts, keywords) {
Stream.call(this, service, credentials, accounts, keywords);
// Set up instagram-node-lib
Insta.set('client_id', credentials.client_id);
Insta.set('client_secret', credentials.client_secret);
// Set api endpoint URL for subscriber
this.api_end... | [
"function",
"(",
"service",
",",
"credentials",
",",
"accounts",
",",
"keywords",
")",
"{",
"Stream",
".",
"call",
"(",
"this",
",",
"service",
",",
"credentials",
",",
"accounts",
",",
"keywords",
")",
";",
"// Set up instagram-node-lib",
"Insta",
".",
"set... | Manages the streaming connection to Instagram
@constructor
@extends Stream | [
"Manages",
"the",
"streaming",
"connection",
"to",
"Instagram"
] | 5edd8de89c7c5fdffc3df0c627513889220f7d51 | https://github.com/chapmanu/hb/blob/5edd8de89c7c5fdffc3df0c627513889220f7d51/lib/services/instagram/stream.js#L16-L37 | |
45,179 | brianbrunner/yowl | lib/bot.js | logError | function logError(message, err, context, event) {
var current_err = err;
while (current_err) {
var next_err = current_err._previous;
delete current_err._previous;
if (current_err.stack) {
console.error(current_err.stack);
} else {
console.error(current_err);
}
current_err = next_... | javascript | function logError(message, err, context, event) {
var current_err = err;
while (current_err) {
var next_err = current_err._previous;
delete current_err._previous;
if (current_err.stack) {
console.error(current_err.stack);
} else {
console.error(current_err);
}
current_err = next_... | [
"function",
"logError",
"(",
"message",
",",
"err",
",",
"context",
",",
"event",
")",
"{",
"var",
"current_err",
"=",
"err",
";",
"while",
"(",
"current_err",
")",
"{",
"var",
"next_err",
"=",
"current_err",
".",
"_previous",
";",
"delete",
"current_err",... | Log Errors With Some Textual Context | [
"Log",
"Errors",
"With",
"Some",
"Textual",
"Context"
] | 35d6764f4cc6c4a3487eca18a12fd8ca567d4293 | https://github.com/brianbrunner/yowl/blob/35d6764f4cc6c4a3487eca18a12fd8ca567d4293/lib/bot.js#L192-L205 |
45,180 | mchalapuk/hyper-text-slider | lib/polyfills/dom-token-list.js | Polyfill | function Polyfill(object, key) {
nodsl.check(typeof object === 'object', 'object must be an object; got ', object);
nodsl.check(typeof key === 'string', 'key must be a string; got ', key);
nodsl.check(typeof object[key] === 'string', 'object.', key, ' must be a string; got ', object[key]);
var that = this;
... | javascript | function Polyfill(object, key) {
nodsl.check(typeof object === 'object', 'object must be an object; got ', object);
nodsl.check(typeof key === 'string', 'key must be a string; got ', key);
nodsl.check(typeof object[key] === 'string', 'object.', key, ' must be a string; got ', object[key]);
var that = this;
... | [
"function",
"Polyfill",
"(",
"object",
",",
"key",
")",
"{",
"nodsl",
".",
"check",
"(",
"typeof",
"object",
"===",
"'object'",
",",
"'object must be an object; got '",
",",
"object",
")",
";",
"nodsl",
".",
"check",
"(",
"typeof",
"key",
"===",
"'string'",
... | Constructs Polyfill of DOMTokenList.
The list will be represented as a string located in given **object**
under property of name **key**.
@see https://developer.mozilla.org/pl/docs/Web/API/DOMTokenList | [
"Constructs",
"Polyfill",
"of",
"DOMTokenList",
"."
] | 2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4 | https://github.com/mchalapuk/hyper-text-slider/blob/2711b41b9bbf1d528e4a0bd31b2efdf91dce55b4/lib/polyfills/dom-token-list.js#L34-L63 |
45,181 | onechiporenko/jsonium | index.js | _isArrayOfObjects | function _isArrayOfObjects(value) {
if (!Array.isArray(value)) {
return false;
}
var l = value.length;
var _type, cond;
for (var i = 0; i < l; i++) {
_type = typeof value[i];
cond = _type === 'function' || _type === 'object' && !!value[i];
if (!cond) {
return false;
}
}
return tr... | javascript | function _isArrayOfObjects(value) {
if (!Array.isArray(value)) {
return false;
}
var l = value.length;
var _type, cond;
for (var i = 0; i < l; i++) {
_type = typeof value[i];
cond = _type === 'function' || _type === 'object' && !!value[i];
if (!cond) {
return false;
}
}
return tr... | [
"function",
"_isArrayOfObjects",
"(",
"value",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"var",
"l",
"=",
"value",
".",
"length",
";",
"var",
"_type",
",",
"cond",
";",
"for",
"(",
... | Check if value is an array of objects
@param {*} value
@returns {boolean}
@private | [
"Check",
"if",
"value",
"is",
"an",
"array",
"of",
"objects"
] | 50059570f58fecebb9e139b4766d03064416a4c4 | https://github.com/onechiporenko/jsonium/blob/50059570f58fecebb9e139b4766d03064416a4c4/index.js#L20-L34 |
45,182 | onechiporenko/jsonium | index.js | _get | function _get(obj, path) {
var subpathes = path.split('.');
while (subpathes.length) {
var subpath = subpathes.shift();
obj = obj[subpath];
if (!obj) {
return obj;
}
}
return obj;
} | javascript | function _get(obj, path) {
var subpathes = path.split('.');
while (subpathes.length) {
var subpath = subpathes.shift();
obj = obj[subpath];
if (!obj) {
return obj;
}
}
return obj;
} | [
"function",
"_get",
"(",
"obj",
",",
"path",
")",
"{",
"var",
"subpathes",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
";",
"while",
"(",
"subpathes",
".",
"length",
")",
"{",
"var",
"subpath",
"=",
"subpathes",
".",
"shift",
"(",
")",
";",
"obj",
... | Get object's value by provided nested path
@param {object} obj
@param {string} path
@returns {*}
@private | [
"Get",
"object",
"s",
"value",
"by",
"provided",
"nested",
"path"
] | 50059570f58fecebb9e139b4766d03064416a4c4 | https://github.com/onechiporenko/jsonium/blob/50059570f58fecebb9e139b4766d03064416a4c4/index.js#L44-L54 |
45,183 | onechiporenko/jsonium | index.js | _set | function _set(obj, path, value) {
var subpathes = path.split('.');
while (subpathes.length - 1) {
obj = obj[subpathes.shift()];
}
obj[subpathes.shift()] = value;
} | javascript | function _set(obj, path, value) {
var subpathes = path.split('.');
while (subpathes.length - 1) {
obj = obj[subpathes.shift()];
}
obj[subpathes.shift()] = value;
} | [
"function",
"_set",
"(",
"obj",
",",
"path",
",",
"value",
")",
"{",
"var",
"subpathes",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
";",
"while",
"(",
"subpathes",
".",
"length",
"-",
"1",
")",
"{",
"obj",
"=",
"obj",
"[",
"subpathes",
".",
"shi... | Set object's value by provided nested path
@param {object} obj
@param {string} path
@param {*} value
@private | [
"Set",
"object",
"s",
"value",
"by",
"provided",
"nested",
"path"
] | 50059570f58fecebb9e139b4766d03064416a4c4 | https://github.com/onechiporenko/jsonium/blob/50059570f58fecebb9e139b4766d03064416a4c4/index.js#L64-L70 |
45,184 | onechiporenko/jsonium | index.js | _has | function _has(obj, path) {
var subpathes = path.split('.');
while (subpathes.length) {
var subpath = subpathes.shift();
if (!obj.hasOwnProperty(subpath)) {
return false;
}
obj = obj[subpath];
}
return true;
} | javascript | function _has(obj, path) {
var subpathes = path.split('.');
while (subpathes.length) {
var subpath = subpathes.shift();
if (!obj.hasOwnProperty(subpath)) {
return false;
}
obj = obj[subpath];
}
return true;
} | [
"function",
"_has",
"(",
"obj",
",",
"path",
")",
"{",
"var",
"subpathes",
"=",
"path",
".",
"split",
"(",
"'.'",
")",
";",
"while",
"(",
"subpathes",
".",
"length",
")",
"{",
"var",
"subpath",
"=",
"subpathes",
".",
"shift",
"(",
")",
";",
"if",
... | Check if object has provided nested path
@param {object} obj
@param {string} path
@returns {boolean}
@private | [
"Check",
"if",
"object",
"has",
"provided",
"nested",
"path"
] | 50059570f58fecebb9e139b4766d03064416a4c4 | https://github.com/onechiporenko/jsonium/blob/50059570f58fecebb9e139b4766d03064416a4c4/index.js#L80-L90 |
45,185 | cliffano/couchpenter | lib/cli.js | exec | function exec() {
// NOTE: pardon this cli target to Couchpenter methods mapping,
// needed to preserve backward compatibility w/ v0.1.x
const FUNCTIONS = {
setup: 'setUp',
'setup-db': 'setUpDatabases',
'setup-doc': 'setUpDocuments',
'setup-doc-overwrite': 'setUpDocumentsOverwrite',
teardown:... | javascript | function exec() {
// NOTE: pardon this cli target to Couchpenter methods mapping,
// needed to preserve backward compatibility w/ v0.1.x
const FUNCTIONS = {
setup: 'setUp',
'setup-db': 'setUpDatabases',
'setup-doc': 'setUpDocuments',
'setup-doc-overwrite': 'setUpDocumentsOverwrite',
teardown:... | [
"function",
"exec",
"(",
")",
"{",
"// NOTE: pardon this cli target to Couchpenter methods mapping,",
"// needed to preserve backward compatibility w/ v0.1.x",
"const",
"FUNCTIONS",
"=",
"{",
"setup",
":",
"'setUp'",
",",
"'setup-db'",
":",
"'setUpDatabases'",
",",
"'setup-doc'... | Execute Couchpenter CLI. | [
"Execute",
"Couchpenter",
"CLI",
"."
] | 00cce387da2f39e4b276b27b0bacb073caa80453 | https://github.com/cliffano/couchpenter/blob/00cce387da2f39e4b276b27b0bacb073caa80453/lib/cli.js#L30-L62 |
45,186 | nodejitsu/contour | pagelets/pagelet.js | use | function use(brand) {
return function branding(file) {
var branded = file.replace('{{brand}}', brand);
return fs.existsSync(branded) ? branded : file.replace('{{brand}}', 'nodejitsu');
};
} | javascript | function use(brand) {
return function branding(file) {
var branded = file.replace('{{brand}}', brand);
return fs.existsSync(branded) ? branded : file.replace('{{brand}}', 'nodejitsu');
};
} | [
"function",
"use",
"(",
"brand",
")",
"{",
"return",
"function",
"branding",
"(",
"file",
")",
"{",
"var",
"branded",
"=",
"file",
".",
"replace",
"(",
"'{{brand}}'",
",",
"brand",
")",
";",
"return",
"fs",
".",
"existsSync",
"(",
"branded",
")",
"?",
... | Return a mapping function with preset brand, will default to nodejitsu files if
the requested branded file does not exist.
@param {String} brand
@returns {Function} mapper
@api private | [
"Return",
"a",
"mapping",
"function",
"with",
"preset",
"brand",
"will",
"default",
"to",
"nodejitsu",
"files",
"if",
"the",
"requested",
"branded",
"file",
"does",
"not",
"exist",
"."
] | 0828e9bd25ef1eeb97ea231c447118d9867021b6 | https://github.com/nodejitsu/contour/blob/0828e9bd25ef1eeb97ea231c447118d9867021b6/pagelets/pagelet.js#L18-L23 |
45,187 | nodejitsu/contour | pagelets/pagelet.js | get | function get(done) {
this.define();
done(undefined, this.mixin({}, this.defaults, this.data, this.merge(
this.data,
this.queue.discharge(this.name)
)));
} | javascript | function get(done) {
this.define();
done(undefined, this.mixin({}, this.defaults, this.data, this.merge(
this.data,
this.queue.discharge(this.name)
)));
} | [
"function",
"get",
"(",
"done",
")",
"{",
"this",
".",
"define",
"(",
")",
";",
"done",
"(",
"undefined",
",",
"this",
".",
"mixin",
"(",
"{",
"}",
",",
"this",
".",
"defaults",
",",
"this",
".",
"data",
",",
"this",
".",
"merge",
"(",
"this",
... | Provide data to the template render method. Can be called sync and async.
@param {Function} done completion callback
@api private | [
"Provide",
"data",
"to",
"the",
"template",
"render",
"method",
".",
"Can",
"be",
"called",
"sync",
"and",
"async",
"."
] | 0828e9bd25ef1eeb97ea231c447118d9867021b6 | https://github.com/nodejitsu/contour/blob/0828e9bd25ef1eeb97ea231c447118d9867021b6/pagelets/pagelet.js#L154-L160 |
45,188 | nodejitsu/contour | pagelets/pagelet.js | use | function use(namespace, name, fn) {
name = name || this.name;
this.temper.require('handlebars').registerHelper(
namespace + '-' + name,
fn
);
return this;
} | javascript | function use(namespace, name, fn) {
name = name || this.name;
this.temper.require('handlebars').registerHelper(
namespace + '-' + name,
fn
);
return this;
} | [
"function",
"use",
"(",
"namespace",
",",
"name",
",",
"fn",
")",
"{",
"name",
"=",
"name",
"||",
"this",
".",
"name",
";",
"this",
".",
"temper",
".",
"require",
"(",
"'handlebars'",
")",
".",
"registerHelper",
"(",
"namespace",
"+",
"'-'",
"+",
"na... | Register provided helper with handlebars.
@param {String} namespace Name of the Pagelet the helper was registered from.
@param {String} name Registered name
@param {Function} fn Handlebars helper
@api public | [
"Register",
"provided",
"helper",
"with",
"handlebars",
"."
] | 0828e9bd25ef1eeb97ea231c447118d9867021b6 | https://github.com/nodejitsu/contour/blob/0828e9bd25ef1eeb97ea231c447118d9867021b6/pagelets/pagelet.js#L170-L178 |
45,189 | taskrjs/fly-util | src/bind.js | reduce | function reduce (m) {
if (Array.isArray(m)) {
try {
const module = m[0].module ? m[0].module : m[0]
_("register bind %o", module)
return require(module)
} catch (_) { return reduce(m.slice(1)) }
} else return reduce([m])
} | javascript | function reduce (m) {
if (Array.isArray(m)) {
try {
const module = m[0].module ? m[0].module : m[0]
_("register bind %o", module)
return require(module)
} catch (_) { return reduce(m.slice(1)) }
} else return reduce([m])
} | [
"function",
"reduce",
"(",
"m",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"m",
")",
")",
"{",
"try",
"{",
"const",
"module",
"=",
"m",
"[",
"0",
"]",
".",
"module",
"?",
"m",
"[",
"0",
"]",
".",
"module",
":",
"m",
"[",
"0",
"]",
... | Try require each module until we don't error.
@param {String} module name | [
"Try",
"require",
"each",
"module",
"until",
"we",
"don",
"t",
"error",
"."
] | 976c0fbec697b2c3de7b2b90b75f2eb66a83de24 | https://github.com/taskrjs/fly-util/blob/976c0fbec697b2c3de7b2b90b75f2eb66a83de24/src/bind.js#L21-L29 |
45,190 | stealjs/live-reload | live.js | teardown | function teardown(moduleName, e, moduleNames) {
var moduleNames = moduleNames || {};
if(disposeModule(moduleName, e, moduleNames)) {
// Delete the module and call teardown on its parents as well.
var parents = loader.getDependants(moduleName);
for(var i = 0, len = parents.length; i < len; i++) {
teardown(p... | javascript | function teardown(moduleName, e, moduleNames) {
var moduleNames = moduleNames || {};
if(disposeModule(moduleName, e, moduleNames)) {
// Delete the module and call teardown on its parents as well.
var parents = loader.getDependants(moduleName);
for(var i = 0, len = parents.length; i < len; i++) {
teardown(p... | [
"function",
"teardown",
"(",
"moduleName",
",",
"e",
",",
"moduleNames",
")",
"{",
"var",
"moduleNames",
"=",
"moduleNames",
"||",
"{",
"}",
";",
"if",
"(",
"disposeModule",
"(",
"moduleName",
",",
"e",
",",
"moduleNames",
")",
")",
"{",
"// Delete the mod... | Teardown a module name by deleting it and all of its parent modules. | [
"Teardown",
"a",
"module",
"name",
"by",
"deleting",
"it",
"and",
"all",
"of",
"its",
"parent",
"modules",
"."
] | 904f929ddbf5f1d4346c5ef13e61b9cbb7b71d52 | https://github.com/stealjs/live-reload/blob/904f929ddbf5f1d4346c5ef13e61b9cbb7b71d52/live.js#L116-L129 |
45,191 | rasouli100/twimap | lib/twimap.js | config_mail_box | function config_mail_box(config) {
imap = new Imap({
user:config.user,
password:config.password,
host:config.host,
port:config.port,
secure:config.secure
});
} | javascript | function config_mail_box(config) {
imap = new Imap({
user:config.user,
password:config.password,
host:config.host,
port:config.port,
secure:config.secure
});
} | [
"function",
"config_mail_box",
"(",
"config",
")",
"{",
"imap",
"=",
"new",
"Imap",
"(",
"{",
"user",
":",
"config",
".",
"user",
",",
"password",
":",
"config",
".",
"password",
",",
"host",
":",
"config",
".",
"host",
",",
"port",
":",
"config",
".... | Configs imap account from which must fetch the twitter e-mails
@param config object containing information of imap account (user, password, host, port, secure boolean flag) | [
"Configs",
"imap",
"account",
"from",
"which",
"must",
"fetch",
"the",
"twitter",
"e",
"-",
"mails"
] | 90a93fda604ab3af6b25bddcfe3dd71dc19ac1f7 | https://github.com/rasouli100/twimap/blob/90a93fda604ab3af6b25bddcfe3dd71dc19ac1f7/lib/twimap.js#L21-L30 |
45,192 | rasouli100/twimap | lib/twimap.js | get_new_followers | function get_new_followers(since, cb, cberr) {
get_inbox(since);
_callback = cb;
_callback_err = cberr;
} | javascript | function get_new_followers(since, cb, cberr) {
get_inbox(since);
_callback = cb;
_callback_err = cberr;
} | [
"function",
"get_new_followers",
"(",
"since",
",",
"cb",
",",
"cberr",
")",
"{",
"get_inbox",
"(",
"since",
")",
";",
"_callback",
"=",
"cb",
";",
"_callback_err",
"=",
"cberr",
";",
"}"
] | returns followers asynchronously
@param since date from which to look for followers e-mails
@param cb callback function when there is a result
@param cberr callback function on error | [
"returns",
"followers",
"asynchronously"
] | 90a93fda604ab3af6b25bddcfe3dd71dc19ac1f7 | https://github.com/rasouli100/twimap/blob/90a93fda604ab3af6b25bddcfe3dd71dc19ac1f7/lib/twimap.js#L40-L44 |
45,193 | MiguelCastillo/bit-loader | example/bundler/src/bundler.js | bundlerFactory | function bundlerFactory(loader, options) {
function bundlerDelegate(modules) {
return bundler(loader, options || {}, modules);
}
bundlerDelegate.bundle = function(names) {
return loader.fetch(names).then(bundlerDelegate);
};
return bundlerDelegate;
} | javascript | function bundlerFactory(loader, options) {
function bundlerDelegate(modules) {
return bundler(loader, options || {}, modules);
}
bundlerDelegate.bundle = function(names) {
return loader.fetch(names).then(bundlerDelegate);
};
return bundlerDelegate;
} | [
"function",
"bundlerFactory",
"(",
"loader",
",",
"options",
")",
"{",
"function",
"bundlerDelegate",
"(",
"modules",
")",
"{",
"return",
"bundler",
"(",
"loader",
",",
"options",
"||",
"{",
"}",
",",
"modules",
")",
";",
"}",
"bundlerDelegate",
".",
"bund... | Convenience factory for specifying the instance of bit loader to bundle up | [
"Convenience",
"factory",
"for",
"specifying",
"the",
"instance",
"of",
"bit",
"loader",
"to",
"bundle",
"up"
] | da9d18952d87014fdb09e7a8320a24cbf1c2b436 | https://github.com/MiguelCastillo/bit-loader/blob/da9d18952d87014fdb09e7a8320a24cbf1c2b436/example/bundler/src/bundler.js#L8-L18 |
45,194 | MiguelCastillo/bit-loader | example/bundler/src/bundler.js | bundler | function bundler(loader, options, modules) {
var stack = modules.slice(0);
var mods = [];
var finished = {};
function processModule(mod) {
if (finished.hasOwnProperty(mod.id)) {
return;
}
mod = loader.getModule(mod.id);
// browser pack chunk
var browserpack = {
id :... | javascript | function bundler(loader, options, modules) {
var stack = modules.slice(0);
var mods = [];
var finished = {};
function processModule(mod) {
if (finished.hasOwnProperty(mod.id)) {
return;
}
mod = loader.getModule(mod.id);
// browser pack chunk
var browserpack = {
id :... | [
"function",
"bundler",
"(",
"loader",
",",
"options",
",",
"modules",
")",
"{",
"var",
"stack",
"=",
"modules",
".",
"slice",
"(",
"0",
")",
";",
"var",
"mods",
"=",
"[",
"]",
";",
"var",
"finished",
"=",
"{",
"}",
";",
"function",
"processModule",
... | Bundles up incoming modules. This will process all dependencies and will create
a bundle using browser-pack.
@returns {Promise} When resolve, the full bundle buffer is returned | [
"Bundles",
"up",
"incoming",
"modules",
".",
"This",
"will",
"process",
"all",
"dependencies",
"and",
"will",
"create",
"a",
"bundle",
"using",
"browser",
"-",
"pack",
"."
] | da9d18952d87014fdb09e7a8320a24cbf1c2b436 | https://github.com/MiguelCastillo/bit-loader/blob/da9d18952d87014fdb09e7a8320a24cbf1c2b436/example/bundler/src/bundler.js#L27-L68 |
45,195 | binduwavell/generator-alfresco-common | lib/java-properties.js | isCommentLine | function isCommentLine (line) {
var isCmnt = commentRE.test(line);
if (isCmnt) {
debug('removing comment: %s', line);
}
return !isCmnt;
} | javascript | function isCommentLine (line) {
var isCmnt = commentRE.test(line);
if (isCmnt) {
debug('removing comment: %s', line);
}
return !isCmnt;
} | [
"function",
"isCommentLine",
"(",
"line",
")",
"{",
"var",
"isCmnt",
"=",
"commentRE",
".",
"test",
"(",
"line",
")",
";",
"if",
"(",
"isCmnt",
")",
"{",
"debug",
"(",
"'removing comment: %s'",
",",
"line",
")",
";",
"}",
"return",
"!",
"isCmnt",
";",
... | Detects if a line is a comment.
@param {string} line
@returns {boolean} | [
"Detects",
"if",
"a",
"line",
"is",
"a",
"comment",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/java-properties.js#L61-L67 |
45,196 | binduwavell/generator-alfresco-common | lib/java-properties.js | extractKeyValue | function extractKeyValue (line) {
var kv = {
key: undefined,
value: undefined,
};
var matches = kvRE.exec(line);
if (matches !== null && matches.length === 3) {
kv.key = matches[1];
kv.value = matches[2];
}
return kv;
} | javascript | function extractKeyValue (line) {
var kv = {
key: undefined,
value: undefined,
};
var matches = kvRE.exec(line);
if (matches !== null && matches.length === 3) {
kv.key = matches[1];
kv.value = matches[2];
}
return kv;
} | [
"function",
"extractKeyValue",
"(",
"line",
")",
"{",
"var",
"kv",
"=",
"{",
"key",
":",
"undefined",
",",
"value",
":",
"undefined",
",",
"}",
";",
"var",
"matches",
"=",
"kvRE",
".",
"exec",
"(",
"line",
")",
";",
"if",
"(",
"matches",
"!==",
"nu... | Uses a regular expression to extract a key
and value from the line.
@param {string} line
@returns {{key: undefined, value: undefined}} | [
"Uses",
"a",
"regular",
"expression",
"to",
"extract",
"a",
"key",
"and",
"value",
"from",
"the",
"line",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/java-properties.js#L76-L89 |
45,197 | binduwavell/generator-alfresco-common | lib/java-properties.js | processLine | function processLine (instance, acc, line) {
debug('processing: %s', line);
// if previous line was continued then capture this line verbatim
// of course we need to handle if this is also a continuation too
if (instance.key) {
var hasCont = hasNewlineContinuation(line);
if (hasCont) {
debug('remo... | javascript | function processLine (instance, acc, line) {
debug('processing: %s', line);
// if previous line was continued then capture this line verbatim
// of course we need to handle if this is also a continuation too
if (instance.key) {
var hasCont = hasNewlineContinuation(line);
if (hasCont) {
debug('remo... | [
"function",
"processLine",
"(",
"instance",
",",
"acc",
",",
"line",
")",
"{",
"debug",
"(",
"'processing: %s'",
",",
"line",
")",
";",
"// if previous line was continued then capture this line verbatim",
"// of course we need to handle if this is also a continuation too",
"if"... | This method is called with each non-blank and non-comment
line from the properties file. It builds up the object
representation of the properties data in the accumulator.
It uses instance object to store state when lines are
being continued.
@param {Object} instance
@param {Object} acc
@param {string} line
@returns {O... | [
"This",
"method",
"is",
"called",
"with",
"each",
"non",
"-",
"blank",
"and",
"non",
"-",
"comment",
"line",
"from",
"the",
"properties",
"file",
".",
"It",
"builds",
"up",
"the",
"object",
"representation",
"of",
"the",
"properties",
"data",
"in",
"the",
... | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/java-properties.js#L113-L142 |
45,198 | binduwavell/generator-alfresco-common | lib/java-properties.js | unescape | function unescape (line) {
var retv = _.replace(line, propEscapeRE, '$1');
retv = _.replace(line, unicodeEscapeRE, function (m) {
return String.fromCharCode(parseInt(m, 16));
});
if (retv !== line) {
debug('removed escapes from: %s => %s', line, retv);
}
return retv;
} | javascript | function unescape (line) {
var retv = _.replace(line, propEscapeRE, '$1');
retv = _.replace(line, unicodeEscapeRE, function (m) {
return String.fromCharCode(parseInt(m, 16));
});
if (retv !== line) {
debug('removed escapes from: %s => %s', line, retv);
}
return retv;
} | [
"function",
"unescape",
"(",
"line",
")",
"{",
"var",
"retv",
"=",
"_",
".",
"replace",
"(",
"line",
",",
"propEscapeRE",
",",
"'$1'",
")",
";",
"retv",
"=",
"_",
".",
"replace",
"(",
"line",
",",
"unicodeEscapeRE",
",",
"function",
"(",
"m",
")",
... | Resolve property esacpe sequences in a line.
Also resolves unicode escapes.
@param {string} line
@returns {string} | [
"Resolve",
"property",
"esacpe",
"sequences",
"in",
"a",
"line",
".",
"Also",
"resolves",
"unicode",
"escapes",
"."
] | d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4 | https://github.com/binduwavell/generator-alfresco-common/blob/d9ba309a1b1d26a97268a07a49ac9e5d86b31dc4/lib/java-properties.js#L183-L192 |
45,199 | feedhenry/fh-mbaas-client | index.js | function(environment, mbaasConfig) {
if (!client) {
client = new MbaasClient(environment, mbaasConfig);
}
//Deprecated
module.exports.app = client.app;
module.exports.admin = client.admin;
} | javascript | function(environment, mbaasConfig) {
if (!client) {
client = new MbaasClient(environment, mbaasConfig);
}
//Deprecated
module.exports.app = client.app;
module.exports.admin = client.admin;
} | [
"function",
"(",
"environment",
",",
"mbaasConfig",
")",
"{",
"if",
"(",
"!",
"client",
")",
"{",
"client",
"=",
"new",
"MbaasClient",
"(",
"environment",
",",
"mbaasConfig",
")",
";",
"}",
"//Deprecated",
"module",
".",
"exports",
".",
"app",
"=",
"clie... | Deprecated, try not to use it. Use MbaasClient instead. | [
"Deprecated",
"try",
"not",
"to",
"use",
"it",
".",
"Use",
"MbaasClient",
"instead",
"."
] | 2d5a9cbb32e1b2464d71ffa18513358fea388859 | https://github.com/feedhenry/fh-mbaas-client/blob/2d5a9cbb32e1b2464d71ffa18513358fea388859/index.js#L9-L16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.