@guanghechen/config 1.0.0 → 1.0.2

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/lib/cjs/index.cjs CHANGED
@@ -2,14 +2,10 @@
2
2
 
3
3
  var byte = require('@guanghechen/byte');
4
4
  var invariant = require('@guanghechen/invariant');
5
- var satisfies = require('semver/functions/satisfies');
5
+ var compareVersions = require('compare-versions');
6
6
  var node_crypto = require('node:crypto');
7
7
  var config_types = require('@guanghechen/config.types');
8
8
 
9
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
-
11
- var satisfies__default = /*#__PURE__*/_interopDefault(satisfies);
12
-
13
9
  function calcMac(chunks, algorithm) {
14
10
  const hash = node_crypto.createHash(algorithm);
15
11
  for (const chunk of chunks)
@@ -36,10 +32,7 @@ class BaseConfigKeeper {
36
32
  return this._instance;
37
33
  }
38
34
  compatible(version) {
39
- return satisfies__default.default(version, this.__compatible_version__, {
40
- loose: false,
41
- includePrerelease: true,
42
- });
35
+ return compareVersions.satisfies(version, this.__compatible_version__);
43
36
  }
44
37
  async destroy() {
45
38
  await this._resource.destroy();
package/lib/esm/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { bytes2text, randomBytes, text2bytes } from '@guanghechen/byte';
2
2
  import { invariant } from '@guanghechen/invariant';
3
- import satisfies from 'semver/functions/satisfies.js';
3
+ import { satisfies } from 'compare-versions';
4
4
  import { createHash } from 'node:crypto';
5
5
  export * from '@guanghechen/config.types';
6
6
 
@@ -30,10 +30,7 @@ class BaseConfigKeeper {
30
30
  return this._instance;
31
31
  }
32
32
  compatible(version) {
33
- return satisfies(version, this.__compatible_version__, {
34
- loose: false,
35
- includePrerelease: true,
36
- });
33
+ return satisfies(version, this.__compatible_version__);
37
34
  }
38
35
  async destroy() {
39
36
  await this._resource.destroy();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanghechen/config",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "author": {
5
5
  "name": "guanghechen",
6
6
  "url": "https://github.com/guanghechen/"
@@ -8,10 +8,10 @@
8
8
  "description": "Utilities for defining config followed by semantic version.",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/guanghechen/sora/tree/@guanghechen/config@1.0.0-alpha.18",
11
+ "url": "https://github.com/guanghechen/sora/tree/@guanghechen/config@1.0.1",
12
12
  "directory": "packages/config"
13
13
  },
14
- "homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/config@1.0.0-alpha.18/packages/config#readme",
14
+ "homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/config@1.0.1/packages/config#readme",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -35,11 +35,11 @@
35
35
  "README.md"
36
36
  ],
37
37
  "dependencies": {
38
- "@guanghechen/byte": "^1.0.0",
39
- "@guanghechen/config.types": "^1.0.0",
40
- "@guanghechen/invariant": "^6.0.1",
41
- "@guanghechen/resource.types": "^1.0.0",
42
- "semver": "^7.6.3"
38
+ "@guanghechen/byte": "^1.0.1",
39
+ "@guanghechen/config.types": "^1.0.1",
40
+ "@guanghechen/invariant": "^6.0.2",
41
+ "@guanghechen/resource.types": "^1.0.1",
42
+ "compare-versions": "^6.1.1"
43
43
  },
44
- "gitHead": "2723aaa31e8ac85afed5b25760875db429d88563"
44
+ "gitHead": "e4d3bb66f61d6bf0a771d6c805dc1eb1ea31361d"
45
45
  }