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.
13 lines
270 B
JavaScript
13 lines
270 B
JavaScript
4 years ago
|
"use strict";
|
||
|
|
||
|
const { isString, ValidationError } = require("validatem");
|
||
|
const path = require("path");
|
||
|
|
||
|
module.exports = function isAbsolutePath(value) {
|
||
|
isString(value);
|
||
|
|
||
|
if (!path.isAbsolute(value)) {
|
||
|
throw new ValidationError(`Must be an absolute path`);
|
||
|
}
|
||
|
};
|