Skip to content

Releases: ahrjarrett/any-ts

v0.45.0

01 Jun 11:24
a8a5293
Compare
Choose a tag to compare

Minor Changes

  • 5e1829b: fix: expose any_* constructors

    Fixes:

    Exported variable 'x' has or is using name 'any_dict' from external module "node_modules/any-ts/dist/index" but cannot be named.
    

v0.44.2

26 May 15:55
60caf29
Compare
Choose a tag to compare

Patch Changes

  • 9065c4b: fix: account for contravariance in index signature of any.dict

v0.44.1

24 May 05:06
7b75a80
Compare
Choose a tag to compare

Patch Changes

  • 9d96ba7: feat: adds has.oneMember

v0.44.0

24 May 03:55
70ce968
Compare
Choose a tag to compare

Minor Changes

  • d2c28aa: feat: adds has module

    • has.oneProperty lets you express a constraint that the input type contains exactly 1 property. For example:

      /**
       * @example
       *  const one = singleton({ a: 1 })       // ✅
      
       *  const zero = singleton({})            // 🚫
       *  //    ^? const zero: never
       *  const two = singleton({ a: 1, b: 2 }) // 🚫
       *  //    ^? const two: never
       */
      declare function singleton<const T extends has.oneProperty<T>>(
        objectWithExactlyOneProperty: T
      ): T;

      Note: has.oneProperty accepts 2 additional optional type parameters

      1. an invariant, which allows you to apply an additional constraint on the type of the property itself; and
      2. a "debug" flag, which, if non-never, changes the behavior of has.oneProperty to raise a custom TypeError if T fails to satisfy the constraint
    • has.oneElement

      /**
       * @example
       *  const one = singleton([1])    // ✅
       *  //    ^? const one: readonly [1]
       *
       *  const zero = singleton([])    // 🚫
       *  //    ^? const zero: never
       *  const two = singleton([1, 2]) // 🚫
       *  //    ^? const two: never
       */
      declare function oneNumber<const T extends has.oneElement<T, number>>(
        tupleContainingOneNumber: T
      ): T;

      Note: like has.oneProperty, has.oneElement also accepts 2 additional optional type parameters

      1. an invariant, which allows you to apply an additional constraint on the type of the element itself; and,
      2. a "debug" flag, which, if non-never, changes the behavior of has.oneElement to raise a custom TypeError if T fails to satisfy the constraint

v0.43.7

21 May 14:47
8c65d4b
Compare
Choose a tag to compare

Patch Changes

  • f2e8ef6: docs: fix empty.string docs (moves them to the right jsdoc node)

v0.43.6

21 May 13:50
350fa18
Compare
Choose a tag to compare

Patch Changes

  • 9fcdbda: - feat: separates empty from nonempty
    • docs: documents empty and nonempty namespaces
    • feat: adds simplified TypeError module (type-error/type-error.ts)
    • todo: creates this todo: #132

v0.43.5

21 May 03:14
d3db1fc
Compare
Choose a tag to compare

Patch Changes

  • 10981fe: fix: string.camel and string.pascal handle non-finite strings now

v0.43.4

19 May 15:12
b9787a4
Compare
Choose a tag to compare

v0.43.3

19 May 01:05
cb9aedf
Compare
Choose a tag to compare

Patch Changes

  • 6dccbe0: 24e3d93 * @ahrjarrett/v0.43.3 feat: adds simplified Kind implementation (available now under experimental.Kind)
  • 6dccbe0: feat: adds any.four, mut.four, exports experimental Kind encoding from experimental.Kind

v0.43.2

13 May 14:43
12795d7
Compare
Choose a tag to compare

Patch Changes

  • 746458e: feat: adds some.class, any.instanceOf