@opra/common
Version:
Opra common package
32 lines (31 loc) • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObjectIdType = void 0;
const tslib_1 = require("tslib");
const valgen_1 = require("valgen");
const constants_js_1 = require("../../constants.js");
const simple_type_js_1 = require("../simple-type.js");
let ObjectIdType = class ObjectIdType {
constructor(attributes) {
if (attributes)
Object.assign(this, attributes);
}
[constants_js_1.DECODER]() {
return valgen_1.vg.isObjectId({ coerce: true });
}
[constants_js_1.ENCODER]() {
return valgen_1.vg.isObjectId({ coerce: true });
}
};
exports.ObjectIdType = ObjectIdType;
exports.ObjectIdType = ObjectIdType = tslib_1.__decorate([
(0, simple_type_js_1.SimpleType)({
name: 'ObjectId',
description: 'A MongoDB ObjectID value',
nameMappings: {
js: 'object',
json: 'string',
},
}),
tslib_1.__metadata("design:paramtypes", [Object])
], ObjectIdType);