@aicacia/changeset
TypeScript icon, indicating that this package has built-in type declarations

0.1.10 • Public • Published

ts-changeset

license docs npm (scoped) build

ecto like changesets for typescript

const changesetFn = (changeset: Changeset) =>
  changeset
    .validateAcceptance("agreedToTerms")
    .validateLength("age", { gt: 18 })
    .validateFormat("name", /[A-Za-z0-9\-_]+/)
    .validateRequired(["age", "name", "agreedToTerms"]);

let changeset = new Changeset({
  age: 0,
  name: "",
  agreedToTerms: false,
});

let changeset = changesetFn(changeset);

console.log(changeset.getErrors());
console.log(changeset.isValid());

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.100latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.100
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.21
0.1.10
0.1.01

Package Sidebar

Install

npm i @aicacia/changeset

Weekly Downloads

2

Version

0.1.10

License

(MIT OR Apache-2.0)

Unpacked Size

46.6 kB

Total Files

15

Last publish

Collaborators

  • nathanfaucett