import { VoltisoUtilError } from '../../_/index.js'; import type { AlsoAccept } from '../../type/AlsoAccept.js'; declare const PrototypePollutionError_base: typeof VoltisoUtilError; export declare class PrototypePollutionError> extends PrototypePollutionError_base { obj: Obj; key: Key; constructor(key: Key, options?: ErrorOptions | undefined); constructor(obj: Obj, key: Key, options?: ErrorOptions | undefined); constructor(...args: readonly [Key] | readonly [Obj, Key] | readonly [Key, ErrorOptions | undefined] | readonly [Obj, Key, ErrorOptions | undefined]); } /** * Check if `obj[key]` is not causing Prototype Pollution, for any `obj` * https://github.com/substack/minimist/blob/7efb22a518b53b06f5b02a1038a88bd6290c2846/index.js#L247 * * @example * * ```ts * isPolluting(propertyName) // will throw on prototype pollution * ``` * * @param key - Any property name * @returns `true` if `obj[key]` could cause prototype pollution, for any `obj` * @throws `PrototypePollutionError` on prototype pollution */ export declare function isPolluting(key: keyof any): key is 'constructor' | '__proto__'; /** * Check if `obj[key]` is causing Prototype Pollution * https://github.com/substack/minimist/blob/7efb22a518b53b06f5b02a1038a88bd6290c2846/index.js#L247 * * @example * * ```ts * isPolluting(object, propertyName) // will throw if Prototype Pollution is possible * ``` * * @param obj - Object * @param key - Any property name * @returns `true` if `obj[key]` would cause Prototype Pollution */ export declare function isPolluting(obj: Obj, key: keyof Obj | AlsoAccept): key is 'constructor' | '__proto__'; export declare function isPolluting(...args: readonly [keyof any] | readonly [object, keyof any]): boolean; /** * Throw if `obj[key]` could cause Prototype Pollution, for any `obj` * * @param key - Any property name * @throws `PrototypePollutionError` on prototype pollution */ export declare function assertNotPolluting(key: Key): asserts key is Key extends 'constructor' ? never : Key extends '__proto__' ? never : Key; /** * Throw if `obj[key]` would cause Prototype Pollution * * @param obj - An object * @param key - Any property name * @throws `PrototypePollutionError` on prototype pollution */ export declare function assertNotPolluting>(obj: Obj, key: Key): asserts key is Key extends 'constructor' ? never : Key extends '__proto__' ? never : Key; export {}; //# sourceMappingURL=isPolluting.d.ts.map