How to use @esfx/internal-deprecate - 10 common examples

To help you get started, we’ve selected a few @esfx/internal-deprecate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esfx / esfx / packages / collection-core / src / index.ts View on Github external
}
}

export declare namespace KeyedMultiCollection {
    /**
     * A well-known symbol used to define the `KeyedMultiCollection#[KeyedMultiCollection.delete]` method.
     */
    const _delete: unique symbol;
    export { _delete as delete };
}

deprecateProperty(ReadonlyCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isIndexedCollection", "Use 'IndexedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isKeyedCollection", "Use 'KeyedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isKeyedMultiCollection", "Use 'KeyedMultiCollection.hasInstance' instead.");
github esfx / esfx / packages / equatable / src / index.ts View on Github external
}
            }
            return 0;
        }
    };

    /**
     * Creates a `Comparer` from a comparison function.
     */
    export function create(comparison: Comparison): Comparer {
        return { compare: comparison };
    }
}

deprecateProperty(Equatable, "isEquatable", "Use 'Equatable.hasInstance' instead.");
deprecateProperty(Comparable, "isComparable", "Use 'Comparable.hasInstance' instead.");
deprecateProperty(StructuralEquatable, "isStructuralEquatable", "Use 'StructuralEquatable.hasInstance' instead.");
deprecateProperty(StructuralComparable, "isStructuralComparable", "Use 'StructuralComparable.hasInstance' instead.");
github esfx / esfx / packages / collection-core / src / index.ts View on Github external
export declare namespace KeyedMultiCollection {
    /**
     * A well-known symbol used to define the `KeyedMultiCollection#[KeyedMultiCollection.delete]` method.
     */
    const _delete: unique symbol;
    export { _delete as delete };
}

deprecateProperty(ReadonlyCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isIndexedCollection", "Use 'IndexedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isKeyedCollection", "Use 'KeyedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isKeyedMultiCollection", "Use 'KeyedMultiCollection.hasInstance' instead.");
github esfx / esfx / packages / collection-core / src / index.ts View on Github external
export declare namespace KeyedMultiCollection {
    /**
     * A well-known symbol used to define the `KeyedMultiCollection#[KeyedMultiCollection.delete]` method.
     */
    const _delete: unique symbol;
    export { _delete as delete };
}

deprecateProperty(ReadonlyCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isIndexedCollection", "Use 'IndexedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isKeyedCollection", "Use 'KeyedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isKeyedMultiCollection", "Use 'KeyedMultiCollection.hasInstance' instead.");
github esfx / esfx / packages / cancelable / src / index.ts View on Github external
export class CancelError extends Error {
    constructor(message?: string) {
        super(message || "Operation was canceled");
    }
}

Object.defineProperty(CancelError.prototype, "name", {
    enumerable: false,
    configurable: true,
    writable: true,
    value: "CancelError",
});

deprecateProperty(Cancelable, 'isCancelable', "Use 'Cancelable.hasInstance' instead.");
deprecateProperty(CancelableSource, 'isCancelable', "Use 'Cancelable.hasInstance' instead.");
deprecateProperty(CancelableSource, 'isCancelableSource', "Use 'CancelableSource.hasInstance' instead.");
github esfx / esfx / packages / collection-core / src / index.ts View on Github external
deprecateProperty(Collection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isIndexedCollection", "Use 'IndexedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isKeyedCollection", "Use 'KeyedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isKeyedMultiCollection", "Use 'KeyedMultiCollection.hasInstance' instead.");
github esfx / esfx / packages / disposable / src / index.ts View on Github external
}
    }

    export const name = "AsyncDisposable";

    /**
     * Determines whether a value is [[AsyncDisposable]].
     */
    export function hasInstance(value: unknown): value is AsyncDisposable {
        return isObject(value)
            && AsyncDisposable.asyncDispose in value;
    }
}

deprecateProperty(Disposable, "isDisposable", "Use 'Disposable.hasInstance' instead.");
deprecateProperty(AsyncDisposable, "isAsyncDisposable", "Use 'AsyncDisposable.hasInstance' instead.");
github esfx / esfx / packages / collection-core / src / index.ts View on Github external
deprecateProperty(Collection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(Collection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(ReadonlyIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(FixedSizeIndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyCollection", "Use 'ReadonlyCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isReadonlyIndexedCollection", "Use 'ReadonlyIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isFixedSizeIndexedCollection", "Use 'FixedSizeIndexedCollection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isCollection", "Use 'Collection.hasInstance' instead.");
deprecateProperty(IndexedCollection, "isIndexedCollection", "Use 'IndexedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isReadonlyKeyedCollection", "Use 'ReadonlyKeyedCollection.hasInstance' instead.");
deprecateProperty(KeyedCollection, "isKeyedCollection", "Use 'KeyedCollection.hasInstance' instead.");
deprecateProperty(ReadonlyKeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isReadonlyKeyedMultiCollection", "Use 'ReadonlyKeyedMultiCollection.hasInstance' instead.");
deprecateProperty(KeyedMultiCollection, "isKeyedMultiCollection", "Use 'KeyedMultiCollection.hasInstance' instead.");
github esfx / esfx / packages / equatable / src / index.ts View on Github external
return 0;
        }
    };

    /**
     * Creates a `Comparer` from a comparison function.
     */
    export function create(comparison: Comparison): Comparer {
        return { compare: comparison };
    }
}

deprecateProperty(Equatable, "isEquatable", "Use 'Equatable.hasInstance' instead.");
deprecateProperty(Comparable, "isComparable", "Use 'Comparable.hasInstance' instead.");
deprecateProperty(StructuralEquatable, "isStructuralEquatable", "Use 'StructuralEquatable.hasInstance' instead.");
deprecateProperty(StructuralComparable, "isStructuralComparable", "Use 'StructuralComparable.hasInstance' instead.");
github esfx / esfx / packages / cancelable / src / index.ts View on Github external
}

export class CancelError extends Error {
    constructor(message?: string) {
        super(message || "Operation was canceled");
    }
}

Object.defineProperty(CancelError.prototype, "name", {
    enumerable: false,
    configurable: true,
    writable: true,
    value: "CancelError",
});

deprecateProperty(Cancelable, 'isCancelable', "Use 'Cancelable.hasInstance' instead.");
deprecateProperty(CancelableSource, 'isCancelable', "Use 'Cancelable.hasInstance' instead.");
deprecateProperty(CancelableSource, 'isCancelableSource', "Use 'CancelableSource.hasInstance' instead.");

@esfx/internal-deprecate

This package provides internal utilities for '@esfx' and is not intended for use in user-code.

Apache-2.0
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular @esfx/internal-deprecate functions

Similar packages