UNPKG

ts-barcode-generator

Version:

Simple Barcode Generator created in TypeScript

17 lines (16 loc) 507 B
import EAN13 from './barcode-types/EAN13'; export default class TsBarcodeGenerator { static generate(code, type) { switch (type) { case 'EAN13': return EAN13.generate(code); case 'QR': return 'Not implemented yet'; // return QR.generate(code); case 'CODE128': return 'Not implemented yet'; default: throw new Error(`Unsupported barcode type: ${type}`); } } }