New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

toggle-kit

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toggle-kit - npm Package Compare versions

Comparing version
1.8.2
to
1.9.0
+3
-3
lib/helpers/isEnabled.d.ts
import { FeatureFlag } from "../types/FeatureFlag";
import { Property } from "../types/Property";
export declare const isEnabled: <FlagNames>({ featureName, flags, property, }: {
export declare const isEnabled: <PropertyNames extends string, FlagNames>({ featureName, flags, property, }: {
featureName: FlagNames;
flags: Map<FlagNames, FeatureFlag<FlagNames>>;
property: Property;
flags: Map<FlagNames, FeatureFlag<PropertyNames, FlagNames>>;
property: Property<PropertyNames>;
}) => boolean;

@@ -5,6 +5,6 @@ import { FeatureFlagClient } from "./types/FeatureFlagClient";

import { Condition } from "./types/Condition";
export declare function createFeatureFlagClient<FlagNames>({ property, flags: initialFlags, }: {
property: Property;
flags: FeatureFlag<FlagNames>[];
export declare function createFeatureFlagClient<PropertyNames extends string, FlagNames>({ property, flags: initialFlags, }: {
property: Property<PropertyNames>;
flags: FeatureFlag<PropertyNames, FlagNames>[];
}): FeatureFlagClient<FlagNames>;
export { type FeatureFlagClient, type Property, type FeatureFlag, type Condition, };

@@ -1,21 +0,21 @@

export type Condition = {
export type Condition<PropertyNames> = {
type: "equal" | "contains" | "startsWith" | "endsWith";
attribute: string;
attribute: PropertyNames;
expectedValue: string;
} | {
type: "equal" | "greaterThan" | "lessThan";
attribute: string;
attribute: PropertyNames;
expectedValue: number;
} | {
type: "equal";
attribute: string;
attribute: PropertyNames;
expectedValue: boolean;
} | {
type: "percentage";
attribute: string;
attribute: PropertyNames;
expectedValue: number;
} | {
type: "regex";
attribute: string;
attribute: PropertyNames;
expectedValue: RegExp;
};
import { Condition } from "./Condition";
export type FeatureFlag<FlagNames = {}> = {
export type FeatureFlag<PropertyNames = {}, FlagNames = {}> = {
name: FlagNames;
condition: Condition;
condition: Condition<PropertyNames>;
};

@@ -1,3 +0,1 @@

export type Property = {
[key: string]: string | number | boolean;
};
export type Property<PropertyNames extends string> = Record<PropertyNames, string | number | boolean>;
{
"name": "toggle-kit",
"version": "1.8.2",
"version": "1.9.0",
"description": "A feature flag library which runs fully on the service itself, without any dependencies.",

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