fix(medusa-react): Fix production.min.js causing invalid hook usage error in CJS environments (#3144)

This commit is contained in:
Kasper Fabricius Kristensen
2023-02-01 08:07:02 -05:00
committed by GitHub
parent b242e22326
commit 4fbf6b7ad3
8 changed files with 1557 additions and 1322 deletions

View File

@@ -0,0 +1,11 @@
export const isObject = (input: any) => input instanceof Object
export const isArray = (input: any) => Array.isArray(input)
export const isEmpty = (input: any) => {
return (
input === null ||
input === undefined ||
(isObject(input) && Object.keys(input).length === 0) ||
(isArray(input) && (input as any[]).length === 0) ||
(typeof input === "string" && input.trim().length === 0)
)
}