{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/filters/index.js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/filters/index.js","mtime":1701742078547},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/babel.config.js","mtime":1701742078504},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000}],"contextDependencies":[],"result":["// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\n// import parseTime, formatTime and set to filter\nexport { parseTime, formatTime } from '@/utils';\nexport * from '../filters/commFilter';\nexport * from '../filters/user';\nexport * from '../filters/order';\nexport * from '../filters/wx';\nexport * from '../filters/merchant';\nexport * from '../filters/accounts';\nexport * from '../filters/product';\n\n/**\n * Show plural label if time is plural number\n * @param {number} time\n * @param {string} label\n * @return {string}\n */\nfunction pluralize(time, label) {\n  if (time === 1) {\n    return time + label;\n  }\n  return time + label + 's';\n}\n\n/**\n * @param {number} time\n */\nexport function timeAgo(time) {\n  var between = Date.now() / 1000 - Number(time);\n  if (between < 3600) {\n    return pluralize(~~(between / 60), ' minute');\n  } else if (between < 86400) {\n    return pluralize(~~(between / 3600), ' hour');\n  } else {\n    return pluralize(~~(between / 86400), ' day');\n  }\n}\n\n/**\n * Number formatting\n * like 10000 => 10k\n * @param {number} num\n * @param {number} digits\n */\nexport function numberFormatter(num, digits) {\n  var si = [{\n    value: 1e18,\n    symbol: 'E'\n  }, {\n    value: 1e15,\n    symbol: 'P'\n  }, {\n    value: 1e12,\n    symbol: 'T'\n  }, {\n    value: 1e9,\n    symbol: 'G'\n  }, {\n    value: 1e6,\n    symbol: 'M'\n  }, {\n    value: 1e3,\n    symbol: 'k'\n  }];\n  for (var i = 0; i < si.length; i++) {\n    if (num >= si[i].value) {\n      return (num / si[i].value).toFixed(digits).replace(/\\.0+$|(\\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol;\n    }\n  }\n  return num.toString();\n}\n\n/**\n * 10000 => \"10,000\"\n * @param {number} num\n */\nexport function toThousandFilter(num) {\n  return (+num || 0).toString().replace(/^-?\\d+/g, function (m) {\n    return m.replace(/(?=(?!\\b)(\\d{3})+$)/g, ',');\n  });\n}\n\n/**\n * Upper case first char\n * @param {String} string\n */\nexport function uppercaseFirst(string) {\n  return string.charAt(0).toUpperCase() + string.slice(1);\n}",null]}