@did-space/core 0.3.44 → 0.3.46

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.
@@ -8,13 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.isCidV1 = exports.getHashPath = exports.getHash = void 0;
16
13
  const path_1 = require("path");
17
- const ipfs_only_hash_1 = __importDefault(require("ipfs-only-hash"));
14
+ const ipfs_only_hash_1 = require("@arcblock/ipfs-only-hash");
18
15
  const multiformats_1 = require("multiformats");
19
16
  const stream_1 = require("./stream");
20
17
  /**
@@ -30,7 +27,7 @@ const stream_1 = require("./stream");
30
27
  function getHash(data) {
31
28
  return __awaiter(this, void 0, void 0, function* () {
32
29
  if (typeof data === 'string' || Buffer.isBuffer(data) || (0, stream_1.isStream)(data)) {
33
- const cidV0 = yield ipfs_only_hash_1.default.of(data);
30
+ const cidV0 = yield (0, ipfs_only_hash_1.onlyHash)(data);
34
31
  return multiformats_1.CID.parse(cidV0).toV1().toString();
35
32
  }
36
33
  throw new Error(`#getHash() Invalid data type: ${data}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,10 +36,10 @@
36
36
  ]
37
37
  },
38
38
  "dependencies": {
39
+ "@arcblock/ipfs-only-hash": "^0.0.2",
39
40
  "@arcblock/validator": "^1.18.107",
40
41
  "debug": "^4.3.4",
41
42
  "hasha": "^5.2.2",
42
- "ipfs-only-hash": "^4.0.0",
43
43
  "joi": "^17.9.2",
44
44
  "js-yaml": "^4.1.0",
45
45
  "lodash": "^4.17.21",
@@ -60,5 +60,5 @@
60
60
  "ts-jest": "^28.0.6",
61
61
  "typescript": "^4.9.5"
62
62
  },
63
- "gitHead": "1337fce641f92f607ca53aa9fe32f7e9e7121025"
63
+ "gitHead": "c777c71779ae59da1e3e9375bc79886a6a277159"
64
64
  }