@zohodesk/utils 1.1.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
1
  /**
2
- *
3
- * @param {number|string} count
4
- * @param {object} options
5
- * @param {string} options.locale
2
+ *
3
+ * @param {number|string} count
4
+ * @param {object} options
5
+ * @param {string} options.locale
6
6
  * @param {boolean} options.withAbbr
7
7
  * @param {number} options.decimals
8
- * @returns
8
+ * @returns
9
9
  */
10
10
  export default function abbreviateNumber() {
11
11
  let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
12
12
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13
- if (typeof count === "string") {
13
+ if (typeof count === 'string') {
14
14
  count = parseInt(count);
15
15
  }
16
16
  if (global.Intl && global.Intl.NumberFormat) {
17
- let numberFormat = Intl.NumberFormat(options.locale || "en", {
18
- notation: "compact"
17
+ let numberFormat = Intl.NumberFormat(options.locale || 'en', {
18
+ notation: 'compact'
19
19
  // compactDisplay: "short",
20
20
  });
21
21
 
22
22
  return numberFormat.format(count);
23
23
  }
24
24
  //Comaptibility
25
- const COUNT_ABBRS = ["", "K", "M", "G", "T", "P", "E", "Z", "Y"];
25
+ const COUNT_ABBRS = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
26
26
  let {
27
27
  withAbbr = true,
28
28
  decimals = 2
@@ -1,3 +1,3 @@
1
1
  export default function (object, search, replace) {
2
- return object.replace(new RegExp(search + "([^" + search + "]*)$"), replace + "$1");
2
+ return object.replace(new RegExp(search + '([^' + search + ']*)$'), replace + '$1');
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/utils",
3
- "version": "1.1.1",
3
+ "version": "1.3.2",
4
4
  "description": "Unified Component Library - Utils",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -31,5 +31,5 @@
31
31
  "es",
32
32
  "!**/__tests__"
33
33
  ],
34
- "gitHead": "3ab581ad35271aa4d93d3036f718d9a67b3bc85a"
34
+ "gitHead": "2be0000a29c7397a9b24e391b328fbe3ecd13156"
35
35
  }