src/packer.js
function packValue(value) {
            const result = memoizedMap.get(value);
            if (result == null) {
                if (value >= MIN_DICT_INDEX && value <= MAX_VERBATIM_INTEGER && Number.isInteger(value))
                    return -value;
                
                memoize(value);
                
                if (typeof value === "number")
                    return String(value);
                if (/^[0-9\.]|^~/.test(value))
                    return `~${value}`;
                return value;
            }
            return result;
        }
function packValue(value) {
            const result = memoizedMap.get(value);
            if (result == null) {
                if (value >= MIN_DICT_INDEX && value <= MAX_VERBATIM_INTEGER && Number.isInteger(value))
                    return -value;
                
                memoize(value);
                
                if (typeof value === "number")
                    return String(value);
                if (/^[0-9\.]|^~/.test(value))
                    return `~${value}`;
                return value;
            }
            return result;
        }
function packValue ( value ) { const result = memoizedMap . get ( value ) ; if ( result == null ) { if ( value >= MIN_DICT_INDEX && value <= MAX_VERBATIM_INTEGER && Number . isInteger ( value ) ) return - value ; memoize ( value ) ; if ( typeof value === "number" ) return String ( value ) ; if ( / ^[0-9\.]|^~ / . test ( value ) ) return ` ${ value } ` ; return value ; } return result ; }
Pack and memoize a scalar value.
Pack and memoize a scalar value .