diff --git a/src/compat/array/flattenDeep.ts b/src/compat/array/flattenDeep.ts index ccdb7380..3d51ebb9 100644 --- a/src/compat/array/flattenDeep.ts +++ b/src/compat/array/flattenDeep.ts @@ -1,4 +1,4 @@ -import { flatten } from './flatten'; +import { flatten } from './flatten.ts'; /** * Utility type for recursively unpacking nested array types to extract the type of the innermost element diff --git a/src/compat/array/flattenDepth.ts b/src/compat/array/flattenDepth.ts index 3f3979fc..09d59b9f 100644 --- a/src/compat/array/flattenDepth.ts +++ b/src/compat/array/flattenDepth.ts @@ -1,4 +1,4 @@ -import { flatten } from './flatten'; +import { flatten } from './flatten.ts'; /** * Flattens an array up to the specified depth. diff --git a/src/function/unary.ts b/src/function/unary.ts index da44f595..31c84a0d 100644 --- a/src/function/unary.ts +++ b/src/function/unary.ts @@ -1,4 +1,4 @@ -import { ary } from './ary'; +import { ary } from './ary.ts'; /** * Creates a function that accepts up to one argument, ignoring any additional arguments. diff --git a/src/predicate/isEqual.ts b/src/predicate/isEqual.ts index c30f21b8..e94350f3 100644 --- a/src/predicate/isEqual.ts +++ b/src/predicate/isEqual.ts @@ -4,6 +4,10 @@ import { getSymbols } from "../compat/_internal/getSymbols.ts"; import { getTag } from "../compat/_internal/getTag.ts"; import { isPlainObject } from "./isPlainObject.ts"; +declare var Buffer: { + isBuffer: (a: any) => boolean; +} | undefined; + /** * Checks if two values are equal, including support for `Date`, `RegExp`, and deep object comparison. * @@ -154,7 +158,7 @@ function areObjectsEqual(a: any, b: any, stack?: Map) { case float32ArrayTag: case float64ArrayTag: { // Buffers are also treated as [object Uint8Array]s. - if (Buffer.isBuffer(a) !== Buffer.isBuffer(b)) { + if (typeof Buffer !== 'undefined' && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) { return false; }