@xylabs/buffer 2.10.18 → 2.11.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/browser/Buffer.d.ts +3 -0
- package/dist/browser/Buffer.d.ts.map +1 -0
- package/dist/browser/bufferPolyfill.d.ts +2 -0
- package/dist/browser/bufferPolyfill.d.ts.map +1 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/index.d.mts +3 -5
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -19
- package/dist/index.mjs.map +1 -1
- package/dist/node/Buffer.d.ts +3 -0
- package/dist/node/Buffer.d.ts.map +1 -0
- package/dist/node/bufferPolyfill.d.ts +2 -0
- package/dist/node/bufferPolyfill.d.ts.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/nodeIndex.d.ts +3 -5
- package/dist/nodeIndex.d.ts.map +1 -0
- package/dist/nodeIndex.js +15 -40
- package/dist/nodeIndex.js.map +1 -1
- package/dist/nodeIndex.mjs +6 -12
- package/dist/nodeIndex.mjs.map +1 -1
- package/package.json +4 -10
- package/dist/nodeIndex.d.mts +0 -5
- package/tsup.config.ts +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/browser/Buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../src/browser/bufferPolyfill.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,qBAAqB,YAKjC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { bufferPolyfillBrowser as bufferPolyfill, bufferPolyfillBrowser };
|
|
1
|
+
export * from './browser';
|
|
2
|
+
export { BrowserBuffer as Buffer, bufferPolyfillBrowser as bufferPolyfill } from './browser';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,qBAAqB,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { bufferPolyfillBrowser as bufferPolyfill, bufferPolyfillBrowser };
|
|
1
|
+
export * from './browser';
|
|
2
|
+
export { BrowserBuffer as Buffer, bufferPolyfillBrowser as bufferPolyfill } from './browser';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,qBAAqB,IAAI,cAAc,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,53 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
BrowserBuffer: () => import_buffer.Buffer,
|
|
24
|
-
Buffer: () => import_buffer.Buffer,
|
|
25
|
-
bufferPolyfill: () => bufferPolyfillBrowser,
|
|
26
|
-
bufferPolyfillBrowser: () => bufferPolyfillBrowser
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(src_exports);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var import_buffer = require("buffer/");
|
|
3
|
+
var _ = require('buffer/');
|
|
32
4
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
5
|
+
const isBrowser = () => {
|
|
6
|
+
return typeof window !== 'undefined' && typeof window?.document !== 'undefined';
|
|
36
7
|
};
|
|
37
|
-
|
|
38
|
-
|
|
8
|
+
const isWebworker = () => {
|
|
9
|
+
return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';
|
|
39
10
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
11
|
+
const bufferPolyfillBrowser = () => {
|
|
12
|
+
const global = isBrowser() ? window : isWebworker() ? self : undefined;
|
|
13
|
+
if (global && global.Buffer === undefined) {
|
|
14
|
+
global.Buffer = _.Buffer;
|
|
15
|
+
}
|
|
45
16
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, 'BrowserBuffer', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return _.Buffer; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, 'Buffer', {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return _.Buffer; }
|
|
52
25
|
});
|
|
53
|
-
|
|
26
|
+
exports.bufferPolyfill = bufferPolyfillBrowser;
|
|
27
|
+
exports.bufferPolyfillBrowser = bufferPolyfillBrowser;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Buffer } from 'buffer/';
|
|
2
|
+
export { Buffer as BrowserBuffer, Buffer } from 'buffer/';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
4
|
+
const isBrowser = () => {
|
|
5
|
+
return typeof window !== 'undefined' && typeof window?.document !== 'undefined';
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const isWebworker = () => {
|
|
8
|
+
return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const bufferPolyfillBrowser = () => {
|
|
11
|
+
const global = isBrowser() ? window : isWebworker() ? self : undefined;
|
|
12
|
+
if (global && global.Buffer === undefined) {
|
|
13
|
+
global.Buffer = Buffer;
|
|
14
|
+
}
|
|
16
15
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
bufferPolyfillBrowser as bufferPolyfill,
|
|
21
|
-
bufferPolyfillBrowser
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.mjs.map
|
|
16
|
+
|
|
17
|
+
export { bufferPolyfillBrowser as bufferPolyfill, bufferPolyfillBrowser };
|
|
18
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/node/Buffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../src/node/bufferPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAE9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA"}
|
package/dist/nodeIndex.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { bufferPolyfillNode as bufferPolyfill, bufferPolyfillNode };
|
|
1
|
+
export * from './node';
|
|
2
|
+
export { NodeBuffer as Buffer, bufferPolyfillNode as bufferPolyfill } from './node';
|
|
3
|
+
//# sourceMappingURL=nodeIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeIndex.d.ts","sourceRoot":"","sources":["../src/nodeIndex.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,kBAAkB,IAAI,cAAc,EAAE,MAAM,QAAQ,CAAA"}
|
package/dist/nodeIndex.js
CHANGED
|
@@ -1,44 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/nodeIndex.ts
|
|
21
|
-
var nodeIndex_exports = {};
|
|
22
|
-
__export(nodeIndex_exports, {
|
|
23
|
-
Buffer: () => import_buffer.Buffer,
|
|
24
|
-
NodeBuffer: () => import_buffer.Buffer,
|
|
25
|
-
bufferPolyfill: () => bufferPolyfillNode,
|
|
26
|
-
bufferPolyfillNode: () => bufferPolyfillNode
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(nodeIndex_exports);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var import_buffer = require("buffer");
|
|
3
|
+
var buffer = require('buffer');
|
|
32
4
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return;
|
|
5
|
+
const bufferPolyfillNode = () => {
|
|
6
|
+
return;
|
|
36
7
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'Buffer', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return buffer.Buffer; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, 'NodeBuffer', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return buffer.Buffer; }
|
|
43
16
|
});
|
|
44
|
-
|
|
17
|
+
exports.bufferPolyfill = bufferPolyfillNode;
|
|
18
|
+
exports.bufferPolyfillNode = bufferPolyfillNode;
|
|
19
|
+
//# sourceMappingURL=nodeIndex.js.map
|
package/dist/nodeIndex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"nodeIndex.js","sources":["../src/node/bufferPolyfill.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAO,MAAA,kBAAwB,GAAA,MAAA;;;;;;;;;;;;;;;"}
|
package/dist/nodeIndex.mjs
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { Buffer } from "buffer";
|
|
1
|
+
export { Buffer, Buffer as NodeBuffer } from 'buffer';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return;
|
|
3
|
+
const bufferPolyfillNode = () => {
|
|
4
|
+
return;
|
|
7
5
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bufferPolyfillNode as bufferPolyfill,
|
|
12
|
-
bufferPolyfillNode
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=nodeIndex.mjs.map
|
|
6
|
+
|
|
7
|
+
export { bufferPolyfillNode as bufferPolyfill, bufferPolyfillNode };
|
|
8
|
+
//# sourceMappingURL=nodeIndex.mjs.map
|
package/dist/nodeIndex.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"nodeIndex.mjs","sources":["../src/node/bufferPolyfill.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAO,MAAA,kBAAwB,GAAA,MAAA;;;;;;"}
|
package/package.json
CHANGED
|
@@ -57,10 +57,6 @@
|
|
|
57
57
|
},
|
|
58
58
|
"main": "dist/index.js",
|
|
59
59
|
"module": "dist/index.mjs",
|
|
60
|
-
"scripts": {
|
|
61
|
-
"package-compile": "tsup && publint",
|
|
62
|
-
"package-recompile": "tsup && publint"
|
|
63
|
-
},
|
|
64
60
|
"homepage": "https://xylabs.com",
|
|
65
61
|
"keywords": [
|
|
66
62
|
"xylabs",
|
|
@@ -73,11 +69,9 @@
|
|
|
73
69
|
},
|
|
74
70
|
"devDependencies": {
|
|
75
71
|
"@types/node": "^20.6.0",
|
|
76
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
77
|
-
"@xylabs/tsconfig": "^
|
|
78
|
-
"@xylabs/tsconfig-dom": "^
|
|
79
|
-
"publint": "^0.2.2",
|
|
80
|
-
"tsup": "^7.2.0",
|
|
72
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.0-rc.16",
|
|
73
|
+
"@xylabs/tsconfig": "^3.0.0-rc.16",
|
|
74
|
+
"@xylabs/tsconfig-dom": "^3.0.0-rc.16",
|
|
81
75
|
"typescript": "^5.2.2"
|
|
82
76
|
},
|
|
83
77
|
"publishConfig": {
|
|
@@ -88,5 +82,5 @@
|
|
|
88
82
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
89
83
|
},
|
|
90
84
|
"sideEffects": false,
|
|
91
|
-
"version": "2.
|
|
85
|
+
"version": "2.11.1"
|
|
92
86
|
}
|
package/dist/nodeIndex.d.mts
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-default-export
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
bundle: true,
|
|
6
|
-
cjsInterop: true,
|
|
7
|
-
clean: false,
|
|
8
|
-
dts: {
|
|
9
|
-
entry: ['src/index.ts', 'src/nodeIndex.ts'],
|
|
10
|
-
},
|
|
11
|
-
entry: ['src/index.ts', 'src/nodeIndex.ts'],
|
|
12
|
-
format: ['cjs', 'esm'],
|
|
13
|
-
sourcemap: true,
|
|
14
|
-
splitting: false,
|
|
15
|
-
tsconfig: 'tsconfig.build.json',
|
|
16
|
-
})
|