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

@smithy/util-middleware

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/util-middleware - npm Package Compare versions

Comparing version
4.2.14
to
4.3.0
+6
-15
dist-cjs/index.js

@@ -1,15 +0,6 @@

'use strict';
var types = require('@smithy/types');
const getSmithyContext = (context) => context[types.SMITHY_CONTEXT_KEY] || (context[types.SMITHY_CONTEXT_KEY] = {});
const normalizeProvider = (input) => {
if (typeof input === "function")
return input;
const promisified = Promise.resolve(input);
return () => promisified;
};
exports.getSmithyContext = getSmithyContext;
exports.normalizeProvider = normalizeProvider;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeProvider = exports.getSmithyContext = void 0;
var client_1 = require("@smithy/core/client");
Object.defineProperty(exports, "getSmithyContext", { enumerable: true, get: function () { return client_1.getSmithyContext; } });
Object.defineProperty(exports, "normalizeProvider", { enumerable: true, get: function () { return client_1.normalizeProvider; } });

@@ -1,2 +0,1 @@

export * from "./getSmithyContext";
export * from "./normalizeProvider";
export { getSmithyContext, normalizeProvider } from "@smithy/core/client";

@@ -1,8 +0,2 @@

/**
* @internal
*/
export * from "./getSmithyContext";
/**
* @internal
*/
export * from "./normalizeProvider";
/** @deprecated Use @smithy/core/client instead. */
export { getSmithyContext, normalizeProvider } from "@smithy/core/client";
{
"name": "@smithy/util-middleware",
"version": "4.2.14",
"version": "4.3.0",
"description": "Shared utilities for to be used in middleware packages.",

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

"scripts": {
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline util-middleware",
"build:types": "yarn g:tsc -p tsconfig.types.json",
"build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
"format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
"test": "yarn g:vitest run",
"test:watch": "yarn g:vitest watch"
"build": "yarn g:tsc -p tsconfig.cjs.json && yarn g:tsc -p tsconfig.es.json && yarn g:tsc -p tsconfig.types.json",
"clean": "rm -rf dist-cjs dist-es dist-types",
"stage-release": "rm -rf .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz"
},

@@ -31,12 +24,5 @@ "keywords": [

"dependencies": {
"@smithy/types": "^4.14.1",
"@smithy/core": "^3.24.0",
"tslib": "^2.6.2"
},
"devDependencies": {
"@types/node": "^18.11.9",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"premove": "4.0.0",
"typedoc": "0.23.23"
},
"types": "./dist-types/index.d.ts",

@@ -46,9 +32,2 @@ "engines": {

},
"typesVersions": {
"<4.5": {
"types/*": [
"types/ts3.4/*"
]
}
},
"files": [

@@ -55,0 +34,0 @@ "dist-*/**"

import { SMITHY_CONTEXT_KEY } from "@smithy/types";
export const getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
export const normalizeProvider = (input) => {
if (typeof input === "function")
return input;
const promisified = Promise.resolve(input);
return () => promisified;
};
import type { HandlerExecutionContext } from "@smithy/types";
/**
* @internal
*/
export declare const getSmithyContext: (context: HandlerExecutionContext) => Record<string, unknown>;
import type { Provider } from "@smithy/types";
/**
* @internal
*
* @returns a provider function for the input value if it isn't already one.
*/
export declare const normalizeProvider: <T>(input: T | Provider<T>) => Provider<T>;
# @smithy/util-middleware
[![NPM version](https://img.shields.io/npm/v/@smithy/util-middleware/latest.svg)](https://www.npmjs.com/package/@smithy/util-middleware)
[![NPM downloads](https://img.shields.io/npm/dm/@smithy/util-middleware.svg)](https://www.npmjs.com/package/@smithy/util-middleware)
### :warning: Internal API :warning:
> This is an internal package.
> That means this is used as a dependency for other, public packages, but
> should not be taken directly as a dependency in your application's `package.json`.
> If you are updating the version of this package, for example to bring in a
> bug-fix, you should do so by updating your application lockfile with
> e.g. `npm up @scope/package` or equivalent command in another
> package manager, rather than taking a direct dependency.
---