@did-space/core 0.5.24 → 0.5.26
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.
|
@@ -5,12 +5,12 @@ const validator_1 = require("@arcblock/validator");
|
|
|
5
5
|
exports.OwnerOperatorKeySchema = validator_1.Joi.string().regex(/^\//).required();
|
|
6
6
|
const WriteAsOwnerOptionsByFolderSchema = {
|
|
7
7
|
is: validator_1.Joi.string().regex(/\/$/),
|
|
8
|
-
then: validator_1.Joi.optional().default(
|
|
8
|
+
then: validator_1.Joi.optional().default(''),
|
|
9
9
|
otherwise: validator_1.Joi.required(),
|
|
10
10
|
};
|
|
11
11
|
const MetadataSchema = {
|
|
12
12
|
is: validator_1.Joi.object(),
|
|
13
|
-
then: validator_1.Joi.optional().default(
|
|
13
|
+
then: validator_1.Joi.optional().default(''),
|
|
14
14
|
otherwise: validator_1.Joi.required(),
|
|
15
15
|
};
|
|
16
16
|
exports.WriteAsOwnerOptionsSchema = validator_1.Joi.object({
|
package/dist/utils/common.d.ts
CHANGED
package/dist/utils/common.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isValidData = exports.isDirectory = exports.getSize = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const stream_1 = require("stream");
|
|
6
|
-
function getSize(data) {
|
|
6
|
+
function getSize(data = '') {
|
|
7
7
|
if (typeof data === 'string') {
|
|
8
8
|
return Buffer.byteLength(data, 'utf-8');
|
|
9
9
|
}
|
package/dist/utils/hash.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Data } from '../meta';
|
|
|
9
9
|
* @param {Data} data
|
|
10
10
|
* @return {Promise<string>} {Promise<string>}
|
|
11
11
|
*/
|
|
12
|
-
export declare function getHash(data
|
|
12
|
+
export declare function getHash(data?: Data): Promise<string>;
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
15
15
|
* @export
|
package/dist/utils/hash.js
CHANGED
|
@@ -24,7 +24,7 @@ const stream_1 = require("./stream");
|
|
|
24
24
|
* @param {Data} data
|
|
25
25
|
* @return {Promise<string>} {Promise<string>}
|
|
26
26
|
*/
|
|
27
|
-
function getHash(data) {
|
|
27
|
+
function getHash(data = '') {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
if (typeof data === 'string' || Buffer.isBuffer(data) || (0, stream_1.isStream)(data)) {
|
|
30
30
|
const cidV0 = yield (0, ipfs_only_hash_1.onlyHash)(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/ipfs-only-hash": "^0.0.2",
|
|
32
|
-
"@arcblock/validator": "^1.18.
|
|
33
|
-
"dayjs": "^1.11.
|
|
32
|
+
"@arcblock/validator": "^1.18.130",
|
|
33
|
+
"dayjs": "^1.11.13",
|
|
34
34
|
"debug": "^4.3.6",
|
|
35
35
|
"hasha": "^5.2.2",
|
|
36
36
|
"joi": "^17.13.3",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"ts-jest": "^28.0.8",
|
|
54
54
|
"typescript": "^4.9.5"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "9cc1817ea05c7c4f7ea333c90f2b311b79c03f55"
|
|
57
57
|
}
|