@whi/into-struct
v0.3.1Into Struct
This package is intended to validate and/or convert input against a given struct definition.
Overview
Install
npm i @whi/into-struct
Usage
import { intoStruct } from '@whi/into-struct';
const PostStruct = {
"message": String,
"tags": VecType( String ),
"published_at": Number,
"last_updated": Number,
};
const post = intoStruct({
"message": "Hello, world!",
"tags": [ "greeting" ],
"published_at": Date.now(),
"last_updated": Date.now(),
}, PostStruct );
Contributing
See CONTRIBUTING.md
npm i @whi/into-struct
Metadata
- ISC
- Whatever
- Matthew Brisebois
- released 8/21/2024