Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@aws-sdk/core

Package Overview
Dependencies
Maintainers
2
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/core - npm Package Compare versions

Comparing version
3.974.11
to
3.974.12
+1
-1
dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js

@@ -56,3 +56,3 @@ import { RpcProtocol } from "@smithy/core/protocols";

}
const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, this.getJsonRpcVersion() === "1.1", awsQueryCompatible) ?? "Unknown";
const errorIdentifier = loadJsonRpcErrorCode(response, dataObject, awsQueryCompatible) ?? "Unknown";
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);

@@ -59,0 +59,0 @@ const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);

@@ -24,3 +24,3 @@ import { collectBodyString } from "../common";

const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
const sanitizeErrorCode = (rawValue, removeNamespace = true) => {
const sanitizeErrorCode = (rawValue) => {
let cleanValue = rawValue;

@@ -36,3 +36,3 @@ if (typeof cleanValue === "number") {

}
if (removeNamespace && cleanValue.indexOf("#") >= 0) {
if (cleanValue.indexOf("#") >= 0) {
cleanValue = cleanValue.split("#")[1];

@@ -43,8 +43,8 @@ }

export const loadRestJsonErrorCode = (output, data) => {
return loadErrorCode(output, data, true, ["header", "code", "type"]);
return loadErrorCode(output, data, ["header", "code", "type"]);
};
export const loadJsonRpcErrorCode = (output, data, removeNamespace, queryCompat = false) => {
return loadErrorCode(output, data, removeNamespace, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
export const loadJsonRpcErrorCode = (output, data, queryCompat = false) => {
return loadErrorCode(output, data, queryCompat ? ["code", "header", "type"] : ["type", "code", "header"]);
};
const loadErrorCode = ({ headers }, data, removeNamespace, order) => {
const loadErrorCode = ({ headers }, data, order) => {
while (order.length > 0) {

@@ -56,3 +56,3 @@ const location = order.shift();

if (headerKey !== undefined) {
return sanitizeErrorCode(headers[headerKey], removeNamespace);
return sanitizeErrorCode(headers[headerKey]);
}

@@ -63,3 +63,3 @@ break;

if (codeKey && data[codeKey] !== undefined) {
return sanitizeErrorCode(data[codeKey], removeNamespace);
return sanitizeErrorCode(data[codeKey]);
}

@@ -69,3 +69,3 @@ break;

if (data?.__type !== undefined) {
return sanitizeErrorCode(data.__type, removeNamespace);
return sanitizeErrorCode(data.__type);
}

@@ -72,0 +72,0 @@ break;

@@ -17,2 +17,2 @@ import type { HttpResponse, SerdeFunctions } from "@smithy/types";

*/
export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, removeNamespace: boolean, queryCompat?: boolean) => string | undefined;
export declare const loadJsonRpcErrorCode: (output: HttpResponse, data: any, queryCompat?: boolean) => string | undefined;

@@ -17,4 +17,3 @@ import { HttpResponse, SerdeFunctions } from "@smithy/types";

data: any,
removeNamespace: boolean,
queryCompat?: boolean
) => string | undefined;
{
"name": "@aws-sdk/core",
"version": "3.974.11",
"version": "3.974.12",
"description": "Core functions & classes shared by multiple AWS SDK clients.",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display