UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

14 lines (13 loc) 287 B
/** * Similar to |toString| but returns |null| for |null| or |undefined| instead * of "null" or "undefined". */ export function axCoerceString(x) { if (typeof x === 'string') { return x; } else if (x == undefined) { return null; } return x + ''; }