Socket
Socket
Sign inDemoInstall

@aws-sdk/util-endpoints

Package Overview
Dependencies
2
Maintainers
6
Versions
106
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.159.0 to 3.160.0

dist-cjs/resolveEndpoint.js

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [3.160.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.159.0...v3.160.0) (2022-08-29)
**Note:** Version bump only for package @aws-sdk/util-endpoints
# [3.159.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.158.0...v3.159.0) (2022-08-26)

@@ -8,0 +16,0 @@

3

dist-cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./EndpointError"), exports);
tslib_1.__exportStar(require("./resolveEndpoint"), exports);
tslib_1.__exportStar(require("./types"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttr = void 0;
const EndpointError_1 = require("../EndpointError");
const types_1 = require("../types");
const getAttrPathList_1 = require("./getAttrPathList");
const getAttr = (value, path) => (0, getAttrPathList_1.getAttrPathList)(path).reduce((acc, index) => {
if (typeof acc !== "object") {
throw new EndpointError_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
throw new types_1.EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
}

@@ -10,0 +10,0 @@ else if (Array.isArray(acc)) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttrPathList = void 0;
const __1 = require("../");
const types_1 = require("../types");
const getAttrPathList = (path) => {

@@ -12,7 +12,7 @@ const parts = path.split(".");

if (part.indexOf("]") !== part.length - 1) {
throw new __1.EndpointError(`Path: '${path}' does not end with ']'`);
throw new types_1.EndpointError(`Path: '${path}' does not end with ']'`);
}
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
if (Number.isNaN(parseInt(arrayIndex))) {
throw new __1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
throw new types_1.EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
}

@@ -19,0 +19,0 @@ if (squareBracketIndex !== 0) {

@@ -1,1 +0,2 @@

export * from "./EndpointError";
export * from "./resolveEndpoint";
export * from "./types";

@@ -1,2 +0,2 @@

import { EndpointError } from "../EndpointError";
import { EndpointError } from "../types";
import { getAttrPathList } from "./getAttrPathList";

@@ -3,0 +3,0 @@ export var getAttr = function (value, path) {

import { __values } from "tslib";
import { EndpointError } from "../";
import { EndpointError } from "../types";
export var getAttrPathList = function (path) {

@@ -4,0 +4,0 @@ var e_1, _a;

@@ -1,1 +0,2 @@

export * from "./EndpointError";
export * from "./resolveEndpoint";
export * from "./types";

@@ -1,1 +0,2 @@

export * from "./EndpointError";
export * from "./resolveEndpoint";
export * from "./types";
{
"name": "@aws-sdk/util-endpoints",
"version": "3.159.0",
"version": "3.160.0",
"description": "Utilities to help with endpoint resolution",

@@ -23,3 +23,3 @@ "main": "./dist-cjs/index.js",

"dependencies": {
"@aws-sdk/types": "3.159.0",
"@aws-sdk/types": "3.160.0",
"tslib": "^2.3.1"

@@ -26,0 +26,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc