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

Factor out custom stringify function #668

Open
smellman opened this issue May 18, 2024 · 0 comments
Open

Factor out custom stringify function #668

smellman opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@smellman
Copy link
Contributor

Describe the bug
Same as maplibre/maplibre-gl-js#967
In test/lib/utils.ts we have a stringify and the following comment:

import compactStringify from 'json-stringify-pretty-compact';

// we have to handle this edge case here because we have test fixtures for this
// edge case, and we don't want UPDATE=1 to mess with them
export function stringify(v) {
    let s = compactStringify(v);

    if (s.indexOf('\u2028') >= 0) {
        s = s.replace(/\u2028/g, '\\u2028');
    }
    if (s.indexOf('\u2029') >= 0) {
        s = s.replace(/\u2029/g, '\\u2029');
    }
    return s;
}

maplibre-gl-js has removed all this function but maplibre-style-spec still available.
If this implementation is needed, close this issue.
Note: Also maplibre-style-spec uses stringifyPretty from json-stringify-pretty-compact.

@smellman smellman added the bug Something isn't working label May 18, 2024
smellman added a commit to smellman/maplibre-style-spec that referenced this issue May 18, 2024
smellman added a commit to smellman/maplibre-style-spec that referenced this issue May 24, 2024
smellman added a commit to smellman/maplibre-style-spec that referenced this issue May 24, 2024
smellman added a commit to smellman/maplibre-style-spec that referenced this issue May 24, 2024
HarelM pushed a commit that referenced this issue May 24, 2024
* #668 remove custom stringify function in test

* #668 use 2 space indent

* #668 remove from CHANGELOG

* #668 replace all json for test via UPDATE=1 npm run jest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant