Socket
Socket
Sign inDemoInstall

@aws-sdk/util-arn-parser

Package Overview
Dependencies
1
Maintainers
5
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.183.0 to 3.186.0

8

CHANGELOG.md

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

# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06)
**Note:** Version bump only for package @aws-sdk/util-arn-parser
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)

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

27

dist-es/index.js

@@ -1,21 +0,24 @@

export const validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
export const parse = (arn) => {
const segments = arn.split(":");
import { __read } from "tslib";
export var validate = function (str) {
return typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
};
export var parse = function (arn) {
var segments = arn.split(":");
if (segments.length < 6 || segments[0] !== "arn")
throw new Error("Malformed ARN");
const [, partition, service, region, accountId, ...resource] = segments;
var _a = __read(segments), partition = _a[1], service = _a[2], region = _a[3], accountId = _a[4], resource = _a.slice(5);
return {
partition,
service,
region,
accountId,
partition: partition,
service: service,
region: region,
accountId: accountId,
resource: resource.join(":"),
};
};
export const build = (arnObject) => {
const { partition = "aws", service, region, accountId, resource } = arnObject;
if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
export var build = function (arnObject) {
var _a = arnObject.partition, partition = _a === void 0 ? "aws" : _a, service = arnObject.service, region = arnObject.region, accountId = arnObject.accountId, resource = arnObject.resource;
if ([service, region, accountId, resource].some(function (segment) { return typeof segment !== "string"; })) {
throw new Error("Input ARN object is invalid");
}
return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
return "arn:".concat(partition, ":").concat(service, ":").concat(region, ":").concat(accountId, ":").concat(resource);
};
{
"name": "@aws-sdk/util-arn-parser",
"version": "3.183.0",
"version": "3.186.0",
"description": "A parser to Amazon Resource Names",

@@ -5,0 +5,0 @@ "main": "./dist-cjs/index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc