UNPKG

@fast-check/poisoning

Version:

Set of utilities to ease detection and revert of poisoning

20 lines (19 loc) 870 B
/** Alias for Map.prototype.get */ export declare const GetSymbol: unique symbol; /** Alias for Map.prototype.has */ export declare const HasSymbol: unique symbol; /** Alias for Map.prototype.entries */ export declare const EntriesSymbol: unique symbol; /** Alias for Map.prototype.set */ export declare const SetSymbol: unique symbol; /** Map instance enriched with aliased methods that cannot be poisoned */ export type PoisoningFreeMap<K, V> = Map<K, V> & { [GetSymbol]: (key: K) => V | undefined; [HasSymbol]: (key: K) => boolean; [EntriesSymbol]: () => IterableIterator<[K, V]>; [SetSymbol]: (key: K, value: V) => Map<K, V>; }; /** Factory responsible to build instances of PoisoningFreeMap */ export declare const PoisoningFreeMap: { from<K, V>(ins?: readonly (readonly [K, V])[] | Iterable<readonly [K, V]> | null): PoisoningFreeMap<K, V>; };