Bot releases are visible (Hide)
dev-only
file in the package 64ab6b8https://github.com/sindresorhus/ow/compare/v0.15.0...v0.15.1
not
messages (#130) 5b74b14https://github.com/sindresorhus/ow/compare/v0.14.0...v0.15.0
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.https://github.com/sindresorhus/ow/compare/v0.13.2...v0.14.0
https://github.com/sindresorhus/ow/compare/v0.13.1...v0.13.2
Fixes:
https://github.com/sindresorhus/ow/compare/v0.13.0...v0.13.1
Enhancements:
string.url
predicate (#140) 0a0972cnumber.oneOf
predicate (#132) e4d581eFixes:
exactShape
predicate (#142) 5421063https://github.com/sindresorhus/ow/compare/v0.12.0...v0.13.0
https://github.com/sindresorhus/ow/compare/v0.11.1...v0.12.0
https://github.com/sindresorhus/ow/compare/v0.11.0...v0.11.1
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.
https://github.com/sindresorhus/ow/compare/v0.10.0...v0.11.0
Ow now infers the label automatically on Node.js. For browser usage, the .label()
method is removed in favor of an optional second ow()
argument. 7eb02af
If you only use Ow in Node.js, you can change it like this:
- ow(foo, ow.string.minLength(5).label('foo'));
+ ow(foo, ow.string.minLength(5));
If you need browser support, you can change it like this;
- ow(foo, ow.string.minLength(5).label('foo'));
+ ow(foo, 'foo', ow.string.minLength(5));