Module
simple, easy-to-use, and declarative input validator; supports Node.js, TypeScript, and Deno
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
4.0.0-rc.1 - 2022-05-27
Changed
{ifUndefined: undefined}
acceptsundefined
input value, and keep it as-is.- rename
ValueSchemaError.cause
toValueSchemaError.rule
- …because
Error.cause
is stage 4 - https://github.com/tc39/proposal-error-cause
- …because
Others
- support Deno 1.20 - 1.22
3.1.1 - 2022-05-25
Others
- support Node.js 16
- support TypeScript 4.5 - 4.7
- support Deno 1.15 - 1.19
- support Windows Server 2022, macOS Big Sur 11, macOS Monterey 12, and Ubuntu 22.04
3.1.0 - 2021-09-27
Added
vs.enumeration()
Fixed
- TypeScript example in README
- Option types
Others
- add JSDoc comments for parameters
- support TypeScript 4.2 - 4.4
- support Deno 1.7 - 1.14
3.0.0 - 2020-12-09
Others
- support TypeScript 4.1
- support Deno 1.6
3.0.0-rc.15 - 2020-11-08
Others
- support TypeScript 4.0
- support Deno 1.3, 1.4, 1.5
3.0.0-rc.14 - 2020-07-26
Added
- UUID pattern;
vs.STRING.PATTERN.UUID
3.0.0-rc.13 - 2020-07-12
Fixed
- revive NPM hosting
3.0.0-rc.12 - 2020-07-11
Others
- host Deno modules on GitHub: https://github.com/denoland/deno_website2/pull/1302
3.0.0-rc.11 - 2020-07-09
Fixed
- type error of
ifUndefined
, such asemail({ifUndefined: "", ifNull: ""})
Others
- support TypeScript>=3.4.1
3.0.0-rc.10 - 2020-07-08
Fixed
- type errors in TypeScript
3.0.0-rc.9 - 2020-06-18
Changed
- make
converter
non-nullable
Fixed
- support nullable cases
{ifUndefined: null}
{ifNull: null}
{ifEmptyString: null}
3.0.0-rc.8 - 2020-06-13
Changed
- enabled property completion and type inference, without explicit type specification
3.0.0-rc.7 - 2020-06-11
Fixed
- TypeScript Generics
3.0.0-rc.6 - 2020-06-11
Fixed
- ❌CEIL_RZ ⭕CEIL_RI (Round towards Infinity)
3.0.0-rc.5 - 2020-05-17
Fixed
- Deno module name
3.0.0-rc.4 - 2020-05-16
Added
- supports Deno
3.0.0-rc.3 - 2020-02-28
Added
converter
option
Changed
isValueSchemaError(err)
toValueSchemaError.is(err)
Fixed
- generic in
array({each})
3.0.0-rc.2 - 2020-02-16
Fixed
- error with transpiled code by tsc/babel
3.0.0-rc.1 - 2020-02-16
Changed
- use object for option
.fit()
to.applySchemaObject()
/.applyTo()
2.2.6 - 2020-02-14
Others
- update version of Checkout action
- add example tests
2.2.5 - 2019-09-22
Fixed
- location of ambient declaration file
2.2.4 - 2019-09-22
Fixed
- CI for publish
2.2.3 - 2019-09-22
Fixed
- CI for publish
2.2.2 - 2019-09-22
Fixed
- add
--unsafe-perm
option for GitHub Actions
2.2.1 - 2019-09-22
Fixed
actions/npm
version
2.2.0 - 2019-09-22
Fixed
- Support Node.js v4.0.0 again!
Others
- use GitHub Actions for CI
- distribute only built files
- document about ES Modules in Node.js v8 and v12
2.1.0 - 2019-07-21
Others
- update dependencies
- Support Node.js v10/v12
2.0.0 - 2019-04-20
Changed
.adjust()
to.fit()
Removed
vs.number().map()
vs.string().map()
vs.numericString().map()
Others
- rename to
value-schema
1.4.0 - 2019-04-15
Added
adjuster.number().acceptFullWidth()
adjuster.numericString().fullWidthToHalf()
adjuster.number().convert()
adjuster.string().convert()
adjuster.numericString().convert()
Deprecated
adjuster.number().map()
adjuster.string().map()
adjuster.numericString().map()
1.3.1 - 2019-03-09
Added
adjuster.number().map()
adjuster.string().map()
adjuster.numericString().map()
1.3.0 - 2019-01-26
Others
- update packages
- export constraints type for TypeScript
1.2.0 - 2018-12-08
Changed
adjuster.array<T>()
returns typeT[]
1.1.0 - 2018-12-08
Changed
adjuster.adjust()
andadjuster.object()
returns typeany
, accept generics for type-safeadjuster.array()
returns typeany[]
, accepts generics for type-safe
1.0.1 - 2018-12-04
Security
1.0.0 - 2018-10-08
- First stable release!
1.0.0-rc.7 - 2018-09-15
Removed
adjuster.AdjusterError
- reverted v1.0.0-rc.6
1.0.0-rc.6 - 2018-09-10
Added
adjuster.AdjusterError
- for TypeScriptadjuster.STRING.PATTERN.HTTP
- for test of HTTP/HTTPS URL
Changed
- collection types for TypeScript code
1.0.0-rc.5 - 2018-09-02
Removed
adjuster.ipv4()
- useadjuster.string().pattern(adjuster.STRING.PATTERN.IPV4)
insteadadjuster.ipv6()
- useadjuster.string().pattern(adjuster.STRING.PATTERN.IPV6)
instead
Fixed
- RegExp pattern;
adjuster.STRING.PATTERN.URI
1.0.0-rc.4 - 2018-08-30
Changed
adjuster.number().adjust([])
causesadjuster.CAUSE.TYPE
1.0.0-rc.3 - 2018-08-28
Others
- documents proofreading
- some minor changes of JSDoc and
index.d.ts
1.0.0-rc.2 - 2018-08-25
Changed
adjuster.string().pattern()
andadjuster.email().pattern()
accept only RegExp (reject string)
1.0.0-rc.1 - 2018-08-23
Fixed
- method to publish
0.16.0 - 2018-08-21
Added
EMAIL
,IPV4
,IPV6
toadjuster.STRING.PATTERN
Changed
- change loading method for CJS; use
var adjuster = require("adjuster");
instead ofvar adjuster = require("adjuster").default;
Fixed
- type of
adjuster.STRING.PATTERN.URI
0.15.1 - 2018-08-19
Others
- enhance
index.d.ts
for TypeScript products
0.15.0 - 2018-08-18
Added
adjuster.boolean()
adjuster.number().strict()
adjuster.string().strict()
adjuster.array()
adjuster.object()
err.keyStack
indicates path to key that caused error; for nested object or array
Changed
- cause an error
adjuster.CAUSE.TYPE
instead ofadjuster.CAUSE.NOT_OBJECT
- reject array and object in
adjuster.string()
- in
numericString
, when.joinArray()
is not called and an array is passed, cause an erroradjuster.CAUSE.TYPE
instead ofadjuster.CAUSE.PATTERN
- rename
STRING_PATTERN
toSTRING.PATTERN
,NUMERIC_STRING_CHECKSUM_ALGORITHM
toNUMERIC_STRING.CHECKSUM_ALGORITHM
Fixed
- installation error!
Removed
adjuster.numberArray()
- useadjuster.array()
insteadadjuster.stringArray()
- useadjuster.array()
insteaderr.key
- useerr.keyStack
instead
0.14.0 - 2018-08-11
Added
- Introduction in
README.md
Changed
- cause an error
adjuster.CAUSE.NOT_OBJECT
wheninput
type ofadjuster.adjust()
is not an object
Fixed
- build error in Windows
Others
- support ES Modules (
*.mjs
)
0.13.0 - 2018-07-20
Added
adjuster.numberArray().eachInteger()
Fixed
adjuster.numberArray().eachIn()
in JSDoc (should beadjuster.numberArray().eachOnly()
)adjuster.stringArray().eachIn()
in JSDoc (should beadjuster.stringArray().eachOnly()
)
0.12.0 - 2018-07-18
Added
adjuster.STRING_PATTERN
, regular expressions foradjuster.string().pattern()
adjuster.number().integer()
Fixed
adjuster.number().adjust(true)
throws an error; should return1
0.11.0 - 2018-07-16
Added
adjuster.number().acceptSpecialFormats()
adjuster.numberArray().eachAcceptSpecialFormats()
Changed
- rename method;
allowEmptyString()
toacceptEmptyString()
- rename method;
allowNull()
toacceptNull()
- rename method;
eachAllowEmptyString()
toeachAcceptEmptyString()
- rename method;
eachAllowNull()
toeachAcceptNull()
0.10.1 - 2018-07-09
Others
- follow
valid-jsdoc
option for ESLint - follow
wrap-regex
option for ESLint
0.10.0 - 2018-06-23
Changed
adjuster.number()
limits input value toNumber.MIN_SAFE_INTEGER
or more andNumber.MAX_SAFE_INTEGER
or less
Others
- support Microsoft Windows officially
0.9.0 - 2018-06-16
Added
adjuster.number().allowNull()
adjuster.numberArray().allowNull()
adjuster.numberArray().eachAllowNull()
adjuster.string().allowNull()
adjuster.stringArray().allowNull()
adjuster.stringArray().eachAllowNull()
adjuster.numericString().allowNull()
adjuster.ipv4().allowNull()
adjuster.ipv6().allowNull()
adjuster.email().allowNull()
Changed
- 3rd parameter of
adjuster.adjust()
,onError
, receivesnull
argument after all adjustment has finished and errors has occurred - remove 4th parameter of
adjuster.adjust()
,onErrorAll
Fixed
- description about error handler in README.md
0.8.0 - 2018-06-03
Added
adjuster.email().trim()
adjuster.ipv4().trim()
adjuster.ipv6().trim()
adjuster.string().trim()
adjuster.stringArray().eachTrim()
Changed
AdjusterError.prototype.key
indicates a key name that caused error; only filled inadjuster.adjust()
, otherwisenull
- error handler for
adjuster.adjust()
needs only 1 parameterserr
;key
is inerr.key
- rename
.in()
to.only()
Others
- use changelog
- reference in README
0.7.0 - 2018-05-20
Added
adjuster.numericString().joinArray()
Others
- support complement of IntelliJ IDEA
0.6.0 - 2018-05-17
Added
adjuster.numericString()
Changed
allowEmpty()
=>allowEmptyString()
adjuster.CAUSE.EMAIL
=>adjuster.CAUSE.PATTERN
adjuster.CAUSE.IPV4
=>adjuster.CAUSE.PATTERN
adjuster.CAUSE.IPV6
=>adjuster.CAUSE.PATTERN
0.5.0 - 2018-05-12
Added
adjuster.numberArray()
adjuster.stringArray()
Changed
- rename
adjuster.adjustData()
toadjuster.adjust()
- throw first error when both
onError
andonErrorAll
are null inadjuster.adjust()
Others
- support Visual Studio Code officially
0.4.0 - 2018-05-06
Added
adjuster.ipv4()
adjuster.ipv6()
Changed
- strict IPv4 and IPv6 validation for
adjuster.email()
0.3.0 - 2018-04-22
Changed
- limit the length of local/domain part of email
Fixed
- quoted-pair of email
- import error in
EmailAdjuster.es
0.2.0 - 2018-04-21
Changed
- enable to specify value to
allowEmpty()
- support IPv6 domain for
EmailAdjuster
Fixed
- test error on npm@5
0.1.0 - 2018-04-18
- First release.