You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@smithy/core

Package Overview
Dependencies
Maintainers
3
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/core - npm Package Compare versions

Comparing version
3.20.8
to
3.21.0
+16
-6
dist-cjs/submodules/schema/index.js

@@ -243,2 +243,5 @@ 'use strict';

const anno = {
it: Symbol.for("@smithy/nor-struct-it"),
};
class NormalizedSchema {

@@ -399,6 +402,3 @@ ref;

isIdempotencyToken() {
const match = (traits) => (traits & 0b0100) === 0b0100 ||
!!traits?.idempotencyToken;
const { normalizedTraits, traits, memberTraits } = this;
return match(normalizedTraits) || match(traits) || match(memberTraits);
return !!this.getMergedTraits().idempotencyToken;
}

@@ -484,5 +484,15 @@ getMergedTraits() {

const struct = this.getSchema();
for (let i = 0; i < struct[4].length; ++i) {
yield [struct[4][i], member([struct[5][i], 0], struct[4][i])];
const z = struct[4].length;
let it = struct[anno.it];
if (it && z === it.length) {
yield* it;
return;
}
it = Array(z);
for (let i = 0; i < z; ++i) {
const k = struct[4][i];
const v = member([struct[5][i], 0], k);
yield (it[i] = [k, v]);
}
struct[anno.it] = it;
}

@@ -489,0 +499,0 @@ }

import { deref } from "../deref";
import { translateTraits } from "./translateTraits";
const anno = {
it: Symbol.for("@smithy/nor-struct-it"),
};
export class NormalizedSchema {

@@ -158,6 +161,3 @@ ref;

isIdempotencyToken() {
const match = (traits) => (traits & 0b0100) === 0b0100 ||
!!traits?.idempotencyToken;
const { normalizedTraits, traits, memberTraits } = this;
return match(normalizedTraits) || match(traits) || match(memberTraits);
return !!this.getMergedTraits().idempotencyToken;
}

@@ -243,5 +243,15 @@ getMergedTraits() {

const struct = this.getSchema();
for (let i = 0; i < struct[4].length; ++i) {
yield [struct[4][i], member([struct[5][i], 0], struct[4][i])];
const z = struct[4].length;
let it = struct[anno.it];
if (it && z === it.length) {
yield* it;
return;
}
it = Array(z);
for (let i = 0; i < z; ++i) {
const k = struct[4][i];
const v = member([struct[5][i], 0], k);
yield (it[i] = [k, v]);
}
struct[anno.it] = it;
}

@@ -248,0 +258,0 @@ }

@@ -66,3 +66,2 @@ import type { $MemberSchema, $Schema, $SchemaRef, NormalizedSchema as INormalizedSchema, SchemaRef, SchemaTraitsObject, StaticSchema } from "@smithy/types";

/**
* This is a shortcut to avoid calling `getMergedTraits().idempotencyToken` on every string.
* @returns whether the schema has the idempotencyToken trait.

@@ -69,0 +68,0 @@ */

@@ -66,3 +66,2 @@ import { $MemberSchema, $Schema, $SchemaRef, NormalizedSchema as INormalizedSchema, SchemaRef, SchemaTraitsObject, StaticSchema } from "@smithy/types";

/**
* This is a shortcut to avoid calling `getMergedTraits().idempotencyToken` on every string.
* @returns whether the schema has the idempotencyToken trait.

@@ -69,0 +68,0 @@ */

{
"name": "@smithy/core",
"version": "3.20.8",
"version": "3.21.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",