UNPKG
@validatem/is-string
Version:
latest (2.0.1)
2.0.1
2.0.0
1.0.0
0.1.1
0.1.0
Validatem validator for ensuring that a value is a string
@validatem/is-string
/
index.js
11 lines
(8 loc)
•
260 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
"use strict"
;
const
ValidationError
=
require
(
"@validatem/error"
);
const
isString =
require
(
"./is-string"
);
module
.
exports
=
function
(
value
) {
if
(!
isString
(value)) {
return
new
ValidationError
(
"Must be a string"
, {
code
:
"validatem.is-string"
}); } };