face-api/build/classes/LabeledBox.js

20 lines
672 B
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LabeledBox = void 0;
const utils_1 = require("../utils");
const Box_1 = require("./Box");
class LabeledBox extends Box_1.Box {
2020-08-18 14:04:33 +02:00
constructor(box, label) {
super(box);
this._label = label;
}
static assertIsValidLabeledBox(box, callee) {
Box_1.Box.assertIsValidBox(box, callee);
if (!utils_1.isValidNumber(box.label)) {
2020-08-18 14:04:33 +02:00
throw new Error(`${callee} - expected property label (${box.label}) to be a number`);
}
}
get label() { return this._label; }
}
exports.LabeledBox = LabeledBox;
2020-08-18 14:04:33 +02:00
//# sourceMappingURL=LabeledBox.js.map