You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
srap/src/validators/is-ms.js

17 lines
410 B
JavaScript

"use strict";
// FIXME: Move to own @validatem/is-ms module
const ms = require("ms");
const either = require("@validatem/either");
const isString = require("@validatem/is-string");
const required = require("@validatem/required");
const isPositiveInteger = require("./is-positive-integer");
module.exports = either([
isPositiveInteger,
[ isString, (value) => ms(value), required, isPositiveInteger ]
]);