Releases: sindresorhus/ow
Releases · sindresorhus/ow
v0.16.0
v0.15.1
- Include the
dev-only
file in the package 64ab6b8
v0.15.0
v0.14.0
Breaking
- Require Node.js 8 25be9db
Enhancements
- Export shim if running on browser in production (#129) acc5c9b
Note: If you intend on usingow
for development purposes only, userequire('ow/dev-only')
instead of the usualimport 'ow'
, and run the bundler withNODE_ENV
set toproduction
(e.g.$ NODE_ENV="production" parcel build index.js
). This will makeow
automatically export a shim when running in production, which should result in a significantly lower bundle size.
v0.13.2
v0.13.1
v0.13.0
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:
v0.12.0
v0.11.1
v0.11.0
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.