@xylabs/buffer 2.11.1 → 2.11.3

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.
Files changed (39) hide show
  1. package/dist/browser/Buffer.d.mts +3 -0
  2. package/dist/browser/Buffer.d.mts.map +1 -0
  3. package/dist/browser/Buffer.js +11 -0
  4. package/dist/browser/Buffer.js.map +1 -0
  5. package/dist/browser/Buffer.mjs +2 -0
  6. package/dist/browser/Buffer.mjs.map +1 -0
  7. package/dist/browser/bufferPolyfill.d.mts +2 -0
  8. package/dist/browser/bufferPolyfill.d.mts.map +1 -0
  9. package/dist/browser/bufferPolyfill.js +19 -0
  10. package/dist/browser/bufferPolyfill.js.map +1 -0
  11. package/dist/browser/bufferPolyfill.mjs +17 -0
  12. package/dist/browser/bufferPolyfill.mjs.map +1 -0
  13. package/dist/browser/index.d.mts +3 -0
  14. package/dist/browser/index.d.mts.map +1 -0
  15. package/dist/browser/index.js +13 -0
  16. package/dist/browser/index.js.map +1 -0
  17. package/dist/browser/index.mjs +3 -0
  18. package/dist/browser/index.mjs.map +1 -0
  19. package/dist/node/Buffer.d.mts +3 -0
  20. package/dist/node/Buffer.d.mts.map +1 -0
  21. package/dist/node/Buffer.js +11 -0
  22. package/dist/node/Buffer.js.map +1 -0
  23. package/dist/node/Buffer.mjs +2 -0
  24. package/dist/node/Buffer.mjs.map +1 -0
  25. package/dist/node/bufferPolyfill.d.mts +2 -0
  26. package/dist/node/bufferPolyfill.d.mts.map +1 -0
  27. package/dist/node/bufferPolyfill.js +8 -0
  28. package/dist/node/bufferPolyfill.js.map +1 -0
  29. package/dist/node/bufferPolyfill.mjs +6 -0
  30. package/dist/node/bufferPolyfill.mjs.map +1 -0
  31. package/dist/node/index.d.mts +3 -0
  32. package/dist/node/index.d.mts.map +1 -0
  33. package/dist/node/index.js +13 -0
  34. package/dist/node/index.js.map +1 -0
  35. package/dist/node/index.mjs +3 -0
  36. package/dist/node/index.mjs.map +1 -0
  37. package/dist/nodeIndex.d.mts +3 -0
  38. package/dist/nodeIndex.d.mts.map +1 -0
  39. package/package.json +6 -25
