UNPKG

@dasch-swiss/dsp-js

Version:
32 lines 969 B
import { __decorate } from "tslib"; import { JsonConverter } from 'json2typescript'; /** * @category Internal */ let UnionStringArrayOfStringsConverter = class UnionStringArrayOfStringsConverter { serialize(el) { if (Array.isArray(el)) { return el; } else { throw new Error(`Serialization Error: expected string[] type. Instead got ${typeof el}.`); } } deserialize(el) { if (Array.isArray(el)) { return el; } else if (!Array.isArray(el)) { return [el]; } else { throw new Error(`Deserialization Error: expected string or string[] type. Instead got ${typeof el}.`); } } }; UnionStringArrayOfStringsConverter = __decorate([ JsonConverter ], UnionStringArrayOfStringsConverter); export { UnionStringArrayOfStringsConverter }; //# sourceMappingURL=union-string-array-of-strings-converter.js.map