@jsonjoy.com/json-type
Version:
High-performance JSON Pointer implementation
41 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BinType = void 0;
const tslib_1 = require("tslib");
const printTree_1 = require("tree-dump/lib/printTree");
const schema = tslib_1.__importStar(require("../../schema"));
const AbsType_1 = require("./AbsType");
class BinType extends AbsType_1.AbsType {
constructor(type, options) {
super(schema.s.Binary(schema.s.any, options));
this.type = type;
}
format(format) {
this.schema.format = format;
return this;
}
min(min) {
this.schema.min = min;
return this;
}
max(max) {
this.schema.max = max;
return this;
}
getSchema() {
return {
...this.schema,
type: this.type.getSchema(),
};
}
getOptions() {
// biome-ignore lint: unused variables are intentional
const { kind, type, ...options } = this.schema;
return options;
}
toString(tab = '') {
return super.toString(tab) + (0, printTree_1.printTree)(tab, [(tab) => this.type.toString(tab)]);
}
}
exports.BinType = BinType;
//# sourceMappingURL=BinType.js.map