1.0.6 • Published 2 years ago

flunt-ts v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Flunt TS

Flunt is a fluent way to validate your entities, concentrating every change you made and easy accessing it when you need.

Git

check the repo

Installation

Use the package manager npm to install the depedencies.

npm install flunt-ts

Usage

import { Contract, Flunt } from '../node-modules/flunt-ts/src/modules/flunt';

export class TodoItem extends flunt {

    public id: number;
    public task: string;
    public complete: boolean = false;

    public constructor(id: number, task: string, complete: boolean = false) {
        super();
        this.id = id;
        this.task = task;
        this.complete = complete;
        Validate();
    }

    Validate(): void {
        const contract = new Contract()
            .IsNotNull(this.id, 'id', 'id cant be null')
    }
}

Note: You may want to check the "src/ex" folder to see a full example.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate, and run lint and prettier always before commit.

License

MIT

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago