1 |
- {"version":3,"sources":["../src/utils/shallowEqual.ts","../src/index-rsc.ts"],"sourcesContent":["function is(x: unknown, y: unknown) {\r\n if (x === y) {\r\n return x !== 0 || y !== 0 || 1 / x === 1 / y\r\n } else {\r\n return x !== x && y !== y\r\n }\r\n}\r\n\r\nexport default function shallowEqual(objA: any, objB: any) {\r\n if (is(objA, objB)) return true\r\n\r\n if (\r\n typeof objA !== 'object' ||\r\n objA === null ||\r\n typeof objB !== 'object' ||\r\n objB === null\r\n ) {\r\n return false\r\n }\r\n\r\n const keysA = Object.keys(objA)\r\n const keysB = Object.keys(objB)\r\n\r\n if (keysA.length !== keysB.length) return false\r\n\r\n for (let i = 0; i < keysA.length; i++) {\r\n if (\r\n !Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||\r\n !is(objA[keysA[i]], objB[keysA[i]])\r\n ) {\r\n return false\r\n }\r\n }\r\n\r\n return true\r\n}\r\n","import type * as normal from './index'\r\nimport type * as rsc from './index-rsc'\r\n\r\n// checks to make sure we didn't forgot to replicate any exports\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nconst _check: typeof normal = {} as typeof rsc\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nconst _check2: typeof rsc = {} as typeof normal\r\n\r\n// -------------------------------------------------------------------------------------\r\n\r\nfunction throwNotSupportedError(\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n ...args: any[]\r\n): any {\r\n throw new Error(\r\n 'This function is not supported in React Server Components. Please only use this export in a Client Component.'\r\n )\r\n}\r\n\r\nexport {\r\n throwNotSupportedError as batch,\r\n throwNotSupportedError as Provider,\r\n throwNotSupportedError as connect,\r\n throwNotSupportedError as useSelector,\r\n throwNotSupportedError as useDispatch,\r\n throwNotSupportedError as useStore,\r\n throwNotSupportedError as createDispatchHook,\r\n throwNotSupportedError as createSelectorHook,\r\n throwNotSupportedError as createStoreHook,\r\n}\r\nexport const ReactReduxContext = {} as any\r\nexport { default as shallowEqual } from './utils/shallowEqual'\r\n"],"mappings":";AAAA,SAAS,GAAG,GAAY,GAAY;AAClC,MAAI,MAAM,GAAG;AACX,WAAO,MAAM,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI;AAAA,EAC7C,OAAO;AACL,WAAO,MAAM,KAAK,MAAM;AAAA,EAC1B;AACF;AAEe,SAAR,aAA8B,MAAW,MAAW;AACzD,MAAI,GAAG,MAAM,IAAI;AAAG,WAAO;AAE3B,MACE,OAAO,SAAS,YAChB,SAAS,QACT,OAAO,SAAS,YAChB,SAAS,MACT;AACA,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,OAAO,KAAK,IAAI;AAC9B,QAAM,QAAQ,OAAO,KAAK,IAAI;AAE9B,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAE1C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QACE,CAAC,OAAO,UAAU,eAAe,KAAK,MAAM,MAAM,CAAC,CAAC,KACpD,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,GAClC;AACA,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;;;ACvBA,SAAS,0BAEJ,MACE;AACL,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAaO,IAAM,oBAAoB,CAAC;","names":[]}
|