Skip to content

Releases: sindresorhus/ow

v0.16.0

13 Feb 19:07
Compare
Choose a tag to compare

Breaking

Enhancements

  • Export ArgumentError 952390a
  • Allow using ow.any with ow.array.ofType ec59a5c

Fixes

  • Fix usage in the browser when using Webpack 0c0f64b

v0.15.1...v0.16.0

v0.15.1

25 Jan 12:23
Compare
Choose a tag to compare
  • Include the dev-only file in the package 64ab6b8

v0.15.0...v0.15.1

v0.15.0

12 Nov 07:04
Compare
Choose a tag to compare

v0.14.0...v0.15.0

v0.14.0

20 Oct 11:32
Compare
Choose a tag to compare

Breaking

Enhancements

  • Export shim if running on browser in production (#129) acc5c9b
    Note: If you intend on using ow for development purposes only, use require('ow/dev-only') instead of the usual import 'ow', and run the bundler with NODE_ENV set to production (e.g. $ NODE_ENV="production" parcel build index.js). This will make ow automatically export a shim when running in production, which should result in a significantly lower bundle size.

v0.13.2...v0.14.0

v0.13.2

17 May 17:16
Compare
Choose a tag to compare
  • Fix missing dependency for TypeScript users (#149) 3846bb2

v0.13.1...v0.13.2

v0.13.1

13 May 14:51
Compare
Choose a tag to compare

Fixes:

  • Fix type definition directory in package.json 3d19c6b

v0.13.0...v0.13.1

v0.13.0

12 May 10:06
Compare
Choose a tag to compare

Enhancements:

  • Add support for a custom validation function (#137) 702c283
  • Add string.url predicate (#140) 0a0972c
  • Add number.oneOf predicate (#132) e4d581e
  • Use the package.json "browser" field to toggle Node.js-specific functionality (#145) 3c42d59

Fixes:

  • Handle missing object property in exactShape predicate (#142) 5421063
  • Only call captureStackTrace when possible (#141) e697ccd

v0.12.0...v0.13.0

v0.12.0

01 Feb 08:37
Compare
Choose a tag to compare

v0.11.1...v0.12.0

v0.11.1

29 Jan 12:16
Compare
Choose a tag to compare
  • Check for optional first before running validator (#125) 3de78ad

v0.11.0...v0.11.1

v0.11.0

27 Jan 18:29
Compare
Choose a tag to compare

Add support for optional predicates (#124) 44272ab 🎉

This means you can now validate the input if it exists and ignore it if it doesn't.

// This passes
ow(2, ow.optional.number);

// This passes too
ow(undefined, ow.optional.number);

// This fails
ow(true, ow.optional.number);

We chose to only allow undefined and not null as that's how default parameters work too.

v0.10.0...v0.11.0