@aws-sdk/util-arn-parser 3.310.0 → 3.495.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +60 -25
  2. package/package.json +2 -6
package/dist-cjs/index.js CHANGED
@@ -1,27 +1,62 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.build = exports.parse = exports.validate = void 0;
4
- const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
5
- exports.validate = validate;
6
- const parse = (arn) => {
7
- const segments = arn.split(":");
8
- if (segments.length < 6 || segments[0] !== "arn")
9
- throw new Error("Malformed ARN");
10
- const [, partition, service, region, accountId, ...resource] = segments;
11
- return {
12
- partition,
13
- service,
14
- region,
15
- accountId,
16
- resource: resource.join(":"),
17
- };
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
18
9
  };
19
- exports.parse = parse;
20
- const build = (arnObject) => {
21
- const { partition = "aws", service, region, accountId, resource } = arnObject;
22
- if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
23
- throw new Error("Input ARN object is invalid");
24
- }
25
- return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
26
17
  };
27
- exports.build = build;
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ build: () => build,
24
+ parse: () => parse,
25
+ validate: () => validate
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+ var validate = /* @__PURE__ */ __name((str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6, "validate");
29
+ var parse = /* @__PURE__ */ __name((arn) => {
30
+ const segments = arn.split(":");
31
+ if (segments.length < 6 || segments[0] !== "arn")
32
+ throw new Error("Malformed ARN");
33
+ const [
34
+ ,
35
+ //Skip "arn" literal
36
+ partition,
37
+ service,
38
+ region,
39
+ accountId,
40
+ ...resource
41
+ ] = segments;
42
+ return {
43
+ partition,
44
+ service,
45
+ region,
46
+ accountId,
47
+ resource: resource.join(":")
48
+ };
49
+ }, "parse");
50
+ var build = /* @__PURE__ */ __name((arnObject) => {
51
+ const { partition = "aws", service, region, accountId, resource } = arnObject;
52
+ if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
53
+ throw new Error("Input ARN object is invalid");
54
+ }
55
+ return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
56
+ }, "build");
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ build,
60
+ parse,
61
+ validate
62
+ });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-arn-parser",
3
- "version": "3.310.0",
3
+ "version": "3.495.0",
4
4
  "description": "A parser to Amazon Resource Names",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
7
7
  "scripts": {
8
8
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
9
- "build:cjs": "tsc -p tsconfig.cjs.json",
9
+ "build:cjs": "node ../../scripts/compilation/inline util-arn-parser",
10
10
  "build:es": "tsc -p tsconfig.es.json",
11
11
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
12
12
  "build:types": "tsc -p tsconfig.types.json",
@@ -28,7 +28,6 @@
28
28
  "concurrently": "7.0.0",
29
29
  "downlevel-dts": "0.10.1",
30
30
  "rimraf": "3.0.2",
31
- "typedoc": "0.23.23",
32
31
  "typescript": "~4.9.5"
33
32
  },
34
33
  "types": "./dist-types/index.d.ts",
@@ -50,8 +49,5 @@
50
49
  "type": "git",
51
50
  "url": "https://github.com/aws/aws-sdk-js-v3.git",
52
51
  "directory": "packages/util-arn-parser"
53
- },
54
- "typedoc": {
55
- "entryPoint": "src/index.ts"
56
52
  }
57
53
  }