@@ -4,7 +4,7 @@ const R = require('ramda'),
44 __ = require ( './_private.js' ) ;
55
66const isString = R . is ( String ) ,
7- isStringOfLength = __ . ofLength ( String , 'identical ' ) ,
7+ isStringOfLength = __ . ofLength ( String , 'equals ' ) ,
88 isStringOfLengthAtLeast = __ . ofLength ( String , 'gte' ) ,
99 isStringOfLengthAtMost = __ . ofLength ( String , 'lte' ) ,
1010 isStringLongerThan = __ . ofLength ( String , 'gt' ) ,
@@ -19,7 +19,7 @@ const isStringMatching = R.curry((pattern, str) => {
1919} ) ;
2020
2121const stringIsOneOf = R . curry ( ( selectionArr , str ) => {
22- return R . allPass ( [ R . is ( String ) , R . contains ( R . __ , selectionArr ) ] ) ( str ) ;
22+ return R . allPass ( [ R . is ( String ) , R . includes ( R . __ , selectionArr ) ] ) ( str ) ;
2323} ) ;
2424
2525const isStringOfLengthBetween = R . curry ( ( min , max , str ) => {
@@ -38,7 +38,7 @@ const isTimestamp = R.test(/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([
3838
3939const isMySqlTimestamp = R . test ( / ^ ( [ 1 - 2 ] [ 0 - 9 ] { 3 } ) - ( [ 0 - 1 ] [ 0 - 9 ] ) - ( [ 0 - 3 ] [ 0 - 9 ] ) (?: ( [ 0 - 2 ] [ 0 - 9 ] ) : ( [ 0 - 5 ] [ 0 - 9 ] ) : ( [ 0 - 5 ] [ 0 - 9 ] ) ) ? $ / ) ;
4040
41- const isUuid = R . test ( / ^ [ 0 - 9 a - f A - F ] { 8 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 12 } $ / gi) ;
41+ const isUUID = R . test ( / ^ [ 0 - 9 a - f A - F ] { 8 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 4 } \b - [ 0 - 9 a - f A - F ] { 12 } $ / gi) ;
4242
4343const isJSON = ( str ) => {
4444 try {
@@ -66,5 +66,7 @@ module.exports = {
6666 isMySqlTimestamp,
6767 isEmail,
6868 isJSON,
69- isUuid
69+ isUUID,
70+ isJson : isJSON ,
71+ isUuid : isUUID
7072} ;
0 commit comments