test-openapi
Version:
Automated client requests
53 lines (16 loc) • 879 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:true});exports.ESCAPED_UNDEFINED=exports.UNDEFINED=exports.getMessage=exports.isJsonType=void 0;var _path=require("../utils/path.js");
var _types=require("../utils/types.js");
const isJsonType=function(value){
return(
["string","number","boolean"].includes(typeof value)||
value===null||
Array.isArray(value)||
(0,_types.isObject)(value));
};exports.isJsonType=isJsonType;
const getMessage=function({value,path}){
const property=(0,_path.getPath)(path);
return`property '${property}' with value '${value}' is invalid: it can only be a JSON type, undefined or a function`;
};exports.getMessage=getMessage;
const UNDEFINED="undefined";exports.UNDEFINED=UNDEFINED;
const ESCAPED_UNDEFINED="\\undefined";exports.ESCAPED_UNDEFINED=ESCAPED_UNDEFINED;
//# sourceMappingURL=common.js.map