-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
52 lines (44 loc) · 1.74 KB
/
index.js
File metadata and controls
52 lines (44 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @licence MIT
* @author Louis Audeon <louis.audeon@mail.be>
*/
'use strict'
const FieldFormat = require('./lib/field/fieldformat')
const FieldRule = require('./lib/field/fieldrule')
const Strategy = require('express-form-handler-strategy')
const Stringformat = require('./lib/field/formats/string')
const Dateformat = require('./lib/field/formats/date')
const Emailformat = require('./lib/field/formats/email')
const Numericformat = require('./lib/field/formats/numeric')
const Floatformat = require('./lib/field/formats/float')
const Integerformat = require('./lib/field/formats/integer')
const Alphaformat = require('./lib/field/formats/alpha')
const Alphanumericformat = require('./lib/field/formats/alphanumeric')
const URLformat = require('./lib/field/formats/url')
const Minlengthrule = require('./lib/field/rules/minlength')
const Maxlengthrule = require('./lib/field/rules/maxlength')
const Equalstorule = require('./lib/field/rules/equalsto')
const Customrule = require('./lib/field/rules/custom')
exports.create = require('./lib/form')
exports.format = {
string: () => new Stringformat(),
text: () => new Stringformat(),
textarea: () => new Stringformat(),
email: () => new Emailformat(),
date: () => new Dateformat(),
numeric: () => new Numericformat(),
integer: () => new Integerformat(),
float: () => new Floatformat(),
alpha: () => new Alphaformat(),
alphanumeric: () => new Alphanumericformat(),
url: () => new URLformat()
}
exports.rule = {
minlength: (length) => new Minlengthrule(length),
maxlength: (length) => new Maxlengthrule(length),
equalsto: (fieldname) => new Equalstorule(fieldname),
custom: (fn) => new Customrule(fn)
}
exports.FieldFormat = FieldFormat
exports.FieldRule = FieldRule
exports.Strategy = Strategy