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
3,300
cytoscape/cytoscape.js
dist/cytoscape.esm.js
addConnectedEdges
function addConnectedEdges(node) { var edges = node._private.edges; for (var i = 0; i < edges.length; i++) { add(edges[i]); } }
javascript
function addConnectedEdges(node) { var edges = node._private.edges; for (var i = 0; i < edges.length; i++) { add(edges[i]); } }
[ "function", "addConnectedEdges", "(", "node", ")", "{", "var", "edges", "=", "node", ".", "_private", ".", "edges", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "edges", ".", "length", ";", "i", "++", ")", "{", "add", "(", "edges", "[", ...
add connected edges
[ "add", "connected", "edges" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L12352-L12358
3,301
cytoscape/cytoscape.js
dist/cytoscape.esm.js
addChildren
function addChildren(node) { var children = node._private.children; for (var i = 0; i < children.length; i++) { add(children[i]); } }
javascript
function addChildren(node) { var children = node._private.children; for (var i = 0; i < children.length; i++) { add(children[i]); } }
[ "function", "addChildren", "(", "node", ")", "{", "var", "children", "=", "node", ".", "_private", ".", "children", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "add", "(", "children", ...
add descendant nodes
[ "add", "descendant", "nodes" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L12361-L12367
3,302
cytoscape/cytoscape.js
dist/cytoscape.esm.js
spring
function spring(tension, friction, duration) { if (duration === 0) { // can't get a spring w/ duration 0 return easings.linear; // duration 0 => jump to end so impl doesn't matter } var spring = generateSpringRK4(tension, friction, duration); return function (start, end, percent) { re...
javascript
function spring(tension, friction, duration) { if (duration === 0) { // can't get a spring w/ duration 0 return easings.linear; // duration 0 => jump to end so impl doesn't matter } var spring = generateSpringRK4(tension, friction, duration); return function (start, end, percent) { re...
[ "function", "spring", "(", "tension", ",", "friction", ",", "duration", ")", "{", "if", "(", "duration", "===", "0", ")", "{", "// can't get a spring w/ duration 0", "return", "easings", ".", "linear", ";", "// duration 0 => jump to end so impl doesn't matter", "}", ...
user param easings...
[ "user", "param", "easings", "..." ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L12947-L12957
3,303
cytoscape/cytoscape.js
dist/cytoscape.esm.js
batchData
function batchData(map) { var cy = this; return this.batch(function () { var ids = Object.keys(map); for (var i = 0; i < ids.length; i++) { var id = ids[i]; var data = map[id]; var ele = cy.getElementById(id); ele.data(data); } }); }
javascript
function batchData(map) { var cy = this; return this.batch(function () { var ids = Object.keys(map); for (var i = 0; i < ids.length; i++) { var id = ids[i]; var data = map[id]; var ele = cy.getElementById(id); ele.data(data); } }); }
[ "function", "batchData", "(", "map", ")", "{", "var", "cy", "=", "this", ";", "return", "this", ".", "batch", "(", "function", "(", ")", "{", "var", "ids", "=", "Object", ".", "keys", "(", "map", ")", ";", "for", "(", "var", "i", "=", "0", ";",...
for backwards compatibility
[ "for", "backwards", "compatibility" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L13604-L13616
3,304
cytoscape/cytoscape.js
dist/cytoscape.esm.js
sortFn
function sortFn(a, b) { var apct = getWeightedPercent(a); var bpct = getWeightedPercent(b); var diff = apct - bpct; if (diff === 0) { return ascending(a.id(), b.id()); // make sure sort doesn't have don't-care comparisons } else { return diff; } }
javascript
function sortFn(a, b) { var apct = getWeightedPercent(a); var bpct = getWeightedPercent(b); var diff = apct - bpct; if (diff === 0) { return ascending(a.id(), b.id()); // make sure sort doesn't have don't-care comparisons } else { return diff; } }
[ "function", "sortFn", "(", "a", ",", "b", ")", "{", "var", "apct", "=", "getWeightedPercent", "(", "a", ")", ";", "var", "bpct", "=", "getWeightedPercent", "(", "b", ")", ";", "var", "diff", "=", "apct", "-", "bpct", ";", "if", "(", "diff", "===", ...
rearrange the indices in each depth level based on connectivity
[ "rearrange", "the", "indices", "in", "each", "depth", "level", "based", "on", "connectivity" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L18322-L18332
3,305
cytoscape/cytoscape.js
dist/cytoscape.esm.js
addNodesToDrag
function addNodesToDrag(nodes, opts) { opts = opts || {}; var hasCompoundNodes = nodes.cy().hasCompoundNodes(); if (opts.inDragLayer) { nodes.forEach(setInDragLayer); nodes.neighborhood().stdFilter(function (ele) { return !hasCompoundNodes || ele.isEdge(); }).forEach(setInDragLaye...
javascript
function addNodesToDrag(nodes, opts) { opts = opts || {}; var hasCompoundNodes = nodes.cy().hasCompoundNodes(); if (opts.inDragLayer) { nodes.forEach(setInDragLayer); nodes.neighborhood().stdFilter(function (ele) { return !hasCompoundNodes || ele.isEdge(); }).forEach(setInDragLaye...
[ "function", "addNodesToDrag", "(", "nodes", ",", "opts", ")", "{", "opts", "=", "opts", "||", "{", "}", ";", "var", "hasCompoundNodes", "=", "nodes", ".", "cy", "(", ")", ".", "hasCompoundNodes", "(", ")", ";", "if", "(", "opts", ".", "inDragLayer", ...
adds the given nodes and its neighbourhood to the drag layer
[ "adds", "the", "given", "nodes", "and", "its", "neighbourhood", "to", "the", "drag", "layer" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L23307-L23331
3,306
cytoscape/cytoscape.js
dist/cytoscape.esm.js
setupShapeColor
function setupShapeColor() { var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; r.eleFillStyle(context, node, bgOpy); }
javascript
function setupShapeColor() { var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; r.eleFillStyle(context, node, bgOpy); }
[ "function", "setupShapeColor", "(", ")", "{", "var", "bgOpy", "=", "arguments", ".", "length", ">", "0", "&&", "arguments", "[", "0", "]", "!==", "undefined", "?", "arguments", "[", "0", "]", ":", "bgOpacity", ";", "r", ".", "eleFillStyle", "(", "conte...
so borders are square with the node shape
[ "so", "borders", "are", "square", "with", "the", "node", "shape" ]
ad2051b65e2243cfd953d8b24a8bf95bfa8559e5
https://github.com/cytoscape/cytoscape.js/blob/ad2051b65e2243cfd953d8b24a8bf95bfa8559e5/dist/cytoscape.esm.js#L28500-L28503
3,307
fex-team/webuploader
build/tasks/build.js
convert
function convert( name, _path, contents ) { var rDefine = /(define\s*\(\s*('|").*?\2\s*,\s*\[)([\s\S]*?)\]/ig, rDeps = /('|")(.*?)\1/g, root = _path.substr( 0, _path.length - name.length - 3 ), dir = path.dirname( _path ), m, m2, deps, dep, _path2; contents = contents.replace( r...
javascript
function convert( name, _path, contents ) { var rDefine = /(define\s*\(\s*('|").*?\2\s*,\s*\[)([\s\S]*?)\]/ig, rDeps = /('|")(.*?)\1/g, root = _path.substr( 0, _path.length - name.length - 3 ), dir = path.dirname( _path ), m, m2, deps, dep, _path2; contents = contents.replace( r...
[ "function", "convert", "(", "name", ",", "_path", ",", "contents", ")", "{", "var", "rDefine", "=", "/", "(define\\s*\\(\\s*('|\").*?\\2\\s*,\\s*\\[)([\\s\\S]*?)\\]", "/", "ig", ",", "rDeps", "=", "/", "('|\")(.*?)\\1", "/", "g", ",", "root", "=", "_path", "."...
convert relative path to absolute path.
[ "convert", "relative", "path", "to", "absolute", "path", "." ]
7094e4476c5af3b06993d91dde2d223200b9feb7
https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/build/tasks/build.js#L12-L30
3,308
fex-team/webuploader
src/runtime/html5/image.js
detectSubsampling
function detectSubsampling( img ) { var iw = img.naturalWidth, ih = img.naturalHeight, canvas, ctx; // subsampling may happen overmegapixel image if ( iw * ih > 1024 * 1024 ) { canvas = document.createElement('c...
javascript
function detectSubsampling( img ) { var iw = img.naturalWidth, ih = img.naturalHeight, canvas, ctx; // subsampling may happen overmegapixel image if ( iw * ih > 1024 * 1024 ) { canvas = document.createElement('c...
[ "function", "detectSubsampling", "(", "img", ")", "{", "var", "iw", "=", "img", ".", "naturalWidth", ",", "ih", "=", "img", ".", "naturalHeight", ",", "canvas", ",", "ctx", ";", "// subsampling may happen overmegapixel image", "if", "(", "iw", "*", "ih", ">"...
Detect subsampling in loaded image. In iOS, larger images than 2M pixels may be subsampled in rendering.
[ "Detect", "subsampling", "in", "loaded", "image", ".", "In", "iOS", "larger", "images", "than", "2M", "pixels", "may", "be", "subsampled", "in", "rendering", "." ]
7094e4476c5af3b06993d91dde2d223200b9feb7
https://github.com/fex-team/webuploader/blob/7094e4476c5af3b06993d91dde2d223200b9feb7/src/runtime/html5/image.js#L366-L386
3,309
swimlane/ngx-datatable
release/utils/sort.js
nextSortDir
function nextSortDir(sortType, current) { if (sortType === types_1.SortType.single) { if (current === types_1.SortDirection.asc) { return types_1.SortDirection.desc; } else { return types_1.SortDirection.asc; } } else { if (!current) { ...
javascript
function nextSortDir(sortType, current) { if (sortType === types_1.SortType.single) { if (current === types_1.SortDirection.asc) { return types_1.SortDirection.desc; } else { return types_1.SortDirection.asc; } } else { if (!current) { ...
[ "function", "nextSortDir", "(", "sortType", ",", "current", ")", "{", "if", "(", "sortType", "===", "types_1", ".", "SortType", ".", "single", ")", "{", "if", "(", "current", "===", "types_1", ".", "SortDirection", ".", "asc", ")", "{", "return", "types_...
Gets the next sort direction
[ "Gets", "the", "next", "sort", "direction" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/sort.js#L8-L30
3,310
swimlane/ngx-datatable
release/utils/sort.js
sortRows
function sortRows(rows, columns, dirs) { if (!rows) return []; if (!dirs || !dirs.length || !columns) return rows.slice(); /** * record the row ordering of results from prior sort operations (if applicable) * this is necessary to guarantee stable sorting behavior */ var ro...
javascript
function sortRows(rows, columns, dirs) { if (!rows) return []; if (!dirs || !dirs.length || !columns) return rows.slice(); /** * record the row ordering of results from prior sort operations (if applicable) * this is necessary to guarantee stable sorting behavior */ var ro...
[ "function", "sortRows", "(", "rows", ",", "columns", ",", "dirs", ")", "{", "if", "(", "!", "rows", ")", "return", "[", "]", ";", "if", "(", "!", "dirs", "||", "!", "dirs", ".", "length", "||", "!", "columns", ")", "return", "rows", ".", "slice",...
creates a shallow copy of the `rows` input and returns the sorted copy. this function does not sort the `rows` argument in place
[ "creates", "a", "shallow", "copy", "of", "the", "rows", "input", "and", "returns", "the", "sorted", "copy", ".", "this", "function", "does", "not", "sort", "the", "rows", "argument", "in", "place" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/sort.js#L72-L130
3,311
swimlane/ngx-datatable
release/utils/column.js
columnsByPin
function columnsByPin(cols) { var ret = { left: [], center: [], right: [] }; if (cols) { for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) { var col = cols_1[_i]; if (col.frozenLeft) { ret.left.push(col); } ...
javascript
function columnsByPin(cols) { var ret = { left: [], center: [], right: [] }; if (cols) { for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) { var col = cols_1[_i]; if (col.frozenLeft) { ret.left.push(col); } ...
[ "function", "columnsByPin", "(", "cols", ")", "{", "var", "ret", "=", "{", "left", ":", "[", "]", ",", "center", ":", "[", "]", ",", "right", ":", "[", "]", "}", ";", "if", "(", "cols", ")", "{", "for", "(", "var", "_i", "=", "0", ",", "col...
Returns the columns by pin.
[ "Returns", "the", "columns", "by", "pin", "." ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column.js#L6-L27
3,312
swimlane/ngx-datatable
release/utils/column.js
columnGroupWidths
function columnGroupWidths(groups, all) { return { left: columnTotalWidth(groups.left), center: columnTotalWidth(groups.center), right: columnTotalWidth(groups.right), total: Math.floor(columnTotalWidth(all)) }; }
javascript
function columnGroupWidths(groups, all) { return { left: columnTotalWidth(groups.left), center: columnTotalWidth(groups.center), right: columnTotalWidth(groups.right), total: Math.floor(columnTotalWidth(all)) }; }
[ "function", "columnGroupWidths", "(", "groups", ",", "all", ")", "{", "return", "{", "left", ":", "columnTotalWidth", "(", "groups", ".", "left", ")", ",", "center", ":", "columnTotalWidth", "(", "groups", ".", "center", ")", ",", "right", ":", "columnTota...
Returns the widths of all group sets of a column
[ "Returns", "the", "widths", "of", "all", "group", "sets", "of", "a", "column" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column.js#L32-L39
3,313
swimlane/ngx-datatable
release/utils/math.js
getTotalFlexGrow
function getTotalFlexGrow(columns) { var totalFlexGrow = 0; for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) { var c = columns_1[_i]; totalFlexGrow += c.flexGrow || 0; } return totalFlexGrow; }
javascript
function getTotalFlexGrow(columns) { var totalFlexGrow = 0; for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) { var c = columns_1[_i]; totalFlexGrow += c.flexGrow || 0; } return totalFlexGrow; }
[ "function", "getTotalFlexGrow", "(", "columns", ")", "{", "var", "totalFlexGrow", "=", "0", ";", "for", "(", "var", "_i", "=", "0", ",", "columns_1", "=", "columns", ";", "_i", "<", "columns_1", ".", "length", ";", "_i", "++", ")", "{", "var", "c", ...
Calculates the Total Flex Grow
[ "Calculates", "the", "Total", "Flex", "Grow" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L7-L14
3,314
swimlane/ngx-datatable
release/utils/math.js
scaleColumns
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) { // calculate total width and flexgrow points for coulumns that can be resized for (var attr in colsByGroup) { for (var _i = 0, _a = colsByGroup[attr]; _i < _a.length; _i++) { var column = _a[_i]; if (!column.canAutoRes...
javascript
function scaleColumns(colsByGroup, maxWidth, totalFlexGrow) { // calculate total width and flexgrow points for coulumns that can be resized for (var attr in colsByGroup) { for (var _i = 0, _a = colsByGroup[attr]; _i < _a.length; _i++) { var column = _a[_i]; if (!column.canAutoRes...
[ "function", "scaleColumns", "(", "colsByGroup", ",", "maxWidth", ",", "totalFlexGrow", ")", "{", "// calculate total width and flexgrow points for coulumns that can be resized", "for", "(", "var", "attr", "in", "colsByGroup", ")", "{", "for", "(", "var", "_i", "=", "0...
Resizes columns based on the flexGrow property, while respecting manually set widths
[ "Resizes", "columns", "based", "on", "the", "flexGrow", "property", "while", "respecting", "manually", "set", "widths" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L32-L70
3,315
swimlane/ngx-datatable
release/utils/math.js
forceFillColumnWidths
function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) { if (defaultColWidth === void 0) { defaultColWidth = 300; } var columnsToResize = allColumns .slice(startIdx + 1, allColumns.length) .filter(function (c) { return c.canAutoResize !== false; ...
javascript
function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) { if (defaultColWidth === void 0) { defaultColWidth = 300; } var columnsToResize = allColumns .slice(startIdx + 1, allColumns.length) .filter(function (c) { return c.canAutoResize !== false; ...
[ "function", "forceFillColumnWidths", "(", "allColumns", ",", "expectedWidth", ",", "startIdx", ",", "allowBleed", ",", "defaultColWidth", ")", "{", "if", "(", "defaultColWidth", "===", "void", "0", ")", "{", "defaultColWidth", "=", "300", ";", "}", "var", "col...
Forces the width of the columns to distribute equally but overflowing when necessary Rules: - If combined withs are less than the total width of the grid, proportion the widths given the min / max / normal widths to fill the width. - If the combined widths, exceed the total width of the grid, use the standard widths...
[ "Forces", "the", "width", "of", "the", "columns", "to", "distribute", "equally", "but", "overflowing", "when", "necessary" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L90-L137
3,316
swimlane/ngx-datatable
release/utils/math.js
removeProcessedColumns
function removeProcessedColumns(columnsToResize, columnsProcessed) { for (var _i = 0, columnsProcessed_1 = columnsProcessed; _i < columnsProcessed_1.length; _i++) { var column = columnsProcessed_1[_i]; var index = columnsToResize.indexOf(column); columnsToResize.splice(index, 1); } }
javascript
function removeProcessedColumns(columnsToResize, columnsProcessed) { for (var _i = 0, columnsProcessed_1 = columnsProcessed; _i < columnsProcessed_1.length; _i++) { var column = columnsProcessed_1[_i]; var index = columnsToResize.indexOf(column); columnsToResize.splice(index, 1); } }
[ "function", "removeProcessedColumns", "(", "columnsToResize", ",", "columnsProcessed", ")", "{", "for", "(", "var", "_i", "=", "0", ",", "columnsProcessed_1", "=", "columnsProcessed", ";", "_i", "<", "columnsProcessed_1", ".", "length", ";", "_i", "++", ")", "...
Remove the processed columns from the current active columns.
[ "Remove", "the", "processed", "columns", "from", "the", "current", "active", "columns", "." ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L142-L148
3,317
swimlane/ngx-datatable
release/utils/math.js
getContentWidth
function getContentWidth(allColumns, defaultColWidth) { if (defaultColWidth === void 0) { defaultColWidth = 300; } var contentWidth = 0; for (var _i = 0, allColumns_1 = allColumns; _i < allColumns_1.length; _i++) { var column = allColumns_1[_i]; contentWidth += (column.width || defaultColWid...
javascript
function getContentWidth(allColumns, defaultColWidth) { if (defaultColWidth === void 0) { defaultColWidth = 300; } var contentWidth = 0; for (var _i = 0, allColumns_1 = allColumns; _i < allColumns_1.length; _i++) { var column = allColumns_1[_i]; contentWidth += (column.width || defaultColWid...
[ "function", "getContentWidth", "(", "allColumns", ",", "defaultColWidth", ")", "{", "if", "(", "defaultColWidth", "===", "void", "0", ")", "{", "defaultColWidth", "=", "300", ";", "}", "var", "contentWidth", "=", "0", ";", "for", "(", "var", "_i", "=", "...
Gets the width of the columns
[ "Gets", "the", "width", "of", "the", "columns" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/math.js#L152-L160
3,318
swimlane/ngx-datatable
release/utils/tree.js
groupRowsByParents
function groupRowsByParents(rows, from, to) { if (from && to) { var nodeById = {}; var l = rows.length; var node = null; nodeById[0] = new TreeNode(); // that's the root node var uniqIDs = rows.reduce(function (arr, item) { var toValue = to(item); if (...
javascript
function groupRowsByParents(rows, from, to) { if (from && to) { var nodeById = {}; var l = rows.length; var node = null; nodeById[0] = new TreeNode(); // that's the root node var uniqIDs = rows.reduce(function (arr, item) { var toValue = to(item); if (...
[ "function", "groupRowsByParents", "(", "rows", ",", "from", ",", "to", ")", "{", "if", "(", "from", "&&", "to", ")", "{", "var", "nodeById", "=", "{", "}", ";", "var", "l", "=", "rows", ".", "length", ";", "var", "node", "=", "null", ";", "nodeBy...
This functions rearrange items by their parents Also sets the level value to each of the items Note: Expecting each item has a property called parentId Note: This algorithm will fail if a list has two or more items with same ID NOTE: This algorithm will fail if there is a deadlock of relationship For example, Input ...
[ "This", "functions", "rearrange", "items", "by", "their", "parents", "Also", "sets", "the", "level", "value", "to", "each", "of", "the", "items" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/tree.js#L44-L80
3,319
swimlane/ngx-datatable
release/utils/column-helper.js
setColumnDefaults
function setColumnDefaults(columns) { if (!columns) return; // Only one column should hold the tree view // Thus if multiple columns are provided with // isTreeColumn as true we take only the first one var treeColumnFound = false; for (var _i = 0, columns_1 = columns; _i < columns_1.leng...
javascript
function setColumnDefaults(columns) { if (!columns) return; // Only one column should hold the tree view // Thus if multiple columns are provided with // isTreeColumn as true we take only the first one var treeColumnFound = false; for (var _i = 0, columns_1 = columns; _i < columns_1.leng...
[ "function", "setColumnDefaults", "(", "columns", ")", "{", "if", "(", "!", "columns", ")", "return", ";", "// Only one column should hold the tree view", "// Thus if multiple columns are provided with", "// isTreeColumn as true we take only the first one", "var", "treeColumnFound",...
Sets the column defaults
[ "Sets", "the", "column", "defaults" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-helper.js#L9-L67
3,320
swimlane/ngx-datatable
release/utils/column-helper.js
translateTemplates
function translateTemplates(templates) { var result = []; for (var _i = 0, templates_1 = templates; _i < templates_1.length; _i++) { var temp = templates_1[_i]; var col = {}; var props = Object.getOwnPropertyNames(temp); for (var _a = 0, props_1 = props; _a < props_1.length; _a++...
javascript
function translateTemplates(templates) { var result = []; for (var _i = 0, templates_1 = templates; _i < templates_1.length; _i++) { var temp = templates_1[_i]; var col = {}; var props = Object.getOwnPropertyNames(temp); for (var _a = 0, props_1 = props; _a < props_1.length; _a++...
[ "function", "translateTemplates", "(", "templates", ")", "{", "var", "result", "=", "[", "]", ";", "for", "(", "var", "_i", "=", "0", ",", "templates_1", "=", "templates", ";", "_i", "<", "templates_1", ".", "length", ";", "_i", "++", ")", "{", "var"...
Translates templates definitions to objects
[ "Translates", "templates", "definitions", "to", "objects" ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-helper.js#L76-L101
3,321
swimlane/ngx-datatable
release/utils/column-prop-getters.js
getterForProp
function getterForProp(prop) { if (prop == null) return emptyStringGetter; if (typeof prop === 'number') { return numericIndexGetter; } else { // deep or simple if (prop.indexOf('.') !== -1) { return deepValueGetter; } else { return...
javascript
function getterForProp(prop) { if (prop == null) return emptyStringGetter; if (typeof prop === 'number') { return numericIndexGetter; } else { // deep or simple if (prop.indexOf('.') !== -1) { return deepValueGetter; } else { return...
[ "function", "getterForProp", "(", "prop", ")", "{", "if", "(", "prop", "==", "null", ")", "return", "emptyStringGetter", ";", "if", "(", "typeof", "prop", "===", "'number'", ")", "{", "return", "numericIndexGetter", ";", "}", "else", "{", "// deep or simple"...
Returns the appropriate getter function for this kind of prop. If prop == null, returns the emptyStringGetter.
[ "Returns", "the", "appropriate", "getter", "function", "for", "this", "kind", "of", "prop", ".", "If", "prop", "==", "null", "returns", "the", "emptyStringGetter", "." ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-prop-getters.js#L16-L31
3,322
swimlane/ngx-datatable
release/utils/column-prop-getters.js
numericIndexGetter
function numericIndexGetter(row, index) { if (row == null) return ''; // mimic behavior of deepValueGetter if (!row || index == null) return row; var value = row[index]; if (value == null) return ''; return value; }
javascript
function numericIndexGetter(row, index) { if (row == null) return ''; // mimic behavior of deepValueGetter if (!row || index == null) return row; var value = row[index]; if (value == null) return ''; return value; }
[ "function", "numericIndexGetter", "(", "row", ",", "index", ")", "{", "if", "(", "row", "==", "null", ")", "return", "''", ";", "// mimic behavior of deepValueGetter", "if", "(", "!", "row", "||", "index", "==", "null", ")", "return", "row", ";", "var", ...
Returns the value at this numeric index. @param row array of values @param index numeric index @returns {any} or '' if invalid index
[ "Returns", "the", "value", "at", "this", "numeric", "index", "." ]
d7df15a070282a169524dba51d9572008b74804c
https://github.com/swimlane/ngx-datatable/blob/d7df15a070282a169524dba51d9572008b74804c/release/utils/column-prop-getters.js#L39-L49
3,323
aws/aws-sdk-js
lib/credentials/chainable_temporary_credentials.js
ChainableTemporaryCredentials
function ChainableTemporaryCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; this.expired = true; this.tokenCodeFn = null; var params = AWS.util.copy(options.params) || {}; if (params.RoleArn) { ...
javascript
function ChainableTemporaryCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.errorCode = 'ChainableTemporaryCredentialsProviderFailure'; this.expired = true; this.tokenCodeFn = null; var params = AWS.util.copy(options.params) || {}; if (params.RoleArn) { ...
[ "function", "ChainableTemporaryCredentials", "(", "options", ")", "{", "AWS", ".", "Credentials", ".", "call", "(", "this", ")", ";", "options", "=", "options", "||", "{", "}", ";", "this", ".", "errorCode", "=", "'ChainableTemporaryCredentialsProviderFailure'", ...
Creates a new temporary credentials object. @param options [map] a set of options @option options params [map] ({}) a map of options that are passed to the {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations. If a `RoleArn` parameter is passed in, credentials will be based on the IAM role. If a `SerialNumber`...
[ "Creates", "a", "new", "temporary", "credentials", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/chainable_temporary_credentials.js#L101-L126
3,324
aws/aws-sdk-js
features/extra/helpers.js
eventually
function eventually(callback, block, options) { if (!options) options = {}; if (!options.delay) options.delay = 0; if (!options.backoff) options.backoff = 500; if (!options.maxTime) options.maxTime = 5; var delay = options.delay; var started = this.AWS.util.date.getDate(); var self = this...
javascript
function eventually(callback, block, options) { if (!options) options = {}; if (!options.delay) options.delay = 0; if (!options.backoff) options.backoff = 500; if (!options.maxTime) options.maxTime = 5; var delay = options.delay; var started = this.AWS.util.date.getDate(); var self = this...
[ "function", "eventually", "(", "callback", ",", "block", ",", "options", ")", "{", "if", "(", "!", "options", ")", "options", "=", "{", "}", ";", "if", "(", "!", "options", ".", "delay", ")", "options", ".", "delay", "=", "0", ";", "if", "(", "!"...
Call this function with a block that will be executed multiple times to deal with eventually consistent conditions. this.When(/^I something is eventually consistent$/, function(callback) { this.eventually(callback, function(next) { doSomething(function(response) { if (response != notWhatIExpect) { next.fail(); } else ...
[ "Call", "this", "function", "with", "a", "block", "that", "will", "be", "executed", "multiple", "times", "to", "deal", "with", "eventually", "consistent", "conditions", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L33-L59
3,325
aws/aws-sdk-js
features/extra/helpers.js
request
function request(svc, operation, params, next, extra) { var world = this; if (!svc) svc = this.service; if (typeof svc === 'string') svc = this[svc]; svc[operation](params, function(err, data) { world.response = this; world.error = err; world.data = data; try { if (typ...
javascript
function request(svc, operation, params, next, extra) { var world = this; if (!svc) svc = this.service; if (typeof svc === 'string') svc = this[svc]; svc[operation](params, function(err, data) { world.response = this; world.error = err; world.data = data; try { if (typ...
[ "function", "request", "(", "svc", ",", "operation", ",", "params", ",", "next", ",", "extra", ")", "{", "var", "world", "=", "this", ";", "if", "(", "!", "svc", ")", "svc", "=", "this", ".", "service", ";", "if", "(", "typeof", "svc", "===", "'s...
A short-cut for calling a service operation and waiting for it to finish execution before moving onto the next step in the scenario.
[ "A", "short", "-", "cut", "for", "calling", "a", "service", "operation", "and", "waiting", "for", "it", "to", "finish", "execution", "before", "moving", "onto", "the", "next", "step", "in", "the", "scenario", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L65-L98
3,326
aws/aws-sdk-js
features/extra/helpers.js
unexpectedError
function unexpectedError(resp, next) { var svc = resp.request.service.api.serviceName; var op = resp.request.operation; var code = resp.error.code; var msg = resp.error.message; var err = 'Received unexpected error from ' + svc + '.' + op + ', ' + code + ': ' + msg; next.fail(new Error(err)); ...
javascript
function unexpectedError(resp, next) { var svc = resp.request.service.api.serviceName; var op = resp.request.operation; var code = resp.error.code; var msg = resp.error.message; var err = 'Received unexpected error from ' + svc + '.' + op + ', ' + code + ': ' + msg; next.fail(new Error(err)); ...
[ "function", "unexpectedError", "(", "resp", ",", "next", ")", "{", "var", "svc", "=", "resp", ".", "request", ".", "service", ".", "api", ".", "serviceName", ";", "var", "op", "=", "resp", ".", "request", ".", "operation", ";", "var", "code", "=", "r...
Given a response that contains an error, this fails the current step with a formatted error message that indicates which service and operation failed.
[ "Given", "a", "response", "that", "contains", "an", "error", "this", "fails", "the", "current", "step", "with", "a", "formatted", "error", "message", "that", "indicates", "which", "service", "and", "operation", "failed", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L105-L112
3,327
aws/aws-sdk-js
features/extra/helpers.js
function(bucket) { var fs = require('fs'); var path = require('path'); var filePath = path.resolve('integ.buckets.json'); var cache; if (fs.existsSync(filePath)) { try { cache = JSON.parse(fs.readFileSync(filePath)); cache.buckets.push(bucket); fs.writeFileSync(filePath...
javascript
function(bucket) { var fs = require('fs'); var path = require('path'); var filePath = path.resolve('integ.buckets.json'); var cache; if (fs.existsSync(filePath)) { try { cache = JSON.parse(fs.readFileSync(filePath)); cache.buckets.push(bucket); fs.writeFileSync(filePath...
[ "function", "(", "bucket", ")", "{", "var", "fs", "=", "require", "(", "'fs'", ")", ";", "var", "path", "=", "require", "(", "'path'", ")", ";", "var", "filePath", "=", "path", ".", "resolve", "(", "'integ.buckets.json'", ")", ";", "var", "cache", ";...
Cache bucket names used for cleanup after all features have run.
[ "Cache", "bucket", "names", "used", "for", "cleanup", "after", "all", "features", "have", "run", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L117-L135
3,328
aws/aws-sdk-js
features/extra/helpers.js
function(size, name) { var fs = require('fs'); var path = require('path'); name = this.uniqueName(name); // Cannot set this as a world property because the world // is cleaned up before the AfterFeatures hook is fired. var fixturePath = path.resolve('./features/extra/fixtures/tmp'); if (!fs....
javascript
function(size, name) { var fs = require('fs'); var path = require('path'); name = this.uniqueName(name); // Cannot set this as a world property because the world // is cleaned up before the AfterFeatures hook is fired. var fixturePath = path.resolve('./features/extra/fixtures/tmp'); if (!fs....
[ "function", "(", "size", ",", "name", ")", "{", "var", "fs", "=", "require", "(", "'fs'", ")", ";", "var", "path", "=", "require", "(", "'path'", ")", ";", "name", "=", "this", ".", "uniqueName", "(", "name", ")", ";", "// Cannot set this as a world pr...
Creates a fixture file of given size and returns the path.
[ "Creates", "a", "fixture", "file", "of", "given", "size", "and", "returns", "the", "path", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L140-L162
3,329
aws/aws-sdk-js
features/extra/helpers.js
function(size) { var match; var buffer; if (match = size.match(/(\d+)KB/)) { buffer = new Buffer(parseInt(match[1]) * 1024); } else if (match = size.match(/(\d+)MB/)) { buffer = new Buffer(parseInt(match[1]) * 1024 * 1024); } else { switch (size) { case 'empty': buffer = ne...
javascript
function(size) { var match; var buffer; if (match = size.match(/(\d+)KB/)) { buffer = new Buffer(parseInt(match[1]) * 1024); } else if (match = size.match(/(\d+)MB/)) { buffer = new Buffer(parseInt(match[1]) * 1024 * 1024); } else { switch (size) { case 'empty': buffer = ne...
[ "function", "(", "size", ")", "{", "var", "match", ";", "var", "buffer", ";", "if", "(", "match", "=", "size", ".", "match", "(", "/", "(\\d+)KB", "/", ")", ")", "{", "buffer", "=", "new", "Buffer", "(", "parseInt", "(", "match", "[", "1", "]", ...
Creates and returns a buffer of given size
[ "Creates", "and", "returns", "a", "buffer", "of", "given", "size" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/helpers.js#L167-L184
3,330
aws/aws-sdk-js
lib/event-stream/event-message-chunker.js
eventMessageChunker
function eventMessageChunker(buffer) { /** @type Buffer[] */ var messages = []; var offset = 0; while (offset < buffer.length) { var totalLength = buffer.readInt32BE(offset); // create new buffer for individual message (shares memory with original) var message = buffer.slice(of...
javascript
function eventMessageChunker(buffer) { /** @type Buffer[] */ var messages = []; var offset = 0; while (offset < buffer.length) { var totalLength = buffer.readInt32BE(offset); // create new buffer for individual message (shares memory with original) var message = buffer.slice(of...
[ "function", "eventMessageChunker", "(", "buffer", ")", "{", "/** @type Buffer[] */", "var", "messages", "=", "[", "]", ";", "var", "offset", "=", "0", ";", "while", "(", "offset", "<", "buffer", ".", "length", ")", "{", "var", "totalLength", "=", "buffer",...
Takes in a buffer of event messages and splits them into individual messages. @param {Buffer} buffer @api private
[ "Takes", "in", "a", "buffer", "of", "event", "messages", "and", "splits", "them", "into", "individual", "messages", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/event-stream/event-message-chunker.js#L6-L23
3,331
aws/aws-sdk-js
lib/credentials/shared_ini_file_credentials.js
SharedIniFileCredentials
function SharedIniFileCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.disableAssumeRole = Boolean(options.disableAssumeRole); this.preferStat...
javascript
function SharedIniFileCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.disableAssumeRole = Boolean(options.disableAssumeRole); this.preferStat...
[ "function", "SharedIniFileCredentials", "(", "options", ")", "{", "AWS", ".", "Credentials", ".", "call", "(", "this", ")", ";", "options", "=", "options", "||", "{", "}", ";", "this", ".", "filename", "=", "options", ".", "filename", ";", "this", ".", ...
Creates a new SharedIniFileCredentials object. @param options [map] a set of options @option options profile [String] (AWS_PROFILE env var or 'default') the name of the profile to load. @option options filename [String] ('~/.aws/credentials' or defined by AWS_SHARED_CREDENTIALS_FILE process env var) the filename to us...
[ "Creates", "a", "new", "SharedIniFileCredentials", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/shared_ini_file_credentials.js#L76-L88
3,332
aws/aws-sdk-js
lib/xml/escape-attribute.js
escapeAttribute
function escapeAttribute(value) { return value.replace(/&/g, '&amp;').replace(/'/g, '&apos;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); }
javascript
function escapeAttribute(value) { return value.replace(/&/g, '&amp;').replace(/'/g, '&apos;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); }
[ "function", "escapeAttribute", "(", "value", ")", "{", "return", "value", ".", "replace", "(", "/", "&", "/", "g", ",", "'&amp;'", ")", ".", "replace", "(", "/", "'", "/", "g", ",", "'&apos;'", ")", ".", "replace", "(", "/", "<", "/", "g", ",", ...
Escapes characters that can not be in an XML attribute.
[ "Escapes", "characters", "that", "can", "not", "be", "in", "an", "XML", "attribute", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/xml/escape-attribute.js#L4-L6
3,333
aws/aws-sdk-js
lib/credentials/cognito_identity_credentials.js
clearCache
function clearCache() { this._identityId = null; delete this.params.IdentityId; var poolId = this.params.IdentityPoolId; var loginId = this.params.LoginId || ''; delete this.storage[this.localStorageKey.id + poolId + loginId]; delete this.storage[this.localStorageKey.providers + poolId + loginI...
javascript
function clearCache() { this._identityId = null; delete this.params.IdentityId; var poolId = this.params.IdentityPoolId; var loginId = this.params.LoginId || ''; delete this.storage[this.localStorageKey.id + poolId + loginId]; delete this.storage[this.localStorageKey.providers + poolId + loginI...
[ "function", "clearCache", "(", ")", "{", "this", ".", "_identityId", "=", "null", ";", "delete", "this", ".", "params", ".", "IdentityId", ";", "var", "poolId", "=", "this", ".", "params", ".", "IdentityPoolId", ";", "var", "loginId", "=", "this", ".", ...
Clears the cached Cognito ID associated with the currently configured identity pool ID. Use this to manually invalidate your cache if the identity pool ID was deleted.
[ "Clears", "the", "cached", "Cognito", "ID", "associated", "with", "the", "currently", "configured", "identity", "pool", "ID", ".", "Use", "this", "to", "manually", "invalidate", "your", "cache", "if", "the", "identity", "pool", "ID", "was", "deleted", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/cognito_identity_credentials.js#L191-L199
3,334
aws/aws-sdk-js
lib/resource_waiter.js
loadWaiterConfig
function loadWaiterConfig(state) { if (!this.service.api.waiters[state]) { throw new AWS.util.error(new Error(), { code: 'StateNotFoundError', message: 'State ' + state + ' not found.' }); } this.config = AWS.util.copy(this.service.api.waiters[state]); }
javascript
function loadWaiterConfig(state) { if (!this.service.api.waiters[state]) { throw new AWS.util.error(new Error(), { code: 'StateNotFoundError', message: 'State ' + state + ' not found.' }); } this.config = AWS.util.copy(this.service.api.waiters[state]); }
[ "function", "loadWaiterConfig", "(", "state", ")", "{", "if", "(", "!", "this", ".", "service", ".", "api", ".", "waiters", "[", "state", "]", ")", "{", "throw", "new", "AWS", ".", "util", ".", "error", "(", "new", "Error", "(", ")", ",", "{", "c...
Loads waiter configuration from API configuration @api private
[ "Loads", "waiter", "configuration", "from", "API", "configuration" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/resource_waiter.js#L194-L203
3,335
aws/aws-sdk-js
lib/xml/xml-node.js
XmlNode
function XmlNode(name, children) { if (children === void 0) { children = []; } this.name = name; this.children = children; this.attributes = {}; }
javascript
function XmlNode(name, children) { if (children === void 0) { children = []; } this.name = name; this.children = children; this.attributes = {}; }
[ "function", "XmlNode", "(", "name", ",", "children", ")", "{", "if", "(", "children", "===", "void", "0", ")", "{", "children", "=", "[", "]", ";", "}", "this", ".", "name", "=", "name", ";", "this", ".", "children", "=", "children", ";", "this", ...
Represents an XML node. @api private
[ "Represents", "an", "XML", "node", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/xml/xml-node.js#L7-L12
3,336
aws/aws-sdk-js
lib/request.js
eachPage
function eachPage(callback) { // Make all callbacks async-ish callback = AWS.util.fn.makeAsync(callback, 3); function wrappedCallback(response) { callback.call(response, response.error, response.data, function (result) { if (result === false) return; if (response.hasNextPage()) { ...
javascript
function eachPage(callback) { // Make all callbacks async-ish callback = AWS.util.fn.makeAsync(callback, 3); function wrappedCallback(response) { callback.call(response, response.error, response.data, function (result) { if (result === false) return; if (response.hasNextPage()) { ...
[ "function", "eachPage", "(", "callback", ")", "{", "// Make all callbacks async-ish", "callback", "=", "AWS", ".", "util", ".", "fn", ".", "makeAsync", "(", "callback", ",", "3", ")", ";", "function", "wrappedCallback", "(", "response", ")", "{", "callback", ...
Iterates over each page of results given a pageable request, calling the provided callback with each page of data. After all pages have been retrieved, the callback is called with `null` data. @note This operation can generate multiple requests to a service. @example Iterating over multiple pages of objects in an S3 b...
[ "Iterates", "over", "each", "page", "of", "results", "given", "a", "pageable", "request", "calling", "the", "provided", "callback", "with", "each", "page", "of", "data", ".", "After", "all", "pages", "have", "been", "retrieved", "the", "callback", "is", "cal...
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/request.js#L489-L506
3,337
aws/aws-sdk-js
lib/request.js
eachItem
function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray...
javascript
function eachItem(callback) { var self = this; function wrappedCallback(err, data) { if (err) return callback(err, null); if (data === null) return callback(null, null); var config = self.service.paginationConfig(self.operation); var resultKey = config.resultKey; if (Array.isArray...
[ "function", "eachItem", "(", "callback", ")", "{", "var", "self", "=", "this", ";", "function", "wrappedCallback", "(", "err", ",", "data", ")", "{", "if", "(", "err", ")", "return", "callback", "(", "err", ",", "null", ")", ";", "if", "(", "data", ...
Enumerates over individual items of a request, paging the responses if necessary. @api experimental @since v1.4.0
[ "Enumerates", "over", "individual", "items", "of", "a", "request", "paging", "the", "responses", "if", "necessary", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/request.js#L515-L536
3,338
aws/aws-sdk-js
lib/publisher/index.js
Publisher
function Publisher(options) { // handle configuration options = options || {}; this.enabled = options.enabled || false; this.port = options.port || 31000; this.clientId = options.clientId || ''; if (this.clientId.length > 255) { // ClientId has a max length of 255 this.clientId =...
javascript
function Publisher(options) { // handle configuration options = options || {}; this.enabled = options.enabled || false; this.port = options.port || 31000; this.clientId = options.clientId || ''; if (this.clientId.length > 255) { // ClientId has a max length of 255 this.clientId =...
[ "function", "Publisher", "(", "options", ")", "{", "// handle configuration", "options", "=", "options", "||", "{", "}", ";", "this", ".", "enabled", "=", "options", ".", "enabled", "||", "false", ";", "this", ".", "port", "=", "options", ".", "port", "|...
8 KB Publishes metrics via udp. @param {object} options Paramters for Publisher constructor @param {number} [options.port = 31000] Port number @param {string} [options.clientId = ''] Client Identifier @param {boolean} [options.enabled = false] enable sending metrics datagram @api private
[ "8", "KB", "Publishes", "metrics", "via", "udp", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/index.js#L14-L26
3,339
aws/aws-sdk-js
lib/services/s3.js
removeVirtualHostedBucketFromPath
function removeVirtualHostedBucketFromPath(req) { var httpRequest = req.httpRequest; var bucket = httpRequest.virtualHostedBucket; if (bucket && httpRequest.path) { if (req.params && req.params.Key) { var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); if (httpRequest.path...
javascript
function removeVirtualHostedBucketFromPath(req) { var httpRequest = req.httpRequest; var bucket = httpRequest.virtualHostedBucket; if (bucket && httpRequest.path) { if (req.params && req.params.Key) { var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key); if (httpRequest.path...
[ "function", "removeVirtualHostedBucketFromPath", "(", "req", ")", "{", "var", "httpRequest", "=", "req", ".", "httpRequest", ";", "var", "bucket", "=", "httpRequest", ".", "virtualHostedBucket", ";", "if", "(", "bucket", "&&", "httpRequest", ".", "path", ")", ...
Takes the bucket name out of the path if bucket is virtual-hosted @api private
[ "Takes", "the", "bucket", "name", "out", "of", "the", "path", "if", "bucket", "is", "virtual", "-", "hosted" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L238-L254
3,340
aws/aws-sdk-js
lib/services/s3.js
addContentType
function addContentType(req) { var httpRequest = req.httpRequest; if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { // Content-Type is not set in GET/HEAD requests delete httpRequest.headers['Content-Type']; return; } if (!httpRequest.headers['Content-Type']) { // a...
javascript
function addContentType(req) { var httpRequest = req.httpRequest; if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') { // Content-Type is not set in GET/HEAD requests delete httpRequest.headers['Content-Type']; return; } if (!httpRequest.headers['Content-Type']) { // a...
[ "function", "addContentType", "(", "req", ")", "{", "var", "httpRequest", "=", "req", ".", "httpRequest", ";", "if", "(", "httpRequest", ".", "method", "===", "'GET'", "||", "httpRequest", ".", "method", "===", "'HEAD'", ")", "{", "// Content-Type is not set i...
Adds a default content type if none is supplied. @api private
[ "Adds", "a", "default", "content", "type", "if", "none", "is", "supplied", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L272-L298
3,341
aws/aws-sdk-js
lib/services/s3.js
computeContentMd5
function computeContentMd5(req) { if (req.service.willComputeChecksums(req)) { var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); req.httpRequest.headers['Content-MD5'] = md5; } }
javascript
function computeContentMd5(req) { if (req.service.willComputeChecksums(req)) { var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64'); req.httpRequest.headers['Content-MD5'] = md5; } }
[ "function", "computeContentMd5", "(", "req", ")", "{", "if", "(", "req", ".", "service", ".", "willComputeChecksums", "(", "req", ")", ")", "{", "var", "md5", "=", "AWS", ".", "util", ".", "crypto", ".", "md5", "(", "req", ".", "httpRequest", ".", "b...
A listener that computes the Content-MD5 and sets it in the header. @see AWS.S3.willComputeChecksums @api private
[ "A", "listener", "that", "computes", "the", "Content", "-", "MD5", "and", "sets", "it", "in", "the", "header", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L357-L362
3,342
aws/aws-sdk-js
lib/services/s3.js
dnsCompatibleBucketName
function dnsCompatibleBucketName(bucketName) { var b = bucketName; var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); var ipAddress = new RegExp(/(\d+\.){3}\d+/); var dots = new RegExp(/\.\./); return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; }
javascript
function dnsCompatibleBucketName(bucketName) { var b = bucketName; var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/); var ipAddress = new RegExp(/(\d+\.){3}\d+/); var dots = new RegExp(/\.\./); return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false; }
[ "function", "dnsCompatibleBucketName", "(", "bucketName", ")", "{", "var", "b", "=", "bucketName", ";", "var", "domain", "=", "new", "RegExp", "(", "/", "^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$", "/", ")", ";", "var", "ipAddress", "=", "new", "RegExp", "(", "/"...
Returns true if the bucket name is DNS compatible. Buckets created outside of the classic region MUST be DNS compatible. @api private
[ "Returns", "true", "if", "the", "bucket", "name", "is", "DNS", "compatible", ".", "Buckets", "created", "outside", "of", "the", "classic", "region", "MUST", "be", "DNS", "compatible", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L405-L411
3,343
aws/aws-sdk-js
lib/services/s3.js
updateReqBucketRegion
function updateReqBucketRegion(request, region) { var httpRequest = request.httpRequest; if (typeof region === 'string' && region.length) { httpRequest.region = region; } if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { return; } var service = request.s...
javascript
function updateReqBucketRegion(request, region) { var httpRequest = request.httpRequest; if (typeof region === 'string' && region.length) { httpRequest.region = region; } if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) { return; } var service = request.s...
[ "function", "updateReqBucketRegion", "(", "request", ",", "region", ")", "{", "var", "httpRequest", "=", "request", ".", "httpRequest", ";", "if", "(", "typeof", "region", "===", "'string'", "&&", "region", ".", "length", ")", "{", "httpRequest", ".", "regio...
Updates httpRequest with region. If region is not provided, then the httpRequest will be updated based on httpRequest.region @api private
[ "Updates", "httpRequest", "with", "region", ".", "If", "region", "is", "not", "provided", "then", "the", "httpRequest", "will", "be", "updated", "based", "on", "httpRequest", ".", "region" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L461-L488
3,344
aws/aws-sdk-js
lib/services/s3.js
extractError
function extractError(resp) { var codes = { 304: 'NotModified', 403: 'Forbidden', 400: 'BadRequest', 404: 'NotFound' }; var req = resp.request; var code = resp.httpResponse.statusCode; var body = resp.httpResponse.body || ''; var headers = resp.httpResponse.headers || {...
javascript
function extractError(resp) { var codes = { 304: 'NotModified', 403: 'Forbidden', 400: 'BadRequest', 404: 'NotFound' }; var req = resp.request; var code = resp.httpResponse.statusCode; var body = resp.httpResponse.body || ''; var headers = resp.httpResponse.headers || {...
[ "function", "extractError", "(", "resp", ")", "{", "var", "codes", "=", "{", "304", ":", "'NotModified'", ",", "403", ":", "'Forbidden'", ",", "400", ":", "'BadRequest'", ",", "404", ":", "'NotFound'", "}", ";", "var", "req", "=", "resp", ".", "request...
Extracts an error object from the http response. @api private
[ "Extracts", "an", "error", "object", "from", "the", "http", "response", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L537-L592
3,345
aws/aws-sdk-js
lib/services/s3.js
requestBucketRegion
function requestBucketRegion(resp, done) { var error = resp.error; var req = resp.request; var bucket = req.params.Bucket || null; if (!error || !bucket || error.region || req.operation === 'listObjects' || (AWS.util.isNode() && req.operation === 'headBucket') || (error.statusCode === 4...
javascript
function requestBucketRegion(resp, done) { var error = resp.error; var req = resp.request; var bucket = req.params.Bucket || null; if (!error || !bucket || error.region || req.operation === 'listObjects' || (AWS.util.isNode() && req.operation === 'headBucket') || (error.statusCode === 4...
[ "function", "requestBucketRegion", "(", "resp", ",", "done", ")", "{", "var", "error", "=", "resp", ".", "error", ";", "var", "req", "=", "resp", ".", "request", ";", "var", "bucket", "=", "req", ".", "params", ".", "Bucket", "||", "null", ";", "if",...
If region was not obtained synchronously, then send async request to get bucket region for errors resulting from wrong region. @api private
[ "If", "region", "was", "not", "obtained", "synchronously", "then", "send", "async", "request", "to", "get", "bucket", "region", "for", "errors", "resulting", "from", "wrong", "region", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L600-L621
3,346
aws/aws-sdk-js
lib/services/s3.js
reqRegionForNetworkingError
function reqRegionForNetworkingError(resp, done) { if (!AWS.util.isBrowser()) { return done(); } var error = resp.error; var request = resp.request; var bucket = request.params.Bucket; if (!error || error.code !== 'NetworkingError' || !bucket || request.httpRequest.region === 'us-e...
javascript
function reqRegionForNetworkingError(resp, done) { if (!AWS.util.isBrowser()) { return done(); } var error = resp.error; var request = resp.request; var bucket = request.params.Bucket; if (!error || error.code !== 'NetworkingError' || !bucket || request.httpRequest.region === 'us-e...
[ "function", "reqRegionForNetworkingError", "(", "resp", ",", "done", ")", "{", "if", "(", "!", "AWS", ".", "util", ".", "isBrowser", "(", ")", ")", "{", "return", "done", "(", ")", ";", "}", "var", "error", "=", "resp", ".", "error", ";", "var", "r...
For browser only. If NetworkingError received, will attempt to obtain the bucket region. @api private
[ "For", "browser", "only", ".", "If", "NetworkingError", "received", "will", "attempt", "to", "obtain", "the", "bucket", "region", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L629-L671
3,347
aws/aws-sdk-js
lib/services/s3.js
function(buckets) { var bucketRegionCache = this.bucketRegionCache; if (!buckets) { buckets = Object.keys(bucketRegionCache); } else if (typeof buckets === 'string') { buckets = [buckets]; } for (var i = 0; i < buckets.length; i++) { delete bucketRegionCache[buckets[i]]; } ...
javascript
function(buckets) { var bucketRegionCache = this.bucketRegionCache; if (!buckets) { buckets = Object.keys(bucketRegionCache); } else if (typeof buckets === 'string') { buckets = [buckets]; } for (var i = 0; i < buckets.length; i++) { delete bucketRegionCache[buckets[i]]; } ...
[ "function", "(", "buckets", ")", "{", "var", "bucketRegionCache", "=", "this", ".", "bucketRegionCache", ";", "if", "(", "!", "buckets", ")", "{", "buckets", "=", "Object", ".", "keys", "(", "bucketRegionCache", ")", ";", "}", "else", "if", "(", "typeof"...
Clears bucket region cache. @api private
[ "Clears", "bucket", "region", "cache", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L685-L696
3,348
aws/aws-sdk-js
lib/services/s3.js
correctBucketRegionFromCache
function correctBucketRegionFromCache(req) { var bucket = req.params.Bucket || null; if (bucket) { var service = req.service; var requestRegion = req.httpRequest.region; var cachedRegion = service.bucketRegionCache[bucket]; if (cachedRegion && cachedRegion !== requestRegion) { se...
javascript
function correctBucketRegionFromCache(req) { var bucket = req.params.Bucket || null; if (bucket) { var service = req.service; var requestRegion = req.httpRequest.region; var cachedRegion = service.bucketRegionCache[bucket]; if (cachedRegion && cachedRegion !== requestRegion) { se...
[ "function", "correctBucketRegionFromCache", "(", "req", ")", "{", "var", "bucket", "=", "req", ".", "params", ".", "Bucket", "||", "null", ";", "if", "(", "bucket", ")", "{", "var", "service", "=", "req", ".", "service", ";", "var", "requestRegion", "=",...
Corrects request region if bucket's cached region is different @api private
[ "Corrects", "request", "region", "if", "bucket", "s", "cached", "region", "is", "different" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L703-L713
3,349
aws/aws-sdk-js
lib/services/s3.js
extractRequestIds
function extractRequestIds(resp) { var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; resp.extendedRequestId = extendedRequestId; resp.cfId = cfId; if (resp.error...
javascript
function extractRequestIds(resp) { var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null; var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null; resp.extendedRequestId = extendedRequestId; resp.cfId = cfId; if (resp.error...
[ "function", "extractRequestIds", "(", "resp", ")", "{", "var", "extendedRequestId", "=", "resp", ".", "httpResponse", ".", "headers", "?", "resp", ".", "httpResponse", ".", "headers", "[", "'x-amz-id-2'", "]", ":", "null", ";", "var", "cfId", "=", "resp", ...
Extracts S3 specific request ids from the http response. @api private
[ "Extracts", "S3", "specific", "request", "ids", "from", "the", "http", "response", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L720-L731
3,350
aws/aws-sdk-js
lib/services/s3.js
getSignedUrl
function getSignedUrl(operation, params, callback) { params = AWS.util.copy(params || {}); var expires = params.Expires || 900; delete params.Expires; // we can't validate this var request = this.makeRequest(operation, params); if (callback) { AWS.util.defer(function() { request.presi...
javascript
function getSignedUrl(operation, params, callback) { params = AWS.util.copy(params || {}); var expires = params.Expires || 900; delete params.Expires; // we can't validate this var request = this.makeRequest(operation, params); if (callback) { AWS.util.defer(function() { request.presi...
[ "function", "getSignedUrl", "(", "operation", ",", "params", ",", "callback", ")", "{", "params", "=", "AWS", ".", "util", ".", "copy", "(", "params", "||", "{", "}", ")", ";", "var", "expires", "=", "params", ".", "Expires", "||", "900", ";", "delet...
Get a pre-signed URL for a given operation name. @note You must ensure that you have static or previously resolved credentials if you call this method synchronously (with no callback), otherwise it may not properly sign the request. If you cannot guarantee this (you are using an asynchronous credential provider, i.e.,...
[ "Get", "a", "pre", "-", "signed", "URL", "for", "a", "given", "operation", "name", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L785-L798
3,351
aws/aws-sdk-js
lib/services/s3.js
createPresignedPost
function createPresignedPost(params, callback) { if (typeof params === 'function' && callback === undefined) { callback = params; params = null; } params = AWS.util.copy(params || {}); var boundParams = this.config.params || {}; var bucket = params.Bucket || boundParams.Bucket, se...
javascript
function createPresignedPost(params, callback) { if (typeof params === 'function' && callback === undefined) { callback = params; params = null; } params = AWS.util.copy(params || {}); var boundParams = this.config.params || {}; var bucket = params.Bucket || boundParams.Bucket, se...
[ "function", "createPresignedPost", "(", "params", ",", "callback", ")", "{", "if", "(", "typeof", "params", "===", "'function'", "&&", "callback", "===", "undefined", ")", "{", "callback", "=", "params", ";", "params", "=", "null", ";", "}", "params", "=",...
Get a pre-signed POST policy to support uploading to S3 directly from an HTML form. @param params [map] @option params Bucket [String] The bucket to which the post should be uploaded @option params Expires [Integer] (3600) The number of seconds for which the presigned policy should be valid. @option params Condi...
[ "Get", "a", "pre", "-", "signed", "POST", "policy", "to", "support", "uploading", "to", "S3", "directly", "from", "an", "HTML", "form", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/services/s3.js#L881-L922
3,352
aws/aws-sdk-js
lib/dynamodb/converter.js
convertInput
function convertInput(data, options) { options = options || {}; var type = typeOf(data); if (type === 'Object') { return formatMap(data, options); } else if (type === 'Array') { return formatList(data, options); } else if (type === 'Set') { return formatSet(data, options); } el...
javascript
function convertInput(data, options) { options = options || {}; var type = typeOf(data); if (type === 'Object') { return formatMap(data, options); } else if (type === 'Array') { return formatList(data, options); } else if (type === 'Set') { return formatSet(data, options); } el...
[ "function", "convertInput", "(", "data", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "type", "=", "typeOf", "(", "data", ")", ";", "if", "(", "type", "===", "'Object'", ")", "{", "return", "formatMap", "(", "data"...
Convert a JavaScript value to its equivalent DynamoDB AttributeValue type @param data [any] The data to convert to a DynamoDB AttributeValue @param options [map] @option options convertEmptyValues [Boolean] Whether to automatically convert empty strings, blobs, and sets to `null` @option options wrapNumbers [Boolean] ...
[ "Convert", "a", "JavaScript", "value", "to", "its", "equivalent", "DynamoDB", "AttributeValue", "type" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L27-L56
3,353
aws/aws-sdk-js
lib/dynamodb/converter.js
marshallItem
function marshallItem(data, options) { return AWS.DynamoDB.Converter.input(data, options).M; }
javascript
function marshallItem(data, options) { return AWS.DynamoDB.Converter.input(data, options).M; }
[ "function", "marshallItem", "(", "data", ",", "options", ")", "{", "return", "AWS", ".", "DynamoDB", ".", "Converter", ".", "input", "(", "data", ",", "options", ")", ".", "M", ";", "}" ]
Convert a JavaScript object into a DynamoDB record. @param data [any] The data to convert to a DynamoDB record @param options [map] @option options convertEmptyValues [Boolean] Whether to automatically convert empty strings, blobs, and sets to `null` @option options wrapNumbers [Boolean] Whether to return numbers as ...
[ "Convert", "a", "JavaScript", "object", "into", "a", "DynamoDB", "record", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L90-L92
3,354
aws/aws-sdk-js
lib/dynamodb/converter.js
convertOutput
function convertOutput(data, options) { options = options || {}; var list, map, i; for (var type in data) { var values = data[type]; if (type === 'M') { map = {}; for (var key in values) { map[key] = convertOutput(values[key], options); } return map; ...
javascript
function convertOutput(data, options) { options = options || {}; var list, map, i; for (var type in data) { var values = data[type]; if (type === 'M') { map = {}; for (var key in values) { map[key] = convertOutput(values[key], options); } return map; ...
[ "function", "convertOutput", "(", "data", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "var", "list", ",", "map", ",", "i", ";", "for", "(", "var", "type", "in", "data", ")", "{", "var", "values", "=", "data", "[", "t...
Convert a DynamoDB AttributeValue object to its equivalent JavaScript type. @param data [map] An object in the Amazon DynamoDB AttributeValue format @param options [map] @option options convertEmptyValues [Boolean] Whether to automatically convert empty strings, blobs, and sets to `null` @option options wrapNumbers [B...
[ "Convert", "a", "DynamoDB", "AttributeValue", "object", "to", "its", "equivalent", "JavaScript", "type", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L114-L161
3,355
aws/aws-sdk-js
lib/dynamodb/converter.js
unmarshall
function unmarshall(data, options) { return AWS.DynamoDB.Converter.output({M: data}, options); }
javascript
function unmarshall(data, options) { return AWS.DynamoDB.Converter.output({M: data}, options); }
[ "function", "unmarshall", "(", "data", ",", "options", ")", "{", "return", "AWS", ".", "DynamoDB", ".", "Converter", ".", "output", "(", "{", "M", ":", "data", "}", ",", "options", ")", ";", "}" ]
Convert a DynamoDB record into a JavaScript object. @param data [any] The DynamoDB record @param options [map] @option options convertEmptyValues [Boolean] Whether to automatically convert empty strings, blobs, and sets to `null` @option options wrapNumbers [Boolean] Whether to return numbers as a NumberValue object ...
[ "Convert", "a", "DynamoDB", "record", "into", "a", "JavaScript", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/converter.js#L200-L202
3,356
aws/aws-sdk-js
lib/protocol/helpers.js
populateHostPrefix
function populateHostPrefix(request) { var enabled = request.service.config.hostPrefixEnabled; if (!enabled) return request; var operationModel = request.service.api.operations[request.operation]; //don't marshal host prefix when operation has endpoint discovery traits if (hasEndpointDiscover(request)) retur...
javascript
function populateHostPrefix(request) { var enabled = request.service.config.hostPrefixEnabled; if (!enabled) return request; var operationModel = request.service.api.operations[request.operation]; //don't marshal host prefix when operation has endpoint discovery traits if (hasEndpointDiscover(request)) retur...
[ "function", "populateHostPrefix", "(", "request", ")", "{", "var", "enabled", "=", "request", ".", "service", ".", "config", ".", "hostPrefixEnabled", ";", "if", "(", "!", "enabled", ")", "return", "request", ";", "var", "operationModel", "=", "request", "."...
Prepend prefix defined by API model to endpoint that's already constructed. This feature does not apply to operations using endpoint discovery and can be disabled. @api private
[ "Prepend", "prefix", "defined", "by", "API", "model", "to", "endpoint", "that", "s", "already", "constructed", ".", "This", "feature", "does", "not", "apply", "to", "operations", "using", "endpoint", "discovery", "and", "can", "be", "disabled", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/protocol/helpers.js#L10-L23
3,357
aws/aws-sdk-js
lib/config.js
loadFromPath
function loadFromPath(path) { this.clear(); var options = JSON.parse(AWS.util.readFileSync(path)); var fileSystemCreds = new AWS.FileSystemCredentials(path); var chain = new AWS.CredentialProviderChain(); chain.providers.unshift(fileSystemCreds); chain.resolve(function (err, creds) { if (...
javascript
function loadFromPath(path) { this.clear(); var options = JSON.parse(AWS.util.readFileSync(path)); var fileSystemCreds = new AWS.FileSystemCredentials(path); var chain = new AWS.CredentialProviderChain(); chain.providers.unshift(fileSystemCreds); chain.resolve(function (err, creds) { if (...
[ "function", "loadFromPath", "(", "path", ")", "{", "this", ".", "clear", "(", ")", ";", "var", "options", "=", "JSON", ".", "parse", "(", "AWS", ".", "util", ".", "readFileSync", "(", "path", ")", ")", ";", "var", "fileSystemCreds", "=", "new", "AWS"...
Loads configuration data from a JSON file into this config object. @note Loading configuration will reset all existing configuration on the object. @!macro nobrowser @param path [String] the path relative to your process's current working directory to load configuration from. @return [AWS.Config] the same configuration...
[ "Loads", "configuration", "data", "from", "a", "JSON", "file", "into", "this", "config", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/config.js#L434-L449
3,358
aws/aws-sdk-js
lib/config.js
extractCredentials
function extractCredentials(options) { if (options.accessKeyId && options.secretAccessKey) { options = AWS.util.copy(options); options.credentials = new AWS.Credentials(options); } return options; }
javascript
function extractCredentials(options) { if (options.accessKeyId && options.secretAccessKey) { options = AWS.util.copy(options); options.credentials = new AWS.Credentials(options); } return options; }
[ "function", "extractCredentials", "(", "options", ")", "{", "if", "(", "options", ".", "accessKeyId", "&&", "options", ".", "secretAccessKey", ")", "{", "options", "=", "AWS", ".", "util", ".", "copy", "(", "options", ")", ";", "options", ".", "credentials...
Extracts accessKeyId, secretAccessKey and sessionToken from a configuration hash. @api private
[ "Extracts", "accessKeyId", "secretAccessKey", "and", "sessionToken", "from", "a", "configuration", "hash", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/config.js#L536-L542
3,359
aws/aws-sdk-js
lib/config.js
setPromisesDependency
function setPromisesDependency(dep) { PromisesDependency = dep; // if null was passed in, we should try to use native promises if (dep === null && typeof Promise === 'function') { PromisesDependency = Promise; } var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; ...
javascript
function setPromisesDependency(dep) { PromisesDependency = dep; // if null was passed in, we should try to use native promises if (dep === null && typeof Promise === 'function') { PromisesDependency = Promise; } var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain]; ...
[ "function", "setPromisesDependency", "(", "dep", ")", "{", "PromisesDependency", "=", "dep", ";", "// if null was passed in, we should try to use native promises", "if", "(", "dep", "===", "null", "&&", "typeof", "Promise", "===", "'function'", ")", "{", "PromisesDepend...
Sets the promise dependency the SDK will use wherever Promises are returned. Passing `null` will force the SDK to use native Promises if they are available. If native Promises are not available, passing `null` will have no effect. @param [Constructor] dep A reference to a Promise constructor
[ "Sets", "the", "promise", "dependency", "the", "SDK", "will", "use", "wherever", "Promises", "are", "returned", ".", "Passing", "null", "will", "force", "the", "SDK", "to", "use", "native", "Promises", "if", "they", "are", "available", ".", "If", "native", ...
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/config.js#L550-L559
3,360
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js
function() { $('div[id] > :header:first').each(function() { $('<a class="headerlink">\u00B6</a>'). attr('href', '#' + this.id). attr('title', _('Permalink to this headline')). appendTo(this); }); $('dt[id]').each(function() { $('<a class="headerlink">\u00B6</a>'). attr('h...
javascript
function() { $('div[id] > :header:first').each(function() { $('<a class="headerlink">\u00B6</a>'). attr('href', '#' + this.id). attr('title', _('Permalink to this headline')). appendTo(this); }); $('dt[id]').each(function() { $('<a class="headerlink">\u00B6</a>'). attr('h...
[ "function", "(", ")", "{", "$", "(", "'div[id] > :header:first'", ")", ".", "each", "(", "function", "(", ")", "{", "$", "(", "'<a class=\"headerlink\">\\u00B6</a>'", ")", ".", "attr", "(", "'href'", ",", "'#'", "+", "this", ".", "id", ")", ".", "attr", ...
add context elements like header anchor links
[ "add", "context", "elements", "like", "header", "anchor", "links" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L150-L163
3,361
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js
function() { if (document.location.hash && $.browser.mozilla) window.setTimeout(function() { document.location.href += ''; }, 10); }
javascript
function() { if (document.location.hash && $.browser.mozilla) window.setTimeout(function() { document.location.href += ''; }, 10); }
[ "function", "(", ")", "{", "if", "(", "document", ".", "location", ".", "hash", "&&", "$", ".", "browser", ".", "mozilla", ")", "window", ".", "setTimeout", "(", "function", "(", ")", "{", "document", ".", "location", ".", "href", "+=", "''", ";", ...
workaround a firefox stupidity
[ "workaround", "a", "firefox", "stupidity" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L168-L173
3,362
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js
function() { var togglers = $('img.toggler').click(function() { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); if (src.substr(-9) == 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else ...
javascript
function() { var togglers = $('img.toggler').click(function() { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); if (src.substr(-9) == 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else ...
[ "function", "(", ")", "{", "var", "togglers", "=", "$", "(", "'img.toggler'", ")", ".", "click", "(", "function", "(", ")", "{", "var", "src", "=", "$", "(", "this", ")", ".", "attr", "(", "'src'", ")", ";", "var", "idnum", "=", "$", "(", "this...
init the domain index toggle buttons
[ "init", "the", "domain", "index", "toggle", "buttons" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L197-L210
3,363
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js
function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }
javascript
function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }
[ "function", "(", ")", "{", "var", "path", "=", "document", ".", "location", ".", "pathname", ";", "var", "parts", "=", "path", ".", "split", "(", "/", "\\/", "/", ")", ";", "$", ".", "each", "(", "DOCUMENTATION_OPTIONS", ".", "URL_ROOT", ".", "split"...
get the current relative url
[ "get", "the", "current", "relative", "url" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/doctools.js#L230-L239
3,364
aws/aws-sdk-js
lib/service.js
Service
function Service(config) { if (!this.loadServiceClass) { throw AWS.util.error(new Error(), 'Service must be constructed with `new\' operator'); } var ServiceClass = this.loadServiceClass(config || {}); if (ServiceClass) { var originalConfig = AWS.util.copy(config); var svc = ne...
javascript
function Service(config) { if (!this.loadServiceClass) { throw AWS.util.error(new Error(), 'Service must be constructed with `new\' operator'); } var ServiceClass = this.loadServiceClass(config || {}); if (ServiceClass) { var originalConfig = AWS.util.copy(config); var svc = ne...
[ "function", "Service", "(", "config", ")", "{", "if", "(", "!", "this", ".", "loadServiceClass", ")", "{", "throw", "AWS", ".", "util", ".", "error", "(", "new", "Error", "(", ")", ",", "'Service must be constructed with `new\\' operator'", ")", ";", "}", ...
Create a new service object with a configuration object @param config [map] a map of configuration options
[ "Create", "a", "new", "service", "object", "with", "a", "configuration", "object" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L23-L41
3,365
aws/aws-sdk-js
lib/service.js
makeRequest
function makeRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = null; } params = params || {}; if (this.config.params) { // copy only toplevel bound params var rules = this.api.operations[operation]; if (rules) { params...
javascript
function makeRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = null; } params = params || {}; if (this.config.params) { // copy only toplevel bound params var rules = this.api.operations[operation]; if (rules) { params...
[ "function", "makeRequest", "(", "operation", ",", "params", ",", "callback", ")", "{", "if", "(", "typeof", "params", "===", "'function'", ")", "{", "callback", "=", "params", ";", "params", "=", "null", ";", "}", "params", "=", "params", "||", "{", "}...
Calls an operation on a service with the given input parameters. @param operation [String] the name of the operation to call on the service. @param params [map] a map of input options for the operation @callback callback function(err, data) If a callback is supplied, it is called when a response is returned from the s...
[ "Calls", "an", "operation", "on", "a", "service", "with", "the", "given", "input", "parameters", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L181-L207
3,366
aws/aws-sdk-js
lib/service.js
makeUnauthenticatedRequest
function makeUnauthenticatedRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = {}; } var request = this.makeRequest(operation, params).toUnauthenticated(); return callback ? request.send(callback) : request; }
javascript
function makeUnauthenticatedRequest(operation, params, callback) { if (typeof params === 'function') { callback = params; params = {}; } var request = this.makeRequest(operation, params).toUnauthenticated(); return callback ? request.send(callback) : request; }
[ "function", "makeUnauthenticatedRequest", "(", "operation", ",", "params", ",", "callback", ")", "{", "if", "(", "typeof", "params", "===", "'function'", ")", "{", "callback", "=", "params", ";", "params", "=", "{", "}", ";", "}", "var", "request", "=", ...
Calls an operation on a service with the given input parameters, without any authentication data. This method is useful for "public" API operations. @param operation [String] the name of the operation to call on the service. @param params [map] a map of input options for the operation @callback callback function(err, ...
[ "Calls", "an", "operation", "on", "a", "service", "with", "the", "given", "input", "parameters", "without", "any", "authentication", "data", ".", "This", "method", "is", "useful", "for", "public", "API", "operations", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L223-L231
3,367
aws/aws-sdk-js
lib/service.js
waitFor
function waitFor(state, params, callback) { var waiter = new AWS.ResourceWaiter(this, state); return waiter.wait(params, callback); }
javascript
function waitFor(state, params, callback) { var waiter = new AWS.ResourceWaiter(this, state); return waiter.wait(params, callback); }
[ "function", "waitFor", "(", "state", ",", "params", ",", "callback", ")", "{", "var", "waiter", "=", "new", "AWS", ".", "ResourceWaiter", "(", "this", ",", "state", ")", ";", "return", "waiter", ".", "wait", "(", "params", ",", "callback", ")", ";", ...
Waits for a given state @param state [String] the state on the service to wait for @param params [map] a map of parameters to pass with each request @option params $waiter [map] a map of configuration options for the waiter @option params $waiter.delay [Number] The number of seconds to wait between requests @option pa...
[ "Waits", "for", "a", "given", "state" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L251-L254
3,368
aws/aws-sdk-js
lib/service.js
apiCallEvent
function apiCallEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCall', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Region: request....
javascript
function apiCallEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCall', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Region: request....
[ "function", "apiCallEvent", "(", "request", ")", "{", "var", "api", "=", "request", ".", "service", ".", "api", ".", "operations", "[", "request", ".", "operation", "]", ";", "var", "monitoringEvent", "=", "{", "Type", ":", "'ApiCall'", ",", "Api", ":", ...
Event recording metrics for a whole API call. @returns {object} a subset of api call metrics @api private
[ "Event", "recording", "metrics", "for", "a", "whole", "API", "call", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L292-L319
3,369
aws/aws-sdk-js
lib/service.js
apiAttemptEvent
function apiAttemptEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCallAttempt', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Fqdn: ...
javascript
function apiAttemptEvent(request) { var api = request.service.api.operations[request.operation]; var monitoringEvent = { Type: 'ApiCallAttempt', Api: api ? api.name : request.operation, Version: 1, Service: request.service.api.serviceId || request.service.api.endpointPrefix, Fqdn: ...
[ "function", "apiAttemptEvent", "(", "request", ")", "{", "var", "api", "=", "request", ".", "service", ".", "api", ".", "operations", "[", "request", ".", "operation", "]", ";", "var", "monitoringEvent", "=", "{", "Type", ":", "'ApiCallAttempt'", ",", "Api...
Event recording metrics for an API call attempt. @returns {object} a subset of api call attempt metrics @api private
[ "Event", "recording", "metrics", "for", "an", "API", "call", "attempt", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L326-L361
3,370
aws/aws-sdk-js
lib/service.js
attemptFailEvent
function attemptFailEvent(request) { var monitoringEvent = this.apiAttemptEvent(request); var response = request.response; var error = response.error; if (response.httpResponse.statusCode > 299 ) { if (error.code) monitoringEvent.AwsException = error.code; if (error.message) monitoringEvent....
javascript
function attemptFailEvent(request) { var monitoringEvent = this.apiAttemptEvent(request); var response = request.response; var error = response.error; if (response.httpResponse.statusCode > 299 ) { if (error.code) monitoringEvent.AwsException = error.code; if (error.message) monitoringEvent....
[ "function", "attemptFailEvent", "(", "request", ")", "{", "var", "monitoringEvent", "=", "this", ".", "apiAttemptEvent", "(", "request", ")", ";", "var", "response", "=", "request", ".", "response", ";", "var", "error", "=", "response", ".", "error", ";", ...
Add metrics of failed request. @api private
[ "Add", "metrics", "of", "failed", "request", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L367-L379
3,371
aws/aws-sdk-js
lib/service.js
attachMonitoringEmitter
function attachMonitoringEmitter(request) { var attemptTimestamp; //timestamp marking the beginning of a request attempt var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency var attemptLatency; //latency from request sent out to http response reaching SDK var cal...
javascript
function attachMonitoringEmitter(request) { var attemptTimestamp; //timestamp marking the beginning of a request attempt var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency var attemptLatency; //latency from request sent out to http response reaching SDK var cal...
[ "function", "attachMonitoringEmitter", "(", "request", ")", "{", "var", "attemptTimestamp", ";", "//timestamp marking the beginning of a request attempt", "var", "attemptStartRealTime", ";", "//Start time of request attempt. Used to calculating attemptLatency", "var", "attemptLatency",...
Attach listeners to request object to fetch metrics of each request and emit data object through \'ApiCall\' and \'ApiCallAttempt\' events. @api private
[ "Attach", "listeners", "to", "request", "object", "to", "fetch", "metrics", "of", "each", "request", "and", "emit", "data", "object", "through", "\\", "ApiCall", "\\", "and", "\\", "ApiCallAttempt", "\\", "events", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L386-L444
3,372
aws/aws-sdk-js
lib/service.js
getSignerClass
function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.au...
javascript
function getSignerClass(request) { var version; // get operation authtype if present var operation = null; var authtype = ''; if (request) { var operations = request.service.api.operations || {}; operation = operations[request.operation] || null; authtype = operation ? operation.au...
[ "function", "getSignerClass", "(", "request", ")", "{", "var", "version", ";", "// get operation authtype if present", "var", "operation", "=", "null", ";", "var", "authtype", "=", "''", ";", "if", "(", "request", ")", "{", "var", "operations", "=", "request",...
Gets the signer class for a given request @api private
[ "Gets", "the", "signer", "class", "for", "a", "given", "request" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L459-L477
3,373
aws/aws-sdk-js
lib/service.js
defineMethods
function defineMethods(svc) { AWS.util.each(svc.prototype.api.operations, function iterator(method) { if (svc.prototype[method]) return; var operation = svc.prototype.api.operations[method]; if (operation.authtype === 'none') { svc.prototype[method] = function (params, callback) { ...
javascript
function defineMethods(svc) { AWS.util.each(svc.prototype.api.operations, function iterator(method) { if (svc.prototype[method]) return; var operation = svc.prototype.api.operations[method]; if (operation.authtype === 'none') { svc.prototype[method] = function (params, callback) { ...
[ "function", "defineMethods", "(", "svc", ")", "{", "AWS", ".", "util", ".", "each", "(", "svc", ".", "prototype", ".", "api", ".", "operations", ",", "function", "iterator", "(", "method", ")", "{", "if", "(", "svc", ".", "prototype", "[", "method", ...
Adds one method for each operation described in the api configuration @api private
[ "Adds", "one", "method", "for", "each", "operation", "described", "in", "the", "api", "configuration" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/service.js#L663-L677
3,374
aws/aws-sdk-js
lib/response.js
nextPage
function nextPage(callback) { var config; var service = this.request.service; var operation = this.request.operation; try { config = service.paginationConfig(operation, true); } catch (e) { this.error = e; } if (!this.hasNextPage()) { if (callback) callback(this.error, null); ...
javascript
function nextPage(callback) { var config; var service = this.request.service; var operation = this.request.operation; try { config = service.paginationConfig(operation, true); } catch (e) { this.error = e; } if (!this.hasNextPage()) { if (callback) callback(this.error, null); ...
[ "function", "nextPage", "(", "callback", ")", "{", "var", "config", ";", "var", "service", "=", "this", ".", "request", ".", "service", ";", "var", "operation", "=", "this", ".", "request", ".", "operation", ";", "try", "{", "config", "=", "service", "...
Creates a new request for the next page of response data, calling the callback with the page data if a callback is provided. @callback callback function(err, data) Called when a page of data is returned from the next request. @param err [Error] an error object, if an error occurred in the request @param data [Object]...
[ "Creates", "a", "new", "request", "for", "the", "next", "page", "of", "response", "data", "calling", "the", "callback", "with", "the", "page", "data", "if", "a", "callback", "is", "provided", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/response.js#L132-L157
3,375
aws/aws-sdk-js
lib/event-stream/to-buffer.js
toBuffer
function toBuffer(data, encoding) { return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ? Buffer.from(data, encoding) : new Buffer(data, encoding); }
javascript
function toBuffer(data, encoding) { return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ? Buffer.from(data, encoding) : new Buffer(data, encoding); }
[ "function", "toBuffer", "(", "data", ",", "encoding", ")", "{", "return", "(", "typeof", "Buffer", ".", "from", "===", "'function'", "&&", "Buffer", ".", "from", "!==", "Uint8Array", ".", "from", ")", "?", "Buffer", ".", "from", "(", "data", ",", "enco...
Converts data into Buffer. @param {ArrayBuffer|string|number[]|Buffer} data Data to convert to a Buffer @param {string} [encoding] String encoding @returns {Buffer}
[ "Converts", "data", "into", "Buffer", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/event-stream/to-buffer.js#L8-L11
3,376
aws/aws-sdk-js
doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/searchtools.js
function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); this.dots = $('<span></span>').appendTo(this.title); this.status = $('<p style="display: none"></p>').appendTo(this.out); this.output...
javascript
function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out); this.dots = $('<span></span>').appendTo(this.title); this.status = $('<p style="display: none"></p>').appendTo(this.out); this.output...
[ "function", "(", "query", ")", "{", "// create the required interface elements", "this", ".", "out", "=", "$", "(", "'#search-results'", ")", ";", "this", ".", "title", "=", "$", "(", "'<h2>'", "+", "_", "(", "'Searching'", ")", "+", "'</h2>'", ")", ".", ...
perform a search for something
[ "perform", "a", "search", "for", "something" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/doc-src/templates/flasky_sphinx_guide/fulldoc/html/js/sphinx/searchtools.js#L292-L308
3,377
aws/aws-sdk-js
lib/publisher/configuration.js
resolveMonitoringConfig
function resolveMonitoringConfig() { var config = { port: undefined, clientId: undefined, enabled: undefined, }; if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); return toJSType(config); }
javascript
function resolveMonitoringConfig() { var config = { port: undefined, clientId: undefined, enabled: undefined, }; if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config); return toJSType(config); }
[ "function", "resolveMonitoringConfig", "(", ")", "{", "var", "config", "=", "{", "port", ":", "undefined", ",", "clientId", ":", "undefined", ",", "enabled", ":", "undefined", ",", "}", ";", "if", "(", "fromEnvironment", "(", "config", ")", "||", "fromConf...
Resolve client-side monitoring configuration from either environmental variables or shared config file. Configurations from environmental variables have higher priority than those from shared config file. The resolver will try to read the shared config file no matter whether the AWS_SDK_LOAD_CONFIG variable is set. @ap...
[ "Resolve", "client", "-", "side", "monitoring", "configuration", "from", "either", "environmental", "variables", "or", "shared", "config", "file", ".", "Configurations", "from", "environmental", "variables", "have", "higher", "priority", "than", "those", "from", "sh...
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/configuration.js#L10-L18
3,378
aws/aws-sdk-js
lib/publisher/configuration.js
fromEnvironment
function fromEnvironment(config) { config.port = config.port || process.env.AWS_CSM_PORT; config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; return config.port && config.enabled && config.clientId || ['false', '0'].indexOf(conf...
javascript
function fromEnvironment(config) { config.port = config.port || process.env.AWS_CSM_PORT; config.enabled = config.enabled || process.env.AWS_CSM_ENABLED; config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID; return config.port && config.enabled && config.clientId || ['false', '0'].indexOf(conf...
[ "function", "fromEnvironment", "(", "config", ")", "{", "config", ".", "port", "=", "config", ".", "port", "||", "process", ".", "env", ".", "AWS_CSM_PORT", ";", "config", ".", "enabled", "=", "config", ".", "enabled", "||", "process", ".", "env", ".", ...
Resolve configurations from environmental variables. @param {object} client side monitoring config object needs to be resolved @returns {boolean} whether resolving configurations is done @api private
[ "Resolve", "configurations", "from", "environmental", "variables", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/configuration.js#L26-L32
3,379
aws/aws-sdk-js
lib/publisher/configuration.js
fromConfigFile
function fromConfigFile(config) { var sharedFileConfig; try { var configFile = AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }); var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ]; } catch (e...
javascript
function fromConfigFile(config) { var sharedFileConfig; try { var configFile = AWS.util.iniLoader.loadFrom({ isConfig: true, filename: process.env[AWS.util.sharedConfigFileEnv] }); var sharedFileConfig = configFile[ process.env.AWS_PROFILE || AWS.util.defaultProfile ]; } catch (e...
[ "function", "fromConfigFile", "(", "config", ")", "{", "var", "sharedFileConfig", ";", "try", "{", "var", "configFile", "=", "AWS", ".", "util", ".", "iniLoader", ".", "loadFrom", "(", "{", "isConfig", ":", "true", ",", "filename", ":", "process", ".", "...
Resolve cofigurations from shared config file with specified role name @param {object} client side monitoring config object needs to be resolved @returns {boolean} whether resolving configurations is done @api private
[ "Resolve", "cofigurations", "from", "shared", "config", "file", "with", "specified", "role", "name" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/publisher/configuration.js#L40-L58
3,380
aws/aws-sdk-js
lib/cloudfront/signer.js
Signer
function Signer(keyPairId, privateKey) { if (keyPairId === void 0 || privateKey === void 0) { throw new Error('A key pair ID and private key are required'); } this.keyPairId = keyPairId; this.privateKey = privateKey; }
javascript
function Signer(keyPairId, privateKey) { if (keyPairId === void 0 || privateKey === void 0) { throw new Error('A key pair ID and private key are required'); } this.keyPairId = keyPairId; this.privateKey = privateKey; }
[ "function", "Signer", "(", "keyPairId", ",", "privateKey", ")", "{", "if", "(", "keyPairId", "===", "void", "0", "||", "privateKey", "===", "void", "0", ")", "{", "throw", "new", "Error", "(", "'A key pair ID and private key are required'", ")", ";", "}", "t...
A signer object can be used to generate signed URLs and cookies for granting access to content on restricted CloudFront distributions. @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html @param keyPairId [String] (Required) The ID of the CloudFront key pair being used. @param...
[ "A", "signer", "object", "can", "be", "used", "to", "generate", "signed", "URLs", "and", "cookies", "for", "granting", "access", "to", "content", "on", "restricted", "CloudFront", "distributions", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/cloudfront/signer.js#L105-L112
3,381
aws/aws-sdk-js
lib/cloudfront/signer.js
function (options, cb) { var signatureHash = 'policy' in options ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); var cookieHash = {}; for (var key in signatureH...
javascript
function (options, cb) { var signatureHash = 'policy' in options ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey) : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey); var cookieHash = {}; for (var key in signatureH...
[ "function", "(", "options", ",", "cb", ")", "{", "var", "signatureHash", "=", "'policy'", "in", "options", "?", "signWithCustomPolicy", "(", "options", ".", "policy", ",", "this", ".", "keyPairId", ",", "this", ".", "privateKey", ")", ":", "signWithCannedPol...
Create a signed Amazon CloudFront Cookie. @param options [Object] The options to create a signed cookie. @option options url [String] The URL to which the signature will grant access. Required unless you pass in a full policy. @option options expires [Number] A Unix UTC timestamp indicating when the sig...
[ "Create", "a", "signed", "Amazon", "CloudFront", "Cookie", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/cloudfront/signer.js#L135-L148
3,382
aws/aws-sdk-js
lib/cloudfront/signer.js
function (options, cb) { try { var resource = getResource(options.url); } catch (err) { return handleError(err, cb); } var parsedUrl = url.parse(options.url, true), signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') ...
javascript
function (options, cb) { try { var resource = getResource(options.url); } catch (err) { return handleError(err, cb); } var parsedUrl = url.parse(options.url, true), signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy') ...
[ "function", "(", "options", ",", "cb", ")", "{", "try", "{", "var", "resource", "=", "getResource", "(", "options", ".", "url", ")", ";", "}", "catch", "(", "err", ")", "{", "return", "handleError", "(", "err", ",", "cb", ")", ";", "}", "var", "p...
Create a signed Amazon CloudFront URL. Keep in mind that URLs meant for use in media/flash players may have different requirements for URL formats (e.g. some require that the extension be removed, some require the file name to be prefixed - mp4:<path>, some require you to add "/cfx/st" into your URL). @param options ...
[ "Create", "a", "signed", "Amazon", "CloudFront", "URL", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/cloudfront/signer.js#L176-L204
3,383
aws/aws-sdk-js
features/extra/cleanup.js
function(list, iter, callback) { var item = list.shift(); iter(item, function(err) { if (err) return callback(err); else if (list.length) { eachSeries(list, iter, callback); } else { return callback(); } }); }
javascript
function(list, iter, callback) { var item = list.shift(); iter(item, function(err) { if (err) return callback(err); else if (list.length) { eachSeries(list, iter, callback); } else { return callback(); } }); }
[ "function", "(", "list", ",", "iter", ",", "callback", ")", "{", "var", "item", "=", "list", ".", "shift", "(", ")", ";", "iter", "(", "item", ",", "function", "(", "err", ")", "{", "if", "(", "err", ")", "return", "callback", "(", "err", ")", ...
Run bucket cleanup serially.
[ "Run", "bucket", "cleanup", "serially", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/cleanup.js#L48-L58
3,384
aws/aws-sdk-js
features/extra/cleanup.js
function(bucket, callback) { var s3 = new AWS.S3({maxRetries: 100}); var params = { Bucket: bucket }; s3.listObjects(params, function (err, data) { if (err) return callback(err); if (data.Contents.length > 0) { params.Delete = { Objects: [] }; data.Contents.forEach(fun...
javascript
function(bucket, callback) { var s3 = new AWS.S3({maxRetries: 100}); var params = { Bucket: bucket }; s3.listObjects(params, function (err, data) { if (err) return callback(err); if (data.Contents.length > 0) { params.Delete = { Objects: [] }; data.Contents.forEach(fun...
[ "function", "(", "bucket", ",", "callback", ")", "{", "var", "s3", "=", "new", "AWS", ".", "S3", "(", "{", "maxRetries", ":", "100", "}", ")", ";", "var", "params", "=", "{", "Bucket", ":", "bucket", "}", ";", "s3", ".", "listObjects", "(", "para...
Delete objects.
[ "Delete", "objects", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/features/extra/cleanup.js#L83-L101
3,385
aws/aws-sdk-js
lib/credentials/process_credentials.js
ProcessCredentials
function ProcessCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.get(options.callback || AWS.util.fn.noop); }
javascript
function ProcessCredentials(options) { AWS.Credentials.call(this); options = options || {}; this.filename = options.filename; this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile; this.get(options.callback || AWS.util.fn.noop); }
[ "function", "ProcessCredentials", "(", "options", ")", "{", "AWS", ".", "Credentials", ".", "call", "(", "this", ")", ";", "options", "=", "options", "||", "{", "}", ";", "this", ".", "filename", "=", "options", ".", "filename", ";", "this", ".", "prof...
Creates a new ProcessCredentials object. @param options [map] a set of options @option options profile [String] (AWS_PROFILE env var or 'default') the name of the profile to load. @option options filename [String] ('~/.aws/credentials' or defined by AWS_SHARED_CREDENTIALS_FILE process env var) the filename to use when...
[ "Creates", "a", "new", "ProcessCredentials", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/process_credentials.js#L59-L67
3,386
aws/aws-sdk-js
lib/credentials/process_credentials.js
loadViaCredentialProcess
function loadViaCredentialProcess(profile, callback) { proc.exec(profile['credential_process'], function(err, stdOut, stdErr) { if (err) { callback(AWS.util.error( new Error('credential_process returned error'), { code: 'ProcessCredentialsProviderFailure'} ), null); }...
javascript
function loadViaCredentialProcess(profile, callback) { proc.exec(profile['credential_process'], function(err, stdOut, stdErr) { if (err) { callback(AWS.util.error( new Error('credential_process returned error'), { code: 'ProcessCredentialsProviderFailure'} ), null); }...
[ "function", "loadViaCredentialProcess", "(", "profile", ",", "callback", ")", "{", "proc", ".", "exec", "(", "profile", "[", "'credential_process'", "]", ",", "function", "(", "err", ",", "stdOut", ",", "stdErr", ")", "{", "if", "(", "err", ")", "{", "ca...
Executes the credential_process and retrieves credentials from the output @api private @param profile [map] credentials profile @throws ProcessCredentialsProviderFailure
[ "Executes", "the", "credential_process", "and", "retrieves", "credentials", "from", "the", "output" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/credentials/process_credentials.js#L136-L166
3,387
aws/aws-sdk-js
lib/dynamodb/document_client.js
DocumentClient
function DocumentClient(options) { var self = this; self.options = options || {}; self.configure(self.options); }
javascript
function DocumentClient(options) { var self = this; self.options = options || {}; self.configure(self.options); }
[ "function", "DocumentClient", "(", "options", ")", "{", "var", "self", "=", "this", ";", "self", ".", "options", "=", "options", "||", "{", "}", ";", "self", ".", "configure", "(", "self", ".", "options", ")", ";", "}" ]
Creates a DynamoDB document client with a set of configuration options. @option options params [map] An optional map of parameters to bind to every request sent by this service object. @option options service [AWS.DynamoDB] An optional pre-configured instance of the AWS.DynamoDB service object to use for requests. The...
[ "Creates", "a", "DynamoDB", "document", "client", "with", "a", "set", "of", "configuration", "options", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/dynamodb/document_client.js#L58-L62
3,388
aws/aws-sdk-js
lib/event-stream/alloc-buffer.js
allocBuffer
function allocBuffer(size) { if (typeof size !== 'number') { throw new Error('size passed to allocBuffer must be a number.'); } var buffer = typeof Buffer.alloc === 'function' ? Buffer.alloc(size) : new Buffer(size); buffer.fill(0); return buffer; }
javascript
function allocBuffer(size) { if (typeof size !== 'number') { throw new Error('size passed to allocBuffer must be a number.'); } var buffer = typeof Buffer.alloc === 'function' ? Buffer.alloc(size) : new Buffer(size); buffer.fill(0); return buffer; }
[ "function", "allocBuffer", "(", "size", ")", "{", "if", "(", "typeof", "size", "!==", "'number'", ")", "{", "throw", "new", "Error", "(", "'size passed to allocBuffer must be a number.'", ")", ";", "}", "var", "buffer", "=", "typeof", "Buffer", ".", "alloc", ...
Allocates a buffer. @param {number} size Number of bytes to allocate for the buffer. @returns {Buffer}
[ "Allocates", "a", "buffer", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/event-stream/alloc-buffer.js#L7-L14
3,389
aws/aws-sdk-js
scripts/changelog/util.js
addVersionJSONToChangelog
function addVersionJSONToChangelog(version, changes) { if (!changelog) readChangelog(); var entry = '\n\n## ' + version; changes.forEach(function(change) { entry += '\n* ' + change.type + ': ' + change.category + ': ' + change.description; }); var logParts = changelog.split(insertMarker); logParts[0] = log...
javascript
function addVersionJSONToChangelog(version, changes) { if (!changelog) readChangelog(); var entry = '\n\n## ' + version; changes.forEach(function(change) { entry += '\n* ' + change.type + ': ' + change.category + ': ' + change.description; }); var logParts = changelog.split(insertMarker); logParts[0] = log...
[ "function", "addVersionJSONToChangelog", "(", "version", ",", "changes", ")", "{", "if", "(", "!", "changelog", ")", "readChangelog", "(", ")", ";", "var", "entry", "=", "'\\n\\n## '", "+", "version", ";", "changes", ".", "forEach", "(", "function", "(", "...
This will not to write to file writeToChangelog must be called after
[ "This", "will", "not", "to", "write", "to", "file", "writeToChangelog", "must", "be", "called", "after" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/scripts/changelog/util.js#L137-L150
3,390
aws/aws-sdk-js
dist-tools/client-creator.js
ClientCreator
function ClientCreator() { this._metadata = require('../apis/metadata'); this._apisFolderPath = path.join(__dirname, '..', 'apis'); this._clientFolderPath = path.join(__dirname, '..', 'clients'); this._serviceCustomizationsFolderPath = path.join(__dirname, '..', 'lib', 'services'); this._packageJsonPath = pat...
javascript
function ClientCreator() { this._metadata = require('../apis/metadata'); this._apisFolderPath = path.join(__dirname, '..', 'apis'); this._clientFolderPath = path.join(__dirname, '..', 'clients'); this._serviceCustomizationsFolderPath = path.join(__dirname, '..', 'lib', 'services'); this._packageJsonPath = pat...
[ "function", "ClientCreator", "(", ")", "{", "this", ".", "_metadata", "=", "require", "(", "'../apis/metadata'", ")", ";", "this", ".", "_apisFolderPath", "=", "path", ".", "join", "(", "__dirname", ",", "'..'", ",", "'apis'", ")", ";", "this", ".", "_cl...
Generate service clients
[ "Generate", "service", "clients" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/dist-tools/client-creator.js#L5-L12
3,391
aws/aws-sdk-js
lib/discover_endpoint.js
marshallCustomIdentifiers
function marshallCustomIdentifiers(request, shape) { var identifiers = {}; marshallCustomIdentifiersHelper(identifiers, request.params, shape); return identifiers; }
javascript
function marshallCustomIdentifiers(request, shape) { var identifiers = {}; marshallCustomIdentifiersHelper(identifiers, request.params, shape); return identifiers; }
[ "function", "marshallCustomIdentifiers", "(", "request", ",", "shape", ")", "{", "var", "identifiers", "=", "{", "}", ";", "marshallCustomIdentifiersHelper", "(", "identifiers", ",", "request", ".", "params", ",", "shape", ")", ";", "return", "identifiers", ";",...
Get custom identifiers for cache key. Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait. @param [object] request object @param [object] input shape of the given operation's api @api private
[ "Get", "custom", "identifiers", "for", "cache", "key", ".", "Identifies", "custom", "identifiers", "by", "checking", "each", "shape", "s", "endpointDiscoveryId", "trait", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L58-L62
3,392
aws/aws-sdk-js
lib/discover_endpoint.js
optionalDiscoverEndpoint
function optionalDiscoverEndpoint(request) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inpu...
javascript
function optionalDiscoverEndpoint(request) { var service = request.service; var api = service.api; var operationModel = api.operations ? api.operations[request.operation] : undefined; var inputShape = operationModel ? operationModel.input : undefined; var identifiers = marshallCustomIdentifiers(request, inpu...
[ "function", "optionalDiscoverEndpoint", "(", "request", ")", "{", "var", "service", "=", "request", ".", "service", ";", "var", "api", "=", "service", ".", "api", ";", "var", "operationModel", "=", "api", ".", "operations", "?", "api", ".", "operations", "...
Call endpoint discovery operation when it's optional. When endpoint is available in cache then use the cached endpoints. If endpoints are unavailable then use regional endpoints and call endpoint discovery operation asynchronously. This is turned off by default. @param [object] request object @api private
[ "Call", "endpoint", "discovery", "operation", "when", "it", "s", "optional", ".", "When", "endpoint", "is", "available", "in", "cache", "then", "use", "the", "cached", "endpoints", ".", "If", "endpoints", "are", "unavailable", "then", "use", "regional", "endpo...
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L72-L118
3,393
aws/aws-sdk-js
lib/discover_endpoint.js
addApiVersionHeader
function addApiVersionHeader(endpointRequest) { var api = endpointRequest.service.api; var apiVersion = api.apiVersion; if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; } }
javascript
function addApiVersionHeader(endpointRequest) { var api = endpointRequest.service.api; var apiVersion = api.apiVersion; if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) { endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion; } }
[ "function", "addApiVersionHeader", "(", "endpointRequest", ")", "{", "var", "api", "=", "endpointRequest", ".", "service", ".", "api", ";", "var", "apiVersion", "=", "api", ".", "apiVersion", ";", "if", "(", "apiVersion", "&&", "!", "endpointRequest", ".", "...
add api version header to endpoint operation @api private
[ "add", "api", "version", "header", "to", "endpoint", "operation" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L210-L216
3,394
aws/aws-sdk-js
lib/discover_endpoint.js
invalidateCachedEndpoints
function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; ...
javascript
function invalidateCachedEndpoints(response) { var error = response.error; var httpResponse = response.httpResponse; if (error && (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421) ) { var request = response.request; var operations = request.service.api.operations || {}; ...
[ "function", "invalidateCachedEndpoints", "(", "response", ")", "{", "var", "error", "=", "response", ".", "error", ";", "var", "httpResponse", "=", "response", ".", "httpResponse", ";", "if", "(", "error", "&&", "(", "error", ".", "code", "===", "'InvalidEnd...
If api call gets invalid endpoint exception, SDK should attempt to remove the invalid endpoint from cache. @api private
[ "If", "api", "call", "gets", "invalid", "endpoint", "exception", "SDK", "should", "attempt", "to", "remove", "the", "invalid", "endpoint", "from", "cache", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L223-L240
3,395
aws/aws-sdk-js
lib/discover_endpoint.js
hasCustomEndpoint
function hasCustomEndpoint(client) { //if set endpoint is set for specific client, enable endpoint discovery will raise an error. if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { throw util.error(new Error(), { code: 'Configuratio...
javascript
function hasCustomEndpoint(client) { //if set endpoint is set for specific client, enable endpoint discovery will raise an error. if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) { throw util.error(new Error(), { code: 'Configuratio...
[ "function", "hasCustomEndpoint", "(", "client", ")", "{", "//if set endpoint is set for specific client, enable endpoint discovery will raise an error.", "if", "(", "client", ".", "_originalConfig", "&&", "client", ".", "_originalConfig", ".", "endpoint", "&&", "client", ".",...
If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime. @param [object] client Service client object. @api private
[ "If", "endpoint", "is", "explicitly", "configured", "SDK", "should", "not", "do", "endpoint", "discovery", "in", "anytime", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L247-L257
3,396
aws/aws-sdk-js
lib/discover_endpoint.js
discoverEndpoint
function discoverEndpoint(request, done) { var service = request.service || {}; if (hasCustomEndpoint(service) || request.isPresigned()) return done(); if (!isEndpointDiscoveryApplicable(request)) return done(); request.httpRequest.appendToUserAgent('endpoint-discovery'); var operations = service.api.opera...
javascript
function discoverEndpoint(request, done) { var service = request.service || {}; if (hasCustomEndpoint(service) || request.isPresigned()) return done(); if (!isEndpointDiscoveryApplicable(request)) return done(); request.httpRequest.appendToUserAgent('endpoint-discovery'); var operations = service.api.opera...
[ "function", "discoverEndpoint", "(", "request", ",", "done", ")", "{", "var", "service", "=", "request", ".", "service", "||", "{", "}", ";", "if", "(", "hasCustomEndpoint", "(", "service", ")", "||", "request", ".", "isPresigned", "(", ")", ")", "return...
attach endpoint discovery logic to request object @param [object] request @api private
[ "attach", "endpoint", "discovery", "logic", "to", "request", "object" ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/discover_endpoint.js#L324-L350
3,397
aws/aws-sdk-js
lib/s3/managed_upload.js
ManagedUpload
function ManagedUpload(options) { var self = this; AWS.SequentialExecutor.call(self); self.body = null; self.sliceFn = null; self.callback = null; self.parts = {}; self.completeInfo = []; self.fillQueue = function() { self.callback(new Error('Unsupported body payload ' + typeof sel...
javascript
function ManagedUpload(options) { var self = this; AWS.SequentialExecutor.call(self); self.body = null; self.sliceFn = null; self.callback = null; self.parts = {}; self.completeInfo = []; self.fillQueue = function() { self.callback(new Error('Unsupported body payload ' + typeof sel...
[ "function", "ManagedUpload", "(", "options", ")", "{", "var", "self", "=", "this", ";", "AWS", ".", "SequentialExecutor", ".", "call", "(", "self", ")", ";", "self", ".", "body", "=", "null", ";", "self", ".", "sliceFn", "=", "null", ";", "self", "."...
Creates a managed upload object with a set of configuration options. @note A "Body" parameter is required to be set prior to calling {send}. @option options params [map] a map of parameters to pass to the upload requests. The "Body" parameter is required to be specified either on the service or in the params option. @...
[ "Creates", "a", "managed", "upload", "object", "with", "a", "set", "of", "configuration", "options", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/s3/managed_upload.js#L81-L94
3,398
aws/aws-sdk-js
lib/s3/managed_upload.js
function(callback) { var self = this; self.failed = false; self.callback = callback || function(err) { if (err) throw err; }; var runFill = true; if (self.sliceFn) { self.fillQueue = self.fillBuffer; } else if (AWS.util.isNode()) { var Stream = AWS.util.stream.Stream; if (self...
javascript
function(callback) { var self = this; self.failed = false; self.callback = callback || function(err) { if (err) throw err; }; var runFill = true; if (self.sliceFn) { self.fillQueue = self.fillBuffer; } else if (AWS.util.isNode()) { var Stream = AWS.util.stream.Stream; if (self...
[ "function", "(", "callback", ")", "{", "var", "self", "=", "this", ";", "self", ".", "failed", "=", "false", ";", "self", ".", "callback", "=", "callback", "||", "function", "(", "err", ")", "{", "if", "(", "err", ")", "throw", "err", ";", "}", "...
Initiates the managed upload for the payload. @callback callback function(err, data) @param err [Error] an error or null if no error occurred. @param data [map] The response data from the successful upload: * `Location` (String) the URL of the uploaded object * `ETag` (String) the ETag of the uploaded object * `Bucket...
[ "Initiates", "the", "managed", "upload", "for", "the", "payload", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/s3/managed_upload.js#L170-L200
3,399
aws/aws-sdk-js
lib/param_validator.js
ParamValidator
function ParamValidator(validation) { if (validation === true || validation === undefined) { validation = {'min': true}; } this.validation = validation; }
javascript
function ParamValidator(validation) { if (validation === true || validation === undefined) { validation = {'min': true}; } this.validation = validation; }
[ "function", "ParamValidator", "(", "validation", ")", "{", "if", "(", "validation", "===", "true", "||", "validation", "===", "undefined", ")", "{", "validation", "=", "{", "'min'", ":", "true", "}", ";", "}", "this", ".", "validation", "=", "validation", ...
Create a new validator object. @param validation [Boolean|map] whether input parameters should be validated against the operation description before sending the request. Pass a map to enable any of the following specific validation features: * **min** [Boolean] &mdash; Validates that a value meets the min constraint....
[ "Create", "a", "new", "validator", "object", "." ]
c23e5f0edd150f8885267e5f7c8a564f8e6e8562
https://github.com/aws/aws-sdk-js/blob/c23e5f0edd150f8885267e5f7c8a564f8e6e8562/lib/param_validator.js#L25-L30