@aws-sdk/util-arn-parser 3.183.0 → 3.186.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/util-arn-parser
9
+
10
+
11
+
12
+
13
+
6
14
  # [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
7
15
 
8
16
  **Note:** Version bump only for package @aws-sdk/util-arn-parser
package/dist-es/index.js CHANGED
@@ -1,21 +1,24 @@
1
- export const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
2
- export const parse = (arn) => {
3
- const segments = arn.split(":");
1
+ import { __read } from "tslib";
2
+ export var validate = function (str) {
3
+ return typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
4
+ };
5
+ export var parse = function (arn) {
6
+ var segments = arn.split(":");
4
7
  if (segments.length < 6 || segments[0] !== "arn")
5
8
  throw new Error("Malformed ARN");
6
- const [, partition, service, region, accountId, ...resource] = segments;
9
+ var _a = __read(segments), partition = _a[1], service = _a[2], region = _a[3], accountId = _a[4], resource = _a.slice(5);
7
10
  return {
8
- partition,
9
- service,
10
- region,
11
- accountId,
11
+ partition: partition,
12
+ service: service,
13
+ region: region,
14
+ accountId: accountId,
12
15
  resource: resource.join(":"),
13
16
  };
14
17
  };
15
- export const build = (arnObject) => {
16
- const { partition = "aws", service, region, accountId, resource } = arnObject;
17
- if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
18
+ export var build = function (arnObject) {
19
+ var _a = arnObject.partition, partition = _a === void 0 ? "aws" : _a, service = arnObject.service, region = arnObject.region, accountId = arnObject.accountId, resource = arnObject.resource;
20
+ if ([service, region, accountId, resource].some(function (segment) { return typeof segment !== "string"; })) {
18
21
  throw new Error("Input ARN object is invalid");
19
22
  }
20
- return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
23
+ return "arn:".concat(partition, ":").concat(service, ":").concat(region, ":").concat(accountId, ":").concat(resource);
21
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-arn-parser",
3
- "version": "3.183.0",
3
+ "version": "3.186.0",
4
4
  "description": "A parser to Amazon Resource Names",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",