1.3.0 • Published 2 years ago

addons-moz-compare v1.3.0

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
2 years ago

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.

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago