sablier 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/helpers.d.ts CHANGED
@@ -3,4 +3,7 @@ export declare function getContractExplorerURL(explorerURL: string, contractAddr
3
3
  export declare function sortChains<T extends {
4
4
  name: string;
5
5
  }>(chains: T[]): T[];
6
+ export declare function compareVersions(a: Sablier.Version, b: Sablier.Version): number;
7
+ export declare function isVersionBefore(version: Sablier.Version, before: Sablier.Version): boolean;
8
+ export declare function isVersionAfter(version: Sablier.Version, after: Sablier.Version): boolean;
6
9
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQvC,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,UAE3F;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEvE"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQvC,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,UAE3F;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEvE;AAYD,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAQ9E;AAWD,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAE1F;AAWD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAExF"}
package/dist/helpers.js CHANGED
@@ -2,10 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getContractExplorerURL = getContractExplorerURL;
4
4
  exports.sortChains = sortChains;
5
+ exports.compareVersions = compareVersions;
6
+ exports.isVersionBefore = isVersionBefore;
7
+ exports.isVersionAfter = isVersionAfter;
5
8
  function getContractExplorerURL(explorerURL, contractAddress) {
6
9
  return `${explorerURL}/address/${contractAddress}`;
7
10
  }
8
11
  function sortChains(chains) {
9
12
  return chains.sort((a, b) => a.name.localeCompare(b.name));
10
13
  }
14
+ function compareVersions(a, b) {
15
+ const [aMajor, aMinor] = a.slice(1).split(".").map(Number);
16
+ const [bMajor, bMinor] = b.slice(1).split(".").map(Number);
17
+ if (aMajor !== bMajor) {
18
+ return aMajor - bMajor;
19
+ }
20
+ return aMinor - bMinor;
21
+ }
22
+ function isVersionBefore(version, before) {
23
+ return compareVersions(version, before) < 0;
24
+ }
25
+ function isVersionAfter(version, after) {
26
+ return compareVersions(version, after) > 0;
27
+ }
11
28
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;AAQA,wDAEC;AAED,gCAEC;AAND,SAAgB,sBAAsB,CAAC,WAAmB,EAAE,eAAgC;IAC1F,OAAO,GAAG,WAAW,YAAY,eAAe,EAAE,CAAC;AACrD,CAAC;AAED,SAAgB,UAAU,CAA6B,MAAW;IAChE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,I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AAC;AAC7C,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "license": "GPL-3.0-or-later",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "1.3.0",
7
+ "version": "1.4.0",
8
8
  "author": {
9
9
  "name": "Sablier Labs Ltd",
10
10
  "url": "https://sablier.com"