Skip to content

Line 251 of stringify.js: case 'null' causes lint failure and total failure on Cloudflare #95

Open
@anywhichway

Description

@anywhichway

Since typeof never resolves to 'null' linting fails in general and causes deployment issues on Cloudflare. Removing or commenting out line 251 fixes the issue. Happy to do a pull request if you wish.

switch (typeof value) {
        case 'string':
            if (isBigNumber) {
                return value;
            } else {
                return quote(value);
            }

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        //case 'null': not valid
        case 'bigint':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions