Skip to content

Commit

Permalink
Validation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gigobyte committed Jul 11, 2018
1 parent cf612d5 commit ee81933
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions site/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,9 @@ const data: Data = {
},
{
name: 'ifEmptyList',
description: 'Fails validation if the argument is an empty array',
description: 'Fails validation if the argument is an empty iterable',
signatureML: '[a] -> Bool',
signatureTS: '<T>(arr: T[]) => boolean',
signatureTS: '<T>(arr: ArrayLike<T>) => boolean',
examples: []
},
{
Expand All @@ -1143,7 +1143,7 @@ const data: Data = {
signatureML: '(a -> Bool) -> a -> Bool',
signatureTS: '<T>(condition: (value: T) => boolean) => (value: T) => boolean',
examples: [
{input: 'ifTrue(x => x > 10)', output: 'Returns the opposite of what the predicate returns'}
{input: 'ifFalse(x => x > 10)', output: 'Returns the opposite of what the predicate returns'}
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ifLongerThan = (length: number) => (value: string) => value.length
export const ifLengthIs = (length: number) => (value: string) => value.length !== length
export const ifSubstringOf = (str: string) => (value: string) => !str.includes(value)
export const ifContains = (substr: string) => (value: string) => !value.includes(substr)
export const ifEmptyList = <T>(arr: T[]) => arr.length > 0
export const ifEmptyList = <T>(arr: ArrayLike<T>) => arr.length > 0
export const ifEqualTo = <T>(other: T) => (value: T) => value !== other
export const ifTrue = <T>(condition: Validator<T>) => (value: T) => !condition(value)
export const ifFalse = <T>(condition: Validator<T>) => (value: T) => condition(value)
Expand Down

0 comments on commit ee81933

Please sign in to comment.