@@ -0,0 +1,3 @@
1
+ import { Buffer as BrowserBuffer } from 'buffer/';
2
+ export { BrowserBuffer };
3
+ //# sourceMappingURL=Buffer.d.ts.map
@@ -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,11 @@
1
+ 'use strict';
2
+
3
+ var _ = require('buffer/');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, 'BrowserBuffer', {
8
+ enumerable: true,
9
+ get: function () { return _.Buffer; }
10
+ });
11
+ //# sourceMappingURL=Buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Buffer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Buffer as BrowserBuffer } from 'buffer/';
2
+ //# sourceMappingURL=Buffer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Buffer.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const bufferPolyfillBrowser: () => void;
2
+ //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -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,19 @@
1
+ 'use strict';
2
+
3
+ var _ = require('buffer/');
4
+
5
+ const isBrowser = () => {
6
+ return typeof window !== 'undefined' && typeof window?.document !== 'undefined';
7
+ };
8
+ const isWebworker = () => {
9
+ return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';
10
+ };
11
+ const bufferPolyfillBrowser = () => {
12
+ const global = isBrowser() ? window : isWebworker() ? self : undefined;
13
+ if (global && global.Buffer === undefined) {
14
+ global.Buffer = _.Buffer;
15
+ }
16
+ };
17
+
18
+ exports.bufferPolyfillBrowser = bufferPolyfillBrowser;
19
+ //# sourceMappingURL=bufferPolyfill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferPolyfill.js","sources":["../../src/browser/bufferPolyfill.ts"],"sourcesContent":["import { BrowserBuffer } from './Buffer';\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined';\n};\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';\n};\nexport const bufferPolyfillBrowser = () => {\n const global = isBrowser() ? window : isWebworker() ? self : undefined;\n if (global && global.Buffer === undefined) {\n global.Buffer = BrowserBuffer;\n }\n};\n//# sourceMappingURL=bufferPolyfill.js.map"],"names":["BrowserBuffer"],"mappings":";;;;AACA,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,EAAE,QAAQ,KAAK,WAAW,CAAC;AACpF,CAAC,CAAC;AACF,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,KAAK,4BAA4B,CAAC;AAC/F,CAAC,CAAC;AACU,MAAC,qBAAqB,GAAG,MAAM;AAC3C,IAAI,MAAM,MAAM,GAAG,SAAS,EAAE,GAAG,MAAM,GAAG,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAC3E,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE;AAC/C,QAAQ,MAAM,CAAC,MAAM,GAAGA,QAAa,CAAC;AACtC,KAAK;AACL;;;;"}
@@ -0,0 +1,17 @@
1
+ import { Buffer } from 'buffer/';
2
+
3
+ const isBrowser = () => {
4
+ return typeof window !== 'undefined' && typeof window?.document !== 'undefined';
5
+ };
6
+ const isWebworker = () => {
7
+ return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';
8
+ };
9
+ const bufferPolyfillBrowser = () => {
10
+ const global = isBrowser() ? window : isWebworker() ? self : undefined;
11
+ if (global && global.Buffer === undefined) {
12
+ global.Buffer = Buffer;
13
+ }
14
+ };
15
+
16
+ export { bufferPolyfillBrowser };
17
+ //# sourceMappingURL=bufferPolyfill.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferPolyfill.mjs","sources":["../../src/browser/bufferPolyfill.ts"],"sourcesContent":["import { BrowserBuffer } from './Buffer';\nconst isBrowser = () => {\n return typeof window !== 'undefined' && typeof window?.document !== 'undefined';\n};\nconst isWebworker = () => {\n return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';\n};\nexport const bufferPolyfillBrowser = () => {\n const global = isBrowser() ? window : isWebworker() ? self : undefined;\n if (global && global.Buffer === undefined) {\n global.Buffer = BrowserBuffer;\n }\n};\n//# sourceMappingURL=bufferPolyfill.js.map"],"names":["BrowserBuffer"],"mappings":";;AACA,MAAM,SAAS,GAAG,MAAM;AACxB,IAAI,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,EAAE,QAAQ,KAAK,WAAW,CAAC;AACpF,CAAC,CAAC;AACF,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,KAAK,4BAA4B,CAAC;AAC/F,CAAC,CAAC;AACU,MAAC,qBAAqB,GAAG,MAAM;AAC3C,IAAI,MAAM,MAAM,GAAG,SAAS,EAAE,GAAG,MAAM,GAAG,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAC3E,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE;AAC/C,QAAQ,MAAM,CAAC,MAAM,GAAGA,MAAa,CAAC;AACtC,KAAK;AACL;;;;"}
@@ -0,0 +1,3 @@
1
+ export * from './Buffer';
2
+ export * from './bufferPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var _ = require('buffer/');
4
+ var bufferPolyfill = require('./bufferPolyfill.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, 'BrowserBuffer', {
9
+ enumerable: true,
10
+ get: function () { return _.Buffer; }
11
+ });
12
+ exports.bufferPolyfillBrowser = bufferPolyfill.bufferPolyfillBrowser;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ export { Buffer as BrowserBuffer } from 'buffer/';
2
+ export { bufferPolyfillBrowser } from './bufferPolyfill.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
1
+ import { Buffer } from 'buffer';
2
+ export { Buffer as NodeBuffer };
3
+ //# sourceMappingURL=Buffer.d.ts.map
@@ -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,11 @@
1
+ 'use strict';
2
+
3
+ var buffer = require('buffer');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, 'NodeBuffer', {
8
+ enumerable: true,
9
+ get: function () { return buffer.Buffer; }
10
+ });
11
+ //# sourceMappingURL=Buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Buffer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export { Buffer as NodeBuffer } from 'buffer';
2
+ //# sourceMappingURL=Buffer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Buffer.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const bufferPolyfillNode: () => void;
2
+ //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -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,8 @@
1
+ 'use strict';
2
+
3
+ const bufferPolyfillNode = () => {
4
+ return;
5
+ };
6
+
7
+ exports.bufferPolyfillNode = bufferPolyfillNode;
8
+ //# sourceMappingURL=bufferPolyfill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferPolyfill.js","sources":["../../src/node/bufferPolyfill.ts"],"sourcesContent":["export const bufferPolyfillNode = () => {\n return;\n};\n//# sourceMappingURL=bufferPolyfill.js.map"],"names":[],"mappings":";;AAAY,MAAC,kBAAkB,GAAG,MAAM;AACxC,IAAI,OAAO;AACX;;;;"}
@@ -0,0 +1,6 @@
1
+ const bufferPolyfillNode = () => {
2
+ return;
3
+ };
4
+
5
+ export { bufferPolyfillNode };
6
+ //# sourceMappingURL=bufferPolyfill.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferPolyfill.mjs","sources":["../../src/node/bufferPolyfill.ts"],"sourcesContent":["export const bufferPolyfillNode = () => {\n return;\n};\n//# sourceMappingURL=bufferPolyfill.js.map"],"names":[],"mappings":"AAAY,MAAC,kBAAkB,GAAG,MAAM;AACxC,IAAI,OAAO;AACX;;;;"}
@@ -0,0 +1,3 @@
1
+ export * from './Buffer';
2
+ export * from './bufferPolyfill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var buffer = require('buffer');
4
+ var bufferPolyfill = require('./bufferPolyfill.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, 'NodeBuffer', {
9
+ enumerable: true,
10
+ get: function () { return buffer.Buffer; }
11
+ });
12
+ exports.bufferPolyfillNode = bufferPolyfill.bufferPolyfillNode;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ export { Buffer as NodeBuffer } from 'buffer';
2
+ export { bufferPolyfillNode } from './bufferPolyfill.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
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/package.json CHANGED
@@ -24,35 +24,16 @@
24
24
  },
