From 398053955ab563aea98b85ed83473e2ea4ea0176 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Sun, 5 Jul 2026 18:54:44 +0200 Subject: [PATCH] fix: switch `isBrowser` to Buffer existance check --- src/buffer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/buffer.js b/src/buffer.js index 77db438..92894e5 100644 --- a/src/buffer.js +++ b/src/buffer.js @@ -5,7 +5,6 @@ */ import * as string from './string.js' -import * as env from './environment.js' import * as array from './array.js' import * as math from './math.js' import * as encoding from './encoding.js' @@ -88,10 +87,10 @@ const fromBase64Node = s => { } /* c8 ignore next */ -export const toBase64 = /* @__PURE__ */(() => env.isBrowser ? toBase64Browser : toBase64Node)() +export const toBase64 = /* @__PURE__ */(() => typeof Buffer === 'undefined' ? toBase64Browser : toBase64Node)() /* c8 ignore next */ -export const fromBase64 = /* @__PURE__ */(() => env.isBrowser ? fromBase64Browser : fromBase64Node)() +export const fromBase64 = /* @__PURE__ */(() => typeof Buffer === 'undefined' ? fromBase64Browser : fromBase64Node)() /** * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5