1 line
4.6 KiB
JSON
1 line
4.6 KiB
JSON
{"ast":null,"code":"/* istanbul ignore file */\nimport * as React from 'react';\nfunction useRenderTimes(props, debug) {\n // Render times\n var timesRef = React.useRef(0);\n timesRef.current += 1;\n\n // Props changed\n var propsRef = React.useRef(props);\n var keys = [];\n Object.keys(props || {}).map(function (key) {\n var _propsRef$current;\n if ((props === null || props === void 0 ? void 0 : props[key]) !== ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current[key])) {\n keys.push(key);\n }\n });\n propsRef.current = props;\n\n // Cache keys since React rerender may cause it lost\n var keysRef = React.useRef([]);\n if (keys.length) {\n keysRef.current = keys;\n }\n React.useDebugValue(timesRef.current);\n React.useDebugValue(keysRef.current.join(', '));\n if (debug) {\n console.log(\"\".concat(debug, \":\"), timesRef.current, keysRef.current);\n }\n return timesRef.current;\n}\nexport default process.env.NODE_ENV !== 'production' ? useRenderTimes : function () {};\nexport var RenderBlock = /*#__PURE__*/React.memo(function () {\n var times = useRenderTimes();\n return /*#__PURE__*/React.createElement(\"h1\", null, \"Render Times: \", times);\n});\nif (process.env.NODE_ENV !== 'production') {\n RenderBlock.displayName = 'RenderBlock';\n}","map":{"version":3,"names":["React","useRenderTimes","props","debug","timesRef","useRef","current","propsRef","keys","Object","map","key","_propsRef$current","push","keysRef","length","useDebugValue","join","console","log","concat","process","env","NODE_ENV","RenderBlock","memo","times","createElement","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-table/es/hooks/useRenderTimes.js"],"sourcesContent":["/* istanbul ignore file */\nimport * as React from 'react';\nfunction useRenderTimes(props, debug) {\n // Render times\n var timesRef = React.useRef(0);\n timesRef.current += 1;\n\n // Props changed\n var propsRef = React.useRef(props);\n var keys = [];\n Object.keys(props || {}).map(function (key) {\n var _propsRef$current;\n if ((props === null || props === void 0 ? void 0 : props[key]) !== ((_propsRef$current = propsRef.current) === null || _propsRef$current === void 0 ? void 0 : _propsRef$current[key])) {\n keys.push(key);\n }\n });\n propsRef.current = props;\n\n // Cache keys since React rerender may cause it lost\n var keysRef = React.useRef([]);\n if (keys.length) {\n keysRef.current = keys;\n }\n React.useDebugValue(timesRef.current);\n React.useDebugValue(keysRef.current.join(', '));\n if (debug) {\n console.log(\"\".concat(debug, \":\"), timesRef.current, keysRef.current);\n }\n return timesRef.current;\n}\nexport default process.env.NODE_ENV !== 'production' ? useRenderTimes : function () {};\nexport var RenderBlock = /*#__PURE__*/React.memo(function () {\n var times = useRenderTimes();\n return /*#__PURE__*/React.createElement(\"h1\", null, \"Render Times: \", times);\n});\nif (process.env.NODE_ENV !== 'production') {\n RenderBlock.displayName = 'RenderBlock';\n}"],"mappings":"AAAA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAcA,CAACC,KAAK,EAAEC,KAAK,EAAE;EACpC;EACA,IAAIC,QAAQ,GAAGJ,KAAK,CAACK,MAAM,CAAC,CAAC,CAAC;EAC9BD,QAAQ,CAACE,OAAO,IAAI,CAAC;;EAErB;EACA,IAAIC,QAAQ,GAAGP,KAAK,CAACK,MAAM,CAACH,KAAK,CAAC;EAClC,IAAIM,IAAI,GAAG,EAAE;EACbC,MAAM,CAACD,IAAI,CAACN,KAAK,IAAI,CAAC,CAAC,CAAC,CAACQ,GAAG,CAAC,UAAUC,GAAG,EAAE;IAC1C,IAAIC,iBAAiB;IACrB,IAAI,CAACV,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,KAAK,CAACS,GAAG,CAAC,OAAO,CAACC,iBAAiB,GAAGL,QAAQ,CAACD,OAAO,MAAM,IAAI,IAAIM,iBAAiB,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,iBAAiB,CAACD,GAAG,CAAC,CAAC,EAAE;MACtLH,IAAI,CAACK,IAAI,CAACF,GAAG,CAAC;IAChB;EACF,CAAC,CAAC;EACFJ,QAAQ,CAACD,OAAO,GAAGJ,K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