first commit

This commit is contained in:
2020-02-02 15:24:30 +07:00
commit 61dfa00b20
2410 changed files with 152621 additions and 0 deletions

26
node_modules/ow-lite/lib/number.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict'
const { func } = require('./symbols')
const numberPredicates = {
positive: (value) => (value > 0),
negative: (value) => (value < 0),
nonNegative: (value) => (value >= 0),
integer: (value) => (value === (value | 0)),
[func]: {
is: (fn) => fn,
eq: (v) => (value) => (value === v),
gt: (v) => (value) => (value > v),
gte: (v) => (value) => (value >= v),
lt: (v) => (value) => (value < v),
lte: (v) => (value) => (value <= v)
}
}
module.exports = {
predicates: numberPredicates,
validator: (value) => {
return typeof value === 'number'
}
}

26
node_modules/ow-lite/lib/object.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict'
const { func } = require('./symbols')
const objectPredicates = {
plain: (value) => {
if (typeof value !== 'object') return false
const proto = Object.getPrototypeOf(value)
return proto === null || proto === Object.getPrototypeOf({})
},
empty: (value) => Object.keys(value).length === 0,
nonEmpty: (value) => Object.keys(value).length > 0,
[func]: {
is: (fn) => fn,
instanceOf: (v) => (value) => (value instanceof v)
}
}
module.exports = {
predicates: objectPredicates,
validator: (value) => {
return typeof value === 'object'
}
}

26
node_modules/ow-lite/lib/string.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict'
const { func } = require('./symbols')
const stringPredicates = {
empty: (value) => (value === ''),
nonEmpty: (value) => (value !== ''),
[func]: {
is: (fn) => fn,
eq: (v) => (value) => (value === v),
length: (v) => (value) => (value.length === v),
minLength: (v) => (value) => (value.length >= v),
maxLength: (v) => (value) => (value.length <= v),
matches: (v) => (value) => v.test(value),
startsWith: (v) => (value) => value.startsWith(v),
endsWith: (v) => (value) => value.endsWith(v)
}
}
module.exports = {
predicates: stringPredicates,
validator: (value) => {
return typeof value === 'string'
}
}

4
node_modules/ow-lite/lib/symbols.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
'use strict'
exports.func = Symbol('func')
exports.validate = Symbol('validate')