{"version":3,"sources":["jsdelivr-header.js","/npm/@type-any/react-native-clear-cache@0.1.1/lib/commonjs/index.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,iICNA,IAAA,aAAA,QAAA,gBAOA,MAAM,WAAE,YAAe,2B,aAER,WAER,SAAS,eAAe,EAAc,EAAkB,GAC7D,GAAI,EAAO,KAAM,MAAQ,GAAE,UAE3B,MACM,EAAI,KAAK,MAAM,KAAK,IAAI,GAAQ,KAAK,IAAI,OACzC,EAAI,EAAU,EAAI,EAAI,EAAU,EAAI,EAAI,EAE9C,OAAO,YAAY,EAAO,KAAK,IAAI,KAAM,IAAI,QAAQ,IAAM,IAJ/C,CAAC,QAAS,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAIK,EACtE,C","file":"/npm/@type-any/react-native-clear-cache@0.1.1/lib/commonjs/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@type-any/react-native-clear-cache@0.1.1/lib/commonjs/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { NativeModules } from 'react-native';\n\ntype ClearCacheType = {\n  getCacheDirSize(): Promise<number>;\n  clearCacheDir(): Promise<void>;\n};\n\nconst { ClearCache } = NativeModules;\n\nexport default ClearCache as ClearCacheType;\n\nexport function formatFileSize(size: number, decimal: number = 4): string {\n  if (size < 1024) return `${size} Bytes`;\n\n  const arr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n  const i = Math.floor(Math.log(size) / Math.log(1024));\n  const d = decimal < 0 ? 0 : decimal > 4 ? 4 : decimal;\n\n  return parseFloat((size / Math.pow(1024, i)).toFixed(d)) + ' ' + arr[i];\n}\n"]}