Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xylabs/buffer

Package Overview
Dependencies
Maintainers
7
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/buffer - npm Package Compare versions

Comparing version 2.8.1 to 2.9.0-rc.1

16

dist/cjs/browser/bufferPolyfill.js

@@ -5,9 +5,13 @@ "use strict";

const Buffer_1 = require("./Buffer");
const isBrowser = () => {
return typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.document) !== 'undefined';
};
const isWebworker = () => {
var _a;
return typeof self === 'object' && ((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'DedicatedWorkerGlobalScope';
};
const bufferPolyfillBrowser = () => {
if (window !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const global = window;
if (global.Buffer === undefined) {
global.Buffer = Buffer_1.BrowserBuffer;
}
const global = isBrowser() ? window : isWebworker() ? self : undefined;
if (global && global.Buffer === undefined) {
global.Buffer = Buffer_1.BrowserBuffer;
}

@@ -14,0 +18,0 @@ };

@@ -18,5 +18,5 @@ {

"fileName": "browser/bufferPolyfill.ts",
"line": 3,
"line": 13,
"character": 13,
"url": "https://github.com/xylabs/sdk-js/blob/7940a22/packages/buffer/src/browser/bufferPolyfill.ts#L3"
"url": "https://github.com/xylabs/sdk-js/blob/238bcfa/packages/buffer/src/browser/bufferPolyfill.ts#L13"
}

@@ -35,5 +35,5 @@ ],

"fileName": "browser/bufferPolyfill.ts",
"line": 3,
"line": 13,
"character": 13,
"url": "https://github.com/xylabs/sdk-js/blob/7940a22/packages/buffer/src/browser/bufferPolyfill.ts#L3"
"url": "https://github.com/xylabs/sdk-js/blob/238bcfa/packages/buffer/src/browser/bufferPolyfill.ts#L13"
}

@@ -66,3 +66,3 @@ ],

"character": 13,
"url": "https://github.com/xylabs/sdk-js/blob/7940a22/packages/buffer/src/node/bufferPolyfill.ts#L1"
"url": "https://github.com/xylabs/sdk-js/blob/238bcfa/packages/buffer/src/node/bufferPolyfill.ts#L1"
}

@@ -105,5 +105,5 @@ ],

"character": 0,
"url": "https://github.com/xylabs/sdk-js/blob/7940a22/packages/buffer/src/index.ts#L1"
"url": "https://github.com/xylabs/sdk-js/blob/238bcfa/packages/buffer/src/index.ts#L1"
}
]
}
import { BrowserBuffer } from './Buffer';
const isBrowser = () => {
return typeof window !== 'undefined' && typeof window?.document !== 'undefined';
};
const isWebworker = () => {
return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope';
};
export const bufferPolyfillBrowser = () => {
if (window !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const global = window;
if (global.Buffer === undefined) {
global.Buffer = BrowserBuffer;
}
const global = isBrowser() ? window : isWebworker() ? self : undefined;
if (global && global.Buffer === undefined) {
global.Buffer = BrowserBuffer;
}
};
//# sourceMappingURL=bufferPolyfill.js.map

@@ -59,3 +59,4 @@ {

"sideEffects": false,
"version": "2.8.1"
"version": "2.9.0-rc.1",
"stableVersion": "2.8.1"
}
import { BrowserBuffer } from './Buffer'
type WithOptionalBuffer = { Buffer?: typeof BrowserBuffer }
const isBrowser = () => {
return typeof window !== 'undefined' && typeof window?.document !== 'undefined'
}
const isWebworker = () => {
return typeof self === 'object' && self.constructor?.name === 'DedicatedWorkerGlobalScope'
}
export const bufferPolyfillBrowser = () => {
if (window !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const global = window as any
if (global.Buffer === undefined) {
global.Buffer = BrowserBuffer
}
const global = isBrowser() ? (window as unknown as WithOptionalBuffer) : isWebworker() ? (self as unknown as WithOptionalBuffer) : undefined
if (global && global.Buffer === undefined) {
global.Buffer = BrowserBuffer
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc