{"ast":null,"code":"import * as React from 'react';\nimport isEqual from \"rc-util/es/isEqual\";\n/**\n * Singleton cache will only take latest `cacheParams` as key\n * and return the result for callback matching.\n */\nexport default function useSingletonCache() {\n const cacheRef = React.useRef([null, null]);\n const getCache = (cacheKeys, callback) => {\n const filteredKeys = cacheKeys.map(item => item instanceof HTMLElement || Number.isNaN(item) ? '' : item);\n if (!isEqual(cacheRef.current[0], filteredKeys)) {\n cacheRef.current = [filteredKeys, callback()];\n }\n return cacheRef.current[1];\n };\n return getCache;\n}","map":{"version":3,"names":["React","isEqual","useSingletonCache","cacheRef","useRef","getCache","cacheKeys","callback","filteredKeys","map","item","HTMLElement","Number","isNaN","current"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/watermark/useSingletonCache.js"],"sourcesContent":["import * as React from 'react';\nimport isEqual from \"rc-util/es/isEqual\";\n/**\n * Singleton cache will only take latest `cacheParams` as key\n * and return the result for callback matching.\n */\nexport default function useSingletonCache() {\n const cacheRef = React.useRef([null, null]);\n const getCache = (cacheKeys, callback) => {\n const filteredKeys = cacheKeys.map(item => item instanceof HTMLElement || Number.isNaN(item) ? '' : item);\n if (!isEqual(cacheRef.current[0], filteredKeys)) {\n cacheRef.current = [filteredKeys, callback()];\n }\n return cacheRef.current[1];\n };\n return getCache;\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,oBAAoB;AACxC;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAA,EAAG;EAC1C,MAAMC,QAAQ,GAAGH,KAAK,CAACI,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;EAC3C,MAAMC,QAAQ,GAAGA,CAACC,SAAS,EAAEC,QAAQ,KAAK;IACxC,MAAMC,YAAY,GAAGF,SAAS,CAACG,GAAG,CAACC,IAAI,IAAIA,IAAI,YAAYC,WAAW,IAAIC,MAAM,CAACC,KAAK,CAACH,IAAI,CAAC,GAAG,EAAE,GAAGA,IAAI,CAAC;IACzG,IAAI,CAACT,OAAO,CAACE,QAAQ,CAACW,OAAO,CAAC,CAAC,CAAC,EAAEN,YAAY,CAAC,EAAE;MAC/CL,QAAQ,CAACW,OAAO,GAAG,CAACN,YAAY,EAAED,QAAQ,CAAC,CAAC,CAAC;IAC/C;IACA,OAAOJ,QAAQ,CAACW,OAAO,CAAC,CAAC,CAAC;EAC5B,CAAC;EACD,OAAOT,QAAQ;AACjB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}