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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,000 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | function(item, arr) {
for (var i = 0; i < arr[LEXICON.l]; i++)
//Sometiems in IE a "SCRIPT70" Permission denied error occurs if HTML elements in a iFrame are compared
try {
if (arr[i] === item)
return i;
... | javascript | function(item, arr) {
for (var i = 0; i < arr[LEXICON.l]; i++)
//Sometiems in IE a "SCRIPT70" Permission denied error occurs if HTML elements in a iFrame are compared
try {
if (arr[i] === item)
return i;
... | [
"function",
"(",
"item",
",",
"arr",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
"[",
"LEXICON",
".",
"l",
"]",
";",
"i",
"++",
")",
"//Sometiems in IE a \"SCRIPT70\" Permission denied error occurs if HTML elements in a iFrame are compared",
... | Checks whether a item is in the given array and returns its index.
@param item The item of which the position in the array shall be determined.
@param arr The array.
@returns {number} The zero based index of the item or -1 if the item isn't in the array. | [
"Checks",
"whether",
"a",
"item",
"is",
"in",
"the",
"given",
"array",
"and",
"returns",
"its",
"index",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L249-L258 | |
10,001 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | function(arr) {
var def = Array.isArray;
return def ? def(arr) : this.type(arr) == TYPES.a;
} | javascript | function(arr) {
var def = Array.isArray;
return def ? def(arr) : this.type(arr) == TYPES.a;
} | [
"function",
"(",
"arr",
")",
"{",
"var",
"def",
"=",
"Array",
".",
"isArray",
";",
"return",
"def",
"?",
"def",
"(",
"arr",
")",
":",
"this",
".",
"type",
"(",
"arr",
")",
"==",
"TYPES",
".",
"a",
";",
"}"
] | Returns true if the given value is a array.
@param arr The potential array.
@returns {boolean} True if the given value is a array, false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"value",
"is",
"a",
"array",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L265-L268 | |
10,002 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | initOverlayScrollbarsStatics | function initOverlayScrollbarsStatics() {
if(!_pluginsGlobals)
_pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults);
if(!_pluginsAutoUpdateLoop)
_pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);
... | javascript | function initOverlayScrollbarsStatics() {
if(!_pluginsGlobals)
_pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults);
if(!_pluginsAutoUpdateLoop)
_pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);
... | [
"function",
"initOverlayScrollbarsStatics",
"(",
")",
"{",
"if",
"(",
"!",
"_pluginsGlobals",
")",
"_pluginsGlobals",
"=",
"new",
"OverlayScrollbarsGlobals",
"(",
"_pluginsOptions",
".",
"_defaults",
")",
";",
"if",
"(",
"!",
"_pluginsAutoUpdateLoop",
")",
"_plugins... | Initializes the object which contains global information about the plugin and each instance of it. | [
"Initializes",
"the",
"object",
"which",
"contains",
"global",
"information",
"about",
"the",
"plugin",
"and",
"each",
"instance",
"of",
"it",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L1647-L1652 |
10,003 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | function() {
if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
_loopID = COMPATIBILITY.rAF()(function () {
loop();
});
var timeNew = COMPATIBILITY.now();
var timeDelta =... | javascript | function() {
if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
_loopID = COMPATIBILITY.rAF()(function () {
loop();
});
var timeNew = COMPATIBILITY.now();
var timeDelta =... | [
"function",
"(",
")",
"{",
"if",
"(",
"_loopingInstances",
"[",
"_strLength",
"]",
">",
"0",
"&&",
"_loopIsActive",
")",
"{",
"_loopID",
"=",
"COMPATIBILITY",
".",
"rAF",
"(",
")",
"(",
"function",
"(",
")",
"{",
"loop",
"(",
")",
";",
"}",
")",
";... | The auto update loop which will run every 50 milliseconds or less if the update interval of a instance is lower than 50 milliseconds. | [
"The",
"auto",
"update",
"loop",
"which",
"will",
"run",
"every",
"50",
"milliseconds",
"or",
"less",
"if",
"the",
"update",
"interval",
"of",
"a",
"instance",
"is",
"lower",
"than",
"50",
"milliseconds",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L1879-L1917 | |
10,004 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | removePassiveEventListener | function removePassiveEventListener(element, eventNames, listener) {
var events = eventNames.split(_strSpace);
for (var i = 0; i < events.length; i++)
element[0].removeEventListener(events[i], listener, {passive: true});
} | javascript | function removePassiveEventListener(element, eventNames, listener) {
var events = eventNames.split(_strSpace);
for (var i = 0; i < events.length; i++)
element[0].removeEventListener(events[i], listener, {passive: true});
} | [
"function",
"removePassiveEventListener",
"(",
"element",
",",
"eventNames",
",",
"listener",
")",
"{",
"var",
"events",
"=",
"eventNames",
".",
"split",
"(",
"_strSpace",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"events",
".",
"length"... | Removes a passive event listener to the given element.
@param element The element from which the event listener shall be removed.
@param eventNames The name(s) of the event listener.
@param listener The listener method which shall be removed. | [
"Removes",
"a",
"passive",
"event",
"listener",
"to",
"the",
"given",
"element",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2257-L2261 |
10,005 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | function () {
/*
var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
var sizeResetHeight = obser... | javascript | function () {
/*
var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
var sizeResetHeight = obser... | [
"function",
"(",
")",
"{",
"/*\n var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;\n var sizeResetHeight = observerE... | care don't make changes to this object!!! | [
"care",
"don",
"t",
"make",
"changes",
"to",
"this",
"object!!!"
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2312-L2327 | |
10,006 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | removeResizeObserver | function removeResizeObserver(targetElement) {
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].disconnect();
delete element[_strResizeObserverProperty];
... | javascript | function removeResizeObserver(targetElement) {
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].disconnect();
delete element[_strResizeObserverProperty];
... | [
"function",
"removeResizeObserver",
"(",
"targetElement",
")",
"{",
"if",
"(",
"_supportResizeObserver",
")",
"{",
"var",
"element",
"=",
"targetElement",
".",
"contents",
"(",
")",
"[",
"0",
"]",
";",
"element",
"[",
"_strResizeObserverProperty",
"]",
".",
"d... | Removes a resize observer from the given element.
@param targetElement The element to which the target resize observer is applied. | [
"Removes",
"a",
"resize",
"observer",
"from",
"the",
"given",
"element",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2446-L2455 |
10,007 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | connectMutationObservers | function connectMutationObservers() {
if (_supportMutationObserver && !_mutationObserversConnected) {
_mutationObserverHost.observe(_hostElementNative, {
attributes: true,
attributeOldValue: true,
... | javascript | function connectMutationObservers() {
if (_supportMutationObserver && !_mutationObserversConnected) {
_mutationObserverHost.observe(_hostElementNative, {
attributes: true,
attributeOldValue: true,
... | [
"function",
"connectMutationObservers",
"(",
")",
"{",
"if",
"(",
"_supportMutationObserver",
"&&",
"!",
"_mutationObserversConnected",
")",
"{",
"_mutationObserverHost",
".",
"observe",
"(",
"_hostElementNative",
",",
"{",
"attributes",
":",
"true",
",",
"attributeOl... | Connects the MutationObservers if they are supported. | [
"Connects",
"the",
"MutationObservers",
"if",
"they",
"are",
"supported",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2587-L2606 |
10,008 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | hostOnMouseMove | function hostOnMouseMove() {
if (_scrollbarsAutoHideMove) {
refreshScrollbarsAutoHide(true);
clearTimeout(_scrollbarsAutoHideMoveTimeoutId);
_scrollbarsAutoHideMoveTimeoutId = setTimeout(function () {
... | javascript | function hostOnMouseMove() {
if (_scrollbarsAutoHideMove) {
refreshScrollbarsAutoHide(true);
clearTimeout(_scrollbarsAutoHideMoveTimeoutId);
_scrollbarsAutoHideMoveTimeoutId = setTimeout(function () {
... | [
"function",
"hostOnMouseMove",
"(",
")",
"{",
"if",
"(",
"_scrollbarsAutoHideMove",
")",
"{",
"refreshScrollbarsAutoHide",
"(",
"true",
")",
";",
"clearTimeout",
"(",
"_scrollbarsAutoHideMoveTimeoutId",
")",
";",
"_scrollbarsAutoHideMoveTimeoutId",
"=",
"setTimeout",
"(... | The mouse move event of the host element. This event is only needed for the autoHide "move" feature. | [
"The",
"mouse",
"move",
"event",
"of",
"the",
"host",
"element",
".",
"This",
"event",
"is",
"only",
"needed",
"for",
"the",
"autoHide",
"move",
"feature",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2668-L2677 |
10,009 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | isUnknownMutation | function isUnknownMutation(mutation) {
var attributeName = mutation.attributeName;
var mutationTarget = mutation.target;
var mutationType = mutation.type;
var strClosest = 'closest';
if (mutationTarget === _contentEleme... | javascript | function isUnknownMutation(mutation) {
var attributeName = mutation.attributeName;
var mutationTarget = mutation.target;
var mutationType = mutation.type;
var strClosest = 'closest';
if (mutationTarget === _contentEleme... | [
"function",
"isUnknownMutation",
"(",
"mutation",
")",
"{",
"var",
"attributeName",
"=",
"mutation",
".",
"attributeName",
";",
"var",
"mutationTarget",
"=",
"mutation",
".",
"target",
";",
"var",
"mutationType",
"=",
"mutation",
".",
"type",
";",
"var",
"strC... | Returns true if the given mutation is not from a from the plugin generated element. If the target element is a textarea the mutation is always unknown.
@param mutation The mutation which shall be checked.
@returns {boolean} True if the mutation is from a unknown element, false otherwise. | [
"Returns",
"true",
"if",
"the",
"given",
"mutation",
"is",
"not",
"from",
"a",
"from",
"the",
"plugin",
"generated",
"element",
".",
"If",
"the",
"target",
"element",
"is",
"a",
"textarea",
"the",
"mutation",
"is",
"always",
"unknown",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2801-L2823 |
10,010 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | updateAutoContentSizeChanged | function updateAutoContentSizeChanged() {
if (_isSleeping)
return false;
var float;
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
var setC... | javascript | function updateAutoContentSizeChanged() {
if (_isSleeping)
return false;
var float;
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
var setC... | [
"function",
"updateAutoContentSizeChanged",
"(",
")",
"{",
"if",
"(",
"_isSleeping",
")",
"return",
"false",
";",
"var",
"float",
";",
"var",
"textareaValueLength",
"=",
"_isTextarea",
"&&",
"_widthAutoCache",
"&&",
"!",
"_textareaAutoWrappingCache",
"?",
"_targetEl... | Returns true if the content size was changed since the last time this method was called.
@returns {boolean} True if the content size was changed, false otherwise. | [
"Returns",
"true",
"if",
"the",
"content",
"size",
"was",
"changed",
"since",
"the",
"last",
"time",
"this",
"method",
"was",
"called",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2829-L2874 |
10,011 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | isSizeAffectingCSSProperty | function isSizeAffectingCSSProperty(propertyName) {
if (!_initialized)
return true;
var flexGrow = 'flex-grow';
var flexShrink = 'flex-shrink';
var flexBasis = 'flex-basis';
var affectingPropsX = ... | javascript | function isSizeAffectingCSSProperty(propertyName) {
if (!_initialized)
return true;
var flexGrow = 'flex-grow';
var flexShrink = 'flex-shrink';
var flexBasis = 'flex-basis';
var affectingPropsX = ... | [
"function",
"isSizeAffectingCSSProperty",
"(",
"propertyName",
")",
"{",
"if",
"(",
"!",
"_initialized",
")",
"return",
"true",
";",
"var",
"flexGrow",
"=",
"'flex-grow'",
";",
"var",
"flexShrink",
"=",
"'flex-shrink'",
";",
"var",
"flexBasis",
"=",
"'flex-basis... | Checks is a CSS Property of a child element is affecting the scroll size of the content.
@param propertyName The CSS property name.
@returns {boolean} True if the property is affecting the content scroll size, false otherwise. | [
"Checks",
"is",
"a",
"CSS",
"Property",
"of",
"a",
"child",
"element",
"is",
"affecting",
"the",
"scroll",
"size",
"of",
"the",
"content",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L2917-L2986 |
10,012 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | refreshScrollbarAppearance | function refreshScrollbarAppearance(isHorizontal, shallBeVisible, canScroll) {
var scrollbarClassName = isHorizontal ? _classNameHostScrollbarHorizontalHidden : _classNameHostScrollbarVerticalHidden;
var scrollbarElement = isHorizontal ? _scrollbarHorizontalElement : _scrollbarVe... | javascript | function refreshScrollbarAppearance(isHorizontal, shallBeVisible, canScroll) {
var scrollbarClassName = isHorizontal ? _classNameHostScrollbarHorizontalHidden : _classNameHostScrollbarVerticalHidden;
var scrollbarElement = isHorizontal ? _scrollbarHorizontalElement : _scrollbarVe... | [
"function",
"refreshScrollbarAppearance",
"(",
"isHorizontal",
",",
"shallBeVisible",
",",
"canScroll",
")",
"{",
"var",
"scrollbarClassName",
"=",
"isHorizontal",
"?",
"_classNameHostScrollbarHorizontalHidden",
":",
"_classNameHostScrollbarVerticalHidden",
";",
"var",
"scrol... | Shows or hides the given scrollbar and applied a class name which indicates if the scrollbar is scrollable or not.
@param isHorizontal True if the horizontal scrollbar is the target, false if the vertical scrollbar is the target.
@param shallBeVisible True if the scrollbar shall be shown, false if hidden.
@param canScr... | [
"Shows",
"or",
"hides",
"the",
"given",
"scrollbar",
"and",
"applied",
"a",
"class",
"name",
"which",
"indicates",
"if",
"the",
"scrollbar",
"is",
"scrollable",
"or",
"not",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L4698-L4711 |
10,013 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | refreshScrollbarHandleLength | function refreshScrollbarHandleLength(isHorizontal) {
var handleCSS = {};
var scrollbarVars = getScrollbarVars(isHorizontal);
var scrollbarVarsInfo = scrollbarVars._info;
var digit = 1000000;
//get and apply intended han... | javascript | function refreshScrollbarHandleLength(isHorizontal) {
var handleCSS = {};
var scrollbarVars = getScrollbarVars(isHorizontal);
var scrollbarVarsInfo = scrollbarVars._info;
var digit = 1000000;
//get and apply intended han... | [
"function",
"refreshScrollbarHandleLength",
"(",
"isHorizontal",
")",
"{",
"var",
"handleCSS",
"=",
"{",
"}",
";",
"var",
"scrollbarVars",
"=",
"getScrollbarVars",
"(",
"isHorizontal",
")",
";",
"var",
"scrollbarVarsInfo",
"=",
"scrollbarVars",
".",
"_info",
";",
... | Refreshes the handle length of the given scrollbar.
@param isHorizontal True if the horizontal scrollbar handle shall be refreshed, false if the vertical one shall be refreshed. | [
"Refreshes",
"the",
"handle",
"length",
"of",
"the",
"given",
"scrollbar",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L4749-L4764 |
10,014 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | refreshScrollbarsInteractive | function refreshScrollbarsInteractive(isTrack, value) {
var action = value ? 'removeClass' : 'addClass';
var element1 = isTrack ? _scrollbarHorizontalTrackElement : _scrollbarHorizontalHandleElement;
var element2 = isTrack ? _scrollbarVerticalTrackElement : _s... | javascript | function refreshScrollbarsInteractive(isTrack, value) {
var action = value ? 'removeClass' : 'addClass';
var element1 = isTrack ? _scrollbarHorizontalTrackElement : _scrollbarHorizontalHandleElement;
var element2 = isTrack ? _scrollbarVerticalTrackElement : _s... | [
"function",
"refreshScrollbarsInteractive",
"(",
"isTrack",
",",
"value",
")",
"{",
"var",
"action",
"=",
"value",
"?",
"'removeClass'",
":",
"'addClass'",
";",
"var",
"element1",
"=",
"isTrack",
"?",
"_scrollbarHorizontalTrackElement",
":",
"_scrollbarHorizontalHandl... | Refreshes the interactivity of the given scrollbar element.
@param isTrack True if the track element is the target, false if the handle element is the target.
@param value True for interactivity false for no interactivity. | [
"Refreshes",
"the",
"interactivity",
"of",
"the",
"given",
"scrollbar",
"element",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L4852-L4860 |
10,015 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | getScrollbarVars | function getScrollbarVars(isHorizontal) {
return {
_width_height: isHorizontal ? _strWidth : _strHeight,
_Width_Height: isHorizontal ? 'Width' : 'Height',
_left_top: isHorizontal ? _strLeft : _strTop,
_Le... | javascript | function getScrollbarVars(isHorizontal) {
return {
_width_height: isHorizontal ? _strWidth : _strHeight,
_Width_Height: isHorizontal ? 'Width' : 'Height',
_left_top: isHorizontal ? _strLeft : _strTop,
_Le... | [
"function",
"getScrollbarVars",
"(",
"isHorizontal",
")",
"{",
"return",
"{",
"_width_height",
":",
"isHorizontal",
"?",
"_strWidth",
":",
"_strHeight",
",",
"_Width_Height",
":",
"isHorizontal",
"?",
"'Width'",
":",
"'Height'",
",",
"_left_top",
":",
"isHorizonta... | Returns a object which is used for fast access for specific variables.
@param isHorizontal True if the horizontal scrollbar vars shall be accessed, false if the vertical scrollbar vars shall be accessed.
@returns {{wh: string, WH: string, lt: string, _wh: string, _lt: string, t: *, h: *, c: {}, s: *}} | [
"Returns",
"a",
"object",
"which",
"is",
"used",
"for",
"fast",
"access",
"for",
"specific",
"variables",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L4867-L4882 |
10,016 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | setupScrollbarCornerEvents | function setupScrollbarCornerEvents() {
var insideIFrame = _windowElementNative.top !== _windowElementNative;
var mouseDownPosition = { };
var mouseDownSize = { };
var mouseDownInvertedScale = { };
_resizeOnMouseTouchDo... | javascript | function setupScrollbarCornerEvents() {
var insideIFrame = _windowElementNative.top !== _windowElementNative;
var mouseDownPosition = { };
var mouseDownSize = { };
var mouseDownInvertedScale = { };
_resizeOnMouseTouchDo... | [
"function",
"setupScrollbarCornerEvents",
"(",
")",
"{",
"var",
"insideIFrame",
"=",
"_windowElementNative",
".",
"top",
"!==",
"_windowElementNative",
";",
"var",
"mouseDownPosition",
"=",
"{",
"}",
";",
"var",
"mouseDownSize",
"=",
"{",
"}",
";",
"var",
"mouse... | Initializes all scrollbar corner interactivity events. | [
"Initializes",
"all",
"scrollbar",
"corner",
"interactivity",
"events",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L4904-L4976 |
10,017 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | setTopRightBottomLeft | function setTopRightBottomLeft(targetCSSObject, prefix, values) {
if (values === undefined)
values = [_strEmpty, _strEmpty, _strEmpty, _strEmpty];
targetCSSObject[prefix + _strTop] = values[0];
targetCSSObject[prefix + _strRight] = val... | javascript | function setTopRightBottomLeft(targetCSSObject, prefix, values) {
if (values === undefined)
values = [_strEmpty, _strEmpty, _strEmpty, _strEmpty];
targetCSSObject[prefix + _strTop] = values[0];
targetCSSObject[prefix + _strRight] = val... | [
"function",
"setTopRightBottomLeft",
"(",
"targetCSSObject",
",",
"prefix",
",",
"values",
")",
"{",
"if",
"(",
"values",
"===",
"undefined",
")",
"values",
"=",
"[",
"_strEmpty",
",",
"_strEmpty",
",",
"_strEmpty",
",",
"_strEmpty",
"]",
";",
"targetCSSObject... | Sets the "top, right, bottom, left" properties, with a given prefix, of the given css object.
@param targetCSSObject The css object to which the values shall be applied.
@param prefix The prefix of the "top, right, bottom, left" css properties. (example: 'padding-' is a valid prefix)
@param values A array of values whi... | [
"Sets",
"the",
"top",
"right",
"bottom",
"left",
"properties",
"with",
"a",
"given",
"prefix",
"of",
"the",
"given",
"css",
"object",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5015-L5023 |
10,018 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | getCSSTransitionString | function getCSSTransitionString(element) {
var transitionStr = VENDORS._cssProperty('transition');
var assembledValue = element.css(transitionStr);
if(assembledValue)
return assembledValue;
var regExpString = '\\s*('... | javascript | function getCSSTransitionString(element) {
var transitionStr = VENDORS._cssProperty('transition');
var assembledValue = element.css(transitionStr);
if(assembledValue)
return assembledValue;
var regExpString = '\\s*('... | [
"function",
"getCSSTransitionString",
"(",
"element",
")",
"{",
"var",
"transitionStr",
"=",
"VENDORS",
".",
"_cssProperty",
"(",
"'transition'",
")",
";",
"var",
"assembledValue",
"=",
"element",
".",
"css",
"(",
"transitionStr",
")",
";",
"if",
"(",
"assembl... | Returns the computed CSS transition string from the given element.
@param element The element from which the transition string shall be returned.
@returns {string} The CSS transition string from the given element. | [
"Returns",
"the",
"computed",
"CSS",
"transition",
"string",
"from",
"the",
"given",
"element",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5030-L5061 |
10,019 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | isHTMLElement | function isHTMLElement(o) {
var strOwnerDocument = 'ownerDocument';
var strHTMLElement = 'HTMLElement';
var wnd = o && o[strOwnerDocument] ? (o[strOwnerDocument].parentWindow || window) : window;
return (
typeof wnd[... | javascript | function isHTMLElement(o) {
var strOwnerDocument = 'ownerDocument';
var strHTMLElement = 'HTMLElement';
var wnd = o && o[strOwnerDocument] ? (o[strOwnerDocument].parentWindow || window) : window;
return (
typeof wnd[... | [
"function",
"isHTMLElement",
"(",
"o",
")",
"{",
"var",
"strOwnerDocument",
"=",
"'ownerDocument'",
";",
"var",
"strHTMLElement",
"=",
"'HTMLElement'",
";",
"var",
"wnd",
"=",
"o",
"&&",
"o",
"[",
"strOwnerDocument",
"]",
"?",
"(",
"o",
"[",
"strOwnerDocumen... | Checks whether the given object is a HTMLElement.
@param o The object which shall be checked.
@returns {boolean} True the given object is a HTMLElement, false otherwise. | [
"Checks",
"whether",
"the",
"given",
"object",
"is",
"a",
"HTMLElement",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5080-L5088 |
10,020 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | getArrayDifferences | function getArrayDifferences(a1, a2) {
var a = [ ];
var diff = [ ];
var i;
var k;
for (i = 0; i < a1.length; i++)
a[a1[i]] = true;
for (i = 0; i < a2.length; i++) {
... | javascript | function getArrayDifferences(a1, a2) {
var a = [ ];
var diff = [ ];
var i;
var k;
for (i = 0; i < a1.length; i++)
a[a1[i]] = true;
for (i = 0; i < a2.length; i++) {
... | [
"function",
"getArrayDifferences",
"(",
"a1",
",",
"a2",
")",
"{",
"var",
"a",
"=",
"[",
"]",
";",
"var",
"diff",
"=",
"[",
"]",
";",
"var",
"i",
";",
"var",
"k",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"a1",
".",
"length",
";",
"i",... | Compares 2 arrays and returns the differences between them as a array.
@param a1 The first array which shall be compared.
@param a2 The second array which shall be compared.
@returns {Array} The differences between the two arrays. | [
"Compares",
"2",
"arrays",
"and",
"returns",
"the",
"differences",
"between",
"them",
"as",
"a",
"array",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5096-L5112 |
10,021 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | parseToZeroOrNumber | function parseToZeroOrNumber(value, toFloat) {
var num = toFloat ? parseFloat(value) : parseInt(value, 10);
return isNaN(num) ? 0 : num;
} | javascript | function parseToZeroOrNumber(value, toFloat) {
var num = toFloat ? parseFloat(value) : parseInt(value, 10);
return isNaN(num) ? 0 : num;
} | [
"function",
"parseToZeroOrNumber",
"(",
"value",
",",
"toFloat",
")",
"{",
"var",
"num",
"=",
"toFloat",
"?",
"parseFloat",
"(",
"value",
")",
":",
"parseInt",
"(",
"value",
",",
"10",
")",
";",
"return",
"isNaN",
"(",
"num",
")",
"?",
"0",
":",
"num... | Returns Zero or the number to which the value can be parsed.
@param value The value which shall be parsed.
@param toFloat Indicates whether the number shall be parsed to a float. | [
"Returns",
"Zero",
"or",
"the",
"number",
"to",
"which",
"the",
"value",
"can",
"be",
"parsed",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5119-L5122 |
10,022 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | getTextareaInfo | function getTextareaInfo() {
//read needed values
var textareaCursorPosition = _targetElementNative.selectionStart;
if (textareaCursorPosition === undefined)
return;
var strLength = 'length';
var... | javascript | function getTextareaInfo() {
//read needed values
var textareaCursorPosition = _targetElementNative.selectionStart;
if (textareaCursorPosition === undefined)
return;
var strLength = 'length';
var... | [
"function",
"getTextareaInfo",
"(",
")",
"{",
"//read needed values",
"var",
"textareaCursorPosition",
"=",
"_targetElementNative",
".",
"selectionStart",
";",
"if",
"(",
"textareaCursorPosition",
"===",
"undefined",
")",
"return",
";",
"var",
"strLength",
"=",
"'leng... | Gets several information of the textarea and returns them as a object or undefined if the browser doesn't support it.
@returns {{cursorRow: Number, cursorCol, rows: Number, cols: number, wRow: number, pos: number, max : number}} or undefined if not supported. | [
"Gets",
"several",
"information",
"of",
"the",
"textarea",
"and",
"returns",
"them",
"as",
"a",
"object",
"or",
"undefined",
"if",
"the",
"browser",
"doesn",
"t",
"support",
"it",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5128-L5165 |
10,023 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | generateDiv | function generateDiv(classesOrAttrs, content) {
return '<div ' + (classesOrAttrs ? type(classesOrAttrs) == TYPES.s ?
'class="' + classesOrAttrs + '"' :
(function() {
var key;
var attrs... | javascript | function generateDiv(classesOrAttrs, content) {
return '<div ' + (classesOrAttrs ? type(classesOrAttrs) == TYPES.s ?
'class="' + classesOrAttrs + '"' :
(function() {
var key;
var attrs... | [
"function",
"generateDiv",
"(",
"classesOrAttrs",
",",
"content",
")",
"{",
"return",
"'<div '",
"+",
"(",
"classesOrAttrs",
"?",
"type",
"(",
"classesOrAttrs",
")",
"==",
"TYPES",
".",
"s",
"?",
"'class=\"'",
"+",
"classesOrAttrs",
"+",
"'\"'",
":",
"(",
... | Generates a string which represents a HTML div with the given classes or attributes.
@param classesOrAttrs The class of the div as string or a object which represents the attributes of the div. (The class attribute can also be written as "className".)
@param content The content of the div as string.
@returns {string} T... | [
"Generates",
"a",
"string",
"which",
"represents",
"a",
"HTML",
"div",
"with",
"the",
"given",
"classes",
"or",
"attributes",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5189-L5205 |
10,024 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | getObjectPropVal | function getObjectPropVal(obj, path) {
var splits = path.split(_strDot);
var i = 0;
var val;
for(; i < splits.length; i++) {
if(!obj.hasOwnProperty(splits[i]))
return;
... | javascript | function getObjectPropVal(obj, path) {
var splits = path.split(_strDot);
var i = 0;
var val;
for(; i < splits.length; i++) {
if(!obj.hasOwnProperty(splits[i]))
return;
... | [
"function",
"getObjectPropVal",
"(",
"obj",
",",
"path",
")",
"{",
"var",
"splits",
"=",
"path",
".",
"split",
"(",
"_strDot",
")",
";",
"var",
"i",
"=",
"0",
";",
"var",
"val",
";",
"for",
"(",
";",
"i",
"<",
"splits",
".",
"length",
";",
"i",
... | Gets the value of the given property from the given object.
@param obj The object from which the property value shall be got.
@param path The property of which the value shall be got.
@returns {*} Returns the value of the searched property or undefined of the property wasn't found. | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"property",
"from",
"the",
"given",
"object",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5213-L5225 |
10,025 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | setObjectPropVal | function setObjectPropVal(obj, path, val) {
var splits = path.split(_strDot);
var splitsLength = splits.length;
var i = 0;
var extendObj = { };
var extendObjRoot = extendObj;
for(; i < splitsLength; i... | javascript | function setObjectPropVal(obj, path, val) {
var splits = path.split(_strDot);
var splitsLength = splits.length;
var i = 0;
var extendObj = { };
var extendObjRoot = extendObj;
for(; i < splitsLength; i... | [
"function",
"setObjectPropVal",
"(",
"obj",
",",
"path",
",",
"val",
")",
"{",
"var",
"splits",
"=",
"path",
".",
"split",
"(",
"_strDot",
")",
";",
"var",
"splitsLength",
"=",
"splits",
".",
"length",
";",
"var",
"i",
"=",
"0",
";",
"var",
"extendOb... | Sets the value of the given property from the given object.
@param obj The object from which the property value shall be set.
@param path The property of which the value shall be set.
@param val The value of the property which shall be set. | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"property",
"from",
"the",
"given",
"object",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5233-L5242 |
10,026 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | checkCacheDouble | function checkCacheDouble(current, cache, prop1, prop2, force) {
if (force === true)
return force;
if (prop2 === undefined && force === undefined) {
if (prop1 === true)
return prop1;
... | javascript | function checkCacheDouble(current, cache, prop1, prop2, force) {
if (force === true)
return force;
if (prop2 === undefined && force === undefined) {
if (prop1 === true)
return prop1;
... | [
"function",
"checkCacheDouble",
"(",
"current",
",",
"cache",
",",
"prop1",
",",
"prop2",
",",
"force",
")",
"{",
"if",
"(",
"force",
"===",
"true",
")",
"return",
"force",
";",
"if",
"(",
"prop2",
"===",
"undefined",
"&&",
"force",
"===",
"undefined",
... | Compares two objects with two properties and returns the result of the comparison as a boolean.
@param current The first object which shall be compared.
@param cache The second object which shall be compared.
@param prop1 The name of the first property of the objects which shall be compared.
@param prop2 The name of th... | [
"Compares",
"two",
"objects",
"with",
"two",
"properties",
"and",
"returns",
"the",
"result",
"of",
"the",
"comparison",
"as",
"a",
"boolean",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5273-L5289 |
10,027 | KingSora/OverlayScrollbars | js/OverlayScrollbars.js | checkCacheTRBL | function checkCacheTRBL(current, cache) {
if (cache === undefined)
return true;
else if (current.t !== cache.t ||
current.r !== cache.r ||
current.b !== cache.b ||
current.l !== cache.... | javascript | function checkCacheTRBL(current, cache) {
if (cache === undefined)
return true;
else if (current.t !== cache.t ||
current.r !== cache.r ||
current.b !== cache.b ||
current.l !== cache.... | [
"function",
"checkCacheTRBL",
"(",
"current",
",",
"cache",
")",
"{",
"if",
"(",
"cache",
"===",
"undefined",
")",
"return",
"true",
";",
"else",
"if",
"(",
"current",
".",
"t",
"!==",
"cache",
".",
"t",
"||",
"current",
".",
"r",
"!==",
"cache",
"."... | Compares two objects which have four properties and returns the result of the comparison as a boolean.
@param current The first object with four properties.
@param cache The second object with four properties.
@returns {boolean} True if both objects aren't equal or some of them is undefined, false otherwise. | [
"Compares",
"two",
"objects",
"which",
"have",
"four",
"properties",
"and",
"returns",
"the",
"result",
"of",
"the",
"comparison",
"as",
"a",
"boolean",
"."
] | 8e658d46e2d034a2525269d7c873bbe844762307 | https://github.com/KingSora/OverlayScrollbars/blob/8e658d46e2d034a2525269d7c873bbe844762307/js/OverlayScrollbars.js#L5297-L5306 |
10,028 | ipfs/aegir | src/release/prerelease.js | validGh | function validGh (opts) {
if (!opts.ghrelease) {
return Promise.resolve(true)
}
if (!opts.ghtoken) {
return Promise.reject(new Error('Missing GitHub access token. ' +
'Have you set `AEGIR_GHTOKEN`?'))
}
return Promise.resolve()
} | javascript | function validGh (opts) {
if (!opts.ghrelease) {
return Promise.resolve(true)
}
if (!opts.ghtoken) {
return Promise.reject(new Error('Missing GitHub access token. ' +
'Have you set `AEGIR_GHTOKEN`?'))
}
return Promise.resolve()
} | [
"function",
"validGh",
"(",
"opts",
")",
"{",
"if",
"(",
"!",
"opts",
".",
"ghrelease",
")",
"{",
"return",
"Promise",
".",
"resolve",
"(",
"true",
")",
"}",
"if",
"(",
"!",
"opts",
".",
"ghtoken",
")",
"{",
"return",
"Promise",
".",
"reject",
"(",... | Check if there are valid GitHub credentials for publishing this module | [
"Check",
"if",
"there",
"are",
"valid",
"GitHub",
"credentials",
"for",
"publishing",
"this",
"module"
] | 1cb8cf217bc03524f7f2caaa248b1b99d700d402 | https://github.com/ipfs/aegir/blob/1cb8cf217bc03524f7f2caaa248b1b99d700d402/src/release/prerelease.js#L7-L17 |
10,029 | ipfs/aegir | src/release/prerelease.js | isDirty | function isDirty () {
return pify(git.raw.bind(git))(['status', '-s'])
.then((out) => {
if (out && out.trim().length > 0) {
throw new Error('Dirty git repo, aborting')
}
})
} | javascript | function isDirty () {
return pify(git.raw.bind(git))(['status', '-s'])
.then((out) => {
if (out && out.trim().length > 0) {
throw new Error('Dirty git repo, aborting')
}
})
} | [
"function",
"isDirty",
"(",
")",
"{",
"return",
"pify",
"(",
"git",
".",
"raw",
".",
"bind",
"(",
"git",
")",
")",
"(",
"[",
"'status'",
",",
"'-s'",
"]",
")",
".",
"then",
"(",
"(",
"out",
")",
"=>",
"{",
"if",
"(",
"out",
"&&",
"out",
".",
... | Is the current git workspace dirty? | [
"Is",
"the",
"current",
"git",
"workspace",
"dirty?"
] | 1cb8cf217bc03524f7f2caaa248b1b99d700d402 | https://github.com/ipfs/aegir/blob/1cb8cf217bc03524f7f2caaa248b1b99d700d402/src/release/prerelease.js#L20-L27 |
10,030 | snowflakedb/snowflake-connector-nodejs | lib/agent/socket_util.js | isOcspValidationDisabled | function isOcspValidationDisabled(host)
{
// ocsp is disabled if insecure-connect is enabled, or if we've disabled ocsp
// for non-snowflake endpoints and the host is a non-snowflake endpoint
return GlobalConfig.isInsecureConnect() || (Parameters.getValue(
Parameters.names.JS_DRIVER_DISABLE_OCSP_FOR_NON... | javascript | function isOcspValidationDisabled(host)
{
// ocsp is disabled if insecure-connect is enabled, or if we've disabled ocsp
// for non-snowflake endpoints and the host is a non-snowflake endpoint
return GlobalConfig.isInsecureConnect() || (Parameters.getValue(
Parameters.names.JS_DRIVER_DISABLE_OCSP_FOR_NON... | [
"function",
"isOcspValidationDisabled",
"(",
"host",
")",
"{",
"// ocsp is disabled if insecure-connect is enabled, or if we've disabled ocsp",
"// for non-snowflake endpoints and the host is a non-snowflake endpoint",
"return",
"GlobalConfig",
".",
"isInsecureConnect",
"(",
")",
"||",
... | Determines if ocsp validation is disabled for a given host.
@param {String} host
@returns {boolean} | [
"Determines",
"if",
"ocsp",
"validation",
"is",
"disabled",
"for",
"a",
"given",
"host",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/agent/socket_util.js#L82-L89 |
10,031 | snowflakedb/snowflake-connector-nodejs | lib/agent/socket_util.js | validateCertChain | function validateCertChain(cert, cb)
{
// walk up the certificate chain and collect all the certificates in an array
var certs = [];
while (cert && cert.issuerCertificate &&
(cert.fingerprint !== cert.issuerCertificate.fingerprint))
{
certs.push(cert);
cert = cert.issuerCertificate;
}
// create a... | javascript | function validateCertChain(cert, cb)
{
// walk up the certificate chain and collect all the certificates in an array
var certs = [];
while (cert && cert.issuerCertificate &&
(cert.fingerprint !== cert.issuerCertificate.fingerprint))
{
certs.push(cert);
cert = cert.issuerCertificate;
}
// create a... | [
"function",
"validateCertChain",
"(",
"cert",
",",
"cb",
")",
"{",
"// walk up the certificate chain and collect all the certificates in an array",
"var",
"certs",
"=",
"[",
"]",
";",
"while",
"(",
"cert",
"&&",
"cert",
".",
"issuerCertificate",
"&&",
"(",
"cert",
"... | Validates a certificate chain using OCSP.
@param {Object} cert a top-level cert that represents the leaf of a
certificate chain.
@param {Function} cb the callback to invoke once the validation is complete. | [
"Validates",
"a",
"certificate",
"chain",
"using",
"OCSP",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/agent/socket_util.js#L118-L179 |
10,032 | snowflakedb/snowflake-connector-nodejs | lib/agent/socket_util.js | function(certs, index)
{
var cert = certs[index];
validateCert(cert, function(err, data)
{
completed++;
errors[index] = err;
// if we have an ocsp response, cache it
if (data)
{
getOcspResponseCache().set(cert, data);
}
// if this is the last request to ... | javascript | function(certs, index)
{
var cert = certs[index];
validateCert(cert, function(err, data)
{
completed++;
errors[index] = err;
// if we have an ocsp response, cache it
if (data)
{
getOcspResponseCache().set(cert, data);
}
// if this is the last request to ... | [
"function",
"(",
"certs",
",",
"index",
")",
"{",
"var",
"cert",
"=",
"certs",
"[",
"index",
"]",
";",
"validateCert",
"(",
"cert",
",",
"function",
"(",
"err",
",",
"data",
")",
"{",
"completed",
"++",
";",
"errors",
"[",
"index",
"]",
"=",
"err",... | Called for every certificate as we traverse the certificate chain and
validate each one.
@param certs
@param index | [
"Called",
"for",
"every",
"certificate",
"as",
"we",
"traverse",
"the",
"certificate",
"chain",
"and",
"validate",
"each",
"one",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/agent/socket_util.js#L140-L171 | |
10,033 | snowflakedb/snowflake-connector-nodejs | lib/agent/socket_util.js | validateCert | function validateCert(cert, cb)
{
// if we already have an entry in the cache, use it
var ocspResponse = getOcspResponseCache().get(cert);
if (ocspResponse)
{
process.nextTick(function()
{
Logger.getInstance().trace('Returning OCSP status for certificate %s ' +
'from cache', cert.serialN... | javascript | function validateCert(cert, cb)
{
// if we already have an entry in the cache, use it
var ocspResponse = getOcspResponseCache().get(cert);
if (ocspResponse)
{
process.nextTick(function()
{
Logger.getInstance().trace('Returning OCSP status for certificate %s ' +
'from cache', cert.serialN... | [
"function",
"validateCert",
"(",
"cert",
",",
"cb",
")",
"{",
"// if we already have an entry in the cache, use it",
"var",
"ocspResponse",
"=",
"getOcspResponseCache",
"(",
")",
".",
"get",
"(",
"cert",
")",
";",
"if",
"(",
"ocspResponse",
")",
"{",
"process",
... | Validates a certificate using OCSP.
@param cert the certificate to validate.
@param cb the callback to invoke once the validation is complete. | [
"Validates",
"a",
"certificate",
"using",
"OCSP",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/agent/socket_util.js#L187-L218 |
10,034 | snowflakedb/snowflake-connector-nodejs | lib/util.js | function (url, paramName, paramValue)
{
// if the specified url is valid
var urlAsObject = Url.parse(url);
if (urlAsObject)
{
// if the url already has query parameters, use '&' as the separator
// when appending the additional query parameter, otherwise use '?'
url +... | javascript | function (url, paramName, paramValue)
{
// if the specified url is valid
var urlAsObject = Url.parse(url);
if (urlAsObject)
{
// if the url already has query parameters, use '&' as the separator
// when appending the additional query parameter, otherwise use '?'
url +... | [
"function",
"(",
"url",
",",
"paramName",
",",
"paramValue",
")",
"{",
"// if the specified url is valid",
"var",
"urlAsObject",
"=",
"Url",
".",
"parse",
"(",
"url",
")",
";",
"if",
"(",
"urlAsObject",
")",
"{",
"// if the url already has query parameters, use '&' ... | Appends a query parameter to a url. If an invalid url is specified, an
exception is thrown.
@param {String} url
@param {String} paramName the name of the query parameter.
@param {String} paramValue the value of the query parameter.
@returns {String} | [
"Appends",
"a",
"query",
"parameter",
"to",
"a",
"url",
".",
"If",
"an",
"invalid",
"url",
"is",
"specified",
"an",
"exception",
"is",
"thrown",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/util.js#L319-L331 | |
10,035 | snowflakedb/snowflake-connector-nodejs | lib/logger/browser.js | Logger | function Logger(options)
{
/**
* The array to which all log messages will be added.
*
* @type {String[]}
*/
var buffer = [];
/**
* Logs a message at a given level.
*
* @param {String} levelTag the tag associated with the level at which to log
* the message.
* @param {String} message ... | javascript | function Logger(options)
{
/**
* The array to which all log messages will be added.
*
* @type {String[]}
*/
var buffer = [];
/**
* Logs a message at a given level.
*
* @param {String} levelTag the tag associated with the level at which to log
* the message.
* @param {String} message ... | [
"function",
"Logger",
"(",
"options",
")",
"{",
"/**\n * The array to which all log messages will be added.\n *\n * @type {String[]}\n */",
"var",
"buffer",
"=",
"[",
"]",
";",
"/**\n * Logs a message at a given level.\n *\n * @param {String} levelTag the tag associated with ... | Creates a new Logger instance for when we're running in the browser.
@param {Object} [options]
@constructor | [
"Creates",
"a",
"new",
"Logger",
"instance",
"for",
"when",
"we",
"re",
"running",
"in",
"the",
"browser",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/logger/browser.js#L15-L133 |
10,036 | snowflakedb/snowflake-connector-nodejs | lib/connection/connection_context.js | ConnectionContext | function ConnectionContext(connectionConfig, httpClient, config)
{
// validate input
Errors.assertInternal(Util.isObject(connectionConfig));
Errors.assertInternal(Util.isObject(httpClient));
// if a config object was specified, verify
// that it has all the information we need
var sfServiceConfig;
if (Ut... | javascript | function ConnectionContext(connectionConfig, httpClient, config)
{
// validate input
Errors.assertInternal(Util.isObject(connectionConfig));
Errors.assertInternal(Util.isObject(httpClient));
// if a config object was specified, verify
// that it has all the information we need
var sfServiceConfig;
if (Ut... | [
"function",
"ConnectionContext",
"(",
"connectionConfig",
",",
"httpClient",
",",
"config",
")",
"{",
"// validate input",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"connectionConfig",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
... | Creates a new ConnectionContext.
@param {ConnectionConfig} connectionConfig
@param {Object} httpClient
@param {Object} config
@constructor | [
"Creates",
"a",
"new",
"ConnectionContext",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/connection_context.js#L19-L80 |
10,037 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/sf_timestamp.js | SfTimestamp | function SfTimestamp(epochSeconds, nanoSeconds, scale, timezone, format)
{
// pick reasonable defaults for the inputs if needed
epochSeconds = Util.isNumber(epochSeconds) ? epochSeconds : 0;
nanoSeconds = Util.isNumber(nanoSeconds) ? nanoSeconds : 0;
scale = Util.isNumber(scale) ? scale : 0;
format = Util.isS... | javascript | function SfTimestamp(epochSeconds, nanoSeconds, scale, timezone, format)
{
// pick reasonable defaults for the inputs if needed
epochSeconds = Util.isNumber(epochSeconds) ? epochSeconds : 0;
nanoSeconds = Util.isNumber(nanoSeconds) ? nanoSeconds : 0;
scale = Util.isNumber(scale) ? scale : 0;
format = Util.isS... | [
"function",
"SfTimestamp",
"(",
"epochSeconds",
",",
"nanoSeconds",
",",
"scale",
",",
"timezone",
",",
"format",
")",
"{",
"// pick reasonable defaults for the inputs if needed",
"epochSeconds",
"=",
"Util",
".",
"isNumber",
"(",
"epochSeconds",
")",
"?",
"epochSecon... | Creates a new SfTimestamp instance.
@param {Number} epochSeconds the epoch time in seconds.
@param {Number} nanoSeconds the number of nano seconds (incremental, not
epoch).
@param {Number} scale the precision for the fractional part of the timestamp.
@param {String | Number} [timezone] the timezone name as a string
(e... | [
"Creates",
"a",
"new",
"SfTimestamp",
"instance",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/sf_timestamp.js#L49-L79 |
10,038 | snowflakedb/snowflake-connector-nodejs | lib/core.js | Core | function Core(options)
{
// validate input
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(
Util.exists(options.httpClient || options.httpClientClass));
Errors.assertInternal(Util.exists(options.loggerClass));
// set the logger instance
Logger.setInstance(new (options.loggerClass... | javascript | function Core(options)
{
// validate input
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(
Util.exists(options.httpClient || options.httpClientClass));
Errors.assertInternal(Util.exists(options.loggerClass));
// set the logger instance
Logger.setInstance(new (options.loggerClass... | [
"function",
"Core",
"(",
"options",
")",
"{",
"// validate input",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"options",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"exists",
"(",
"options",
".",
"httpClient",
... | Creates a new instance of the Snowflake core module.
@param {Object} options
@returns {Object}
@constructor | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"Snowflake",
"core",
"module",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/core.js#L24-L184 |
10,039 | snowflakedb/snowflake-connector-nodejs | lib/core.js | function(options, serializedConnection)
{
// check for missing serializedConfig
Errors.checkArgumentExists(Util.exists(serializedConnection),
ErrorCodes.ERR_CONN_DESERIALIZE_MISSING_CONFIG);
// check for invalid serializedConfig
Errors.checkArgumentValid(Util.isString(serializedCo... | javascript | function(options, serializedConnection)
{
// check for missing serializedConfig
Errors.checkArgumentExists(Util.exists(serializedConnection),
ErrorCodes.ERR_CONN_DESERIALIZE_MISSING_CONFIG);
// check for invalid serializedConfig
Errors.checkArgumentValid(Util.isString(serializedCo... | [
"function",
"(",
"options",
",",
"serializedConnection",
")",
"{",
"// check for missing serializedConfig",
"Errors",
".",
"checkArgumentExists",
"(",
"Util",
".",
"exists",
"(",
"serializedConnection",
")",
",",
"ErrorCodes",
".",
"ERR_CONN_DESERIALIZE_MISSING_CONFIG",
"... | Deserializes a serialized connection.
@param {Object} options
@param {String} serializedConnection
@returns {Object} | [
"Deserializes",
"a",
"serialized",
"connection",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/core.js#L101-L126 | |
10,040 | snowflakedb/snowflake-connector-nodejs | lib/core.js | function(options)
{
var logTag = options.logLevel;
if (Util.exists(logTag))
{
// check that the specified value is a valid tag
Errors.checkArgumentValid(LoggerCore.isValidLogTag(logTag),
ErrorCodes.ERR_GLOGAL_CONFIGURE_INVALID_LOG_LEVEL);
Logger.getInstance().c... | javascript | function(options)
{
var logTag = options.logLevel;
if (Util.exists(logTag))
{
// check that the specified value is a valid tag
Errors.checkArgumentValid(LoggerCore.isValidLogTag(logTag),
ErrorCodes.ERR_GLOGAL_CONFIGURE_INVALID_LOG_LEVEL);
Logger.getInstance().c... | [
"function",
"(",
"options",
")",
"{",
"var",
"logTag",
"=",
"options",
".",
"logLevel",
";",
"if",
"(",
"Util",
".",
"exists",
"(",
"logTag",
")",
")",
"{",
"// check that the specified value is a valid tag",
"Errors",
".",
"checkArgumentValid",
"(",
"LoggerCore... | Configures this instance of the Snowflake core module.
@param {Object} options | [
"Configures",
"this",
"instance",
"of",
"the",
"Snowflake",
"core",
"module",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/core.js#L145-L169 | |
10,041 | snowflakedb/snowflake-connector-nodejs | lib/logger/node.js | Logger | function Logger(options)
{
var common;
var winstonLogger;
/**
* Logs a message at a given level.
*
* @param {String} levelTag the tag associated with the level at which to log
* the message.
* @param {String} message the message to log.
* @param {Number} bufferMaxLength the maximum size to wh... | javascript | function Logger(options)
{
var common;
var winstonLogger;
/**
* Logs a message at a given level.
*
* @param {String} levelTag the tag associated with the level at which to log
* the message.
* @param {String} message the message to log.
* @param {Number} bufferMaxLength the maximum size to wh... | [
"function",
"Logger",
"(",
"options",
")",
"{",
"var",
"common",
";",
"var",
"winstonLogger",
";",
"/**\n * Logs a message at a given level.\n *\n * @param {String} levelTag the tag associated with the level at which to log\n * the message.\n * @param {String} message the message... | Creates a new Logger instance for when we're running in node.
@param {Object} [options]
@constructor | [
"Creates",
"a",
"new",
"Logger",
"instance",
"for",
"when",
"we",
"re",
"running",
"in",
"node",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/logger/node.js#L16-L134 |
10,042 | snowflakedb/snowflake-connector-nodejs | lib/connection/connection_config.js | createParameters | function createParameters()
{
var isNonNegativeInteger = Util.number.isNonNegativeInteger.bind(Util.number);
var isPositiveInteger = Util.number.isPositiveInteger.bind(Util.number);
var isNonNegativeNumber = Util.number.isNonNegative.bind(Util.number);
return [
{
name : PARAM_TIMEOUT,
... | javascript | function createParameters()
{
var isNonNegativeInteger = Util.number.isNonNegativeInteger.bind(Util.number);
var isPositiveInteger = Util.number.isPositiveInteger.bind(Util.number);
var isNonNegativeNumber = Util.number.isNonNegative.bind(Util.number);
return [
{
name : PARAM_TIMEOUT,
... | [
"function",
"createParameters",
"(",
")",
"{",
"var",
"isNonNegativeInteger",
"=",
"Util",
".",
"number",
".",
"isNonNegativeInteger",
".",
"bind",
"(",
"Util",
".",
"number",
")",
";",
"var",
"isPositiveInteger",
"=",
"Util",
".",
"number",
".",
"isPositiveIn... | Creates the list of known parameters. If a parameter is marked as external,
its value can be overridden by adding the appropriate name-value mapping to
the ConnectionConfig options.
@returns {Object[]} | [
"Creates",
"the",
"list",
"of",
"known",
"parameters",
".",
"If",
"a",
"parameter",
"is",
"marked",
"as",
"external",
"its",
"value",
"can",
"be",
"overridden",
"by",
"adding",
"the",
"appropriate",
"name",
"-",
"value",
"mapping",
"to",
"the",
"ConnectionCo... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/connection_config.js#L441-L514 |
10,043 | snowflakedb/snowflake-connector-nodejs | lib/logger/core.js | function(options)
{
var localIncludeTimestamp;
var localBufferMaxLength;
var localMessageMaxLength;
var localLevel;
// if an options argument is specified
if (Util.exists(options))
{
// make sure it's an object
Errors.assertInternal(Util.isObject(options));... | javascript | function(options)
{
var localIncludeTimestamp;
var localBufferMaxLength;
var localMessageMaxLength;
var localLevel;
// if an options argument is specified
if (Util.exists(options))
{
// make sure it's an object
Errors.assertInternal(Util.isObject(options));... | [
"function",
"(",
"options",
")",
"{",
"var",
"localIncludeTimestamp",
";",
"var",
"localBufferMaxLength",
";",
"var",
"localMessageMaxLength",
";",
"var",
"localLevel",
";",
"// if an options argument is specified",
"if",
"(",
"Util",
".",
"exists",
"(",
"options",
... | Configures this logger.
@param {Object} options | [
"Configures",
"this",
"logger",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/logger/core.js#L113-L184 | |
10,044 | snowflakedb/snowflake-connector-nodejs | lib/parameters.js | Parameter | function Parameter(options)
{
// validate input
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(Util.isString(options.name));
Errors.assertInternal(Util.exists(options.value));
var name = options.name;
var value = options.value;
/**
* Returns the name of the parameter.
*
* ... | javascript | function Parameter(options)
{
// validate input
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(Util.isString(options.name));
Errors.assertInternal(Util.exists(options.value));
var name = options.name;
var value = options.value;
/**
* Returns the name of the parameter.
*
* ... | [
"function",
"Parameter",
"(",
"options",
")",
"{",
"// validate input",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"options",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isString",
"(",
"options",
".",
"name",
... | Creates a new Parameter.
@param {Object} options
@constructor | [
"Creates",
"a",
"new",
"Parameter",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/parameters.js#L14-L53 |
10,045 | snowflakedb/snowflake-connector-nodejs | lib/errors.js | createError | function createError(name, options)
{
// TODO: validate that name is a string and options is an object
// TODO: this code is a bit of a mess and needs to be cleaned up
// create a new error
var error = new Error();
// set its name
error.name = name;
// set the error code
var code;
error.code = cod... | javascript | function createError(name, options)
{
// TODO: validate that name is a string and options is an object
// TODO: this code is a bit of a mess and needs to be cleaned up
// create a new error
var error = new Error();
// set its name
error.name = name;
// set the error code
var code;
error.code = cod... | [
"function",
"createError",
"(",
"name",
",",
"options",
")",
"{",
"// TODO: validate that name is a string and options is an object",
"// TODO: this code is a bit of a mess and needs to be cleaned up",
"// create a new error",
"var",
"error",
"=",
"new",
"Error",
"(",
")",
";",
... | Creates a generic error.
@param {String} name
@param {Object} options
@returns {Error} | [
"Creates",
"a",
"generic",
"error",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/errors.js#L469-L568 |
10,046 | snowflakedb/snowflake-connector-nodejs | lib/agent/ocsp_response_cache.js | OcspResponseCache | function OcspResponseCache(capacity, maxAge)
{
// validate input
Errors.assertInternal(Util.number.isPositiveInteger(capacity));
Errors.assertInternal(Util.number.isPositiveInteger(maxAge));
// create a cache to store the responses
var cache = new SimpleCache({ maxSize: capacity });
/**
* Adds an entry... | javascript | function OcspResponseCache(capacity, maxAge)
{
// validate input
Errors.assertInternal(Util.number.isPositiveInteger(capacity));
Errors.assertInternal(Util.number.isPositiveInteger(maxAge));
// create a cache to store the responses
var cache = new SimpleCache({ maxSize: capacity });
/**
* Adds an entry... | [
"function",
"OcspResponseCache",
"(",
"capacity",
",",
"maxAge",
")",
"{",
"// validate input",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"number",
".",
"isPositiveInteger",
"(",
"capacity",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"Util",
... | Client-side cache for storing OCSP responses.
@param {Number} capacity
@param {Number} maxAge
@constructor | [
"Client",
"-",
"side",
"cache",
"for",
"storing",
"OCSP",
"responses",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/agent/ocsp_response_cache.js#L18-L76 |
10,047 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result_stream.js | ResultStream | function ResultStream(options)
{
// options should be an object
Errors.assertInternal(Util.isObject(options));
var chunks = options.chunks;
var prefetchSize = options.prefetchSize;
// chunks should be an array
Errors.assertInternal(Util.isArray(chunks));
// prefetch size should be non-negative
... | javascript | function ResultStream(options)
{
// options should be an object
Errors.assertInternal(Util.isObject(options));
var chunks = options.chunks;
var prefetchSize = options.prefetchSize;
// chunks should be an array
Errors.assertInternal(Util.isArray(chunks));
// prefetch size should be non-negative
... | [
"function",
"ResultStream",
"(",
"options",
")",
"{",
"// options should be an object",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"options",
")",
")",
";",
"var",
"chunks",
"=",
"options",
".",
"chunks",
";",
"var",
"prefetchSize",
"=... | Creates a stream-like object that can be used to read the contents of an
array of chunks with the ability to prefetch chunks as we go. Every time the
contents of a new chunk become available, a 'data' event is fired. When there
are no more chunks to read, a 'close' event is fired to indicate that the
read operation is ... | [
"Creates",
"a",
"stream",
"-",
"like",
"object",
"that",
"can",
"be",
"used",
"to",
"read",
"the",
"contents",
"of",
"an",
"array",
"of",
"chunks",
"with",
"the",
"ability",
"to",
"prefetch",
"chunks",
"as",
"we",
"go",
".",
"Every",
"time",
"the",
"co... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result_stream.js#L24-L121 |
10,048 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result_stream.js | function(err, chunk)
{
// unsubscribe from the 'loadcomplete' event
chunk.removeListener('loadcomplete', onLoadComplete);
// if the chunk load succeeded
if (!err)
{
// move on to the next chunk
start++;
// emit an event to signal that new data is available
self.emit('data... | javascript | function(err, chunk)
{
// unsubscribe from the 'loadcomplete' event
chunk.removeListener('loadcomplete', onLoadComplete);
// if the chunk load succeeded
if (!err)
{
// move on to the next chunk
start++;
// emit an event to signal that new data is available
self.emit('data... | [
"function",
"(",
"err",
",",
"chunk",
")",
"{",
"// unsubscribe from the 'loadcomplete' event",
"chunk",
".",
"removeListener",
"(",
"'loadcomplete'",
",",
"onLoadComplete",
")",
";",
"// if the chunk load succeeded",
"if",
"(",
"!",
"err",
")",
"{",
"// move on to th... | Called when a chunk fires a 'loadcomplete' event.
@param {Error} err
@param {Chunk} chunk | [
"Called",
"when",
"a",
"chunk",
"fires",
"a",
"loadcomplete",
"event",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result_stream.js#L49-L70 | |
10,049 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result_stream.js | function()
{
// get the array of chunks whose contents need to be fetched
var buffer = chunks.slice(start, start + prefetchSize + 1);
// the first chunk in the buffer is the next chunk we want to load
var nextChunk = buffer[0];
// if we don't have anymore chunks to load, we're done
if (!next... | javascript | function()
{
// get the array of chunks whose contents need to be fetched
var buffer = chunks.slice(start, start + prefetchSize + 1);
// the first chunk in the buffer is the next chunk we want to load
var nextChunk = buffer[0];
// if we don't have anymore chunks to load, we're done
if (!next... | [
"function",
"(",
")",
"{",
"// get the array of chunks whose contents need to be fetched",
"var",
"buffer",
"=",
"chunks",
".",
"slice",
"(",
"start",
",",
"start",
"+",
"prefetchSize",
"+",
"1",
")",
";",
"// the first chunk in the buffer is the next chunk we want to load"... | Identifies the next chunk to load and issues requests to fetch both its
contents plus the contents of the next few chunks. If there are no more
chunks to load, a 'close' event is fired on the stream to notify
subscribers that all the chunks have been successfully read. | [
"Identifies",
"the",
"next",
"chunk",
"to",
"load",
"and",
"issues",
"requests",
"to",
"fetch",
"both",
"its",
"contents",
"plus",
"the",
"contents",
"of",
"the",
"next",
"few",
"chunks",
".",
"If",
"there",
"are",
"no",
"more",
"chunks",
"to",
"load",
"... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result_stream.js#L78-L108 | |
10,050 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | invokeStatementComplete | function invokeStatementComplete(statement, context)
{
// find out if the result will be streamed;
// if a value is not specified, get it from the connection
var streamResult = context.streamResult;
if (!Util.exists(streamResult))
{
streamResult = context.connectionConfig.getStreamResult();
}
// if t... | javascript | function invokeStatementComplete(statement, context)
{
// find out if the result will be streamed;
// if a value is not specified, get it from the connection
var streamResult = context.streamResult;
if (!Util.exists(streamResult))
{
streamResult = context.connectionConfig.getStreamResult();
}
// if t... | [
"function",
"invokeStatementComplete",
"(",
"statement",
",",
"context",
")",
"{",
"// find out if the result will be streamed;",
"// if a value is not specified, get it from the connection",
"var",
"streamResult",
"=",
"context",
".",
"streamResult",
";",
"if",
"(",
"!",
"Ut... | Invokes the statement complete callback.
@param {Object} statement
@param {Object} context | [
"Invokes",
"the",
"statement",
"complete",
"callback",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L543-L581 |
10,051 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | createOnStatementRequestSuccRow | function createOnStatementRequestSuccRow(statement, context)
{
return function(body)
{
// if we don't already have a result
if (!context.result)
{
// build a result from the response
context.result = new Result(
{
response : body,
statement : statement,
... | javascript | function createOnStatementRequestSuccRow(statement, context)
{
return function(body)
{
// if we don't already have a result
if (!context.result)
{
// build a result from the response
context.result = new Result(
{
response : body,
statement : statement,
... | [
"function",
"createOnStatementRequestSuccRow",
"(",
"statement",
",",
"context",
")",
"{",
"return",
"function",
"(",
"body",
")",
"{",
"// if we don't already have a result",
"if",
"(",
"!",
"context",
".",
"result",
")",
"{",
"// build a result from the response",
"... | Creates a function that can be used by row statements to process the response
when the request is successful.
@param statement
@param context
@returns {Function} | [
"Creates",
"a",
"function",
"that",
"can",
"be",
"used",
"by",
"row",
"statements",
"to",
"process",
"the",
"response",
"when",
"the",
"request",
"is",
"successful",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L643-L674 |
10,052 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | FileStatementPreExec | function FileStatementPreExec(
statementOptions, context, services, connectionConfig)
{
// call super
BaseStatement.apply(this, arguments);
// add the result request headers to the context
context.resultRequestHeaders = buildResultRequestHeadersFile();
/**
* Called when the statement request is succe... | javascript | function FileStatementPreExec(
statementOptions, context, services, connectionConfig)
{
// call super
BaseStatement.apply(this, arguments);
// add the result request headers to the context
context.resultRequestHeaders = buildResultRequestHeadersFile();
/**
* Called when the statement request is succe... | [
"function",
"FileStatementPreExec",
"(",
"statementOptions",
",",
"context",
",",
"services",
",",
"connectionConfig",
")",
"{",
"// call super",
"BaseStatement",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"// add the result request headers to the context",
... | Creates a new FileStatementPreExec instance.
@param {Object} statementOptions
@param {Object} context
@param {Object} services
@param {Object} connectionConfig
@constructor | [
"Creates",
"a",
"new",
"FileStatementPreExec",
"instance",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L685-L716 |
10,053 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | RowStatementPostExec | function RowStatementPostExec(
statementOptions, context, services, connectionConfig)
{
// call super
BaseStatement.apply(this, arguments);
// add the result request headers to the context
context.resultRequestHeaders = buildResultRequestHeadersRow();
/**
* Called when the statement request is succes... | javascript | function RowStatementPostExec(
statementOptions, context, services, connectionConfig)
{
// call super
BaseStatement.apply(this, arguments);
// add the result request headers to the context
context.resultRequestHeaders = buildResultRequestHeadersRow();
/**
* Called when the statement request is succes... | [
"function",
"RowStatementPostExec",
"(",
"statementOptions",
",",
"context",
",",
"services",
",",
"connectionConfig",
")",
"{",
"// call super",
"BaseStatement",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"// add the result request headers to the context",
... | Creates a new RowStatementPostExec instance.
@param {Object} statementOptions
@param {Object} context
@param {Object} services
@param {Object} connectionConfig
@constructor | [
"Creates",
"a",
"new",
"RowStatementPostExec",
"instance",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L729-L768 |
10,054 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | createFnStreamRows | function createFnStreamRows(statement, context)
{
return function(options)
{
// if some options are specified
if (Util.exists(options))
{
// check for invalid options
Errors.checkArgumentValid(Util.isObject(options),
ErrorCodes.ERR_STMT_FETCH_ROWS_INVALID_OPTIONS);
// check ... | javascript | function createFnStreamRows(statement, context)
{
return function(options)
{
// if some options are specified
if (Util.exists(options))
{
// check for invalid options
Errors.checkArgumentValid(Util.isObject(options),
ErrorCodes.ERR_STMT_FETCH_ROWS_INVALID_OPTIONS);
// check ... | [
"function",
"createFnStreamRows",
"(",
"statement",
",",
"context",
")",
"{",
"return",
"function",
"(",
"options",
")",
"{",
"// if some options are specified",
"if",
"(",
"Util",
".",
"exists",
"(",
"options",
")",
")",
"{",
"// check for invalid options",
"Erro... | Creates a function that streams the rows in a statement's result. If start
and end values are specified, only rows in the specified range are streamed.
@param statement
@param context | [
"Creates",
"a",
"function",
"that",
"streams",
"the",
"rows",
"in",
"a",
"statement",
"s",
"result",
".",
"If",
"start",
"and",
"end",
"values",
"are",
"specified",
"only",
"rows",
"in",
"the",
"specified",
"range",
"are",
"streamed",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L865-L908 |
10,055 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | fetchRowsFromResult | function fetchRowsFromResult(options, statement, context)
{
var numInterrupts = 0;
// forward to the result to get a FetchRowsOperation object
var operation = context.result.fetchRows(options);
// subscribe to the operation's 'complete' event
operation.on('complete', function(err, continueCallback)
{
... | javascript | function fetchRowsFromResult(options, statement, context)
{
var numInterrupts = 0;
// forward to the result to get a FetchRowsOperation object
var operation = context.result.fetchRows(options);
// subscribe to the operation's 'complete' event
operation.on('complete', function(err, continueCallback)
{
... | [
"function",
"fetchRowsFromResult",
"(",
"options",
",",
"statement",
",",
"context",
")",
"{",
"var",
"numInterrupts",
"=",
"0",
";",
"// forward to the result to get a FetchRowsOperation object",
"var",
"operation",
"=",
"context",
".",
"result",
".",
"fetchRows",
"(... | Fetches rows from the statement's result.
@param {Object} options the options passed to fetchRows().
@param {Object} statement
@param {Object} context | [
"Fetches",
"rows",
"from",
"the",
"statement",
"s",
"result",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L929-L967 |
10,056 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | sendCancelStatement | function sendCancelStatement(statementContext, statement, callback)
{
var url;
var json;
// use different rest endpoints based on whether the statement id is available
if (statementContext.statementId)
{
url = '/queries/' + statementContext.statementId + '/abort-request';
}
else
{
url = '/quer... | javascript | function sendCancelStatement(statementContext, statement, callback)
{
var url;
var json;
// use different rest endpoints based on whether the statement id is available
if (statementContext.statementId)
{
url = '/queries/' + statementContext.statementId + '/abort-request';
}
else
{
url = '/quer... | [
"function",
"sendCancelStatement",
"(",
"statementContext",
",",
"statement",
",",
"callback",
")",
"{",
"var",
"url",
";",
"var",
"json",
";",
"// use different rest endpoints based on whether the statement id is available",
"if",
"(",
"statementContext",
".",
"statementId... | Issues a request to cancel a statement.
@param {Object} statementContext
@param {Object} statement
@param {Function} callback | [
"Issues",
"a",
"request",
"to",
"cancel",
"a",
"statement",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L976-L1010 |
10,057 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | sendRequestPreExec | function sendRequestPreExec(statementContext, onResultAvailable)
{
// get the request headers
var headers = statementContext.resultRequestHeaders;
// build the basic json for the request
var json =
{
disableOfflineChunks : false,
sqlText : statementContext.sqlText
};
// if binds are... | javascript | function sendRequestPreExec(statementContext, onResultAvailable)
{
// get the request headers
var headers = statementContext.resultRequestHeaders;
// build the basic json for the request
var json =
{
disableOfflineChunks : false,
sqlText : statementContext.sqlText
};
// if binds are... | [
"function",
"sendRequestPreExec",
"(",
"statementContext",
",",
"onResultAvailable",
")",
"{",
"// get the request headers",
"var",
"headers",
"=",
"statementContext",
".",
"resultRequestHeaders",
";",
"// build the basic json for the request",
"var",
"json",
"=",
"{",
"dis... | Issues a request to get the result of a statement that hasn't been previously
executed.
@param statementContext
@param onResultAvailable | [
"Issues",
"a",
"request",
"to",
"get",
"the",
"result",
"of",
"a",
"statement",
"that",
"hasn",
"t",
"been",
"previously",
"executed",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L1019-L1067 |
10,058 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | buildBindsMap | function buildBindsMap(bindsArray)
{
var bindsMap = {};
var isArrayBinding = bindsArray.length >0 && Util.isArray(bindsArray[0]);
var singleArray = isArrayBinding ? bindsArray[0] : bindsArray;
for (var index = 0, length = singleArray.length; index < length; index++)
{
var value = singleArray[index];
... | javascript | function buildBindsMap(bindsArray)
{
var bindsMap = {};
var isArrayBinding = bindsArray.length >0 && Util.isArray(bindsArray[0]);
var singleArray = isArrayBinding ? bindsArray[0] : bindsArray;
for (var index = 0, length = singleArray.length; index < length; index++)
{
var value = singleArray[index];
... | [
"function",
"buildBindsMap",
"(",
"bindsArray",
")",
"{",
"var",
"bindsMap",
"=",
"{",
"}",
";",
"var",
"isArrayBinding",
"=",
"bindsArray",
".",
"length",
">",
"0",
"&&",
"Util",
".",
"isArray",
"(",
"bindsArray",
"[",
"0",
"]",
")",
";",
"var",
"sing... | Converts a bind variables array to a map that can be included in the
POST-body when issuing a pre-exec statement request.
@param bindsArray
@returns {Object} | [
"Converts",
"a",
"bind",
"variables",
"array",
"to",
"a",
"map",
"that",
"can",
"be",
"included",
"in",
"the",
"POST",
"-",
"body",
"when",
"issuing",
"a",
"pre",
"-",
"exec",
"statement",
"request",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L1077-L1143 |
10,059 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | sendRequestPostExec | function sendRequestPostExec(statementContext, onResultAvailable)
{
// get the request headers
var headers = statementContext.resultRequestHeaders;
// use the snowflake service to issue the request
sendSfRequest(statementContext,
{
method : 'GET',
headers: headers,
url : Url.format(
{
... | javascript | function sendRequestPostExec(statementContext, onResultAvailable)
{
// get the request headers
var headers = statementContext.resultRequestHeaders;
// use the snowflake service to issue the request
sendSfRequest(statementContext,
{
method : 'GET',
headers: headers,
url : Url.format(
{
... | [
"function",
"sendRequestPostExec",
"(",
"statementContext",
",",
"onResultAvailable",
")",
"{",
"// get the request headers",
"var",
"headers",
"=",
"statementContext",
".",
"resultRequestHeaders",
";",
"// use the snowflake service to issue the request",
"sendSfRequest",
"(",
... | Issues a request to get the result of a statement that has been previously
executed.
@param statementContext
@param onResultAvailable | [
"Issues",
"a",
"request",
"to",
"get",
"the",
"result",
"of",
"a",
"statement",
"that",
"has",
"been",
"previously",
"executed",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L1152-L1173 |
10,060 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | sendSfRequest | function sendSfRequest(statementContext, options, appendQueryParamOnRetry)
{
var sf = statementContext.services.sf;
var connectionConfig = statementContext.connectionConfig;
// clone the options
options = Util.apply({}, options);
// get the original url and callback
var urlOrig = options.url;
var callba... | javascript | function sendSfRequest(statementContext, options, appendQueryParamOnRetry)
{
var sf = statementContext.services.sf;
var connectionConfig = statementContext.connectionConfig;
// clone the options
options = Util.apply({}, options);
// get the original url and callback
var urlOrig = options.url;
var callba... | [
"function",
"sendSfRequest",
"(",
"statementContext",
",",
"options",
",",
"appendQueryParamOnRetry",
")",
"{",
"var",
"sf",
"=",
"statementContext",
".",
"services",
".",
"sf",
";",
"var",
"connectionConfig",
"=",
"statementContext",
".",
"connectionConfig",
";",
... | Issues a statement-related request using the Snowflake service.
@param {Object} statementContext the statement context.
@param {Object} options the request options.
@param {Boolean} [appendQueryParamOnRetry] whether retry=true should be
appended to the url if the request is retried. | [
"Issues",
"a",
"statement",
"-",
"related",
"request",
"using",
"the",
"Snowflake",
"service",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L1183-L1246 |
10,061 | snowflakedb/snowflake-connector-nodejs | lib/connection/statement.js | buildResultRequestCallback | function buildResultRequestCallback(
statementContext, headers, onResultAvailable)
{
var callback = function(err, body)
{
// if the result is not ready yet, extract the result url from the response
// and issue a GET request to try to fetch the result again
if (!err && body && (body.code === '333333... | javascript | function buildResultRequestCallback(
statementContext, headers, onResultAvailable)
{
var callback = function(err, body)
{
// if the result is not ready yet, extract the result url from the response
// and issue a GET request to try to fetch the result again
if (!err && body && (body.code === '333333... | [
"function",
"buildResultRequestCallback",
"(",
"statementContext",
",",
"headers",
",",
"onResultAvailable",
")",
"{",
"var",
"callback",
"=",
"function",
"(",
"err",
",",
"body",
")",
"{",
"// if the result is not ready yet, extract the result url from the response",
"// a... | Builds a callback for use in an exec-statement or fetch-result request.
@param statementContext
@param headers
@param onResultAvailable
@returns {Function} | [
"Builds",
"a",
"callback",
"for",
"use",
"in",
"an",
"exec",
"-",
"statement",
"or",
"fetch",
"-",
"result",
"request",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/statement.js#L1257-L1286 |
10,062 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | Chunk | function Chunk(options)
{
// make sure the options object contains all the necessary information
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(Util.isObject(options.statement));
Errors.assertInternal(Util.isObject(options.services));
Errors.assertInternal(Util.isNumber(options.startInde... | javascript | function Chunk(options)
{
// make sure the options object contains all the necessary information
Errors.assertInternal(Util.isObject(options));
Errors.assertInternal(Util.isObject(options.statement));
Errors.assertInternal(Util.isObject(options.services));
Errors.assertInternal(Util.isNumber(options.startInde... | [
"function",
"Chunk",
"(",
"options",
")",
"{",
"// make sure the options object contains all the necessary information",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"options",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
... | Creates a new Chunk.
@param options
@constructor | [
"Creates",
"a",
"new",
"Chunk",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L15-L48 |
10,063 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | function(err)
{
// we're done loading
self._isLoading = false;
// emit an event to notify subscribers
self.emit('loadcomplete', err, self);
// invoke the callback if one was specified
if (Util.isFunction(callback))
{
callback(err, self);
}
} | javascript | function(err)
{
// we're done loading
self._isLoading = false;
// emit an event to notify subscribers
self.emit('loadcomplete', err, self);
// invoke the callback if one was specified
if (Util.isFunction(callback))
{
callback(err, self);
}
} | [
"function",
"(",
"err",
")",
"{",
"// we're done loading",
"self",
".",
"_isLoading",
"=",
"false",
";",
"// emit an event to notify subscribers",
"self",
".",
"emit",
"(",
"'loadcomplete'",
",",
"err",
",",
"self",
")",
";",
"// invoke the callback if one was specifi... | Completes the chunk load.
@param err | [
"Completes",
"the",
"chunk",
"load",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L229-L242 | |
10,064 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | convertRowsetToRows | function convertRowsetToRows(
statement,
startIndex,
rowset,
columns,
mapColumnNameToIndices)
{
// assert that rowset and columns are arrays
Errors.assertInternal(Util.isArray(rowset));
Errors.assertInternal(Util.isArray(columns));
//////////////////////////////////////////////////////////... | javascript | function convertRowsetToRows(
statement,
startIndex,
rowset,
columns,
mapColumnNameToIndices)
{
// assert that rowset and columns are arrays
Errors.assertInternal(Util.isArray(rowset));
Errors.assertInternal(Util.isArray(columns));
//////////////////////////////////////////////////////////... | [
"function",
"convertRowsetToRows",
"(",
"statement",
",",
"startIndex",
",",
"rowset",
",",
"columns",
",",
"mapColumnNameToIndices",
")",
"{",
"// assert that rowset and columns are arrays",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isArray",
"(",
"rowset",
... | Converts a rowset to an array of records.
@param statement
@param startIndex the chunk start index.
@param rowset
@param columns
@param mapColumnNameToIndices
@returns {Array}
@private | [
"Converts",
"a",
"rowset",
"to",
"an",
"array",
"of",
"records",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L298-L393 |
10,065 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | getColumnValue | function getColumnValue(columnIdentifier)
{
// resolve the column identifier to the correct column if possible
var column = resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices);
return column ? column.getRowValue(this) : undefined;
} | javascript | function getColumnValue(columnIdentifier)
{
// resolve the column identifier to the correct column if possible
var column = resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices);
return column ? column.getRowValue(this) : undefined;
} | [
"function",
"getColumnValue",
"(",
"columnIdentifier",
")",
"{",
"// resolve the column identifier to the correct column if possible",
"var",
"column",
"=",
"resolveColumnIdentifierToColumn",
"(",
"columns",
",",
"columnIdentifier",
",",
"mapColumnNameToIndices",
")",
";",
"ret... | Returns the value of a column.
@param {String | Number} columnIdentifier this can be either the column
name or the column index.
@returns {*} | [
"Returns",
"the",
"value",
"of",
"a",
"column",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L342-L349 |
10,066 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | getColumnValueAsString | function getColumnValueAsString(columnIdentifier)
{
// resolve the column identifier to the correct column if possible
var column = resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices);
return column ? column.getRowValueAsString(this) : undefined;
} | javascript | function getColumnValueAsString(columnIdentifier)
{
// resolve the column identifier to the correct column if possible
var column = resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices);
return column ? column.getRowValueAsString(this) : undefined;
} | [
"function",
"getColumnValueAsString",
"(",
"columnIdentifier",
")",
"{",
"// resolve the column identifier to the correct column if possible",
"var",
"column",
"=",
"resolveColumnIdentifierToColumn",
"(",
"columns",
",",
"columnIdentifier",
",",
"mapColumnNameToIndices",
")",
";"... | Returns the value of a column as a String.
@param {String | Number} columnIdentifier this can be either the column
name or the column index.
@returns {*} | [
"Returns",
"the",
"value",
"of",
"a",
"column",
"as",
"a",
"String",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L359-L366 |
10,067 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/chunk.js | resolveColumnIdentifierToColumn | function resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices)
{
var columnIndex;
// if the column identifier is a string, treat it as a column
// name and use it to get the index of the specified column
if (Util.isString(columnIdentifier))
{
// if a valid column name wa... | javascript | function resolveColumnIdentifierToColumn(
columns, columnIdentifier, mapColumnNameToIndices)
{
var columnIndex;
// if the column identifier is a string, treat it as a column
// name and use it to get the index of the specified column
if (Util.isString(columnIdentifier))
{
// if a valid column name wa... | [
"function",
"resolveColumnIdentifierToColumn",
"(",
"columns",
",",
"columnIdentifier",
",",
"mapColumnNameToIndices",
")",
"{",
"var",
"columnIndex",
";",
"// if the column identifier is a string, treat it as a column",
"// name and use it to get the index of the specified column",
"i... | Resolves a column identifier to the corresponding column if possible. The
column identifier can be a column name or a column index. If an invalid
column identifier is specified, we return undefined.
@param {Object[]} columns
@param {String | Number} columnIdentifier
@param {Object} mapColumnNameToIndices
@returns {*} | [
"Resolves",
"a",
"column",
"identifier",
"to",
"the",
"corresponding",
"column",
"if",
"possible",
".",
"The",
"column",
"identifier",
"can",
"be",
"a",
"column",
"name",
"or",
"a",
"column",
"index",
".",
"If",
"an",
"invalid",
"column",
"identifier",
"is",... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/chunk.js#L406-L429 |
10,068 | snowflakedb/snowflake-connector-nodejs | lib/services/large_result_set.js | LargeResultSetService | function LargeResultSetService(connectionConfig, httpClient)
{
// validate input
Errors.assertInternal(Util.isObject(connectionConfig));
Errors.assertInternal(Util.isObject(httpClient));
function isRetryableError(response, err)
{
// https://aws.amazon.com/articles/1904 (Handling Errors)
// Note: 403'... | javascript | function LargeResultSetService(connectionConfig, httpClient)
{
// validate input
Errors.assertInternal(Util.isObject(connectionConfig));
Errors.assertInternal(Util.isObject(httpClient));
function isRetryableError(response, err)
{
// https://aws.amazon.com/articles/1904 (Handling Errors)
// Note: 403'... | [
"function",
"LargeResultSetService",
"(",
"connectionConfig",
",",
"httpClient",
")",
"{",
"// validate input",
"Errors",
".",
"assertInternal",
"(",
"Util",
".",
"isObject",
"(",
"connectionConfig",
")",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"Util",
"."... | Creates a new instance of an LargeResultSetService.
@param {Object} connectionConfig
@param {Object} httpClient
@constructor | [
"Creates",
"a",
"new",
"instance",
"of",
"an",
"LargeResultSetService",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/services/large_result_set.js#L17-L113 |
10,069 | snowflakedb/snowflake-connector-nodejs | lib/services/large_result_set.js | callback | function callback(err, response, body)
{
if (err)
{
// if we haven't exceeded the maximum number of retries yet and the
// server came back with a retryable error code.
if (numRetries < maxNumRetries && isRetryableError(response, err))
{
// increment the number ... | javascript | function callback(err, response, body)
{
if (err)
{
// if we haven't exceeded the maximum number of retries yet and the
// server came back with a retryable error code.
if (numRetries < maxNumRetries && isRetryableError(response, err))
{
// increment the number ... | [
"function",
"callback",
"(",
"err",
",",
"response",
",",
"body",
")",
"{",
"if",
"(",
"err",
")",
"{",
"// if we haven't exceeded the maximum number of retries yet and the",
"// server came back with a retryable error code.",
"if",
"(",
"numRetries",
"<",
"maxNumRetries",
... | invoked when the request completes | [
"invoked",
"when",
"the",
"request",
"completes"
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/services/large_result_set.js#L50-L95 |
10,070 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawDate | function convertRawDate(rawColumnValue, column, context)
{
return new SfTimestamp(
Number(rawColumnValue) * 86400, // convert to seconds
0, // no nano seconds
0, // no scale required
'UTC', // use utc as the tim... | javascript | function convertRawDate(rawColumnValue, column, context)
{
return new SfTimestamp(
Number(rawColumnValue) * 86400, // convert to seconds
0, // no nano seconds
0, // no scale required
'UTC', // use utc as the tim... | [
"function",
"convertRawDate",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"return",
"new",
"SfTimestamp",
"(",
"Number",
"(",
"rawColumnValue",
")",
"*",
"86400",
",",
"// convert to seconds",
"0",
",",
"// no nano seconds",
"0",
",",
"// no ... | Converts a raw column value of type Date to a Snowflake Date.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Date} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"Date",
"to",
"a",
"Snowflake",
"Date",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L294-L302 |
10,071 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawTime | function convertRawTime(rawColumnValue, column, context)
{
var columnScale = column.getScale();
// the values might be big so use BigNumber to do arithmetic
var valFracSecsBig =
new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));
return convertRawTimestampHelper(
valFracSecsBig,
... | javascript | function convertRawTime(rawColumnValue, column, context)
{
var columnScale = column.getScale();
// the values might be big so use BigNumber to do arithmetic
var valFracSecsBig =
new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));
return convertRawTimestampHelper(
valFracSecsBig,
... | [
"function",
"convertRawTime",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"var",
"columnScale",
"=",
"column",
".",
"getScale",
"(",
")",
";",
"// the values might be big so use BigNumber to do arithmetic",
"var",
"valFracSecsBig",
"=",
"new",
"Big... | Converts a raw column value of type Time to a Snowflake Time.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Object} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"Time",
"to",
"a",
"Snowflake",
"Time",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L313-L326 |
10,072 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawTimestampLtz | function convertRawTimestampLtz(rawColumnValue, column, context)
{
var columnScale = column.getScale();
// the values might be big so use BigNumber to do arithmetic
var valFracSecsBig =
new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));
// create a new snowflake date
return convertRawTime... | javascript | function convertRawTimestampLtz(rawColumnValue, column, context)
{
var columnScale = column.getScale();
// the values might be big so use BigNumber to do arithmetic
var valFracSecsBig =
new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));
// create a new snowflake date
return convertRawTime... | [
"function",
"convertRawTimestampLtz",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"var",
"columnScale",
"=",
"column",
".",
"getScale",
"(",
")",
";",
"// the values might be big so use BigNumber to do arithmetic",
"var",
"valFracSecsBig",
"=",
"new"... | Converts a raw column value of type TIMESTAMP_LTZ to a Snowflake Date.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Date} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"TIMESTAMP_LTZ",
"to",
"a",
"Snowflake",
"Date",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L337-L351 |
10,073 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawTimestampTz | function convertRawTimestampTz(rawColumnValue, column, context)
{
var valFracSecsBig;
var valFracSecsWithTzBig;
var timezoneBig;
var timezone;
var timestampAndTZIndex;
// compute the scale factor
var columnScale = column.getScale();
var scaleFactor = Math.pow(10, columnScale);
var resultVersion = co... | javascript | function convertRawTimestampTz(rawColumnValue, column, context)
{
var valFracSecsBig;
var valFracSecsWithTzBig;
var timezoneBig;
var timezone;
var timestampAndTZIndex;
// compute the scale factor
var columnScale = column.getScale();
var scaleFactor = Math.pow(10, columnScale);
var resultVersion = co... | [
"function",
"convertRawTimestampTz",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"var",
"valFracSecsBig",
";",
"var",
"valFracSecsWithTzBig",
";",
"var",
"timezoneBig",
";",
"var",
"timezone",
";",
"var",
"timestampAndTZIndex",
";",
"// compute t... | Converts a raw column value of type TIMESTAMP_TZ to a Snowflake Date.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Date} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"TIMESTAMP_TZ",
"to",
"a",
"Snowflake",
"Date",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L387-L451 |
10,074 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawVariant | function convertRawVariant(rawColumnValue, column, context)
{
var ret;
// if the input is a non-empty string, convert it to a json object
if (Util.string.isNotNullOrEmpty(rawColumnValue))
{
try
{
ret = eval("(" + rawColumnValue + ")");
}
catch (parseError)
{
// TODO: log the err... | javascript | function convertRawVariant(rawColumnValue, column, context)
{
var ret;
// if the input is a non-empty string, convert it to a json object
if (Util.string.isNotNullOrEmpty(rawColumnValue))
{
try
{
ret = eval("(" + rawColumnValue + ")");
}
catch (parseError)
{
// TODO: log the err... | [
"function",
"convertRawVariant",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"var",
"ret",
";",
"// if the input is a non-empty string, convert it to a json object",
"if",
"(",
"Util",
".",
"string",
".",
"isNotNullOrEmpty",
"(",
"rawColumnValue",
")... | Converts a raw column value of type Variant to a JavaScript value.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Object | Array} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"Variant",
"to",
"a",
"JavaScript",
"value",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L498-L519 |
10,075 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | convertRawBinary | function convertRawBinary(rawColumnValue, column, context)
{
// Ensure the format is valid.
var format = context.format.toUpperCase();
Errors.assertInternal(format === "HEX" || format === "BASE64");
// Decode hex string sent by GS.
var buffer = Buffer.from(rawColumnValue, "HEX");
if (format === "HEX")
{... | javascript | function convertRawBinary(rawColumnValue, column, context)
{
// Ensure the format is valid.
var format = context.format.toUpperCase();
Errors.assertInternal(format === "HEX" || format === "BASE64");
// Decode hex string sent by GS.
var buffer = Buffer.from(rawColumnValue, "HEX");
if (format === "HEX")
{... | [
"function",
"convertRawBinary",
"(",
"rawColumnValue",
",",
"column",
",",
"context",
")",
"{",
"// Ensure the format is valid.",
"var",
"format",
"=",
"context",
".",
"format",
".",
"toUpperCase",
"(",
")",
";",
"Errors",
".",
"assertInternal",
"(",
"format",
"... | Converts a raw column value of type Binary to a Buffer.
@param {String} rawColumnValue
@param {Object} column
@param {Object} context
@returns {Buffer} | [
"Converts",
"a",
"raw",
"column",
"value",
"of",
"type",
"Binary",
"to",
"a",
"Buffer",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L530-L563 |
10,076 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/column.js | extractFromRow | function extractFromRow(row, context, asString)
{
var map = row._arrayProcessedColumns;
var values = row.values;
// get the value
var columnIndex = this.getIndex();
var ret = values[columnIndex];
// if we want the value as a string, and the column is of type variant, and we
// haven't already process... | javascript | function extractFromRow(row, context, asString)
{
var map = row._arrayProcessedColumns;
var values = row.values;
// get the value
var columnIndex = this.getIndex();
var ret = values[columnIndex];
// if we want the value as a string, and the column is of type variant, and we
// haven't already process... | [
"function",
"extractFromRow",
"(",
"row",
",",
"context",
",",
"asString",
")",
"{",
"var",
"map",
"=",
"row",
".",
"_arrayProcessedColumns",
";",
"var",
"values",
"=",
"row",
".",
"values",
";",
"// get the value",
"var",
"columnIndex",
"=",
"this",
".",
... | Extracts the value of a column from a given row.
@param {Object} row
@param {Object} context
@param {Boolean} asString
@returns {*} | [
"Extracts",
"the",
"value",
"of",
"a",
"column",
"from",
"a",
"given",
"row",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/column.js#L709-L742 |
10,077 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | Result | function Result(options)
{
var data;
var chunkHeaders;
var parametersMap;
var parametersArray;
var length;
var index;
var parameter;
var mapColumnNameToIndices;
var columns;
var column;
// assert that options is a valid object that contains a response, statement,
// services and connection conf... | javascript | function Result(options)
{
var data;
var chunkHeaders;
var parametersMap;
var parametersArray;
var length;
var index;
var parameter;
var mapColumnNameToIndices;
var columns;
var column;
// assert that options is a valid object that contains a response, statement,
// services and connection conf... | [
"function",
"Result",
"(",
"options",
")",
"{",
"var",
"data",
";",
"var",
"chunkHeaders",
";",
"var",
"parametersMap",
";",
"var",
"parametersArray",
";",
"var",
"length",
";",
"var",
"index",
";",
"var",
"parameter",
";",
"var",
"mapColumnNameToIndices",
"... | Creates a new Result.
@param {Object} options
@constructor | [
"Creates",
"a",
"new",
"Result",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L21-L128 |
10,078 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | createSessionState | function createSessionState(responseData)
{
var currentRole = responseData.finalRoleName;
var currentWarehouse = responseData.finalWarehouseName;
var currentDatabaseProvider = responseData.databaseProvider;
var currentDatabase = responseData.finalDatabaseName;
var currentSchema ... | javascript | function createSessionState(responseData)
{
var currentRole = responseData.finalRoleName;
var currentWarehouse = responseData.finalWarehouseName;
var currentDatabaseProvider = responseData.databaseProvider;
var currentDatabase = responseData.finalDatabaseName;
var currentSchema ... | [
"function",
"createSessionState",
"(",
"responseData",
")",
"{",
"var",
"currentRole",
"=",
"responseData",
".",
"finalRoleName",
";",
"var",
"currentWarehouse",
"=",
"responseData",
".",
"finalWarehouseName",
";",
"var",
"currentDatabaseProvider",
"=",
"responseData",
... | Creates a session state object from the values of the current role, current
warehouse, etc., returned in the result response.
@param responseData
@returns {Object} | [
"Creates",
"a",
"session",
"state",
"object",
"from",
"the",
"values",
"of",
"the",
"current",
"role",
"current",
"warehouse",
"etc",
".",
"returned",
"in",
"the",
"result",
"response",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L195-L225 |
10,079 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | createChunks | function createChunks(chunkCfgs,
rowset,
columns,
mapColumnNameToIndices,
chunkHeaders,
statementParameters,
resultVersion,
statement,
services)... | javascript | function createChunks(chunkCfgs,
rowset,
columns,
mapColumnNameToIndices,
chunkHeaders,
statementParameters,
resultVersion,
statement,
services)... | [
"function",
"createChunks",
"(",
"chunkCfgs",
",",
"rowset",
",",
"columns",
",",
"mapColumnNameToIndices",
",",
"chunkHeaders",
",",
"statementParameters",
",",
"resultVersion",
",",
"statement",
",",
"services",
")",
"{",
"var",
"chunks",
";",
"var",
"startIndex... | Creates an array of Chunk instances from the chunk-related information in the
result response.
@param chunkCfgs
@param rowset
@param columns
@param mapColumnNameToIndices
@param chunkHeaders
@param statementParameters
@param resultVersion
@param statement
@param services
@returns {Chunk} | [
"Creates",
"an",
"array",
"of",
"Chunk",
"instances",
"from",
"the",
"chunk",
"-",
"related",
"information",
"in",
"the",
"result",
"response",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L243-L299 |
10,080 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | function(chunk)
{
// get all the rows in the current chunk that overlap with the requested
// window
var chunkStart = chunk.getStartIndex();
var chunkEnd = chunk.getEndIndex();
var rows = chunk.getRows().slice(
Math.max(chunkStart, start) - chunkStart,
Math.min(chunkEnd, en... | javascript | function(chunk)
{
// get all the rows in the current chunk that overlap with the requested
// window
var chunkStart = chunk.getStartIndex();
var chunkEnd = chunk.getEndIndex();
var rows = chunk.getRows().slice(
Math.max(chunkStart, start) - chunkStart,
Math.min(chunkEnd, en... | [
"function",
"(",
"chunk",
")",
"{",
"// get all the rows in the current chunk that overlap with the requested",
"// window",
"var",
"chunkStart",
"=",
"chunk",
".",
"getStartIndex",
"(",
")",
";",
"var",
"chunkEnd",
"=",
"chunk",
".",
"getEndIndex",
"(",
")",
";",
"... | Processes the rows in a given chunk.
@param {Object} chunk | [
"Processes",
"the",
"rows",
"in",
"a",
"given",
"chunk",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L402-L471 | |
10,081 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | function()
{
// get the start position and start time
var startIndex = rowIndex;
var startTime = Date.now();
var each = options.each;
while (rowIndex < rowsLength)
{
// invoke the each() callback on the current row
var ret = each(rows[rowIndex++]);
cont... | javascript | function()
{
// get the start position and start time
var startIndex = rowIndex;
var startTime = Date.now();
var each = options.each;
while (rowIndex < rowsLength)
{
// invoke the each() callback on the current row
var ret = each(rows[rowIndex++]);
cont... | [
"function",
"(",
")",
"{",
"// get the start position and start time",
"var",
"startIndex",
"=",
"rowIndex",
";",
"var",
"startTime",
"=",
"Date",
".",
"now",
"(",
")",
";",
"var",
"each",
"=",
"options",
".",
"each",
";",
"while",
"(",
"rowIndex",
"<",
"r... | create a function that can be called to batch-process rows | [
"create",
"a",
"function",
"that",
"can",
"be",
"called",
"to",
"batch",
"-",
"process",
"rows"
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L416-L467 | |
10,082 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | findOverlappingChunks | function findOverlappingChunks(chunks, windowStart, windowEnd)
{
var overlappingChunks = [];
if (chunks.length !== 0)
{
// get the index of the first chunk that overlaps with the specified window
var index = findFirstOverlappingChunk(chunks, windowStart, windowEnd);
// iterate over the chunks starti... | javascript | function findOverlappingChunks(chunks, windowStart, windowEnd)
{
var overlappingChunks = [];
if (chunks.length !== 0)
{
// get the index of the first chunk that overlaps with the specified window
var index = findFirstOverlappingChunk(chunks, windowStart, windowEnd);
// iterate over the chunks starti... | [
"function",
"findOverlappingChunks",
"(",
"chunks",
",",
"windowStart",
",",
"windowEnd",
")",
"{",
"var",
"overlappingChunks",
"=",
"[",
"]",
";",
"if",
"(",
"chunks",
".",
"length",
"!==",
"0",
")",
"{",
"// get the index of the first chunk that overlaps with the ... | Given a sorted array of chunks, returns a sub-array that overlaps with a
specified window.
@param chunks
@param windowStart
@param windowEnd
@returns {Array} | [
"Given",
"a",
"sorted",
"array",
"of",
"chunks",
"returns",
"a",
"sub",
"-",
"array",
"that",
"overlaps",
"with",
"a",
"specified",
"window",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L492-L519 |
10,083 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/result.js | findFirstOverlappingChunk | function findFirstOverlappingChunk(chunks, windowStartIndex, windowEndIndex)
{
var helper = function(chunks,
chunkIndexLeft,
chunkIndexRight,
windowStartIndex,
windowEndIndex)
{
var result;
var chunkIndexMiddle;
... | javascript | function findFirstOverlappingChunk(chunks, windowStartIndex, windowEndIndex)
{
var helper = function(chunks,
chunkIndexLeft,
chunkIndexRight,
windowStartIndex,
windowEndIndex)
{
var result;
var chunkIndexMiddle;
... | [
"function",
"findFirstOverlappingChunk",
"(",
"chunks",
",",
"windowStartIndex",
",",
"windowEndIndex",
")",
"{",
"var",
"helper",
"=",
"function",
"(",
"chunks",
",",
"chunkIndexLeft",
",",
"chunkIndexRight",
",",
"windowStartIndex",
",",
"windowEndIndex",
")",
"{"... | Given a sorted array of chunks, returns the index of the first chunk in the
array that overlaps with a specified window.
@param chunks
@param windowStartIndex
@param windowEndIndex
@returns {number} | [
"Given",
"a",
"sorted",
"array",
"of",
"chunks",
"returns",
"the",
"index",
"of",
"the",
"first",
"chunk",
"in",
"the",
"array",
"that",
"overlaps",
"with",
"a",
"specified",
"window",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/result.js#L531-L637 |
10,084 | snowflakedb/snowflake-connector-nodejs | lib/services/sf.js | function(state, transitionContext)
{
// this check is necessary to make sure we don't re-enter a transient state
// like Renewing when we're already in it
if (currentState !== state)
{
// if we have a current state, exit it; the null check is necessary
// because the currentState is undefi... | javascript | function(state, transitionContext)
{
// this check is necessary to make sure we don't re-enter a transient state
// like Renewing when we're already in it
if (currentState !== state)
{
// if we have a current state, exit it; the null check is necessary
// because the currentState is undefi... | [
"function",
"(",
"state",
",",
"transitionContext",
")",
"{",
"// this check is necessary to make sure we don't re-enter a transient state",
"// like Renewing when we're already in it",
"if",
"(",
"currentState",
"!==",
"state",
")",
"{",
"// if we have a current state, exit it; the ... | Transitions to a given state.
@param {Object} state
@param {Object} [transitionContext] | [
"Transitions",
"to",
"a",
"given",
"state",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/services/sf.js#L106-L126 | |
10,085 | snowflakedb/snowflake-connector-nodejs | lib/services/sf.js | sendHttpRequest | function sendHttpRequest(requestOptions, httpClient)
{
return httpClient.request(
{
method : requestOptions.method,
headers : requestOptions.headers,
url : requestOptions.absoluteUrl,
gzip : requestOptions.gzip,
json : requestOptions.json,
callback : functio... | javascript | function sendHttpRequest(requestOptions, httpClient)
{
return httpClient.request(
{
method : requestOptions.method,
headers : requestOptions.headers,
url : requestOptions.absoluteUrl,
gzip : requestOptions.gzip,
json : requestOptions.json,
callback : functio... | [
"function",
"sendHttpRequest",
"(",
"requestOptions",
",",
"httpClient",
")",
"{",
"return",
"httpClient",
".",
"request",
"(",
"{",
"method",
":",
"requestOptions",
".",
"method",
",",
"headers",
":",
"requestOptions",
".",
"headers",
",",
"url",
":",
"reques... | Issues an http request to Snowflake.
@param {Object} requestOptions
@param {Object} httpClient
@returns {Object} the http request object. | [
"Issues",
"an",
"http",
"request",
"to",
"Snowflake",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/services/sf.js#L498-L564 |
10,086 | snowflakedb/snowflake-connector-nodejs | lib/services/sf.js | buildLoginUrl | function buildLoginUrl(connectionConfig)
{
var queryParams =
[
{ name: 'warehouse', value: connectionConfig.getWarehouse() },
{ name: 'databaseName', value: connectionConfig.getDatabase() },
{ name: 'schemaName', value: connectionConfig.getSchema() },
{ name: 'roleName', value: connectionCo... | javascript | function buildLoginUrl(connectionConfig)
{
var queryParams =
[
{ name: 'warehouse', value: connectionConfig.getWarehouse() },
{ name: 'databaseName', value: connectionConfig.getDatabase() },
{ name: 'schemaName', value: connectionConfig.getSchema() },
{ name: 'roleName', value: connectionCo... | [
"function",
"buildLoginUrl",
"(",
"connectionConfig",
")",
"{",
"var",
"queryParams",
"=",
"[",
"{",
"name",
":",
"'warehouse'",
",",
"value",
":",
"connectionConfig",
".",
"getWarehouse",
"(",
")",
"}",
",",
"{",
"name",
":",
"'databaseName'",
",",
"value",... | Builds the url for a login request.
@param connectionConfig
@returns {*} | [
"Builds",
"the",
"url",
"for",
"a",
"login",
"request",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/services/sf.js#L1028-L1053 |
10,087 | snowflakedb/snowflake-connector-nodejs | lib/http/base.js | HttpClient | function HttpClient(connectionConfig)
{
// save the connection config
this._connectionConfig = connectionConfig;
// check that we have a valid request module
var requestModule = this.getRequestModule();
Errors.assertInternal(
Util.isObject(requestModule) || Util.isFunction(requestModule));
} | javascript | function HttpClient(connectionConfig)
{
// save the connection config
this._connectionConfig = connectionConfig;
// check that we have a valid request module
var requestModule = this.getRequestModule();
Errors.assertInternal(
Util.isObject(requestModule) || Util.isFunction(requestModule));
} | [
"function",
"HttpClient",
"(",
"connectionConfig",
")",
"{",
"// save the connection config",
"this",
".",
"_connectionConfig",
"=",
"connectionConfig",
";",
"// check that we have a valid request module",
"var",
"requestModule",
"=",
"this",
".",
"getRequestModule",
"(",
"... | Creates a new HTTP client.
@param connectionConfig
@constructor | [
"Creates",
"a",
"new",
"HTTP",
"client",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/http/base.js#L18-L27 |
10,088 | snowflakedb/snowflake-connector-nodejs | lib/http/base.js | normalizeHeaders | function normalizeHeaders(headers)
{
var ret = headers;
if (Util.isObject(headers))
{
ret = {};
// shallow copy the headers object and convert some headers like 'Accept'
// and 'Content-Type' to lower case while copying; this is necessary
// because the browser-request module, which we use to ma... | javascript | function normalizeHeaders(headers)
{
var ret = headers;
if (Util.isObject(headers))
{
ret = {};
// shallow copy the headers object and convert some headers like 'Accept'
// and 'Content-Type' to lower case while copying; this is necessary
// because the browser-request module, which we use to ma... | [
"function",
"normalizeHeaders",
"(",
"headers",
")",
"{",
"var",
"ret",
"=",
"headers",
";",
"if",
"(",
"Util",
".",
"isObject",
"(",
"headers",
")",
")",
"{",
"ret",
"=",
"{",
"}",
";",
"// shallow copy the headers object and convert some headers like 'Accept'",
... | Normalizes a request headers object so that we get the same behavior
regardless of whether we're using request.js or browser-request.js.
@param {Object} headers
@returns {Object} | [
"Normalizes",
"a",
"request",
"headers",
"object",
"so",
"that",
"we",
"get",
"the",
"same",
"behavior",
"regardless",
"of",
"whether",
"we",
"re",
"using",
"request",
".",
"js",
"or",
"browser",
"-",
"request",
".",
"js",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/http/base.js#L199-L236 |
10,089 | snowflakedb/snowflake-connector-nodejs | lib/http/base.js | normalizeResponse | function normalizeResponse(response)
{
// if the response doesn't already have a getResponseHeader() method, add one
if (response && !response.getResponseHeader)
{
response.getResponseHeader = function(header)
{
return response.headers && response.headers[
Util.isString(header) ? heade... | javascript | function normalizeResponse(response)
{
// if the response doesn't already have a getResponseHeader() method, add one
if (response && !response.getResponseHeader)
{
response.getResponseHeader = function(header)
{
return response.headers && response.headers[
Util.isString(header) ? heade... | [
"function",
"normalizeResponse",
"(",
"response",
")",
"{",
"// if the response doesn't already have a getResponseHeader() method, add one",
"if",
"(",
"response",
"&&",
"!",
"response",
".",
"getResponseHeader",
")",
"{",
"response",
".",
"getResponseHeader",
"=",
"functio... | Normalizes the response object so that we can extract response headers from
it in a uniform way regardless of whether we're using request.js or
browser-request.js.
@param {Object} response
@return {Object} | [
"Normalizes",
"the",
"response",
"object",
"so",
"that",
"we",
"can",
"extract",
"response",
"headers",
"from",
"it",
"in",
"a",
"uniform",
"way",
"regardless",
"of",
"whether",
"we",
"re",
"using",
"request",
".",
"js",
"or",
"browser",
"-",
"request",
".... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/http/base.js#L247-L260 |
10,090 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | init | function init()
{
// the stream has now been initialized
initialized = true;
// if we have a result
if (context.result)
{
// if no value was specified for the start index or if the specified start
// index is negative, default to 0, otherwise truncate the fractional part
start =... | javascript | function init()
{
// the stream has now been initialized
initialized = true;
// if we have a result
if (context.result)
{
// if no value was specified for the start index or if the specified start
// index is negative, default to 0, otherwise truncate the fractional part
start =... | [
"function",
"init",
"(",
")",
"{",
"// the stream has now been initialized",
"initialized",
"=",
"true",
";",
"// if we have a result",
"if",
"(",
"context",
".",
"result",
")",
"{",
"// if no value was specified for the start index or if the specified start",
"// index is nega... | Initializes this stream. | [
"Initializes",
"this",
"stream",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L92-L135 |
10,091 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | processRowBuffer | function processRowBuffer()
{
// get the row to add to the read queue
var row = rowBuffer[rowIndex++];
// if we just read the last row in the row buffer, clear the row buffer and
// reset the row index so that we load the next chunk in the result stream
// when _read() is called
if (rowIndex ... | javascript | function processRowBuffer()
{
// get the row to add to the read queue
var row = rowBuffer[rowIndex++];
// if we just read the last row in the row buffer, clear the row buffer and
// reset the row index so that we load the next chunk in the result stream
// when _read() is called
if (rowIndex ... | [
"function",
"processRowBuffer",
"(",
")",
"{",
"// get the row to add to the read queue",
"var",
"row",
"=",
"rowBuffer",
"[",
"rowIndex",
"++",
"]",
";",
"// if we just read the last row in the row buffer, clear the row buffer and",
"// reset the row index so that we load the next c... | Processes the row buffer. | [
"Processes",
"the",
"row",
"buffer",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L140-L170 |
10,092 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | onResultStreamData | function onResultStreamData(chunk)
{
// unsubscribe from the result stream's 'data' and 'close' events
resultStream.removeListener('data', onResultStreamData);
resultStream.removeListener('close', onResultStreamClose);
// get all the rows in the chunk that overlap with the requested window,
// an... | javascript | function onResultStreamData(chunk)
{
// unsubscribe from the result stream's 'data' and 'close' events
resultStream.removeListener('data', onResultStreamData);
resultStream.removeListener('close', onResultStreamClose);
// get all the rows in the chunk that overlap with the requested window,
// an... | [
"function",
"onResultStreamData",
"(",
"chunk",
")",
"{",
"// unsubscribe from the result stream's 'data' and 'close' events",
"resultStream",
".",
"removeListener",
"(",
"'data'",
",",
"onResultStreamData",
")",
";",
"resultStream",
".",
"removeListener",
"(",
"'close'",
"... | Called when the result stream reads a new chunk.
@param {Chunk} chunk | [
"Called",
"when",
"the",
"result",
"stream",
"reads",
"a",
"new",
"chunk",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L177-L196 |
10,093 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | onResultStreamClose | function onResultStreamClose(err, continueCallback)
{
// if the error is retryable and
// the result stream hasn't been closed too many times
if (isResultStreamErrorRetryable(err) &&
(numResultStreamInterrupts <
context.connectionConfig.getResultStreamInterrupts()))
{
numResultSt... | javascript | function onResultStreamClose(err, continueCallback)
{
// if the error is retryable and
// the result stream hasn't been closed too many times
if (isResultStreamErrorRetryable(err) &&
(numResultStreamInterrupts <
context.connectionConfig.getResultStreamInterrupts()))
{
numResultSt... | [
"function",
"onResultStreamClose",
"(",
"err",
",",
"continueCallback",
")",
"{",
"// if the error is retryable and",
"// the result stream hasn't been closed too many times",
"if",
"(",
"isResultStreamErrorRetryable",
"(",
"err",
")",
"&&",
"(",
"numResultStreamInterrupts",
"<... | Called when there are no more chunks to read in the result stream or an
error is encountered while trying to read the next chunk.
@param err
@param continueCallback | [
"Called",
"when",
"there",
"are",
"no",
"more",
"chunks",
"to",
"read",
"in",
"the",
"result",
"stream",
"or",
"an",
"error",
"is",
"encountered",
"while",
"trying",
"to",
"read",
"the",
"next",
"chunk",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L205-L232 |
10,094 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | function(err)
{
// if we have a result stream, stop listening to events on it
if (resultStream)
{
resultStream.removeListener('data', onResultStreamData);
resultStream.removeListener('close', onResultStreamClose);
}
// we're done, so time to clean up
rowBuffer = null;
rowIndex... | javascript | function(err)
{
// if we have a result stream, stop listening to events on it
if (resultStream)
{
resultStream.removeListener('data', onResultStreamData);
resultStream.removeListener('close', onResultStreamClose);
}
// we're done, so time to clean up
rowBuffer = null;
rowIndex... | [
"function",
"(",
"err",
")",
"{",
"// if we have a result stream, stop listening to events on it",
"if",
"(",
"resultStream",
")",
"{",
"resultStream",
".",
"removeListener",
"(",
"'data'",
",",
"onResultStreamData",
")",
";",
"resultStream",
".",
"removeListener",
"(",... | Closes the row stream.
@param {Error} [err] | [
"Closes",
"the",
"row",
"stream",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L239-L262 | |
10,095 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | readNextRow | function readNextRow()
{
// if we have a row buffer, process it
if (rowBuffer)
{
processRowBuffer();
}
else
{
// subscribe to the result stream's 'data' and 'close' events
resultStream.on('data', onResultStreamData);
resultStream.on('close', onResultStreamClose);
... | javascript | function readNextRow()
{
// if we have a row buffer, process it
if (rowBuffer)
{
processRowBuffer();
}
else
{
// subscribe to the result stream's 'data' and 'close' events
resultStream.on('data', onResultStreamData);
resultStream.on('close', onResultStreamClose);
... | [
"function",
"readNextRow",
"(",
")",
"{",
"// if we have a row buffer, process it",
"if",
"(",
"rowBuffer",
")",
"{",
"processRowBuffer",
"(",
")",
";",
"}",
"else",
"{",
"// subscribe to the result stream's 'data' and 'close' events",
"resultStream",
".",
"on",
"(",
"'... | Called when we're ready to read the next row in the result. | [
"Called",
"when",
"we",
"re",
"ready",
"to",
"read",
"the",
"next",
"row",
"in",
"the",
"result",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L267-L283 |
10,096 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | isResultStreamErrorRetryable | function isResultStreamErrorRetryable(error)
{
return Errors.isLargeResultSetError(error) && error.response &&
(error.response.statusCode === 403);
} | javascript | function isResultStreamErrorRetryable(error)
{
return Errors.isLargeResultSetError(error) && error.response &&
(error.response.statusCode === 403);
} | [
"function",
"isResultStreamErrorRetryable",
"(",
"error",
")",
"{",
"return",
"Errors",
".",
"isLargeResultSetError",
"(",
"error",
")",
"&&",
"error",
".",
"response",
"&&",
"(",
"error",
".",
"response",
".",
"statusCode",
"===",
"403",
")",
";",
"}"
] | Determines if a result stream error is a retryable error.
@param {Error} error
@returns {Boolean} | [
"Determines",
"if",
"a",
"result",
"stream",
"error",
"is",
"a",
"retryable",
"error",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L316-L320 |
10,097 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | buildMapColumnExtractFnNames | function buildMapColumnExtractFnNames(columns, fetchAsString)
{
var fnNameGetColumnValue = 'getColumnValue';
var fnNameGetColumnValueAsString = 'getColumnValueAsString';
var index, length, column;
var mapColumnIdToExtractFnName = {};
// if no native types need to be retrieved as strings, extract values norm... | javascript | function buildMapColumnExtractFnNames(columns, fetchAsString)
{
var fnNameGetColumnValue = 'getColumnValue';
var fnNameGetColumnValueAsString = 'getColumnValueAsString';
var index, length, column;
var mapColumnIdToExtractFnName = {};
// if no native types need to be retrieved as strings, extract values norm... | [
"function",
"buildMapColumnExtractFnNames",
"(",
"columns",
",",
"fetchAsString",
")",
"{",
"var",
"fnNameGetColumnValue",
"=",
"'getColumnValue'",
";",
"var",
"fnNameGetColumnValueAsString",
"=",
"'getColumnValueAsString'",
";",
"var",
"index",
",",
"length",
",",
"col... | Builds a map in which the keys are column ids and the values are the names of
the extract functions to use when retrieving row values for the corresponding
columns.
@param {Object[]} columns
@param {String[]} fetchAsString the native types that should be retrieved as
strings.
@returns {Object} | [
"Builds",
"a",
"map",
"in",
"which",
"the",
"keys",
"are",
"column",
"ids",
"and",
"the",
"values",
"are",
"the",
"names",
"of",
"the",
"extract",
"functions",
"to",
"use",
"when",
"retrieving",
"row",
"values",
"for",
"the",
"corresponding",
"columns",
".... | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L333-L372 |
10,098 | snowflakedb/snowflake-connector-nodejs | lib/connection/result/row_stream.js | externalizeRow | function externalizeRow(row, columns, mapColumnIdToExtractFnName)
{
var externalizedRow = {};
for (var index = 0, length = columns.length; index < length; index++)
{
var column = columns[index];
var extractFnName = mapColumnIdToExtractFnName[column.getId()];
externalizedRow[column.getName()] = row[ext... | javascript | function externalizeRow(row, columns, mapColumnIdToExtractFnName)
{
var externalizedRow = {};
for (var index = 0, length = columns.length; index < length; index++)
{
var column = columns[index];
var extractFnName = mapColumnIdToExtractFnName[column.getId()];
externalizedRow[column.getName()] = row[ext... | [
"function",
"externalizeRow",
"(",
"row",
",",
"columns",
",",
"mapColumnIdToExtractFnName",
")",
"{",
"var",
"externalizedRow",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"index",
"=",
"0",
",",
"length",
"=",
"columns",
".",
"length",
";",
"index",
"<",
"l... | Converts an internal representation of a result row to a format appropriate
for consumption by the outside world.
@param {Object} row
@param {Object[]} columns
@param {Object} [mapColumnIdToExtractFnName]
@returns {Object} | [
"Converts",
"an",
"internal",
"representation",
"of",
"a",
"result",
"row",
"to",
"a",
"format",
"appropriate",
"for",
"consumption",
"by",
"the",
"outside",
"world",
"."
] | 7ad71410a3bb679a96021b6b2d5b9b515f790db8 | https://github.com/snowflakedb/snowflake-connector-nodejs/blob/7ad71410a3bb679a96021b6b2d5b9b515f790db8/lib/connection/result/row_stream.js#L384-L395 |
10,099 | PlatziDev/pulse-editor | src/utils/get-selection.js | getSelection | function getSelection (field) {
if (typeof field !== 'object') {
throw new TypeError('The field must be an object.')
}
return {
start: field.selectionStart,
end: field.selectionEnd
}
} | javascript | function getSelection (field) {
if (typeof field !== 'object') {
throw new TypeError('The field must be an object.')
}
return {
start: field.selectionStart,
end: field.selectionEnd
}
} | [
"function",
"getSelection",
"(",
"field",
")",
"{",
"if",
"(",
"typeof",
"field",
"!==",
"'object'",
")",
"{",
"throw",
"new",
"TypeError",
"(",
"'The field must be an object.'",
")",
"}",
"return",
"{",
"start",
":",
"field",
".",
"selectionStart",
",",
"en... | Get the element selection start and end values
@param {Element} field The DOM node element
@return {SelectionType} The selection start and end | [
"Get",
"the",
"element",
"selection",
"start",
"and",
"end",
"values"
] | 897bc0e91b365e305c06c038f0192a21e5f5fe4a | https://github.com/PlatziDev/pulse-editor/blob/897bc0e91b365e305c06c038f0192a21e5f5fe4a/src/utils/get-selection.js#L6-L15 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.