UNPKG

@adapty/capacitor

Version:
25 lines 851 B
// Coder for Record<string, T> export class HashmapCoder { constructor(coder) { this.coder = coder; } decode(input) { const result = {}; Object.keys(input).forEach(key => { var _a, _b; const property = input[key]; result[key] = (_b = (_a = this.coder) === null || _a === void 0 ? void 0 : _a.decode(property)) !== null && _b !== void 0 ? _b : property; }); return result; } encode(value) { const result = {}; Object.keys(value).forEach(key => { var _a, _b; const property = value[key]; result[key] = (_b = (_a = this.coder) === null || _a === void 0 ? void 0 : _a.encode(property)) !== null && _b !== void 0 ? _b : property; }); return result; } } //# sourceMappingURL=hashmap.js.map