json-schema-fill-defaults

2.3.1 • Public • Published

To install:

npm install json-schema-fill-defaults --save

After calling:

import autoDefaults from 'json-schema-fill-defaults';

const dataWithDefaults = autoDefaults(data, schema);

the object data will be complemented with default values specified in schema. Whatever already has a value will remain untouched. autoDefaults returns the complemented structure.

http://harmvandendorpel.com

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.3.13latest

Version History

VersionDownloads (Last 7 Days)Published
2.3.13
2.3.00
2.2.00
2.1.40
2.1.30
2.1.20
2.1.10
2.1.00
2.0.00
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i json-schema-fill-defaults

Weekly Downloads

3

Version

2.3.1

License

GPL-3.0

Last publish

Collaborators

  • harmvandendorpel