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

Comparison with -0 using the "==" operator will also match 0 [equals-negative-zero] #5044

Open
nonodev96 opened this issue Nov 19, 2023 · 2 comments
Labels
Type: Bug / Error Something isn't working or is incorrect

Comments

@nonodev96
Copy link

nonodev96 commented Nov 19, 2023

Description

When add the file node_modules/mermaid/dist/mermaid.min.js to angular.json scripts in angular 17 and init de server, I have this warning:

[WARNING] Comparison with -0 using the "==" operator will also match 0 [equals-negative-zero]

    angular:script/global:scripts.js:4637:121911:
      4637 │ ...t){var e;return Bo(t)?(e=t,e==-0?0:e):Lon(t)}function M$(t){v...
           ╵                                  ~~

  Floating-point equality is defined such that 0 and -0 are equal, so "x === -0" returns true for both 0 and -0. You need to use "Object.is(x, -0)" instead to test for -0.

Steps to reproduce

  1. Init a new app with angular cli version 17 ng new ....
  2. Install ngx-markdown
  3. Add the mermaid.min.js to angular.json scripts
  4. Start the dev server.

Setup

  • Mermaid version: 10.6.1
  • Angular: 17.0.3
  • ngx-markdown: 17.1.1
  • npm: 8.19.4
  • node: v18.18.2
@nonodev96 nonodev96 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 19, 2023
@sidharthv96
Copy link
Member

This is an issue with how elkjs is minfied, not mermaid.
The source can be found here https://cdn.jsdelivr.net/npm/[email protected]/lib/elk-worker.min.js

We are removing ELK from the core mermaid package in v11. So the error should disappear.

@sidharthv96 sidharthv96 removed the Status: Triage Needs to be verified, categorized, etc label Nov 20, 2023
@TheBigOx
Copy link

TheBigOx commented Jul 7, 2024

WHen is v11 due to come out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

3 participants