Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anywhichway opened this issue Dec 17, 2024 · 0 comments

Comments

@anywhichway
Copy link

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':
anywhichway added a commit to anywhichway/json-bigint that referenced this issue Dec 27, 2024
See sidorares#95.

Commented out switch on type: null because it can never be true and may cause lint failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant