@xylabs/buffer 2.12.13 → 2.12.15
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.
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
// src/browser/bufferPolyfill.ts
|
|
1
2
|
import { Buffer } from "buffer/";
|
|
2
|
-
|
|
3
|
+
var isBrowser = () => {
|
|
3
4
|
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
+
var isWebworker = () => {
|
|
6
7
|
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
var bufferPolyfill = () => {
|
|
9
10
|
const global = isBrowser() ? window : isWebworker() ? self : void 0;
|
|
10
11
|
if (global && global.Buffer === void 0) {
|
|
11
12
|
global.Buffer = Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/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,SAAS,cAAc;AAIvB,
|
|
1
|
+
{"version":3,"sources":["../../src/browser/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,SAAS,cAAc;AAIvB,IAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,IAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,UAAU,OAAO,WAAW,QAAW;AACzC,WAAO,SAAS;AAAA,EAClB;AACF;","names":[]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// src/browser/bufferPolyfill.ts
|
|
2
2
|
import { Buffer } from "buffer/";
|
|
3
|
+
var isBrowser = () => {
|
|
4
|
+
return typeof window !== "undefined" && typeof window?.document !== "undefined";
|
|
5
|
+
};
|
|
6
|
+
var isWebworker = () => {
|
|
7
|
+
return typeof self === "object" && self.constructor?.name === "DedicatedWorkerGlobalScope";
|
|
8
|
+
};
|
|
9
|
+
var bufferPolyfill = () => {
|
|
10
|
+
const global = isBrowser() ? window : isWebworker() ? self : void 0;
|
|
11
|
+
if (global && global.Buffer === void 0) {
|
|
12
|
+
global.Buffer = Buffer;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// src/browser/index.ts
|
|
17
|
+
import { Buffer as Buffer2 } from "buffer/";
|
|
3
18
|
export {
|
|
4
|
-
Buffer,
|
|
19
|
+
Buffer2 as Buffer,
|
|
5
20
|
bufferPolyfill
|
|
6
21
|
};
|
|
7
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/index.ts"],"sourcesContent":["import { bufferPolyfill } from './bufferPolyfill'\nexport { Buffer } from 'buffer/'\n\nexport { bufferPolyfill }\n"],"mappings":"AAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../src/browser/bufferPolyfill.ts","../../src/browser/index.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","import { bufferPolyfill } from './bufferPolyfill'\nexport { Buffer } from 'buffer/'\n\nexport { bufferPolyfill }\n"],"mappings":";AAAA,SAAS,cAAc;AAIvB,IAAM,YAAY,MAAM;AACtB,SAAO,OAAO,WAAW,eAAe,OAAO,QAAQ,aAAa;AACtE;AAEA,IAAM,cAAc,MAAM;AACxB,SAAO,OAAO,SAAS,YAAY,KAAK,aAAa,SAAS;AAChE;AAEO,IAAM,iBAAiB,MAAM;AAClC,QAAM,SAAS,UAAU,IAAK,SAA2C,YAAY,IAAK,OAAyC;AACnI,MAAI,UAAU,OAAO,WAAW,QAAW;AACzC,WAAO,SAAS;AAAA,EAClB;AACF;;;AChBA,SAAS,UAAAA,eAAc;","names":["Buffer"]}
|
package/package.json
CHANGED
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"buffer": "^6.0.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^20.
|
|
56
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
57
|
-
"@xylabs/tsconfig": "^3.0.
|
|
58
|
-
"@xylabs/tsconfig-dom": "^3.0.
|
|
55
|
+
"@types/node": "^20.8.2",
|
|
56
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.88",
|
|
57
|
+
"@xylabs/tsconfig": "^3.0.88",
|
|
58
|
+
"@xylabs/tsconfig-dom": "^3.0.88",
|
|
59
59
|
"typescript": "^5.2.2"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"url": "https://github.com/xylabs/sdk-js.git"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "2.12.
|
|
69
|
+
"version": "2.12.15",
|
|
70
70
|
"xy": {
|
|
71
71
|
"compile": {
|
|
72
72
|
"browser": {
|