@yamamotok/dataobject
Version:
Decorator based JSON serializer and deserializer.
15 lines • 692 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.retrieveTypes = void 0;
const isDataObject_1 = require("./isDataObject");
function retrieveTypes(opts) {
const { options } = opts;
const val = ((options === null || options === void 0 ? void 0 : options.type) && options.type()) || [];
const types = Array.isArray(val) ? val : [val];
if (types.length < 1 && (options === null || options === void 0 ? void 0 : options.typeInfo) && (0, isDataObject_1.isDataObject)(options.typeInfo)) {
types.push(options.typeInfo);
}
return types;
}
exports.retrieveTypes = retrieveTypes;
//# sourceMappingURL=retrieveTypes.js.map