Never Play Matchmaker

    set-enhance
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    set-enhance

    This library extends JS Set prototype with methods like map(), reduce() and others.

    Those methods work just like the similiarly named Array methods.

    List of added methods:

    • any (Array.some() counterpart)
    • every
    • filter
    • join
    • map
    • reduce
    • reduceRight
    • toString

    This library also includes TypeScript definitions, to use those import and use function newSet for creating new Set instances (recommended) or import EnhancedSet type definition and assert it on to regular Set instances:

    import { newSet } from "set-enhance";
    
    const mySet = newSet([1, 2, 3]);
    // const mySet: EnhancedSet<number, Set<number>>

    or

    import { EnhancedSet } from "set-enhance";
    const mySet: EnhancedSet<number> = new Set([1, 2, 3]) as any;
    // const mySet: EnhancedSet<number, Set<number>>

    Install

    npm i set-enhance

    DownloadsWeekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    28 kB

    Total Files

    14

    Last publish

    Collaborators

    • ncpa0cpl