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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,500 | bbc/waveform-data.js | lib/core.js | setSegment | function setSegment(start, end, identifier) {
if (identifier === undefined || identifier === null || identifier.length === 0) {
identifier = "default";
}
this.segments[identifier] = new WaveformDataSegment(this, start, end);
return this.segments[identifier];
} | javascript | function setSegment(start, end, identifier) {
if (identifier === undefined || identifier === null || identifier.length === 0) {
identifier = "default";
}
this.segments[identifier] = new WaveformDataSegment(this, start, end);
return this.segments[identifier];
} | [
"function",
"setSegment",
"(",
"start",
",",
"end",
",",
"identifier",
")",
"{",
"if",
"(",
"identifier",
"===",
"undefined",
"||",
"identifier",
"===",
"null",
"||",
"identifier",
".",
"length",
"===",
"0",
")",
"{",
"identifier",
"=",
"\"default\"",
";",... | Creates a new segment of data.
Pretty handy if you need to bookmark a duration and display it according
to the current offset.
```javascript
var waveform = WaveformData.create({ ... });
console.log(Object.keys(waveform.segments)); // -> []
waveform.set_segment(10, 120);
waveform.set_segment(30, 90, "speaker... | [
"Creates",
"a",
"new",
"segment",
"of",
"data",
".",
"Pretty",
"handy",
"if",
"you",
"need",
"to",
"bookmark",
"a",
"duration",
"and",
"display",
"it",
"according",
"to",
"the",
"current",
"offset",
"."
] | 64967ad58aac527642be193eee916698df521efa | https://github.com/bbc/waveform-data.js/blob/64967ad58aac527642be193eee916698df521efa/lib/core.js#L210-L218 |
15,501 | bbc/waveform-data.js | lib/core.js | setPoint | function setPoint(timeStamp, identifier) {
if (identifier === undefined || identifier === null || identifier.length === 0) {
identifier = "default";
}
this.points[identifier] = new WaveformDataPoint(this, timeStamp);
return this.points[identifier];
} | javascript | function setPoint(timeStamp, identifier) {
if (identifier === undefined || identifier === null || identifier.length === 0) {
identifier = "default";
}
this.points[identifier] = new WaveformDataPoint(this, timeStamp);
return this.points[identifier];
} | [
"function",
"setPoint",
"(",
"timeStamp",
",",
"identifier",
")",
"{",
"if",
"(",
"identifier",
"===",
"undefined",
"||",
"identifier",
"===",
"null",
"||",
"identifier",
".",
"length",
"===",
"0",
")",
"{",
"identifier",
"=",
"\"default\"",
";",
"}",
"thi... | Creates a new point of data.
Pretty handy if you need to bookmark a specific point and display it
according to the current offset.
```javascript
var waveform = WaveformData.create({ ... });
console.log(Object.keys(waveform.points)); // -> []
waveform.set_point(10);
waveform.set_point(30, "speakerA");
console.log(Ob... | [
"Creates",
"a",
"new",
"point",
"of",
"data",
".",
"Pretty",
"handy",
"if",
"you",
"need",
"to",
"bookmark",
"a",
"specific",
"point",
"and",
"display",
"it",
"according",
"to",
"the",
"current",
"offset",
"."
] | 64967ad58aac527642be193eee916698df521efa | https://github.com/bbc/waveform-data.js/blob/64967ad58aac527642be193eee916698df521efa/lib/core.js#L242-L250 |
15,502 | bbc/waveform-data.js | lib/core.js | getOffsetValues | function getOffsetValues(start, length, correction) {
var adapter = this.adapter;
var values = [];
correction += (start * 2); // offset the positioning query
for (var i = 0; i < length; i++) {
values.push(adapter.at((i * 2) + correction));
}
return values;
} | javascript | function getOffsetValues(start, length, correction) {
var adapter = this.adapter;
var values = [];
correction += (start * 2); // offset the positioning query
for (var i = 0; i < length; i++) {
values.push(adapter.at((i * 2) + correction));
}
return values;
} | [
"function",
"getOffsetValues",
"(",
"start",
",",
"length",
",",
"correction",
")",
"{",
"var",
"adapter",
"=",
"this",
".",
"adapter",
";",
"var",
"values",
"=",
"[",
"]",
";",
"correction",
"+=",
"(",
"start",
"*",
"2",
")",
";",
"// offset the positio... | Return the unpacked values for a particular offset.
@param {Integer} start
@param {Integer} length
@param {Integer} correction The step to skip for each iteration
(as the response body is [min, max, min, max...])
@return {Array.<Integer>} | [
"Return",
"the",
"unpacked",
"values",
"for",
"a",
"particular",
"offset",
"."
] | 64967ad58aac527642be193eee916698df521efa | https://github.com/bbc/waveform-data.js/blob/64967ad58aac527642be193eee916698df521efa/lib/core.js#L502-L513 |
15,503 | bbc/waveform-data.js | lib/builders/webaudio.js | fromAudioObjectBuilder | function fromAudioObjectBuilder(audio_context, raw_response, options, callback) {
var audioContext = window.AudioContext || window.webkitAudioContext;
if (!(audio_context instanceof audioContext)) {
throw new TypeError("First argument should be an AudioContext instance");
}
var opts = getOptions(options, ... | javascript | function fromAudioObjectBuilder(audio_context, raw_response, options, callback) {
var audioContext = window.AudioContext || window.webkitAudioContext;
if (!(audio_context instanceof audioContext)) {
throw new TypeError("First argument should be an AudioContext instance");
}
var opts = getOptions(options, ... | [
"function",
"fromAudioObjectBuilder",
"(",
"audio_context",
",",
"raw_response",
",",
"options",
",",
"callback",
")",
"{",
"var",
"audioContext",
"=",
"window",
".",
"AudioContext",
"||",
"window",
".",
"webkitAudioContext",
";",
"if",
"(",
"!",
"(",
"audio_con... | Creates a working WaveformData based on binary audio data.
This is still quite experimental and the result will mostly depend on the
level of browser support.
```javascript
const xhr = new XMLHttpRequest();
const audioContext = new AudioContext();
// URL of a CORS MP3/Ogg file
xhr.open('GET', 'https://example.com/au... | [
"Creates",
"a",
"working",
"WaveformData",
"based",
"on",
"binary",
"audio",
"data",
"."
] | 64967ad58aac527642be193eee916698df521efa | https://github.com/bbc/waveform-data.js/blob/64967ad58aac527642be193eee916698df521efa/lib/builders/webaudio.js#L44-L73 |
15,504 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | ADD_LOCALE | function ADD_LOCALE(state, payload) {
// reduce the given translations to a single-depth tree
var translations = flattenTranslations(payload.translations);
if (state.translations.hasOwnProperty(payload.locale)) {
// get the existing translations
var existingTranslations = state.transl... | javascript | function ADD_LOCALE(state, payload) {
// reduce the given translations to a single-depth tree
var translations = flattenTranslations(payload.translations);
if (state.translations.hasOwnProperty(payload.locale)) {
// get the existing translations
var existingTranslations = state.transl... | [
"function",
"ADD_LOCALE",
"(",
"state",
",",
"payload",
")",
"{",
"// reduce the given translations to a single-depth tree",
"var",
"translations",
"=",
"flattenTranslations",
"(",
"payload",
".",
"translations",
")",
";",
"if",
"(",
"state",
".",
"translations",
".",... | add a new locale | [
"add",
"a",
"new",
"locale"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L33-L53 |
15,505 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | REPLACE_LOCALE | function REPLACE_LOCALE(state, payload) {
// reduce the given translations to a single-depth tree
var translations = flattenTranslations(payload.translations); // replace the translations entirely
state.translations[payload.locale] = translations; // make sure to notify vue of changes (this might bre... | javascript | function REPLACE_LOCALE(state, payload) {
// reduce the given translations to a single-depth tree
var translations = flattenTranslations(payload.translations); // replace the translations entirely
state.translations[payload.locale] = translations; // make sure to notify vue of changes (this might bre... | [
"function",
"REPLACE_LOCALE",
"(",
"state",
",",
"payload",
")",
"{",
"// reduce the given translations to a single-depth tree",
"var",
"translations",
"=",
"flattenTranslations",
"(",
"payload",
".",
"translations",
")",
";",
"// replace the translations entirely",
"state",
... | replace existing locale information with new translations | [
"replace",
"existing",
"locale",
"information",
"with",
"new",
"translations"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L55-L66 |
15,506 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | REMOVE_LOCALE | function REMOVE_LOCALE(state, payload) {
// check if the given locale is present in the state
if (state.translations.hasOwnProperty(payload.locale)) {
// check if the current locale is the given locale to remvoe
if (state.locale === payload.locale) {
// reset the current locale
... | javascript | function REMOVE_LOCALE(state, payload) {
// check if the given locale is present in the state
if (state.translations.hasOwnProperty(payload.locale)) {
// check if the current locale is the given locale to remvoe
if (state.locale === payload.locale) {
// reset the current locale
... | [
"function",
"REMOVE_LOCALE",
"(",
"state",
",",
"payload",
")",
"{",
"// check if the given locale is present in the state",
"if",
"(",
"state",
".",
"translations",
".",
"hasOwnProperty",
"(",
"payload",
".",
"locale",
")",
")",
"{",
"// check if the current locale is ... | remove a locale from the store | [
"remove",
"a",
"locale",
"from",
"the",
"store"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L68-L84 |
15,507 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | addLocale | function addLocale(context, payload) {
context.commit({
type: 'ADD_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | javascript | function addLocale(context, payload) {
context.commit({
type: 'ADD_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | [
"function",
"addLocale",
"(",
"context",
",",
"payload",
")",
"{",
"context",
".",
"commit",
"(",
"{",
"type",
":",
"'ADD_LOCALE'",
",",
"locale",
":",
"payload",
".",
"locale",
",",
"translations",
":",
"payload",
".",
"translations",
"}",
")",
";",
"}"... | add or extend a locale with translations | [
"add",
"or",
"extend",
"a",
"locale",
"with",
"translations"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L98-L104 |
15,508 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | replaceLocale | function replaceLocale(context, payload) {
context.commit({
type: 'REPLACE_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | javascript | function replaceLocale(context, payload) {
context.commit({
type: 'REPLACE_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | [
"function",
"replaceLocale",
"(",
"context",
",",
"payload",
")",
"{",
"context",
".",
"commit",
"(",
"{",
"type",
":",
"'REPLACE_LOCALE'",
",",
"locale",
":",
"payload",
".",
"locale",
",",
"translations",
":",
"payload",
".",
"translations",
"}",
")",
";... | replace locale information | [
"replace",
"locale",
"information"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L106-L112 |
15,509 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | removeLocale | function removeLocale(context, payload) {
context.commit({
type: 'REMOVE_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | javascript | function removeLocale(context, payload) {
context.commit({
type: 'REMOVE_LOCALE',
locale: payload.locale,
translations: payload.translations
});
} | [
"function",
"removeLocale",
"(",
"context",
",",
"payload",
")",
"{",
"context",
".",
"commit",
"(",
"{",
"type",
":",
"'REMOVE_LOCALE'",
",",
"locale",
":",
"payload",
".",
"locale",
",",
"translations",
":",
"payload",
".",
"translations",
"}",
")",
";",... | remove the given locale translations | [
"remove",
"the",
"given",
"locale",
"translations"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L114-L120 |
15,510 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | flattenTranslations | function flattenTranslations(translations) {
var toReturn = {};
for (var i in translations) {
// check if the property is present
if (!translations.hasOwnProperty(i)) {
continue;
} // get the type of the property
var objType = _typeof(translations[i]); // allow unflattened array of strings
... | javascript | function flattenTranslations(translations) {
var toReturn = {};
for (var i in translations) {
// check if the property is present
if (!translations.hasOwnProperty(i)) {
continue;
} // get the type of the property
var objType = _typeof(translations[i]); // allow unflattened array of strings
... | [
"function",
"flattenTranslations",
"(",
"translations",
")",
"{",
"var",
"toReturn",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"in",
"translations",
")",
"{",
"// check if the property is present",
"if",
"(",
"!",
"translations",
".",
"hasOwnProperty",
"(",
... | flattenTranslations will convert object trees for translations into a single-depth object tree | [
"flattenTranslations",
"will",
"convert",
"object",
"trees",
"for",
"translations",
"into",
"a",
"single",
"-",
"depth",
"object",
"tree"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L131-L170 |
15,511 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | $t | function $t() {
// get the current language from the store
var locale = store.state[moduleName].locale;
return translateInLanguage.apply(void 0, [locale].concat(Array.prototype.slice.call(arguments)));
} | javascript | function $t() {
// get the current language from the store
var locale = store.state[moduleName].locale;
return translateInLanguage.apply(void 0, [locale].concat(Array.prototype.slice.call(arguments)));
} | [
"function",
"$t",
"(",
")",
"{",
"// get the current language from the store",
"var",
"locale",
"=",
"store",
".",
"state",
"[",
"moduleName",
"]",
".",
"locale",
";",
"return",
"translateInLanguage",
".",
"apply",
"(",
"void",
"0",
",",
"[",
"locale",
"]",
... | get localized string from store. note that we pass the arguments passed to the function directly to the translateInLanguage function | [
"get",
"localized",
"string",
"from",
"store",
".",
"note",
"that",
"we",
"pass",
"the",
"arguments",
"passed",
"to",
"the",
"function",
"directly",
"to",
"the",
"translateInLanguage",
"function"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L453-L457 |
15,512 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | checkKeyExists | function checkKeyExists(key) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fallback';
// get the current language from the store
var locale = store.state[moduleName].locale;
var fallback = store.state[moduleName].fallback;
var translations = store.state[moduleNam... | javascript | function checkKeyExists(key) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fallback';
// get the current language from the store
var locale = store.state[moduleName].locale;
var fallback = store.state[moduleName].fallback;
var translations = store.state[moduleNam... | [
"function",
"checkKeyExists",
"(",
"key",
")",
"{",
"var",
"scope",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"'fallback'",
";",
"// get the current language from th... | check if the given key exists in the current locale | [
"check",
"if",
"the",
"given",
"key",
"exists",
"in",
"the",
"current",
"locale"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L568-L601 |
15,513 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | replaceLocale | function replaceLocale(locale, translations) {
return store.dispatch({
type: "".concat(moduleName, "/replaceLocale"),
locale: locale,
translations: translations
});
} | javascript | function replaceLocale(locale, translations) {
return store.dispatch({
type: "".concat(moduleName, "/replaceLocale"),
locale: locale,
translations: translations
});
} | [
"function",
"replaceLocale",
"(",
"locale",
",",
"translations",
")",
"{",
"return",
"store",
".",
"dispatch",
"(",
"{",
"type",
":",
"\"\"",
".",
"concat",
"(",
"moduleName",
",",
"\"/replaceLocale\"",
")",
",",
"locale",
":",
"locale",
",",
"translations",... | replace all locale information in the store | [
"replace",
"all",
"locale",
"information",
"in",
"the",
"store"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L639-L645 |
15,514 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | removeLocale | function removeLocale(locale) {
if (store.state[moduleName].translations.hasOwnProperty(locale)) {
store.dispatch({
type: "".concat(moduleName, "/removeLocale"),
locale: locale
});
}
} | javascript | function removeLocale(locale) {
if (store.state[moduleName].translations.hasOwnProperty(locale)) {
store.dispatch({
type: "".concat(moduleName, "/removeLocale"),
locale: locale
});
}
} | [
"function",
"removeLocale",
"(",
"locale",
")",
"{",
"if",
"(",
"store",
".",
"state",
"[",
"moduleName",
"]",
".",
"translations",
".",
"hasOwnProperty",
"(",
"locale",
")",
")",
"{",
"store",
".",
"dispatch",
"(",
"{",
"type",
":",
"\"\"",
".",
"conc... | remove the givne locale from the store | [
"remove",
"the",
"givne",
"locale",
"from",
"the",
"store"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L648-L655 |
15,515 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | replace | function replace(translation, replacements) {
// check if the object has a replace property
if (!translation.replace) {
return translation;
}
return translation.replace(matcher, function (placeholder) {
// remove the identifiers (can be set on the module level)
var key = placeholder.r... | javascript | function replace(translation, replacements) {
// check if the object has a replace property
if (!translation.replace) {
return translation;
}
return translation.replace(matcher, function (placeholder) {
// remove the identifiers (can be set on the module level)
var key = placeholder.r... | [
"function",
"replace",
"(",
"translation",
",",
"replacements",
")",
"{",
"// check if the object has a replace property",
"if",
"(",
"!",
"translation",
".",
"replace",
")",
"{",
"return",
"translation",
";",
"}",
"return",
"translation",
".",
"replace",
"(",
"ma... | define the replacement function | [
"define",
"the",
"replacement",
"function"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L722-L750 |
15,516 | dkfbasel/vuex-i18n | dist/vuex-i18n.es.js | render | function render(locale, translation) {
var replacements = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var pluralization = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
// get the type of the property
var objType = _typeof(translation);
var pl... | javascript | function render(locale, translation) {
var replacements = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var pluralization = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
// get the type of the property
var objType = _typeof(translation);
var pl... | [
"function",
"render",
"(",
"locale",
",",
"translation",
")",
"{",
"var",
"replacements",
"=",
"arguments",
".",
"length",
">",
"2",
"&&",
"arguments",
"[",
"2",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"2",
"]",
":",
"{",
"}",
";",
"var",
"pl... | the render function will replace variable substitutions and prepare the translations for rendering | [
"the",
"render",
"function",
"will",
"replace",
"variable",
"substitutions",
"and",
"prepare",
"the",
"translations",
"for",
"rendering"
] | 41b589e05546986f9e7768cd1ca4982b90ebde95 | https://github.com/dkfbasel/vuex-i18n/blob/41b589e05546986f9e7768cd1ca4982b90ebde95/dist/vuex-i18n.es.js#L754-L813 |
15,517 | rdkmaster/jigsaw | build/scripts/doc-generator/json-parser.js | findInheritedProperties | function findInheritedProperties(ci, properties) {
while (ci && ci.extends) {
ci = findTypeMetaInfo(ci.extends);
if (!ci) {
console.warn('no meta info for: ' + ci.extends);
continue;
}
mergeProperties(ci).forEach(p => {
if (properties.find(... | javascript | function findInheritedProperties(ci, properties) {
while (ci && ci.extends) {
ci = findTypeMetaInfo(ci.extends);
if (!ci) {
console.warn('no meta info for: ' + ci.extends);
continue;
}
mergeProperties(ci).forEach(p => {
if (properties.find(... | [
"function",
"findInheritedProperties",
"(",
"ci",
",",
"properties",
")",
"{",
"while",
"(",
"ci",
"&&",
"ci",
".",
"extends",
")",
"{",
"ci",
"=",
"findTypeMetaInfo",
"(",
"ci",
".",
"extends",
")",
";",
"if",
"(",
"!",
"ci",
")",
"{",
"console",
".... | not including the current class's properties | [
"not",
"including",
"the",
"current",
"class",
"s",
"properties"
] | c378116a62913f3d43ac3e1064f6f41b9e1b4333 | https://github.com/rdkmaster/jigsaw/blob/c378116a62913f3d43ac3e1064f6f41b9e1b4333/build/scripts/doc-generator/json-parser.js#L244-L265 |
15,518 | rdkmaster/jigsaw | build/scripts/doc-generator/json-parser.js | findInheritedMethods | function findInheritedMethods(ci, methods) {
while (ci && ci.extends) {
ci = findTypeMetaInfo(ci.extends);
if (!ci) {
console.warn('no meta info for: ' + ci.extends);
continue;
}
(ci.methodsClass || ci.methods).forEach(m => {
if (methods.fi... | javascript | function findInheritedMethods(ci, methods) {
while (ci && ci.extends) {
ci = findTypeMetaInfo(ci.extends);
if (!ci) {
console.warn('no meta info for: ' + ci.extends);
continue;
}
(ci.methodsClass || ci.methods).forEach(m => {
if (methods.fi... | [
"function",
"findInheritedMethods",
"(",
"ci",
",",
"methods",
")",
"{",
"while",
"(",
"ci",
"&&",
"ci",
".",
"extends",
")",
"{",
"ci",
"=",
"findTypeMetaInfo",
"(",
"ci",
".",
"extends",
")",
";",
"if",
"(",
"!",
"ci",
")",
"{",
"console",
".",
"... | not including the current class's methods | [
"not",
"including",
"the",
"current",
"class",
"s",
"methods"
] | c378116a62913f3d43ac3e1064f6f41b9e1b4333 | https://github.com/rdkmaster/jigsaw/blob/c378116a62913f3d43ac3e1064f6f41b9e1b4333/build/scripts/doc-generator/json-parser.js#L366-L387 |
15,519 | adonisjs/ace | src/Question/index.js | multipleFilterFn | function multipleFilterFn () {
return this.choices.choices
.filter((choice) => choice.checked)
.map((choice) => choice.key)
} | javascript | function multipleFilterFn () {
return this.choices.choices
.filter((choice) => choice.checked)
.map((choice) => choice.key)
} | [
"function",
"multipleFilterFn",
"(",
")",
"{",
"return",
"this",
".",
"choices",
".",
"choices",
".",
"filter",
"(",
"(",
"choice",
")",
"=>",
"choice",
".",
"checked",
")",
".",
"map",
"(",
"(",
"choice",
")",
"=>",
"choice",
".",
"key",
")",
"}"
] | The enquirer has a bug where it returns
the name over the key, which is wrong.
This method overrides that behavior
@method multipleFilterFn
@return {Array} | [
"The",
"enquirer",
"has",
"a",
"bug",
"where",
"it",
"returns",
"the",
"name",
"over",
"the",
"key",
"which",
"is",
"wrong",
"."
] | 1d9df4a75740da5fa8098efab5f08da2bcc30b7f | https://github.com/adonisjs/ace/blob/1d9df4a75740da5fa8098efab5f08da2bcc30b7f/src/Question/index.js#L25-L29 |
15,520 | detro/ghostdriver | src/third_party/console++.js | function(msg, levelMsg) {
if (console.isTimestamped()) {
return "[" + levelMsg + " - " + new Date().toJSON() + "] " + msg;
} else {
return "[" + levelMsg + "] " + msg;
}
} | javascript | function(msg, levelMsg) {
if (console.isTimestamped()) {
return "[" + levelMsg + " - " + new Date().toJSON() + "] " + msg;
} else {
return "[" + levelMsg + "] " + msg;
}
} | [
"function",
"(",
"msg",
",",
"levelMsg",
")",
"{",
"if",
"(",
"console",
".",
"isTimestamped",
"(",
")",
")",
"{",
"return",
"\"[\"",
"+",
"levelMsg",
"+",
"\" - \"",
"+",
"new",
"Date",
"(",
")",
".",
"toJSON",
"(",
")",
"+",
"\"] \"",
"+",
"msg",... | Formats the Message content.
@param msg The message itself
@param levelMsg The portion of message that contains the Level (maybe colored)
@retuns The formatted message | [
"Formats",
"the",
"Message",
"content",
"."
] | fe3063d52f47ec2781d43970452595c42f729ebf | https://github.com/detro/ghostdriver/blob/fe3063d52f47ec2781d43970452595c42f729ebf/src/third_party/console++.js#L162-L168 | |
15,521 | bunkat/later | src/constraint/time.js | function(d, val) {
val = val > 86399 ? 0 : val;
var next = later.date.next(
later.Y.val(d),
later.M.val(d),
later.D.val(d) + (val <= later.t.val(d) ? 1 : 0),
0,
0,
val);
// correct for passing over a daylight savings boundry
if(!later.date.isUTC && next.getTime() < ... | javascript | function(d, val) {
val = val > 86399 ? 0 : val;
var next = later.date.next(
later.Y.val(d),
later.M.val(d),
later.D.val(d) + (val <= later.t.val(d) ? 1 : 0),
0,
0,
val);
// correct for passing over a daylight savings boundry
if(!later.date.isUTC && next.getTime() < ... | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"val",
"=",
"val",
">",
"86399",
"?",
"0",
":",
"val",
";",
"var",
"next",
"=",
"later",
".",
"date",
".",
"next",
"(",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
",",
"later",
".",
"M",
".",
... | Returns the start of the next instance of the time value indicated.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"start",
"of",
"the",
"next",
"instance",
"of",
"the",
"time",
"value",
"indicated",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/time.js#L76-L99 | |
15,522 | bunkat/later | src/constraint/weekofyear.js | function(d) {
if (d.wy) return d.wy;
// move to the Thursday in the target week and find Thurs of target year
var wThur = later.dw.next(later.wy.start(d), 5),
YThur = later.dw.next(later.Y.prev(wThur, later.Y.val(wThur)-1), 5);
// caculate the difference between the two dates in weeks
retu... | javascript | function(d) {
if (d.wy) return d.wy;
// move to the Thursday in the target week and find Thurs of target year
var wThur = later.dw.next(later.wy.start(d), 5),
YThur = later.dw.next(later.Y.prev(wThur, later.Y.val(wThur)-1), 5);
// caculate the difference between the two dates in weeks
retu... | [
"function",
"(",
"d",
")",
"{",
"if",
"(",
"d",
".",
"wy",
")",
"return",
"d",
".",
"wy",
";",
"// move to the Thursday in the target week and find Thurs of target year",
"var",
"wThur",
"=",
"later",
".",
"dw",
".",
"next",
"(",
"later",
".",
"wy",
".",
"... | The ISO week year value of the specified date.
@param {Date} d: The date to calculate the value of | [
"The",
"ISO",
"week",
"year",
"value",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofyear.js#L30-L39 | |
15,523 | bunkat/later | src/constraint/weekofyear.js | function(d) {
if (d.wyExtent) return d.wyExtent;
// go to start of ISO week to get to the right year
var year = later.dw.next(later.wy.start(d), 5),
dwFirst = later.dw.val(later.Y.start(year)),
dwLast = later.dw.val(later.Y.end(year));
return (d.wyExtent = [1, dwFirst === 5 || dwLast =... | javascript | function(d) {
if (d.wyExtent) return d.wyExtent;
// go to start of ISO week to get to the right year
var year = later.dw.next(later.wy.start(d), 5),
dwFirst = later.dw.val(later.Y.start(year)),
dwLast = later.dw.val(later.Y.end(year));
return (d.wyExtent = [1, dwFirst === 5 || dwLast =... | [
"function",
"(",
"d",
")",
"{",
"if",
"(",
"d",
".",
"wyExtent",
")",
"return",
"d",
".",
"wyExtent",
";",
"// go to start of ISO week to get to the right year",
"var",
"year",
"=",
"later",
".",
"dw",
".",
"next",
"(",
"later",
".",
"wy",
".",
"start",
... | The minimum and maximum valid ISO week values for the year indicated.
@param {Date} d: The date indicating the year to find ISO values for | [
"The",
"minimum",
"and",
"maximum",
"valid",
"ISO",
"week",
"values",
"for",
"the",
"year",
"indicated",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofyear.js#L56-L65 | |
15,524 | bunkat/later | src/constraint/weekofyear.js | function(d, val) {
var wyThur = later.dw.next(later.wy.start(d), 5),
year = later.date.prevRollover(wyThur, val, later.wy, later.Y);
// handle case where 1st of year is last week of previous month
if(later.wy.val(year) !== 1) {
year = later.dw.next(year, 2);
}
var wyMax = later.wy.ex... | javascript | function(d, val) {
var wyThur = later.dw.next(later.wy.start(d), 5),
year = later.date.prevRollover(wyThur, val, later.wy, later.Y);
// handle case where 1st of year is last week of previous month
if(later.wy.val(year) !== 1) {
year = later.dw.next(year, 2);
}
var wyMax = later.wy.ex... | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"var",
"wyThur",
"=",
"later",
".",
"dw",
".",
"next",
"(",
"later",
".",
"wy",
".",
"start",
"(",
"d",
")",
",",
"5",
")",
",",
"year",
"=",
"later",
".",
"date",
".",
"prevRollover",
"(",
"wyThur",
... | Returns the end of the previous instance of the ISO week value indicated.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"end",
"of",
"the",
"previous",
"instance",
"of",
"the",
"ISO",
"week",
"value",
"indicated",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofyear.js#L130-L149 | |
15,525 | bunkat/later | src/constraint/dayofweekcount.js | function(d) {
return d.dc || (d.dc = Math.floor((later.D.val(d)-1)/7)+1);
} | javascript | function(d) {
return d.dc || (d.dc = Math.floor((later.D.val(d)-1)/7)+1);
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"dc",
"||",
"(",
"d",
".",
"dc",
"=",
"Math",
".",
"floor",
"(",
"(",
"later",
".",
"D",
".",
"val",
"(",
"d",
")",
"-",
"1",
")",
"/",
"7",
")",
"+",
"1",
")",
";",
"}"
] | The day of week count value of the specified date.
@param {Date} d: The date to calculate the value of | [
"The",
"day",
"of",
"week",
"count",
"value",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L30-L32 | |
15,526 | bunkat/later | src/constraint/dayofweekcount.js | function(d) {
return d.dcExtent || (d.dcExtent = [1, Math.ceil(later.D.extent(d)[1] /7)]);
} | javascript | function(d) {
return d.dcExtent || (d.dcExtent = [1, Math.ceil(later.D.extent(d)[1] /7)]);
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"dcExtent",
"||",
"(",
"d",
".",
"dcExtent",
"=",
"[",
"1",
",",
"Math",
".",
"ceil",
"(",
"later",
".",
"D",
".",
"extent",
"(",
"d",
")",
"[",
"1",
"]",
"/",
"7",
")",
"]",
")",
";",
"... | The minimum and maximum valid day values of the month specified.
Zero to specify the last day of week count of the month.
@param {Date} d: The date indicating the month to find the extent of | [
"The",
"minimum",
"and",
"maximum",
"valid",
"day",
"values",
"of",
"the",
"month",
"specified",
".",
"Zero",
"to",
"specify",
"the",
"last",
"day",
"of",
"week",
"count",
"of",
"the",
"month",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L51-L53 | |
15,527 | bunkat/later | src/constraint/dayofweekcount.js | function(d) {
return d.dcStart || (d.dcStart =
later.date.next(
later.Y.val(d),
later.M.val(d),
Math.max(1, ((later.dc.val(d) - 1) * 7) + 1 || 1)));
} | javascript | function(d) {
return d.dcStart || (d.dcStart =
later.date.next(
later.Y.val(d),
later.M.val(d),
Math.max(1, ((later.dc.val(d) - 1) * 7) + 1 || 1)));
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"dcStart",
"||",
"(",
"d",
".",
"dcStart",
"=",
"later",
".",
"date",
".",
"next",
"(",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
",",
"later",
".",
"M",
".",
"val",
"(",
"d",
")",
","... | The first day of the month with the same day of week count as the date
specified.
@param {Date} d: The specified date | [
"The",
"first",
"day",
"of",
"the",
"month",
"with",
"the",
"same",
"day",
"of",
"week",
"count",
"as",
"the",
"date",
"specified",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L61-L67 | |
15,528 | bunkat/later | src/constraint/dayofweekcount.js | function(d) {
return d.dcEnd || (d.dcEnd =
later.date.prev(
later.Y.val(d),
later.M.val(d),
Math.min(later.dc.val(d) * 7, later.D.extent(d)[1])));
} | javascript | function(d) {
return d.dcEnd || (d.dcEnd =
later.date.prev(
later.Y.val(d),
later.M.val(d),
Math.min(later.dc.val(d) * 7, later.D.extent(d)[1])));
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"dcEnd",
"||",
"(",
"d",
".",
"dcEnd",
"=",
"later",
".",
"date",
".",
"prev",
"(",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
",",
"later",
".",
"M",
".",
"val",
"(",
"d",
")",
",",
... | The last day of the month with the same day of week count as the date
specified.
@param {Date} d: The specified date | [
"The",
"last",
"day",
"of",
"the",
"month",
"with",
"the",
"same",
"day",
"of",
"week",
"count",
"as",
"the",
"date",
"specified",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L75-L81 | |
15,529 | bunkat/later | src/constraint/dayofweekcount.js | function(d, val) {
val = val > later.dc.extent(d)[1] ? 1 : val;
var month = later.date.nextRollover(d, val, later.dc, later.M),
dcMax = later.dc.extent(month)[1];
val = val > dcMax ? 1 : val;
var next = later.date.next(
later.Y.val(month),
later.M.val(month),
val === 0 ? late... | javascript | function(d, val) {
val = val > later.dc.extent(d)[1] ? 1 : val;
var month = later.date.nextRollover(d, val, later.dc, later.M),
dcMax = later.dc.extent(month)[1];
val = val > dcMax ? 1 : val;
var next = later.date.next(
later.Y.val(month),
later.M.val(month),
val === 0 ? late... | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"val",
"=",
"val",
">",
"later",
".",
"dc",
".",
"extent",
"(",
"d",
")",
"[",
"1",
"]",
"?",
"1",
":",
"val",
";",
"var",
"month",
"=",
"later",
".",
"date",
".",
"nextRollover",
"(",
"d",
",",
"... | Returns the next earliest date with the day of week count specified.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"next",
"earliest",
"date",
"with",
"the",
"day",
"of",
"week",
"count",
"specified",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L89-L113 | |
15,530 | bunkat/later | src/constraint/dayofweekcount.js | function(d, val) {
var month = later.date.prevRollover(d, val, later.dc, later.M),
dcMax = later.dc.extent(month)[1];
val = val > dcMax ? dcMax : val || dcMax;
return later.dc.end(later.date.prev(
later.Y.val(month),
later.M.val(month),
1 + (7 * (val - 1))
));
} | javascript | function(d, val) {
var month = later.date.prevRollover(d, val, later.dc, later.M),
dcMax = later.dc.extent(month)[1];
val = val > dcMax ? dcMax : val || dcMax;
return later.dc.end(later.date.prev(
later.Y.val(month),
later.M.val(month),
1 + (7 * (val - 1))
));
} | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"var",
"month",
"=",
"later",
".",
"date",
".",
"prevRollover",
"(",
"d",
",",
"val",
",",
"later",
".",
"dc",
",",
"later",
".",
"M",
")",
",",
"dcMax",
"=",
"later",
".",
"dc",
".",
"extent",
"(",
... | Returns the closest previous date with the day of week count specified.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"closest",
"previous",
"date",
"with",
"the",
"day",
"of",
"week",
"count",
"specified",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofweekcount.js#L121-L132 | |
15,531 | bunkat/later | src/constraint/weekofmonth.js | function(d) {
return d.wm || (d.wm =
(later.D.val(d) +
(later.dw.val(later.M.start(d)) - 1) + (7 - later.dw.val(d))) / 7);
} | javascript | function(d) {
return d.wm || (d.wm =
(later.D.val(d) +
(later.dw.val(later.M.start(d)) - 1) + (7 - later.dw.val(d))) / 7);
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"wm",
"||",
"(",
"d",
".",
"wm",
"=",
"(",
"later",
".",
"D",
".",
"val",
"(",
"d",
")",
"+",
"(",
"later",
".",
"dw",
".",
"val",
"(",
"later",
".",
"M",
".",
"start",
"(",
"d",
")",
... | The week of month value of the specified date.
@param {Date} d: The date to calculate the value of | [
"The",
"week",
"of",
"month",
"value",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofmonth.js#L31-L35 | |
15,532 | bunkat/later | src/constraint/weekofmonth.js | function(d) {
return d.wmExtent || (d.wmExtent = [1,
(later.D.extent(d)[1] + (later.dw.val(later.M.start(d)) - 1) +
(7 - later.dw.val(later.M.end(d)))) / 7]);
} | javascript | function(d) {
return d.wmExtent || (d.wmExtent = [1,
(later.D.extent(d)[1] + (later.dw.val(later.M.start(d)) - 1) +
(7 - later.dw.val(later.M.end(d)))) / 7]);
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"wmExtent",
"||",
"(",
"d",
".",
"wmExtent",
"=",
"[",
"1",
",",
"(",
"later",
".",
"D",
".",
"extent",
"(",
"d",
")",
"[",
"1",
"]",
"+",
"(",
"later",
".",
"dw",
".",
"val",
"(",
"later"... | The minimum and maximum valid week of month values for the month indicated.
Zero indicates the last week in the month.
@param {Date} d: The date indicating the month to find values for | [
"The",
"minimum",
"and",
"maximum",
"valid",
"week",
"of",
"month",
"values",
"for",
"the",
"month",
"indicated",
".",
"Zero",
"indicates",
"the",
"last",
"week",
"in",
"the",
"month",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofmonth.js#L53-L57 | |
15,533 | bunkat/later | src/constraint/weekofmonth.js | function(d) {
return d.wmStart || (d.wmStart = later.date.next(
later.Y.val(d),
later.M.val(d),
Math.max(later.D.val(d) - later.dw.val(d) + 1, 1)));
} | javascript | function(d) {
return d.wmStart || (d.wmStart = later.date.next(
later.Y.val(d),
later.M.val(d),
Math.max(later.D.val(d) - later.dw.val(d) + 1, 1)));
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"wmStart",
"||",
"(",
"d",
".",
"wmStart",
"=",
"later",
".",
"date",
".",
"next",
"(",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
",",
"later",
".",
"M",
".",
"val",
"(",
"d",
")",
","... | The start of the week of the specified date.
@param {Date} d: The specified date | [
"The",
"start",
"of",
"the",
"week",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofmonth.js#L64-L69 | |
15,534 | bunkat/later | src/constraint/weekofmonth.js | function(d) {
return d.wmEnd || (d.wmEnd = later.date.prev(
later.Y.val(d),
later.M.val(d),
Math.min(later.D.val(d) + (7 - later.dw.val(d)), later.D.extent(d)[1])));
} | javascript | function(d) {
return d.wmEnd || (d.wmEnd = later.date.prev(
later.Y.val(d),
later.M.val(d),
Math.min(later.D.val(d) + (7 - later.dw.val(d)), later.D.extent(d)[1])));
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"wmEnd",
"||",
"(",
"d",
".",
"wmEnd",
"=",
"later",
".",
"date",
".",
"prev",
"(",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
",",
"later",
".",
"M",
".",
"val",
"(",
"d",
")",
",",
... | The end of the week of the specified date.
@param {Date} d: The specified date | [
"The",
"end",
"of",
"the",
"week",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofmonth.js#L76-L81 | |
15,535 | bunkat/later | src/constraint/weekofmonth.js | function(d, val) {
val = val > later.wm.extent(d)[1] ? 1 : val;
var month = later.date.nextRollover(d, val, later.wm, later.M),
wmMax = later.wm.extent(month)[1];
val = val > wmMax ? 1 : val || wmMax;
// jump to the Sunday of the desired week, set to 1st of month for week 1
return later.d... | javascript | function(d, val) {
val = val > later.wm.extent(d)[1] ? 1 : val;
var month = later.date.nextRollover(d, val, later.wm, later.M),
wmMax = later.wm.extent(month)[1];
val = val > wmMax ? 1 : val || wmMax;
// jump to the Sunday of the desired week, set to 1st of month for week 1
return later.d... | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"val",
"=",
"val",
">",
"later",
".",
"wm",
".",
"extent",
"(",
"d",
")",
"[",
"1",
"]",
"?",
"1",
":",
"val",
";",
"var",
"month",
"=",
"later",
".",
"date",
".",
"nextRollover",
"(",
"d",
",",
"... | Returns the start of the next instance of the week value indicated. Returns
the first day of the next month if val is greater than the number of
days in the following month.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"start",
"of",
"the",
"next",
"instance",
"of",
"the",
"week",
"value",
"indicated",
".",
"Returns",
"the",
"first",
"day",
"of",
"the",
"next",
"month",
"if",
"val",
"is",
"greater",
"than",
"the",
"number",
"of",
"days",
"in",
"the",
... | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/weekofmonth.js#L91-L104 | |
15,536 | bunkat/later | src/parse/recur.js | function (id, vals) {
var custom = later.modifier[id];
if(!custom) throw new Error('Custom modifier ' + id + ' not recognized!');
modifier = id;
values = arguments[1] instanceof Array ? arguments[1] : [arguments[1]];
return this;
} | javascript | function (id, vals) {
var custom = later.modifier[id];
if(!custom) throw new Error('Custom modifier ' + id + ' not recognized!');
modifier = id;
values = arguments[1] instanceof Array ? arguments[1] : [arguments[1]];
return this;
} | [
"function",
"(",
"id",
",",
"vals",
")",
"{",
"var",
"custom",
"=",
"later",
".",
"modifier",
"[",
"id",
"]",
";",
"if",
"(",
"!",
"custom",
")",
"throw",
"new",
"Error",
"(",
"'Custom modifier '",
"+",
"id",
"+",
"' not recognized!'",
")",
";",
"mod... | Custom modifier.
recur().on(2011, 2012, 2013).custom('partOfDay');
@api public | [
"Custom",
"modifier",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/parse/recur.js#L418-L425 | |
15,537 | bunkat/later | src/parse/recur.js | function (id) {
var custom = later[id];
if(!custom) throw new Error('Custom time period ' + id + ' not recognized!');
add(id, custom.extent(new Date())[0], custom.extent(new Date())[1]);
return this;
} | javascript | function (id) {
var custom = later[id];
if(!custom) throw new Error('Custom time period ' + id + ' not recognized!');
add(id, custom.extent(new Date())[0], custom.extent(new Date())[1]);
return this;
} | [
"function",
"(",
"id",
")",
"{",
"var",
"custom",
"=",
"later",
"[",
"id",
"]",
";",
"if",
"(",
"!",
"custom",
")",
"throw",
"new",
"Error",
"(",
"'Custom time period '",
"+",
"id",
"+",
"' not recognized!'",
")",
";",
"add",
"(",
"id",
",",
"custom"... | Custom time period.
recur().on(2011, 2012, 2013).customPeriod('partOfDay');
@api public | [
"Custom",
"time",
"period",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/parse/recur.js#L434-L440 | |
15,538 | bunkat/later | src/constraint/second.js | function(d) {
return d.s || (d.s = later.date.getSec.call(d));
} | javascript | function(d) {
return d.s || (d.s = later.date.getSec.call(d));
} | [
"function",
"(",
"d",
")",
"{",
"return",
"d",
".",
"s",
"||",
"(",
"d",
".",
"s",
"=",
"later",
".",
"date",
".",
"getSec",
".",
"call",
"(",
"d",
")",
")",
";",
"}"
] | The second value of the specified date.
@param {Date} d: The date to calculate the value of | [
"The",
"second",
"value",
"of",
"the",
"specified",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/second.js#L29-L31 | |
15,539 | bunkat/later | src/constraint/dayofyear.js | function(d) {
var year = later.Y.val(d);
// shortcut on finding leap years since this function gets called a lot
// works between 1901 and 2099
return d.dyExtent || (d.dyExtent = [1, year % 4 ? 365 : 366]);
} | javascript | function(d) {
var year = later.Y.val(d);
// shortcut on finding leap years since this function gets called a lot
// works between 1901 and 2099
return d.dyExtent || (d.dyExtent = [1, year % 4 ? 365 : 366]);
} | [
"function",
"(",
"d",
")",
"{",
"var",
"year",
"=",
"later",
".",
"Y",
".",
"val",
"(",
"d",
")",
";",
"// shortcut on finding leap years since this function gets called a lot",
"// works between 1901 and 2099",
"return",
"d",
".",
"dyExtent",
"||",
"(",
"d",
".",... | The minimum and maximum valid day of year values of the month specified.
Zero indicates the last day of the year.
@param {Date} d: The date indicating the month to find the extent of | [
"The",
"minimum",
"and",
"maximum",
"valid",
"day",
"of",
"year",
"values",
"of",
"the",
"month",
"specified",
".",
"Zero",
"indicates",
"the",
"last",
"day",
"of",
"the",
"year",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/dayofyear.js#L50-L56 | |
15,540 | bunkat/later | src/constraint/minute.js | function(d, val) {
var m = later.m.val(d),
s = later.s.val(d),
inc = val > 59 ? 60-m : (val <= m ? (60-m) + val : val-m),
next = new Date(d.getTime() + (inc * later.MIN) - (s * later.SEC));
// correct for passing over a daylight savings boundry
if(!later.date.isUTC && next.getTime()... | javascript | function(d, val) {
var m = later.m.val(d),
s = later.s.val(d),
inc = val > 59 ? 60-m : (val <= m ? (60-m) + val : val-m),
next = new Date(d.getTime() + (inc * later.MIN) - (s * later.SEC));
// correct for passing over a daylight savings boundry
if(!later.date.isUTC && next.getTime()... | [
"function",
"(",
"d",
",",
"val",
")",
"{",
"var",
"m",
"=",
"later",
".",
"m",
".",
"val",
"(",
"d",
")",
",",
"s",
"=",
"later",
".",
"s",
".",
"val",
"(",
"d",
")",
",",
"inc",
"=",
"val",
">",
"59",
"?",
"60",
"-",
"m",
":",
"(",
... | Returns the start of the next instance of the minute value indicated.
@param {Date} d: The starting date
@param {int} val: The desired value, must be within extent | [
"Returns",
"the",
"start",
"of",
"the",
"next",
"instance",
"of",
"the",
"minute",
"value",
"indicated",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/constraint/minute.js#L76-L88 | |
15,541 | bunkat/later | src/core/schedule.js | calcEnd | function calcEnd(dir, schedArr, startsArr, startDate, maxEndDate) {
var compare = compareFn(dir), result;
for(var i = 0, len = schedArr.length; i < len; i++) {
var start = startsArr[i];
if(start && start.getTime() === startDate.getTime()) {
var end = schedArr[i].end(dir, start);
/... | javascript | function calcEnd(dir, schedArr, startsArr, startDate, maxEndDate) {
var compare = compareFn(dir), result;
for(var i = 0, len = schedArr.length; i < len; i++) {
var start = startsArr[i];
if(start && start.getTime() === startDate.getTime()) {
var end = schedArr[i].end(dir, start);
/... | [
"function",
"calcEnd",
"(",
"dir",
",",
"schedArr",
",",
"startsArr",
",",
"startDate",
",",
"maxEndDate",
")",
"{",
"var",
"compare",
"=",
"compareFn",
"(",
"dir",
")",
",",
"result",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"schedArr... | Calculates the next invalid date for a particular schedules starting from
the specified valid start date.
@param {String} dir: The direction to use, either 'next' or 'prev'
@param {Array} schedArr: The set of compiled schedules to use
@param {Array} startsArr: The set of cached start dates for the schedules
@param {Da... | [
"Calculates",
"the",
"next",
"invalid",
"date",
"for",
"a",
"particular",
"schedules",
"starting",
"from",
"the",
"specified",
"valid",
"start",
"date",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/core/schedule.js#L324-L346 |
15,542 | bunkat/later | src/parse/cron.js | cloneSchedule | function cloneSchedule(sched) {
var clone = {}, field;
for(field in sched) {
if (field !== 'dc' && field !== 'd') {
clone[field] = sched[field].slice(0);
}
}
return clone;
} | javascript | function cloneSchedule(sched) {
var clone = {}, field;
for(field in sched) {
if (field !== 'dc' && field !== 'd') {
clone[field] = sched[field].slice(0);
}
}
return clone;
} | [
"function",
"cloneSchedule",
"(",
"sched",
")",
"{",
"var",
"clone",
"=",
"{",
"}",
",",
"field",
";",
"for",
"(",
"field",
"in",
"sched",
")",
"{",
"if",
"(",
"field",
"!==",
"'dc'",
"&&",
"field",
"!==",
"'d'",
")",
"{",
"clone",
"[",
"field",
... | Returns a deep clone of a schedule skipping any day of week
constraints.
@param {Sched} sched: The schedule that will be cloned | [
"Returns",
"a",
"deep",
"clone",
"of",
"a",
"schedule",
"skipping",
"any",
"day",
"of",
"week",
"constraints",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/parse/cron.js#L71-L81 |
15,543 | bunkat/later | src/parse/cron.js | parse | function parse(item, s, name, min, max, offset) {
var value,
split,
schedules = s.schedules,
curSched = schedules[schedules.length-1];
// L just means min - 1 (this also makes it work for any field)
if (item === 'L') {
item = min - 1;
}
// parse x
if ((value = get... | javascript | function parse(item, s, name, min, max, offset) {
var value,
split,
schedules = s.schedules,
curSched = schedules[schedules.length-1];
// L just means min - 1 (this also makes it work for any field)
if (item === 'L') {
item = min - 1;
}
// parse x
if ((value = get... | [
"function",
"parse",
"(",
"item",
",",
"s",
",",
"name",
",",
"min",
",",
"max",
",",
"offset",
")",
"{",
"var",
"value",
",",
"split",
",",
"schedules",
"=",
"s",
".",
"schedules",
",",
"curSched",
"=",
"schedules",
"[",
"schedules",
".",
"length",
... | Parses a particular item within a cron expression.
@param {String} item: The cron expression item to parse
@param {Schedule} s: The existing set of schedules
@param {String} name: The name to use for this constraint
@param {Int} min: The min value for the constraint
@param {Int} max: The max value for the constraint
@... | [
"Parses",
"a",
"particular",
"item",
"within",
"a",
"cron",
"expression",
"."
] | c5b45ef076d7a2c175c27427e5af22b29a0cc241 | https://github.com/bunkat/later/blob/c5b45ef076d7a2c175c27427e5af22b29a0cc241/src/parse/cron.js#L195-L227 |
15,544 | Mobius1/Selectr | docs/js/plugins.js | extend | function extend(src, props) {
props = props || {};
var p;
for (p in src) {
if (src.hasOwnProperty(p)) {
if (!props.hasOwnProperty(p)) {
props[p] = src[p];
}
}
}
return props;
} | javascript | function extend(src, props) {
props = props || {};
var p;
for (p in src) {
if (src.hasOwnProperty(p)) {
if (!props.hasOwnProperty(p)) {
props[p] = src[p];
}
}
}
return props;
} | [
"function",
"extend",
"(",
"src",
",",
"props",
")",
"{",
"props",
"=",
"props",
"||",
"{",
"}",
";",
"var",
"p",
";",
"for",
"(",
"p",
"in",
"src",
")",
"{",
"if",
"(",
"src",
".",
"hasOwnProperty",
"(",
"p",
")",
")",
"{",
"if",
"(",
"!",
... | Merge objects together into the first.
@param {Object} src Source object
@param {Object} obj Object to merge into source object
@return {Object} | [
"Merge",
"objects",
"together",
"into",
"the",
"first",
"."
] | f7e825fc97f95b6489408492ba15e3968fde943b | https://github.com/Mobius1/Selectr/blob/f7e825fc97f95b6489408492ba15e3968fde943b/docs/js/plugins.js#L85-L96 |
15,545 | Mobius1/Selectr | docs/js/plugins.js | createElement | function createElement(name, props) {
var c = document,
d = c.createElement(name);
if (props && "[object Object]" === Object.prototype.toString.call(props)) {
var e;
for (e in props)
if ("html" === e) d.innerHTML = props[e];
else if ("text" === e) {
var f = c.createTextNode(props[e]);
d.app... | javascript | function createElement(name, props) {
var c = document,
d = c.createElement(name);
if (props && "[object Object]" === Object.prototype.toString.call(props)) {
var e;
for (e in props)
if ("html" === e) d.innerHTML = props[e];
else if ("text" === e) {
var f = c.createTextNode(props[e]);
d.app... | [
"function",
"createElement",
"(",
"name",
",",
"props",
")",
"{",
"var",
"c",
"=",
"document",
",",
"d",
"=",
"c",
".",
"createElement",
"(",
"name",
")",
";",
"if",
"(",
"props",
"&&",
"\"[object Object]\"",
"===",
"Object",
".",
"prototype",
".",
"to... | Create new element and apply propertiess and attributes
@param {String} name The new element's nodeName
@param {Object} prop CSS properties and values
@return {Object} The newly create HTMLElement | [
"Create",
"new",
"element",
"and",
"apply",
"propertiess",
"and",
"attributes"
] | f7e825fc97f95b6489408492ba15e3968fde943b | https://github.com/Mobius1/Selectr/blob/f7e825fc97f95b6489408492ba15e3968fde943b/docs/js/plugins.js#L104-L117 |
15,546 | Mobius1/Selectr | docs/js/plugins.js | style | function style(el, obj) {
if ( !obj ) {
return window.getComputedStyle(el);
}
if ("[object Object]" === Object.prototype.toString.call(obj)) {
var s = "";
each(obj, function(prop, val) {
if ( typeof val !== "string" && prop !== "opacity" ) {
val += "px";
}
s += prop + ": " + val + ";";... | javascript | function style(el, obj) {
if ( !obj ) {
return window.getComputedStyle(el);
}
if ("[object Object]" === Object.prototype.toString.call(obj)) {
var s = "";
each(obj, function(prop, val) {
if ( typeof val !== "string" && prop !== "opacity" ) {
val += "px";
}
s += prop + ": " + val + ";";... | [
"function",
"style",
"(",
"el",
",",
"obj",
")",
"{",
"if",
"(",
"!",
"obj",
")",
"{",
"return",
"window",
".",
"getComputedStyle",
"(",
"el",
")",
";",
"}",
"if",
"(",
"\"[object Object]\"",
"===",
"Object",
".",
"prototype",
".",
"toString",
".",
"... | Emulate jQuery's css method
@param {Object} el HTMLElement
@param {Object} prop CSS properties and values
@return {Object|Void} | [
"Emulate",
"jQuery",
"s",
"css",
"method"
] | f7e825fc97f95b6489408492ba15e3968fde943b | https://github.com/Mobius1/Selectr/blob/f7e825fc97f95b6489408492ba15e3968fde943b/docs/js/plugins.js#L125-L141 |
15,547 | Mobius1/Selectr | docs/js/plugins.js | rect | function rect(t, e) {
var o = window,
r = t.getBoundingClientRect(),
x = o.pageXOffset,
y = o.pageYOffset,
m = {},
f = "none";
if (e) {
var s = style(t);
m = {
top: parseInt(s["margin-top"], 10),
left: parseInt(s["margin-left"], 10),
right: parseInt(s["margin-right"], 10),
bott... | javascript | function rect(t, e) {
var o = window,
r = t.getBoundingClientRect(),
x = o.pageXOffset,
y = o.pageYOffset,
m = {},
f = "none";
if (e) {
var s = style(t);
m = {
top: parseInt(s["margin-top"], 10),
left: parseInt(s["margin-left"], 10),
right: parseInt(s["margin-right"], 10),
bott... | [
"function",
"rect",
"(",
"t",
",",
"e",
")",
"{",
"var",
"o",
"=",
"window",
",",
"r",
"=",
"t",
".",
"getBoundingClientRect",
"(",
")",
",",
"x",
"=",
"o",
".",
"pageXOffset",
",",
"y",
"=",
"o",
".",
"pageYOffset",
",",
"m",
"=",
"{",
"}",
... | Get an element's DOMRect relative to the document instead of the viewport.
@param {Object} t HTMLElement
@param {Boolean} e Include margins
@return {Object} Formatted DOMRect copy | [
"Get",
"an",
"element",
"s",
"DOMRect",
"relative",
"to",
"the",
"document",
"instead",
"of",
"the",
"viewport",
"."
] | f7e825fc97f95b6489408492ba15e3968fde943b | https://github.com/Mobius1/Selectr/blob/f7e825fc97f95b6489408492ba15e3968fde943b/docs/js/plugins.js#L159-L189 |
15,548 | Mobius1/Selectr | docs/js/plugins.js | getScrollBarWidth | function getScrollBarWidth() {
var width = 0, div = createElement("div", { class: "scrollbar-measure" });
style(div, {
width: 100,
height: 100,
overflow: "scroll",
position: "absolute",
top: -9999
});
document.body.appendChild(div);
width = div.offsetWidth - div.clientWidth;
document.body... | javascript | function getScrollBarWidth() {
var width = 0, div = createElement("div", { class: "scrollbar-measure" });
style(div, {
width: 100,
height: 100,
overflow: "scroll",
position: "absolute",
top: -9999
});
document.body.appendChild(div);
width = div.offsetWidth - div.clientWidth;
document.body... | [
"function",
"getScrollBarWidth",
"(",
")",
"{",
"var",
"width",
"=",
"0",
",",
"div",
"=",
"createElement",
"(",
"\"div\"",
",",
"{",
"class",
":",
"\"scrollbar-measure\"",
"}",
")",
";",
"style",
"(",
"div",
",",
"{",
"width",
":",
"100",
",",
"height... | Get native scrollbar width
@return {Number} Scrollbar width | [
"Get",
"native",
"scrollbar",
"width"
] | f7e825fc97f95b6489408492ba15e3968fde943b | https://github.com/Mobius1/Selectr/blob/f7e825fc97f95b6489408492ba15e3968fde943b/docs/js/plugins.js#L237-L253 |
15,549 | postwait/node-amqp | lib/exchange.js | createExchangeErrorHandlerFor | function createExchangeErrorHandlerFor (exchange) {
return function (err) {
if (!exchange.options.confirm) return;
// should requeue instead?
// https://www.rabbitmq.com/reliability.html#producer
debug && debug('Exchange error handler triggered, erroring and wiping all unacked publishes');
for (v... | javascript | function createExchangeErrorHandlerFor (exchange) {
return function (err) {
if (!exchange.options.confirm) return;
// should requeue instead?
// https://www.rabbitmq.com/reliability.html#producer
debug && debug('Exchange error handler triggered, erroring and wiping all unacked publishes');
for (v... | [
"function",
"createExchangeErrorHandlerFor",
"(",
"exchange",
")",
"{",
"return",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"exchange",
".",
"options",
".",
"confirm",
")",
"return",
";",
"// should requeue instead?",
"// https://www.rabbitmq.com/reliability.h... | creates an error handler scoped to the given `exchange` | [
"creates",
"an",
"error",
"handler",
"scoped",
"to",
"the",
"given",
"exchange"
] | 0bc3ffab79dd62f3579571579e3e52a4eb2df0c1 | https://github.com/postwait/node-amqp/blob/0bc3ffab79dd62f3579571579e3e52a4eb2df0c1/lib/exchange.js#L28-L41 |
15,550 | postwait/node-amqp | lib/parser.js | parseInt | function parseInt (buffer, size) {
switch (size) {
case 1:
return buffer[buffer.read++];
case 2:
return (buffer[buffer.read++] << 8) + buffer[buffer.read++];
case 4:
return (buffer[buffer.read++] << 24) + (buffer[buffer.read++] << 16) +
(buffer[buffer.read++] << 8) + buff... | javascript | function parseInt (buffer, size) {
switch (size) {
case 1:
return buffer[buffer.read++];
case 2:
return (buffer[buffer.read++] << 8) + buffer[buffer.read++];
case 4:
return (buffer[buffer.read++] << 24) + (buffer[buffer.read++] << 16) +
(buffer[buffer.read++] << 8) + buff... | [
"function",
"parseInt",
"(",
"buffer",
",",
"size",
")",
"{",
"switch",
"(",
"size",
")",
"{",
"case",
"1",
":",
"return",
"buffer",
"[",
"buffer",
".",
"read",
"++",
"]",
";",
"case",
"2",
":",
"return",
"(",
"buffer",
"[",
"buffer",
".",
"read",
... | parse Network Byte Order integers. size can be 1,2,4,8 | [
"parse",
"Network",
"Byte",
"Order",
"integers",
".",
"size",
"can",
"be",
"1",
"2",
"4",
"8"
] | 0bc3ffab79dd62f3579571579e3e52a4eb2df0c1 | https://github.com/postwait/node-amqp/blob/0bc3ffab79dd62f3579571579e3e52a4eb2df0c1/lib/parser.js#L153-L174 |
15,551 | airtap/airtap | lib/builder-browserify.js | registerable | function registerable (cfgObj) {
_.forIn(cfgObj, function (value, key) {
if (registerableCfg.indexOf(key) !== -1) {
register(key, cfgObj)
}
})
} | javascript | function registerable (cfgObj) {
_.forIn(cfgObj, function (value, key) {
if (registerableCfg.indexOf(key) !== -1) {
register(key, cfgObj)
}
})
} | [
"function",
"registerable",
"(",
"cfgObj",
")",
"{",
"_",
".",
"forIn",
"(",
"cfgObj",
",",
"function",
"(",
"value",
",",
"key",
")",
"{",
"if",
"(",
"registerableCfg",
".",
"indexOf",
"(",
"key",
")",
"!==",
"-",
"1",
")",
"{",
"register",
"(",
"... | grab registerable configs and register them | [
"grab",
"registerable",
"configs",
"and",
"register",
"them"
] | deb4da83b39267f16454e3373ce4ab48a8832f9f | https://github.com/airtap/airtap/blob/deb4da83b39267f16454e3373ce4ab48a8832f9f/lib/builder-browserify.js#L29-L35 |
15,552 | jshttp/cookie | index.js | parse | function parse(str, options) {
if (typeof str !== 'string') {
throw new TypeError('argument str must be a string');
}
var obj = {}
var opt = options || {};
var pairs = str.split(pairSplitRegExp);
var dec = opt.decode || decode;
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i];
va... | javascript | function parse(str, options) {
if (typeof str !== 'string') {
throw new TypeError('argument str must be a string');
}
var obj = {}
var opt = options || {};
var pairs = str.split(pairSplitRegExp);
var dec = opt.decode || decode;
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i];
va... | [
"function",
"parse",
"(",
"str",
",",
"options",
")",
"{",
"if",
"(",
"typeof",
"str",
"!==",
"'string'",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'argument str must be a string'",
")",
";",
"}",
"var",
"obj",
"=",
"{",
"}",
"var",
"opt",
"=",
"opt... | Parse a cookie header.
Parse the given cookie header string into an object
The object has the various cookies as keys(names) => values
@param {string} str
@param {object} [options]
@return {object}
@public | [
"Parse",
"a",
"cookie",
"header",
"."
] | 7f9265da44887a8d7ca881a8a6317314195ec303 | https://github.com/jshttp/cookie/blob/7f9265da44887a8d7ca881a8a6317314195ec303/index.js#L49-L83 |
15,553 | formly-js/angular-formly | src/other/utils.js | findByNodeName | function findByNodeName(el, nodeName) {
if (!el.prop) { // not a jQuery or jqLite object -> wrap it
el = angular.element(el)
}
if (el.prop('nodeName') === nodeName.toUpperCase()) {
return el
}
const c = el.children()
for (let i = 0; c && i < c.length; i++) {
const node = findByNodeName(c[i], n... | javascript | function findByNodeName(el, nodeName) {
if (!el.prop) { // not a jQuery or jqLite object -> wrap it
el = angular.element(el)
}
if (el.prop('nodeName') === nodeName.toUpperCase()) {
return el
}
const c = el.children()
for (let i = 0; c && i < c.length; i++) {
const node = findByNodeName(c[i], n... | [
"function",
"findByNodeName",
"(",
"el",
",",
"nodeName",
")",
"{",
"if",
"(",
"!",
"el",
".",
"prop",
")",
"{",
"// not a jQuery or jqLite object -> wrap it",
"el",
"=",
"angular",
".",
"element",
"(",
"el",
")",
"}",
"if",
"(",
"el",
".",
"prop",
"(",
... | recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8 | [
"recurse",
"down",
"a",
"node",
"tree",
"to",
"find",
"a",
"node",
"with",
"matching",
"nodeName",
"for",
"custom",
"tags",
"jQuery",
".",
"find",
"doesn",
"t",
"work",
"in",
"IE8"
] | c1bd043dc56bed4eecb573717c60804e993e1ab0 | https://github.com/formly-js/angular-formly/blob/c1bd043dc56bed4eecb573717c60804e993e1ab0/src/other/utils.js#L65-L81 |
15,554 | mapbox/shp-write | src/write.js | write | function write(rows, geometry_type, geometries, callback) {
var TYPE = types.geometries[geometry_type],
writer = writers[TYPE],
parts = writer.parts(geometries, TYPE),
shpLength = 100 + (parts - geometries.length) * 4 + writer.shpLength(geometries),
shxLength = 100 + writer.shxLengt... | javascript | function write(rows, geometry_type, geometries, callback) {
var TYPE = types.geometries[geometry_type],
writer = writers[TYPE],
parts = writer.parts(geometries, TYPE),
shpLength = 100 + (parts - geometries.length) * 4 + writer.shpLength(geometries),
shxLength = 100 + writer.shxLengt... | [
"function",
"write",
"(",
"rows",
",",
"geometry_type",
",",
"geometries",
",",
"callback",
")",
"{",
"var",
"TYPE",
"=",
"types",
".",
"geometries",
"[",
"geometry_type",
"]",
",",
"writer",
"=",
"writers",
"[",
"TYPE",
"]",
",",
"parts",
"=",
"writer",... | Low-level writing interface | [
"Low",
"-",
"level",
"writing",
"interface"
] | 9681b583927c94fb563f7ad38a159934060026f1 | https://github.com/mapbox/shp-write/blob/9681b583927c94fb563f7ad38a159934060026f1/src/write.js#L21-L55 |
15,555 | guymorita/recommendationRaccoon | lib/algorithms.js | function(otherUserId, callback){
// if there is only one other user or the other user is the same user
if (otherUserIdsWhoRated.length === 1 || userId === otherUserId){
// then call the callback and exciting the similarity check
callback();
}
// if the use... | javascript | function(otherUserId, callback){
// if there is only one other user or the other user is the same user
if (otherUserIdsWhoRated.length === 1 || userId === otherUserId){
// then call the callback and exciting the similarity check
callback();
}
// if the use... | [
"function",
"(",
"otherUserId",
",",
"callback",
")",
"{",
"// if there is only one other user or the other user is the same user",
"if",
"(",
"otherUserIdsWhoRated",
".",
"length",
"===",
"1",
"||",
"userId",
"===",
"otherUserId",
")",
"{",
"// then call the callback and e... | running a function on each item in the list | [
"running",
"a",
"function",
"on",
"each",
"item",
"in",
"the",
"list"
] | cc99d193938993107cf02a2caaff4803f3e6a476 | https://github.com/guymorita/recommendationRaccoon/blob/cc99d193938993107cf02a2caaff4803f3e6a476/lib/algorithms.js#L74-L92 | |
15,556 | guymorita/recommendationRaccoon | lib/algorithms.js | function(err){
client.del(recommendedZSet, function(err){
async.each(scoreMap,
function(scorePair, callback){
client.zadd(recommendedZSet, scorePair[0], scorePair[1], function(err){
callback();
});
... | javascript | function(err){
client.del(recommendedZSet, function(err){
async.each(scoreMap,
function(scorePair, callback){
client.zadd(recommendedZSet, scorePair[0], scorePair[1], function(err){
callback();
});
... | [
"function",
"(",
"err",
")",
"{",
"client",
".",
"del",
"(",
"recommendedZSet",
",",
"function",
"(",
"err",
")",
"{",
"async",
".",
"each",
"(",
"scoreMap",
",",
"function",
"(",
"scorePair",
",",
"callback",
")",
"{",
"client",
".",
"zadd",
"(",
"r... | using score map which is an array of what the current user would rate all the unrated items, add them to that users sorted recommended set | [
"using",
"score",
"map",
"which",
"is",
"an",
"array",
"of",
"what",
"the",
"current",
"user",
"would",
"rate",
"all",
"the",
"unrated",
"items",
"add",
"them",
"to",
"that",
"users",
"sorted",
"recommended",
"set"
] | cc99d193938993107cf02a2caaff4803f3e6a476 | https://github.com/guymorita/recommendationRaccoon/blob/cc99d193938993107cf02a2caaff4803f3e6a476/lib/algorithms.js#L194-L214 | |
15,557 | 75lb/command-line-args | dist/index.js | findReplace | function findReplace (array, testFn) {
const found = [];
const replaceWiths = arrayify$1(arguments);
replaceWiths.splice(0, 2);
arrayify$1(array).forEach((value, index) => {
let expanded = [];
replaceWiths.forEach(replaceWith => {
if (typeof replaceWith === 'function') {
expanded = expand... | javascript | function findReplace (array, testFn) {
const found = [];
const replaceWiths = arrayify$1(arguments);
replaceWiths.splice(0, 2);
arrayify$1(array).forEach((value, index) => {
let expanded = [];
replaceWiths.forEach(replaceWith => {
if (typeof replaceWith === 'function') {
expanded = expand... | [
"function",
"findReplace",
"(",
"array",
",",
"testFn",
")",
"{",
"const",
"found",
"=",
"[",
"]",
";",
"const",
"replaceWiths",
"=",
"arrayify$1",
"(",
"arguments",
")",
";",
"replaceWiths",
".",
"splice",
"(",
"0",
",",
"2",
")",
";",
"arrayify$1",
"... | Find and either replace or remove items in an array.
@module find-replace
@example
> const findReplace = require('find-replace')
> const numbers = [ 1, 2, 3]
> findReplace(numbers, n => n === 2, 'two')
[ 1, 'two', 3 ]
> findReplace(numbers, n => n === 2, [ 'two', 'zwei' ])
[ 1, [ 'two', 'zwei' ], 3 ]
> findReplace(... | [
"Find",
"and",
"either",
"replace",
"or",
"remove",
"items",
"in",
"an",
"array",
"."
] | b07cb35ed0d1f3632230cb658e1e8c5a238e38fa | https://github.com/75lb/command-line-args/blob/b07cb35ed0d1f3632230cb658e1e8c5a238e38fa/dist/index.js#L147-L176 |
15,558 | 75lb/command-line-args | dist/index.js | isClass | function isClass (input) {
if (isFunction(input)) {
return /^class /.test(Function.prototype.toString.call(input))
} else {
return false
}
} | javascript | function isClass (input) {
if (isFunction(input)) {
return /^class /.test(Function.prototype.toString.call(input))
} else {
return false
}
} | [
"function",
"isClass",
"(",
"input",
")",
"{",
"if",
"(",
"isFunction",
"(",
"input",
")",
")",
"{",
"return",
"/",
"^class ",
"/",
".",
"test",
"(",
"Function",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"input",
")",
")",
"}",
"else",
"... | Returns true if the input value is an es2015 `class`.
@param {*} - the input to test
@returns {boolean}
@static | [
"Returns",
"true",
"if",
"the",
"input",
"value",
"is",
"an",
"es2015",
"class",
"."
] | b07cb35ed0d1f3632230cb658e1e8c5a238e38fa | https://github.com/75lb/command-line-args/blob/b07cb35ed0d1f3632230cb658e1e8c5a238e38fa/dist/index.js#L475-L481 |
15,559 | 75lb/command-line-args | dist/index.js | isPromise | function isPromise (input) {
if (input) {
const isPromise = isDefined(Promise) && input instanceof Promise;
const isThenable = input.then && typeof input.then === 'function';
return !!(isPromise || isThenable)
} else {
return false
}
} | javascript | function isPromise (input) {
if (input) {
const isPromise = isDefined(Promise) && input instanceof Promise;
const isThenable = input.then && typeof input.then === 'function';
return !!(isPromise || isThenable)
} else {
return false
}
} | [
"function",
"isPromise",
"(",
"input",
")",
"{",
"if",
"(",
"input",
")",
"{",
"const",
"isPromise",
"=",
"isDefined",
"(",
"Promise",
")",
"&&",
"input",
"instanceof",
"Promise",
";",
"const",
"isThenable",
"=",
"input",
".",
"then",
"&&",
"typeof",
"in... | Returns true if the input is a Promise.
@param {*} - the input to test
@returns {boolean}
@static | [
"Returns",
"true",
"if",
"the",
"input",
"is",
"a",
"Promise",
"."
] | b07cb35ed0d1f3632230cb658e1e8c5a238e38fa | https://github.com/75lb/command-line-args/blob/b07cb35ed0d1f3632230cb658e1e8c5a238e38fa/dist/index.js#L509-L517 |
15,560 | pelias/schema | scripts/drop_index.js | warnIfNotLocal | function warnIfNotLocal() {
if (config.esclient.hosts.some((env) => { return env.host !== 'localhost'; } )) {
console.log(colors.red(`WARNING: DROPPING SCHEMA NOT ON LOCALHOST: ${config.esclient.hosts[0].host}`));
}
} | javascript | function warnIfNotLocal() {
if (config.esclient.hosts.some((env) => { return env.host !== 'localhost'; } )) {
console.log(colors.red(`WARNING: DROPPING SCHEMA NOT ON LOCALHOST: ${config.esclient.hosts[0].host}`));
}
} | [
"function",
"warnIfNotLocal",
"(",
")",
"{",
"if",
"(",
"config",
".",
"esclient",
".",
"hosts",
".",
"some",
"(",
"(",
"env",
")",
"=>",
"{",
"return",
"env",
".",
"host",
"!==",
"'localhost'",
";",
"}",
")",
")",
"{",
"console",
".",
"log",
"(",
... | check all hosts to see if any is not localhost | [
"check",
"all",
"hosts",
"to",
"see",
"if",
"any",
"is",
"not",
"localhost"
] | 0f1305a2c87bd9c778c187435dfc94dc0d7e3d97 | https://github.com/pelias/schema/blob/0f1305a2c87bd9c778c187435dfc94dc0d7e3d97/scripts/drop_index.js#L21-L26 |
15,561 | onehilltech/blueprint | lib/router-builder.js | makeAction | function makeAction (controller, method, opts) {
let action = {action: controller + '@' + method};
return extend (action, opts);
} | javascript | function makeAction (controller, method, opts) {
let action = {action: controller + '@' + method};
return extend (action, opts);
} | [
"function",
"makeAction",
"(",
"controller",
",",
"method",
",",
"opts",
")",
"{",
"let",
"action",
"=",
"{",
"action",
":",
"controller",
"+",
"'@'",
"+",
"method",
"}",
";",
"return",
"extend",
"(",
"action",
",",
"opts",
")",
";",
"}"
] | Factory method that generates an action object. | [
"Factory",
"method",
"that",
"generates",
"an",
"action",
"object",
"."
] | 3a90b1f463e82a68427bcd1d85b2eb3660d1f385 | https://github.com/onehilltech/blueprint/blob/3a90b1f463e82a68427bcd1d85b2eb3660d1f385/lib/router-builder.js#L62-L65 |
15,562 | onehilltech/blueprint | lib/barrier/index.js | registerParticipant | function registerParticipant (name, participant) {
let barrier = barriers[name];
if (!barrier) {
debug (`creating barrier ${name}`);
barrier = barriers[name] = new Barrier ({name});
}
debug (`registering participant with barrier ${name}`);
return barrier.registerParticipant (participant);
} | javascript | function registerParticipant (name, participant) {
let barrier = barriers[name];
if (!barrier) {
debug (`creating barrier ${name}`);
barrier = barriers[name] = new Barrier ({name});
}
debug (`registering participant with barrier ${name}`);
return barrier.registerParticipant (participant);
} | [
"function",
"registerParticipant",
"(",
"name",
",",
"participant",
")",
"{",
"let",
"barrier",
"=",
"barriers",
"[",
"name",
"]",
";",
"if",
"(",
"!",
"barrier",
")",
"{",
"debug",
"(",
"`",
"${",
"name",
"}",
"`",
")",
";",
"barrier",
"=",
"barrier... | Factory method for registering a participant with a barrier. If the barrier
does not exist, then a new barrier is created.
@param name Name of the barrier
@param participant JavaScript object
@returns {Barrier} | [
"Factory",
"method",
"for",
"registering",
"a",
"participant",
"with",
"a",
"barrier",
".",
"If",
"the",
"barrier",
"does",
"not",
"exist",
"then",
"a",
"new",
"barrier",
"is",
"created",
"."
] | 3a90b1f463e82a68427bcd1d85b2eb3660d1f385 | https://github.com/onehilltech/blueprint/blob/3a90b1f463e82a68427bcd1d85b2eb3660d1f385/lib/barrier/index.js#L14-L24 |
15,563 | lightstep/lightstep-tracer-javascript | src/plugins/instrument_xhr.js | getResponseHeaders | function getResponseHeaders(xhr) {
let raw = xhr.getAllResponseHeaders();
let parts = raw.replace(/\s+$/, '').split(/\n/);
for (let i = 0; i < parts.length; i++) {
parts[i] = parts[i].replace(/\r/g, '').replace(/^\s+/, '').replace(/\s+$/, '');
}
return parts;
} | javascript | function getResponseHeaders(xhr) {
let raw = xhr.getAllResponseHeaders();
let parts = raw.replace(/\s+$/, '').split(/\n/);
for (let i = 0; i < parts.length; i++) {
parts[i] = parts[i].replace(/\r/g, '').replace(/^\s+/, '').replace(/\s+$/, '');
}
return parts;
} | [
"function",
"getResponseHeaders",
"(",
"xhr",
")",
"{",
"let",
"raw",
"=",
"xhr",
".",
"getAllResponseHeaders",
"(",
")",
";",
"let",
"parts",
"=",
"raw",
".",
"replace",
"(",
"/",
"\\s+$",
"/",
",",
"''",
")",
".",
"split",
"(",
"/",
"\\n",
"/",
"... | Normalize the getAllResponseHeaders output | [
"Normalize",
"the",
"getAllResponseHeaders",
"output"
] | 648797fbf02ad78eb567665ee7e6e4f83c98a0c3 | https://github.com/lightstep/lightstep-tracer-javascript/blob/648797fbf02ad78eb567665ee7e6e4f83c98a0c3/src/plugins/instrument_xhr.js#L41-L48 |
15,564 | lightstep/lightstep-tracer-javascript | examples/node/index.js | queryUserInfo | function queryUserInfo(parentSpan, username, callback) {
// Aggregated user information across multiple API calls
var user = {
login : null,
type : null,
repoNames : [],
recentEvents : 0,
eventCounts : {},
};
// Call the callback only when all ... | javascript | function queryUserInfo(parentSpan, username, callback) {
// Aggregated user information across multiple API calls
var user = {
login : null,
type : null,
repoNames : [],
recentEvents : 0,
eventCounts : {},
};
// Call the callback only when all ... | [
"function",
"queryUserInfo",
"(",
"parentSpan",
",",
"username",
",",
"callback",
")",
"{",
"// Aggregated user information across multiple API calls",
"var",
"user",
"=",
"{",
"login",
":",
"null",
",",
"type",
":",
"null",
",",
"repoNames",
":",
"[",
"]",
",",... | Make a series GitHub calls and aggregate the data into the `user` object
defined below. | [
"Make",
"a",
"series",
"GitHub",
"calls",
"and",
"aggregate",
"the",
"data",
"into",
"the",
"user",
"object",
"defined",
"below",
"."
] | 648797fbf02ad78eb567665ee7e6e4f83c98a0c3 | https://github.com/lightstep/lightstep-tracer-javascript/blob/648797fbf02ad78eb567665ee7e6e4f83c98a0c3/examples/node/index.js#L110-L166 |
15,565 | lightstep/lightstep-tracer-javascript | examples/node/index.js | httpGet | function httpGet(parentSpan, urlString, callback) {
var span = opentracing.globalTracer().startSpan('http.get', { childOf : parentSpan });
var callbackWrapper = function (err, data) {
span.finish();
callback(err, data);
};
try {
var carrier = {};
opentracing.globalTracer... | javascript | function httpGet(parentSpan, urlString, callback) {
var span = opentracing.globalTracer().startSpan('http.get', { childOf : parentSpan });
var callbackWrapper = function (err, data) {
span.finish();
callback(err, data);
};
try {
var carrier = {};
opentracing.globalTracer... | [
"function",
"httpGet",
"(",
"parentSpan",
",",
"urlString",
",",
"callback",
")",
"{",
"var",
"span",
"=",
"opentracing",
".",
"globalTracer",
"(",
")",
".",
"startSpan",
"(",
"'http.get'",
",",
"{",
"childOf",
":",
"parentSpan",
"}",
")",
";",
"var",
"c... | Helper function to make a GET request and return parsed JSON data. | [
"Helper",
"function",
"to",
"make",
"a",
"GET",
"request",
"and",
"return",
"parsed",
"JSON",
"data",
"."
] | 648797fbf02ad78eb567665ee7e6e4f83c98a0c3 | https://github.com/lightstep/lightstep-tracer-javascript/blob/648797fbf02ad78eb567665ee7e6e4f83c98a0c3/examples/node/index.js#L171-L239 |
15,566 | patosai/tree-multiselect.js | src/tree-multiselect/utility/array.js | filterInPlace | function filterInPlace (arr, pred) {
var idx = 0;
for (var ii = 0; ii < arr.length; ++ii) {
if (pred(arr[ii])) {
arr[idx] = arr[ii];
++idx;
}
}
arr.length = idx;
} | javascript | function filterInPlace (arr, pred) {
var idx = 0;
for (var ii = 0; ii < arr.length; ++ii) {
if (pred(arr[ii])) {
arr[idx] = arr[ii];
++idx;
}
}
arr.length = idx;
} | [
"function",
"filterInPlace",
"(",
"arr",
",",
"pred",
")",
"{",
"var",
"idx",
"=",
"0",
";",
"for",
"(",
"var",
"ii",
"=",
"0",
";",
"ii",
"<",
"arr",
".",
"length",
";",
"++",
"ii",
")",
"{",
"if",
"(",
"pred",
"(",
"arr",
"[",
"ii",
"]",
... | keeps if pred is true | [
"keeps",
"if",
"pred",
"is",
"true"
] | 0eca6336c7f41866618edb3ef7b1f46528627b72 | https://github.com/patosai/tree-multiselect.js/blob/0eca6336c7f41866618edb3ef7b1f46528627b72/src/tree-multiselect/utility/array.js#L2-L11 |
15,567 | ProseMirror/prosemirror-model | src/from_dom.js | normalizeList | function normalizeList(dom) {
for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null
if (name && listTags.hasOwnProperty(name) && prevItem) {
prevItem.appendChild(child)
child = prevItem
} else ... | javascript | function normalizeList(dom) {
for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {
let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null
if (name && listTags.hasOwnProperty(name) && prevItem) {
prevItem.appendChild(child)
child = prevItem
} else ... | [
"function",
"normalizeList",
"(",
"dom",
")",
"{",
"for",
"(",
"let",
"child",
"=",
"dom",
".",
"firstChild",
",",
"prevItem",
"=",
"null",
";",
"child",
";",
"child",
"=",
"child",
".",
"nextSibling",
")",
"{",
"let",
"name",
"=",
"child",
".",
"nod... | Kludge to work around directly nested list nodes produced by some tools and allowed by browsers to mean that the nested list is actually part of the list item above it. | [
"Kludge",
"to",
"work",
"around",
"directly",
"nested",
"list",
"nodes",
"produced",
"by",
"some",
"tools",
"and",
"allowed",
"by",
"browsers",
"to",
"mean",
"that",
"the",
"nested",
"list",
"is",
"actually",
"part",
"of",
"the",
"list",
"item",
"above",
"... | 8bf01f1b58e81ffabf64e2944538fca80fc578d8 | https://github.com/ProseMirror/prosemirror-model/blob/8bf01f1b58e81ffabf64e2944538fca80fc578d8/src/from_dom.js#L692-L704 |
15,568 | ProseMirror/prosemirror-model | src/from_dom.js | matches | function matches(dom, selector) {
return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)
} | javascript | function matches(dom, selector) {
return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)
} | [
"function",
"matches",
"(",
"dom",
",",
"selector",
")",
"{",
"return",
"(",
"dom",
".",
"matches",
"||",
"dom",
".",
"msMatchesSelector",
"||",
"dom",
".",
"webkitMatchesSelector",
"||",
"dom",
".",
"mozMatchesSelector",
")",
".",
"call",
"(",
"dom",
",",... | Apply a CSS selector. | [
"Apply",
"a",
"CSS",
"selector",
"."
] | 8bf01f1b58e81ffabf64e2944538fca80fc578d8 | https://github.com/ProseMirror/prosemirror-model/blob/8bf01f1b58e81ffabf64e2944538fca80fc578d8/src/from_dom.js#L707-L709 |
15,569 | ProseMirror/prosemirror-model | src/content.js | nullFrom | function nullFrom(nfa, node) {
let result = []
scan(node)
return result.sort(cmp)
function scan(node) {
let edges = nfa[node]
if (edges.length == 1 && !edges[0].term) return scan(edges[0].to)
result.push(node)
for (let i = 0; i < edges.length; i++) {
let {term, to} = edges[i]
if (!t... | javascript | function nullFrom(nfa, node) {
let result = []
scan(node)
return result.sort(cmp)
function scan(node) {
let edges = nfa[node]
if (edges.length == 1 && !edges[0].term) return scan(edges[0].to)
result.push(node)
for (let i = 0; i < edges.length; i++) {
let {term, to} = edges[i]
if (!t... | [
"function",
"nullFrom",
"(",
"nfa",
",",
"node",
")",
"{",
"let",
"result",
"=",
"[",
"]",
"scan",
"(",
"node",
")",
"return",
"result",
".",
"sort",
"(",
"cmp",
")",
"function",
"scan",
"(",
"node",
")",
"{",
"let",
"edges",
"=",
"nfa",
"[",
"no... | Get the set of nodes reachable by null edges from `node`. Omit nodes with only a single null-out-edge, since they may lead to needless duplicated nodes. | [
"Get",
"the",
"set",
"of",
"nodes",
"reachable",
"by",
"null",
"edges",
"from",
"node",
".",
"Omit",
"nodes",
"with",
"only",
"a",
"single",
"null",
"-",
"out",
"-",
"edge",
"since",
"they",
"may",
"lead",
"to",
"needless",
"duplicated",
"nodes",
"."
] | 8bf01f1b58e81ffabf64e2944538fca80fc578d8 | https://github.com/ProseMirror/prosemirror-model/blob/8bf01f1b58e81ffabf64e2944538fca80fc578d8/src/content.js#L333-L347 |
15,570 | orbotix/sphero.js | examples/conway.js | connect | function connect(orbs, callback) {
var total = Object.keys(orbs).length,
finished = 0;
function done() {
finished++;
if (finished >= total) { callback(); }
}
for (var name in orbs) {
orbs[name].connect(done);
}
} | javascript | function connect(orbs, callback) {
var total = Object.keys(orbs).length,
finished = 0;
function done() {
finished++;
if (finished >= total) { callback(); }
}
for (var name in orbs) {
orbs[name].connect(done);
}
} | [
"function",
"connect",
"(",
"orbs",
",",
"callback",
")",
"{",
"var",
"total",
"=",
"Object",
".",
"keys",
"(",
"orbs",
")",
".",
"length",
",",
"finished",
"=",
"0",
";",
"function",
"done",
"(",
")",
"{",
"finished",
"++",
";",
"if",
"(",
"finish... | connects all spheros, triggering callback when done | [
"connects",
"all",
"spheros",
"triggering",
"callback",
"when",
"done"
] | 75ccac9caaa823da2ff816c27afac509c34dafc5 | https://github.com/orbotix/sphero.js/blob/75ccac9caaa823da2ff816c27afac509c34dafc5/examples/conway.js#L22-L34 |
15,571 | orbotix/sphero.js | examples/conway.js | start | function start(name) {
var orb = spheros[name],
contacts = 0,
age = 0,
alive = false;
orb.detectCollisions();
born();
orb.on("collision", function() { contacts += 1; });
setInterval(function() { if (alive) { move(); } }, 3000);
setInterval(birthday, 10000);
// roll Sphero in a rando... | javascript | function start(name) {
var orb = spheros[name],
contacts = 0,
age = 0,
alive = false;
orb.detectCollisions();
born();
orb.on("collision", function() { contacts += 1; });
setInterval(function() { if (alive) { move(); } }, 3000);
setInterval(birthday, 10000);
// roll Sphero in a rando... | [
"function",
"start",
"(",
"name",
")",
"{",
"var",
"orb",
"=",
"spheros",
"[",
"name",
"]",
",",
"contacts",
"=",
"0",
",",
"age",
"=",
"0",
",",
"alive",
"=",
"false",
";",
"orb",
".",
"detectCollisions",
"(",
")",
";",
"born",
"(",
")",
";",
... | tells each Sphero what to do | [
"tells",
"each",
"Sphero",
"what",
"to",
"do"
] | 75ccac9caaa823da2ff816c27afac509c34dafc5 | https://github.com/orbotix/sphero.js/blob/75ccac9caaa823da2ff816c27afac509c34dafc5/examples/conway.js#L37-L103 |
15,572 | orbotix/sphero.js | lib/devices/custom.js | calculateLuminance | function calculateLuminance(hex, lum) {
return Math.round(Math.min(Math.max(0, hex + (hex * lum)), 255));
} | javascript | function calculateLuminance(hex, lum) {
return Math.round(Math.min(Math.max(0, hex + (hex * lum)), 255));
} | [
"function",
"calculateLuminance",
"(",
"hex",
",",
"lum",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"Math",
".",
"min",
"(",
"Math",
".",
"max",
"(",
"0",
",",
"hex",
"+",
"(",
"hex",
"*",
"lum",
")",
")",
",",
"255",
")",
")",
";",
"}"
] | Converts a hex color number to luminance adjusted value
@private
@param {Object} hex hex color value to convert
@param {Number} lum percentage of luminance
@return {Object} converted color value | [
"Converts",
"a",
"hex",
"color",
"number",
"to",
"luminance",
"adjusted",
"value"
] | 75ccac9caaa823da2ff816c27afac509c34dafc5 | https://github.com/orbotix/sphero.js/blob/75ccac9caaa823da2ff816c27afac509c34dafc5/lib/devices/custom.js#L36-L38 |
15,573 | orbotix/sphero.js | lib/devices/custom.js | adjustLuminance | function adjustLuminance(rgb, lum) {
var newRgb = {};
newRgb.red = calculateLuminance(rgb.red, lum);
newRgb.green = calculateLuminance(rgb.green, lum);
newRgb.blue = calculateLuminance(rgb.blue, lum);
return newRgb;
} | javascript | function adjustLuminance(rgb, lum) {
var newRgb = {};
newRgb.red = calculateLuminance(rgb.red, lum);
newRgb.green = calculateLuminance(rgb.green, lum);
newRgb.blue = calculateLuminance(rgb.blue, lum);
return newRgb;
} | [
"function",
"adjustLuminance",
"(",
"rgb",
",",
"lum",
")",
"{",
"var",
"newRgb",
"=",
"{",
"}",
";",
"newRgb",
".",
"red",
"=",
"calculateLuminance",
"(",
"rgb",
".",
"red",
",",
"lum",
")",
";",
"newRgb",
".",
"green",
"=",
"calculateLuminance",
"(",... | Adjusts an RGB color by the relative luminance
@private
@param {Object} rgb rgb color value to convert
@param {Number} lum percentage of luminance
@return {Object} RGB color values | [
"Adjusts",
"an",
"RGB",
"color",
"by",
"the",
"relative",
"luminance"
] | 75ccac9caaa823da2ff816c27afac509c34dafc5 | https://github.com/orbotix/sphero.js/blob/75ccac9caaa823da2ff816c27afac509c34dafc5/lib/devices/custom.js#L48-L55 |
15,574 | webdeveric/webpack-assets-manifest | src/helpers.js | warn | function warn( message )
{
if ( message in warn.cache ) {
return;
}
const prefix = chalk.hex('#CC4A8B')('WARNING:');
console.warn(chalk`${prefix} ${message}`);
} | javascript | function warn( message )
{
if ( message in warn.cache ) {
return;
}
const prefix = chalk.hex('#CC4A8B')('WARNING:');
console.warn(chalk`${prefix} ${message}`);
} | [
"function",
"warn",
"(",
"message",
")",
"{",
"if",
"(",
"message",
"in",
"warn",
".",
"cache",
")",
"{",
"return",
";",
"}",
"const",
"prefix",
"=",
"chalk",
".",
"hex",
"(",
"'#CC4A8B'",
")",
"(",
"'WARNING:'",
")",
";",
"console",
".",
"warn",
"... | Display a warning message.
@param {string} message | [
"Display",
"a",
"warning",
"message",
"."
] | 051243ec8963be69ab8565b5998032cc3a020a7a | https://github.com/webdeveric/webpack-assets-manifest/blob/051243ec8963be69ab8565b5998032cc3a020a7a/src/helpers.js#L9-L18 |
15,575 | webdeveric/webpack-assets-manifest | src/helpers.js | filterHashes | function filterHashes( hashes )
{
const validHashes = crypto.getHashes();
return hashes.filter( hash => {
if ( validHashes.includes(hash) ) {
return true;
}
warn(chalk`{blueBright ${hash}} is not a supported hash algorithm`);
return false;
});
} | javascript | function filterHashes( hashes )
{
const validHashes = crypto.getHashes();
return hashes.filter( hash => {
if ( validHashes.includes(hash) ) {
return true;
}
warn(chalk`{blueBright ${hash}} is not a supported hash algorithm`);
return false;
});
} | [
"function",
"filterHashes",
"(",
"hashes",
")",
"{",
"const",
"validHashes",
"=",
"crypto",
".",
"getHashes",
"(",
")",
";",
"return",
"hashes",
".",
"filter",
"(",
"hash",
"=>",
"{",
"if",
"(",
"validHashes",
".",
"includes",
"(",
"hash",
")",
")",
"{... | Filter out invalid hash algorithms.
@param {array} hashes
@return {array} Valid hash algorithms | [
"Filter",
"out",
"invalid",
"hash",
"algorithms",
"."
] | 051243ec8963be69ab8565b5998032cc3a020a7a | https://github.com/webdeveric/webpack-assets-manifest/blob/051243ec8963be69ab8565b5998032cc3a020a7a/src/helpers.js#L47-L60 |
15,576 | webdeveric/webpack-assets-manifest | src/helpers.js | varType | function varType( v )
{
const [ , type ] = Object.prototype.toString.call( v ).match(/\[object\s(\w+)\]/);
return type;
} | javascript | function varType( v )
{
const [ , type ] = Object.prototype.toString.call( v ).match(/\[object\s(\w+)\]/);
return type;
} | [
"function",
"varType",
"(",
"v",
")",
"{",
"const",
"[",
",",
"type",
"]",
"=",
"Object",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"v",
")",
".",
"match",
"(",
"/",
"\\[object\\s(\\w+)\\]",
"/",
")",
";",
"return",
"type",
";",
"}"
] | Get the data type of an argument.
@param {*} v - Some variable
@return {string} Data type | [
"Get",
"the",
"data",
"type",
"of",
"an",
"argument",
"."
] | 051243ec8963be69ab8565b5998032cc3a020a7a | https://github.com/webdeveric/webpack-assets-manifest/blob/051243ec8963be69ab8565b5998032cc3a020a7a/src/helpers.js#L84-L89 |
15,577 | webdeveric/webpack-assets-manifest | src/helpers.js | getSortedObject | function getSortedObject(object, compareFunction)
{
const keys = Object.keys(object);
keys.sort( compareFunction );
return keys.reduce(
(sorted, key) => (sorted[ key ] = object[ key ], sorted),
Object.create(null)
);
} | javascript | function getSortedObject(object, compareFunction)
{
const keys = Object.keys(object);
keys.sort( compareFunction );
return keys.reduce(
(sorted, key) => (sorted[ key ] = object[ key ], sorted),
Object.create(null)
);
} | [
"function",
"getSortedObject",
"(",
"object",
",",
"compareFunction",
")",
"{",
"const",
"keys",
"=",
"Object",
".",
"keys",
"(",
"object",
")",
";",
"keys",
".",
"sort",
"(",
"compareFunction",
")",
";",
"return",
"keys",
".",
"reduce",
"(",
"(",
"sorte... | Get an object sorted by keys.
@param {object} object
@param {function} compareFunction
@return {object} | [
"Get",
"an",
"object",
"sorted",
"by",
"keys",
"."
] | 051243ec8963be69ab8565b5998032cc3a020a7a | https://github.com/webdeveric/webpack-assets-manifest/blob/051243ec8963be69ab8565b5998032cc3a020a7a/src/helpers.js#L98-L108 |
15,578 | patternfly/patternfly-ng | config/html-elements-plugin/index.js | createTag | function createTag(tagName, attrMap, publicPath) {
publicPath = publicPath || '';
// add trailing slash if we have a publicPath and it doesn't have one.
if (publicPath && !RE_ENDS_WITH_BS.test(publicPath)) {
publicPath += '/';
}
const attributes = Object.getOwnPropertyNames(attrMap)
.filter(function... | javascript | function createTag(tagName, attrMap, publicPath) {
publicPath = publicPath || '';
// add trailing slash if we have a publicPath and it doesn't have one.
if (publicPath && !RE_ENDS_WITH_BS.test(publicPath)) {
publicPath += '/';
}
const attributes = Object.getOwnPropertyNames(attrMap)
.filter(function... | [
"function",
"createTag",
"(",
"tagName",
",",
"attrMap",
",",
"publicPath",
")",
"{",
"publicPath",
"=",
"publicPath",
"||",
"''",
";",
"// add trailing slash if we have a publicPath and it doesn't have one.",
"if",
"(",
"publicPath",
"&&",
"!",
"RE_ENDS_WITH_BS",
".",
... | Create an HTML tag with attributes from a map.
Example:
createTag('link', { rel: "manifest", href: "/assets/manifest.json" })
// <link rel="manifest" href="/assets/manifest.json">
@param tagName The name of the tag
@param attrMap A Map of attribute names (keys) and their values.
@param publicPath a path to add to eh s... | [
"Create",
"an",
"HTML",
"tag",
"with",
"attributes",
"from",
"a",
"map",
"."
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/config/html-elements-plugin/index.js#L42-L72 |
15,579 | patternfly/patternfly-ng | config/html-elements-plugin/index.js | getHtmlElementString | function getHtmlElementString(dataSource, publicPath) {
return Object.getOwnPropertyNames(dataSource)
.map(function(name) {
if (Array.isArray(dataSource[name])) {
return dataSource[name].map(function(attrs) { return createTag(name, attrs, publicPath); } );
} else {
return [ createTag(n... | javascript | function getHtmlElementString(dataSource, publicPath) {
return Object.getOwnPropertyNames(dataSource)
.map(function(name) {
if (Array.isArray(dataSource[name])) {
return dataSource[name].map(function(attrs) { return createTag(name, attrs, publicPath); } );
} else {
return [ createTag(n... | [
"function",
"getHtmlElementString",
"(",
"dataSource",
",",
"publicPath",
")",
"{",
"return",
"Object",
".",
"getOwnPropertyNames",
"(",
"dataSource",
")",
".",
"map",
"(",
"function",
"(",
"name",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"dataSour... | Returns a string representing all html elements defined in a data source.
Example:
const ds = {
link: [
{ rel: "apple-touch-icon", sizes: "57x57", href: "/assets/icon/apple-icon-57x57.png" }
],
meta: [
{ name: "msapplication-TileColor", content: "#00bcd4" }
]
}
getHeadTags(ds);
// "<link rel="apple-touch-icon" sizes... | [
"Returns",
"a",
"string",
"representing",
"all",
"html",
"elements",
"defined",
"in",
"a",
"data",
"source",
"."
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/config/html-elements-plugin/index.js#L94-L107 |
15,580 | patternfly/patternfly-ng | gulpfile.js | copyToDemo | function copyToDemo(srcArr) {
return gulp.src(srcArr)
.pipe(gulp.dest(function (file) {
return demoDist + file.base.slice(__dirname.length); // save directly to demo
}));
} | javascript | function copyToDemo(srcArr) {
return gulp.src(srcArr)
.pipe(gulp.dest(function (file) {
return demoDist + file.base.slice(__dirname.length); // save directly to demo
}));
} | [
"function",
"copyToDemo",
"(",
"srcArr",
")",
"{",
"return",
"gulp",
".",
"src",
"(",
"srcArr",
")",
".",
"pipe",
"(",
"gulp",
".",
"dest",
"(",
"function",
"(",
"file",
")",
"{",
"return",
"demoDist",
"+",
"file",
".",
"base",
".",
"slice",
"(",
"... | Copy given files to demo directory | [
"Copy",
"given",
"files",
"to",
"demo",
"directory"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L55-L60 |
15,581 | patternfly/patternfly-ng | gulpfile.js | copyToDist | function copyToDist(srcArr) {
return gulp.src(srcArr.concat(globalExcludes))
.pipe(gulp.dest(function (file) {
return libraryDist + file.base.slice(__dirname.length); // save directly to dist
}));
} | javascript | function copyToDist(srcArr) {
return gulp.src(srcArr.concat(globalExcludes))
.pipe(gulp.dest(function (file) {
return libraryDist + file.base.slice(__dirname.length); // save directly to dist
}));
} | [
"function",
"copyToDist",
"(",
"srcArr",
")",
"{",
"return",
"gulp",
".",
"src",
"(",
"srcArr",
".",
"concat",
"(",
"globalExcludes",
")",
")",
".",
"pipe",
"(",
"gulp",
".",
"dest",
"(",
"function",
"(",
"file",
")",
"{",
"return",
"libraryDist",
"+",... | Copy given files to dist directory | [
"Copy",
"given",
"files",
"to",
"dist",
"directory"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L63-L68 |
15,582 | patternfly/patternfly-ng | gulpfile.js | transpileMinifyLESS | function transpileMinifyLESS(src) {
return gulp.src(src)
.pipe(sourcemaps.init())
.pipe(lessCompiler({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(cssmin().on('error', function(err) {
console.log(err);
}))
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write... | javascript | function transpileMinifyLESS(src) {
return gulp.src(src)
.pipe(sourcemaps.init())
.pipe(lessCompiler({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(cssmin().on('error', function(err) {
console.log(err);
}))
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write... | [
"function",
"transpileMinifyLESS",
"(",
"src",
")",
"{",
"return",
"gulp",
".",
"src",
"(",
"src",
")",
".",
"pipe",
"(",
"sourcemaps",
".",
"init",
"(",
")",
")",
".",
"pipe",
"(",
"lessCompiler",
"(",
"{",
"paths",
":",
"[",
"path",
".",
"join",
... | Build and minify LESS separately | [
"Build",
"and",
"minify",
"LESS",
"separately"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L98-L112 |
15,583 | patternfly/patternfly-ng | gulpfile.js | inlineTemplate | function inlineTemplate() {
return gulp.src(['./src/app/**/*.ts'].concat(globalExcludes), {base: './'})
.pipe(replace(/templateUrl.*\'/g, function (matched) {
var fileName = matched.match(/\/.*html/g).toString();
var dirName = this.file.relative.substring(0, this.file.relative.lastIndexOf('/'));
... | javascript | function inlineTemplate() {
return gulp.src(['./src/app/**/*.ts'].concat(globalExcludes), {base: './'})
.pipe(replace(/templateUrl.*\'/g, function (matched) {
var fileName = matched.match(/\/.*html/g).toString();
var dirName = this.file.relative.substring(0, this.file.relative.lastIndexOf('/'));
... | [
"function",
"inlineTemplate",
"(",
")",
"{",
"return",
"gulp",
".",
"src",
"(",
"[",
"'./src/app/**/*.ts'",
"]",
".",
"concat",
"(",
"globalExcludes",
")",
",",
"{",
"base",
":",
"'./'",
"}",
")",
".",
"pipe",
"(",
"replace",
"(",
"/",
"templateUrl.*\\'"... | Typescript
Inline HTML templates in component classes | [
"Typescript",
"Inline",
"HTML",
"templates",
"in",
"component",
"classes"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L177-L186 |
15,584 | patternfly/patternfly-ng | gulpfile.js | transpileAot | function transpileAot() {
// https://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async
return new Promise(function(resolve, reject) {
// Need to capture the exit code
exec('node_modules/.bin/ngc -p tsconfig-aot.json', function (err, stdout, s... | javascript | function transpileAot() {
// https://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async
return new Promise(function(resolve, reject) {
// Need to capture the exit code
exec('node_modules/.bin/ngc -p tsconfig-aot.json', function (err, stdout, s... | [
"function",
"transpileAot",
"(",
")",
"{",
"// https://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"// Need to capture the... | Build with AOT enabled | [
"Build",
"with",
"AOT",
"enabled"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L203-L216 |
15,585 | patternfly/patternfly-ng | gulpfile.js | updateWatchDist | function updateWatchDist() {
return gulp
.src([libraryDist + '/**'].concat(globalExcludes))
.pipe(changed(watchDist))
.pipe(gulp.dest(watchDist));
} | javascript | function updateWatchDist() {
return gulp
.src([libraryDist + '/**'].concat(globalExcludes))
.pipe(changed(watchDist))
.pipe(gulp.dest(watchDist));
} | [
"function",
"updateWatchDist",
"(",
")",
"{",
"return",
"gulp",
".",
"src",
"(",
"[",
"libraryDist",
"+",
"'/**'",
"]",
".",
"concat",
"(",
"globalExcludes",
")",
")",
".",
"pipe",
"(",
"changed",
"(",
"watchDist",
")",
")",
".",
"pipe",
"(",
"gulp",
... | Update watch dist directory | [
"Update",
"watch",
"dist",
"directory"
] | 06e46d70834d90ef275ddf85bd5e311410c8c943 | https://github.com/patternfly/patternfly-ng/blob/06e46d70834d90ef275ddf85bd5e311410c8c943/gulpfile.js#L240-L245 |
15,586 | pouchdb-community/socket-pouch | lib/client/index.js | checkBinaryReady | function checkBinaryReady(uuid) {
if (!(uuid in api._blobs && uuid in api._binaryMessages)) {
return;
}
log('receive full binary message', uuid);
var blob = api._blobs[uuid];
var msg = api._binaryMessages[uuid];
delete api._blobs[uuid];
delete api._binaryMessages[uuid]... | javascript | function checkBinaryReady(uuid) {
if (!(uuid in api._blobs && uuid in api._binaryMessages)) {
return;
}
log('receive full binary message', uuid);
var blob = api._blobs[uuid];
var msg = api._binaryMessages[uuid];
delete api._blobs[uuid];
delete api._binaryMessages[uuid]... | [
"function",
"checkBinaryReady",
"(",
"uuid",
")",
"{",
"if",
"(",
"!",
"(",
"uuid",
"in",
"api",
".",
"_blobs",
"&&",
"uuid",
"in",
"api",
".",
"_binaryMessages",
")",
")",
"{",
"return",
";",
"}",
"log",
"(",
"'receive full binary message'",
",",
"uuid"... | binary messages come in two parts; wait until we've received both | [
"binary",
"messages",
"come",
"in",
"two",
"parts",
";",
"wait",
"until",
"we",
"ve",
"received",
"both"
] | 6911f9a47b41f579708be74c88c8d227f2f8afdd | https://github.com/pouchdb-community/socket-pouch/blob/6911f9a47b41f579708be74c88c8d227f2f8afdd/lib/client/index.js#L211-L231 |
15,587 | leapmotion/leapjs | lib/controller.js | function(){
if (controller.connection.opts.requestProtocolVersion < 5 && controller.streamingCount == 0){
controller.streamingCount = 1;
var info = {
attached: true,
streaming: true,
type: 'unknown',
id: "Lx00000000000"
};
controller.devices[info.id] = info;
... | javascript | function(){
if (controller.connection.opts.requestProtocolVersion < 5 && controller.streamingCount == 0){
controller.streamingCount = 1;
var info = {
attached: true,
streaming: true,
type: 'unknown',
id: "Lx00000000000"
};
controller.devices[info.id] = info;
... | [
"function",
"(",
")",
"{",
"if",
"(",
"controller",
".",
"connection",
".",
"opts",
".",
"requestProtocolVersion",
"<",
"5",
"&&",
"controller",
".",
"streamingCount",
"==",
"0",
")",
"{",
"controller",
".",
"streamingCount",
"=",
"1",
";",
"var",
"info",
... | here we backfill the 0.5.0 deviceEvents as best possible backfill begin streaming events | [
"here",
"we",
"backfill",
"the",
"0",
".",
"5",
".",
"0",
"deviceEvents",
"as",
"best",
"possible",
"backfill",
"begin",
"streaming",
"events"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/lib/controller.js#L307-L323 | |
15,588 | leapmotion/leapjs | lib/gesture.js | function(data) {
/**
* The center point of the circle within the Leap frame of reference.
*
* @member center
* @memberof Leap.CircleGesture.prototype
* @type {number[]}
*/
this.center = data.center;
/**
* The normal vector for the circle being traced.
*
* If you draw the circle clockwise, the norm... | javascript | function(data) {
/**
* The center point of the circle within the Leap frame of reference.
*
* @member center
* @memberof Leap.CircleGesture.prototype
* @type {number[]}
*/
this.center = data.center;
/**
* The normal vector for the circle being traced.
*
* If you draw the circle clockwise, the norm... | [
"function",
"(",
"data",
")",
"{",
"/**\n * The center point of the circle within the Leap frame of reference.\n *\n * @member center\n * @memberof Leap.CircleGesture.prototype\n * @type {number[]}\n */",
"this",
".",
"center",
"=",
"data",
".",
"center",
";",
"/**\n * The normal ... | Constructs a new CircleGesture object.
An uninitialized CircleGesture object is considered invalid. Get valid instances
of the CircleGesture class from a Frame object.
@class CircleGesture
@memberof Leap
@augments Leap.Gesture
@classdesc
The CircleGesture classes represents a circular finger movement.
A circle movem... | [
"Constructs",
"a",
"new",
"CircleGesture",
"object",
"."
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/lib/gesture.js#L250-L310 | |
15,589 | leapmotion/leapjs | lib/gesture.js | function(data) {
/**
* The starting position within the Leap frame of
* reference, in mm.
*
* @member startPosition
* @memberof Leap.SwipeGesture.prototype
* @type {number[]}
*/
this.startPosition = data.startPosition;
/**
* The current swipe position within the Leap frame of
* reference, in mm.
... | javascript | function(data) {
/**
* The starting position within the Leap frame of
* reference, in mm.
*
* @member startPosition
* @memberof Leap.SwipeGesture.prototype
* @type {number[]}
*/
this.startPosition = data.startPosition;
/**
* The current swipe position within the Leap frame of
* reference, in mm.
... | [
"function",
"(",
"data",
")",
"{",
"/**\n * The starting position within the Leap frame of\n * reference, in mm.\n *\n * @member startPosition\n * @memberof Leap.SwipeGesture.prototype\n * @type {number[]}\n */",
"this",
".",
"startPosition",
"=",
"data",
".",
"startPosition",
";",
... | Constructs a new SwipeGesture object.
An uninitialized SwipeGesture object is considered invalid. Get valid instances
of the SwipeGesture class from a Frame object.
@class SwipeGesture
@memberof Leap
@augments Leap.Gesture
@classdesc
The SwipeGesture class represents a swiping motion of a finger or tool.
![SwipeGest... | [
"Constructs",
"a",
"new",
"SwipeGesture",
"object",
"."
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/lib/gesture.js#L332-L373 | |
15,590 | leapmotion/leapjs | lib/gesture.js | function(data) {
/**
* The position where the key tap is registered.
*
* @member position
* @memberof Leap.KeyTapGesture.prototype
* @type {number[]}
*/
this.position = data.position;
/**
* The direction of finger tip motion.
*
* @member direction
* @membero... | javascript | function(data) {
/**
* The position where the key tap is registered.
*
* @member position
* @memberof Leap.KeyTapGesture.prototype
* @type {number[]}
*/
this.position = data.position;
/**
* The direction of finger tip motion.
*
* @member direction
* @membero... | [
"function",
"(",
"data",
")",
"{",
"/**\n * The position where the key tap is registered.\n *\n * @member position\n * @memberof Leap.KeyTapGesture.prototype\n * @type {number[]}\n */",
"this",
".",
"position",
"=",
"data",
".",
"position",
";",
"/**\n * The d... | Constructs a new KeyTapGesture object.
An uninitialized KeyTapGesture object is considered invalid. Get valid instances
of the KeyTapGesture class from a Frame object.
@class KeyTapGesture
@memberof Leap
@augments Leap.Gesture
@classdesc
The KeyTapGesture class represents a tapping gesture by a finger or tool.
A key... | [
"Constructs",
"a",
"new",
"KeyTapGesture",
"object",
"."
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/lib/gesture.js#L454-L479 | |
15,591 | leapmotion/leapjs | examples/lib/three.js | expand | function expand( v1, v2, pixels ) {
var x = v2.x - v1.x, y = v2.y - v1.y,
det = x * x + y * y, idet;
if ( det === 0 ) return;
idet = pixels / Math.sqrt( det );
x *= idet; y *= idet;
v2.x += x; v2.y += y;
v1.x -= x; v1.y -= y;
} | javascript | function expand( v1, v2, pixels ) {
var x = v2.x - v1.x, y = v2.y - v1.y,
det = x * x + y * y, idet;
if ( det === 0 ) return;
idet = pixels / Math.sqrt( det );
x *= idet; y *= idet;
v2.x += x; v2.y += y;
v1.x -= x; v1.y -= y;
} | [
"function",
"expand",
"(",
"v1",
",",
"v2",
",",
"pixels",
")",
"{",
"var",
"x",
"=",
"v2",
".",
"x",
"-",
"v1",
".",
"x",
",",
"y",
"=",
"v2",
".",
"y",
"-",
"v1",
".",
"y",
",",
"det",
"=",
"x",
"*",
"x",
"+",
"y",
"*",
"y",
",",
"i... | Hide anti-alias gaps | [
"Hide",
"anti",
"-",
"alias",
"gaps"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L17442-L17456 |
15,592 | leapmotion/leapjs | examples/lib/three.js | binarySearchIndices | function binarySearchIndices( value ) {
function binarySearch( start, end ) {
// return closest larger index
// if exact number is not found
if ( end < start )
return start;
var mid = start + Math.floor( ( end - start ) / 2 );
if ( cumulativeAreas[ mid ] > value ) {
return binaryS... | javascript | function binarySearchIndices( value ) {
function binarySearch( start, end ) {
// return closest larger index
// if exact number is not found
if ( end < start )
return start;
var mid = start + Math.floor( ( end - start ) / 2 );
if ( cumulativeAreas[ mid ] > value ) {
return binaryS... | [
"function",
"binarySearchIndices",
"(",
"value",
")",
"{",
"function",
"binarySearch",
"(",
"start",
",",
"end",
")",
"{",
"// return closest larger index",
"// if exact number is not found",
"if",
"(",
"end",
"<",
"start",
")",
"return",
"start",
";",
"var",
"mid... | binary search cumulative areas array | [
"binary",
"search",
"cumulative",
"areas",
"array"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L27739-L27770 |
15,593 | leapmotion/leapjs | examples/lib/three.js | function ( geometry ) {
geometry.computeBoundingBox();
var bb = geometry.boundingBox;
var offset = new THREE.Vector3();
offset.addVectors( bb.min, bb.max );
offset.multiplyScalar( -0.5 );
geometry.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
geometry.computeBoun... | javascript | function ( geometry ) {
geometry.computeBoundingBox();
var bb = geometry.boundingBox;
var offset = new THREE.Vector3();
offset.addVectors( bb.min, bb.max );
offset.multiplyScalar( -0.5 );
geometry.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
geometry.computeBoun... | [
"function",
"(",
"geometry",
")",
"{",
"geometry",
".",
"computeBoundingBox",
"(",
")",
";",
"var",
"bb",
"=",
"geometry",
".",
"boundingBox",
";",
"var",
"offset",
"=",
"new",
"THREE",
".",
"Vector3",
"(",
")",
";",
"offset",
".",
"addVectors",
"(",
"... | Center geometry so that 0,0,0 is in center of bounding box | [
"Center",
"geometry",
"so",
"that",
"0",
"0",
"0",
"is",
"in",
"center",
"of",
"bounding",
"box"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L27825-L27841 | |
15,594 | leapmotion/leapjs | examples/lib/three.js | function ( points, scale ) {
var c = [], v3 = [],
point, intPoint, weight, w2, w3,
pa, pb, pc, pd;
point = ( points.length - 1 ) * scale;
intPoint = Math.floor( point );
weight = point - intPoint;
c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1;
c[ 1 ] = intPoint;
c[ 2 ] = intPoint > points.lengt... | javascript | function ( points, scale ) {
var c = [], v3 = [],
point, intPoint, weight, w2, w3,
pa, pb, pc, pd;
point = ( points.length - 1 ) * scale;
intPoint = Math.floor( point );
weight = point - intPoint;
c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1;
c[ 1 ] = intPoint;
c[ 2 ] = intPoint > points.lengt... | [
"function",
"(",
"points",
",",
"scale",
")",
"{",
"var",
"c",
"=",
"[",
"]",
",",
"v3",
"=",
"[",
"]",
",",
"point",
",",
"intPoint",
",",
"weight",
",",
"w2",
",",
"w3",
",",
"pa",
",",
"pb",
",",
"pc",
",",
"pd",
";",
"point",
"=",
"(",
... | Catmull-Rom spline | [
"Catmull",
"-",
"Rom",
"spline"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L31762-L31791 | |
15,595 | leapmotion/leapjs | examples/lib/three.js | updateVirtualLight | function updateVirtualLight( light, cascade ) {
var virtualLight = light.shadowCascadeArray[ cascade ];
virtualLight.position.copy( light.position );
virtualLight.target.position.copy( light.target.position );
virtualLight.lookAt( virtualLight.target );
virtualLight.shadowCameraVisible = light.shadowCamera... | javascript | function updateVirtualLight( light, cascade ) {
var virtualLight = light.shadowCascadeArray[ cascade ];
virtualLight.position.copy( light.position );
virtualLight.target.position.copy( light.target.position );
virtualLight.lookAt( virtualLight.target );
virtualLight.shadowCameraVisible = light.shadowCamera... | [
"function",
"updateVirtualLight",
"(",
"light",
",",
"cascade",
")",
"{",
"var",
"virtualLight",
"=",
"light",
".",
"shadowCascadeArray",
"[",
"cascade",
"]",
";",
"virtualLight",
".",
"position",
".",
"copy",
"(",
"light",
".",
"position",
")",
";",
"virtua... | Synchronize virtual light with the original light | [
"Synchronize",
"virtual",
"light",
"with",
"the",
"original",
"light"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L37655-L37683 |
15,596 | leapmotion/leapjs | examples/lib/three.js | updateShadowCamera | function updateShadowCamera( camera, light ) {
var shadowCamera = light.shadowCamera,
pointsFrustum = light.pointsFrustum,
pointsWorld = light.pointsWorld;
_min.set( Infinity, Infinity, Infinity );
_max.set( -Infinity, -Infinity, -Infinity );
for ( var i = 0; i < 8; i ++ ) {
var p = pointsWorld[ i ... | javascript | function updateShadowCamera( camera, light ) {
var shadowCamera = light.shadowCamera,
pointsFrustum = light.pointsFrustum,
pointsWorld = light.pointsWorld;
_min.set( Infinity, Infinity, Infinity );
_max.set( -Infinity, -Infinity, -Infinity );
for ( var i = 0; i < 8; i ++ ) {
var p = pointsWorld[ i ... | [
"function",
"updateShadowCamera",
"(",
"camera",
",",
"light",
")",
"{",
"var",
"shadowCamera",
"=",
"light",
".",
"shadowCamera",
",",
"pointsFrustum",
"=",
"light",
".",
"pointsFrustum",
",",
"pointsWorld",
"=",
"light",
".",
"pointsWorld",
";",
"_min",
".",... | Fit shadow camera's ortho frustum to camera frustum | [
"Fit",
"shadow",
"camera",
"s",
"ortho",
"frustum",
"to",
"camera",
"frustum"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L37687-L37727 |
15,597 | leapmotion/leapjs | examples/lib/three.js | getObjectMaterial | function getObjectMaterial( object ) {
return object.material instanceof THREE.MeshFaceMaterial
? object.material.materials[ 0 ]
: object.material;
} | javascript | function getObjectMaterial( object ) {
return object.material instanceof THREE.MeshFaceMaterial
? object.material.materials[ 0 ]
: object.material;
} | [
"function",
"getObjectMaterial",
"(",
"object",
")",
"{",
"return",
"object",
".",
"material",
"instanceof",
"THREE",
".",
"MeshFaceMaterial",
"?",
"object",
".",
"material",
".",
"materials",
"[",
"0",
"]",
":",
"object",
".",
"material",
";",
"}"
] | For the moment just ignore objects that have multiple materials with different animation methods Only the first material will be taken into account for deciding which depth material to use for shadow maps | [
"For",
"the",
"moment",
"just",
"ignore",
"objects",
"that",
"have",
"multiple",
"materials",
"with",
"different",
"animation",
"methods",
"Only",
"the",
"first",
"material",
"will",
"be",
"taken",
"into",
"account",
"for",
"deciding",
"which",
"depth",
"materia... | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/three.js#L37732-L37738 |
15,598 | leapmotion/leapjs | examples/lib/leap-plugins-0.1.6.js | function(){
this.frameIndex++;
if (this.frameIndex >= this.rightCropPosition) {
this.frameIndex = this.frameIndex % (this.rightCropPosition || 1);
if ((this.frameIndex < this.leftCropPosition)) {
this.frameIndex = this.leftCropPosition;
}
}else{
this.frameIndex--;
}
} | javascript | function(){
this.frameIndex++;
if (this.frameIndex >= this.rightCropPosition) {
this.frameIndex = this.frameIndex % (this.rightCropPosition || 1);
if ((this.frameIndex < this.leftCropPosition)) {
this.frameIndex = this.leftCropPosition;
}
}else{
this.frameIndex--;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"frameIndex",
"++",
";",
"if",
"(",
"this",
".",
"frameIndex",
">=",
"this",
".",
"rightCropPosition",
")",
"{",
"this",
".",
"frameIndex",
"=",
"this",
".",
"frameIndex",
"%",
"(",
"this",
".",
"rightCropPosition"... | resets to beginning if at end | [
"resets",
"to",
"beginning",
"if",
"at",
"end"
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/leap-plugins-0.1.6.js#L996-L1007 | |
15,599 | leapmotion/leapjs | examples/lib/leap-plugins-0.1.6.js | function (factor) {
console.log('cull frames', factor);
factor || (factor = 1);
for (var i = 0; i < this.frameData.length; i++) {
this.frameData.splice(i, factor);
}
this.setMetaData();
} | javascript | function (factor) {
console.log('cull frames', factor);
factor || (factor = 1);
for (var i = 0; i < this.frameData.length; i++) {
this.frameData.splice(i, factor);
}
this.setMetaData();
} | [
"function",
"(",
"factor",
")",
"{",
"console",
".",
"log",
"(",
"'cull frames'",
",",
"factor",
")",
";",
"factor",
"||",
"(",
"factor",
"=",
"1",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"frameData",
".",
"length"... | removes every other frame from the array Accepts an optional `factor` integer, which is the number of frames discarded for every frame kept. | [
"removes",
"every",
"other",
"frame",
"from",
"the",
"array",
"Accepts",
"an",
"optional",
"factor",
"integer",
"which",
"is",
"the",
"number",
"of",
"frames",
"discarded",
"for",
"every",
"frame",
"kept",
"."
] | 31b00723f98077304acda3200f9fbcbaaf29294a | https://github.com/leapmotion/leapjs/blob/31b00723f98077304acda3200f9fbcbaaf29294a/examples/lib/leap-plugins-0.1.6.js#L1115-L1122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.