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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,600 | SAP/chevrotain | examples/grammars/tinyc/tinyc.js | createToken | function createToken(options) {
const newToken = chevrotain.createToken(options)
allTokens.push(newToken)
return newToken
} | javascript | function createToken(options) {
const newToken = chevrotain.createToken(options)
allTokens.push(newToken)
return newToken
} | [
"function",
"createToken",
"(",
"options",
")",
"{",
"const",
"newToken",
"=",
"chevrotain",
".",
"createToken",
"(",
"options",
")",
"allTokens",
".",
"push",
"(",
"newToken",
")",
"return",
"newToken",
"}"
] | Utility to avoid manually building the allTokens array | [
"Utility",
"to",
"avoid",
"manually",
"building",
"the",
"allTokens",
"array"
] | 1ffe6c74590af8af037dc638d787602571a10a0e | https://github.com/SAP/chevrotain/blob/1ffe6c74590af8af037dc638d787602571a10a0e/examples/grammars/tinyc/tinyc.js#L13-L17 |
11,601 | SAP/chevrotain | examples/tutorial/tutorial_spec.js | minimizeCst | function minimizeCst(cstElement) {
// tokenType idx is auto generated, can't assert over it
if (cstElement.tokenType) {
delete cstElement.tokenType
}
// CstNode
if (cstElement.children !== undefined) {
cstElement.children = _.o... | javascript | function minimizeCst(cstElement) {
// tokenType idx is auto generated, can't assert over it
if (cstElement.tokenType) {
delete cstElement.tokenType
}
// CstNode
if (cstElement.children !== undefined) {
cstElement.children = _.o... | [
"function",
"minimizeCst",
"(",
"cstElement",
")",
"{",
"// tokenType idx is auto generated, can't assert over it",
"if",
"(",
"cstElement",
".",
"tokenType",
")",
"{",
"delete",
"cstElement",
".",
"tokenType",
"}",
"// CstNode",
"if",
"(",
"cstElement",
".",
"childre... | to make it easier to understand the assertions | [
"to",
"make",
"it",
"easier",
"to",
"understand",
"the",
"assertions"
] | 1ffe6c74590af8af037dc638d787602571a10a0e | https://github.com/SAP/chevrotain/blob/1ffe6c74590af8af037dc638d787602571a10a0e/examples/tutorial/tutorial_spec.js#L115-L130 |
11,602 | SAP/chevrotain | examples/custom_apis/combinator/combinator_api.js | toOriginalText | function toOriginalText(item) {
if (_.has(item, "tokenName")) {
return item.tokenName
} else if (item instanceof Rule) {
return item.name
} else if (_.isString(item)) {
return item
} else if (_.has(item, "toRule")) {
return item.definition.orgText
} else {
thr... | javascript | function toOriginalText(item) {
if (_.has(item, "tokenName")) {
return item.tokenName
} else if (item instanceof Rule) {
return item.name
} else if (_.isString(item)) {
return item
} else if (_.has(item, "toRule")) {
return item.definition.orgText
} else {
thr... | [
"function",
"toOriginalText",
"(",
"item",
")",
"{",
"if",
"(",
"_",
".",
"has",
"(",
"item",
",",
"\"tokenName\"",
")",
")",
"{",
"return",
"item",
".",
"tokenName",
"}",
"else",
"if",
"(",
"item",
"instanceof",
"Rule",
")",
"{",
"return",
"item",
"... | Attempts to reconstruct the original api usage text
for better error message purposes. | [
"Attempts",
"to",
"reconstruct",
"the",
"original",
"api",
"usage",
"text",
"for",
"better",
"error",
"message",
"purposes",
"."
] | 1ffe6c74590af8af037dc638d787602571a10a0e | https://github.com/SAP/chevrotain/blob/1ffe6c74590af8af037dc638d787602571a10a0e/examples/custom_apis/combinator/combinator_api.js#L150-L162 |
11,603 | d3/d3-hierarchy | src/tree.js | nextRight | function nextRight(v) {
var children = v.children;
return children ? children[children.length - 1] : v.t;
} | javascript | function nextRight(v) {
var children = v.children;
return children ? children[children.length - 1] : v.t;
} | [
"function",
"nextRight",
"(",
"v",
")",
"{",
"var",
"children",
"=",
"v",
".",
"children",
";",
"return",
"children",
"?",
"children",
"[",
"children",
".",
"length",
"-",
"1",
"]",
":",
"v",
".",
"t",
";",
"}"
] | This function works analogously to nextLeft. | [
"This",
"function",
"works",
"analogously",
"to",
"nextLeft",
"."
] | 7d22381f87ac7e28ff58f725e70f0a40f5b1c625 | https://github.com/d3/d3-hierarchy/blob/7d22381f87ac7e28ff58f725e70f0a40f5b1c625/src/tree.js#L21-L24 |
11,604 | d3/d3-hierarchy | src/tree.js | firstWalk | function firstWalk(v) {
var children = v.children,
siblings = v.parent.children,
w = v.i ? siblings[v.i - 1] : null;
if (children) {
executeShifts(v);
var midpoint = (children[0].z + children[children.length - 1].z) / 2;
if (w) {
v.z = w.z + separation(v._, w._);
... | javascript | function firstWalk(v) {
var children = v.children,
siblings = v.parent.children,
w = v.i ? siblings[v.i - 1] : null;
if (children) {
executeShifts(v);
var midpoint = (children[0].z + children[children.length - 1].z) / 2;
if (w) {
v.z = w.z + separation(v._, w._);
... | [
"function",
"firstWalk",
"(",
"v",
")",
"{",
"var",
"children",
"=",
"v",
".",
"children",
",",
"siblings",
"=",
"v",
".",
"parent",
".",
"children",
",",
"w",
"=",
"v",
".",
"i",
"?",
"siblings",
"[",
"v",
".",
"i",
"-",
"1",
"]",
":",
"null",... | Computes a preliminary x-coordinate for v. Before that, FIRST WALK is applied recursively to the children of v, as well as the function APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the node v is placed to the midpoint of its outermost children. | [
"Computes",
"a",
"preliminary",
"x",
"-",
"coordinate",
"for",
"v",
".",
"Before",
"that",
"FIRST",
"WALK",
"is",
"applied",
"recursively",
"to",
"the",
"children",
"of",
"v",
"as",
"well",
"as",
"the",
"function",
"APPORTION",
".",
"After",
"spacing",
"ou... | 7d22381f87ac7e28ff58f725e70f0a40f5b1c625 | https://github.com/d3/d3-hierarchy/blob/7d22381f87ac7e28ff58f725e70f0a40f5b1c625/src/tree.js#L144-L161 |
11,605 | imsky/holder | holder.js | function(name, theme) {
name != null && theme != null && (App.settings.themes[name] = theme);
delete App.vars.cache.themeKeys;
return this;
} | javascript | function(name, theme) {
name != null && theme != null && (App.settings.themes[name] = theme);
delete App.vars.cache.themeKeys;
return this;
} | [
"function",
"(",
"name",
",",
"theme",
")",
"{",
"name",
"!=",
"null",
"&&",
"theme",
"!=",
"null",
"&&",
"(",
"App",
".",
"settings",
".",
"themes",
"[",
"name",
"]",
"=",
"theme",
")",
";",
"delete",
"App",
".",
"vars",
".",
"cache",
".",
"them... | Adds a theme to default settings
@param {string} name Theme name
@param {Object} theme Theme object, with foreground, background, size, font, and fontweight properties. | [
"Adds",
"a",
"theme",
"to",
"default",
"settings"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L349-L353 | |
11,606 | imsky/holder | holder.js | function(src, el) {
//todo: use jquery fallback if available for all QSA references
var nodes = DOM.getNodeArray(el);
nodes.forEach(function (node) {
var img = DOM.newEl('img');
var domProps = {};
domProps[App.setup.dataAttr] = src;
DOM.setA... | javascript | function(src, el) {
//todo: use jquery fallback if available for all QSA references
var nodes = DOM.getNodeArray(el);
nodes.forEach(function (node) {
var img = DOM.newEl('img');
var domProps = {};
domProps[App.setup.dataAttr] = src;
DOM.setA... | [
"function",
"(",
"src",
",",
"el",
")",
"{",
"//todo: use jquery fallback if available for all QSA references",
"var",
"nodes",
"=",
"DOM",
".",
"getNodeArray",
"(",
"el",
")",
";",
"nodes",
".",
"forEach",
"(",
"function",
"(",
"node",
")",
"{",
"var",
"img",... | Appends a placeholder to an element
@param {string} src Placeholder URL string
@param el A selector or a reference to a DOM node | [
"Appends",
"a",
"placeholder",
"to",
"an",
"element"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L361-L372 | |
11,607 | imsky/holder | holder.js | function(el, value) {
if (el.holderData) {
el.holderData.resizeUpdate = !!value;
if (el.holderData.resizeUpdate) {
updateResizableElements(el);
}
}
} | javascript | function(el, value) {
if (el.holderData) {
el.holderData.resizeUpdate = !!value;
if (el.holderData.resizeUpdate) {
updateResizableElements(el);
}
}
} | [
"function",
"(",
"el",
",",
"value",
")",
"{",
"if",
"(",
"el",
".",
"holderData",
")",
"{",
"el",
".",
"holderData",
".",
"resizeUpdate",
"=",
"!",
"!",
"value",
";",
"if",
"(",
"el",
".",
"holderData",
".",
"resizeUpdate",
")",
"{",
"updateResizabl... | Sets whether or not an image is updated on resize.
If an image is set to be updated, it is immediately rendered.
@param {Object} el Image DOM element
@param {Boolean} value Resizable update flag value | [
"Sets",
"whether",
"or",
"not",
"an",
"image",
"is",
"updated",
"on",
"resize",
".",
"If",
"an",
"image",
"is",
"set",
"to",
"be",
"updated",
"it",
"is",
"immediately",
"rendered",
"."
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L381-L388 | |
11,608 | imsky/holder | holder.js | prepareImageElement | function prepareImageElement(options, engineSettings, src, el) {
var holderFlags = parseURL(src.substr(src.lastIndexOf(options.domain)), options);
if (holderFlags) {
prepareDOMElement({
mode: null,
el: el,
flags: holderFlags,
engineSettings: engineS... | javascript | function prepareImageElement(options, engineSettings, src, el) {
var holderFlags = parseURL(src.substr(src.lastIndexOf(options.domain)), options);
if (holderFlags) {
prepareDOMElement({
mode: null,
el: el,
flags: holderFlags,
engineSettings: engineS... | [
"function",
"prepareImageElement",
"(",
"options",
",",
"engineSettings",
",",
"src",
",",
"el",
")",
"{",
"var",
"holderFlags",
"=",
"parseURL",
"(",
"src",
".",
"substr",
"(",
"src",
".",
"lastIndexOf",
"(",
"options",
".",
"domain",
")",
")",
",",
"op... | Processes provided source attribute and sets up the appropriate rendering workflow
@private
@param options Instance options from Holder.run
@param renderSettings Instance configuration
@param src Image URL
@param el Image DOM element | [
"Processes",
"provided",
"source",
"attribute",
"and",
"sets",
"up",
"the",
"appropriate",
"rendering",
"workflow"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L576-L586 |
11,609 | imsky/holder | holder.js | render | function render(renderSettings) {
var image = null;
var mode = renderSettings.mode;
var el = renderSettings.el;
var holderSettings = renderSettings.holderSettings;
var engineSettings = renderSettings.engineSettings;
switch (engineSettings.renderer) {
case 'svg':
if (... | javascript | function render(renderSettings) {
var image = null;
var mode = renderSettings.mode;
var el = renderSettings.el;
var holderSettings = renderSettings.holderSettings;
var engineSettings = renderSettings.engineSettings;
switch (engineSettings.renderer) {
case 'svg':
if (... | [
"function",
"render",
"(",
"renderSettings",
")",
"{",
"var",
"image",
"=",
"null",
";",
"var",
"mode",
"=",
"renderSettings",
".",
"mode",
";",
"var",
"el",
"=",
"renderSettings",
".",
"el",
";",
"var",
"holderSettings",
"=",
"renderSettings",
".",
"holde... | Core function that takes output from renderers and sets it as the source or background-image of the target element
@private
@param renderSettings Renderer settings | [
"Core",
"function",
"that",
"takes",
"output",
"from",
"renderers",
"and",
"sets",
"it",
"as",
"the",
"source",
"or",
"background",
"-",
"image",
"of",
"the",
"target",
"element"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L862-L954 |
11,610 | imsky/holder | holder.js | textSize | function textSize(width, height, fontSize, scale) {
var stageWidth = parseInt(width, 10);
var stageHeight = parseInt(height, 10);
var bigSide = Math.max(stageWidth, stageHeight);
var smallSide = Math.min(stageWidth, stageHeight);
var newHeight = 0.8 * Math.min(smallSide, bigSide * scale);
... | javascript | function textSize(width, height, fontSize, scale) {
var stageWidth = parseInt(width, 10);
var stageHeight = parseInt(height, 10);
var bigSide = Math.max(stageWidth, stageHeight);
var smallSide = Math.min(stageWidth, stageHeight);
var newHeight = 0.8 * Math.min(smallSide, bigSide * scale);
... | [
"function",
"textSize",
"(",
"width",
",",
"height",
",",
"fontSize",
",",
"scale",
")",
"{",
"var",
"stageWidth",
"=",
"parseInt",
"(",
"width",
",",
"10",
")",
";",
"var",
"stageHeight",
"=",
"parseInt",
"(",
"height",
",",
"10",
")",
";",
"var",
"... | Adaptive text sizing function
@private
@param width Parent width
@param height Parent height
@param fontSize Requested text size
@param scale Proportional scale of text | [
"Adaptive",
"text",
"sizing",
"function"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1150-L1159 |
11,611 | imsky/holder | holder.js | setInitialDimensions | function setInitialDimensions(el) {
if (el.holderData) {
var dimensions = dimensionCheck(el);
if (dimensions) {
var flags = el.holderData.flags;
var fluidConfig = {
fluidHeight: flags.dimensions.height.slice(-1) == '%',
fluidWidth: flag... | javascript | function setInitialDimensions(el) {
if (el.holderData) {
var dimensions = dimensionCheck(el);
if (dimensions) {
var flags = el.holderData.flags;
var fluidConfig = {
fluidHeight: flags.dimensions.height.slice(-1) == '%',
fluidWidth: flag... | [
"function",
"setInitialDimensions",
"(",
"el",
")",
"{",
"if",
"(",
"el",
".",
"holderData",
")",
"{",
"var",
"dimensions",
"=",
"dimensionCheck",
"(",
"el",
")",
";",
"if",
"(",
"dimensions",
")",
"{",
"var",
"flags",
"=",
"el",
".",
"holderData",
"."... | Sets up aspect ratio metadata for fluid placeholders, in order to preserve proportions when resizing
@private
@param el Image DOM element | [
"Sets",
"up",
"aspect",
"ratio",
"metadata",
"for",
"fluid",
"placeholders",
"in",
"order",
"to",
"preserve",
"proportions",
"when",
"resizing"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1226-L1252 |
11,612 | imsky/holder | holder.js | visibilityCheck | function visibilityCheck() {
var renderableImages = [];
var keys = Object.keys(App.vars.invisibleImages);
var el;
keys.forEach(function (key) {
el = App.vars.invisibleImages[key];
if (dimensionCheck(el) && el.nodeName.toLowerCase() == 'img') {
renderableImages.push(el... | javascript | function visibilityCheck() {
var renderableImages = [];
var keys = Object.keys(App.vars.invisibleImages);
var el;
keys.forEach(function (key) {
el = App.vars.invisibleImages[key];
if (dimensionCheck(el) && el.nodeName.toLowerCase() == 'img') {
renderableImages.push(el... | [
"function",
"visibilityCheck",
"(",
")",
"{",
"var",
"renderableImages",
"=",
"[",
"]",
";",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"App",
".",
"vars",
".",
"invisibleImages",
")",
";",
"var",
"el",
";",
"keys",
".",
"forEach",
"(",
"function"... | Iterates through all current invisible images, and if they're visible, renders them and removes them from further checks. Runs every animation frame.
@private | [
"Iterates",
"through",
"all",
"current",
"invisible",
"images",
"and",
"if",
"they",
"re",
"visible",
"renders",
"them",
"and",
"removes",
"them",
"from",
"further",
"checks",
".",
"Runs",
"every",
"animation",
"frame",
"."
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1259-L1282 |
11,613 | imsky/holder | holder.js | startVisibilityCheck | function startVisibilityCheck() {
if (!App.vars.visibilityCheckStarted) {
global.requestAnimationFrame(visibilityCheck);
App.vars.visibilityCheckStarted = true;
}
} | javascript | function startVisibilityCheck() {
if (!App.vars.visibilityCheckStarted) {
global.requestAnimationFrame(visibilityCheck);
App.vars.visibilityCheckStarted = true;
}
} | [
"function",
"startVisibilityCheck",
"(",
")",
"{",
"if",
"(",
"!",
"App",
".",
"vars",
".",
"visibilityCheckStarted",
")",
"{",
"global",
".",
"requestAnimationFrame",
"(",
"visibilityCheck",
")",
";",
"App",
".",
"vars",
".",
"visibilityCheckStarted",
"=",
"t... | Starts checking for invisible placeholders if not doing so yet. Does nothing otherwise.
@private | [
"Starts",
"checking",
"for",
"invisible",
"placeholders",
"if",
"not",
"doing",
"so",
"yet",
".",
"Does",
"nothing",
"otherwise",
"."
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1289-L1294 |
11,614 | imsky/holder | holder.js | setInvisible | function setInvisible(el) {
if (!el.holderData.invisibleId) {
App.vars.invisibleId += 1;
App.vars.invisibleImages['i' + App.vars.invisibleId] = el;
el.holderData.invisibleId = App.vars.invisibleId;
}
} | javascript | function setInvisible(el) {
if (!el.holderData.invisibleId) {
App.vars.invisibleId += 1;
App.vars.invisibleImages['i' + App.vars.invisibleId] = el;
el.holderData.invisibleId = App.vars.invisibleId;
}
} | [
"function",
"setInvisible",
"(",
"el",
")",
"{",
"if",
"(",
"!",
"el",
".",
"holderData",
".",
"invisibleId",
")",
"{",
"App",
".",
"vars",
".",
"invisibleId",
"+=",
"1",
";",
"App",
".",
"vars",
".",
"invisibleImages",
"[",
"'i'",
"+",
"App",
".",
... | Sets a unique ID for an image detected to be invisible and adds it to the map of invisible images checked by visibilityCheck
@private
@param el Invisible DOM element | [
"Sets",
"a",
"unique",
"ID",
"for",
"an",
"image",
"detected",
"to",
"be",
"invisible",
"and",
"adds",
"it",
"to",
"the",
"map",
"of",
"invisible",
"images",
"checked",
"by",
"visibilityCheck"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1302-L1308 |
11,615 | imsky/holder | holder.js | debounce | function debounce(fn) {
if (!App.vars.debounceTimer) fn.call(this);
if (App.vars.debounceTimer) global.clearTimeout(App.vars.debounceTimer);
App.vars.debounceTimer = global.setTimeout(function() {
App.vars.debounceTimer = null;
fn.call(this);
}, App.setup.debounce);
} | javascript | function debounce(fn) {
if (!App.vars.debounceTimer) fn.call(this);
if (App.vars.debounceTimer) global.clearTimeout(App.vars.debounceTimer);
App.vars.debounceTimer = global.setTimeout(function() {
App.vars.debounceTimer = null;
fn.call(this);
}, App.setup.debounce);
} | [
"function",
"debounce",
"(",
"fn",
")",
"{",
"if",
"(",
"!",
"App",
".",
"vars",
".",
"debounceTimer",
")",
"fn",
".",
"call",
"(",
"this",
")",
";",
"if",
"(",
"App",
".",
"vars",
".",
"debounceTimer",
")",
"global",
".",
"clearTimeout",
"(",
"App... | Helpers
Prevents a function from being called too often, waits until a timer elapses to call it again
@param fn Function to call | [
"Helpers",
"Prevents",
"a",
"function",
"from",
"being",
"called",
"too",
"often",
"waits",
"until",
"a",
"timer",
"elapses",
"to",
"call",
"it",
"again"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1419-L1426 |
11,616 | imsky/holder | holder.js | completed | function completed( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {
detach();
ready();
}
} | javascript | function completed( event ) {
// readyState === "complete" is good enough for us to call the dom ready in oldIE
if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {
detach();
ready();
}
} | [
"function",
"completed",
"(",
"event",
")",
"{",
"// readyState === \"complete\" is good enough for us to call the dom ready in oldIE",
"if",
"(",
"w3c",
"||",
"event",
".",
"type",
"===",
"LOAD",
"||",
"doc",
"[",
"READYSTATE",
"]",
"===",
"COMPLETE",
")",
"{",
"de... | The ready event handler | [
"The",
"ready",
"event",
"handler"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1582-L1588 |
11,617 | imsky/holder | holder.js | detach | function detach() {
if ( w3c ) {
doc[REMOVEEVENTLISTENER]( DOMCONTENTLOADED, completed, FALSE );
win[REMOVEEVENTLISTENER]( LOAD, completed, FALSE );
} else {
doc[DETACHEVENT]( ONREADYSTATECHANGE, completed );
win[DETACHEVENT]( ONLOAD, completed );
... | javascript | function detach() {
if ( w3c ) {
doc[REMOVEEVENTLISTENER]( DOMCONTENTLOADED, completed, FALSE );
win[REMOVEEVENTLISTENER]( LOAD, completed, FALSE );
} else {
doc[DETACHEVENT]( ONREADYSTATECHANGE, completed );
win[DETACHEVENT]( ONLOAD, completed );
... | [
"function",
"detach",
"(",
")",
"{",
"if",
"(",
"w3c",
")",
"{",
"doc",
"[",
"REMOVEEVENTLISTENER",
"]",
"(",
"DOMCONTENTLOADED",
",",
"completed",
",",
"FALSE",
")",
";",
"win",
"[",
"REMOVEEVENTLISTENER",
"]",
"(",
"LOAD",
",",
"completed",
",",
"FALSE... | Clean-up method for dom ready events | [
"Clean",
"-",
"up",
"method",
"for",
"dom",
"ready",
"events"
] | 220827ebe4097b9a76f150590f8bdf521803aba8 | https://github.com/imsky/holder/blob/220827ebe4097b9a76f150590f8bdf521803aba8/holder.js#L1591-L1599 |
11,618 | wix/react-templates | src/utils.js | usesScopeName | function usesScopeName(scopeNames, node) {
function usesScope(root) {
return usesScopeName(scopeNames, root)
}
if (_.isEmpty(scopeNames)) {
return false
}
// rt-if="x"
if (node.type === 'Identifier') {
return _.includes(scopeNames, node.name)
}
// rt-if="e({key1: ... | javascript | function usesScopeName(scopeNames, node) {
function usesScope(root) {
return usesScopeName(scopeNames, root)
}
if (_.isEmpty(scopeNames)) {
return false
}
// rt-if="x"
if (node.type === 'Identifier') {
return _.includes(scopeNames, node.name)
}
// rt-if="e({key1: ... | [
"function",
"usesScopeName",
"(",
"scopeNames",
",",
"node",
")",
"{",
"function",
"usesScope",
"(",
"root",
")",
"{",
"return",
"usesScopeName",
"(",
"scopeNames",
",",
"root",
")",
"}",
"if",
"(",
"_",
".",
"isEmpty",
"(",
"scopeNames",
")",
")",
"{",
... | return true if any node in the given tree uses a scope name from the given set, false - otherwise.
@param scopeNames a set of scope names to find
@param node root of a syntax tree generated from an ExpressionStatement or one of its children. | [
"return",
"true",
"if",
"any",
"node",
"in",
"the",
"given",
"tree",
"uses",
"a",
"scope",
"name",
"from",
"the",
"given",
"set",
"false",
"-",
"otherwise",
"."
] | becfc2b789c412c9189c35dc900ab6185713cdae | https://github.com/wix/react-templates/blob/becfc2b789c412c9189c35dc900ab6185713cdae/src/utils.js#L91-L131 |
11,619 | wix/react-templates | src/reactTemplates.js | parseScopeSyntax | function parseScopeSyntax(text) {
// the regex below was built using the following pseudo-code:
// double_quoted_string = `"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"`
// single_quoted_string = `'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'`
// text_out_of_quotes = `[^"']*?`
// expr_parts = double_quoted_string + "|" + single_... | javascript | function parseScopeSyntax(text) {
// the regex below was built using the following pseudo-code:
// double_quoted_string = `"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"`
// single_quoted_string = `'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'`
// text_out_of_quotes = `[^"']*?`
// expr_parts = double_quoted_string + "|" + single_... | [
"function",
"parseScopeSyntax",
"(",
"text",
")",
"{",
"// the regex below was built using the following pseudo-code:",
"// double_quoted_string = `\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"`",
"// single_quoted_string = `'[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*'`",
"// text_out_of_quotes = `... | Parses the rt-scope attribute returning an array of parsed sections
@param {String} scope The scope attribute to parse
@returns {Array} an array of {expression,identifier}
@throws {String} the part of the string that failed to parse | [
"Parses",
"the",
"rt",
"-",
"scope",
"attribute",
"returning",
"an",
"array",
"of",
"parsed",
"sections"
] | becfc2b789c412c9189c35dc900ab6185713cdae | https://github.com/wix/react-templates/blob/becfc2b789c412c9189c35dc900ab6185713cdae/src/reactTemplates.js#L479-L508 |
11,620 | wix/react-templates | src/cli.js | execute | function execute(args) {
try {
const currentOptions = options.parse(args)
return executeOptions(currentOptions)
} catch (error) {
console.error(error.message)
return 1
}
} | javascript | function execute(args) {
try {
const currentOptions = options.parse(args)
return executeOptions(currentOptions)
} catch (error) {
console.error(error.message)
return 1
}
} | [
"function",
"execute",
"(",
"args",
")",
"{",
"try",
"{",
"const",
"currentOptions",
"=",
"options",
".",
"parse",
"(",
"args",
")",
"return",
"executeOptions",
"(",
"currentOptions",
")",
"}",
"catch",
"(",
"error",
")",
"{",
"console",
".",
"error",
"(... | Executes the CLI based on an array of arguments that is passed in.
@param {string|Array|Object} args The arguments to process.
@returns {int} The exit code for the operation. | [
"Executes",
"the",
"CLI",
"based",
"on",
"an",
"array",
"of",
"arguments",
"that",
"is",
"passed",
"in",
"."
] | becfc2b789c412c9189c35dc900ab6185713cdae | https://github.com/wix/react-templates/blob/becfc2b789c412c9189c35dc900ab6185713cdae/src/cli.js#L95-L103 |
11,621 | AnalyticalGraphicsInc/obj2gltf | lib/getJsonBufferPadded.js | getJsonBufferPadded | function getJsonBufferPadded(json) {
let string = JSON.stringify(json);
const boundary = 4;
const byteLength = Buffer.byteLength(string);
const remainder = byteLength % boundary;
const padding = (remainder === 0) ? 0 : boundary - remainder;
let whitespace = '';
for (let i = 0; i < padding; ... | javascript | function getJsonBufferPadded(json) {
let string = JSON.stringify(json);
const boundary = 4;
const byteLength = Buffer.byteLength(string);
const remainder = byteLength % boundary;
const padding = (remainder === 0) ? 0 : boundary - remainder;
let whitespace = '';
for (let i = 0; i < padding; ... | [
"function",
"getJsonBufferPadded",
"(",
"json",
")",
"{",
"let",
"string",
"=",
"JSON",
".",
"stringify",
"(",
"json",
")",
";",
"const",
"boundary",
"=",
"4",
";",
"const",
"byteLength",
"=",
"Buffer",
".",
"byteLength",
"(",
"string",
")",
";",
"const"... | Convert the JSON object to a padded buffer.
Pad the JSON with extra whitespace to fit the next 4-byte boundary. This ensures proper alignment
for the section that follows.
@param {Object} [json] The JSON object.
@returns {Buffer} The padded JSON buffer.
@private | [
"Convert",
"the",
"JSON",
"object",
"to",
"a",
"padded",
"buffer",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/getJsonBufferPadded.js#L15-L29 |
11,622 | AnalyticalGraphicsInc/obj2gltf | lib/readLines.js | readLines | function readLines(path, callback) {
return new Promise(function(resolve, reject) {
const stream = fsExtra.createReadStream(path);
stream.on('error', reject);
stream.on('end', resolve);
const lineReader = readline.createInterface({
input : stream
});
line... | javascript | function readLines(path, callback) {
return new Promise(function(resolve, reject) {
const stream = fsExtra.createReadStream(path);
stream.on('error', reject);
stream.on('end', resolve);
const lineReader = readline.createInterface({
input : stream
});
line... | [
"function",
"readLines",
"(",
"path",
",",
"callback",
")",
"{",
"return",
"new",
"Promise",
"(",
"function",
"(",
"resolve",
",",
"reject",
")",
"{",
"const",
"stream",
"=",
"fsExtra",
".",
"createReadStream",
"(",
"path",
")",
";",
"stream",
".",
"on",... | Read a file line-by-line.
@param {String} path Path to the file.
@param {Function} callback Function to call when reading each line.
@returns {Promise} A promise when the reader is finished.
@private | [
"Read",
"a",
"file",
"line",
"-",
"by",
"-",
"line",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/readLines.js#L17-L28 |
11,623 | AnalyticalGraphicsInc/obj2gltf | lib/gltfToGlb.js | gltfToGlb | function gltfToGlb(gltf, binaryBuffer) {
const buffer = gltf.buffers[0];
if (defined(buffer.uri)) {
binaryBuffer = Buffer.alloc(0);
}
// Create padded binary scene string
const jsonBuffer = getJsonBufferPadded(gltf);
// Allocate buffer (Global header) + (JSON chunk header) + (JSON chun... | javascript | function gltfToGlb(gltf, binaryBuffer) {
const buffer = gltf.buffers[0];
if (defined(buffer.uri)) {
binaryBuffer = Buffer.alloc(0);
}
// Create padded binary scene string
const jsonBuffer = getJsonBufferPadded(gltf);
// Allocate buffer (Global header) + (JSON chunk header) + (JSON chun... | [
"function",
"gltfToGlb",
"(",
"gltf",
",",
"binaryBuffer",
")",
"{",
"const",
"buffer",
"=",
"gltf",
".",
"buffers",
"[",
"0",
"]",
";",
"if",
"(",
"defined",
"(",
"buffer",
".",
"uri",
")",
")",
"{",
"binaryBuffer",
"=",
"Buffer",
".",
"alloc",
"(",... | Convert a glTF to binary glTF.
The glTF is expected to have a single buffer and all embedded resources stored in bufferViews.
@param {Object} gltf The glTF asset.
@param {Buffer} binaryBuffer The binary buffer.
@returns {Buffer} The glb buffer.
@private | [
"Convert",
"a",
"glTF",
"to",
"binary",
"glTF",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/gltfToGlb.js#L20-L61 |
11,624 | AnalyticalGraphicsInc/obj2gltf | lib/obj2gltf.js | obj2gltf | function obj2gltf(objPath, options) {
const defaults = obj2gltf.defaults;
options = defaultValue(options, {});
options.binary = defaultValue(options.binary, defaults.binary);
options.separate = defaultValue(options.separate, defaults.separate);
options.separateTextures = defaultValue(options.separat... | javascript | function obj2gltf(objPath, options) {
const defaults = obj2gltf.defaults;
options = defaultValue(options, {});
options.binary = defaultValue(options.binary, defaults.binary);
options.separate = defaultValue(options.separate, defaults.separate);
options.separateTextures = defaultValue(options.separat... | [
"function",
"obj2gltf",
"(",
"objPath",
",",
"options",
")",
"{",
"const",
"defaults",
"=",
"obj2gltf",
".",
"defaults",
";",
"options",
"=",
"defaultValue",
"(",
"options",
",",
"{",
"}",
")",
";",
"options",
".",
"binary",
"=",
"defaultValue",
"(",
"op... | Converts an obj file to a glTF or glb.
@param {String} objPath Path to the obj file.
@param {Object} [options] An object with the following properties:
@param {Boolean} [options.binary=false] Convert to binary glTF.
@param {Boolean} [options.separate=false] Write out separate buffer files and textures instead of embed... | [
"Converts",
"an",
"obj",
"file",
"to",
"a",
"glTF",
"or",
"glb",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/obj2gltf.js#L42-L92 |
11,625 | AnalyticalGraphicsInc/obj2gltf | lib/loadTexture.js | loadTexture | function loadTexture(texturePath, options) {
options = defaultValue(options, {});
options.checkTransparency = defaultValue(options.checkTransparency, false);
options.decode = defaultValue(options.decode, false);
return fsExtra.readFile(texturePath)
.then(function(source) {
const nam... | javascript | function loadTexture(texturePath, options) {
options = defaultValue(options, {});
options.checkTransparency = defaultValue(options.checkTransparency, false);
options.decode = defaultValue(options.decode, false);
return fsExtra.readFile(texturePath)
.then(function(source) {
const nam... | [
"function",
"loadTexture",
"(",
"texturePath",
",",
"options",
")",
"{",
"options",
"=",
"defaultValue",
"(",
"options",
",",
"{",
"}",
")",
";",
"options",
".",
"checkTransparency",
"=",
"defaultValue",
"(",
"options",
".",
"checkTransparency",
",",
"false",
... | Load a texture file.
@param {String} texturePath Path to the texture file.
@param {Object} [options] An object with the following properties:
@param {Boolean} [options.checkTransparency=false] Do a more exhaustive check for texture transparency by looking at the alpha channel of each pixel.
@param {Boolean} [options.d... | [
"Load",
"a",
"texture",
"file",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/loadTexture.js#L26-L54 |
11,626 | AnalyticalGraphicsInc/obj2gltf | lib/Texture.js | Texture | function Texture() {
this.transparent = false;
this.source = undefined;
this.name = undefined;
this.extension = undefined;
this.path = undefined;
this.pixels = undefined;
this.width = undefined;
this.height = undefined;
} | javascript | function Texture() {
this.transparent = false;
this.source = undefined;
this.name = undefined;
this.extension = undefined;
this.path = undefined;
this.pixels = undefined;
this.width = undefined;
this.height = undefined;
} | [
"function",
"Texture",
"(",
")",
"{",
"this",
".",
"transparent",
"=",
"false",
";",
"this",
".",
"source",
"=",
"undefined",
";",
"this",
".",
"name",
"=",
"undefined",
";",
"this",
".",
"extension",
"=",
"undefined",
";",
"this",
".",
"path",
"=",
... | An object containing information about a texture.
@private | [
"An",
"object",
"containing",
"information",
"about",
"a",
"texture",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/Texture.js#L10-L19 |
11,627 | AnalyticalGraphicsInc/obj2gltf | lib/getBufferPadded.js | getBufferPadded | function getBufferPadded(buffer) {
const boundary = 4;
const byteLength = buffer.length;
const remainder = byteLength % boundary;
if (remainder === 0) {
return buffer;
}
const padding = (remainder === 0) ? 0 : boundary - remainder;
const emptyBuffer = Buffer.alloc(padding);
retur... | javascript | function getBufferPadded(buffer) {
const boundary = 4;
const byteLength = buffer.length;
const remainder = byteLength % boundary;
if (remainder === 0) {
return buffer;
}
const padding = (remainder === 0) ? 0 : boundary - remainder;
const emptyBuffer = Buffer.alloc(padding);
retur... | [
"function",
"getBufferPadded",
"(",
"buffer",
")",
"{",
"const",
"boundary",
"=",
"4",
";",
"const",
"byteLength",
"=",
"buffer",
".",
"length",
";",
"const",
"remainder",
"=",
"byteLength",
"%",
"boundary",
";",
"if",
"(",
"remainder",
"===",
"0",
")",
... | Pad the buffer to the next 4-byte boundary to ensure proper alignment for the section that follows.
@param {Buffer} buffer The buffer.
@returns {Buffer} The padded buffer.
@private | [
"Pad",
"the",
"buffer",
"to",
"the",
"next",
"4",
"-",
"byte",
"boundary",
"to",
"ensure",
"proper",
"alignment",
"for",
"the",
"section",
"that",
"follows",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/getBufferPadded.js#L12-L22 |
11,628 | AnalyticalGraphicsInc/obj2gltf | lib/createGltf.js | createGltf | function createGltf(objData, options) {
const nodes = objData.nodes;
let materials = objData.materials;
const name = objData.name;
// Split materials used by primitives with different types of attributes
materials = splitIncompatibleMaterials(nodes, materials, options);
const gltf = {
... | javascript | function createGltf(objData, options) {
const nodes = objData.nodes;
let materials = objData.materials;
const name = objData.name;
// Split materials used by primitives with different types of attributes
materials = splitIncompatibleMaterials(nodes, materials, options);
const gltf = {
... | [
"function",
"createGltf",
"(",
"objData",
",",
"options",
")",
"{",
"const",
"nodes",
"=",
"objData",
".",
"nodes",
";",
"let",
"materials",
"=",
"objData",
".",
"materials",
";",
"const",
"name",
"=",
"objData",
".",
"name",
";",
"// Split materials used by... | Create a glTF from obj data.
@param {Object} objData An object containing an array of nodes containing geometry information and an array of materials.
@param {Object} options The options object passed along from lib/obj2gltf.js
@returns {Object} A glTF asset.
@private | [
"Create",
"a",
"glTF",
"from",
"obj",
"data",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/createGltf.js#L23-L112 |
11,629 | AnalyticalGraphicsInc/obj2gltf | lib/writeGltf.js | writeGltf | function writeGltf(gltf, options) {
return encodeTextures(gltf)
.then(function() {
const binary = options.binary;
const separate = options.separate;
const separateTextures = options.separateTextures;
const promises = [];
if (separateTextures) {
... | javascript | function writeGltf(gltf, options) {
return encodeTextures(gltf)
.then(function() {
const binary = options.binary;
const separate = options.separate;
const separateTextures = options.separateTextures;
const promises = [];
if (separateTextures) {
... | [
"function",
"writeGltf",
"(",
"gltf",
",",
"options",
")",
"{",
"return",
"encodeTextures",
"(",
"gltf",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"const",
"binary",
"=",
"options",
".",
"binary",
";",
"const",
"separate",
"=",
"options",
".",
... | Write glTF resources as embedded data uris or external files.
@param {Object} gltf The glTF asset.
@param {Object} options The options object passed along from lib/obj2gltf.js
@returns {Promise} A promise that resolves to the glTF JSON or glb buffer.
@private | [
"Write",
"glTF",
"resources",
"as",
"embedded",
"data",
"uris",
"or",
"external",
"files",
"."
] | 67b95daa8cd99dd64324115675c968ef9f1c195c | https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/67b95daa8cd99dd64324115675c968ef9f1c195c/lib/writeGltf.js#L23-L55 |
11,630 | Netflix/unleash | lib/ls.js | ls | function ls (onEnd) {
const FN = require('fstream-npm')
const color = require('chalk')
const glob = require('glob')
const exclude = require('lodash.difference')
const included = [ ]
const all = glob.sync('**/**', { ignore : [ 'node_modules/**/**' ], nodir : true })
FN({ path: process.cwd() })... | javascript | function ls (onEnd) {
const FN = require('fstream-npm')
const color = require('chalk')
const glob = require('glob')
const exclude = require('lodash.difference')
const included = [ ]
const all = glob.sync('**/**', { ignore : [ 'node_modules/**/**' ], nodir : true })
FN({ path: process.cwd() })... | [
"function",
"ls",
"(",
"onEnd",
")",
"{",
"const",
"FN",
"=",
"require",
"(",
"'fstream-npm'",
")",
"const",
"color",
"=",
"require",
"(",
"'chalk'",
")",
"const",
"glob",
"=",
"require",
"(",
"'glob'",
")",
"const",
"exclude",
"=",
"require",
"(",
"'l... | ls module.
@module lib/ls | [
"ls",
"module",
"."
] | 0414ab9938d20b36c99587d84fbc0b52533085ee | https://github.com/Netflix/unleash/blob/0414ab9938d20b36c99587d84fbc0b52533085ee/lib/ls.js#L8-L39 |
11,631 | Netflix/unleash | lib/changelog.js | createBitbucketEnterpriseCommitLink | function createBitbucketEnterpriseCommitLink () {
const pkg = require(process.cwd() + '/package')
const repository = pkg.repository.url
return function (commit) {
const commitStr = commit.substring(0,8)
return repository ?
`[${commitStr}](${repository}/commits/${commitStr})` :
commitStr
}
} | javascript | function createBitbucketEnterpriseCommitLink () {
const pkg = require(process.cwd() + '/package')
const repository = pkg.repository.url
return function (commit) {
const commitStr = commit.substring(0,8)
return repository ?
`[${commitStr}](${repository}/commits/${commitStr})` :
commitStr
}
} | [
"function",
"createBitbucketEnterpriseCommitLink",
"(",
")",
"{",
"const",
"pkg",
"=",
"require",
"(",
"process",
".",
"cwd",
"(",
")",
"+",
"'/package'",
")",
"const",
"repository",
"=",
"pkg",
".",
"repository",
".",
"url",
"return",
"function",
"(",
"comm... | changelog module.
@module lib/changelog | [
"changelog",
"module",
"."
] | 0414ab9938d20b36c99587d84fbc0b52533085ee | https://github.com/Netflix/unleash/blob/0414ab9938d20b36c99587d84fbc0b52533085ee/lib/changelog.js#L10-L20 |
11,632 | Netflix/unleash | lib/changelog.js | writeChangelog | function writeChangelog (options, done) {
options.repoType = options.repoType || 'github'
log('Using repo type: ', colors.magenta(options.repoType))
const pkg = require(process.cwd() + '/package')
const opts = {
log: log,
repository: pkg.repository.url,
version: options.version
}
// Github u... | javascript | function writeChangelog (options, done) {
options.repoType = options.repoType || 'github'
log('Using repo type: ', colors.magenta(options.repoType))
const pkg = require(process.cwd() + '/package')
const opts = {
log: log,
repository: pkg.repository.url,
version: options.version
}
// Github u... | [
"function",
"writeChangelog",
"(",
"options",
",",
"done",
")",
"{",
"options",
".",
"repoType",
"=",
"options",
".",
"repoType",
"||",
"'github'",
"log",
"(",
"'Using repo type: '",
",",
"colors",
".",
"magenta",
"(",
"options",
".",
"repoType",
")",
")",
... | Output change information from git commits to CHANGELOG.md
@param options - {Object} that contains all the options of the changelog writer
- repoType: The {String} repo type (github or bitbucket) of the project (default to `"github"`),
- version: The {String} semantic version to add a change log for
@param done - {Fun... | [
"Output",
"change",
"information",
"from",
"git",
"commits",
"to",
"CHANGELOG",
".",
"md"
] | 0414ab9938d20b36c99587d84fbc0b52533085ee | https://github.com/Netflix/unleash/blob/0414ab9938d20b36c99587d84fbc0b52533085ee/lib/changelog.js#L32-L58 |
11,633 | Netflix/unleash | lib/git.js | caller | function caller() {
const returnedArgs = Array.prototype.slice.call(arguments)
const fn = returnedArgs.shift()
const self = this
return wrapPromise(function (resolve, reject) {
returnedArgs.push(function (err, args) {
if (err) {
reject(err)
return
}
resolve(args)
})
... | javascript | function caller() {
const returnedArgs = Array.prototype.slice.call(arguments)
const fn = returnedArgs.shift()
const self = this
return wrapPromise(function (resolve, reject) {
returnedArgs.push(function (err, args) {
if (err) {
reject(err)
return
}
resolve(args)
})
... | [
"function",
"caller",
"(",
")",
"{",
"const",
"returnedArgs",
"=",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
")",
"const",
"fn",
"=",
"returnedArgs",
".",
"shift",
"(",
")",
"const",
"self",
"=",
"this",
"return",
"wrapPromi... | Caller abstract method
for promisifying traditional callback methods | [
"Caller",
"abstract",
"method",
"for",
"promisifying",
"traditional",
"callback",
"methods"
] | 0414ab9938d20b36c99587d84fbc0b52533085ee | https://github.com/Netflix/unleash/blob/0414ab9938d20b36c99587d84fbc0b52533085ee/lib/git.js#L29-L46 |
11,634 | twilio/twilio-node | lib/jwt/taskrouter/util.js | defaultWorkerPolicies | function defaultWorkerPolicies(version, workspaceSid, workerSid) {
var activities = new Policy({
url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Activities'], '/'),
method: 'GET',
allow: true
});
var tasks = new Policy({
url: _.join([TASKROUTER_BASE_URL, version, 'Workspace... | javascript | function defaultWorkerPolicies(version, workspaceSid, workerSid) {
var activities = new Policy({
url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Activities'], '/'),
method: 'GET',
allow: true
});
var tasks = new Policy({
url: _.join([TASKROUTER_BASE_URL, version, 'Workspace... | [
"function",
"defaultWorkerPolicies",
"(",
"version",
",",
"workspaceSid",
",",
"workerSid",
")",
"{",
"var",
"activities",
"=",
"new",
"Policy",
"(",
"{",
"url",
":",
"_",
".",
"join",
"(",
"[",
"TASKROUTER_BASE_URL",
",",
"version",
",",
"'Workspaces'",
","... | Build the default Policies for a worker
@param {string} version TaskRouter version
@param {string} workspaceSid workspace sid
@param {string} workerSid worker sid
@returns {Array<Policy>} list of Policies | [
"Build",
"the",
"default",
"Policies",
"for",
"a",
"worker"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L18-L44 |
11,635 | twilio/twilio-node | lib/jwt/taskrouter/util.js | defaultEventBridgePolicies | function defaultEventBridgePolicies(accountSid, channelId) {
var url = _.join([EVENT_URL_BASE, accountSid, channelId], '/');
return [
new Policy({
url: url,
method: 'GET',
allow: true
}),
new Policy({
url: url,
method: 'POST',
allow: true
})
];
} | javascript | function defaultEventBridgePolicies(accountSid, channelId) {
var url = _.join([EVENT_URL_BASE, accountSid, channelId], '/');
return [
new Policy({
url: url,
method: 'GET',
allow: true
}),
new Policy({
url: url,
method: 'POST',
allow: true
})
];
} | [
"function",
"defaultEventBridgePolicies",
"(",
"accountSid",
",",
"channelId",
")",
"{",
"var",
"url",
"=",
"_",
".",
"join",
"(",
"[",
"EVENT_URL_BASE",
",",
"accountSid",
",",
"channelId",
"]",
",",
"'/'",
")",
";",
"return",
"[",
"new",
"Policy",
"(",
... | Build the default Event Bridge Policies
@param {string} accountSid account sid
@param {string} channelId channel id
@returns {Array<Policy>} list of Policies | [
"Build",
"the",
"default",
"Event",
"Bridge",
"Policies"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L53-L67 |
11,636 | twilio/twilio-node | lib/jwt/taskrouter/util.js | workspacesUrl | function workspacesUrl(workspaceSid) {
return _.join(
_.filter([TASKROUTER_BASE_URL, TASKROUTER_VERSION, 'Workspaces', workspaceSid], _.isString),
'/'
);
} | javascript | function workspacesUrl(workspaceSid) {
return _.join(
_.filter([TASKROUTER_BASE_URL, TASKROUTER_VERSION, 'Workspaces', workspaceSid], _.isString),
'/'
);
} | [
"function",
"workspacesUrl",
"(",
"workspaceSid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"TASKROUTER_BASE_URL",
",",
"TASKROUTER_VERSION",
",",
"'Workspaces'",
",",
"workspaceSid",
"]",
",",
"_",
".",
"isString",
")",
",",
... | Generate TaskRouter workspace url
@param {string} [workspaceSid] workspace sid or '**' for all workspaces
@return {string} generated url | [
"Generate",
"TaskRouter",
"workspace",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L75-L80 |
11,637 | twilio/twilio-node | lib/jwt/taskrouter/util.js | taskQueuesUrl | function taskQueuesUrl(workspaceSid, taskQueueSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'TaskQueues', taskQueueSid], _.isString),
'/'
);
} | javascript | function taskQueuesUrl(workspaceSid, taskQueueSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'TaskQueues', taskQueueSid], _.isString),
'/'
);
} | [
"function",
"taskQueuesUrl",
"(",
"workspaceSid",
",",
"taskQueueSid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"workspacesUrl",
"(",
"workspaceSid",
")",
",",
"'TaskQueues'",
",",
"taskQueueSid",
"]",
",",
"_",
".",
"isStri... | Generate TaskRouter task queue url
@param {string} workspaceSid workspace sid
@param {string} [taskQueueSid] task queue sid or '**' for all task queues
@return {string} generated url | [
"Generate",
"TaskRouter",
"task",
"queue",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L89-L94 |
11,638 | twilio/twilio-node | lib/jwt/taskrouter/util.js | tasksUrl | function tasksUrl(workspaceSid, taskSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Tasks', taskSid], _.isString),
'/'
);
} | javascript | function tasksUrl(workspaceSid, taskSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Tasks', taskSid], _.isString),
'/'
);
} | [
"function",
"tasksUrl",
"(",
"workspaceSid",
",",
"taskSid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"workspacesUrl",
"(",
"workspaceSid",
")",
",",
"'Tasks'",
",",
"taskSid",
"]",
",",
"_",
".",
"isString",
")",
",",
... | Generate TaskRouter task url
@param {string} workspaceSid workspace sid
@param {string} [taskSid] task sid or '**' for all tasks
@returns {string} generated url | [
"Generate",
"TaskRouter",
"task",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L103-L108 |
11,639 | twilio/twilio-node | lib/jwt/taskrouter/util.js | activitiesUrl | function activitiesUrl(workspaceSid, activitySid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Activities', activitySid], _.isString),
'/'
);
} | javascript | function activitiesUrl(workspaceSid, activitySid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Activities', activitySid], _.isString),
'/'
);
} | [
"function",
"activitiesUrl",
"(",
"workspaceSid",
",",
"activitySid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"workspacesUrl",
"(",
"workspaceSid",
")",
",",
"'Activities'",
",",
"activitySid",
"]",
",",
"_",
".",
"isString... | Generate TaskRouter activity url
@param {string} workspaceSid workspace sid
@param {string} [activitySid] activity sid or '**' for all activities
@returns {string} generated url | [
"Generate",
"TaskRouter",
"activity",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L117-L122 |
11,640 | twilio/twilio-node | lib/jwt/taskrouter/util.js | workersUrl | function workersUrl(workspaceSid, workerSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Workers', workerSid], _.isString),
'/'
);
} | javascript | function workersUrl(workspaceSid, workerSid) {
return _.join(
_.filter([workspacesUrl(workspaceSid), 'Workers', workerSid], _.isString),
'/'
);
} | [
"function",
"workersUrl",
"(",
"workspaceSid",
",",
"workerSid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"workspacesUrl",
"(",
"workspaceSid",
")",
",",
"'Workers'",
",",
"workerSid",
"]",
",",
"_",
".",
"isString",
")",
... | Generate TaskRouter worker url
@param {string} workspaceSid workspace sid
@param {string} [workerSid] worker sid or '**' for all workers
@returns {string} generated url | [
"Generate",
"TaskRouter",
"worker",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L131-L136 |
11,641 | twilio/twilio-node | lib/jwt/taskrouter/util.js | reservationsUrl | function reservationsUrl(workspaceSid, workerSid, reservationSid) {
return _.join(
_.filter([workersUrl(workspaceSid, workerSid), 'Reservations', reservationSid], _.isString),
'/'
);
} | javascript | function reservationsUrl(workspaceSid, workerSid, reservationSid) {
return _.join(
_.filter([workersUrl(workspaceSid, workerSid), 'Reservations', reservationSid], _.isString),
'/'
);
} | [
"function",
"reservationsUrl",
"(",
"workspaceSid",
",",
"workerSid",
",",
"reservationSid",
")",
"{",
"return",
"_",
".",
"join",
"(",
"_",
".",
"filter",
"(",
"[",
"workersUrl",
"(",
"workspaceSid",
",",
"workerSid",
")",
",",
"'Reservations'",
",",
"reser... | Generate TaskRouter worker reservation url
@param {string} workspaceSid workspace sid
@param {string} workerSid worker sid
@param {string} [reservationSid] reservation sid or '**' for all reservations
@returns {string} generated url | [
"Generate",
"TaskRouter",
"worker",
"reservation",
"url"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/util.js#L146-L151 |
11,642 | twilio/twilio-node | lib/jwt/taskrouter/TaskRouterCapability.js | Policy | function Policy(options) {
options = options || {};
this.url = options.url;
this.method = options.method || 'GET';
this.queryFilter = options.queryFilter || {};
this.postFilter = options.postFilter || {};
this.allow = options.allow || true;
} | javascript | function Policy(options) {
options = options || {};
this.url = options.url;
this.method = options.method || 'GET';
this.queryFilter = options.queryFilter || {};
this.postFilter = options.postFilter || {};
this.allow = options.allow || true;
} | [
"function",
"Policy",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"url",
"=",
"options",
".",
"url",
";",
"this",
".",
"method",
"=",
"options",
".",
"method",
"||",
"'GET'",
";",
"this",
".",
"queryFilter",... | Create a new Policy
@constructor
@param {object} options - ...
@param {string} [options.url] - Policy URL
@param {string} [options.method] - HTTP Method
@param {object} [options.queryFilter] - Request query filter allowances
@param {object} [options.postFilter] - Request post filter allowances
@param {boolean} [option... | [
"Create",
"a",
"new",
"Policy"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/jwt/taskrouter/TaskRouterCapability.js#L17-L24 |
11,643 | twilio/twilio-node | lib/webhooks/webhooks.js | getExpectedTwilioSignature | function getExpectedTwilioSignature(authToken, url, params) {
if (url.indexOf('bodySHA256') != -1) params = {};
var data = Object.keys(params)
.sort()
.reduce((acc, key) => acc + key + params[key], url);
return crypto
.createHmac('sha1', authToken)
.update(Buffer.from(data, 'utf-8'))
.diges... | javascript | function getExpectedTwilioSignature(authToken, url, params) {
if (url.indexOf('bodySHA256') != -1) params = {};
var data = Object.keys(params)
.sort()
.reduce((acc, key) => acc + key + params[key], url);
return crypto
.createHmac('sha1', authToken)
.update(Buffer.from(data, 'utf-8'))
.diges... | [
"function",
"getExpectedTwilioSignature",
"(",
"authToken",
",",
"url",
",",
"params",
")",
"{",
"if",
"(",
"url",
".",
"indexOf",
"(",
"'bodySHA256'",
")",
"!=",
"-",
"1",
")",
"params",
"=",
"{",
"}",
";",
"var",
"data",
"=",
"Object",
".",
"keys",
... | Utility function to get the expected signature for a given request
@param {string} authToken - The auth token, as seen in the Twilio portal
@param {string} url - The full URL (with query string) you configured to handle this request
@param {object} params - the parameters sent with this request
@returns {string} - sig... | [
"Utility",
"function",
"to",
"get",
"the",
"expected",
"signature",
"for",
"a",
"given",
"request"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/webhooks/webhooks.js#L16-L26 |
11,644 | twilio/twilio-node | lib/webhooks/webhooks.js | validateRequest | function validateRequest(authToken, twilioHeader, url, params) {
var expectedSignature = getExpectedTwilioSignature(authToken, url, params);
return scmp(Buffer.from(twilioHeader), Buffer.from(expectedSignature));
} | javascript | function validateRequest(authToken, twilioHeader, url, params) {
var expectedSignature = getExpectedTwilioSignature(authToken, url, params);
return scmp(Buffer.from(twilioHeader), Buffer.from(expectedSignature));
} | [
"function",
"validateRequest",
"(",
"authToken",
",",
"twilioHeader",
",",
"url",
",",
"params",
")",
"{",
"var",
"expectedSignature",
"=",
"getExpectedTwilioSignature",
"(",
"authToken",
",",
"url",
",",
"params",
")",
";",
"return",
"scmp",
"(",
"Buffer",
".... | Utility function to validate an incoming request is indeed from Twilio
@param {string} authToken - The auth token, as seen in the Twilio portal
@param {string} twilioHeader - The value of the X-Twilio-Signature header from the request
@param {string} url - The full URL (with query string) you configured to handle this... | [
"Utility",
"function",
"to",
"validate",
"an",
"incoming",
"request",
"is",
"indeed",
"from",
"Twilio"
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/webhooks/webhooks.js#L49-L52 |
11,645 | twilio/twilio-node | lib/webhooks/webhooks.js | validateRequestWithBody | function validateRequestWithBody(authToken, twilioHeader, requestUrl, body) {
var urlObject = new url.URL(requestUrl);
return validateRequest(authToken, twilioHeader, requestUrl, {}) && validateBody(body, urlObject.searchParams.get('bodySHA256'));
} | javascript | function validateRequestWithBody(authToken, twilioHeader, requestUrl, body) {
var urlObject = new url.URL(requestUrl);
return validateRequest(authToken, twilioHeader, requestUrl, {}) && validateBody(body, urlObject.searchParams.get('bodySHA256'));
} | [
"function",
"validateRequestWithBody",
"(",
"authToken",
",",
"twilioHeader",
",",
"requestUrl",
",",
"body",
")",
"{",
"var",
"urlObject",
"=",
"new",
"url",
".",
"URL",
"(",
"requestUrl",
")",
";",
"return",
"validateRequest",
"(",
"authToken",
",",
"twilioH... | Utility function to validate an incoming request is indeed from Twilio. This also validates
the request body against the bodySHA256 post parameter.
@param {string} authToken - The auth token, as seen in the Twilio portal
@param {string} twilioHeader - The value of the X-Twilio-Signature header from the request
@param ... | [
"Utility",
"function",
"to",
"validate",
"an",
"incoming",
"request",
"is",
"indeed",
"from",
"Twilio",
".",
"This",
"also",
"validates",
"the",
"request",
"body",
"against",
"the",
"bodySHA256",
"post",
"parameter",
"."
] | 61c56f8345c49ed7fa73fbfc1cdf943b6c324542 | https://github.com/twilio/twilio-node/blob/61c56f8345c49ed7fa73fbfc1cdf943b6c324542/lib/webhooks/webhooks.js#L64-L67 |
11,646 | ericgio/react-bootstrap-typeahead | src/utils/getTruncatedOptions.js | getTruncatedOptions | function getTruncatedOptions(options, maxResults) {
if (!maxResults || maxResults >= options.length) {
return options;
}
return options.slice(0, maxResults);
} | javascript | function getTruncatedOptions(options, maxResults) {
if (!maxResults || maxResults >= options.length) {
return options;
}
return options.slice(0, maxResults);
} | [
"function",
"getTruncatedOptions",
"(",
"options",
",",
"maxResults",
")",
"{",
"if",
"(",
"!",
"maxResults",
"||",
"maxResults",
">=",
"options",
".",
"length",
")",
"{",
"return",
"options",
";",
"}",
"return",
"options",
".",
"slice",
"(",
"0",
",",
"... | Truncates the result set based on `maxResults` and returns the new set. | [
"Truncates",
"the",
"result",
"set",
"based",
"on",
"maxResults",
"and",
"returns",
"the",
"new",
"set",
"."
] | 528cc8081b634bfd58727f6d95939fb515ab3cb1 | https://github.com/ericgio/react-bootstrap-typeahead/blob/528cc8081b634bfd58727f6d95939fb515ab3cb1/src/utils/getTruncatedOptions.js#L4-L10 |
11,647 | cronvel/terminal-kit | lib/termconfig/linux.js | gpmMouse | function gpmMouse( mode ) {
var self = this ;
if ( this.root.gpmHandler ) {
this.root.gpmHandler.close() ;
this.root.gpmHandler = undefined ;
}
if ( ! mode ) {
//console.log( '>>>>> off <<<<<' ) ;
return ;
}
this.root.gpmHandler = gpm.createHandler( { stdin: this.root.stdin , raw: false , mode: mode }... | javascript | function gpmMouse( mode ) {
var self = this ;
if ( this.root.gpmHandler ) {
this.root.gpmHandler.close() ;
this.root.gpmHandler = undefined ;
}
if ( ! mode ) {
//console.log( '>>>>> off <<<<<' ) ;
return ;
}
this.root.gpmHandler = gpm.createHandler( { stdin: this.root.stdin , raw: false , mode: mode }... | [
"function",
"gpmMouse",
"(",
"mode",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"this",
".",
"root",
".",
"gpmHandler",
")",
"{",
"this",
".",
"root",
".",
"gpmHandler",
".",
"close",
"(",
")",
";",
"this",
".",
"root",
".",
"gpmHandler"... | This is the code that handle GPM | [
"This",
"is",
"the",
"code",
"that",
"handle",
"GPM"
] | e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73 | https://github.com/cronvel/terminal-kit/blob/e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73/lib/termconfig/linux.js#L268-L293 |
11,648 | cronvel/terminal-kit | lib/TextBuffer.js | TextBuffer | function TextBuffer( options = {} ) {
this.ScreenBuffer = options.ScreenBuffer || ( options.dst && options.dst.constructor ) || termkit.ScreenBuffer ;
// a screenBuffer
this.dst = options.dst ;
// virtually infinity by default
this.width = options.width || Infinity ;
this.height = options.height || Infinity ;
... | javascript | function TextBuffer( options = {} ) {
this.ScreenBuffer = options.ScreenBuffer || ( options.dst && options.dst.constructor ) || termkit.ScreenBuffer ;
// a screenBuffer
this.dst = options.dst ;
// virtually infinity by default
this.width = options.width || Infinity ;
this.height = options.height || Infinity ;
... | [
"function",
"TextBuffer",
"(",
"options",
"=",
"{",
"}",
")",
"{",
"this",
".",
"ScreenBuffer",
"=",
"options",
".",
"ScreenBuffer",
"||",
"(",
"options",
".",
"dst",
"&&",
"options",
".",
"dst",
".",
"constructor",
")",
"||",
"termkit",
".",
"ScreenBuff... | A buffer suitable for text editor | [
"A",
"buffer",
"suitable",
"for",
"text",
"editor"
] | e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73 | https://github.com/cronvel/terminal-kit/blob/e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73/lib/TextBuffer.js#L40-L68 |
11,649 | cronvel/terminal-kit | lib/Terminal.js | onResize | function onResize() {
if ( this.stdout.columns && this.stdout.rows ) {
this.width = this.stdout.columns ;
this.height = this.stdout.rows ;
}
this.emit( 'resize' , this.width , this.height ) ;
} | javascript | function onResize() {
if ( this.stdout.columns && this.stdout.rows ) {
this.width = this.stdout.columns ;
this.height = this.stdout.rows ;
}
this.emit( 'resize' , this.width , this.height ) ;
} | [
"function",
"onResize",
"(",
")",
"{",
"if",
"(",
"this",
".",
"stdout",
".",
"columns",
"&&",
"this",
".",
"stdout",
".",
"rows",
")",
"{",
"this",
".",
"width",
"=",
"this",
".",
"stdout",
".",
"columns",
";",
"this",
".",
"height",
"=",
"this",
... | Called by either SIGWINCH signal or stdout's 'resize' event. It is not meant to be used by end-user. | [
"Called",
"by",
"either",
"SIGWINCH",
"signal",
"or",
"stdout",
"s",
"resize",
"event",
".",
"It",
"is",
"not",
"meant",
"to",
"be",
"used",
"by",
"end",
"-",
"user",
"."
] | e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73 | https://github.com/cronvel/terminal-kit/blob/e0a3ff6cd7dac62cc222e9ac10a5d95d9eee1d73/lib/Terminal.js#L932-L939 |
11,650 | catamphetamine/read-excel-file | source/convertToJson.js | parseValueOfType | function parseValueOfType(value, type, options) {
switch (type) {
case String:
return { value }
case Number:
case 'Integer':
case Integer:
// The global isFinite() function determines
// whether the passed value is a finite number.
// If needed, the parameter is first convert... | javascript | function parseValueOfType(value, type, options) {
switch (type) {
case String:
return { value }
case Number:
case 'Integer':
case Integer:
// The global isFinite() function determines
// whether the passed value is a finite number.
// If needed, the parameter is first convert... | [
"function",
"parseValueOfType",
"(",
"value",
",",
"type",
",",
"options",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"String",
":",
"return",
"{",
"value",
"}",
"case",
"Number",
":",
"case",
"'Integer'",
":",
"case",
"Integer",
":",
"// The glo... | Converts textual value to a javascript typed value.
@param {string} value
@param {} type
@return {{ value: (string|number|Date|boolean), error: string }} | [
"Converts",
"textual",
"value",
"to",
"a",
"javascript",
"typed",
"value",
"."
] | 78b3a47bdf01788c12d6674b3a1f42fd7cc92510 | https://github.com/catamphetamine/read-excel-file/blob/78b3a47bdf01788c12d6674b3a1f42fd7cc92510/source/convertToJson.js#L183-L251 |
11,651 | FaridSafi/react-native-gifted-listview | GiftedListView.js | MergeRowsWithHeaders | function MergeRowsWithHeaders(obj1, obj2) {
for(var p in obj2){
if(obj1[p] instanceof Array && obj1[p] instanceof Array){
obj1[p] = obj1[p].concat(obj2[p])
} else {
obj1[p] = obj2[p]
}
}
return obj1;
} | javascript | function MergeRowsWithHeaders(obj1, obj2) {
for(var p in obj2){
if(obj1[p] instanceof Array && obj1[p] instanceof Array){
obj1[p] = obj1[p].concat(obj2[p])
} else {
obj1[p] = obj2[p]
}
}
return obj1;
} | [
"function",
"MergeRowsWithHeaders",
"(",
"obj1",
",",
"obj2",
")",
"{",
"for",
"(",
"var",
"p",
"in",
"obj2",
")",
"{",
"if",
"(",
"obj1",
"[",
"p",
"]",
"instanceof",
"Array",
"&&",
"obj1",
"[",
"p",
"]",
"instanceof",
"Array",
")",
"{",
"obj1",
"... | small helper function which merged two objects into one | [
"small",
"helper",
"function",
"which",
"merged",
"two",
"objects",
"into",
"one"
] | 1415f0f4656245c139c94195073a44243e1c4c8c | https://github.com/FaridSafi/react-native-gifted-listview/blob/1415f0f4656245c139c94195073a44243e1c4c8c/GiftedListView.js#L17-L26 |
11,652 | remarkjs/remark | packages/remark-parse/lib/parse.js | parse | function parse() {
var self = this
var value = String(self.file)
var start = {line: 1, column: 1, offset: 0}
var content = xtend(start)
var node
// Clean non-unix newlines: `\r\n` and `\r` are all changed to `\n`.
// This should not affect positional information.
value = value.replace(lineBreaksExpress... | javascript | function parse() {
var self = this
var value = String(self.file)
var start = {line: 1, column: 1, offset: 0}
var content = xtend(start)
var node
// Clean non-unix newlines: `\r\n` and `\r` are all changed to `\n`.
// This should not affect positional information.
value = value.replace(lineBreaksExpress... | [
"function",
"parse",
"(",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"value",
"=",
"String",
"(",
"self",
".",
"file",
")",
"var",
"start",
"=",
"{",
"line",
":",
"1",
",",
"column",
":",
"1",
",",
"offset",
":",
"0",
"}",
"var",
"content",
"... | Parse the bound file. | [
"Parse",
"the",
"bound",
"file",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/parse.js#L12-L42 |
11,653 | remarkjs/remark | packages/remark-stringify/lib/escape.js | alignment | function alignment(value, index) {
var start = value.lastIndexOf(lineFeed, index)
var end = value.indexOf(lineFeed, index)
var char
end = end === -1 ? value.length : end
while (++start < end) {
char = value.charAt(start)
if (
char !== colon &&
char !== dash &&
char !== space &&
... | javascript | function alignment(value, index) {
var start = value.lastIndexOf(lineFeed, index)
var end = value.indexOf(lineFeed, index)
var char
end = end === -1 ? value.length : end
while (++start < end) {
char = value.charAt(start)
if (
char !== colon &&
char !== dash &&
char !== space &&
... | [
"function",
"alignment",
"(",
"value",
",",
"index",
")",
"{",
"var",
"start",
"=",
"value",
".",
"lastIndexOf",
"(",
"lineFeed",
",",
"index",
")",
"var",
"end",
"=",
"value",
".",
"indexOf",
"(",
"lineFeed",
",",
"index",
")",
"var",
"char",
"end",
... | Check if `index` in `value` is inside an alignment row. | [
"Check",
"if",
"index",
"in",
"value",
"is",
"inside",
"an",
"alignment",
"row",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/escape.js#L267-L288 |
11,654 | remarkjs/remark | packages/remark-stringify/lib/escape.js | protocol | function protocol(value) {
var val = value.slice(-6).toLowerCase()
return val === mailto || val.slice(-5) === https || val.slice(-4) === http
} | javascript | function protocol(value) {
var val = value.slice(-6).toLowerCase()
return val === mailto || val.slice(-5) === https || val.slice(-4) === http
} | [
"function",
"protocol",
"(",
"value",
")",
"{",
"var",
"val",
"=",
"value",
".",
"slice",
"(",
"-",
"6",
")",
".",
"toLowerCase",
"(",
")",
"return",
"val",
"===",
"mailto",
"||",
"val",
".",
"slice",
"(",
"-",
"5",
")",
"===",
"https",
"||",
"va... | Check if `value` ends in a protocol. | [
"Check",
"if",
"value",
"ends",
"in",
"a",
"protocol",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/escape.js#L296-L299 |
11,655 | remarkjs/remark | packages/remark-stringify/lib/compiler.js | Compiler | function Compiler(tree, file) {
this.inLink = false
this.inTable = false
this.tree = tree
this.file = file
this.options = xtend(this.options)
this.setOptions({})
} | javascript | function Compiler(tree, file) {
this.inLink = false
this.inTable = false
this.tree = tree
this.file = file
this.options = xtend(this.options)
this.setOptions({})
} | [
"function",
"Compiler",
"(",
"tree",
",",
"file",
")",
"{",
"this",
".",
"inLink",
"=",
"false",
"this",
".",
"inTable",
"=",
"false",
"this",
".",
"tree",
"=",
"tree",
"this",
".",
"file",
"=",
"file",
"this",
".",
"options",
"=",
"xtend",
"(",
"t... | Construct a new compiler. | [
"Construct",
"a",
"new",
"compiler",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/compiler.js#L9-L16 |
11,656 | remarkjs/remark | packages/remark-parse/lib/tokenize/list.js | pedanticListItem | function pedanticListItem(ctx, value, position) {
var offsets = ctx.offset
var line = position.line
// Remove the list-item’s bullet.
value = value.replace(pedanticBulletExpression, replacer)
// The initial line was also matched by the below, so we reset the `line`.
line = position.line
return value.re... | javascript | function pedanticListItem(ctx, value, position) {
var offsets = ctx.offset
var line = position.line
// Remove the list-item’s bullet.
value = value.replace(pedanticBulletExpression, replacer)
// The initial line was also matched by the below, so we reset the `line`.
line = position.line
return value.re... | [
"function",
"pedanticListItem",
"(",
"ctx",
",",
"value",
",",
"position",
")",
"{",
"var",
"offsets",
"=",
"ctx",
".",
"offset",
"var",
"line",
"=",
"position",
".",
"line",
"// Remove the list-item’s bullet.",
"value",
"=",
"value",
".",
"replace",
"(",
"p... | Create a list-item using overly simple mechanics. | [
"Create",
"a",
"list",
"-",
"item",
"using",
"overly",
"simple",
"mechanics",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenize/list.js#L376-L396 |
11,657 | remarkjs/remark | packages/remark-parse/lib/tokenize/list.js | normalListItem | function normalListItem(ctx, value, position) {
var offsets = ctx.offset
var line = position.line
var max
var bullet
var rest
var lines
var trimmedLines
var index
var length
// Remove the list-item’s bullet.
value = value.replace(bulletExpression, replacer)
lines = value.split(lineFeed)
tri... | javascript | function normalListItem(ctx, value, position) {
var offsets = ctx.offset
var line = position.line
var max
var bullet
var rest
var lines
var trimmedLines
var index
var length
// Remove the list-item’s bullet.
value = value.replace(bulletExpression, replacer)
lines = value.split(lineFeed)
tri... | [
"function",
"normalListItem",
"(",
"ctx",
",",
"value",
",",
"position",
")",
"{",
"var",
"offsets",
"=",
"ctx",
".",
"offset",
"var",
"line",
"=",
"position",
".",
"line",
"var",
"max",
"var",
"bullet",
"var",
"rest",
"var",
"lines",
"var",
"trimmedLine... | Create a list-item using sane mechanics. | [
"Create",
"a",
"list",
"-",
"item",
"using",
"sane",
"mechanics",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenize/list.js#L399-L452 |
11,658 | remarkjs/remark | packages/remark-parse/lib/util/get-indentation.js | indentation | function indentation(value) {
var index = 0
var indent = 0
var character = value.charAt(index)
var stops = {}
var size
while (character === tab || character === space) {
size = character === tab ? tabSize : spaceSize
indent += size
if (size > 1) {
indent = Math.floor(indent / size) * si... | javascript | function indentation(value) {
var index = 0
var indent = 0
var character = value.charAt(index)
var stops = {}
var size
while (character === tab || character === space) {
size = character === tab ? tabSize : spaceSize
indent += size
if (size > 1) {
indent = Math.floor(indent / size) * si... | [
"function",
"indentation",
"(",
"value",
")",
"{",
"var",
"index",
"=",
"0",
"var",
"indent",
"=",
"0",
"var",
"character",
"=",
"value",
".",
"charAt",
"(",
"index",
")",
"var",
"stops",
"=",
"{",
"}",
"var",
"size",
"while",
"(",
"character",
"==="... | Gets indentation information for a line. | [
"Gets",
"indentation",
"information",
"for",
"a",
"line",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/util/get-indentation.js#L12-L33 |
11,659 | remarkjs/remark | packages/remark-stringify/lib/macro/all.js | all | function all(parent) {
var self = this
var children = parent.children
var length = children.length
var results = []
var index = -1
while (++index < length) {
results[index] = self.visit(children[index], parent)
}
return results
} | javascript | function all(parent) {
var self = this
var children = parent.children
var length = children.length
var results = []
var index = -1
while (++index < length) {
results[index] = self.visit(children[index], parent)
}
return results
} | [
"function",
"all",
"(",
"parent",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"children",
"=",
"parent",
".",
"children",
"var",
"length",
"=",
"children",
".",
"length",
"var",
"results",
"=",
"[",
"]",
"var",
"index",
"=",
"-",
"1",
"while",
"(",
... | Visit all children of `parent`. | [
"Visit",
"all",
"children",
"of",
"parent",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/macro/all.js#L6-L18 |
11,660 | remarkjs/remark | packages/remark-parse/lib/unescape.js | factory | function factory(ctx, key) {
return unescape
// De-escape a string using the expression at `key` in `ctx`.
function unescape(value) {
var prev = 0
var index = value.indexOf(backslash)
var escape = ctx[key]
var queue = []
var character
while (index !== -1) {
queue.push(value.slice(p... | javascript | function factory(ctx, key) {
return unescape
// De-escape a string using the expression at `key` in `ctx`.
function unescape(value) {
var prev = 0
var index = value.indexOf(backslash)
var escape = ctx[key]
var queue = []
var character
while (index !== -1) {
queue.push(value.slice(p... | [
"function",
"factory",
"(",
"ctx",
",",
"key",
")",
"{",
"return",
"unescape",
"// De-escape a string using the expression at `key` in `ctx`.",
"function",
"unescape",
"(",
"value",
")",
"{",
"var",
"prev",
"=",
"0",
"var",
"index",
"=",
"value",
".",
"indexOf",
... | Factory to de-escape a value, based on a list at `key` in `ctx`. | [
"Factory",
"to",
"de",
"-",
"escape",
"a",
"value",
"based",
"on",
"a",
"list",
"at",
"key",
"in",
"ctx",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/unescape.js#L8-L36 |
11,661 | remarkjs/remark | packages/remark-parse/lib/tokenize/paragraph.js | paragraph | function paragraph(eat, value, silent) {
var self = this
var settings = self.options
var commonmark = settings.commonmark
var gfm = settings.gfm
var tokenizers = self.blockTokenizers
var interruptors = self.interruptParagraph
var index = value.indexOf(lineFeed)
var length = value.length
var position
... | javascript | function paragraph(eat, value, silent) {
var self = this
var settings = self.options
var commonmark = settings.commonmark
var gfm = settings.gfm
var tokenizers = self.blockTokenizers
var interruptors = self.interruptParagraph
var index = value.indexOf(lineFeed)
var length = value.length
var position
... | [
"function",
"paragraph",
"(",
"eat",
",",
"value",
",",
"silent",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"settings",
"=",
"self",
".",
"options",
"var",
"commonmark",
"=",
"settings",
".",
"commonmark",
"var",
"gfm",
"=",
"settings",
".",
"gfm",
... | Tokenise paragraph. | [
"Tokenise",
"paragraph",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenize/paragraph.js#L17-L117 |
11,662 | remarkjs/remark | packages/remark-parse/lib/parser.js | keys | function keys(value) {
var result = []
var key
for (key in value) {
result.push(key)
}
return result
} | javascript | function keys(value) {
var result = []
var key
for (key in value) {
result.push(key)
}
return result
} | [
"function",
"keys",
"(",
"value",
")",
"{",
"var",
"result",
"=",
"[",
"]",
"var",
"key",
"for",
"(",
"key",
"in",
"value",
")",
"{",
"result",
".",
"push",
"(",
"key",
")",
"}",
"return",
"result",
"}"
] | Get all keys in `value`. | [
"Get",
"all",
"keys",
"in",
"value",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/parser.js#L140-L149 |
11,663 | remarkjs/remark | packages/remark-parse/lib/tokenizer.js | updatePosition | function updatePosition(subvalue) {
var lastIndex = -1
var index = subvalue.indexOf('\n')
while (index !== -1) {
line++
lastIndex = index
index = subvalue.indexOf('\n', index + 1)
}
if (lastIndex === -1) {
column += subvalue.length
} else {
c... | javascript | function updatePosition(subvalue) {
var lastIndex = -1
var index = subvalue.indexOf('\n')
while (index !== -1) {
line++
lastIndex = index
index = subvalue.indexOf('\n', index + 1)
}
if (lastIndex === -1) {
column += subvalue.length
} else {
c... | [
"function",
"updatePosition",
"(",
"subvalue",
")",
"{",
"var",
"lastIndex",
"=",
"-",
"1",
"var",
"index",
"=",
"subvalue",
".",
"indexOf",
"(",
"'\\n'",
")",
"while",
"(",
"index",
"!==",
"-",
"1",
")",
"{",
"line",
"++",
"lastIndex",
"=",
"index",
... | Update line, column, and offset based on `value`. | [
"Update",
"line",
"column",
"and",
"offset",
"based",
"on",
"value",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenizer.js#L79-L102 |
11,664 | remarkjs/remark | packages/remark-parse/lib/tokenizer.js | now | function now() {
var pos = {line: line, column: column}
pos.offset = self.toOffset(pos)
return pos
} | javascript | function now() {
var pos = {line: line, column: column}
pos.offset = self.toOffset(pos)
return pos
} | [
"function",
"now",
"(",
")",
"{",
"var",
"pos",
"=",
"{",
"line",
":",
"line",
",",
"column",
":",
"column",
"}",
"pos",
".",
"offset",
"=",
"self",
".",
"toOffset",
"(",
"pos",
")",
"return",
"pos",
"}"
] | Get the current position. | [
"Get",
"the",
"current",
"position",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenizer.js#L126-L132 |
11,665 | remarkjs/remark | packages/remark-parse/lib/tokenizer.js | add | function add(node, parent) {
var children = parent ? parent.children : tokens
var prev = children[children.length - 1]
var fn
if (
prev &&
node.type === prev.type &&
(node.type === 'text' || node.type === 'blockquote') &&
mergeable(prev) &&
mergeable(node... | javascript | function add(node, parent) {
var children = parent ? parent.children : tokens
var prev = children[children.length - 1]
var fn
if (
prev &&
node.type === prev.type &&
(node.type === 'text' || node.type === 'blockquote') &&
mergeable(prev) &&
mergeable(node... | [
"function",
"add",
"(",
"node",
",",
"parent",
")",
"{",
"var",
"children",
"=",
"parent",
"?",
"parent",
".",
"children",
":",
"tokens",
"var",
"prev",
"=",
"children",
"[",
"children",
".",
"length",
"-",
"1",
"]",
"var",
"fn",
"if",
"(",
"prev",
... | Add `node` to `parent`s children or to `tokens`. Performs merges where possible. | [
"Add",
"node",
"to",
"parent",
"s",
"children",
"or",
"to",
"tokens",
".",
"Performs",
"merges",
"where",
"possible",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenizer.js#L198-L223 |
11,666 | remarkjs/remark | packages/remark-parse/lib/tokenizer.js | eat | function eat(subvalue) {
var indent = getOffset()
var pos = position()
var current = now()
validateEat(subvalue)
apply.reset = reset
reset.test = test
apply.test = test
value = value.substring(subvalue.length)
updatePosition(subvalue)
indent = indent()
... | javascript | function eat(subvalue) {
var indent = getOffset()
var pos = position()
var current = now()
validateEat(subvalue)
apply.reset = reset
reset.test = test
apply.test = test
value = value.substring(subvalue.length)
updatePosition(subvalue)
indent = indent()
... | [
"function",
"eat",
"(",
"subvalue",
")",
"{",
"var",
"indent",
"=",
"getOffset",
"(",
")",
"var",
"pos",
"=",
"position",
"(",
")",
"var",
"current",
"=",
"now",
"(",
")",
"validateEat",
"(",
"subvalue",
")",
"apply",
".",
"reset",
"=",
"reset",
"res... | Remove `subvalue` from `value`. `subvalue` must be at the start of `value`. | [
"Remove",
"subvalue",
"from",
"value",
".",
"subvalue",
"must",
"be",
"at",
"the",
"start",
"of",
"value",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenizer.js#L227-L276 |
11,667 | remarkjs/remark | packages/remark-parse/lib/tokenizer.js | mergeable | function mergeable(node) {
var start
var end
if (node.type !== 'text' || !node.position) {
return true
}
start = node.position.start
end = node.position.end
// Only merge nodes which occupy the same size as their `value`.
return (
start.line !== end.line || end.column - start.column === node.... | javascript | function mergeable(node) {
var start
var end
if (node.type !== 'text' || !node.position) {
return true
}
start = node.position.start
end = node.position.end
// Only merge nodes which occupy the same size as their `value`.
return (
start.line !== end.line || end.column - start.column === node.... | [
"function",
"mergeable",
"(",
"node",
")",
"{",
"var",
"start",
"var",
"end",
"if",
"(",
"node",
".",
"type",
"!==",
"'text'",
"||",
"!",
"node",
".",
"position",
")",
"{",
"return",
"true",
"}",
"start",
"=",
"node",
".",
"position",
".",
"start",
... | Check whether a node is mergeable with adjacent nodes. | [
"Check",
"whether",
"a",
"node",
"is",
"mergeable",
"with",
"adjacent",
"nodes",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/tokenizer.js#L281-L296 |
11,668 | remarkjs/remark | packages/remark-parse/lib/decode.js | factory | function factory(ctx) {
decoder.raw = decodeRaw
return decoder
// Normalize `position` to add an `indent`.
function normalize(position) {
var offsets = ctx.offset
var line = position.line
var result = []
while (++line) {
if (!(line in offsets)) {
break
}
result.push... | javascript | function factory(ctx) {
decoder.raw = decodeRaw
return decoder
// Normalize `position` to add an `indent`.
function normalize(position) {
var offsets = ctx.offset
var line = position.line
var result = []
while (++line) {
if (!(line in offsets)) {
break
}
result.push... | [
"function",
"factory",
"(",
"ctx",
")",
"{",
"decoder",
".",
"raw",
"=",
"decodeRaw",
"return",
"decoder",
"// Normalize `position` to add an `indent`.",
"function",
"normalize",
"(",
"position",
")",
"{",
"var",
"offsets",
"=",
"ctx",
".",
"offset",
"var",
"lin... | Factory to create an entity decoder. | [
"Factory",
"to",
"create",
"an",
"entity",
"decoder",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/decode.js#L9-L58 |
11,669 | remarkjs/remark | packages/remark-parse/lib/decode.js | normalize | function normalize(position) {
var offsets = ctx.offset
var line = position.line
var result = []
while (++line) {
if (!(line in offsets)) {
break
}
result.push((offsets[line] || 0) + 1)
}
return {start: position, indent: result}
} | javascript | function normalize(position) {
var offsets = ctx.offset
var line = position.line
var result = []
while (++line) {
if (!(line in offsets)) {
break
}
result.push((offsets[line] || 0) + 1)
}
return {start: position, indent: result}
} | [
"function",
"normalize",
"(",
"position",
")",
"{",
"var",
"offsets",
"=",
"ctx",
".",
"offset",
"var",
"line",
"=",
"position",
".",
"line",
"var",
"result",
"=",
"[",
"]",
"while",
"(",
"++",
"line",
")",
"{",
"if",
"(",
"!",
"(",
"line",
"in",
... | Normalize `position` to add an `indent`. | [
"Normalize",
"position",
"to",
"add",
"an",
"indent",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-parse/lib/decode.js#L15-L29 |
11,670 | remarkjs/remark | packages/remark-stringify/lib/set-options.js | setOptions | function setOptions(options) {
var self = this
var current = self.options
var ruleRepetition
var key
if (options == null) {
options = {}
} else if (typeof options === 'object') {
options = xtend(options)
} else {
throw new Error('Invalid value `' + options + '` for setting `options`')
}
... | javascript | function setOptions(options) {
var self = this
var current = self.options
var ruleRepetition
var key
if (options == null) {
options = {}
} else if (typeof options === 'object') {
options = xtend(options)
} else {
throw new Error('Invalid value `' + options + '` for setting `options`')
}
... | [
"function",
"setOptions",
"(",
"options",
")",
"{",
"var",
"self",
"=",
"this",
"var",
"current",
"=",
"self",
".",
"options",
"var",
"ruleRepetition",
"var",
"key",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"options",
"=",
"{",
"}",
"}",
"else",
... | Set options. Does not overwrite previously set options. | [
"Set",
"options",
".",
"Does",
"not",
"overwrite",
"previously",
"set",
"options",
"."
] | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/set-options.js#L31-L61 |
11,671 | remarkjs/remark | packages/remark-stringify/lib/set-options.js | encodeFactory | function encodeFactory(type) {
var options = {}
if (type === 'false') {
return identity
}
if (type === 'true') {
options.useNamedReferences = true
}
if (type === 'escape') {
options.escapeOnly = true
options.useNamedReferences = true
}
return wrapped
// Encode HTML entities using ... | javascript | function encodeFactory(type) {
var options = {}
if (type === 'false') {
return identity
}
if (type === 'true') {
options.useNamedReferences = true
}
if (type === 'escape') {
options.escapeOnly = true
options.useNamedReferences = true
}
return wrapped
// Encode HTML entities using ... | [
"function",
"encodeFactory",
"(",
"type",
")",
"{",
"var",
"options",
"=",
"{",
"}",
"if",
"(",
"type",
"===",
"'false'",
")",
"{",
"return",
"identity",
"}",
"if",
"(",
"type",
"===",
"'true'",
")",
"{",
"options",
".",
"useNamedReferences",
"=",
"tru... | Factory to encode HTML entities. Creates a no-operation function when `type` is `'false'`, a function which encodes using named references when `type` is `'true'`, and a function which encodes using numbered references when `type` is `'numbers'`. | [
"Factory",
"to",
"encode",
"HTML",
"entities",
".",
"Creates",
"a",
"no",
"-",
"operation",
"function",
"when",
"type",
"is",
"false",
"a",
"function",
"which",
"encodes",
"using",
"named",
"references",
"when",
"type",
"is",
"true",
"and",
"a",
"function",
... | cca8385746c2f3489b2d491e91ab8c581901ae8a | https://github.com/remarkjs/remark/blob/cca8385746c2f3489b2d491e91ab8c581901ae8a/packages/remark-stringify/lib/set-options.js#L133-L155 |
11,672 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | getLocaleDateTimeFormat | function getLocaleDateTimeFormat(locale, width) {
var data = findLocaleData(locale);
var dateTimeFormatData = data[12 /* DateTimeFormat */];
return getLastDefinedValue(dateTimeFormatData, width);
} | javascript | function getLocaleDateTimeFormat(locale, width) {
var data = findLocaleData(locale);
var dateTimeFormatData = data[12 /* DateTimeFormat */];
return getLastDefinedValue(dateTimeFormatData, width);
} | [
"function",
"getLocaleDateTimeFormat",
"(",
"locale",
",",
"width",
")",
"{",
"var",
"data",
"=",
"findLocaleData",
"(",
"locale",
")",
";",
"var",
"dateTimeFormatData",
"=",
"data",
"[",
"12",
"/* DateTimeFormat */",
"]",
";",
"return",
"getLastDefinedValue",
"... | Date-time format that depends on the locale.
The date-time pattern shows how to combine separate patterns for date (represented by {1})
and time (represented by {0}) into a single pattern. It usually doesn't need to be changed.
What you want to pay attention to are:
- possibly removing a space for languages that don't... | [
"Date",
"-",
"time",
"format",
"that",
"depends",
"on",
"the",
"locale",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1057-L1061 |
11,673 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | getLastDefinedValue | function getLastDefinedValue(data, index) {
for (var i = index; i > -1; i--) {
if (typeof data[i] !== 'undefined') {
return data[i];
}
}
throw new Error('Locale data API: locale data undefined');
} | javascript | function getLastDefinedValue(data, index) {
for (var i = index; i > -1; i--) {
if (typeof data[i] !== 'undefined') {
return data[i];
}
}
throw new Error('Locale data API: locale data undefined');
} | [
"function",
"getLastDefinedValue",
"(",
"data",
",",
"index",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"index",
";",
"i",
">",
"-",
"1",
";",
"i",
"--",
")",
"{",
"if",
"(",
"typeof",
"data",
"[",
"i",
"]",
"!==",
"'undefined'",
")",
"{",
"return",... | Returns the first value that is defined in an array, going backwards.
To avoid repeating the same data (e.g. when "format" and "standalone" are the same) we only
add the first one to the locale data arrays, the other ones are only defined when different.
We use this function to retrieve the first defined value.
@expe... | [
"Returns",
"the",
"first",
"value",
"that",
"is",
"defined",
"in",
"an",
"array",
"going",
"backwards",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1218-L1225 |
11,674 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | findLocaleData | function findLocaleData(locale) {
var normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
var match = LOCALE_DATA[normalizedLocale];
if (match) {
return match;
}
// let's try to find a parent locale
var parentLocale = normalizedLocale.split('-')[0];
match = LOCALE_DATA[parent... | javascript | function findLocaleData(locale) {
var normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
var match = LOCALE_DATA[normalizedLocale];
if (match) {
return match;
}
// let's try to find a parent locale
var parentLocale = normalizedLocale.split('-')[0];
match = LOCALE_DATA[parent... | [
"function",
"findLocaleData",
"(",
"locale",
")",
"{",
"var",
"normalizedLocale",
"=",
"locale",
".",
"toLowerCase",
"(",
")",
".",
"replace",
"(",
"/",
"_",
"/",
"g",
",",
"'-'",
")",
";",
"var",
"match",
"=",
"LOCALE_DATA",
"[",
"normalizedLocale",
"]"... | Finds the locale data for a locale id
@experimental i18n support is experimental. | [
"Finds",
"the",
"locale",
"data",
"for",
"a",
"locale",
"id"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1238-L1254 |
11,675 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | getNumberOfCurrencyDigits | function getNumberOfCurrencyDigits(code) {
var digits;
var currency = CURRENCIES_EN[code];
if (currency) {
digits = currency[2 /* NbOfDigits */];
}
return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
} | javascript | function getNumberOfCurrencyDigits(code) {
var digits;
var currency = CURRENCIES_EN[code];
if (currency) {
digits = currency[2 /* NbOfDigits */];
}
return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
} | [
"function",
"getNumberOfCurrencyDigits",
"(",
"code",
")",
"{",
"var",
"digits",
";",
"var",
"currency",
"=",
"CURRENCIES_EN",
"[",
"code",
"]",
";",
"if",
"(",
"currency",
")",
"{",
"digits",
"=",
"currency",
"[",
"2",
"/* NbOfDigits */",
"]",
";",
"}",
... | Returns the number of decimal digits for the given currency.
Its value depends upon the presence of cents in that particular currency.
@experimental i18n support is experimental. | [
"Returns",
"the",
"number",
"of",
"decimal",
"digits",
"for",
"the",
"given",
"currency",
".",
"Its",
"value",
"depends",
"upon",
"the",
"presence",
"of",
"cents",
"in",
"that",
"particular",
"currency",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1279-L1286 |
11,676 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | dateStrGetter | function dateStrGetter(name, width, form, extended) {
if (form === void 0) { form = FormStyle.Format; }
if (extended === void 0) { extended = false; }
return function (date, locale) {
return getDateTranslation(date, locale, name, width, form, extended);
};
} | javascript | function dateStrGetter(name, width, form, extended) {
if (form === void 0) { form = FormStyle.Format; }
if (extended === void 0) { extended = false; }
return function (date, locale) {
return getDateTranslation(date, locale, name, width, form, extended);
};
} | [
"function",
"dateStrGetter",
"(",
"name",
",",
"width",
",",
"form",
",",
"extended",
")",
"{",
"if",
"(",
"form",
"===",
"void",
"0",
")",
"{",
"form",
"=",
"FormStyle",
".",
"Format",
";",
"}",
"if",
"(",
"extended",
"===",
"void",
"0",
")",
"{",... | Returns a date formatter that transforms a date into its locale string representation | [
"Returns",
"a",
"date",
"formatter",
"that",
"transforms",
"a",
"date",
"into",
"its",
"locale",
"string",
"representation"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1519-L1525 |
11,677 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | toDate | function toDate(value) {
if (isDate(value)) {
return value;
}
if (typeof value === 'number' && !isNaN(value)) {
return new Date(value);
}
if (typeof value === 'string') {
value = value.trim();
var parsedNb = parseFloat(value);
// any string that only contains ... | javascript | function toDate(value) {
if (isDate(value)) {
return value;
}
if (typeof value === 'number' && !isNaN(value)) {
return new Date(value);
}
if (typeof value === 'string') {
value = value.trim();
var parsedNb = parseFloat(value);
// any string that only contains ... | [
"function",
"toDate",
"(",
"value",
")",
"{",
"if",
"(",
"isDate",
"(",
"value",
")",
")",
"{",
"return",
"value",
";",
"}",
"if",
"(",
"typeof",
"value",
"===",
"'number'",
"&&",
"!",
"isNaN",
"(",
"value",
")",
")",
"{",
"return",
"new",
"Date",
... | Converts a value to date.
Supported input formats:
- `Date`
- number: timestamp
- string: numeric (e.g. "1234"), ISO and date strings in a format supported by
[Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
Note: ISO strings without time return a date withou... | [
"Converts",
"a",
"value",
"to",
"date",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L1879-L1914 |
11,678 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | toPercent | function toPercent(parsedNumber) {
// if the number is 0, don't do anything
if (parsedNumber.digits[0] === 0) {
return parsedNumber;
}
// Getting the current number of decimals
var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
if (parsedNumber.exponent) {
pa... | javascript | function toPercent(parsedNumber) {
// if the number is 0, don't do anything
if (parsedNumber.digits[0] === 0) {
return parsedNumber;
}
// Getting the current number of decimals
var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
if (parsedNumber.exponent) {
pa... | [
"function",
"toPercent",
"(",
"parsedNumber",
")",
"{",
"// if the number is 0, don't do anything",
"if",
"(",
"parsedNumber",
".",
"digits",
"[",
"0",
"]",
"===",
"0",
")",
"{",
"return",
"parsedNumber",
";",
"}",
"// Getting the current number of decimals",
"var",
... | Transforms a parsed number into a percentage by multiplying it by 100 | [
"Transforms",
"a",
"parsed",
"number",
"into",
"a",
"percentage",
"by",
"multiplying",
"it",
"by",
"100"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L2165-L2185 |
11,679 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | HttpHeaderResponse | function HttpHeaderResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.ResponseHeader;
return _this;
} | javascript | function HttpHeaderResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.ResponseHeader;
return _this;
} | [
"function",
"HttpHeaderResponse",
"(",
"init",
")",
"{",
"if",
"(",
"init",
"===",
"void",
"0",
")",
"{",
"init",
"=",
"{",
"}",
";",
"}",
"var",
"_this",
"=",
"_super",
".",
"call",
"(",
"this",
",",
"init",
")",
"||",
"this",
";",
"_this",
".",... | Create a new `HttpHeaderResponse` with the given parameters. | [
"Create",
"a",
"new",
"HttpHeaderResponse",
"with",
"the",
"given",
"parameters",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L6709-L6714 |
11,680 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | HttpResponse | function HttpResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.Response;
_this.body = init.body !== undefined ? init.body : null;
return _this;
} | javascript | function HttpResponse(init) {
if (init === void 0) { init = {}; }
var _this = _super.call(this, init) || this;
_this.type = HttpEventType.Response;
_this.body = init.body !== undefined ? init.body : null;
return _this;
} | [
"function",
"HttpResponse",
"(",
"init",
")",
"{",
"if",
"(",
"init",
"===",
"void",
"0",
")",
"{",
"init",
"=",
"{",
"}",
";",
"}",
"var",
"_this",
"=",
"_super",
".",
"call",
"(",
"this",
",",
"init",
")",
"||",
"this",
";",
"_this",
".",
"ty... | Construct a new `HttpResponse`. | [
"Construct",
"a",
"new",
"HttpResponse",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L6746-L6752 |
11,681 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | getResponseUrl | function getResponseUrl(xhr) {
if ('responseURL' in xhr && xhr.responseURL) {
return xhr.responseURL;
}
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL');
}
return null;
} | javascript | function getResponseUrl(xhr) {
if ('responseURL' in xhr && xhr.responseURL) {
return xhr.responseURL;
}
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL');
}
return null;
} | [
"function",
"getResponseUrl",
"(",
"xhr",
")",
"{",
"if",
"(",
"'responseURL'",
"in",
"xhr",
"&&",
"xhr",
".",
"responseURL",
")",
"{",
"return",
"xhr",
".",
"responseURL",
";",
"}",
"if",
"(",
"/",
"^X-Request-URL:",
"/",
"m",
".",
"test",
"(",
"xhr",... | Determine an appropriate URL for the response, by checking either
XMLHttpRequest.responseURL or the X-Request-URL header. | [
"Determine",
"an",
"appropriate",
"URL",
"for",
"the",
"response",
"by",
"checking",
"either",
"XMLHttpRequest",
".",
"responseURL",
"or",
"the",
"X",
"-",
"Request",
"-",
"URL",
"header",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7315-L7323 |
11,682 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | function () {
if (headerResponse !== null) {
return headerResponse;
}
// Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
var status = xhr.status === 1223 ? 204 : xhr.status;
var statusText = xh... | javascript | function () {
if (headerResponse !== null) {
return headerResponse;
}
// Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
var status = xhr.status === 1223 ? 204 : xhr.status;
var statusText = xh... | [
"function",
"(",
")",
"{",
"if",
"(",
"headerResponse",
"!==",
"null",
")",
"{",
"return",
"headerResponse",
";",
"}",
"// Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).",
"var",
"status",
"=",
"xhr",
".",
"status",
"===",
"1223",
"?",
"2... | partialFromXhr extracts the HttpHeaderResponse from the current XMLHttpRequest state, and memoizes it into headerResponse. | [
"partialFromXhr",
"extracts",
"the",
"HttpHeaderResponse",
"from",
"the",
"current",
"XMLHttpRequest",
"state",
"and",
"memoizes",
"it",
"into",
"headerResponse",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7412-L7427 | |
11,683 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | function () {
// Read response state from the memoized partial data.
var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;
// The body will be read out if present.
var body = null;
if... | javascript | function () {
// Read response state from the memoized partial data.
var _a = partialFromXhr(), headers = _a.headers, status = _a.status, statusText = _a.statusText, url = _a.url;
// The body will be read out if present.
var body = null;
if... | [
"function",
"(",
")",
"{",
"// Read response state from the memoized partial data.",
"var",
"_a",
"=",
"partialFromXhr",
"(",
")",
",",
"headers",
"=",
"_a",
".",
"headers",
",",
"status",
"=",
"_a",
".",
"status",
",",
"statusText",
"=",
"_a",
".",
"statusTex... | Next, a few closures are defined for the various events which XMLHttpRequest can emit. This allows them to be unregistered as event listeners later. First up is the load event, which represents a response being fully available. | [
"Next",
"a",
"few",
"closures",
"are",
"defined",
"for",
"the",
"various",
"events",
"which",
"XMLHttpRequest",
"can",
"emit",
".",
"This",
"allows",
"them",
"to",
"be",
"unregistered",
"as",
"event",
"listeners",
"later",
".",
"First",
"up",
"is",
"the",
... | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7431-L7498 | |
11,684 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | function (error) {
var res = new HttpErrorResponse({
error: error,
status: xhr.status || 0,
statusText: xhr.statusText || 'Unknown Error',
});
observer.error(res);
} | javascript | function (error) {
var res = new HttpErrorResponse({
error: error,
status: xhr.status || 0,
statusText: xhr.statusText || 'Unknown Error',
});
observer.error(res);
} | [
"function",
"(",
"error",
")",
"{",
"var",
"res",
"=",
"new",
"HttpErrorResponse",
"(",
"{",
"error",
":",
"error",
",",
"status",
":",
"xhr",
".",
"status",
"||",
"0",
",",
"statusText",
":",
"xhr",
".",
"statusText",
"||",
"'Unknown Error'",
",",
"}"... | The onError callback is called when something goes wrong at the network level. Connection timeout, DNS error, offline, etc. These are actual errors, and are transmitted on the error channel. | [
"The",
"onError",
"callback",
"is",
"called",
"when",
"something",
"goes",
"wrong",
"at",
"the",
"network",
"level",
".",
"Connection",
"timeout",
"DNS",
"error",
"offline",
"etc",
".",
"These",
"are",
"actual",
"errors",
"and",
"are",
"transmitted",
"on",
"... | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7502-L7509 | |
11,685 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | function (event) {
// Send the HttpResponseHeaders event if it hasn't been sent already.
if (!sentHeaders) {
observer.next(partialFromXhr());
sentHeaders = true;
}
// Start building the download progress event to del... | javascript | function (event) {
// Send the HttpResponseHeaders event if it hasn't been sent already.
if (!sentHeaders) {
observer.next(partialFromXhr());
sentHeaders = true;
}
// Start building the download progress event to del... | [
"function",
"(",
"event",
")",
"{",
"// Send the HttpResponseHeaders event if it hasn't been sent already.",
"if",
"(",
"!",
"sentHeaders",
")",
"{",
"observer",
".",
"next",
"(",
"partialFromXhr",
"(",
")",
")",
";",
"sentHeaders",
"=",
"true",
";",
"}",
"// Star... | The download progress event handler, which is only registered if progress events are enabled. | [
"The",
"download",
"progress",
"event",
"handler",
"which",
"is",
"only",
"registered",
"if",
"progress",
"events",
"are",
"enabled",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7517-L7541 | |
11,686 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | function (event) {
// Upload progress events are simpler. Begin building the progress
// event.
var progress = {
type: HttpEventType.UploadProgress,
loaded: event.loaded,
};
// If the total number of ... | javascript | function (event) {
// Upload progress events are simpler. Begin building the progress
// event.
var progress = {
type: HttpEventType.UploadProgress,
loaded: event.loaded,
};
// If the total number of ... | [
"function",
"(",
"event",
")",
"{",
"// Upload progress events are simpler. Begin building the progress",
"// event.",
"var",
"progress",
"=",
"{",
"type",
":",
"HttpEventType",
".",
"UploadProgress",
",",
"loaded",
":",
"event",
".",
"loaded",
",",
"}",
";",
"// If... | The upload progress event handler, which is only registered if progress events are enabled. | [
"The",
"upload",
"progress",
"event",
"handler",
"which",
"is",
"only",
"registered",
"if",
"progress",
"events",
"are",
"enabled",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L7544-L7558 | |
11,687 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | defineInjector | function defineInjector(options) {
return {
factory: options.factory, providers: options.providers || [], imports: options.imports || [],
};
} | javascript | function defineInjector(options) {
return {
factory: options.factory, providers: options.providers || [], imports: options.imports || [],
};
} | [
"function",
"defineInjector",
"(",
"options",
")",
"{",
"return",
"{",
"factory",
":",
"options",
".",
"factory",
",",
"providers",
":",
"options",
".",
"providers",
"||",
"[",
"]",
",",
"imports",
":",
"options",
".",
"imports",
"||",
"[",
"]",
",",
"... | Construct an `InjectorDef` which configures an injector.
This should be assigned to a static `ngInjectorDef` field on a type, which will then be an
`InjectorType`.
Options:
* `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to
create the type must be provided. If that facto... | [
"Construct",
"an",
"InjectorDef",
"which",
"configures",
"an",
"injector",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L8248-L8252 |
11,688 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | resolveForwardRef | function resolveForwardRef(type) {
if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&
type.__forward_ref__ === forwardRef) {
return type();
}
else {
return type;
}
} | javascript | function resolveForwardRef(type) {
if (typeof type === 'function' && type.hasOwnProperty('__forward_ref__') &&
type.__forward_ref__ === forwardRef) {
return type();
}
else {
return type;
}
} | [
"function",
"resolveForwardRef",
"(",
"type",
")",
"{",
"if",
"(",
"typeof",
"type",
"===",
"'function'",
"&&",
"type",
".",
"hasOwnProperty",
"(",
"'__forward_ref__'",
")",
"&&",
"type",
".",
"__forward_ref__",
"===",
"forwardRef",
")",
"{",
"return",
"type",... | Lazily retrieves the reference value from a forwardRef.
Acts as the identity function when given a non-forward-ref value.
@usageNotes
### Example
{@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}
@see `forwardRef`
@experimental | [
"Lazily",
"retrieves",
"the",
"reference",
"value",
"from",
"a",
"forwardRef",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L9174-L9182 |
11,689 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | resolveReflectiveProvider | function resolveReflectiveProvider(provider) {
return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
} | javascript | function resolveReflectiveProvider(provider) {
return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);
} | [
"function",
"resolveReflectiveProvider",
"(",
"provider",
")",
"{",
"return",
"new",
"ResolvedReflectiveProvider_",
"(",
"ReflectiveKey",
".",
"get",
"(",
"provider",
".",
"provide",
")",
",",
"[",
"resolveReflectiveFactory",
"(",
"provider",
")",
"]",
",",
"provi... | Converts the `Provider` into `ResolvedProvider`.
`Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider
syntax. | [
"Converts",
"the",
"Provider",
"into",
"ResolvedProvider",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L10368-L10370 |
11,690 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | EventEmitter | function EventEmitter(isAsync) {
if (isAsync === void 0) { isAsync = false; }
var _this = _super.call(this) || this;
_this.__isAsync = isAsync;
return _this;
} | javascript | function EventEmitter(isAsync) {
if (isAsync === void 0) { isAsync = false; }
var _this = _super.call(this) || this;
_this.__isAsync = isAsync;
return _this;
} | [
"function",
"EventEmitter",
"(",
"isAsync",
")",
"{",
"if",
"(",
"isAsync",
"===",
"void",
"0",
")",
"{",
"isAsync",
"=",
"false",
";",
"}",
"var",
"_this",
"=",
"_super",
".",
"call",
"(",
"this",
")",
"||",
"this",
";",
"_this",
".",
"__isAsync",
... | Creates an instance of this class that can
deliver events synchronously or asynchronously.
@param isAsync When true, deliver events asynchronously. | [
"Creates",
"an",
"instance",
"of",
"this",
"class",
"that",
"can",
"deliver",
"events",
"synchronously",
"or",
"asynchronously",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L11714-L11719 |
11,691 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | registerModuleFactory | function registerModuleFactory(id, factory) {
var existing = moduleFactories.get(id);
if (existing) {
throw new Error("Duplicate module registered for " + id + " - " + existing.moduleType.name + " vs " + factory.moduleType.name);
}
moduleFactories.set(id, factory);
} | javascript | function registerModuleFactory(id, factory) {
var existing = moduleFactories.get(id);
if (existing) {
throw new Error("Duplicate module registered for " + id + " - " + existing.moduleType.name + " vs " + factory.moduleType.name);
}
moduleFactories.set(id, factory);
} | [
"function",
"registerModuleFactory",
"(",
"id",
",",
"factory",
")",
"{",
"var",
"existing",
"=",
"moduleFactories",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"existing",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Duplicate module registered for \"",
"+",
... | Registers a loaded module. Should only be called from generated NgModuleFactory code.
@experimental | [
"Registers",
"a",
"loaded",
"module",
".",
"Should",
"only",
"be",
"called",
"from",
"generated",
"NgModuleFactory",
"code",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L13005-L13011 |
11,692 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | shouldCallLifecycleInitHook | function shouldCallLifecycleInitHook(view, initState, index) {
if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {
view.initIndex = index + 1;
return true;
}
return false;
} | javascript | function shouldCallLifecycleInitHook(view, initState, index) {
if ((view.state & 1792 /* InitState_Mask */) === initState && view.initIndex <= index) {
view.initIndex = index + 1;
return true;
}
return false;
} | [
"function",
"shouldCallLifecycleInitHook",
"(",
"view",
",",
"initState",
",",
"index",
")",
"{",
"if",
"(",
"(",
"view",
".",
"state",
"&",
"1792",
"/* InitState_Mask */",
")",
"===",
"initState",
"&&",
"view",
".",
"initIndex",
"<=",
"index",
")",
"{",
"... | Returns true if the lifecycle init method should be called for the node with the given init index. | [
"Returns",
"true",
"if",
"the",
"lifecycle",
"init",
"method",
"should",
"be",
"called",
"for",
"the",
"node",
"with",
"the",
"given",
"init",
"index",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L15691-L15697 |
11,693 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | viewParentEl | function viewParentEl(view) {
var parentView = view.parent;
if (parentView) {
return view.parentNodeDef.parent;
}
else {
return null;
}
} | javascript | function viewParentEl(view) {
var parentView = view.parent;
if (parentView) {
return view.parentNodeDef.parent;
}
else {
return null;
}
} | [
"function",
"viewParentEl",
"(",
"view",
")",
"{",
"var",
"parentView",
"=",
"view",
".",
"parent",
";",
"if",
"(",
"parentView",
")",
"{",
"return",
"view",
".",
"parentNodeDef",
".",
"parent",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
] | for component views, this is the host element.
for embedded views, this is the index of the parent node
that contains the view container. | [
"for",
"component",
"views",
"this",
"is",
"the",
"host",
"element",
".",
"for",
"embedded",
"views",
"this",
"is",
"the",
"index",
"of",
"the",
"parent",
"node",
"that",
"contains",
"the",
"view",
"container",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L15918-L15926 |
11,694 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | queueLifecycleHooks | function queueLifecycleHooks(flags, tView) {
if (tView.firstTemplatePass) {
var start = flags >> 14 /* DirectiveStartingIndexShift */;
var count = flags & 4095 /* DirectiveCountMask */;
var end = start + count;
// It's necessary to loop through the directives at elementEnd() (rather ... | javascript | function queueLifecycleHooks(flags, tView) {
if (tView.firstTemplatePass) {
var start = flags >> 14 /* DirectiveStartingIndexShift */;
var count = flags & 4095 /* DirectiveCountMask */;
var end = start + count;
// It's necessary to loop through the directives at elementEnd() (rather ... | [
"function",
"queueLifecycleHooks",
"(",
"flags",
",",
"tView",
")",
"{",
"if",
"(",
"tView",
".",
"firstTemplatePass",
")",
"{",
"var",
"start",
"=",
"flags",
">>",
"14",
"/* DirectiveStartingIndexShift */",
";",
"var",
"count",
"=",
"flags",
"&",
"4095",
"/... | Loops through the directives on a node and queues all their hooks except ngOnInit
and ngDoCheck, which are queued separately in directiveCreate. | [
"Loops",
"through",
"the",
"directives",
"on",
"a",
"node",
"and",
"queues",
"all",
"their",
"hooks",
"except",
"ngOnInit",
"and",
"ngDoCheck",
"which",
"are",
"queued",
"separately",
"in",
"directiveCreate",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19898-L19913 |
11,695 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | queueContentHooks | function queueContentHooks(def, tView, i) {
if (def.afterContentInit) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);
}
if (def.afterContentChecked) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);
(tView.content... | javascript | function queueContentHooks(def, tView, i) {
if (def.afterContentInit) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);
}
if (def.afterContentChecked) {
(tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);
(tView.content... | [
"function",
"queueContentHooks",
"(",
"def",
",",
"tView",
",",
"i",
")",
"{",
"if",
"(",
"def",
".",
"afterContentInit",
")",
"{",
"(",
"tView",
".",
"contentHooks",
"||",
"(",
"tView",
".",
"contentHooks",
"=",
"[",
"]",
")",
")",
".",
"push",
"(",... | Queues afterContentInit and afterContentChecked hooks on TView | [
"Queues",
"afterContentInit",
"and",
"afterContentChecked",
"hooks",
"on",
"TView"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19915-L19923 |
11,696 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | queueViewHooks | function queueViewHooks(def, tView, i) {
if (def.afterViewInit) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);
}
if (def.afterViewChecked) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);
(tView.viewCheckHooks || (tView.viewCheck... | javascript | function queueViewHooks(def, tView, i) {
if (def.afterViewInit) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);
}
if (def.afterViewChecked) {
(tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);
(tView.viewCheckHooks || (tView.viewCheck... | [
"function",
"queueViewHooks",
"(",
"def",
",",
"tView",
",",
"i",
")",
"{",
"if",
"(",
"def",
".",
"afterViewInit",
")",
"{",
"(",
"tView",
".",
"viewHooks",
"||",
"(",
"tView",
".",
"viewHooks",
"=",
"[",
"]",
")",
")",
".",
"push",
"(",
"i",
",... | Queues afterViewInit and afterViewChecked hooks on TView | [
"Queues",
"afterViewInit",
"and",
"afterViewChecked",
"hooks",
"on",
"TView"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19925-L19933 |
11,697 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | queueDestroyHooks | function queueDestroyHooks(def, tView, i) {
if (def.onDestroy != null) {
(tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);
}
} | javascript | function queueDestroyHooks(def, tView, i) {
if (def.onDestroy != null) {
(tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);
}
} | [
"function",
"queueDestroyHooks",
"(",
"def",
",",
"tView",
",",
"i",
")",
"{",
"if",
"(",
"def",
".",
"onDestroy",
"!=",
"null",
")",
"{",
"(",
"tView",
".",
"destroyHooks",
"||",
"(",
"tView",
".",
"destroyHooks",
"=",
"[",
"]",
")",
")",
".",
"pu... | Queues onDestroy hooks on TView | [
"Queues",
"onDestroy",
"hooks",
"on",
"TView"
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19935-L19939 |
11,698 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | executeInitHooks | function executeInitHooks(currentView, tView, creationMode) {
if (currentView[FLAGS] & 16 /* RunInit */) {
executeHooks(currentView[DIRECTIVES], tView.initHooks, tView.checkHooks, creationMode);
currentView[FLAGS] &= ~16 /* RunInit */;
}
} | javascript | function executeInitHooks(currentView, tView, creationMode) {
if (currentView[FLAGS] & 16 /* RunInit */) {
executeHooks(currentView[DIRECTIVES], tView.initHooks, tView.checkHooks, creationMode);
currentView[FLAGS] &= ~16 /* RunInit */;
}
} | [
"function",
"executeInitHooks",
"(",
"currentView",
",",
"tView",
",",
"creationMode",
")",
"{",
"if",
"(",
"currentView",
"[",
"FLAGS",
"]",
"&",
"16",
"/* RunInit */",
")",
"{",
"executeHooks",
"(",
"currentView",
"[",
"DIRECTIVES",
"]",
",",
"tView",
".",... | Calls onInit and doCheck calls if they haven't already been called.
@param currentView The current view | [
"Calls",
"onInit",
"and",
"doCheck",
"calls",
"if",
"they",
"haven",
"t",
"already",
"been",
"called",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19945-L19950 |
11,699 | CuppaLabs/angular2-multiselect-dropdown | docs/vendor.js | executeHooks | function executeHooks(data, allHooks, checkHooks, creationMode) {
var hooksToCall = creationMode ? allHooks : checkHooks;
if (hooksToCall) {
callHooks(data, hooksToCall);
}
} | javascript | function executeHooks(data, allHooks, checkHooks, creationMode) {
var hooksToCall = creationMode ? allHooks : checkHooks;
if (hooksToCall) {
callHooks(data, hooksToCall);
}
} | [
"function",
"executeHooks",
"(",
"data",
",",
"allHooks",
",",
"checkHooks",
",",
"creationMode",
")",
"{",
"var",
"hooksToCall",
"=",
"creationMode",
"?",
"allHooks",
":",
"checkHooks",
";",
"if",
"(",
"hooksToCall",
")",
"{",
"callHooks",
"(",
"data",
",",... | Iterates over afterViewInit and afterViewChecked functions and calls them.
@param currentView The current view | [
"Iterates",
"over",
"afterViewInit",
"and",
"afterViewChecked",
"functions",
"and",
"calls",
"them",
"."
] | cb94eb9af46de79c69d61b4fd37a800009fb70d3 | https://github.com/CuppaLabs/angular2-multiselect-dropdown/blob/cb94eb9af46de79c69d61b4fd37a800009fb70d3/docs/vendor.js#L19956-L19961 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.