const RX = /^((?=\.\d|\d)(?:\d+)?(?:\.?\d*))px$/ ; hidden internal export class Pixels { param text static parse ( text ) { const match = RX . exec ( text ) ; if ( match === null ) { return undefined ; } return new Pixels ( Number ( match [ 1 ] ) ) ; } param value constructor ( readonly value ) { } toJSON ( ) { return `${ this . value }px` ; } }