Socket
Socket
Sign inDemoInstall

@loopback/context

Package Overview
Dependencies
12
Maintainers
8
Versions
192
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.7.0 to 3.8.0

19

CHANGELOG.md

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

# [3.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/context@3.7.0...@loopback/context@3.8.0) (2020-05-19)
### Bug Fixes
* **context:** check parameter design type for method injections ([7e81e10](https://github.com/strongloop/loopback-next/commit/7e81e10f8d5c5c5cd9be0e091fde9bf8c4b1e3b3))
### Features
* **context:** allow bindings to be created from dynamic value provider classes ([9e15154](https://github.com/strongloop/loopback-next/commit/9e15154dae3a3b51b5e090ecfe4052f416051332))
* **context:** pass resolution context to the factory function for toDynamicValue() ([6513d3f](https://github.com/strongloop/loopback-next/commit/6513d3f5e36b90f58501cfbf311b2b26210d44dd))
* **context:** use a `_source` to keep the original value provider for bindings ([90679f3](https://github.com/strongloop/loopback-next/commit/90679f3826a8cf18f06123503a9b96c763b5dc20))
* **core:** allow extensionFilter to take a list of extension point names ([8f315eb](https://github.com/strongloop/loopback-next/commit/8f315eb46bee7365da5325a23b948df9d477bfdb))
# [3.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/context@3.6.0...@loopback/context@3.7.0) (2020-05-07)

@@ -8,0 +27,0 @@

1

dist/binding-config.js

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.configBindingKeyFor = exports.DefaultConfigurationResolver = void 0;
const binding_key_1 = require("./binding-key");

@@ -9,0 +10,0 @@ /**

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.bind = void 0;
const metadata_1 = require("@loopback/metadata");

@@ -9,0 +10,0 @@ const binding_inspector_1 = require("./binding-inspector");

4

dist/binding-filter.d.ts

@@ -96,5 +96,5 @@ import { Binding, BindingTag } from './binding';

* value equals to the item value or is an array that includes the item value.
* @param itemValue - Tag item value
* @param itemValues - A list of tag item value
*/
export declare function includesTagValue(itemValue: unknown): TagValueMatcher;
export declare function includesTagValue(...itemValues: unknown[]): TagValueMatcher;
/**

@@ -101,0 +101,0 @@ * Create a binding filter for the tag pattern

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.filterByKey = exports.filterByTag = exports.includesTagValue = exports.ANY_TAG_VALUE = exports.isBindingTagFilter = exports.isBindingAddress = void 0;
/**

@@ -64,7 +65,7 @@ * Check if an object is a `BindingKey` by duck typing

* value equals to the item value or is an array that includes the item value.
* @param itemValue - Tag item value
* @param itemValues - A list of tag item value
*/
function includesTagValue(itemValue) {
function includesTagValue(...itemValues) {
return tagValue => {
return (
return itemValues.some(itemValue =>
// The tag value equals the item value

@@ -71,0 +72,0 @@ tagValue === itemValue ||

import { MetadataAccessor } from '@loopback/metadata';
import { Binding, BindingScope, BindingTag, BindingTemplate } from './binding';
import { Binding, BindingScope, BindingTag, BindingTemplate, DynamicValueProviderClass } from './binding';
import { BindingAddress } from './binding-key';

@@ -55,6 +55,7 @@ import { Provider } from './provider';

* @param target - Target class, which can be an implementation of `Provider`
* or `DynamicValueProviderClass`
*
* @typeParam T - Value type
*/
export declare function asClassOrProvider<T>(target: Constructor<T | Provider<T>>): BindingTemplate<T>;
export declare function asClassOrProvider<T>(target: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>): BindingTemplate<T>;
/**

@@ -85,3 +86,3 @@ * Convert binding scope and tags as a template function

*/
export declare function bindingTemplateFor<T>(cls: Constructor<T | Provider<T>>): BindingTemplate<T>;
export declare function bindingTemplateFor<T>(cls: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>): BindingTemplate<T>;
/**

@@ -148,2 +149,2 @@ * Mapping artifact types to binding key namespaces (prefixes).

*/
export declare function createBindingFromClass<T>(cls: Constructor<T | Provider<T>>, options?: BindingFromClassOptions): Binding<T>;
export declare function createBindingFromClass<T>(cls: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>, options?: BindingFromClassOptions): Binding<T>;

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createBindingFromClass = exports.DEFAULT_TYPE_NAMESPACES = exports.bindingTemplateFor = exports.removeNameAndKeyTags = exports.getBindingMetadata = exports.asBindingTemplate = exports.asClassOrProvider = exports.asProvider = exports.isProviderClass = exports.BINDING_METADATA_KEY = void 0;
const tslib_1 = require("tslib");

@@ -48,2 +49,3 @@ const metadata_1 = require("@loopback/metadata");

* @param target - Target class, which can be an implementation of `Provider`
* or `DynamicValueProviderClass`
*

@@ -58,2 +60,7 @@ * @typeParam T - Value type

}
else if (binding_1.isDynamicValueProviderClass(target)) {
binding.toDynamicValue(target).tag(keys_1.ContextTags.DYNAMIC_VALUE_PROVIDER, {
[keys_1.ContextTags.TYPE]: keys_1.ContextTags.DYNAMIC_VALUE_PROVIDER,
});
}
else {

@@ -133,2 +140,3 @@ binding.toClass(target);

provider: 'providers',
dynamicValueProvider: 'dynamicValueProviders',
};

@@ -135,0 +143,0 @@ /**

@@ -7,110 +7,114 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.BindingKey = void 0;
const value_promise_1 = require("./value-promise");
class BindingKey {
constructor(key, propertyPath) {
this.key = key;
this.propertyPath = propertyPath;
}
/**
* Create a new key for a binding bound to a value of type `ValueType`.
*
* @example
*
* ```ts
* BindingKey.create<string>('application.name');
* BindingKey.create<number>('config', 'rest.port);
* BindingKey.create<number>('config#rest.port');
* ```
*
* @param key - The binding key. When propertyPath is not provided, the key
* is allowed to contain propertyPath as encoded via `BindingKey#toString()`
* @param propertyPath - Optional path to a deep property of the bound value.
*/
static create(key, propertyPath) {
// TODO(bajtos) allow chaining of propertyPaths, e.g.
// BindingKey.create('config#rest', 'port')
// should create {key: 'config', path: 'rest.port'}
if (propertyPath) {
BindingKey.validate(key);
return new BindingKey(key, propertyPath);
let BindingKey = /** @class */ (() => {
class BindingKey {
constructor(key, propertyPath) {
this.key = key;
this.propertyPath = propertyPath;
}
return BindingKey.parseKeyWithPath(key);
}
toString() {
return this.propertyPath
? `${this.key}${BindingKey.PROPERTY_SEPARATOR}${this.propertyPath}`
: this.key;
}
/**
* Get a binding address for retrieving a deep property of the object
* bound to the current binding key.
*
* @param propertyPath - A dot-separated path to a (deep) property, e.g. "server.port".
*/
deepProperty(propertyPath) {
// TODO(bajtos) allow chaining of propertyPaths, e.g.
// BindingKey.create('config', 'rest').deepProperty('port')
// should create {key: 'config', path: 'rest.port'}
return BindingKey.create(this.key, propertyPath);
}
/**
* Validate the binding key format. Please note that `#` is reserved.
* Returns a string representation of the binding key.
*
* @param key - Binding key, such as `a`, `a.b`, `a:b`, or `a/b`
*/
static validate(key) {
if (!key)
throw new Error('Binding key must be provided.');
key = key.toString();
if (key.includes(BindingKey.PROPERTY_SEPARATOR)) {
throw new Error(`Binding key ${key} cannot contain` +
` '${BindingKey.PROPERTY_SEPARATOR}'.`);
/**
* Create a new key for a binding bound to a value of type `ValueType`.
*
* @example
*
* ```ts
* BindingKey.create<string>('application.name');
* BindingKey.create<number>('config', 'rest.port);
* BindingKey.create<number>('config#rest.port');
* ```
*
* @param key - The binding key. When propertyPath is not provided, the key
* is allowed to contain propertyPath as encoded via `BindingKey#toString()`
* @param propertyPath - Optional path to a deep property of the bound value.
*/
static create(key, propertyPath) {
// TODO(bajtos) allow chaining of propertyPaths, e.g.
// BindingKey.create('config#rest', 'port')
// should create {key: 'config', path: 'rest.port'}
if (propertyPath) {
BindingKey.validate(key);
return new BindingKey(key, propertyPath);
}
return BindingKey.parseKeyWithPath(key);
}
return key;
}
/**
* Parse a string containing both the binding key and the path to the deeply
* nested property to retrieve.
*
* @param keyWithPath - The key with an optional path,
* e.g. "application.instance" or "config#rest.port".
*/
static parseKeyWithPath(keyWithPath) {
if (typeof keyWithPath !== 'string') {
return BindingKey.create(keyWithPath.key, keyWithPath.propertyPath);
toString() {
return this.propertyPath
? `${this.key}${BindingKey.PROPERTY_SEPARATOR}${this.propertyPath}`
: this.key;
}
const index = keyWithPath.indexOf(BindingKey.PROPERTY_SEPARATOR);
if (index === -1) {
return new BindingKey(keyWithPath);
/**
* Get a binding address for retrieving a deep property of the object
* bound to the current binding key.
*
* @param propertyPath - A dot-separated path to a (deep) property, e.g. "server.port".
*/
deepProperty(propertyPath) {
// TODO(bajtos) allow chaining of propertyPaths, e.g.
// BindingKey.create('config', 'rest').deepProperty('port')
// should create {key: 'config', path: 'rest.port'}
return BindingKey.create(this.key, propertyPath);
}
return BindingKey.create(keyWithPath.substr(0, index).trim(), keyWithPath.substr(index + 1));
/**
* Validate the binding key format. Please note that `#` is reserved.
* Returns a string representation of the binding key.
*
* @param key - Binding key, such as `a`, `a.b`, `a:b`, or `a/b`
*/
static validate(key) {
if (!key)
throw new Error('Binding key must be provided.');
key = key.toString();
if (key.includes(BindingKey.PROPERTY_SEPARATOR)) {
throw new Error(`Binding key ${key} cannot contain` +
` '${BindingKey.PROPERTY_SEPARATOR}'.`);
}
return key;
}
/**
* Parse a string containing both the binding key and the path to the deeply
* nested property to retrieve.
*
* @param keyWithPath - The key with an optional path,
* e.g. "application.instance" or "config#rest.port".
*/
static parseKeyWithPath(keyWithPath) {
if (typeof keyWithPath !== 'string') {
return BindingKey.create(keyWithPath.key, keyWithPath.propertyPath);
}
const index = keyWithPath.indexOf(BindingKey.PROPERTY_SEPARATOR);
if (index === -1) {
return new BindingKey(keyWithPath);
}
return BindingKey.create(keyWithPath.substr(0, index).trim(), keyWithPath.substr(index + 1));
}
/**
* Build a binding key for the configuration of the given binding.
* The format is `<key>:$config`
*
* @param key - Key of the target binding to be configured
*/
static buildKeyForConfig(key = '') {
const suffix = BindingKey.CONFIG_NAMESPACE;
const bindingKey = key ? `${key}:${suffix}` : suffix;
return bindingKey;
}
/**
* Generate a unique binding key with `uuid`
* @param namespace - Namespace for the binding
*/
static generate(namespace = '') {
const prefix = namespace ? `${namespace}.` : '';
const name = value_promise_1.uuid();
return BindingKey.create(`${prefix}${name}`);
}
}
BindingKey.PROPERTY_SEPARATOR = '#';
/**
* Build a binding key for the configuration of the given binding.
* The format is `<key>:$config`
*
* @param key - Key of the target binding to be configured
* Name space for configuration binding keys
*/
static buildKeyForConfig(key = '') {
const suffix = BindingKey.CONFIG_NAMESPACE;
const bindingKey = key ? `${key}:${suffix}` : suffix;
return bindingKey;
}
/**
* Generate a unique binding key with `uuid`
* @param namespace - Namespace for the binding
*/
static generate(namespace = '') {
const prefix = namespace ? `${namespace}.` : '';
const name = value_promise_1.uuid();
return BindingKey.create(`${prefix}${name}`);
}
}
BindingKey.CONFIG_NAMESPACE = '$config';
return BindingKey;
})();
exports.BindingKey = BindingKey;
BindingKey.PROPERTY_SEPARATOR = '#';
/**
* Name space for configuration binding keys
*/
BindingKey.CONFIG_NAMESPACE = '$config';
//# sourceMappingURL=binding-key.js.map

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.sortBindingsByPhase = exports.compareByOrder = exports.compareBindingsByTag = void 0;
/**

@@ -9,0 +10,0 @@ * Creates a binding compare function to sort bindings by tagged phase name.

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { Provider } from './provider';
import { ResolutionOptions, ResolutionSession } from './resolution-session';
import { ResolutionContext, ResolutionOptions, ResolutionSession } from './resolution-session';
import { BoundValue, Constructor, MapObject, ValueOrPromise } from './value-promise';

@@ -105,2 +105,41 @@ /**

}
/**
* Binding source for `to`
*/
export declare type ConstantBindingSource<T> = {
type: BindingType.CONSTANT;
value: T;
};
/**
* Binding source for `toDynamicValue`
*/
export declare type DynamicValueBindingSource<T> = {
type: BindingType.DYNAMIC_VALUE;
value: ValueFactory<T> | DynamicValueProviderClass<T>;
};
/**
* Binding source for `toClass`
*/
export declare type ClassBindingSource<T> = {
type: BindingType.CLASS;
value: Constructor<T>;
};
/**
* Binding source for `toProvider`
*/
export declare type ProviderBindingSource<T> = {
type: BindingType.PROVIDER;
value: Constructor<Provider<T>>;
};
/**
* Binding source for `toAlias`
*/
export declare type AliasBindingSource<T> = {
type: BindingType.ALIAS;
value: BindingAddress<T>;
};
/**
* Source for the binding, including the type and value
*/
export declare type BindingSource<T> = ConstantBindingSource<T> | DynamicValueBindingSource<T> | ClassBindingSource<T> | ProviderBindingSource<T> | AliasBindingSource<T>;
export declare type TagMap = MapObject<any>;

@@ -141,2 +180,29 @@ /**

/**
* A factory function for `toDynamicValue`
*/
export declare type ValueFactory<T = unknown> = (resolutionCtx: ResolutionContext) => ValueOrPromise<T | undefined>;
/**
* A class with a static `value` method as the factory function for
* `toDynamicValue`.
*
* @example
* ```ts
* import {inject} from '@loopback/context';
*
* export class DynamicGreetingProvider {
* static value(@inject('currentUser') user: string) {
* return `Hello, ${user}`;
* }
* }
* ```
*/
export interface DynamicValueProviderClass<T = unknown> extends Constructor<unknown>, Function {
value: (...args: BoundValue[]) => ValueOrPromise<T>;
}
/**
* Check if the factory is a value factory provider class
* @param factory - A factory function or a dynamic value provider class
*/
export declare function isDynamicValueProviderClass<T = unknown>(factory: unknown): factory is DynamicValueProviderClass<T>;
/**
* Binding represents an entry in the `Context`. Each binding has a key and a

@@ -160,3 +226,2 @@ * corresponding value getter.

get scope(): BindingScope;
private _type?;
/**

@@ -167,7 +232,10 @@ * Type of the binding value getter

private _cache;
private _getValue;
private _valueConstructor?;
private _providerConstructor?;
private _alias?;
private _getValue?;
/**
* The original source value received from `to`, `toClass`, `toDynamicValue`,
* `toProvider`, or `toAlias`.
*/
private _source?;
get source(): ConstantBindingSource<T> | DynamicValueBindingSource<T> | ClassBindingSource<T> | ProviderBindingSource<T> | AliasBindingSource<T> | undefined;
/**
* For bindings bound via `toClass()`, this property contains the constructor

@@ -322,3 +390,3 @@ * function of the class

*/
toDynamicValue(factoryFn: () => ValueOrPromise<T>): this;
toDynamicValue(factory: ValueFactory<T> | DynamicValueProviderClass<T>): this;
/**

@@ -325,0 +393,0 @@ * Bind the key to a value computed by a Provider.

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Binding = exports.isDynamicValueProviderClass = exports.BindingType = exports.BindingScope = void 0;
const tslib_1 = require("tslib");

@@ -14,2 +15,3 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

const interception_proxy_1 = require("./interception-proxy");
const invocation_1 = require("./invocation");
const keys_1 = require("./keys");

@@ -118,2 +120,24 @@ const resolution_session_1 = require("./resolution-session");

/**
* Adapt the ValueFactoryProvider class to be a value factory
* @param provider - ValueFactoryProvider class
*/
function toValueFactory(provider) {
return resolutionCtx => invocation_1.invokeMethod(provider, 'value', resolutionCtx.context, [], {
skipInterceptors: true,
});
}
/**
* Check if the factory is a value factory provider class
* @param factory - A factory function or a dynamic value provider class
*/
function isDynamicValueProviderClass(factory) {
// Not a class
if (typeof factory !== 'function' || !String(factory).startsWith('class ')) {
return false;
}
const valueMethod = factory.value;
return typeof valueMethod === 'function';
}
exports.isDynamicValueProviderClass = isDynamicValueProviderClass;
/**
* Binding represents an entry in the `Context`. Each binding has a key and a

@@ -145,4 +169,8 @@ * corresponding value getter.

get type() {
return this._type;
var _a;
return (_a = this._source) === null || _a === void 0 ? void 0 : _a.type;
}
get source() {
return this._source;
}
/**

@@ -153,3 +181,5 @@ * For bindings bound via `toClass()`, this property contains the constructor

get valueConstructor() {
return this._valueConstructor;
var _a, _b;
return ((_a = this._source) === null || _a === void 0 ? void 0 : _a.type) === BindingType.CLASS
? (_b = this._source) === null || _b === void 0 ? void 0 : _b.value : undefined;
}

@@ -161,3 +191,5 @@ /**

get providerConstructor() {
return this._providerConstructor;
var _a, _b;
return ((_a = this._source) === null || _a === void 0 ? void 0 : _a.type) === BindingType.PROVIDER
? (_b = this._source) === null || _b === void 0 ? void 0 : _b.value : undefined;
}

@@ -239,6 +271,12 @@ /**

const options = resolution_session_1.asResolutionOptions(optionsOrSession);
if (this._getValue) {
if (typeof this._getValue === 'function') {
const result = resolution_session_1.ResolutionSession.runWithBinding(s => {
const optionsWithSession = Object.assign({}, options, { session: s });
return this._getValue(ctx, optionsWithSession);
// We already test `this._getValue` is a function. It's safe to assert
// that `this._getValue` is not undefined.
return this._getValue({
context: ctx,
binding: this,
options: optionsWithSession,
});
}, this, options.session);

@@ -343,7 +381,9 @@ return this._cacheValue(ctx, result);

this._clearCache();
this._getValue = (ctx, options) => {
if (options.asProxyWithInterceptors && this._type !== BindingType.CLASS) {
throw new Error(`Binding '${this.key}' (${this._type}) does not support 'asProxyWithInterceptors'`);
this._getValue = resolutionCtx => {
var _a, _b;
if (resolutionCtx.options.asProxyWithInterceptors &&
((_a = this._source) === null || _a === void 0 ? void 0 : _a.type) !== BindingType.CLASS) {
throw new Error(`Binding '${this.key}' (${(_b = this._source) === null || _b === void 0 ? void 0 : _b.type}) does not support 'asProxyWithInterceptors'`);
}
return getValue(ctx, options);
return getValue(resolutionCtx);
};

@@ -388,3 +428,6 @@ this.emitChangedEvent('value');

}
this._type = BindingType.CONSTANT;
this._source = {
type: BindingType.CONSTANT,
value,
};
this._setValueGetter(() => value);

@@ -411,9 +454,19 @@ return this;

*/
toDynamicValue(factoryFn) {
toDynamicValue(factory) {
/* istanbul ignore if */
if (debug.enabled) {
debug('Bind %s to dynamic value:', this.key, factoryFn);
debug('Bind %s to dynamic value:', this.key, factory);
}
this._type = BindingType.DYNAMIC_VALUE;
this._setValueGetter(ctx => factoryFn());
this._source = {
type: BindingType.DYNAMIC_VALUE,
value: factory,
};
let factoryFn;
if (isDynamicValueProviderClass(factory)) {
factoryFn = toValueFactory(factory);
}
else {
factoryFn = factory;
}
this._setValueGetter(resolutionCtx => factoryFn(resolutionCtx));
return this;

@@ -442,6 +495,8 @@ }

}
this._type = BindingType.PROVIDER;
this._providerConstructor = providerClass;
this._setValueGetter((ctx, options) => {
const providerOrPromise = resolver_1.instantiateClass(providerClass, ctx, options.session);
this._source = {
type: BindingType.PROVIDER,
value: providerClass,
};
this._setValueGetter(({ context, options }) => {
const providerOrPromise = resolver_1.instantiateClass(providerClass, context, options.session);
return value_promise_1.transformValueOrPromise(providerOrPromise, p => p.value());

@@ -463,10 +518,12 @@ });

}
this._type = BindingType.CLASS;
this._setValueGetter((ctx, options) => {
const instOrPromise = resolver_1.instantiateClass(ctor, ctx, options.session);
this._source = {
type: BindingType.CLASS,
value: ctor,
};
this._setValueGetter(({ context, options }) => {
const instOrPromise = resolver_1.instantiateClass(ctor, context, options.session);
if (!options.asProxyWithInterceptors)
return instOrPromise;
return createInterceptionProxyFromInstance(instOrPromise, ctx, options.session);
return createInterceptionProxyFromInstance(instOrPromise, context, options.session);
});
this._valueConstructor = ctor;
return this;

@@ -484,6 +541,8 @@ }

}
this._type = BindingType.ALIAS;
this._alias = keyWithPath;
this._setValueGetter((ctx, options) => {
return ctx.getValueOrPromise(keyWithPath, options);
this._source = {
type: BindingType.ALIAS,
value: keyWithPath,
};
this._setValueGetter(({ context, options }) => {
return context.getValueOrPromise(keyWithPath, options);
});

@@ -523,2 +582,3 @@ return this;

toJSON() {
var _a, _b, _c, _d;
const json = {

@@ -533,11 +593,13 @@ key: this.key,

}
if (this._valueConstructor != null) {
json.valueConstructor = this._valueConstructor.name;
switch ((_a = this._source) === null || _a === void 0 ? void 0 : _a.type) {
case BindingType.CLASS:
json.valueConstructor = (_b = this._source) === null || _b === void 0 ? void 0 : _b.value.name;
break;
case BindingType.PROVIDER:
json.providerConstructor = (_c = this._source) === null || _c === void 0 ? void 0 : _c.value.name;
break;
case BindingType.ALIAS:
json.alias = (_d = this._source) === null || _d === void 0 ? void 0 : _d.value.toString();
break;
}
if (this._providerConstructor != null) {
json.providerConstructor = this._providerConstructor.name;
}
if (this._alias != null) {
json.alias = this._alias.toString();
}
return json;

@@ -544,0 +606,0 @@ }

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextSubscriptionManager = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextTagIndexer = void 0;
const binding_filter_1 = require("./binding-filter");

@@ -9,0 +10,0 @@ /**

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createViewGetter = exports.ContextView = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.BindingCreationPolicy = exports.Context = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

@@ -43,2 +43,4 @@ "use strict";

tslib_1.__exportStar(require("./context"), exports);
tslib_1.__exportStar(require("./context-event"), exports);
tslib_1.__exportStar(require("./context-observer"), exports);
tslib_1.__exportStar(require("./context-subscription"), exports);

@@ -52,3 +54,5 @@ tslib_1.__exportStar(require("./context-view"), exports);

tslib_1.__exportStar(require("./invocation"), exports);
tslib_1.__exportStar(require("./json-types"), exports);
tslib_1.__exportStar(require("./keys"), exports);
tslib_1.__exportStar(require("./provider"), exports);
tslib_1.__exportStar(require("./resolution-session"), exports);

@@ -55,0 +59,0 @@ tslib_1.__exportStar(require("./resolver"), exports);

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.config = void 0;
const binding_key_1 = require("./binding-key");

@@ -9,0 +10,0 @@ const context_view_1 = require("./context-view");

import { MetadataMap } from '@loopback/metadata';
import { Binding } from './binding';
import { Binding, BindingTag } from './binding';
import { BindingFilter, BindingSelector } from './binding-filter';

@@ -11,3 +11,10 @@ import { BindingAddress } from './binding-key';

/**
* A function to provide resolution of injected values
* A function to provide resolution of injected values.
*
* @example
* ```ts
* const resolver: ResolverFunction = (ctx, injection, session) {
* return session.currentBinding?.key;
* }
* ```
*/

@@ -137,3 +144,3 @@ export interface ResolverFunction {

*/
const setter: (bindingKey: BindingAddress<unknown>, metadata?: InjectBindingMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
const setter: (bindingKey: BindingAddress, metadata?: InjectBindingMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
/**

@@ -179,3 +186,3 @@ * Inject the binding object for the given key. This is useful if a binding

*/
const tag: (bindingTag: string | RegExp | Record<string, any>, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
const tag: (bindingTag: BindingTag | RegExp, metadata?: InjectionMetadata | undefined) => (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
/**

@@ -182,0 +189,0 @@ * Inject matching bound values by the filter function

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.inspectInjections = exports.describeInjectedProperties = exports.inspectTargetType = exports.describeInjectedArguments = exports.assertTargetType = exports.Getter = exports.inject = void 0;
const metadata_1 = require("@loopback/metadata");

@@ -225,3 +226,3 @@ const binding_1 = require("./binding");

inject.context = function injectContext() {
return inject('', { decorator: '@inject.context' }, ctx => ctx);
return inject('', { decorator: '@inject.context' }, (ctx) => ctx);
};

@@ -401,10 +402,7 @@ })(inject = exports.inject || (exports.inject = {}));

function inspectTargetType(injection) {
let type = metadata_1.MetadataInspector.getDesignTypeForProperty(injection.target, injection.member);
if (type) {
return type;
if (typeof injection.methodDescriptorOrParameterIndex === 'number') {
const designType = metadata_1.MetadataInspector.getDesignTypeForMethod(injection.target, injection.member);
return designType.parameterTypes[injection.methodDescriptorOrParameterIndex];
}
const designType = metadata_1.MetadataInspector.getDesignTypeForMethod(injection.target, injection.member);
type =
designType.parameterTypes[injection.methodDescriptorOrParameterIndex];
return type;
return metadata_1.MetadataInspector.getDesignTypeForProperty(injection.target, injection.member);
}

@@ -411,0 +409,0 @@ exports.inspectTargetType = inspectTargetType;

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createProxyWithInterceptors = exports.InterceptionHandler = exports.ProxySource = void 0;
const context_1 = require("./context");

@@ -9,0 +10,0 @@ const interceptor_1 = require("./interceptor");

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.composeInterceptors = exports.invokeInterceptors = exports.GenericInterceptorChain = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const debug_1 = tslib_1.__importDefault(require("debug"));

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.registerInterceptor = exports.invokeMethodWithInterceptors = exports.intercept = exports.INTERCEPT_CLASS_KEY = exports.mergeInterceptors = exports.INTERCEPT_METHOD_KEY = exports.globalInterceptor = exports.asGlobalInterceptor = exports.InterceptedInvocationContext = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const metadata_1 = require("@loopback/metadata");

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.invokeMethod = exports.InvocationContext = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const metadata_1 = require("@loopback/metadata");

@@ -9,2 +9,3 @@ import { ConfigurationResolver } from './binding-config';

const PROVIDER = "provider";
const DYNAMIC_VALUE_PROVIDER = "dynamicValueProvider";
/**

@@ -11,0 +12,0 @@ * Type of the artifact

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextBindings = exports.LOCAL_INTERCEPTOR_NAMESPACE = exports.GLOBAL_INTERCEPTOR_NAMESPACE = exports.ContextTags = void 0;
const binding_key_1 = require("./binding-key");

@@ -16,2 +17,3 @@ /**

ContextTags.PROVIDER = 'provider';
ContextTags.DYNAMIC_VALUE_PROVIDER = 'dynamicValueProvider';
/**

@@ -18,0 +20,0 @@ * Type of the artifact

import { Binding } from './binding';
import { Context } from './context';
import { Injection } from './inject';

@@ -159,1 +160,18 @@ import { BoundValue, ValueOrPromise } from './value-promise';

export declare function asResolutionOptions(optionsOrSession?: ResolutionOptionsOrSession): ResolutionOptions;
/**
* Contextual metadata for resolution
*/
export interface ResolutionContext<T = unknown> {
/**
* The context for resolution
*/
readonly context: Context;
/**
* The binding to be resolved
*/
readonly binding: Readonly<Binding<T>>;
/**
* The options used for resolution
*/
readonly options: ResolutionOptions;
}

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.asResolutionOptions = exports.ResolutionSession = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const metadata_1 = require("@loopback/metadata");

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveInjectedProperties = exports.resolveInjectedArguments = exports.instantiateClass = void 0;
const tslib_1 = require("tslib");

@@ -9,0 +10,0 @@ const metadata_1 = require("@loopback/metadata");

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.UUID_PATTERN = exports.uuid = exports.transformValueOrPromise = exports.resolveUntil = exports.tryWithFinally = exports.resolveList = exports.resolveMap = exports.getDeepProperty = exports.isPromiseLike = void 0;
/**

@@ -9,0 +10,0 @@ * This module contains types for values and/or promises as well as a set of

{
"name": "@loopback/context",
"version": "3.7.0",
"version": "3.8.0",
"description": "LoopBack's container for Inversion of Control",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {

@@ -21,14 +23,14 @@ "node": ">=10"

"dependencies": {
"@loopback/metadata": "^2.1.3",
"@loopback/metadata": "^2.1.4",
"@types/debug": "^4.1.5",
"debug": "^4.1.1",
"p-event": "^4.1.0",
"tslib": "^1.11.2",
"tslib": "^2.0.0",
"uuid": "^8.0.0"
},
"devDependencies": {
"@loopback/build": "^5.3.1",
"@loopback/eslint-config": "^6.0.6",
"@loopback/testlab": "^3.1.3",
"@types/bluebird": "^3.5.30",
"@loopback/build": "^5.4.0",
"@loopback/eslint-config": "^7.0.0",
"@loopback/testlab": "^3.1.4",
"@types/bluebird": "^3.5.31",
"@types/node": "^10.17.21",

@@ -49,4 +51,2 @@ "@types/uuid": "^7.0.3",

"README.md",
"index.js",
"index.d.ts",
"dist",

@@ -61,3 +61,3 @@ "src",

},
"gitHead": "50c3f06d942f8bae8f0c32a3775ff98a7498e4fd"
"gitHead": "c8681026187471f0ceeee7c101d66feae295116b"
}

@@ -147,11 +147,12 @@ // Copyright IBM Corp. 2019,2020. All Rights Reserved.

* value equals to the item value or is an array that includes the item value.
* @param itemValue - Tag item value
* @param itemValues - A list of tag item value
*/
export function includesTagValue(itemValue: unknown): TagValueMatcher {
export function includesTagValue(...itemValues: unknown[]): TagValueMatcher {
return tagValue => {
return (
// The tag value equals the item value
tagValue === itemValue ||
// The tag value contains the item value
(Array.isArray(tagValue) && tagValue.includes(itemValue))
return itemValues.some(
itemValue =>
// The tag value equals the item value
tagValue === itemValue ||
// The tag value contains the item value
(Array.isArray(tagValue) && tagValue.includes(itemValue)),
);

@@ -158,0 +159,0 @@ };

@@ -8,3 +8,10 @@ // Copyright IBM Corp. 2018,2019. All Rights Reserved.

import debugFactory from 'debug';
import {Binding, BindingScope, BindingTag, BindingTemplate} from './binding';
import {
Binding,
BindingScope,
BindingTag,
BindingTemplate,
DynamicValueProviderClass,
isDynamicValueProviderClass,
} from './binding';
import {BindingAddress} from './binding-key';

@@ -89,2 +96,3 @@ import {ContextTags} from './keys';

* @param target - Target class, which can be an implementation of `Provider`
* or `DynamicValueProviderClass`
*

@@ -94,3 +102,3 @@ * @typeParam T - Value type

export function asClassOrProvider<T>(
target: Constructor<T | Provider<T>>,
target: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>,
): BindingTemplate<T> {

@@ -101,2 +109,6 @@ // Add a template to bind to a class or provider

asProvider(target)(binding);
} else if (isDynamicValueProviderClass<T>(target)) {
binding.toDynamicValue(target).tag(ContextTags.DYNAMIC_VALUE_PROVIDER, {
[ContextTags.TYPE]: ContextTags.DYNAMIC_VALUE_PROVIDER,
});
} else {

@@ -164,3 +176,3 @@ binding.toClass(target as Constructor<T>);

export function bindingTemplateFor<T>(
cls: Constructor<T | Provider<T>>,
cls: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>,
): BindingTemplate<T> {

@@ -196,2 +208,3 @@ const spec = getBindingMetadata(cls);

provider: 'providers',
dynamicValueProvider: 'dynamicValueProviders',
};

@@ -248,3 +261,3 @@

export function createBindingFromClass<T>(
cls: Constructor<T | Provider<T>>,
cls: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>,
options: BindingFromClassOptions = {},

@@ -251,0 +264,0 @@ ): Binding<T> {

@@ -12,2 +12,3 @@ // Copyright IBM Corp. 2017,2020. All Rights Reserved.

import {createProxyWithInterceptors} from './interception-proxy';
import {invokeMethod} from './invocation';
import {JSONObject} from './json-types';

@@ -18,2 +19,3 @@ import {ContextTags} from './keys';

asResolutionOptions,
ResolutionContext,
ResolutionOptions,

@@ -134,2 +136,52 @@ ResolutionOptionsOrSession,

/**
* Binding source for `to`
*/
export type ConstantBindingSource<T> = {
type: BindingType.CONSTANT;
value: T;
};
/**
* Binding source for `toDynamicValue`
*/
export type DynamicValueBindingSource<T> = {
type: BindingType.DYNAMIC_VALUE;
value: ValueFactory<T> | DynamicValueProviderClass<T>;
};
/**
* Binding source for `toClass`
*/
export type ClassBindingSource<T> = {
type: BindingType.CLASS;
value: Constructor<T>;
};
/**
* Binding source for `toProvider`
*/
export type ProviderBindingSource<T> = {
type: BindingType.PROVIDER;
value: Constructor<Provider<T>>;
};
/**
* Binding source for `toAlias`
*/
export type AliasBindingSource<T> = {
type: BindingType.ALIAS;
value: BindingAddress<T>;
};
/**
* Source for the binding, including the type and value
*/
export type BindingSource<T> =
| ConstantBindingSource<T>
| DynamicValueBindingSource<T>
| ClassBindingSource<T>
| ProviderBindingSource<T>
| AliasBindingSource<T>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -176,8 +228,59 @@ export type TagMap = MapObject<any>;

type ValueGetter<T> = (
ctx: Context,
options: ResolutionOptions,
/**
* A factory function for `toDynamicValue`
*/
export type ValueFactory<T = unknown> = (
resolutionCtx: ResolutionContext,
) => ValueOrPromise<T | undefined>;
/**
* A class with a static `value` method as the factory function for
* `toDynamicValue`.
*
* @example
* ```ts
* import {inject} from '@loopback/context';
*
* export class DynamicGreetingProvider {
* static value(@inject('currentUser') user: string) {
* return `Hello, ${user}`;
* }
* }
* ```
*/
export interface DynamicValueProviderClass<T = unknown>
extends Constructor<unknown>,
Function {
value: (...args: BoundValue[]) => ValueOrPromise<T>;
}
/**
* Adapt the ValueFactoryProvider class to be a value factory
* @param provider - ValueFactoryProvider class
*/
function toValueFactory<T = unknown>(
provider: DynamicValueProviderClass<T>,
): ValueFactory<T> {
return resolutionCtx =>
invokeMethod(provider, 'value', resolutionCtx.context, [], {
skipInterceptors: true,
});
}
/**
* Check if the factory is a value factory provider class
* @param factory - A factory function or a dynamic value provider class
*/
export function isDynamicValueProviderClass<T = unknown>(
factory: unknown,
): factory is DynamicValueProviderClass<T> {
// Not a class
if (typeof factory !== 'function' || !String(factory).startsWith('class ')) {
return false;
}
const valueMethod = (factory as DynamicValueProviderClass).value;
return typeof valueMethod === 'function';
}
/**
* Binding represents an entry in the `Context`. Each binding has a key and a

@@ -206,3 +309,2 @@ * corresponding value getter.

private _type?: BindingType;
/**

@@ -212,12 +314,18 @@ * Type of the binding value getter

public get type(): BindingType | undefined {
return this._type;
return this._source?.type;
}
private _cache: WeakMap<Context, T>;
private _getValue: ValueGetter<T>;
private _getValue?: ValueFactory<T>;
private _valueConstructor?: Constructor<T>;
private _providerConstructor?: Constructor<Provider<T>>;
private _alias?: BindingAddress<T>;
/**
* The original source value received from `to`, `toClass`, `toDynamicValue`,
* `toProvider`, or `toAlias`.
*/
private _source?: BindingSource<T>;
public get source() {
return this._source;
}
/**

@@ -228,3 +336,5 @@ * For bindings bound via `toClass()`, this property contains the constructor

public get valueConstructor(): Constructor<T> | undefined {
return this._valueConstructor;
return this._source?.type === BindingType.CLASS
? this._source?.value
: undefined;
}

@@ -237,3 +347,5 @@

public get providerConstructor(): Constructor<Provider<T>> | undefined {
return this._providerConstructor;
return this._source?.type === BindingType.PROVIDER
? this._source?.value
: undefined;
}

@@ -364,7 +476,13 @@

const options = asResolutionOptions(optionsOrSession);
if (this._getValue) {
if (typeof this._getValue === 'function') {
const result = ResolutionSession.runWithBinding(
s => {
const optionsWithSession = Object.assign({}, options, {session: s});
return this._getValue(ctx, optionsWithSession);
// We already test `this._getValue` is a function. It's safe to assert
// that `this._getValue` is not undefined.
return this._getValue!({
context: ctx,
binding: this,
options: optionsWithSession,
});
},

@@ -476,12 +594,15 @@ this,

*/
private _setValueGetter(getValue: ValueGetter<T>) {
private _setValueGetter(getValue: ValueFactory<T>) {
// Clear the cache
this._clearCache();
this._getValue = (ctx: Context, options: ResolutionOptions) => {
if (options.asProxyWithInterceptors && this._type !== BindingType.CLASS) {
this._getValue = resolutionCtx => {
if (
resolutionCtx.options.asProxyWithInterceptors &&
this._source?.type !== BindingType.CLASS
) {
throw new Error(
`Binding '${this.key}' (${this._type}) does not support 'asProxyWithInterceptors'`,
`Binding '${this.key}' (${this._source?.type}) does not support 'asProxyWithInterceptors'`,
);
}
return getValue(ctx, options);
return getValue(resolutionCtx);
};

@@ -529,3 +650,6 @@ this.emitChangedEvent('value');

}
this._type = BindingType.CONSTANT;
this._source = {
type: BindingType.CONSTANT,
value,
};
this._setValueGetter(() => value);

@@ -553,9 +677,21 @@ return this;

*/
toDynamicValue(factoryFn: () => ValueOrPromise<T>): this {
toDynamicValue(
factory: ValueFactory<T> | DynamicValueProviderClass<T>,
): this {
/* istanbul ignore if */
if (debug.enabled) {
debug('Bind %s to dynamic value:', this.key, factoryFn);
debug('Bind %s to dynamic value:', this.key, factory);
}
this._type = BindingType.DYNAMIC_VALUE;
this._setValueGetter(ctx => factoryFn());
this._source = {
type: BindingType.DYNAMIC_VALUE,
value: factory,
};
let factoryFn: ValueFactory<T>;
if (isDynamicValueProviderClass(factory)) {
factoryFn = toValueFactory(factory);
} else {
factoryFn = factory;
}
this._setValueGetter(resolutionCtx => factoryFn(resolutionCtx));
return this;

@@ -585,8 +721,10 @@ }

}
this._type = BindingType.PROVIDER;
this._providerConstructor = providerClass;
this._setValueGetter((ctx, options) => {
this._source = {
type: BindingType.PROVIDER,
value: providerClass,
};
this._setValueGetter(({context, options}) => {
const providerOrPromise = instantiateClass<Provider<T>>(
providerClass,
ctx,
context,
options.session,

@@ -611,13 +749,15 @@ );

}
this._type = BindingType.CLASS;
this._setValueGetter((ctx, options) => {
const instOrPromise = instantiateClass(ctor, ctx, options.session);
this._source = {
type: BindingType.CLASS,
value: ctor,
};
this._setValueGetter(({context, options}) => {
const instOrPromise = instantiateClass(ctor, context, options.session);
if (!options.asProxyWithInterceptors) return instOrPromise;
return createInterceptionProxyFromInstance(
instOrPromise,
ctx,
context,
options.session,
);
});
this._valueConstructor = ctor;
return this;

@@ -636,6 +776,8 @@ }

}
this._type = BindingType.ALIAS;
this._alias = keyWithPath;
this._setValueGetter((ctx, options) => {
return ctx.getValueOrPromise(keyWithPath, options);
this._source = {
type: BindingType.ALIAS,
value: keyWithPath,
};
this._setValueGetter(({context, options}) => {
return context.getValueOrPromise(keyWithPath, options);
});

@@ -687,11 +829,13 @@ return this;

}
if (this._valueConstructor != null) {
json.valueConstructor = this._valueConstructor.name;
switch (this._source?.type) {
case BindingType.CLASS:
json.valueConstructor = this._source?.value.name;
break;
case BindingType.PROVIDER:
json.providerConstructor = this._source?.value.name;
break;
case BindingType.ALIAS:
json.alias = this._source?.value.toString();
break;
}
if (this._providerConstructor != null) {
json.providerConstructor = this._providerConstructor.name;
}
if (this._alias != null) {
json.alias = this._alias.toString();
}
return json;

@@ -698,0 +842,0 @@ }

@@ -43,4 +43,13 @@ // Copyright IBM Corp. 2017,2020. All Rights Reserved.

// TODO(rfeng): We may want to align it with `ValueFactory` interface that takes
// an argument of `ResolutionContext`.
/**
* A function to provide resolution of injected values
* A function to provide resolution of injected values.
*
* @example
* ```ts
* const resolver: ResolverFunction = (ctx, injection, session) {
* return session.currentBinding?.key;
* }
* ```
*/

@@ -381,3 +390,3 @@ export interface ResolverFunction {

export const context = function injectContext() {
return inject('', {decorator: '@inject.context'}, ctx => ctx);
return inject('', {decorator: '@inject.context'}, (ctx: Context) => ctx);
};

@@ -609,18 +618,15 @@ }

export function inspectTargetType(injection: Readonly<Injection>) {
let type = MetadataInspector.getDesignTypeForProperty(
injection.target,
injection.member!,
);
if (type) {
return type;
if (typeof injection.methodDescriptorOrParameterIndex === 'number') {
const designType = MetadataInspector.getDesignTypeForMethod(
injection.target,
injection.member!,
);
return designType.parameterTypes[
injection.methodDescriptorOrParameterIndex as number
];
}
const designType = MetadataInspector.getDesignTypeForMethod(
return MetadataInspector.getDesignTypeForProperty(
injection.target,
injection.member!,
);
type =
designType.parameterTypes[
injection.methodDescriptorOrParameterIndex as number
];
return type;
}

@@ -627,0 +633,0 @@

@@ -15,2 +15,3 @@ // Copyright IBM Corp. 2018,2020. All Rights Reserved.

export const PROVIDER = 'provider';
export const DYNAMIC_VALUE_PROVIDER = 'dynamicValueProvider';

@@ -17,0 +18,0 @@ /**

@@ -9,2 +9,3 @@ // Copyright IBM Corp. 2018,2020. All Rights Reserved.

import {Binding} from './binding';
import {Context} from './context';
import {Injection} from './inject';

@@ -370,1 +371,19 @@ import {BoundValue, tryWithFinally, ValueOrPromise} from './value-promise';

}
/**
* Contextual metadata for resolution
*/
export interface ResolutionContext<T = unknown> {
/**
* The context for resolution
*/
readonly context: Context;
/**
* The binding to be resolved
*/
readonly binding: Readonly<Binding<T>>;
/**
* The options used for resolution
*/
readonly options: ResolutionOptions;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc