Socket
Socket
Sign inDemoInstall

@aws-sdk/util-endpoints

Package Overview
Dependencies
Maintainers
5
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-endpoints - npm Package Compare versions

Comparing version 3.614.0 to 3.631.0

11

dist-cjs/index.js

@@ -90,9 +90,12 @@ "use strict";

// src/lib/aws/parseArn.ts
var ARN_DELIMITER = ":";
var RESOURCE_DELIMITER = "/";
var parseArn = /* @__PURE__ */ __name((value) => {
const segments = value.split(":");
const segments = value.split(ARN_DELIMITER);
if (segments.length < 6)
return null;
const [arn, partition2, service, region, accountId, ...resourceId] = segments;
if (arn !== "arn" || partition2 === "" || service === "" || resourceId[0] === "")
const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
return null;
const resourceId = resourcePath[0].includes(RESOURCE_DELIMITER) ? resourcePath[0].split(RESOURCE_DELIMITER) : resourcePath;
return {

@@ -103,3 +106,3 @@ partition: partition2,

accountId,
resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId
resourceId
};

@@ -106,0 +109,0 @@ }, "parseArn");

@@ -0,8 +1,13 @@

const ARN_DELIMITER = ":";
const RESOURCE_DELIMITER = "/";
export const parseArn = (value) => {
const segments = value.split(":");
const segments = value.split(ARN_DELIMITER);
if (segments.length < 6)
return null;
const [arn, partition, service, region, accountId, ...resourceId] = segments;
if (arn !== "arn" || partition === "" || service === "" || resourceId[0] === "")
const [arn, partition, service, region, accountId, ...resourcePath] = segments;
if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
return null;
const resourceId = resourcePath[0].includes(RESOURCE_DELIMITER)
? resourcePath[0].split(RESOURCE_DELIMITER)
: resourcePath;
return {

@@ -13,4 +18,4 @@ partition,

accountId,
resourceId: resourceId[0].includes("/") ? resourceId[0].split("/") : resourceId,
resourceId,
};
};
{
"name": "@aws-sdk/util-endpoints",
"version": "3.614.0",
"version": "3.631.0",
"description": "Utilities to help with endpoint resolution",

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc