constrainjs

1.0.5 • Public • Published

Logo

Constrain JS

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

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

What's included

  • 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)

Compatibility

See compatibility table

Bugs and feature requests

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.

Contributing

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

Authors

Inanis

Main developer and package initiator

If you would like to join this list, please feel free to send a pull request!

Copyright and license

Code released under the MIT License.

Enjoy

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i constrainjs

      Weekly Downloads

      9

      Version

      1.0.5

      License

      MIT

      Unpacked Size

      183 kB

      Total Files

      30

      Last publish

      Collaborators

      • inaniscode