Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minor] export enforce as a standalone module #58

Merged
merged 2 commits into from Jan 26, 2018
Merged

Conversation

ealush
Copy link
Contributor

@ealush ealush commented Jan 25, 2018

Description

Export enforce as an individual module, allowing to consume it as a standalone module.
This supports future plans for leaner validation schemes.

The old API still works, and will be maintained for the foreseeable future.

Usage

// before
import passable from 'passable';

passable('form_name', (pass, enforce) => {
    pass('field_name', 'error_string', () => enforce(1).isNumber());
});

// after
import passable, { enforce } from 'passable';

passable('form_name', (pass) => {
    pass('field_name', 'error_string', () => enforce(1).isNumber());
});

@ealush ealush merged commit 97ff14d into next Jan 26, 2018
@ealush ealush deleted the export-enforce branch May 10, 2019 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant