UNPKG

@opra/common

Version:
29 lines (28 loc) 771 B
import { __decorate, __metadata } from "tslib"; import { vg } from 'valgen'; import { DECODER, ENCODER } from '../../constants.js'; import { SimpleType } from '../simple-type.js'; let Base64Type = class Base64Type { constructor(attributes) { if (attributes) Object.assign(this, attributes); } [DECODER]() { return vg.isBase64({ coerce: true }); } [ENCODER]() { return vg.isBase64({ coerce: true }); } }; Base64Type = __decorate([ SimpleType({ name: 'base64', description: 'A stream of bytes, base64 encoded', nameMappings: { js: 'string', json: 'string', }, }), __metadata("design:paramtypes", [Object]) ], Base64Type); export { Base64Type };