Перейти к файлу
dependabot[bot] 3febf8e26c
Bump cross-spawn from 7.0.3 to 7.0.6 (#48)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 09:55:42 +01:00
.circleci Update images/orbs used by CircleCI (#42) 2024-03-27 13:40:48 +01:00
.github Add CoC (#8) 2021-04-22 15:53:12 +02:00
src Fix parsing of multi-part versions (#30) 2022-11-03 14:49:05 +01:00
tests Add tests around version numbers resigning (#41) 2024-03-28 12:48:23 +01:00
.gitignore Add Circle CI config (#1) 2021-04-21 21:46:29 +02:00
.npmignore Add *.tgz in .npmignore 2021-04-21 22:18:59 +02:00
.npmrc Add Circle CI config (#1) 2021-04-21 21:46:29 +02:00
.prettierignore Add prettier (#3) 2021-04-21 22:09:45 +02:00
.prettierrc Add prettier (#3) 2021-04-21 22:09:45 +02:00
LICENSE.txt Add LICENSE.txt 2021-04-21 18:44:45 +02:00
README.md Add npm badge on README (#13) 2021-05-04 11:54:18 +02:00
package.json ⬆️ release 1.3.0 2022-11-03 14:53:47 +01:00
yarn.lock Bump cross-spawn from 7.0.3 to 7.0.6 (#48) 2024-11-19 09:55:42 +01:00

README.md

addons-moz-compare

CircleCI npm version

A JavaScript library to compare Mozilla add-on versions that follow the Manifest Version Format.

API

This library exposes a mozCompare() function that takes two (string) versions A and B and returns:

  • -1 if A < B
  • 0 if A == B
  • 1 if A > B

This implementation matches the Firefox implementation except that there are only 3 different possible return values (Firefox returns strictly negative and strictly positive values instead of -1 and 1).

Usage

npm i addons-moz-compare

or

yarn add addons-moz-compare

Node

const { mozCompare } = require('addons-moz-compare');

Browser

Use window.mozCompare after having included the source of this library.

License

This plugin is released under the Mozilla Public License Version 2.0. See the bundled LICENSE file for details.