Skip to content

Uses JSON Schema to fill in missing required values that have a default value.

Notifications You must be signed in to change notification settings

harmvandendorpel/json-schema-fill-defaults

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Uses JSON Schema to fill in missing required values that have a default value.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published