@leofcoin/codec-format-interface 1.1.0 → 1.2.1
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/index.js +32 -3
- package/package.json +3 -3
- package/src/codec-format-interface.js +1 -1
- package/src/index.js +5 -7
- package/transform.js +12 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var bs32 = require('@vandeurenglenn/base32');
|
|
4
6
|
var bs58 = require('@vandeurenglenn/base58');
|
|
5
7
|
var isHex = require('@vandeurenglenn/is-hex');
|
|
@@ -152,6 +154,11 @@ class BasicInterface {
|
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
|
|
157
|
+
var basicInterface = /*#__PURE__*/Object.freeze({
|
|
158
|
+
__proto__: null,
|
|
159
|
+
'default': BasicInterface
|
|
160
|
+
});
|
|
161
|
+
|
|
155
162
|
var codecs = {
|
|
156
163
|
// just a hash
|
|
157
164
|
'disco-hash': {
|
|
@@ -232,6 +239,11 @@ var codecs = {
|
|
|
232
239
|
},
|
|
233
240
|
};
|
|
234
241
|
|
|
242
|
+
var codecs$1 = /*#__PURE__*/Object.freeze({
|
|
243
|
+
__proto__: null,
|
|
244
|
+
'default': codecs
|
|
245
|
+
});
|
|
246
|
+
|
|
235
247
|
class PeernetCodec extends BasicInterface {
|
|
236
248
|
get codecs() {
|
|
237
249
|
return {...globalThis.peernet.codecs, ...codecs}
|
|
@@ -323,6 +335,11 @@ class PeernetCodec extends BasicInterface {
|
|
|
323
335
|
}
|
|
324
336
|
}
|
|
325
337
|
|
|
338
|
+
var codec = /*#__PURE__*/Object.freeze({
|
|
339
|
+
__proto__: null,
|
|
340
|
+
'default': PeernetCodec
|
|
341
|
+
});
|
|
342
|
+
|
|
326
343
|
class CodecHash extends BasicInterface {
|
|
327
344
|
constructor(buffer, options = {}) {
|
|
328
345
|
super();
|
|
@@ -446,11 +463,16 @@ class CodecHash extends BasicInterface {
|
|
|
446
463
|
}
|
|
447
464
|
}
|
|
448
465
|
|
|
466
|
+
var codecHash = /*#__PURE__*/Object.freeze({
|
|
467
|
+
__proto__: null,
|
|
468
|
+
'default': CodecHash
|
|
469
|
+
});
|
|
470
|
+
|
|
449
471
|
let protons;
|
|
450
472
|
|
|
451
473
|
class FormatInterface extends BasicInterface {
|
|
452
474
|
async #importProtons() {
|
|
453
|
-
let importee = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('protons')); });
|
|
475
|
+
let importee = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackChunkName: "protons" */ 'protons')); });
|
|
454
476
|
return importee.default
|
|
455
477
|
}
|
|
456
478
|
|
|
@@ -555,6 +577,13 @@ class FormatInterface extends BasicInterface {
|
|
|
555
577
|
}
|
|
556
578
|
}
|
|
557
579
|
|
|
558
|
-
var
|
|
580
|
+
var codecFormatInterface = /*#__PURE__*/Object.freeze({
|
|
581
|
+
__proto__: null,
|
|
582
|
+
'default': FormatInterface
|
|
583
|
+
});
|
|
559
584
|
|
|
560
|
-
|
|
585
|
+
exports.BasicInterface = basicInterface.default;
|
|
586
|
+
exports.Codec = codec.default;
|
|
587
|
+
exports.CodecHash = codecHash;
|
|
588
|
+
exports.FormatInterface = codecFormatInterface.default;
|
|
589
|
+
exports.codecs = codecs$1.default;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/codec-format-interface",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"c": "rollup -c"
|
|
9
|
+
"c": "rollup -c && node transform.js"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"varint": "^6.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"rollup": "^2.
|
|
31
|
+
"rollup": "^2.75.5",
|
|
32
32
|
"tape": "^5.5.3"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default { codecs, Codec, CodecHash, FormatInterface, BasicInterface }
|
|
1
|
+
export * as BasicInterface from './basic-interface.js'
|
|
2
|
+
export * as FormatInterface from './codec-format-interface.js'
|
|
3
|
+
export * as CodecHash from './codec-hash.js'
|
|
4
|
+
export * as Codec from './codec.js'
|
|
5
|
+
export * as codecs from './codecs.js'
|
package/transform.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const { readFile, writeFileSync } = require('fs')
|
|
2
|
+
|
|
3
|
+
readFile('dist/index.js', (error, data) => {
|
|
4
|
+
data = data.toString()
|
|
5
|
+
data = data.replace('exports.BasicInterface = basicInterface', 'exports.BasicInterface = basicInterface.default')
|
|
6
|
+
data = data.replace('exports.Codec = codec', 'exports.Codec = codec.default')
|
|
7
|
+
data = data.replace('exports.codecHash = codecHash', 'exports.codecHash = codecHash.default')
|
|
8
|
+
data = data.replace('exports.FormatInterface = codecFormatInterface', 'exports.FormatInterface = codecFormatInterface.default')
|
|
9
|
+
data = data.replace('exports.codecs = codecs$1', 'exports.codecs = codecs$1.default')
|
|
10
|
+
|
|
11
|
+
writeFileSync('dist/index.js', data)
|
|
12
|
+
})
|