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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
31,600 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function() {
if (this.isDestroyed) { return; }
// At this point, the App.Router must already be assigned
if (this.Router) {
var container = this.__container__;
container.unregister('router:main');
container.register('router:main', this.Router);
}
t... | javascript | function() {
if (this.isDestroyed) { return; }
// At this point, the App.Router must already be assigned
if (this.Router) {
var container = this.__container__;
container.unregister('router:main');
container.register('router:main', this.Router);
}
t... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isDestroyed",
")",
"{",
"return",
";",
"}",
"// At this point, the App.Router must already be assigned",
"if",
"(",
"this",
".",
"Router",
")",
"{",
"var",
"container",
"=",
"this",
".",
"__container__",
";",... | Initialize the application. This happens automatically.
Run any initializers and run the application load hook. These hooks may
choose to defer readiness. For example, an authentication hook might want
to defer readiness until the auth token has been retrieved.
@private
@method _initialize | [
"Initialize",
"the",
"application",
".",
"This",
"happens",
"automatically",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L2733-L2752 | |
31,601 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(namespace) {
var container = new Container();
container.set = set;
container.resolver = resolverFor(namespace);
container.normalizeFullName = container.resolver.normalize;
container.describe = container.resolver.describe;
container.makeToString = container.resol... | javascript | function(namespace) {
var container = new Container();
container.set = set;
container.resolver = resolverFor(namespace);
container.normalizeFullName = container.resolver.normalize;
container.describe = container.resolver.describe;
container.makeToString = container.resol... | [
"function",
"(",
"namespace",
")",
"{",
"var",
"container",
"=",
"new",
"Container",
"(",
")",
";",
"container",
".",
"set",
"=",
"set",
";",
"container",
".",
"resolver",
"=",
"resolverFor",
"(",
"namespace",
")",
";",
"container",
".",
"normalizeFullName... | This creates a container with the default Ember naming conventions.
It also configures the container:
registered views are created every time they are looked up (they are
not singletons)
registered templates are not factories; the registered value is
returned directly.
the router receives the application as its `name... | [
"This",
"creates",
"a",
"container",
"with",
"the",
"default",
"Ember",
"naming",
"conventions",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L3135-L3190 | |
31,602 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function() {
var namespaces = emberA(Namespace.NAMESPACES);
var types = emberA();
var self = this;
namespaces.forEach(function(namespace) {
for (var key in namespace) {
if (!namespace.hasOwnProperty(key)) { continue; }
// Even though we will filter agai... | javascript | function() {
var namespaces = emberA(Namespace.NAMESPACES);
var types = emberA();
var self = this;
namespaces.forEach(function(namespace) {
for (var key in namespace) {
if (!namespace.hasOwnProperty(key)) { continue; }
// Even though we will filter agai... | [
"function",
"(",
")",
"{",
"var",
"namespaces",
"=",
"emberA",
"(",
"Namespace",
".",
"NAMESPACES",
")",
";",
"var",
"types",
"=",
"emberA",
"(",
")",
";",
"var",
"self",
"=",
"this",
";",
"namespaces",
".",
"forEach",
"(",
"function",
"(",
"namespace"... | Loops over all namespaces and all objects
attached to them
@private
@method _getObjectsOnNamespaces
@return {Array} Array of model type strings | [
"Loops",
"over",
"all",
"namespaces",
"and",
"all",
"objects",
"attached",
"to",
"them"
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L4527-L4547 | |
31,603 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | handlebarsGet | function handlebarsGet(root, path, options) {
var data = options && options.data;
var normalizedPath = normalizePath(root, path, data);
var value;
// In cases where the path begins with a keyword, change the
// root to the value represented by that keyword, and ensure
// the path is... | javascript | function handlebarsGet(root, path, options) {
var data = options && options.data;
var normalizedPath = normalizePath(root, path, data);
var value;
// In cases where the path begins with a keyword, change the
// root to the value represented by that keyword, and ensure
// the path is... | [
"function",
"handlebarsGet",
"(",
"root",
",",
"path",
",",
"options",
")",
"{",
"var",
"data",
"=",
"options",
"&&",
"options",
".",
"data",
";",
"var",
"normalizedPath",
"=",
"normalizePath",
"(",
"root",
",",
"path",
",",
"data",
")",
";",
"var",
"v... | Lookup both on root and on window. If the path starts with
a keyword, the corresponding object will be looked up in the
template's data hash and used to resolve the path.
@method get
@for Ember.Handlebars
@param {Object} root The object to look up the property on
@param {String} path The path to be lookedup
@param {Ob... | [
"Lookup",
"both",
"on",
"root",
"and",
"on",
"window",
".",
"If",
"the",
"path",
"starts",
"with",
"a",
"keyword",
"the",
"corresponding",
"object",
"will",
"be",
"looked",
"up",
"in",
"the",
"template",
"s",
"data",
"hash",
"and",
"used",
"to",
"resolve... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L6797-L6829 |
31,604 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | registerBoundHelper | function registerBoundHelper(name, fn) {
var boundHelperArgs = slice.call(arguments, 1);
var boundFn = makeBoundHelper.apply(this, boundHelperArgs);
EmberHandlebars.registerHelper(name, boundFn);
} | javascript | function registerBoundHelper(name, fn) {
var boundHelperArgs = slice.call(arguments, 1);
var boundFn = makeBoundHelper.apply(this, boundHelperArgs);
EmberHandlebars.registerHelper(name, boundFn);
} | [
"function",
"registerBoundHelper",
"(",
"name",
",",
"fn",
")",
"{",
"var",
"boundHelperArgs",
"=",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"var",
"boundFn",
"=",
"makeBoundHelper",
".",
"apply",
"(",
"this",
",",
"boundHelperArgs",
")"... | Register a bound handlebars helper. Bound helpers behave similarly to regular
handlebars helpers, with the added ability to re-render when the underlying data
changes.
## Simple example
```javascript
Ember.Handlebars.registerBoundHelper('capitalize', function(value) {
return Ember.String.capitalize(value);
});
```
T... | [
"Register",
"a",
"bound",
"handlebars",
"helper",
".",
"Bound",
"helpers",
"behave",
"similarly",
"to",
"regular",
"handlebars",
"helpers",
"with",
"the",
"added",
"ability",
"to",
"re",
"-",
"render",
"when",
"the",
"underlying",
"data",
"changes",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L7167-L7171 |
31,605 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | _triageMustacheHelper | function _triageMustacheHelper(property, options) {
Ember.assert("You cannot pass more than one argument to the _triageMustache helper", arguments.length <= 2);
var helper = EmberHandlebars.resolveHelper(options.data.view.container, property);
if (helper) {
return helper.call(this, options);
... | javascript | function _triageMustacheHelper(property, options) {
Ember.assert("You cannot pass more than one argument to the _triageMustache helper", arguments.length <= 2);
var helper = EmberHandlebars.resolveHelper(options.data.view.container, property);
if (helper) {
return helper.call(this, options);
... | [
"function",
"_triageMustacheHelper",
"(",
"property",
",",
"options",
")",
"{",
"Ember",
".",
"assert",
"(",
"\"You cannot pass more than one argument to the _triageMustache helper\"",
",",
"arguments",
".",
"length",
"<=",
"2",
")",
";",
"var",
"helper",
"=",
"EmberH... | '_triageMustache' is used internally select between a binding, helper, or component for
the given context. Until this point, it would be hard to determine if the
mustache is a property reference or a regular helper reference. This triage
helper resolves that.
This would not be typically invoked by directly.
@private
... | [
"_triageMustache",
"is",
"used",
"internally",
"select",
"between",
"a",
"binding",
"helper",
"or",
"component",
"for",
"the",
"given",
"context",
".",
"Until",
"this",
"point",
"it",
"would",
"be",
"hard",
"to",
"determine",
"if",
"the",
"mustache",
"is",
"... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L7641-L7650 |
31,606 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | bindClasses | function bindClasses(context, classBindings, view, bindAttrId, options) {
var ret = [];
var newClass, value, elem;
// Helper method to retrieve the property from the context and
// determine which class string to return, based on whether it is
// a Boolean or not.
var classStringFor... | javascript | function bindClasses(context, classBindings, view, bindAttrId, options) {
var ret = [];
var newClass, value, elem;
// Helper method to retrieve the property from the context and
// determine which class string to return, based on whether it is
// a Boolean or not.
var classStringFor... | [
"function",
"bindClasses",
"(",
"context",
",",
"classBindings",
",",
"view",
",",
"bindAttrId",
",",
"options",
")",
"{",
"var",
"ret",
"=",
"[",
"]",
";",
"var",
"newClass",
",",
"value",
",",
"elem",
";",
"// Helper method to retrieve the property from the co... | Helper that, given a space-separated string of property paths and a context,
returns an array of class names. Calling this method also has the side
effect of setting up observers at those property paths, such that if they
change, the correct class name will be reapplied to the DOM element.
For example, if you pass the... | [
"Helper",
"that",
"given",
"a",
"space",
"-",
"separated",
"string",
"of",
"property",
"paths",
"and",
"a",
"context",
"returns",
"an",
"array",
"of",
"class",
"names",
".",
"Calling",
"this",
"method",
"also",
"has",
"the",
"side",
"effect",
"of",
"settin... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L8234-L8323 |
31,607 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(buffer) {
// If not invoked via a triple-mustache ({{{foo}}}), escape
// the content of the template.
var escape = get(this, 'isEscaped');
var shouldDisplay = get(this, 'shouldDisplayFunc');
var preserveContext = get(this, 'preserveContext');
var context = get(t... | javascript | function(buffer) {
// If not invoked via a triple-mustache ({{{foo}}}), escape
// the content of the template.
var escape = get(this, 'isEscaped');
var shouldDisplay = get(this, 'shouldDisplayFunc');
var preserveContext = get(this, 'preserveContext');
var context = get(t... | [
"function",
"(",
"buffer",
")",
"{",
"// If not invoked via a triple-mustache ({{{foo}}}), escape",
"// the content of the template.",
"var",
"escape",
"=",
"get",
"(",
"this",
",",
"'isEscaped'",
")",
";",
"var",
"shouldDisplay",
"=",
"get",
"(",
"this",
",",
"'shoul... | Determines which template to invoke, sets up the correct state based on
that logic, then invokes the default `Ember.View` `render` implementation.
This method will first look up the `path` key on `pathRoot`,
then pass that value to the `shouldDisplayFunc` function. If that returns
`true,` the `displayTemplate` functio... | [
"Determines",
"which",
"template",
"to",
"invoke",
"sets",
"up",
"the",
"correct",
"state",
"based",
"on",
"that",
"logic",
"then",
"invokes",
"the",
"default",
"Ember",
".",
"View",
"render",
"implementation",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L10427-L10484 | |
31,608 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | flushPendingChains | function flushPendingChains() {
if (pendingQueue.length === 0) { return; } // nothing to do
var queue = pendingQueue;
pendingQueue = [];
forEach.call(queue, function(q) { q[0].add(q[1]); });
warn('Watching an undefined global, Ember expects watched globals to be setup by the time the ru... | javascript | function flushPendingChains() {
if (pendingQueue.length === 0) { return; } // nothing to do
var queue = pendingQueue;
pendingQueue = [];
forEach.call(queue, function(q) { q[0].add(q[1]); });
warn('Watching an undefined global, Ember expects watched globals to be setup by the time the ru... | [
"function",
"flushPendingChains",
"(",
")",
"{",
"if",
"(",
"pendingQueue",
".",
"length",
"===",
"0",
")",
"{",
"return",
";",
"}",
"// nothing to do",
"var",
"queue",
"=",
"pendingQueue",
";",
"pendingQueue",
"=",
"[",
"]",
";",
"forEach",
".",
"call",
... | attempts to add the pendingQueue chains again. If some of them end up back in the queue and reschedule is true, schedules a timeout to try again. | [
"attempts",
"to",
"add",
"the",
"pendingQueue",
"chains",
"again",
".",
"If",
"some",
"of",
"them",
"end",
"up",
"back",
"in",
"the",
"queue",
"and",
"reschedule",
"is",
"true",
"schedules",
"a",
"timeout",
"to",
"try",
"again",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L11972-L11981 |
31,609 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | deprecateProperty | function deprecateProperty(object, deprecatedKey, newKey) {
function deprecate() {
Ember.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.');
}
if (hasPropertyAccessors) {
defineProperty(object, deprecatedKey, {
configurable: true,
... | javascript | function deprecateProperty(object, deprecatedKey, newKey) {
function deprecate() {
Ember.deprecate('Usage of `' + deprecatedKey + '` is deprecated, use `' + newKey + '` instead.');
}
if (hasPropertyAccessors) {
defineProperty(object, deprecatedKey, {
configurable: true,
... | [
"function",
"deprecateProperty",
"(",
"object",
",",
"deprecatedKey",
",",
"newKey",
")",
"{",
"function",
"deprecate",
"(",
")",
"{",
"Ember",
".",
"deprecate",
"(",
"'Usage of `'",
"+",
"deprecatedKey",
"+",
"'` is deprecated, use `'",
"+",
"newKey",
"+",
"'` ... | Used internally to allow changing properties in a backwards compatible way, and print a helpful
deprecation warning.
@method deprecateProperty
@param {Object} object The object to add the deprecated property to.
@param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing).
@param {... | [
"Used",
"internally",
"to",
"allow",
"changing",
"properties",
"in",
"a",
"backwards",
"compatible",
"way",
"and",
"print",
"a",
"helpful",
"deprecation",
"warning",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L13951-L13964 |
31,610 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | indexOf | function indexOf(obj, element, index) {
return obj.indexOf ? obj.indexOf(element, index) : _indexOf.call(obj, element, index);
} | javascript | function indexOf(obj, element, index) {
return obj.indexOf ? obj.indexOf(element, index) : _indexOf.call(obj, element, index);
} | [
"function",
"indexOf",
"(",
"obj",
",",
"element",
",",
"index",
")",
"{",
"return",
"obj",
".",
"indexOf",
"?",
"obj",
".",
"indexOf",
"(",
"element",
",",
"index",
")",
":",
"_indexOf",
".",
"call",
"(",
"obj",
",",
"element",
",",
"index",
")",
... | Calls the indexOf function on the passed object with a specified callback. This
uses `Ember.ArrayPolyfill`'s-indexOf method when necessary.
@method indexOf
@param {Object} obj The object to call indexOn on
@param {Function} callback The callback to execute
@param {Object} index The index to start searching from | [
"Calls",
"the",
"indexOf",
"function",
"on",
"the",
"passed",
"object",
"with",
"a",
"specified",
"callback",
".",
"This",
"uses",
"Ember",
".",
"ArrayPolyfill",
"s",
"-",
"indexOf",
"method",
"when",
"necessary",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L14061-L14063 |
31,611 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | indexesOf | function indexesOf(obj, elements) {
return elements === undefined ? [] : map(elements, function(item) {
return indexOf(obj, item);
});
} | javascript | function indexesOf(obj, elements) {
return elements === undefined ? [] : map(elements, function(item) {
return indexOf(obj, item);
});
} | [
"function",
"indexesOf",
"(",
"obj",
",",
"elements",
")",
"{",
"return",
"elements",
"===",
"undefined",
"?",
"[",
"]",
":",
"map",
"(",
"elements",
",",
"function",
"(",
"item",
")",
"{",
"return",
"indexOf",
"(",
"obj",
",",
"item",
")",
";",
"}",... | Returns an array of indexes of the first occurrences of the passed elements
on the passed object.
```javascript
var array = [1, 2, 3, 4, 5];
Ember.EnumerableUtils.indexesOf(array, [2, 5]); // [1, 4]
var fubar = "Fubarr";
Ember.EnumerableUtils.indexesOf(fubar, ['b', 'r']); // [2, 4]
```
@method indexesOf
@param {Obje... | [
"Returns",
"an",
"array",
"of",
"indexes",
"of",
"the",
"first",
"occurrences",
"of",
"the",
"passed",
"elements",
"on",
"the",
"passed",
"object",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L14084-L14088 |
31,612 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | addObject | function addObject(array, item) {
var index = indexOf(array, item);
if (index === -1) { array.push(item); }
} | javascript | function addObject(array, item) {
var index = indexOf(array, item);
if (index === -1) { array.push(item); }
} | [
"function",
"addObject",
"(",
"array",
",",
"item",
")",
"{",
"var",
"index",
"=",
"indexOf",
"(",
"array",
",",
"item",
")",
";",
"if",
"(",
"index",
"===",
"-",
"1",
")",
"{",
"array",
".",
"push",
"(",
"item",
")",
";",
"}",
"}"
] | Adds an object to an array. If the array already includes the object this
method has no effect.
@method addObject
@param {Array} array The array the passed item should be added to
@param {Object} item The item to add to the passed array
@return 'undefined' | [
"Adds",
"an",
"object",
"to",
"an",
"array",
".",
"If",
"the",
"array",
"already",
"includes",
"the",
"object",
"this",
"method",
"has",
"no",
"effect",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L14100-L14103 |
31,613 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | intersection | function intersection(array1, array2) {
var result = [];
forEach(array1, function(element) {
if (indexOf(array2, element) >= 0) {
result.push(element);
}
});
return result;
} | javascript | function intersection(array1, array2) {
var result = [];
forEach(array1, function(element) {
if (indexOf(array2, element) >= 0) {
result.push(element);
}
});
return result;
} | [
"function",
"intersection",
"(",
"array1",
",",
"array2",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"forEach",
"(",
"array1",
",",
"function",
"(",
"element",
")",
"{",
"if",
"(",
"indexOf",
"(",
"array2",
",",
"element",
")",
">=",
"0",
")",
... | Calculates the intersection of two arrays. This method returns a new array
filled with the records that the two passed arrays share with each other.
If there is no intersection, an empty array will be returned.
```javascript
var array1 = [1, 2, 3, 4, 5];
var array2 = [1, 3, 5, 6, 7];
Ember.EnumerableUtils.intersectio... | [
"Calculates",
"the",
"intersection",
"of",
"two",
"arrays",
".",
"This",
"method",
"returns",
"a",
"new",
"array",
"filled",
"with",
"the",
"records",
"that",
"the",
"two",
"passed",
"arrays",
"share",
"with",
"each",
"other",
".",
"If",
"there",
"is",
"no... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L14200-L14209 |
31,614 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | watchedEvents | function watchedEvents(obj) {
var listeners = obj['__ember_meta__'].listeners, ret = [];
if (listeners) {
for(var eventName in listeners) {
if (listeners[eventName]) { ret.push(eventName); }
}
}
return ret;
} | javascript | function watchedEvents(obj) {
var listeners = obj['__ember_meta__'].listeners, ret = [];
if (listeners) {
for(var eventName in listeners) {
if (listeners[eventName]) { ret.push(eventName); }
}
}
return ret;
} | [
"function",
"watchedEvents",
"(",
"obj",
")",
"{",
"var",
"listeners",
"=",
"obj",
"[",
"'__ember_meta__'",
"]",
".",
"listeners",
",",
"ret",
"=",
"[",
"]",
";",
"if",
"(",
"listeners",
")",
"{",
"for",
"(",
"var",
"eventName",
"in",
"listeners",
")",... | Return a list of currently watched events
@private
@method watchedEvents
@for Ember
@param obj | [
"Return",
"a",
"list",
"of",
"currently",
"watched",
"events"
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L14564-L14573 |
31,615 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | isEmpty | function isEmpty(obj) {
var none = isNone(obj);
if (none) {
return none;
}
if (typeof obj.size === 'number') {
return !obj.size;
}
var objectType = typeof obj;
if (objectType === 'object') {
var size = get(obj, 'size');
if (typeof size === 'nu... | javascript | function isEmpty(obj) {
var none = isNone(obj);
if (none) {
return none;
}
if (typeof obj.size === 'number') {
return !obj.size;
}
var objectType = typeof obj;
if (objectType === 'object') {
var size = get(obj, 'size');
if (typeof size === 'nu... | [
"function",
"isEmpty",
"(",
"obj",
")",
"{",
"var",
"none",
"=",
"isNone",
"(",
"obj",
")",
";",
"if",
"(",
"none",
")",
"{",
"return",
"none",
";",
"}",
"if",
"(",
"typeof",
"obj",
".",
"size",
"===",
"'number'",
")",
"{",
"return",
"!",
"obj",
... | Verifies that a value is `null` or an empty string, empty array,
or empty function.
Constrains the rules on `Ember.isNone` by returning true for empty
string and empty arrays.
```javascript
Ember.isEmpty(); // true
Ember.isEmpty(null); // true
Ember.isEmpty(undefined); // true
Ember.is... | [
"Verifies",
"that",
"a",
"value",
"is",
"null",
"or",
"an",
"empty",
"string",
"empty",
"array",
"or",
"empty",
"function",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L15128-L15159 |
31,616 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | _suspendBeforeObserver | function _suspendBeforeObserver(obj, path, target, method, callback) {
return suspendListener(obj, beforeEvent(path), target, method, callback);
} | javascript | function _suspendBeforeObserver(obj, path, target, method, callback) {
return suspendListener(obj, beforeEvent(path), target, method, callback);
} | [
"function",
"_suspendBeforeObserver",
"(",
"obj",
",",
"path",
",",
"target",
",",
"method",
",",
"callback",
")",
"{",
"return",
"suspendListener",
"(",
"obj",
",",
"beforeEvent",
"(",
"path",
")",
",",
"target",
",",
"method",
",",
"callback",
")",
";",
... | Suspend observer during callback. This should only be used by the target of the observer while it is setting the observed path. | [
"Suspend",
"observer",
"during",
"callback",
".",
"This",
"should",
"only",
"be",
"used",
"by",
"the",
"target",
"of",
"the",
"observer",
"while",
"it",
"is",
"setting",
"the",
"observed",
"path",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L16977-L16979 |
31,617 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | set | function set(obj, keyName, value, tolerant) {
if (typeof obj === 'string') {
Ember.assert("Path '" + obj + "' must be global if no obj is given.", IS_GLOBAL.test(obj));
value = keyName;
keyName = obj;
obj = null;
}
Ember.assert("Cannot call set with "+ keyName +" key."... | javascript | function set(obj, keyName, value, tolerant) {
if (typeof obj === 'string') {
Ember.assert("Path '" + obj + "' must be global if no obj is given.", IS_GLOBAL.test(obj));
value = keyName;
keyName = obj;
obj = null;
}
Ember.assert("Cannot call set with "+ keyName +" key."... | [
"function",
"set",
"(",
"obj",
",",
"keyName",
",",
"value",
",",
"tolerant",
")",
"{",
"if",
"(",
"typeof",
"obj",
"===",
"'string'",
")",
"{",
"Ember",
".",
"assert",
"(",
"\"Path '\"",
"+",
"obj",
"+",
"\"' must be global if no obj is given.\"",
",",
"I... | Sets the value of a property on an object, respecting computed properties
and notifying observers and other listeners of the change. If the
property is not defined but the object implements the `setUnknownProperty`
method then that will be invoked as well.
@method set
@for Ember
@param {Object} obj The object to modif... | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"on",
"an",
"object",
"respecting",
"computed",
"properties",
"and",
"notifying",
"observers",
"and",
"other",
"listeners",
"of",
"the",
"change",
".",
"If",
"the",
"property",
"is",
"not",
"defined",
"but",
"th... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L18028-L18098 |
31,618 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | intern | function intern(str) {
var obj = {};
obj[str] = 1;
for (var key in obj) {
if (key === str) return key;
}
return str;
} | javascript | function intern(str) {
var obj = {};
obj[str] = 1;
for (var key in obj) {
if (key === str) return key;
}
return str;
} | [
"function",
"intern",
"(",
"str",
")",
"{",
"var",
"obj",
"=",
"{",
"}",
";",
"obj",
"[",
"str",
"]",
"=",
"1",
";",
"for",
"(",
"var",
"key",
"in",
"obj",
")",
"{",
"if",
"(",
"key",
"===",
"str",
")",
"return",
"key",
";",
"}",
"return",
... | Strongly hint runtimes to intern the provided string.
When do I need to use this function?
For the most part, never. Pre-mature optimization is bad, and often the
runtime does exactly what you need it to, and more often the trade-off isn't
worth it.
Why?
Runtimes store strings in at least 2 different representation... | [
"Strongly",
"hint",
"runtimes",
"to",
"intern",
"the",
"provided",
"string",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L18923-L18930 |
31,619 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | makeArray | function makeArray(obj) {
if (obj === null || obj === undefined) { return []; }
return isArray(obj) ? obj : [obj];
} | javascript | function makeArray(obj) {
if (obj === null || obj === undefined) { return []; }
return isArray(obj) ? obj : [obj];
} | [
"function",
"makeArray",
"(",
"obj",
")",
"{",
"if",
"(",
"obj",
"===",
"null",
"||",
"obj",
"===",
"undefined",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"isArray",
"(",
"obj",
")",
"?",
"obj",
":",
"[",
"obj",
"]",
";",
"}"
] | Forces the passed object to be part of an array. If the object is already
an array or array-like, returns the object. Otherwise adds the object to
an array. If obj is `null` or `undefined`, returns an empty array.
```javascript
Ember.makeArray(); // []
Ember.makeArray(null); // []
Ember.makeArray(und... | [
"Forces",
"the",
"passed",
"object",
"to",
"be",
"part",
"of",
"an",
"array",
".",
"If",
"the",
"object",
"is",
"already",
"an",
"array",
"or",
"array",
"-",
"like",
"returns",
"the",
"object",
".",
"Otherwise",
"adds",
"the",
"object",
"to",
"an",
"ar... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L19327-L19330 |
31,620 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | typeOf | function typeOf(item) {
var ret, modulePath;
// ES6TODO: Depends on Ember.Object which is defined in runtime.
if (typeof EmberObject === "undefined") {
modulePath = 'ember-runtime/system/object';
if (Ember.__loader.registry[modulePath]) {
EmberObject = Ember.__loader.require... | javascript | function typeOf(item) {
var ret, modulePath;
// ES6TODO: Depends on Ember.Object which is defined in runtime.
if (typeof EmberObject === "undefined") {
modulePath = 'ember-runtime/system/object';
if (Ember.__loader.registry[modulePath]) {
EmberObject = Ember.__loader.require... | [
"function",
"typeOf",
"(",
"item",
")",
"{",
"var",
"ret",
",",
"modulePath",
";",
"// ES6TODO: Depends on Ember.Object which is defined in runtime.",
"if",
"(",
"typeof",
"EmberObject",
"===",
"\"undefined\"",
")",
"{",
"modulePath",
"=",
"'ember-runtime/system/object'",... | Returns a consistent type for the passed item.
Use this instead of the built-in `typeof` to get the type of an item.
It will return the same result across all browsers and includes a bit
more detail. Here is what will be returned:
| Return Value | Meaning |
|-------------... | [
"Returns",
"a",
"consistent",
"type",
"for",
"the",
"passed",
"item",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L19602-L19624 |
31,621 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | watchKey | function watchKey(obj, keyName, meta) {
// can't watch length on Array - it is special...
if (keyName === 'length' && typeOf(obj) === 'array') { return; }
var m = meta || metaFor(obj), watching = m.watching;
// activate watching first time
if (!watching[keyName]) {
watching[keyNa... | javascript | function watchKey(obj, keyName, meta) {
// can't watch length on Array - it is special...
if (keyName === 'length' && typeOf(obj) === 'array') { return; }
var m = meta || metaFor(obj), watching = m.watching;
// activate watching first time
if (!watching[keyName]) {
watching[keyNa... | [
"function",
"watchKey",
"(",
"obj",
",",
"keyName",
",",
"meta",
")",
"{",
"// can't watch length on Array - it is special...",
"if",
"(",
"keyName",
"===",
"'length'",
"&&",
"typeOf",
"(",
"obj",
")",
"===",
"'array'",
")",
"{",
"return",
";",
"}",
"var",
"... | utils.js | [
"utils",
".",
"js"
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L19720-L19745 |
31,622 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function() {
this._super.apply(this, arguments);
Ember.deprecate('Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.', !this.currentWhen);
// Map desired event name to invoke function
var eventName = get(this, 'eventName');
this.on(eventName, this, thi... | javascript | function() {
this._super.apply(this, arguments);
Ember.deprecate('Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.', !this.currentWhen);
// Map desired event name to invoke function
var eventName = get(this, 'eventName');
this.on(eventName, this, thi... | [
"function",
"(",
")",
"{",
"this",
".",
"_super",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"Ember",
".",
"deprecate",
"(",
"'Using currentWhen with {{link-to}} is deprecated in favor of `current-when`.'",
",",
"!",
"this",
".",
"currentWhen",
")",
";... | this is doc'ed here so it shows up in the events section of the API documentation, which is where people will likely go looking for it.
Triggers the `LinkView`'s routing behavior. If
`eventName` is changed to a value other than `click`
the routing behavior will trigger on that custom event
instead.
@event click
An ... | [
"this",
"is",
"doc",
"ed",
"here",
"so",
"it",
"shows",
"up",
"in",
"the",
"events",
"section",
"of",
"the",
"API",
"documentation",
"which",
"is",
"where",
"people",
"will",
"likely",
"go",
"looking",
"for",
"it",
".",
"Triggers",
"the",
"LinkView",
"s"... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L20594-L20602 | |
31,623 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(){
var helperParameters = this.parameters;
var linkTextPath = helperParameters.options.linkTextPath;
var paths = getResolvedPaths(helperParameters);
var length = paths.length;
var path, i, normalizedPath;
if (linkTextPath) {
normalizedPath = getNormali... | javascript | function(){
var helperParameters = this.parameters;
var linkTextPath = helperParameters.options.linkTextPath;
var paths = getResolvedPaths(helperParameters);
var length = paths.length;
var path, i, normalizedPath;
if (linkTextPath) {
normalizedPath = getNormali... | [
"function",
"(",
")",
"{",
"var",
"helperParameters",
"=",
"this",
".",
"parameters",
";",
"var",
"linkTextPath",
"=",
"helperParameters",
".",
"options",
".",
"linkTextPath",
";",
"var",
"paths",
"=",
"getResolvedPaths",
"(",
"helperParameters",
")",
";",
"va... | This is called to setup observers that will trigger a rerender.
@private
@method _setupPathObservers
@since 1.3.0 | [
"This",
"is",
"called",
"to",
"setup",
"observers",
"that",
"will",
"trigger",
"a",
"rerender",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L20623-L20661 | |
31,624 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(params, transition) {
var match, name, sawParams, value;
var queryParams = get(this, '_qp.map');
for (var prop in params) {
if (prop === 'queryParams' || (queryParams && prop in queryParams)) {
continue;
}
if (match = prop.match(/^(.*)_id$/))... | javascript | function(params, transition) {
var match, name, sawParams, value;
var queryParams = get(this, '_qp.map');
for (var prop in params) {
if (prop === 'queryParams' || (queryParams && prop in queryParams)) {
continue;
}
if (match = prop.match(/^(.*)_id$/))... | [
"function",
"(",
"params",
",",
"transition",
")",
"{",
"var",
"match",
",",
"name",
",",
"sawParams",
",",
"value",
";",
"var",
"queryParams",
"=",
"get",
"(",
"this",
",",
"'_qp.map'",
")",
";",
"for",
"(",
"var",
"prop",
"in",
"params",
")",
"{",
... | A hook you can implement to convert the URL into the model for
this route.
```js
App.Router.map(function() {
this.resource('post', {path: '/posts/:post_id'});
});
```
The model for the `post` route is `store.find('post', params.post_id)`.
By default, if your route has a dynamic segment ending in `_id`:
The model cl... | [
"A",
"hook",
"you",
"can",
"implement",
"to",
"convert",
"the",
"URL",
"into",
"the",
"model",
"for",
"this",
"route",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L24873-L24900 | |
31,625 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(name, model) {
var container = this.container;
model = model || this.modelFor(name);
return generateController(container, name, model);
} | javascript | function(name, model) {
var container = this.container;
model = model || this.modelFor(name);
return generateController(container, name, model);
} | [
"function",
"(",
"name",
",",
"model",
")",
"{",
"var",
"container",
"=",
"this",
".",
"container",
";",
"model",
"=",
"model",
"||",
"this",
".",
"modelFor",
"(",
"name",
")",
";",
"return",
"generateController",
"(",
"container",
",",
"name",
",",
"m... | Generates a controller for a route.
If the optional model is passed then the controller type is determined automatically,
e.g., an ArrayController for arrays.
Example
```js
App.PostRoute = Ember.Route.extend({
setupController: function(controller, post) {
this._super(controller, post);
this.generateController('posts... | [
"Generates",
"a",
"controller",
"for",
"a",
"route",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L25150-L25156 | |
31,626 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(infos) {
updatePaths(this);
this._cancelLoadingEvent();
this.notifyPropertyChange('url');
// Put this in the runloop so url will be accurate. Seems
// less surprising than didTransition being out of sync.
run.once(this, this.trigger, 'didTransition');
... | javascript | function(infos) {
updatePaths(this);
this._cancelLoadingEvent();
this.notifyPropertyChange('url');
// Put this in the runloop so url will be accurate. Seems
// less surprising than didTransition being out of sync.
run.once(this, this.trigger, 'didTransition');
... | [
"function",
"(",
"infos",
")",
"{",
"updatePaths",
"(",
"this",
")",
";",
"this",
".",
"_cancelLoadingEvent",
"(",
")",
";",
"this",
".",
"notifyPropertyChange",
"(",
"'url'",
")",
";",
"// Put this in the runloop so url will be accurate. Seems",
"// less surprising t... | Handles updating the paths and notifying any listeners of the URL
change.
Triggers the router level `didTransition` hook.
@method didTransition
@private
@since 1.2.0 | [
"Handles",
"updating",
"the",
"paths",
"and",
"notifying",
"any",
"listeners",
"of",
"the",
"URL",
"change",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L25804-L25818 | |
31,627 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(routeName, models, queryParams) {
var router = this.router;
return router.isActive.apply(router, arguments);
} | javascript | function(routeName, models, queryParams) {
var router = this.router;
return router.isActive.apply(router, arguments);
} | [
"function",
"(",
"routeName",
",",
"models",
",",
"queryParams",
")",
"{",
"var",
"router",
"=",
"this",
".",
"router",
";",
"return",
"router",
".",
"isActive",
".",
"apply",
"(",
"router",
",",
"arguments",
")",
";",
"}"
] | An alternative form of `isActive` that doesn't require
manual concatenation of the arguments into a single
array.
@method isActiveIntent
@param routeName
@param models
@param queryParams
@return {Boolean}
@private
@since 1.7.0 | [
"An",
"alternative",
"form",
"of",
"isActive",
"that",
"doesn",
"t",
"require",
"manual",
"concatenation",
"of",
"the",
"arguments",
"into",
"a",
"single",
"array",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L25893-L25896 | |
31,628 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(callback) {
var router = this.router;
if (!router) {
router = new Router();
router._triggerWillChangeContext = Ember.K;
router._triggerWillLeave = Ember.K;
router.callbacks = [];
router.triggerEvent = triggerEvent;
... | javascript | function(callback) {
var router = this.router;
if (!router) {
router = new Router();
router._triggerWillChangeContext = Ember.K;
router._triggerWillLeave = Ember.K;
router.callbacks = [];
router.triggerEvent = triggerEvent;
... | [
"function",
"(",
"callback",
")",
"{",
"var",
"router",
"=",
"this",
".",
"router",
";",
"if",
"(",
"!",
"router",
")",
"{",
"router",
"=",
"new",
"Router",
"(",
")",
";",
"router",
".",
"_triggerWillChangeContext",
"=",
"Ember",
".",
"K",
";",
"rout... | The `Router.map` function allows you to define mappings from URLs to routes
and resources in your application. These mappings are defined within the
supplied callback function using `this.resource` and `this.route`.
```javascript
App.Router.map(function({
this.route('about');
this.resource('article');
}));
```
For mo... | [
"The",
"Router",
".",
"map",
"function",
"allows",
"you",
"to",
"define",
"mappings",
"from",
"URLs",
"to",
"routes",
"and",
"resources",
"in",
"your",
"application",
".",
"These",
"mappings",
"are",
"defined",
"within",
"the",
"supplied",
"callback",
"functio... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L26432-L26459 | |
31,629 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | map | function map(dependentKey, callback) {
var options = {
addedItem: function(array, item, changeMeta, instanceMeta) {
var mapped = callback.call(this, item, changeMeta.index);
array.insertAt(changeMeta.index, mapped);
return array;
},
removedItem: function(array... | javascript | function map(dependentKey, callback) {
var options = {
addedItem: function(array, item, changeMeta, instanceMeta) {
var mapped = callback.call(this, item, changeMeta.index);
array.insertAt(changeMeta.index, mapped);
return array;
},
removedItem: function(array... | [
"function",
"map",
"(",
"dependentKey",
",",
"callback",
")",
"{",
"var",
"options",
"=",
"{",
"addedItem",
":",
"function",
"(",
"array",
",",
"item",
",",
"changeMeta",
",",
"instanceMeta",
")",
"{",
"var",
"mapped",
"=",
"callback",
".",
"call",
"(",
... | Returns an array mapped via the callback
The callback method you provide should have the following signature.
`item` is the current item in the iteration.
`index` is the integer index of the current item in the iteration.
```javascript
function(item, index);
```
Example
```javascript
var Hamster = Ember.Object.exte... | [
"Returns",
"an",
"array",
"mapped",
"via",
"the",
"callback"
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L28050-L28064 |
31,630 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | sort | function sort(itemsKey, sortDefinition) {
Ember.assert('Ember.computed.sort requires two arguments: an array key to sort and ' +
'either a sort properties key or sort function', arguments.length === 2);
if (typeof sortDefinition === 'function') {
return customSort(itemsKey, sortDefinition);... | javascript | function sort(itemsKey, sortDefinition) {
Ember.assert('Ember.computed.sort requires two arguments: an array key to sort and ' +
'either a sort properties key or sort function', arguments.length === 2);
if (typeof sortDefinition === 'function') {
return customSort(itemsKey, sortDefinition);... | [
"function",
"sort",
"(",
"itemsKey",
",",
"sortDefinition",
")",
"{",
"Ember",
".",
"assert",
"(",
"'Ember.computed.sort requires two arguments: an array key to sort and '",
"+",
"'either a sort properties key or sort function'",
",",
"arguments",
".",
"length",
"===",
"2",
... | A computed property which returns a new array with all the
properties from the first dependent array sorted based on a property
or sort function.
The callback method you provide should have the following signature:
```javascript
function(itemA, itemB);
```
- `itemA` the first item to compare.
- `itemB` the second it... | [
"A",
"computed",
"property",
"which",
"returns",
"a",
"new",
"array",
"with",
"all",
"the",
"properties",
"from",
"the",
"first",
"dependent",
"array",
"sorted",
"based",
"on",
"a",
"property",
"or",
"sort",
"function",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L28558-L28567 |
31,631 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(actionName) {
var args = [].slice.call(arguments, 1);
var target;
if (this._actions && this._actions[actionName]) {
if (this._actions[actionName].apply(this, args) === true) {
// handler returned true, so this action will bubble
} else {
retu... | javascript | function(actionName) {
var args = [].slice.call(arguments, 1);
var target;
if (this._actions && this._actions[actionName]) {
if (this._actions[actionName].apply(this, args) === true) {
// handler returned true, so this action will bubble
} else {
retu... | [
"function",
"(",
"actionName",
")",
"{",
"var",
"args",
"=",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
";",
"var",
"target",
";",
"if",
"(",
"this",
".",
"_actions",
"&&",
"this",
".",
"_actions",
"[",
"actionName",
"]",... | Triggers a named action on the `ActionHandler`. Any parameters
supplied after the `actionName` string will be passed as arguments
to the action target function.
If the `ActionHandler` has its `target` property set, actions may
bubble to the `target`. Bubbling happens when an `actionName` can
not be found in the `Actio... | [
"Triggers",
"a",
"named",
"action",
"on",
"the",
"ActionHandler",
".",
"Any",
"parameters",
"supplied",
"after",
"the",
"actionName",
"string",
"will",
"be",
"passed",
"as",
"arguments",
"to",
"the",
"action",
"target",
"function",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L29893-L29909 | |
31,632 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(removing, adding) {
var removeCnt, addCnt, hasDelta;
if ('number' === typeof removing) removeCnt = removing;
else if (removing) removeCnt = get(removing, 'length');
else removeCnt = removing = -1;
if ('number' === typeof adding) addCnt = adding;
else if (addin... | javascript | function(removing, adding) {
var removeCnt, addCnt, hasDelta;
if ('number' === typeof removing) removeCnt = removing;
else if (removing) removeCnt = get(removing, 'length');
else removeCnt = removing = -1;
if ('number' === typeof adding) addCnt = adding;
else if (addin... | [
"function",
"(",
"removing",
",",
"adding",
")",
"{",
"var",
"removeCnt",
",",
"addCnt",
",",
"hasDelta",
";",
"if",
"(",
"'number'",
"===",
"typeof",
"removing",
")",
"removeCnt",
"=",
"removing",
";",
"else",
"if",
"(",
"removing",
")",
"removeCnt",
"=... | Invoke this method just before the contents of your enumerable will
change. You can either omit the parameters completely or pass the objects
to be removed or added if available or just a count.
@method enumerableContentWillChange
@param {Ember.Enumerable|Number} removing An enumerable of the objects to
be removed or ... | [
"Invoke",
"this",
"method",
"just",
"before",
"the",
"contents",
"of",
"your",
"enumerable",
"will",
"change",
".",
"You",
"can",
"either",
"omit",
"the",
"parameters",
"completely",
"or",
"pass",
"the",
"objects",
"to",
"be",
"removed",
"or",
"added",
"if",... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L31705-L31727 | |
31,633 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(name, target, method) {
if (!method) {
method = target;
target = null;
}
addListener(this, name, target, method, true);
return this;
} | javascript | function(name, target, method) {
if (!method) {
method = target;
target = null;
}
addListener(this, name, target, method, true);
return this;
} | [
"function",
"(",
"name",
",",
"target",
",",
"method",
")",
"{",
"if",
"(",
"!",
"method",
")",
"{",
"method",
"=",
"target",
";",
"target",
"=",
"null",
";",
"}",
"addListener",
"(",
"this",
",",
"name",
",",
"target",
",",
"method",
",",
"true",
... | Subscribes a function to a named event and then cancels the subscription
after the first time the event is triggered. It is good to use ``one`` when
you only care about the first time an event has taken place.
This function takes an optional 2nd argument that will become the "this"
value for the callback. If this argu... | [
"Subscribes",
"a",
"function",
"to",
"a",
"named",
"event",
"and",
"then",
"cancels",
"the",
"subscription",
"after",
"the",
"first",
"time",
"the",
"event",
"is",
"triggered",
".",
"It",
"is",
"good",
"to",
"use",
"one",
"when",
"you",
"only",
"care",
"... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L31885-L31893 | |
31,634 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(name) {
var length = arguments.length;
var args = new Array(length - 1);
for (var i = 1; i < length; i++) {
args[i - 1] = arguments[i];
}
sendEvent(this, name, args);
} | javascript | function(name) {
var length = arguments.length;
var args = new Array(length - 1);
for (var i = 1; i < length; i++) {
args[i - 1] = arguments[i];
}
sendEvent(this, name, args);
} | [
"function",
"(",
"name",
")",
"{",
"var",
"length",
"=",
"arguments",
".",
"length",
";",
"var",
"args",
"=",
"new",
"Array",
"(",
"length",
"-",
"1",
")",
";",
"for",
"(",
"var",
"i",
"=",
"1",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"... | Triggers a named event for the object. Any additional arguments
will be passed as parameters to the functions that are subscribed to the
event.
```javascript
person.on('didEat', function(food) {
console.log('person ate some ' + food);
});
person.trigger('didEat', 'broccoli');
outputs: person ate some broccoli
```
@m... | [
"Triggers",
"a",
"named",
"event",
"for",
"the",
"object",
".",
"Any",
"additional",
"arguments",
"will",
"be",
"passed",
"as",
"parameters",
"to",
"the",
"functions",
"that",
"are",
"subscribed",
"to",
"the",
"event",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L31913-L31922 | |
31,635 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(objects) {
if (!(Enumerable.detect(objects) || isArray(objects))) {
throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");
}
this.replace(get(this, 'length'), 0, objects);
return this;
} | javascript | function(objects) {
if (!(Enumerable.detect(objects) || isArray(objects))) {
throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");
}
this.replace(get(this, 'length'), 0, objects);
return this;
} | [
"function",
"(",
"objects",
")",
"{",
"if",
"(",
"!",
"(",
"Enumerable",
".",
"detect",
"(",
"objects",
")",
"||",
"isArray",
"(",
"objects",
")",
")",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\""... | Add the objects in the passed numerable to the end of the array. Defers
notifying observers of the change until all objects are added.
```javascript
var colors = ["red"];
colors.pushObjects(["yellow", "orange"]); // ["red", "yellow", "orange"]
```
@method pushObjects
@param {Ember.Enumerable} objects the objects to ... | [
"Add",
"the",
"objects",
"in",
"the",
"passed",
"numerable",
"to",
"the",
"end",
"of",
"the",
"array",
".",
"Defers",
"notifying",
"observers",
"of",
"the",
"change",
"until",
"all",
"objects",
"are",
"added",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L32228-L32234 | |
31,636 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(objects) {
beginPropertyChanges(this);
for (var i = objects.length - 1; i >= 0; i--) {
this.removeObject(objects[i]);
}
endPropertyChanges(this);
return this;
} | javascript | function(objects) {
beginPropertyChanges(this);
for (var i = objects.length - 1; i >= 0; i--) {
this.removeObject(objects[i]);
}
endPropertyChanges(this);
return this;
} | [
"function",
"(",
"objects",
")",
"{",
"beginPropertyChanges",
"(",
"this",
")",
";",
"for",
"(",
"var",
"i",
"=",
"objects",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"this",
".",
"removeObject",
"(",
"objects",
"[",
... | Removes each object in the passed enumerable from the receiver.
@method removeObjects
@param {Ember.Enumerable} objects the objects to remove
@return {Object} receiver | [
"Removes",
"each",
"object",
"in",
"the",
"passed",
"enumerable",
"from",
"the",
"receiver",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L32513-L32520 | |
31,637 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function() {
var C = this;
var l = arguments.length;
if (l > 0) {
var args = new Array(l);
for (var i = 0; i < l; i++) {
args[i] = arguments[i];
}
this._initProperties(args);
}
return new C();
} | javascript | function() {
var C = this;
var l = arguments.length;
if (l > 0) {
var args = new Array(l);
for (var i = 0; i < l; i++) {
args[i] = arguments[i];
}
this._initProperties(args);
}
return new C();
} | [
"function",
"(",
")",
"{",
"var",
"C",
"=",
"this",
";",
"var",
"l",
"=",
"arguments",
".",
"length",
";",
"if",
"(",
"l",
">",
"0",
")",
"{",
"var",
"args",
"=",
"new",
"Array",
"(",
"l",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
... | Creates an instance of a class. Accepts either no arguments, or an object
containing values to initialize the newly instantiated object with.
```javascript
App.Person = Ember.Object.extend({
helloWorld: function() {
alert("Hi, my name is " + this.get('name'));
}
});
var tom = App.Person.create({
name: 'Tom Dale'
});
... | [
"Creates",
"an",
"instance",
"of",
"a",
"class",
".",
"Accepts",
"either",
"no",
"arguments",
"or",
"an",
"object",
"containing",
"values",
"to",
"initialize",
"the",
"newly",
"instantiated",
"object",
"with",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L34719-L34730 | |
31,638 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(obj) {
// fail fast
if (!Enumerable.detect(obj)) return false;
var loc = get(this, 'length');
if (get(obj, 'length') !== loc) return false;
while(--loc >= 0) {
if (!obj.contains(this[loc])) return false;
}
return true;
} | javascript | function(obj) {
// fail fast
if (!Enumerable.detect(obj)) return false;
var loc = get(this, 'length');
if (get(obj, 'length') !== loc) return false;
while(--loc >= 0) {
if (!obj.contains(this[loc])) return false;
}
return true;
} | [
"function",
"(",
"obj",
")",
"{",
"// fail fast",
"if",
"(",
"!",
"Enumerable",
".",
"detect",
"(",
"obj",
")",
")",
"return",
"false",
";",
"var",
"loc",
"=",
"get",
"(",
"this",
",",
"'length'",
")",
";",
"if",
"(",
"get",
"(",
"obj",
",",
"'le... | Returns true if the passed object is also an enumerable that contains the
same objects as the receiver.
```javascript
var colors = ["red", "green", "blue"],
same_colors = new Ember.Set(colors);
same_colors.isEqual(colors); // true
same_colors.isEqual(["purple", "brown"]); // false
```
@method isEqual
... | [
"Returns",
"true",
"if",
"the",
"passed",
"object",
"is",
"also",
"an",
"enumerable",
"that",
"contains",
"the",
"same",
"objects",
"as",
"the",
"receiver",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L35999-L36011 | |
31,639 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function() {
if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);
var obj = this.length > 0 ? this[this.length-1] : null;
this.remove(obj);
return obj;
} | javascript | function() {
if (get(this, 'isFrozen')) throw new EmberError(FROZEN_ERROR);
var obj = this.length > 0 ? this[this.length-1] : null;
this.remove(obj);
return obj;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"get",
"(",
"this",
",",
"'isFrozen'",
")",
")",
"throw",
"new",
"EmberError",
"(",
"FROZEN_ERROR",
")",
";",
"var",
"obj",
"=",
"this",
".",
"length",
">",
"0",
"?",
"this",
"[",
"this",
".",
"length",
"-",
... | Removes the last element from the set and returns it, or `null` if it's empty.
```javascript
var colors = new Ember.Set(["green", "blue"]);
colors.pop(); // "blue"
colors.pop(); // "green"
colors.pop(); // null
```
@method pop
@return {Object} The removed object from the set or null. | [
"Removes",
"the",
"last",
"element",
"from",
"the",
"set",
"and",
"returns",
"it",
"or",
"null",
"if",
"it",
"s",
"empty",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L36066-L36071 | |
31,640 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function (index) {
var split = false;
var arrayOperationIndex, arrayOperation,
arrayOperationRangeStart, arrayOperationRangeEnd,
len;
// OPTIMIZE: we could search these faster if we kept a balanced tree.
// find leftmost arrayOperation to the right of `index`
... | javascript | function (index) {
var split = false;
var arrayOperationIndex, arrayOperation,
arrayOperationRangeStart, arrayOperationRangeEnd,
len;
// OPTIMIZE: we could search these faster if we kept a balanced tree.
// find leftmost arrayOperation to the right of `index`
... | [
"function",
"(",
"index",
")",
"{",
"var",
"split",
"=",
"false",
";",
"var",
"arrayOperationIndex",
",",
"arrayOperation",
",",
"arrayOperationRangeStart",
",",
"arrayOperationRangeEnd",
",",
"len",
";",
"// OPTIMIZE: we could search these faster if we kept a balanced tree... | Return an `ArrayOperationMatch` for the operation that contains the item at `index`.
@method _findArrayOperation
@param {Number} index the index of the item whose operation information
should be returned.
@private | [
"Return",
"an",
"ArrayOperationMatch",
"for",
"the",
"operation",
"that",
"contains",
"the",
"item",
"at",
"index",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L36918-L36944 | |
31,641 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(rootElement, event, eventName) {
var self = this;
rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {
var view = View.views[this.id];
var result = true;
var manager = self.canDispatchToEventManager ? self._findNearestEventManager(vi... | javascript | function(rootElement, event, eventName) {
var self = this;
rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {
var view = View.views[this.id];
var result = true;
var manager = self.canDispatchToEventManager ? self._findNearestEventManager(vi... | [
"function",
"(",
"rootElement",
",",
"event",
",",
"eventName",
")",
"{",
"var",
"self",
"=",
"this",
";",
"rootElement",
".",
"on",
"(",
"event",
"+",
"'.ember'",
",",
"'.ember-view'",
",",
"function",
"(",
"evt",
",",
"triggeringManager",
")",
"{",
"va... | Registers an event listener on the rootElement. If the given event is
triggered, the provided event handler will be triggered on the target view.
If the target view does not implement the event handler, or if the handler
returns `false`, the parent view will be called. The event will continue to
bubble to each success... | [
"Registers",
"an",
"event",
"listener",
"on",
"the",
"rootElement",
".",
"If",
"the",
"given",
"event",
"is",
"triggered",
"the",
"provided",
"event",
"handler",
"will",
"be",
"triggered",
"on",
"the",
"target",
"view",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L38698-L38727 | |
31,642 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(content, start, removedCount) {
// If the contents were empty before and this template collection has an
// empty view remove it now.
var emptyView = get(this, 'emptyView');
if (emptyView && emptyView instanceof View) {
emptyView.removeFromParent();
}
... | javascript | function(content, start, removedCount) {
// If the contents were empty before and this template collection has an
// empty view remove it now.
var emptyView = get(this, 'emptyView');
if (emptyView && emptyView instanceof View) {
emptyView.removeFromParent();
}
... | [
"function",
"(",
"content",
",",
"start",
",",
"removedCount",
")",
"{",
"// If the contents were empty before and this template collection has an",
"// empty view remove it now.",
"var",
"emptyView",
"=",
"get",
"(",
"this",
",",
"'emptyView'",
")",
";",
"if",
"(",
"em... | Called when a mutation to the underlying content array will occur.
This method will remove any views that are no longer in the underlying
content array.
Invokes whenever the content array itself will change.
@method arrayWillChange
@param {Array} content the managed collection of objects
@param {Number} start the in... | [
"Called",
"when",
"a",
"mutation",
"to",
"the",
"underlying",
"content",
"array",
"will",
"occur",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L39935-L39953 | |
31,643 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(content, start, removed, added) {
var addedViews = [];
var view, item, idx, len, itemViewClass, emptyView;
len = content ? get(content, 'length') : 0;
if (len) {
itemViewClass = get(this, 'itemViewClass');
itemViewClass = handlebarsGetView(content, itemView... | javascript | function(content, start, removed, added) {
var addedViews = [];
var view, item, idx, len, itemViewClass, emptyView;
len = content ? get(content, 'length') : 0;
if (len) {
itemViewClass = get(this, 'itemViewClass');
itemViewClass = handlebarsGetView(content, itemView... | [
"function",
"(",
"content",
",",
"start",
",",
"removed",
",",
"added",
")",
"{",
"var",
"addedViews",
"=",
"[",
"]",
";",
"var",
"view",
",",
"item",
",",
"idx",
",",
"len",
",",
"itemViewClass",
",",
"emptyView",
";",
"len",
"=",
"content",
"?",
... | Called when a mutation to the underlying content array occurs.
This method will replay that mutation against the views that compose the
`Ember.CollectionView`, ensuring that the view reflects the model.
This array observer is added in `contentDidChange`.
@method arrayDidChange
@param {Array} content the managed coll... | [
"Called",
"when",
"a",
"mutation",
"to",
"the",
"underlying",
"content",
"array",
"occurs",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L39969-L40008 | |
31,644 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(classBindings) {
var classNames = this.classNames;
var elem, newClass, dasherizedClass;
// Loop through all of the configured bindings. These will be either
// property names ('isUrgent') or property paths relative to the view
// ('content.isUrgent')
forEach(cla... | javascript | function(classBindings) {
var classNames = this.classNames;
var elem, newClass, dasherizedClass;
// Loop through all of the configured bindings. These will be either
// property names ('isUrgent') or property paths relative to the view
// ('content.isUrgent')
forEach(cla... | [
"function",
"(",
"classBindings",
")",
"{",
"var",
"classNames",
"=",
"this",
".",
"classNames",
";",
"var",
"elem",
",",
"newClass",
",",
"dasherizedClass",
";",
"// Loop through all of the configured bindings. These will be either",
"// property names ('isUrgent') or proper... | Iterates over the view's `classNameBindings` array, inserts the value
of the specified property into the `classNames` array, then creates an
observer to update the view's element if the bound property ever changes
in the future.
@method _applyClassNameBindings
@private | [
"Iterates",
"over",
"the",
"view",
"s",
"classNameBindings",
"array",
"inserts",
"the",
"value",
"of",
"the",
"specified",
"property",
"into",
"the",
"classNames",
"array",
"then",
"creates",
"an",
"observer",
"to",
"update",
"the",
"view",
"s",
"element",
"if... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L42336-L42404 | |
31,645 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | function(property) {
var parsedPath = View._parsePropertyPath(property);
var path = parsedPath.path;
var val = get(this, path);
if (val === undefined && isGlobalPath(path)) {
val = get(Ember.lookup, path);
}
return View._classStringForValue(path, val, parsedPa... | javascript | function(property) {
var parsedPath = View._parsePropertyPath(property);
var path = parsedPath.path;
var val = get(this, path);
if (val === undefined && isGlobalPath(path)) {
val = get(Ember.lookup, path);
}
return View._classStringForValue(path, val, parsedPa... | [
"function",
"(",
"property",
")",
"{",
"var",
"parsedPath",
"=",
"View",
".",
"_parsePropertyPath",
"(",
"property",
")",
";",
"var",
"path",
"=",
"parsedPath",
".",
"path",
";",
"var",
"val",
"=",
"get",
"(",
"this",
",",
"path",
")",
";",
"if",
"("... | Given a property name, returns a dasherized version of that
property name if the property evaluates to a non-falsy value.
For example, if the view has property `isUrgent` that evaluates to true,
passing `isUrgent` to this method will return `"is-urgent"`.
@method _classStringForProperty
@param property
@private | [
"Given",
"a",
"property",
"name",
"returns",
"a",
"dasherized",
"version",
"of",
"that",
"property",
"name",
"if",
"the",
"property",
"evaluates",
"to",
"a",
"non",
"-",
"falsy",
"value",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L42493-L42503 | |
31,646 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | interiorNamespace | function interiorNamespace(element){
if (
element &&
element.namespaceURI === svgNamespace &&
!svgHTMLIntegrationPoints[element.tagName]
) {
return svgNamespace;
} else {
return null;
}
} | javascript | function interiorNamespace(element){
if (
element &&
element.namespaceURI === svgNamespace &&
!svgHTMLIntegrationPoints[element.tagName]
) {
return svgNamespace;
} else {
return null;
}
} | [
"function",
"interiorNamespace",
"(",
"element",
")",
"{",
"if",
"(",
"element",
"&&",
"element",
".",
"namespaceURI",
"===",
"svgNamespace",
"&&",
"!",
"svgHTMLIntegrationPoints",
"[",
"element",
".",
"tagName",
"]",
")",
"{",
"return",
"svgNamespace",
";",
"... | This is not the namespace of the element, but of the elements inside that elements. | [
"This",
"is",
"not",
"the",
"namespace",
"of",
"the",
"element",
"but",
"of",
"the",
"elements",
"inside",
"that",
"elements",
"."
] | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L43484-L43494 |
31,647 | appiphony/appiphony-lightning-js | public/lib/emberjs/ember.js | buildSafeDOM | function buildSafeDOM(html, contextualElement, dom) {
var childNodes = buildIESafeDOM(html, contextualElement, dom);
if (contextualElement.tagName === 'SELECT') {
// Walk child nodes
for (var i = 0; childNodes[i]; i++) {
// Find and process the first option child node
if... | javascript | function buildSafeDOM(html, contextualElement, dom) {
var childNodes = buildIESafeDOM(html, contextualElement, dom);
if (contextualElement.tagName === 'SELECT') {
// Walk child nodes
for (var i = 0; childNodes[i]; i++) {
// Find and process the first option child node
if... | [
"function",
"buildSafeDOM",
"(",
"html",
",",
"contextualElement",
",",
"dom",
")",
"{",
"var",
"childNodes",
"=",
"buildIESafeDOM",
"(",
"html",
",",
"contextualElement",
",",
"dom",
")",
";",
"if",
"(",
"contextualElement",
".",
"tagName",
"===",
"'SELECT'",... | When parsing innerHTML, the browser may set up DOM with some things not desired. For example, with a select element context and option innerHTML the first option will be marked selected. This method cleans up some of that, resetting those values back to their defaults. | [
"When",
"parsing",
"innerHTML",
"the",
"browser",
"may",
"set",
"up",
"DOM",
"with",
"some",
"things",
"not",
"desired",
".",
"For",
"example",
"with",
"a",
"select",
"element",
"context",
"and",
"option",
"innerHTML",
"the",
"first",
"option",
"will",
"be",... | 704953fdc60b62d3073fc5cace716a201d38b36c | https://github.com/appiphony/appiphony-lightning-js/blob/704953fdc60b62d3073fc5cace716a201d38b36c/public/lib/emberjs/ember.js#L43949-L43968 |
31,648 | yahoo/kobold | lib/cli.js | filterArguments | function filterArguments(args, params, inject) {
var newArgs = ['node', '_mocha'].concat(inject || []),
param, i, len,
type;
for (i = 2, len = args.length; i < len; i++) {
if ((i < args.length - 1) && (args[i].length > 2) && (args[i].substr(0, 2) === '--')) {
// Get parameter without '--'
param = args... | javascript | function filterArguments(args, params, inject) {
var newArgs = ['node', '_mocha'].concat(inject || []),
param, i, len,
type;
for (i = 2, len = args.length; i < len; i++) {
if ((i < args.length - 1) && (args[i].length > 2) && (args[i].substr(0, 2) === '--')) {
// Get parameter without '--'
param = args... | [
"function",
"filterArguments",
"(",
"args",
",",
"params",
",",
"inject",
")",
"{",
"var",
"newArgs",
"=",
"[",
"'node'",
",",
"'_mocha'",
"]",
".",
"concat",
"(",
"inject",
"||",
"[",
"]",
")",
",",
"param",
",",
"i",
",",
"len",
",",
"type",
";",... | Filters arguments given and sets them to parameters
@method filterArguments
@param {string[]} args
@param {object} params
@param {string[]} [inject]
@return {string[]}
@private | [
"Filters",
"arguments",
"given",
"and",
"sets",
"them",
"to",
"parameters"
] | c43adea98046a7cc4101a27f0448675b2f589601 | https://github.com/yahoo/kobold/blob/c43adea98046a7cc4101a27f0448675b2f589601/lib/cli.js#L14-L63 |
31,649 | yahoo/kobold | lib/cli.js | prepareEnvironment | function prepareEnvironment (argv) {
var params, args;
// Define default values
params = {
'approved-folder': 'approved',
'build-folder': 'build',
'highlight-folder': 'highlight',
'config-folder': 'config',
'fail-orphans': false,
'fail-additions': false,
'test-path': null,
'config': null
};
// F... | javascript | function prepareEnvironment (argv) {
var params, args;
// Define default values
params = {
'approved-folder': 'approved',
'build-folder': 'build',
'highlight-folder': 'highlight',
'config-folder': 'config',
'fail-orphans': false,
'fail-additions': false,
'test-path': null,
'config': null
};
// F... | [
"function",
"prepareEnvironment",
"(",
"argv",
")",
"{",
"var",
"params",
",",
"args",
";",
"// Define default values",
"params",
"=",
"{",
"'approved-folder'",
":",
"'approved'",
",",
"'build-folder'",
":",
"'build'",
",",
"'highlight-folder'",
":",
"'highlight'",
... | Prepares the environment for kobold
@method prepareEnvironment
@param {string[]} argv
@return {string[]}
@private | [
"Prepares",
"the",
"environment",
"for",
"kobold"
] | c43adea98046a7cc4101a27f0448675b2f589601 | https://github.com/yahoo/kobold/blob/c43adea98046a7cc4101a27f0448675b2f589601/lib/cli.js#L73-L133 |
31,650 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeBarsChartPath | function makeBarsChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, paddingLeft, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let barWidth = xSpacing - paddingLeft;
let fullWidth = paddingLeft/2 ... | javascript | function makeBarsChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, paddingLeft, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let barWidth = xSpacing - paddingLeft;
let fullWidth = paddingLeft/2 ... | [
"function",
"makeBarsChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
",",
"paddingLeft",
",",
"isRange",
")",
"{",
"let",
"heightScaler",
"=",
"(",
"ch... | Generate the SVG path for a bar chart.
@param {object} chart The chart object
@param {number} width Width of the chart in pixels
@param {number} t Scale parameter (range: 0-1), used for
animating the graph
@param {number} maxValue The maximum value of chart data... | [
"Generate",
"the",
"SVG",
"path",
"for",
"a",
"bar",
"chart",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L276-L313 |
31,651 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeStackedBarsChartPath | function makeStackedBarsChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, paddingLeft, yAxisWidth, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
width = width - yAxisWidth;
let xSpacing = width / pointsOnScreen;
let barWidth = xSpacin... | javascript | function makeStackedBarsChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, paddingLeft, yAxisWidth, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
width = width - yAxisWidth;
let xSpacing = width / pointsOnScreen;
let barWidth = xSpacin... | [
"function",
"makeStackedBarsChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
",",
"paddingLeft",
",",
"yAxisWidth",
",",
"isRange",
")",
"{",
"let",
"heig... | Make like candle-stick, where each stck is its own Shape | [
"Make",
"like",
"candle",
"-",
"stick",
"where",
"each",
"stck",
"is",
"its",
"own",
"Shape"
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L316-L350 |
31,652 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeAreaChartPath | function makeAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen) {
return makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, true, false);
} | javascript | function makeAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen) {
return makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, true, false);
} | [
"function",
"makeAreaChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
")",
"{",
"return",
"makeLineOrAreaChartPath",
"(",
"chart",
",",
"width",
",",
"t",... | Wrapper function for makeLineOrAreaChartPath to make a line chart. | [
"Wrapper",
"function",
"for",
"makeLineOrAreaChartPath",
"to",
"make",
"a",
"line",
"chart",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L479-L481 |
31,653 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeLineChartPath | function makeLineChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen) {
return makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, false, false);
} | javascript | function makeLineChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen) {
return makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, false, false);
} | [
"function",
"makeLineChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
")",
"{",
"return",
"makeLineOrAreaChartPath",
"(",
"chart",
",",
"width",
",",
"t",... | Wrapper function for makeLineOrAreaChartPath to make an area chart. | [
"Wrapper",
"function",
"for",
"makeLineOrAreaChartPath",
"to",
"make",
"an",
"area",
"chart",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L490-L492 |
31,654 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeLineOrAreaChartPath | function makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, makeArea, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let centeriser = xSpacing / 2 - markerRadius;
let fullWidth = xSpa... | javascript | function makeLineOrAreaChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, makeArea, isRange) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let centeriser = xSpacing / 2 - markerRadius;
let fullWidth = xSpa... | [
"function",
"makeLineOrAreaChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
",",
"makeArea",
",",
"isRange",
")",
"{",
"let",
"heightScaler",
"=",
"(",
... | Generate the SVG path for a line or area chart.
@param {object} chart The chart object
@param {number} width Width of the chart in pixels
@param {number} t Scale parameter (range: 0-1), used for
animating the graph
@param {number} maxValue The maximum value of c... | [
"Generate",
"the",
"SVG",
"path",
"for",
"a",
"line",
"or",
"area",
"chart",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L515-L564 |
31,655 | redpandatronicsuk/arty-charty | arty-charty/util.js | makeSplineChartPath | function makeSplineChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, closePath) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let centeriser = xSpacing / 2 - markerRadius;
let fullWidth = xSpacing*(chart.... | javascript | function makeSplineChartPath(chart, width, t, maxValue, chartHeight, chartHeightOffset, markerRadius, pointsOnScreen, closePath) {
let heightScaler = (chartHeight-markerRadius)/maxValue;
let xSpacing = width / pointsOnScreen;
let centeriser = xSpacing / 2 - markerRadius;
let fullWidth = xSpacing*(chart.... | [
"function",
"makeSplineChartPath",
"(",
"chart",
",",
"width",
",",
"t",
",",
"maxValue",
",",
"chartHeight",
",",
"chartHeightOffset",
",",
"markerRadius",
",",
"pointsOnScreen",
",",
"closePath",
")",
"{",
"let",
"heightScaler",
"=",
"(",
"chartHeight",
"-",
... | Generate the SVG path for a spline or spline-area chart.
@param {object} chart The chart object
@param {number} width Width of the chart in pixels
@param {number} t Scale parameter (range: 0-1), used for
animating the graph
@param {number} maxValue The maximum v... | [
"Generate",
"the",
"SVG",
"path",
"for",
"a",
"spline",
"or",
"spline",
"-",
"area",
"chart",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L613-L645 |
31,656 | redpandatronicsuk/arty-charty | arty-charty/util.js | rgbaToHsla | function rgbaToHsla(h, s, l, a) {
return [...rgbToHsl(h,s,l), a];
} | javascript | function rgbaToHsla(h, s, l, a) {
return [...rgbToHsl(h,s,l), a];
} | [
"function",
"rgbaToHsla",
"(",
"h",
",",
"s",
",",
"l",
",",
"a",
")",
"{",
"return",
"[",
"...",
"rgbToHsl",
"(",
"h",
",",
"s",
",",
"l",
")",
",",
"a",
"]",
";",
"}"
] | Converts a RGBA colour to HSLA. | [
"Converts",
"a",
"RGBA",
"colour",
"to",
"HSLA",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L739-L741 |
31,657 | redpandatronicsuk/arty-charty | arty-charty/util.js | inerpolateColorsFixedAlpha | function inerpolateColorsFixedAlpha(col1, col2, amount, alpha) {
let col1rgb = parseColor(col1);
let col2rgb = parseColor(col2);
return RGBobj2string({
r: Math.min(255, col1rgb.r * amount + col2rgb.r * Math.max(0,1-amount)),
g: Math.min(255, col1rgb.g * amount + col2rgb.g * Math.max(0,1-amount)),
b: M... | javascript | function inerpolateColorsFixedAlpha(col1, col2, amount, alpha) {
let col1rgb = parseColor(col1);
let col2rgb = parseColor(col2);
return RGBobj2string({
r: Math.min(255, col1rgb.r * amount + col2rgb.r * Math.max(0,1-amount)),
g: Math.min(255, col1rgb.g * amount + col2rgb.g * Math.max(0,1-amount)),
b: M... | [
"function",
"inerpolateColorsFixedAlpha",
"(",
"col1",
",",
"col2",
",",
"amount",
",",
"alpha",
")",
"{",
"let",
"col1rgb",
"=",
"parseColor",
"(",
"col1",
")",
";",
"let",
"col2rgb",
"=",
"parseColor",
"(",
"col2",
")",
";",
"return",
"RGBobj2string",
"(... | Interpolate two colours and set the alpha value. | [
"Interpolate",
"two",
"colours",
"and",
"set",
"the",
"alpha",
"value",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L863-L872 |
31,658 | redpandatronicsuk/arty-charty | arty-charty/util.js | shadeColor | function shadeColor(col, amount) {
let col1rgb = parseColor(col);
return RGBobj2string({
r: Math.min(255, col1rgb.r * amount + 0 * Math.max(0,1-amount)),
g: Math.min(255, col1rgb.g * amount + 0 * Math.max(0,1-amount)),
b: Math.min(255, col1rgb.b * amount + 0 * Math.max(0,1-amount)),
a: col1rgb.a
}... | javascript | function shadeColor(col, amount) {
let col1rgb = parseColor(col);
return RGBobj2string({
r: Math.min(255, col1rgb.r * amount + 0 * Math.max(0,1-amount)),
g: Math.min(255, col1rgb.g * amount + 0 * Math.max(0,1-amount)),
b: Math.min(255, col1rgb.b * amount + 0 * Math.max(0,1-amount)),
a: col1rgb.a
}... | [
"function",
"shadeColor",
"(",
"col",
",",
"amount",
")",
"{",
"let",
"col1rgb",
"=",
"parseColor",
"(",
"col",
")",
";",
"return",
"RGBobj2string",
"(",
"{",
"r",
":",
"Math",
".",
"min",
"(",
"255",
",",
"col1rgb",
".",
"r",
"*",
"amount",
"+",
"... | Shade the colour by the given amount. | [
"Shade",
"the",
"colour",
"by",
"the",
"given",
"amount",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L877-L885 |
31,659 | redpandatronicsuk/arty-charty | arty-charty/util.js | lightenColor | function lightenColor(col, amount) {
let colRgba = parseColor(col);
let colHsla = rgbaToHsla(colRgba.r, colRgba.g, colRgba.b, colRgba.a);
colRgba = hslaToRgba(colHsla[0],colHsla[1],Math.min(Math.max(colHsla[2]+amount, 0), 1),colHsla[3]);
return RGBobj2string({
r: colRgba[0],
g: colRgba[1],
b: colRgb... | javascript | function lightenColor(col, amount) {
let colRgba = parseColor(col);
let colHsla = rgbaToHsla(colRgba.r, colRgba.g, colRgba.b, colRgba.a);
colRgba = hslaToRgba(colHsla[0],colHsla[1],Math.min(Math.max(colHsla[2]+amount, 0), 1),colHsla[3]);
return RGBobj2string({
r: colRgba[0],
g: colRgba[1],
b: colRgb... | [
"function",
"lightenColor",
"(",
"col",
",",
"amount",
")",
"{",
"let",
"colRgba",
"=",
"parseColor",
"(",
"col",
")",
";",
"let",
"colHsla",
"=",
"rgbaToHsla",
"(",
"colRgba",
".",
"r",
",",
"colRgba",
".",
"g",
",",
"colRgba",
".",
"b",
",",
"colRg... | Increase colour lightness by the given amount. | [
"Increase",
"colour",
"lightness",
"by",
"the",
"given",
"amount",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L903-L913 |
31,660 | redpandatronicsuk/arty-charty | arty-charty/util.js | hueshiftColor | function hueshiftColor(col, amount) {
let colRgba = parseColor(col);
let colHsla = rgbaToHsla(colRgba.r, colRgba.g, colRgba.b, colRgba.a);
colRgba = hslaToRgba((hsl[0] + amount) % 1, colHsla[1], colHsla[2],colHsla[3]);
return RGBobj2string({
r: colRgba[0],
g: colRgba[1],
b: colRgba[2],
a: colRgb... | javascript | function hueshiftColor(col, amount) {
let colRgba = parseColor(col);
let colHsla = rgbaToHsla(colRgba.r, colRgba.g, colRgba.b, colRgba.a);
colRgba = hslaToRgba((hsl[0] + amount) % 1, colHsla[1], colHsla[2],colHsla[3]);
return RGBobj2string({
r: colRgba[0],
g: colRgba[1],
b: colRgba[2],
a: colRgb... | [
"function",
"hueshiftColor",
"(",
"col",
",",
"amount",
")",
"{",
"let",
"colRgba",
"=",
"parseColor",
"(",
"col",
")",
";",
"let",
"colHsla",
"=",
"rgbaToHsla",
"(",
"colRgba",
".",
"r",
",",
"colRgba",
".",
"g",
",",
"colRgba",
".",
"b",
",",
"colR... | Hue shift colour by a given amount. | [
"Hue",
"shift",
"colour",
"by",
"a",
"given",
"amount",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L933-L943 |
31,661 | redpandatronicsuk/arty-charty | arty-charty/util.js | getMaxSumStack | function getMaxSumStack(arr) { //here!!!
let maxValue = Number.MIN_VALUE;
arr
.forEach((d) => {
let stackSum = computeArrayValueSum(d);
if (stackSum > maxValue) {
maxValue = stackSum;
}
});
return maxValue;
} | javascript | function getMaxSumStack(arr) { //here!!!
let maxValue = Number.MIN_VALUE;
arr
.forEach((d) => {
let stackSum = computeArrayValueSum(d);
if (stackSum > maxValue) {
maxValue = stackSum;
}
});
return maxValue;
} | [
"function",
"getMaxSumStack",
"(",
"arr",
")",
"{",
"//here!!!",
"let",
"maxValue",
"=",
"Number",
".",
"MIN_VALUE",
";",
"arr",
".",
"forEach",
"(",
"(",
"d",
")",
"=>",
"{",
"let",
"stackSum",
"=",
"computeArrayValueSum",
"(",
"d",
")",
";",
"if",
"(... | Find maximum stacksum | [
"Find",
"maximum",
"stacksum"
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L999-L1009 |
31,662 | redpandatronicsuk/arty-charty | arty-charty/util.js | getMinMaxValuesXY | function getMinMaxValuesXY(arr) {
let maxValueX = Number.MIN_VALUE;
let maxValueY = Number.MIN_VALUE;
let minValueX = Number.MAX_VALUE;
let minValueY = Number.MAX_VALUE;
arr
.forEach((d) => {
if (d.x > maxValueX) {
maxValueX = d.x;
}
if (d.x < minValueX) {
... | javascript | function getMinMaxValuesXY(arr) {
let maxValueX = Number.MIN_VALUE;
let maxValueY = Number.MIN_VALUE;
let minValueX = Number.MAX_VALUE;
let minValueY = Number.MAX_VALUE;
arr
.forEach((d) => {
if (d.x > maxValueX) {
maxValueX = d.x;
}
if (d.x < minValueX) {
... | [
"function",
"getMinMaxValuesXY",
"(",
"arr",
")",
"{",
"let",
"maxValueX",
"=",
"Number",
".",
"MIN_VALUE",
";",
"let",
"maxValueY",
"=",
"Number",
".",
"MIN_VALUE",
";",
"let",
"minValueX",
"=",
"Number",
".",
"MAX_VALUE",
";",
"let",
"minValueY",
"=",
"N... | Find minimum and maximum X and Y values in an array of
XY coordinate objects | [
"Find",
"minimum",
"and",
"maximum",
"X",
"and",
"Y",
"values",
"in",
"an",
"array",
"of",
"XY",
"coordinate",
"objects"
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L1027-L1048 |
31,663 | redpandatronicsuk/arty-charty | arty-charty/util.js | getMinMaxValuesCandlestick | function getMinMaxValuesCandlestick(arr) {
let maxValue = Number.MIN_VALUE;
let minValue = Number.MAX_VALUE;
arr
.forEach((d) => {
if (d.high > maxValue) {
maxValue = d.high;
}
if (d.low < minValue) {
minValue = d.low;
}
});
return {maxVa... | javascript | function getMinMaxValuesCandlestick(arr) {
let maxValue = Number.MIN_VALUE;
let minValue = Number.MAX_VALUE;
arr
.forEach((d) => {
if (d.high > maxValue) {
maxValue = d.high;
}
if (d.low < minValue) {
minValue = d.low;
}
});
return {maxVa... | [
"function",
"getMinMaxValuesCandlestick",
"(",
"arr",
")",
"{",
"let",
"maxValue",
"=",
"Number",
".",
"MIN_VALUE",
";",
"let",
"minValue",
"=",
"Number",
".",
"MAX_VALUE",
";",
"arr",
".",
"forEach",
"(",
"(",
"d",
")",
"=>",
"{",
"if",
"(",
"d",
".",... | Find minimum and maximum value in an array of candlestick objects | [
"Find",
"minimum",
"and",
"maximum",
"value",
"in",
"an",
"array",
"of",
"candlestick",
"objects"
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L1053-L1066 |
31,664 | redpandatronicsuk/arty-charty | arty-charty/util.js | findRectangleIndexContainingPoint | function findRectangleIndexContainingPoint(rectangles, x, y) {
let closestIdx;
rectangles.some((d, idx) => {
if ((d.x1 <= x && x <= d.x2) && (d.y1 <= y && y <= d.y2)) {
closestIdx = idx;
return true;
}
return false;
});
return closestIdx;
} | javascript | function findRectangleIndexContainingPoint(rectangles, x, y) {
let closestIdx;
rectangles.some((d, idx) => {
if ((d.x1 <= x && x <= d.x2) && (d.y1 <= y && y <= d.y2)) {
closestIdx = idx;
return true;
}
return false;
});
return closestIdx;
} | [
"function",
"findRectangleIndexContainingPoint",
"(",
"rectangles",
",",
"x",
",",
"y",
")",
"{",
"let",
"closestIdx",
";",
"rectangles",
".",
"some",
"(",
"(",
"d",
",",
"idx",
")",
"=>",
"{",
"if",
"(",
"(",
"d",
".",
"x1",
"<=",
"x",
"&&",
"x",
... | Find the index of the rectangle that contains a given
coordinate.
@param {array} points - Array of rectangles, each rectangle is of the form
{x1: number, x2: number, y1: number, y2: number},
where x1 and x2 are the minimum and maximum x coordinates
and y1 and y3 are the minimum and maximum x coordinates.
@param {number... | [
"Find",
"the",
"index",
"of",
"the",
"rectangle",
"that",
"contains",
"a",
"given",
"coordinate",
"."
] | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L1091-L1101 |
31,665 | redpandatronicsuk/arty-charty | arty-charty/util.js | findClosestPointIndexWithinRadius | function findClosestPointIndexWithinRadius(points, x, y, radiusThreshold) {
let closestIdx;
let closestDist = Number.MAX_VALUE;
points.forEach((d, idx) => {
let distSqrd = Math.pow(d.x - x, 2) + Math.pow(d.y - y, 2); // changeto: (d.x - x)**2 + (d.y - y)**2;
if (distSqrd < closestDist && distSqr... | javascript | function findClosestPointIndexWithinRadius(points, x, y, radiusThreshold) {
let closestIdx;
let closestDist = Number.MAX_VALUE;
points.forEach((d, idx) => {
let distSqrd = Math.pow(d.x - x, 2) + Math.pow(d.y - y, 2); // changeto: (d.x - x)**2 + (d.y - y)**2;
if (distSqrd < closestDist && distSqr... | [
"function",
"findClosestPointIndexWithinRadius",
"(",
"points",
",",
"x",
",",
"y",
",",
"radiusThreshold",
")",
"{",
"let",
"closestIdx",
";",
"let",
"closestDist",
"=",
"Number",
".",
"MAX_VALUE",
";",
"points",
".",
"forEach",
"(",
"(",
"d",
",",
"idx",
... | Find the index of the closest coordinate to a
reference coordinate in an array of coordinates.
If no point is found within the threshold distance
undefined is returned. | [
"Find",
"the",
"index",
"of",
"the",
"closest",
"coordinate",
"to",
"a",
"reference",
"coordinate",
"in",
"an",
"array",
"of",
"coordinates",
".",
"If",
"no",
"point",
"is",
"found",
"within",
"the",
"threshold",
"distance",
"undefined",
"is",
"returned",
".... | d0b90b42de9f4360343e25e918358e9b331f080d | https://github.com/redpandatronicsuk/arty-charty/blob/d0b90b42de9f4360343e25e918358e9b331f080d/arty-charty/util.js#L1109-L1120 |
31,666 | Kronos-Integration/kronos-interceptor-object-data-processor-row | lib/util/property-helper.js | function (fieldDefinition) {
let type = fieldDefinition.fieldType;
if (typeof type === 'object') {
type = fieldDefinition.fieldType.type;
}
return type;
} | javascript | function (fieldDefinition) {
let type = fieldDefinition.fieldType;
if (typeof type === 'object') {
type = fieldDefinition.fieldType.type;
}
return type;
} | [
"function",
"(",
"fieldDefinition",
")",
"{",
"let",
"type",
"=",
"fieldDefinition",
".",
"fieldType",
";",
"if",
"(",
"typeof",
"type",
"===",
"'object'",
")",
"{",
"type",
"=",
"fieldDefinition",
".",
"fieldType",
".",
"type",
";",
"}",
"return",
"type",... | Returns the severity for a check property. The severity may be defined globaly
for the complete field, but also may be defined on a per check basis
@param fieldDefinition The field_definition | [
"Returns",
"the",
"severity",
"for",
"a",
"check",
"property",
".",
"The",
"severity",
"may",
"be",
"defined",
"globaly",
"for",
"the",
"complete",
"field",
"but",
"also",
"may",
"be",
"defined",
"on",
"a",
"per",
"check",
"basis"
] | 678a59b84dab4a9082377c90849a0d62d97a1ea4 | https://github.com/Kronos-Integration/kronos-interceptor-object-data-processor-row/blob/678a59b84dab4a9082377c90849a0d62d97a1ea4/lib/util/property-helper.js#L87-L93 | |
31,667 | sociomantic-tsunami/lochness | webpack.config.js | buildConfig | function buildConfig( wantedEnv )
{
const isValid = wantedEnv &&
wantedEnv.length > 0 && allowedEnvs.indexOf( wantedEnv ) !== -1;
const validEnv = isValid ? wantedEnv : 'dev';
return configs[ validEnv ];
} | javascript | function buildConfig( wantedEnv )
{
const isValid = wantedEnv &&
wantedEnv.length > 0 && allowedEnvs.indexOf( wantedEnv ) !== -1;
const validEnv = isValid ? wantedEnv : 'dev';
return configs[ validEnv ];
} | [
"function",
"buildConfig",
"(",
"wantedEnv",
")",
"{",
"const",
"isValid",
"=",
"wantedEnv",
"&&",
"wantedEnv",
".",
"length",
">",
"0",
"&&",
"allowedEnvs",
".",
"indexOf",
"(",
"wantedEnv",
")",
"!==",
"-",
"1",
";",
"const",
"validEnv",
"=",
"isValid",
... | Build the webpack configuration
@param {String} wantedEnv The wanted environment
@return {Object} Webpack config | [
"Build",
"the",
"webpack",
"configuration"
] | cf71d6608ce2cdc6d745195a90c815304b8f0f6f | https://github.com/sociomantic-tsunami/lochness/blob/cf71d6608ce2cdc6d745195a90c815304b8f0f6f/webpack.config.js#L37-L45 |
31,668 | yhtml5/yhtml5-cli | packages/yhtml5-cli/lib/generate.js | generate | function generate (projectPatch, source, done) {
shell.mkdir('-p', projectPatch)
shell.cp('-Rf', source, projectPatch)
done()
} | javascript | function generate (projectPatch, source, done) {
shell.mkdir('-p', projectPatch)
shell.cp('-Rf', source, projectPatch)
done()
} | [
"function",
"generate",
"(",
"projectPatch",
",",
"source",
",",
"done",
")",
"{",
"shell",
".",
"mkdir",
"(",
"'-p'",
",",
"projectPatch",
")",
"shell",
".",
"cp",
"(",
"'-Rf'",
",",
"source",
",",
"projectPatch",
")",
"done",
"(",
")",
"}"
] | Generate a template given a `src` and `dest`.
@param {String} projectPatch
@param {String} source
@param {Function} done | [
"Generate",
"a",
"template",
"given",
"a",
"src",
"and",
"dest",
"."
] | 521a8ad160058e453dff87c7cc9bfb16215715c6 | https://github.com/yhtml5/yhtml5-cli/blob/521a8ad160058e453dff87c7cc9bfb16215715c6/packages/yhtml5-cli/lib/generate.js#L12-L16 |
31,669 | feedhenry/fh-mbaas-express | lib/common/authenticate.js | getCacheRefreshInterval | function getCacheRefreshInterval() {
var value = parseInt(process.env[CACHE_REFRESH_KEY]);
// Should we 0 here to invalidate the cache immediately?
if (value && !isNaN(value) && value > 0) {
return value;
}
return DEFAULT_CACHE_REFRESH_SECONDS;
} | javascript | function getCacheRefreshInterval() {
var value = parseInt(process.env[CACHE_REFRESH_KEY]);
// Should we 0 here to invalidate the cache immediately?
if (value && !isNaN(value) && value > 0) {
return value;
}
return DEFAULT_CACHE_REFRESH_SECONDS;
} | [
"function",
"getCacheRefreshInterval",
"(",
")",
"{",
"var",
"value",
"=",
"parseInt",
"(",
"process",
".",
"env",
"[",
"CACHE_REFRESH_KEY",
"]",
")",
";",
"// Should we 0 here to invalidate the cache immediately?",
"if",
"(",
"value",
"&&",
"!",
"isNaN",
"(",
"va... | The refresh interval of the authentication cache should be configurable. Since
this is running inside a cloud app the best option is th use an environment
variable.
@returns {*} | [
"The",
"refresh",
"interval",
"of",
"the",
"authentication",
"cache",
"should",
"be",
"configurable",
".",
"Since",
"this",
"is",
"running",
"inside",
"a",
"cloud",
"app",
"the",
"best",
"option",
"is",
"th",
"use",
"an",
"environment",
"variable",
"."
] | 381c2a5842b49a4cbc4519d55b9a3c870b364d3c | https://github.com/feedhenry/fh-mbaas-express/blob/381c2a5842b49a4cbc4519d55b9a3c870b364d3c/lib/common/authenticate.js#L357-L366 |
31,670 | scijs/cwise-parser | index.js | createLocal | function createLocal(id) {
var nstr = prefix + id.replace(/\_/g, "__")
localVars.push(nstr)
return nstr
} | javascript | function createLocal(id) {
var nstr = prefix + id.replace(/\_/g, "__")
localVars.push(nstr)
return nstr
} | [
"function",
"createLocal",
"(",
"id",
")",
"{",
"var",
"nstr",
"=",
"prefix",
"+",
"id",
".",
"replace",
"(",
"/",
"\\_",
"/",
"g",
",",
"\"__\"",
")",
"localVars",
".",
"push",
"(",
"nstr",
")",
"return",
"nstr",
"}"
] | Retrieves a local variable | [
"Retrieves",
"a",
"local",
"variable"
] | 6b9cbce6ebb6b66051226df75627f740b7ecdcc8 | https://github.com/scijs/cwise-parser/blob/6b9cbce6ebb6b66051226df75627f740b7ecdcc8/index.js#L72-L76 |
31,671 | scijs/cwise-parser | index.js | createThisVar | function createThisVar(id) {
var nstr = "this_" + id.replace(/\_/g, "__")
thisVars.push(nstr)
return nstr
} | javascript | function createThisVar(id) {
var nstr = "this_" + id.replace(/\_/g, "__")
thisVars.push(nstr)
return nstr
} | [
"function",
"createThisVar",
"(",
"id",
")",
"{",
"var",
"nstr",
"=",
"\"this_\"",
"+",
"id",
".",
"replace",
"(",
"/",
"\\_",
"/",
"g",
",",
"\"__\"",
")",
"thisVars",
".",
"push",
"(",
"nstr",
")",
"return",
"nstr",
"}"
] | Creates a this variable | [
"Creates",
"a",
"this",
"variable"
] | 6b9cbce6ebb6b66051226df75627f740b7ecdcc8 | https://github.com/scijs/cwise-parser/blob/6b9cbce6ebb6b66051226df75627f740b7ecdcc8/index.js#L79-L83 |
31,672 | scijs/cwise-parser | index.js | rewrite | function rewrite(node, nstr) {
var lo = node.range[0], hi = node.range[1]
for(var i=lo+1; i<hi; ++i) {
exploded[i] = ""
}
exploded[lo] = nstr
} | javascript | function rewrite(node, nstr) {
var lo = node.range[0], hi = node.range[1]
for(var i=lo+1; i<hi; ++i) {
exploded[i] = ""
}
exploded[lo] = nstr
} | [
"function",
"rewrite",
"(",
"node",
",",
"nstr",
")",
"{",
"var",
"lo",
"=",
"node",
".",
"range",
"[",
"0",
"]",
",",
"hi",
"=",
"node",
".",
"range",
"[",
"1",
"]",
"for",
"(",
"var",
"i",
"=",
"lo",
"+",
"1",
";",
"i",
"<",
"hi",
";",
... | Rewrites an ast node | [
"Rewrites",
"an",
"ast",
"node"
] | 6b9cbce6ebb6b66051226df75627f740b7ecdcc8 | https://github.com/scijs/cwise-parser/blob/6b9cbce6ebb6b66051226df75627f740b7ecdcc8/index.js#L86-L92 |
31,673 | dowjones/distribucache | lib/CacheClient.js | CacheClient | function CacheClient(store, config) {
EventEmitter.call(this);
this._store = store;
this._config = config || {};
util.propagateEvent(this._store, this, 'error');
this.on('error', unhandledErrorListener);
} | javascript | function CacheClient(store, config) {
EventEmitter.call(this);
this._store = store;
this._config = config || {};
util.propagateEvent(this._store, this, 'error');
this.on('error', unhandledErrorListener);
} | [
"function",
"CacheClient",
"(",
"store",
",",
"config",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"this",
".",
"_store",
"=",
"store",
";",
"this",
".",
"_config",
"=",
"config",
"||",
"{",
"}",
";",
"util",
".",
"propagateEvent",
... | Create a new cache client,
decorated with the desired features,
based on the provided config.
@constructor
@param {Store} store
@param {Object} [config]
@param {Boolean} [config.isPreconfigured] defaults to false
@param {String} [config.host] defaults to 'localhost'
@param {Number} [config.port] defaults to 6379
@pa... | [
"Create",
"a",
"new",
"cache",
"client",
"decorated",
"with",
"the",
"desired",
"features",
"based",
"on",
"the",
"provided",
"config",
"."
] | ad79caee277771a6e49ee4a98c4983480cd89945 | https://github.com/dowjones/distribucache/blob/ad79caee277771a6e49ee4a98c4983480cd89945/lib/CacheClient.js#L46-L54 |
31,674 | macrat/AsyncMark | src/timer.js | timeit | async function timeit(fun, context={}, args=[]) {
const start = now();
await fun.call(context, ...args);
const end = now();
return end - start;
} | javascript | async function timeit(fun, context={}, args=[]) {
const start = now();
await fun.call(context, ...args);
const end = now();
return end - start;
} | [
"async",
"function",
"timeit",
"(",
"fun",
",",
"context",
"=",
"{",
"}",
",",
"args",
"=",
"[",
"]",
")",
"{",
"const",
"start",
"=",
"now",
"(",
")",
";",
"await",
"fun",
".",
"call",
"(",
"context",
",",
"...",
"args",
")",
";",
"const",
"en... | Measure tiem to execute a function.
wait for done if the target function returns a thenable object. so you can use async function.
NOTE: this function will execute target function only once.
@param {function(): ?Promise} fun - the target function.
@param {Object} [context={}] - the `this` for target function.
@param... | [
"Measure",
"tiem",
"to",
"execute",
"a",
"function",
"."
] | 84ae4130034c47857d0df0e64d43900a18b8b285 | https://github.com/macrat/AsyncMark/blob/84ae4130034c47857d0df0e64d43900a18b8b285/src/timer.js#L79-L85 |
31,675 | SandJS/http | lib/middleware/ai.js | getCache | function getCache() {
return new Promise(function(resolve, reject) {
// create and fetch the cache key
get(getKey(), function(err, data) {
if (err) {
return reject(err);
}
resolve(data);
});
});
} | javascript | function getCache() {
return new Promise(function(resolve, reject) {
// create and fetch the cache key
get(getKey(), function(err, data) {
if (err) {
return reject(err);
}
resolve(data);
});
});
} | [
"function",
"getCache",
"(",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"// create and fetch the cache key",
"get",
"(",
"getKey",
"(",
")",
",",
"function",
"(",
"err",
",",
"data",
")",
"{",
"if",
"(... | Fetches an image buffer from the cache
@returns {Promise} | [
"Fetches",
"an",
"image",
"buffer",
"from",
"the",
"cache"
] | 8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f | https://github.com/SandJS/http/blob/8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f/lib/middleware/ai.js#L323-L333 |
31,676 | SandJS/http | lib/middleware/ai.js | putCache | function putCache() {
return new Promise(function(resolve, reject) {
// make the cache key
let key = getKey();
// adapt the image
adapt(function(err, stdout, stderr) {
if (err) {
return reject(err);
}
// convert the new image stream to bu... | javascript | function putCache() {
return new Promise(function(resolve, reject) {
// make the cache key
let key = getKey();
// adapt the image
adapt(function(err, stdout, stderr) {
if (err) {
return reject(err);
}
// convert the new image stream to bu... | [
"function",
"putCache",
"(",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"// make the cache key",
"let",
"key",
"=",
"getKey",
"(",
")",
";",
"// adapt the image",
"adapt",
"(",
"function",
"(",
"err",
",... | Creates an adapted image buffer | puts it in the cache | returns the buffer
@returns {Promise} | [
"Creates",
"an",
"adapted",
"image",
"buffer",
"|",
"puts",
"it",
"in",
"the",
"cache",
"|",
"returns",
"the",
"buffer"
] | 8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f | https://github.com/SandJS/http/blob/8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f/lib/middleware/ai.js#L340-L373 |
31,677 | SandJS/http | lib/middleware/ai.js | getKey | function getKey() {
let paramString =
width + 'x' + height + '-'
+ path
+ (is2x ? '-@2x' : '')
+ (bg ? `_${bg}` : '')
+ (crop ? '_crop' : '')
+ (mode ? `_${mode}` : '')
+ (trim ? '_trim' : '');
return paramString + '-' + crypto.createHash('sha1').upda... | javascript | function getKey() {
let paramString =
width + 'x' + height + '-'
+ path
+ (is2x ? '-@2x' : '')
+ (bg ? `_${bg}` : '')
+ (crop ? '_crop' : '')
+ (mode ? `_${mode}` : '')
+ (trim ? '_trim' : '');
return paramString + '-' + crypto.createHash('sha1').upda... | [
"function",
"getKey",
"(",
")",
"{",
"let",
"paramString",
"=",
"width",
"+",
"'x'",
"+",
"height",
"+",
"'-'",
"+",
"path",
"+",
"(",
"is2x",
"?",
"'-@2x'",
":",
"''",
")",
"+",
"(",
"bg",
"?",
"`",
"${",
"bg",
"}",
"`",
":",
"''",
")",
"+",... | Builds a cache key for the adapted image
@returns {string} | [
"Builds",
"a",
"cache",
"key",
"for",
"the",
"adapted",
"image"
] | 8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f | https://github.com/SandJS/http/blob/8f8b4d23eb5f59d802c9537e0ccd67b47fa79d2f/lib/middleware/ai.js#L380-L391 |
31,678 | Rhinostone/gina | core/controller/controller.js | function(type, resStr, resArr, resObj) {
switch(type){
case 'css':
var css = resObj;
for (var res in resArr) {
//means that you will find options.
if (typeof(resArr[res]) == "object") {
//console.info('fo... | javascript | function(type, resStr, resArr, resObj) {
switch(type){
case 'css':
var css = resObj;
for (var res in resArr) {
//means that you will find options.
if (typeof(resArr[res]) == "object") {
//console.info('fo... | [
"function",
"(",
"type",
",",
"resStr",
",",
"resArr",
",",
"resObj",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"'css'",
":",
"var",
"css",
"=",
"resObj",
";",
"for",
"(",
"var",
"res",
"in",
"resArr",
")",
"{",
"//means that you will find opt... | Get node resources
@param {string} type
@param {string} resStr
@param {array} resArr
@param {object} resObj
@return {object} content
@private | [
"Get",
"node",
"resources"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/controller/controller.js#L942-L989 | |
31,679 | Rhinostone/gina | core/controller/controller.js | function (i, res, files, cb) {
if (!files.length || files.length == 0) {
cb(false)
} else {
if ( fs.existsSync(files[i].target) ) new _(files[i].target).rmSync();
var sourceStream = fs.createReadStream(files[i].source);
var destinationStream = fs.createWr... | javascript | function (i, res, files, cb) {
if (!files.length || files.length == 0) {
cb(false)
} else {
if ( fs.existsSync(files[i].target) ) new _(files[i].target).rmSync();
var sourceStream = fs.createReadStream(files[i].source);
var destinationStream = fs.createWr... | [
"function",
"(",
"i",
",",
"res",
",",
"files",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"files",
".",
"length",
"||",
"files",
".",
"length",
"==",
"0",
")",
"{",
"cb",
"(",
"false",
")",
"}",
"else",
"{",
"if",
"(",
"fs",
".",
"existsSync",
"("... | Move files to assets dir
@param {object} res
@param {collection} files
@callback cb
@param {object} [err] | [
"Move",
"files",
"to",
"assets",
"dir"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/controller/controller.js#L1165-L1192 | |
31,680 | Rhinostone/gina | core/controller/controller.js | function(req) {
req.getParams = function() {
// copy
var params = JSON.parse(JSON.stringify(req.params));
switch( req.method.toLowerCase() ) {
case 'get':
params = merge(params, req.get, true);
break;
c... | javascript | function(req) {
req.getParams = function() {
// copy
var params = JSON.parse(JSON.stringify(req.params));
switch( req.method.toLowerCase() ) {
case 'get':
params = merge(params, req.get, true);
break;
c... | [
"function",
"(",
"req",
")",
"{",
"req",
".",
"getParams",
"=",
"function",
"(",
")",
"{",
"// copy",
"var",
"params",
"=",
"JSON",
".",
"parse",
"(",
"JSON",
".",
"stringify",
"(",
"req",
".",
"params",
")",
")",
";",
"switch",
"(",
"req",
".",
... | Get all Params | [
"Get",
"all",
"Params"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/controller/controller.js#L1542-L1591 | |
31,681 | Rhinostone/gina | core/controller/controller.js | function (code) {
var list = {}, cde = 'short', name = null;
if ( typeof(code) != 'undefined' && typeof(userLocales[0][code]) == 'string' ) {
cde = code
} else if ( typeof(code) != 'undefined' ) (
console.warn('`'+ code +'` not supported : sticking wi... | javascript | function (code) {
var list = {}, cde = 'short', name = null;
if ( typeof(code) != 'undefined' && typeof(userLocales[0][code]) == 'string' ) {
cde = code
} else if ( typeof(code) != 'undefined' ) (
console.warn('`'+ code +'` not supported : sticking wi... | [
"function",
"(",
"code",
")",
"{",
"var",
"list",
"=",
"{",
"}",
",",
"cde",
"=",
"'short'",
",",
"name",
"=",
"null",
";",
"if",
"(",
"typeof",
"(",
"code",
")",
"!=",
"'undefined'",
"&&",
"typeof",
"(",
"userLocales",
"[",
"0",
"]",
"[",
"code"... | Get countries list
@param {string} [code] - e.g.: short, long, fifa, m49
@return {object} countries - countries code & value list | [
"Get",
"countries",
"list"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/controller/controller.js#L1649-L1670 | |
31,682 | Rhinostone/gina | core/controller/controller.js | function (arr){
var tmp = null,
curObj = {},
obj = {},
count = 0,
data = {},
last = null;
for (var r in arr) {
tmp = r.split(".");
//Creating structure - Adding sub levels
for (var o in tmp) {
... | javascript | function (arr){
var tmp = null,
curObj = {},
obj = {},
count = 0,
data = {},
last = null;
for (var r in arr) {
tmp = r.split(".");
//Creating structure - Adding sub levels
for (var o in tmp) {
... | [
"function",
"(",
"arr",
")",
"{",
"var",
"tmp",
"=",
"null",
",",
"curObj",
"=",
"{",
"}",
",",
"obj",
"=",
"{",
"}",
",",
"count",
"=",
"0",
",",
"data",
"=",
"{",
"}",
",",
"last",
"=",
"null",
";",
"for",
"(",
"var",
"r",
"in",
"arr",
... | converting references to objects | [
"converting",
"references",
"to",
"objects"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/controller/controller.js#L1816-L1854 | |
31,683 | invisible-tech/mongoose-extras | customAsserts/documentAssertions.js | assertSameObjectIdArray | function assertSameObjectIdArray(actual, expected, msg) {
assert(Array.isArray(actual), 'assertSameObjectIdArray: First argument is not an Array.')
assert(Array.isArray(expected), 'assertSameObjectIdArray: Second argument is not an Array.')
assert(size(actual) > 0 || size(expected) > 0, 'assertSameObjectIdArray: ... | javascript | function assertSameObjectIdArray(actual, expected, msg) {
assert(Array.isArray(actual), 'assertSameObjectIdArray: First argument is not an Array.')
assert(Array.isArray(expected), 'assertSameObjectIdArray: Second argument is not an Array.')
assert(size(actual) > 0 || size(expected) > 0, 'assertSameObjectIdArray: ... | [
"function",
"assertSameObjectIdArray",
"(",
"actual",
",",
"expected",
",",
"msg",
")",
"{",
"assert",
"(",
"Array",
".",
"isArray",
"(",
"actual",
")",
",",
"'assertSameObjectIdArray: First argument is not an Array.'",
")",
"assert",
"(",
"Array",
".",
"isArray",
... | Throws if the given actual and expected arrays of ObjectIds don't match.
@method assertSameDocumentIdArray
@param {ObjectId[]} actual - Array of ObjectId
@param {ObjectId[]} expected - Array of ObjectId
@param {String} msg - Optional custom error message
@return {undefined} - Throws if assertions fail | [
"Throws",
"if",
"the",
"given",
"actual",
"and",
"expected",
"arrays",
"of",
"ObjectIds",
"don",
"t",
"match",
"."
] | 9b572554a292ead1644b0afa3fc5a5b382d5dec9 | https://github.com/invisible-tech/mongoose-extras/blob/9b572554a292ead1644b0afa3fc5a5b382d5dec9/customAsserts/documentAssertions.js#L73-L82 |
31,684 | Rhinostone/gina | script/pre_install.js | PreInstall | function PreInstall() {
var self = this;
var init = function() {
self.isWin32 = ( os.platform() == 'win32' ) ? true : false;
self.path = __dirname.substring(0, (__dirname.length - 'script'.length));
console.debug('paths -> '+ self.path);
if ( hasNodeModulesSync() ) { // cleain... | javascript | function PreInstall() {
var self = this;
var init = function() {
self.isWin32 = ( os.platform() == 'win32' ) ? true : false;
self.path = __dirname.substring(0, (__dirname.length - 'script'.length));
console.debug('paths -> '+ self.path);
if ( hasNodeModulesSync() ) { // cleain... | [
"function",
"PreInstall",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"init",
"=",
"function",
"(",
")",
"{",
"self",
".",
"isWin32",
"=",
"(",
"os",
".",
"platform",
"(",
")",
"==",
"'win32'",
")",
"?",
"true",
":",
"false",
";",
"sel... | Pre install constructor
@constructor | [
"Pre",
"install",
"constructor"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/script/pre_install.js#L24-L61 |
31,685 | Rhinostone/gina | core/plugins/lib/validator/src/main.js | function($form) {
var $form = $form, _id = null;
if ( typeof($form) == 'undefined' ) {
if ( typeof(this.target) != 'undefined' ) {
_id = this.target.getAttribute('id');
} else {
_id = this.getAttribute('id');
}
$form = inst... | javascript | function($form) {
var $form = $form, _id = null;
if ( typeof($form) == 'undefined' ) {
if ( typeof(this.target) != 'undefined' ) {
_id = this.target.getAttribute('id');
} else {
_id = this.getAttribute('id');
}
$form = inst... | [
"function",
"(",
"$form",
")",
"{",
"var",
"$form",
"=",
"$form",
",",
"_id",
"=",
"null",
";",
"if",
"(",
"typeof",
"(",
"$form",
")",
"==",
"'undefined'",
")",
"{",
"if",
"(",
"typeof",
"(",
"this",
".",
"target",
")",
"!=",
"'undefined'",
")",
... | Reset errors display
@param {object|string} [$form|formId] | [
"Reset",
"errors",
"display"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/plugins/lib/validator/src/main.js#L392-L416 | |
31,686 | Rhinostone/gina | core/plugins/lib/validator/src/main.js | function(rules, tmp) {
var _r = null;
for (var r in rules) {
if ( typeof(rules[r]) == 'object' && typeof(instance.rules[tmp + r]) == 'undefined' ) {
_r = r;
if (/\[|\]/.test(r) ) { // must be a real path
_r = r.replace(/\[/g, '.').replace... | javascript | function(rules, tmp) {
var _r = null;
for (var r in rules) {
if ( typeof(rules[r]) == 'object' && typeof(instance.rules[tmp + r]) == 'undefined' ) {
_r = r;
if (/\[|\]/.test(r) ) { // must be a real path
_r = r.replace(/\[/g, '.').replace... | [
"function",
"(",
"rules",
",",
"tmp",
")",
"{",
"var",
"_r",
"=",
"null",
";",
"for",
"(",
"var",
"r",
"in",
"rules",
")",
"{",
"if",
"(",
"typeof",
"(",
"rules",
"[",
"r",
"]",
")",
"==",
"'object'",
"&&",
"typeof",
"(",
"instance",
".",
"rule... | parseRules - Preparing rules paths
@param {object} rules
@param {string} tmp - path | [
"parseRules",
"-",
"Preparing",
"rules",
"paths"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/plugins/lib/validator/src/main.js#L1103-L1119 | |
31,687 | Kronos-Integration/kronos-interceptor-object-data-processor-row | lib/converter/data-field-splitter.js | createSplitterForField | function createSplitterForField(multiFieldDefinitionPart, fieldName) {
if (multiFieldDefinitionPart === undefined) {
throw ("'multiFieldDefinitionPart' must not be undefined");
}
if (fieldName === undefined) {
throw ("'fieldName' must not be undefined");
}
const delimiter = multiFieldDefinitionPart.delimiter... | javascript | function createSplitterForField(multiFieldDefinitionPart, fieldName) {
if (multiFieldDefinitionPart === undefined) {
throw ("'multiFieldDefinitionPart' must not be undefined");
}
if (fieldName === undefined) {
throw ("'fieldName' must not be undefined");
}
const delimiter = multiFieldDefinitionPart.delimiter... | [
"function",
"createSplitterForField",
"(",
"multiFieldDefinitionPart",
",",
"fieldName",
")",
"{",
"if",
"(",
"multiFieldDefinitionPart",
"===",
"undefined",
")",
"{",
"throw",
"(",
"\"'multiFieldDefinitionPart' must not be undefined\"",
")",
";",
"}",
"if",
"(",
"field... | Create the field spliter for a given field definition
The field must be a multiField.
@param multiFieldDefinitionPart The multiField part of aa field definition for one field.
@param fieldName The name of the current multiField | [
"Create",
"the",
"field",
"spliter",
"for",
"a",
"given",
"field",
"definition",
"The",
"field",
"must",
"be",
"a",
"multiField",
"."
] | 678a59b84dab4a9082377c90849a0d62d97a1ea4 | https://github.com/Kronos-Integration/kronos-interceptor-object-data-processor-row/blob/678a59b84dab4a9082377c90849a0d62d97a1ea4/lib/converter/data-field-splitter.js#L28-L146 |
31,688 | AlCalzone/shared-utils | build/sorted-list/index.js | findPrevNode | function findPrevNode(firstNode, item, comparer) {
let ret;
let prevNode = firstNode;
// while item > prevNode.value
while (prevNode != undefined && comparer(prevNode.value, item) > 0) {
ret = prevNode;
prevNode = prevNode.next;
}
return ret;
} | javascript | function findPrevNode(firstNode, item, comparer) {
let ret;
let prevNode = firstNode;
// while item > prevNode.value
while (prevNode != undefined && comparer(prevNode.value, item) > 0) {
ret = prevNode;
prevNode = prevNode.next;
}
return ret;
} | [
"function",
"findPrevNode",
"(",
"firstNode",
",",
"item",
",",
"comparer",
")",
"{",
"let",
"ret",
";",
"let",
"prevNode",
"=",
"firstNode",
";",
"// while item > prevNode.value",
"while",
"(",
"prevNode",
"!=",
"undefined",
"&&",
"comparer",
"(",
"prevNode",
... | Seeks the list from the beginning and finds the position to add the new item | [
"Seeks",
"the",
"list",
"from",
"the",
"beginning",
"and",
"finds",
"the",
"position",
"to",
"add",
"the",
"new",
"item"
] | 9048e1f8793909fae7acb503984a4d8aadad4f3b | https://github.com/AlCalzone/shared-utils/blob/9048e1f8793909fae7acb503984a4d8aadad4f3b/build/sorted-list/index.js#L8-L17 |
31,689 | AlCalzone/shared-utils | build/sorted-list/index.js | findNode | function findNode(firstNode, predicate) {
let curNode = firstNode;
while (curNode != null) {
if (predicate(curNode.value))
return curNode;
curNode = curNode.next;
}
} | javascript | function findNode(firstNode, predicate) {
let curNode = firstNode;
while (curNode != null) {
if (predicate(curNode.value))
return curNode;
curNode = curNode.next;
}
} | [
"function",
"findNode",
"(",
"firstNode",
",",
"predicate",
")",
"{",
"let",
"curNode",
"=",
"firstNode",
";",
"while",
"(",
"curNode",
"!=",
"null",
")",
"{",
"if",
"(",
"predicate",
"(",
"curNode",
".",
"value",
")",
")",
"return",
"curNode",
";",
"c... | Seeks the list from the beginning and returns the first item matching the given predicate | [
"Seeks",
"the",
"list",
"from",
"the",
"beginning",
"and",
"returns",
"the",
"first",
"item",
"matching",
"the",
"given",
"predicate"
] | 9048e1f8793909fae7acb503984a4d8aadad4f3b | https://github.com/AlCalzone/shared-utils/blob/9048e1f8793909fae7acb503984a4d8aadad4f3b/build/sorted-list/index.js#L21-L28 |
31,690 | Kronos-Integration/kronos-interceptor-object-data-processor-row | lib/recordCheck/data-check-string-email.js | createCheckEmail | function createCheckEmail(fieldDefinition, fieldName) {
const severity = propertyHelper.getSeverity(fieldDefinition);
// return getIteratorFunction: function (fieldName, defaultValue, checkProperties, checkFunction, getErrorFunction,
// getValueIfErrorFunction, getValueIfOkFunction) {
let errorInfo = {
s... | javascript | function createCheckEmail(fieldDefinition, fieldName) {
const severity = propertyHelper.getSeverity(fieldDefinition);
// return getIteratorFunction: function (fieldName, defaultValue, checkProperties, checkFunction, getErrorFunction,
// getValueIfErrorFunction, getValueIfOkFunction) {
let errorInfo = {
s... | [
"function",
"createCheckEmail",
"(",
"fieldDefinition",
",",
"fieldName",
")",
"{",
"const",
"severity",
"=",
"propertyHelper",
".",
"getSeverity",
"(",
"fieldDefinition",
")",
";",
"// return getIteratorFunction: function (fieldName, defaultValue, checkProperties, checkFunction,... | Checks if a given string looks like a valid email.
@param fieldDefinition The field_definition for this field.
@param fieldName The name of the current field
@return The check | [
"Checks",
"if",
"a",
"given",
"string",
"looks",
"like",
"a",
"valid",
"email",
"."
] | 678a59b84dab4a9082377c90849a0d62d97a1ea4 | https://github.com/Kronos-Integration/kronos-interceptor-object-data-processor-row/blob/678a59b84dab4a9082377c90849a0d62d97a1ea4/lib/recordCheck/data-check-string-email.js#L45-L58 |
31,691 | Kronos-Integration/kronos-interceptor-object-data-processor-row | lib/recordCheck/data-check-string-email.js | createCheckDefaultValue | function createCheckDefaultValue(fieldDefinition, fieldName) {
const defaultValue = fieldDefinition.defaultValue;
// -----------------------------------------------------------------------
// Set default value
// -----------------------------------------------------------------------
return function (content... | javascript | function createCheckDefaultValue(fieldDefinition, fieldName) {
const defaultValue = fieldDefinition.defaultValue;
// -----------------------------------------------------------------------
// Set default value
// -----------------------------------------------------------------------
return function (content... | [
"function",
"createCheckDefaultValue",
"(",
"fieldDefinition",
",",
"fieldName",
")",
"{",
"const",
"defaultValue",
"=",
"fieldDefinition",
".",
"defaultValue",
";",
"// -----------------------------------------------------------------------",
"// Set default value",
"// ----------... | Set the default value if no value is there
@param fieldDefinition The field_definition for this field.
@param fieldName The name of the current field
@return checks A list of checks to be perfomred | [
"Set",
"the",
"default",
"value",
"if",
"no",
"value",
"is",
"there"
] | 678a59b84dab4a9082377c90849a0d62d97a1ea4 | https://github.com/Kronos-Integration/kronos-interceptor-object-data-processor-row/blob/678a59b84dab4a9082377c90849a0d62d97a1ea4/lib/recordCheck/data-check-string-email.js#L66-L90 |
31,692 | Rhinostone/gina | core/utils/helpers/dateFormat.js | function (format) {
var name = "default";
for (var f in self.masks) {
if ( self.masks[f] === format )
return f
}
return name
} | javascript | function (format) {
var name = "default";
for (var f in self.masks) {
if ( self.masks[f] === format )
return f
}
return name
} | [
"function",
"(",
"format",
")",
"{",
"var",
"name",
"=",
"\"default\"",
";",
"for",
"(",
"var",
"f",
"in",
"self",
".",
"masks",
")",
"{",
"if",
"(",
"self",
".",
"masks",
"[",
"f",
"]",
"===",
"format",
")",
"return",
"f",
"}",
"return",
"name",... | Get mask name from a given format
@param {string} format
@return {string} maskName | [
"Get",
"mask",
"name",
"from",
"a",
"given",
"format"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/utils/helpers/dateFormat.js#L143-L153 | |
31,693 | Rhinostone/gina | core/utils/helpers/dateFormat.js | function(date, dateTo) {
if ( dateTo instanceof Date) {
// The number of milliseconds in one day
var oneDay = 1000 * 60 * 60 * 24
// Convert both dates to milliseconds
var date1Ms = date.getTime()
var date2Ms = dateTo.getTime()
// Calcul... | javascript | function(date, dateTo) {
if ( dateTo instanceof Date) {
// The number of milliseconds in one day
var oneDay = 1000 * 60 * 60 * 24
// Convert both dates to milliseconds
var date1Ms = date.getTime()
var date2Ms = dateTo.getTime()
// Calcul... | [
"function",
"(",
"date",
",",
"dateTo",
")",
"{",
"if",
"(",
"dateTo",
"instanceof",
"Date",
")",
"{",
"// The number of milliseconds in one day",
"var",
"oneDay",
"=",
"1000",
"*",
"60",
"*",
"60",
"*",
"24",
"// Convert both dates to milliseconds",
"var",
"dat... | Count days from the current date to another
TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
@param {object} dateTo
@return {number} count | [
"Count",
"days",
"from",
"the",
"current",
"date",
"to",
"another"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/utils/helpers/dateFormat.js#L165-L183 | |
31,694 | Rhinostone/gina | core/utils/helpers/dateFormat.js | function(date, dateTo, mask) {
if ( dateTo instanceof Date) {
var count = countDaysTo(date, dateTo)
, month = date.getMonth()
, year = date.getFullYear()
, day = date.getDate() + 1
, dateObj = new Date(year, mont... | javascript | function(date, dateTo, mask) {
if ( dateTo instanceof Date) {
var count = countDaysTo(date, dateTo)
, month = date.getMonth()
, year = date.getFullYear()
, day = date.getDate() + 1
, dateObj = new Date(year, mont... | [
"function",
"(",
"date",
",",
"dateTo",
",",
"mask",
")",
"{",
"if",
"(",
"dateTo",
"instanceof",
"Date",
")",
"{",
"var",
"count",
"=",
"countDaysTo",
"(",
"date",
",",
"dateTo",
")",
",",
"month",
"=",
"date",
".",
"getMonth",
"(",
")",
",",
"yea... | Will give an array of dates between the current date to a targeted date
TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
@param {object} dateTo
@param {string} [ mask ]
@return {array} dates | [
"Will",
"give",
"an",
"array",
"of",
"dates",
"between",
"the",
"current",
"date",
"to",
"a",
"targeted",
"date"
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/utils/helpers/dateFormat.js#L196-L221 | |
31,695 | dowjones/distribucache | lib/decorators/BaseDecorator.js | BaseDecorator | function BaseDecorator(cache, config, configSchema) {
this._cache = cache;
if (config) {
this._configSchema = configSchema;
this._config = this._humanTimeIntervalToMs(config);
this._config = this._validateConfig(configSchema, this._config);
}
// substitute cb, for cases
// when you don't need a ... | javascript | function BaseDecorator(cache, config, configSchema) {
this._cache = cache;
if (config) {
this._configSchema = configSchema;
this._config = this._humanTimeIntervalToMs(config);
this._config = this._validateConfig(configSchema, this._config);
}
// substitute cb, for cases
// when you don't need a ... | [
"function",
"BaseDecorator",
"(",
"cache",
",",
"config",
",",
"configSchema",
")",
"{",
"this",
".",
"_cache",
"=",
"cache",
";",
"if",
"(",
"config",
")",
"{",
"this",
".",
"_configSchema",
"=",
"configSchema",
";",
"this",
".",
"_config",
"=",
"this",... | The root of the Decorator tree
@constructor | [
"The",
"root",
"of",
"the",
"Decorator",
"tree"
] | ad79caee277771a6e49ee4a98c4983480cd89945 | https://github.com/dowjones/distribucache/blob/ad79caee277771a6e49ee4a98c4983480cd89945/lib/decorators/BaseDecorator.js#L12-L27 |
31,696 | Rhinostone/gina | core/utils/lib/merge/src/main.js | function (obj) {
if (
!obj
|| {}.toString.call(obj) !== '[object Object]'
|| obj.nodeType
|| obj.setInterval
) {
return false
}
var hasOwn = {}.hasOwnProperty;
var hasOwnConstructor = hasOwn.call(obj, 'co... | javascript | function (obj) {
if (
!obj
|| {}.toString.call(obj) !== '[object Object]'
|| obj.nodeType
|| obj.setInterval
) {
return false
}
var hasOwn = {}.hasOwnProperty;
var hasOwnConstructor = hasOwn.call(obj, 'co... | [
"function",
"(",
"obj",
")",
"{",
"if",
"(",
"!",
"obj",
"||",
"{",
"}",
".",
"toString",
".",
"call",
"(",
"obj",
")",
"!==",
"'[object Object]'",
"||",
"obj",
".",
"nodeType",
"||",
"obj",
".",
"setInterval",
")",
"{",
"return",
"false",
"}",
"va... | Check if object before merging. | [
"Check",
"if",
"object",
"before",
"merging",
"."
] | c6ba13d3255a43734c54880ff12d3a50df53ebea | https://github.com/Rhinostone/gina/blob/c6ba13d3255a43734c54880ff12d3a50df53ebea/core/utils/lib/merge/src/main.js#L307-L333 | |
31,697 | kevinoid/promise-nodeify | index.js | doCallback | function doCallback(callback, reason, value) {
// Note: Could delay callback call until later, as When.js does, but this
// loses the stack (particularly for bluebird long traces) and causes
// unnecessary delay in the non-exception (common) case.
try {
// Match argument length to resolve/reject in case ca... | javascript | function doCallback(callback, reason, value) {
// Note: Could delay callback call until later, as When.js does, but this
// loses the stack (particularly for bluebird long traces) and causes
// unnecessary delay in the non-exception (common) case.
try {
// Match argument length to resolve/reject in case ca... | [
"function",
"doCallback",
"(",
"callback",
",",
"reason",
",",
"value",
")",
"{",
"// Note: Could delay callback call until later, as When.js does, but this",
"// loses the stack (particularly for bluebird long traces) and causes",
"// unnecessary delay in the non-exception (common) case.",... | Invokes callback and ensures any exceptions thrown are uncaught.
@private | [
"Invokes",
"callback",
"and",
"ensures",
"any",
"exceptions",
"thrown",
"are",
"uncaught",
"."
] | 1542cb7824c1b5e0e19e925dfb9650bfe8c7cdbd | https://github.com/kevinoid/promise-nodeify/blob/1542cb7824c1b5e0e19e925dfb9650bfe8c7cdbd/index.js#L20-L37 |
31,698 | kevinoid/promise-nodeify | index.js | promiseNodeify | function promiseNodeify(promise, callback) {
if (typeof callback !== 'function') {
return promise;
}
function onRejected(reason) {
// callback is unlikely to recognize or expect a falsey error.
// (we also rely on truthyness for arguments.length in doCallback)
// Convert it to something truthy
... | javascript | function promiseNodeify(promise, callback) {
if (typeof callback !== 'function') {
return promise;
}
function onRejected(reason) {
// callback is unlikely to recognize or expect a falsey error.
// (we also rely on truthyness for arguments.length in doCallback)
// Convert it to something truthy
... | [
"function",
"promiseNodeify",
"(",
"promise",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"callback",
"!==",
"'function'",
")",
"{",
"return",
"promise",
";",
"}",
"function",
"onRejected",
"(",
"reason",
")",
"{",
"// callback is unlikely to recognize or expe... | Calls a node-style callback when a Promise is resolved or rejected.
This function provides the behavior of
{@link https://github.com/then/nodeify then <code>nodeify</code>},
{@link
https://github.com/cujojs/when/blob/master/docs/api.md#nodebindcallback
when.js <code>node.bindCallback</code>},
or {@link http://bluebird... | [
"Calls",
"a",
"node",
"-",
"style",
"callback",
"when",
"a",
"Promise",
"is",
"resolved",
"or",
"rejected",
"."
] | 1542cb7824c1b5e0e19e925dfb9650bfe8c7cdbd | https://github.com/kevinoid/promise-nodeify/blob/1542cb7824c1b5e0e19e925dfb9650bfe8c7cdbd/index.js#L63-L90 |
31,699 | Gi60s/binary-case | index.js | getBinaryCase | function getBinaryCase (str, val) {
let res = '';
for (let i = 0; i < str.length; i++) {
const code = str.charCodeAt(i);
if (code >= 65 && code <= 90) {
res += val & 1 ? String.fromCharCode(code + 32) : String.fromCharCode(code);
val >>>= 1;
} else if (code >= 9... | javascript | function getBinaryCase (str, val) {
let res = '';
for (let i = 0; i < str.length; i++) {
const code = str.charCodeAt(i);
if (code >= 65 && code <= 90) {
res += val & 1 ? String.fromCharCode(code + 32) : String.fromCharCode(code);
val >>>= 1;
} else if (code >= 9... | [
"function",
"getBinaryCase",
"(",
"str",
",",
"val",
")",
"{",
"let",
"res",
"=",
"''",
";",
"for",
"(",
"let",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
";",
"i",
"++",
")",
"{",
"const",
"code",
"=",
"str",
".",
"charCodeAt",
"(",
... | A performance improved method for acquiring the binary case, provided by Blake Embrey with very minor modification by James Speirs.
@author Blake Embrey | https://github.com/blakeembrey
@author James Speirs | https://github.com/gi60s
@param {string} str
@param {number} val
@returns {string} | [
"A",
"performance",
"improved",
"method",
"for",
"acquiring",
"the",
"binary",
"case",
"provided",
"by",
"Blake",
"Embrey",
"with",
"very",
"minor",
"modification",
"by",
"James",
"Speirs",
"."
] | a53af5c542b936d6c1329895dd9b93556024d132 | https://github.com/Gi60s/binary-case/blob/a53af5c542b936d6c1329895dd9b93556024d132/index.js#L86-L108 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.