25
25
  "import": {
26
26
  "node": {
27
- "types": "./dist/nodeIndex.d.mts",
27
+ "types": "./dist/nodeIndex.d.ts",
28
28
  "default": "./dist/nodeIndex.mjs"
29
29
  },
30
30
  "types": "./dist/index.d.mts",
31
31
  "default": "./dist/index.mjs"
32
32
  }
33
33
  },
34
- "./dist/docs.json": {
35
- "default": "./dist/docs.json"
36
- },
37
- "./cjs": {
38
- "types": "./dist/index.d.ts",
39
- "default": "./dist/index.js"
40
- },
41
34
  "./docs": {
42
35
  "default": "./dist/docs.json"
43
36
  },
44
- "./esm": {
45
- "types": "./dist/index.d.mts",
46
- "default": "./dist/index.mjs"
47
- },
48
- "./node/cjs": {
49
- "types": "./dist/nodeIndex.d.ts",
50
- "default": "./dist/nodeIndex.js"
51
- },
52
- "./node/esm": {
53
- "types": "./dist/nodeIndex.d.mts",
54
- "default": "./dist/nodeIndex.mjs"
55
- },
56
37
  "./package.json": "./package.json"
57
38
  },
58
39
  "main": "dist/index.js",
@@ -68,10 +49,10 @@
68
49
  "buffer": "^6.0.3"
69
50
  },
70
51
  "devDependencies": {
71
- "@types/node": "^20.6.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",
52
+ "@types/node": "^20.6.1",
53
+ "@xylabs/ts-scripts-yarn3": "^3.0.0",
54
+ "@xylabs/tsconfig": "^3.0.0",
55
+ "@xylabs/tsconfig-dom": "^3.0.0",
75
56
  "typescript": "^5.2.2"
76
57
  },
77
58
  "publishConfig": {
@@ -82,5 +63,5 @@
82
63
  "url": "https://github.com/xylabs/sdk-js.git"
83
64
  },
84
65
  "sideEffects": false,
85
- "version": "2.11.1"
66
+ "version": "2.11.3"
86
67
  }