Skip to content

edkongz/rv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rommel 🦊

A validation library written with ramda (all hail ramda 🙌). Heavily inspired by Joi, Yup with the following features:

  • Functional all the way
  • Reusable and composable
  • Descriptive and declarative
schema([
  	description(),
  	label(),
  	matches(),
  	defaultsTo(),

  	isObject(),
  	isString(),
  	isNumber(),
  	isDate(),
  	isBoolean(),
  	isArray(),
		isRequired(),
  	isPositive(),
  	isNegative(),
  	isInfinity(),
  	isInteger(),
  	isNaN(),
  	isPositiveInteger(),
  	isNegativeInteger(),
  	isGreaterThan(),
  	isLessThan(),
  	isNull(),
  	isUndefined(),
  	isNil(),
  	isEmpty(),
  	isTrue(),
  	isTruthy(),
  	isFalse(),
  	isFalsey(),

  	isOneOf(),
  	notOneOf(),
  	notNil(),
  	notNull(),
  	notEmpty(),
  	notUndefined(),

		hasShape(),
  	hasLength(),
  	hasMinLength(),
  	hasMaxLength(),
  	hasRequiredKeys(),
  	hasOnlyKnownKeys(),
  	hasUniqueValues(),

  	allowOptionalKeys(),
  	allowUnknownKeys(),

	rejectKeys(),
  	rejectWhen

  	shouldAnyPass(),
  	shouldAllPass(),
])
// Primitives
isObject(
	hasShape({
		name: isString(isOptional()))
		email: isString(matches(/\.+@\.+/), isOptional())
		password: isString()
	}),
	notNull(),
	notEmpty(),
)
isArray()
isNumber()
isString()
isBoolean()
matches()

is
not
has
reject
allow
should

hasShape()
hasItems()

isNil()
notNil()
rejectNil()
allowNil()

isOptional()
allowUndefined()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published