@xylabs/buffer 2.11.18 → 2.11.20
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/browser-only/bufferPolyfill.cjs +37 -0
- package/dist/browser/browser-only/bufferPolyfill.cjs.map +1 -0
- package/dist/browser/browser-only/index.cjs +27 -0
- package/dist/browser/browser-only/index.cjs.map +1 -0
- package/dist/browser/node-only/bufferPolyfill.cjs +27 -0
- package/dist/browser/node-only/bufferPolyfill.cjs.map +1 -0
- package/dist/browser/node-only/index.cjs +27 -0
- package/dist/browser/node-only/index.cjs.map +1 -0
- package/package.json +12 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
var bufferPolyfill_exports = {};
|
|
20
|
+
__export(bufferPolyfill_exports, {
|
|
21
|
+
bufferPolyfill: () => bufferPolyfill
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(bufferPolyfill_exports);
|
|
24
|
+
var import_buffer = require("buffer/");
|
|
25
|
+
const isBrowser = () => {
|
|
26
|
+
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
27
|
+
};
|
|
28
|
+
const isWebworker = () => {
|
|
29
|
+
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
30
|
+
};
|
|
31
|
+
const bufferPolyfill = () => {
|
|
32
|
+
const global = isBrowser() ? window : isWebworker() ? self : void 0;
|
|
33
|
+
if (global && global.Buffer === void 0) {
|
|
34
|
+
global.Buffer = import_buffer.Buffer;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=bufferPolyfill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/browser-only/bufferPolyfill.ts"],"sourcesContent":["import { Buffer } from 'buffer/'\n\ntype WithOptionalBuffer = { Buffer?: typeof Buffer }\n\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined'\n}\n\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'\n}\n\nexport const bufferPolyfill = () => {\n const global = isBrowser() ? (window as unknown as WithOptionalBuffer) : isWebworker() ? (self as unknown as WithOptionalBuffer) : undefined\n if (global && global.Buffer === undefined) {\n global.Buffer = Buffer\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAIvB,MAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,MAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,MAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,UAAU,OAAO,WAAW,QAAW;AACzC,WAAO,SAAS;AAAA,EAClB;AACF;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var browser_only_exports = {};
|
|
21
|
+
__export(browser_only_exports, {
|
|
22
|
+
Buffer: () => import_buffer.Buffer
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(browser_only_exports);
|
|
25
|
+
__reExport(browser_only_exports, require("./bufferPolyfill"), module.exports);
|
|
26
|
+
var import_buffer = require("buffer/");
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/browser-only/index.ts"],"sourcesContent":["export * from './bufferPolyfill'\nexport { Buffer } from 'buffer/'\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAc,6BAAd;AACA,oBAAuB;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
var bufferPolyfill_exports = {};
|
|
20
|
+
__export(bufferPolyfill_exports, {
|
|
21
|
+
bufferPolyfill: () => bufferPolyfill
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(bufferPolyfill_exports);
|
|
24
|
+
const bufferPolyfill = () => {
|
|
25
|
+
return;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=bufferPolyfill.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/node-only/bufferPolyfill.ts"],"sourcesContent":["export const bufferPolyfill = () => {\n return\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,iBAAiB,MAAM;AAClC;AACF;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var node_only_exports = {};
|
|
21
|
+
__export(node_only_exports, {
|
|
22
|
+
Buffer: () => import_buffer.Buffer
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(node_only_exports);
|
|
25
|
+
__reExport(node_only_exports, require("./bufferPolyfill"), module.exports);
|
|
26
|
+
var import_buffer = require("buffer");
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/node-only/index.ts"],"sourcesContent":["export * from './bufferPolyfill'\nexport { Buffer } from 'buffer'\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAc,6BAAd;AACA,oBAAuB;","names":[]}
|
package/package.json
CHANGED
|
@@ -16,8 +16,14 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"browser": {
|
|
19
|
-
"
|
|
20
|
-
|
|
19
|
+
"require": {
|
|
20
|
+
"types": "./dist/browser/browser-only/index.d.ts",
|
|
21
|
+
"default": "./dist/browser/browser-only/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/browser/browser-only/index.d.ts",
|
|
25
|
+
"default": "./dist/browser/browser-only/index.js"
|
|
26
|
+
}
|
|
21
27
|
},
|
|
22
28
|
"require": {
|
|
23
29
|
"types": "./dist/node/node-only/index.d.ts",
|
|
@@ -47,9 +53,9 @@
|
|
|
47
53
|
},
|
|
48
54
|
"devDependencies": {
|
|
49
55
|
"@types/node": "^20.7.0",
|
|
50
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
51
|
-
"@xylabs/tsconfig": "^3.0.
|
|
52
|
-
"@xylabs/tsconfig-dom": "^3.0.
|
|
56
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.68",
|
|
57
|
+
"@xylabs/tsconfig": "^3.0.68",
|
|
58
|
+
"@xylabs/tsconfig-dom": "^3.0.68",
|
|
53
59
|
"typescript": "^5.2.2"
|
|
54
60
|
},
|
|
55
61
|
"publishConfig": {
|
|
@@ -60,7 +66,7 @@
|
|
|
60
66
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
61
67
|
},
|
|
62
68
|
"sideEffects": false,
|
|
63
|
-
"version": "2.11.
|
|
69
|
+
"version": "2.11.20",
|
|
64
70
|
"xy": {
|
|
65
71
|
"compile": {
|
|
66
72
|
"depth": 1
|