@xylabs/buffer 5.0.83 → 5.0.84

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/README.md CHANGED
@@ -50,6 +50,8 @@ const Buffer: typeof Buffer;
50
50
  const bufferPolyfill: () => void;
51
51
  ```
52
52
 
53
+ Polyfills `globalThis.Buffer` with the browser-compatible Buffer implementation if not already defined.
54
+
53
55
  ## Returns
54
56
 
55
57
  `void`
@@ -78,6 +80,8 @@ const Buffer: BufferConstructor;
78
80
  const bufferPolyfill: () => void;
79
81
  ```
80
82
 
83
+ No-op polyfill for Node.js, where Buffer is already available globally.
84
+
81
85
  ## Returns
82
86
 
83
87
  `void`
@@ -1,2 +1,3 @@
1
+ /** Polyfills `globalThis.Buffer` with the browser-compatible Buffer implementation if not already defined. */
1
2
  export declare const bufferPolyfill: () => void;
2
3
  //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/bufferPolyfill.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,YAI1B,CAAA"}
1
+ {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/bufferPolyfill.ts"],"names":[],"mappings":"AAEA,8GAA8G;AAC9G,eAAO,MAAM,cAAc,YAI1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/browser/bufferPolyfill.ts","../../src/browser/index.ts","../../src/index-browser.ts"],"sourcesContent":["import { Buffer } from 'buffer/'\n\nexport const bufferPolyfill = () => {\n if (globalThis.Buffer === undefined) {\n globalThis.Buffer = globalThis.Buffer ?? Buffer\n }\n}\n","export { bufferPolyfill } from './bufferPolyfill.ts'\nexport { Buffer } from 'buffer/'\n","import { Buffer, bufferPolyfill } from './browser/index.ts'\n\nconst BrowserBuffer = Buffer\nconst BrowserBufferPolyfill = bufferPolyfill\nexport { BrowserBuffer as Buffer, BrowserBufferPolyfill as bufferPolyfill }\n"],"mappings":";AAAA,SAAS,cAAc;AAEhB,IAAM,iBAAiB,MAAM;AAClC,MAAI,WAAW,WAAW,QAAW;AACnC,eAAW,SAAS,WAAW,UAAU;AAAA,EAC3C;AACF;;;ACLA,SAAS,UAAAA,eAAc;;;ACCvB,IAAM,gBAAgBC;AACtB,IAAM,wBAAwB;","names":["Buffer","Buffer"]}
1
+ {"version":3,"sources":["../../src/browser/bufferPolyfill.ts","../../src/browser/index.ts","../../src/index-browser.ts"],"sourcesContent":["import { Buffer } from 'buffer/'\n\n/** Polyfills `globalThis.Buffer` with the browser-compatible Buffer implementation if not already defined. */\nexport const bufferPolyfill = () => {\n if (globalThis.Buffer === undefined) {\n globalThis.Buffer = globalThis.Buffer ?? Buffer\n }\n}\n","export { bufferPolyfill } from './bufferPolyfill.ts'\nexport { Buffer } from 'buffer/'\n","import { Buffer, bufferPolyfill } from './browser/index.ts'\n\nconst BrowserBuffer = Buffer\nconst BrowserBufferPolyfill = bufferPolyfill\nexport { BrowserBuffer as Buffer, BrowserBufferPolyfill as bufferPolyfill }\n"],"mappings":";AAAA,SAAS,cAAc;AAGhB,IAAM,iBAAiB,MAAM;AAClC,MAAI,WAAW,WAAW,QAAW;AACnC,eAAW,SAAS,WAAW,UAAU;AAAA,EAC3C;AACF;;;ACNA,SAAS,UAAAA,eAAc;;;ACCvB,IAAM,gBAAgBC;AACtB,IAAM,wBAAwB;","names":["Buffer","Buffer"]}
@@ -1,2 +1,3 @@
1
+ /** No-op polyfill for Node.js, where Buffer is already available globally. */
1
2
  export declare const bufferPolyfill: () => void;
2
3
  //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/bufferPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,YAE1B,CAAA"}
1
+ {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/bufferPolyfill.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,cAAc,YAE1B,CAAA"}
@@ -1,2 +1,3 @@
1
+ /** Polyfills `globalThis.Buffer` with the browser-compatible Buffer implementation if not already defined. */
1
2
  export declare const bufferPolyfill: () => void;
2
3
  //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/bufferPolyfill.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,YAI1B,CAAA"}
1
+ {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/browser/bufferPolyfill.ts"],"names":[],"mappings":"AAEA,8GAA8G;AAC9G,eAAO,MAAM,cAAc,YAI1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/node/bufferPolyfill.ts","../../src/node/index.ts","../../src/index-node.ts"],"sourcesContent":["export const bufferPolyfill = () => {\n return\n}\n","export * from './bufferPolyfill.ts'\nexport { Buffer } from 'node:buffer'\n","import { Buffer, bufferPolyfill } from './node/index.ts'\n\nconst NodeBuffer = Buffer\nconst NodeBufferPolyfill = bufferPolyfill\nexport { NodeBuffer as Buffer, NodeBufferPolyfill as bufferPolyfill }\n"],"mappings":";AAAO,IAAM,iBAAiB,MAAM;AAClC;AACF;;;ACDA,SAAS,cAAc;;;ACCvB,IAAM,aAAa;AACnB,IAAM,qBAAqB;","names":[]}
1
+ {"version":3,"sources":["../../src/node/bufferPolyfill.ts","../../src/node/index.ts","../../src/index-node.ts"],"sourcesContent":["/** No-op polyfill for Node.js, where Buffer is already available globally. */\nexport const bufferPolyfill = () => {\n return\n}\n","export * from './bufferPolyfill.ts'\nexport { Buffer } from 'node:buffer'\n","import { Buffer, bufferPolyfill } from './node/index.ts'\n\nconst NodeBuffer = Buffer\nconst NodeBufferPolyfill = bufferPolyfill\nexport { NodeBuffer as Buffer, NodeBufferPolyfill as bufferPolyfill }\n"],"mappings":";AACO,IAAM,iBAAiB,MAAM;AAClC;AACF;;;ACFA,SAAS,cAAc;;;ACCvB,IAAM,aAAa;AACnB,IAAM,qBAAqB;","names":[]}
@@ -1,2 +1,3 @@
1
+ /** No-op polyfill for Node.js, where Buffer is already available globally. */
1
2
  export declare const bufferPolyfill: () => void;
2
3
  //# sourceMappingURL=bufferPolyfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/bufferPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,YAE1B,CAAA"}
1
+ {"version":3,"file":"bufferPolyfill.d.ts","sourceRoot":"","sources":["../../../src/node/bufferPolyfill.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,cAAc,YAE1B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/buffer",
3
- "version": "5.0.83",
3
+ "version": "5.0.84",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "buffer",
@@ -49,8 +49,8 @@
49
49
  "buffer": "~6.0.3"
50
50
  },
51
51
  "devDependencies": {
52
- "@xylabs/ts-scripts-yarn3": "~7.4.11",
53
- "@xylabs/tsconfig": "~7.4.11",
52
+ "@xylabs/ts-scripts-yarn3": "~7.4.13",
53
+ "@xylabs/tsconfig": "~7.4.13",
54
54
  "typescript": "~5.9.3",
55
55
  "vitest": "~4.0.18"
56
56
  },