(function () {
"use strict";
const defineProperty = Object.defineProperty;
const freeze = Object.freeze;
const getPrototypeOf = Object.getPrototypeOf;
const objectPrototype = Object.prototype;
const define = (name) => {
const cls = {
[name]: class {
constructor(value) {
if (typeof value !== "string") {
throw new TypeError(name + " takes a string");
}
defineProperty(this, "value", { __proto__: null, value, enumerable: true });
freeze(this);
}
toJSON() {
return this.value;
}
toString() {
return this.value;
}
[Symbol.for("nodejs.util.inspect.custom")]() {
return name + "(" + this.value + ")";
}
},
}[name];
freeze(cls.prototype);
return freeze(cls);
};
return freeze({
__proto__: null,
VcDate: define("VcDate"),
VcTimestamp: define("VcTimestamp"),
VcDecimal: define("VcDecimal"),
VcUuid: define("VcUuid"),
isPlain: (value) => {
const proto = getPrototypeOf(value);
return proto === null || proto === objectPrototype;
},
});
})()