Releases: losandes/polyn-blueprint
feat: adds es module support
feat: adds is.arrayOf for evaluting arrays of primitives
The undocumented is feature in blueprint is used by other polyn libraries. This adds the ability to evaluate arrays of primitives. Note that this isn't a change to the blueprint evaluation if arrays, which support custom validation in addition to primitives. It's only an addition to the is feature set.
chore: updates dependencies
This is a maintenance release that updates the dependencies, all of which are dev dependencies, so there is no functional difference in the production code.
Adds `is.[not].primitive` to the Type File
Adds is.primitive
, and is.not.primitive
to the TypeScript Type File
Adds `is.[not].primitive` To `is`
Adds is.primitive
and is.not.primitive
to is
The following results from is.getType
will return true
for
is.primitive
. Everything else returns false
.
- 'boolean',
- 'null',
- 'undefined',
- 'number',
- 'bigint',
- 'string',
- 'symbol'
Fixes Typings and Upgrades Packages
- Fixes is Typings
The getType
output type was set to boolean, when it should have been
string, and getType
was defined on not
in the Type file, but it
isn't defined there in JS.
- Upgrades Packages
Upgrades all packages, but more specifically, gets the latest
eslint-utils to address GHSA-3gx7-xhv7-5mx3
Runs npm audit fix And Updates lodash
This package only has devDependencies, so consumers
were not subject to any of the vulnerabilities that
are fixed in this update.
Adds `from` to `optional` and `Blueprint.required`
- Adds
required
to blueprint, which can be used withfrom
to map the
input properties to different output properties. This is intendeded to
be used in conjunction with immutable. - Adds the same
from
behavior tooptional
Adds Partial Output To ValidationContext
Adds the value that will be returned by validate
to the
ValidationContext, so inline validators can base their output and
validity on previously processed properties.
Adds is.asyncFunc
and is.promise
to the TypeScript definitions.
Updates documentation for the ValidationContext, and to all TypeScript
interfaces.
Reduces verbosity when returning IValueOrError, so consumers don't have
to set a bunch of null properties. Blueprint guarantees them for us, so
no reason to set them explicitly.
Adds Validation For AyncFunction and Promise
- Adds ability to check if
is.asyncFunction
, oris.promise
, as well as
validators for these. - Refactors
is.getType
so it will always return the lowered, printed
type (i.e. an object that prints as [object Boolean] will return
'boolean'). - Adds optional Strict Type support for
ValueOrError<T>
. - Adds optional Strict Type to remaining interfaces: IBlueprint and
IValidationContext. - Adds examples for all Strictly Typed interfaces