UNPKG

@iabtechlabtcf/core

Version:

Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).

10 lines (9 loc) 219 B
export class BooleanEncoder { static encode(value) { return String(Number(value)); } static decode(value) { // less operations than !!parseInt(value, 2) return value === '1'; } }