A pure javascript method of limiting and controlling the properties of native js objects and JSON objects, along with extra builtin methods to make js easier to use.
Report bug
·
Request feature
WARNING Major updates are being made to this package without a version change as this package is not made for public release yet
See our docs for full documentation
- Table of Contents
- Quick Start Guide
- What's included
- Compatibility
- Bugs and feature requests
- Contributing
- Authors
- Copyright and license
Require the package
const constrainjs = require("constrainjs");
// or
const {ConstrainArray, ConstrainString} = require("constrainjs").native;
and start using the new native objects!
const myArray = ["hello", "world"];
const options = {
maxLength: 5,
allowedTypes: ["string"]
}
const myBetterArray = new ConstrainArray(myArray, options)
See our docs for further documentation
- Native
- Array (A custom and constrainable version of the native Array object)
- String (A custom and constrainable version of the native String object)
- JSON
- Config (A JSON object access class, used by Schema for defining controlled schemas)
- ConfigSchema (A Class used to define schemas and check objects against them)
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
VSCode Editor preferences are left available in the editor config to aid development, any changes made to this folder for personal preferences should NOT be committed to any PRs
Inanis
Main developer and package initiator
If you would like to join this list, please feel free to send a pull request!
Code released under the MIT License.
Enjoy