commafy-anything 4.0.3 → 4.0.5

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.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,17 @@
1
1
  /**
2
2
  * Adds comma's to a number
3
3
  *
4
+ * @param {string | number} num The number to commafy
5
+ * @param {{
6
+ * stripDecimals?: boolean
7
+ * spacedDecimals?: boolean
8
+ * thousandsComma?: boolean
9
+ * K?: boolean
10
+ * }} [options]
11
+ * By default thousandsComma is enabled, if disabled it shows `1000` without comma (but `10,000`
12
+ * with)
13
+ * @returns {string} Eg. '1,000,000'
4
14
  * @export
5
- * @param {(string | number)} num the number to commafy
6
- * @param {{ stripDecimals?: boolean, spacedDecimals?: boolean, thousandsComma?: boolean, K?: boolean }} [options] By default thousandsComma is enabled, if disabled it shows `1000` without comma (but `10,000` with)
7
- * @returns {string} eg. '1,000,000'
8
15
  */
9
16
  export declare function commafy(num: number, options?: {
10
17
  stripDecimals?: boolean;
package/dist/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  /**
2
2
  * Adds comma's to a number
3
3
  *
4
+ * @param {string | number} num The number to commafy
5
+ * @param {{
6
+ * stripDecimals?: boolean
7
+ * spacedDecimals?: boolean
8
+ * thousandsComma?: boolean
9
+ * K?: boolean
10
+ * }} [options]
11
+ * By default thousandsComma is enabled, if disabled it shows `1000` without comma (but `10,000`
12
+ * with)
13
+ * @returns {string} Eg. '1,000,000'
4
14
  * @export
5
- * @param {(string | number)} num the number to commafy
6
- * @param {{ stripDecimals?: boolean, spacedDecimals?: boolean, thousandsComma?: boolean, K?: boolean }} [options] By default thousandsComma is enabled, if disabled it shows `1000` without comma (but `10,000` with)
7
- * @returns {string} eg. '1,000,000'
8
15
  */
9
16
  export function commafy(num, options) {
10
17
  const { stripDecimals = false, spacedDecimals = false, thousandsComma = true, K = false, } = options || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commafy-anything",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "Adds comma's to a number. A simple and small integration",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -11,11 +11,14 @@
11
11
  "node": ">=18"
12
12
  },
13
13
  "devDependencies": {
14
- "@cycraft/eslint": "^0.4.10",
14
+ "@cycraft/eslint": "^0.4.11",
15
15
  "@cycraft/tsconfig": "^0.1.2",
16
+ "bumpp": "^12.3.0",
16
17
  "del-cli": "^7.0.0",
17
- "np": "^12.1.1",
18
- "vitest": "^5.0.1"
18
+ "eslint": "^9.20.1",
19
+ "jsr": "^0.14.3",
20
+ "typescript": "^5.9.3",
21
+ "vitest": "^5.0.2"
19
22
  },
20
23
  "files": [
21
24
  "dist"
@@ -39,6 +42,6 @@
39
42
  "test": "vitest run",
40
43
  "lint": "tsc --noEmit && eslint ./src",
41
44
  "build": "del-cli dist && tsc",
42
- "release": "pnpm run lint && pnpm run build && np"
45
+ "release": "pnpm run lint && pnpm run build && pnpm test && bumpp --no-push --all && pnpm publish --no-git-checks && jsr publish ${JSR_TOKEN:+--token $JSR_TOKEN} && git push --follow-tags && gh release create $(git describe --tags --abbrev=0) --generate-notes --notes \"$(git log --pretty='- %s %h' $(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD~1)\""
43
46
  }
44
47
  }