UNPKG

@opra/common

Version:

Opra common package

29 lines (28 loc) 746 B
import { __decorate, __metadata } from "tslib"; import { vg } from 'valgen'; import { DECODER, ENCODER } from '../../constants.js'; import { SimpleType } from '../simple-type.js'; let EanType = class EanType { constructor(attributes) { if (attributes) Object.assign(this, attributes); } [DECODER]() { return vg.isEAN({ coerce: true }); } [ENCODER]() { return vg.isEAN({ coerce: true }); } }; EanType = __decorate([ SimpleType({ name: 'ean', description: 'An EAN (European Article Number)', nameMappings: { js: 'string', json: 'string', }, }), __metadata("design:paramtypes", [Object]) ], EanType); export { EanType };