@xylabs/decimal-precision 2.11.3 → 2.11.4

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.js CHANGED
@@ -1,13 +1,38 @@
1
- 'use strict';
2
-
3
- const toDecimalPrecision = (value, digits) => {
4
- let fixed = 0;
5
- const result = parseFloat(value.toPrecision(digits));
6
- while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {
7
- fixed++;
8
- }
9
- return result.toFixed(fixed);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
10
17
  };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
11
19
 
12
- exports.toDecimalPrecision = toDecimalPrecision;
13
- //# sourceMappingURL=index.js.map
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ toDecimalPrecision: () => toDecimalPrecision
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ var toDecimalPrecision = (value, digits) => {
27
+ let fixed = 0;
28
+ const result = parseFloat(value.toPrecision(digits));
29
+ while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {
30
+ fixed++;
31
+ }
32
+ return result.toFixed(fixed);
33
+ };
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ toDecimalPrecision
37
+ });
38
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA,MAAA,kBAA+B,GAAA,CAAA,KAAA,EAAA,MAAA;;;;;;;;;;;"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const toDecimalPrecision = (value: number, digits: number) => {\n let fixed = 0\n const result = parseFloat(value.toPrecision(digits))\n while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {\n fixed++\n }\n return result.toFixed(fixed)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,qBAAqB,CAAC,OAAe,WAAmB;AACnE,MAAI,QAAQ;AACZ,QAAM,SAAS,WAAW,MAAM,YAAY,MAAM,CAAC;AACnD,SAAO,WAAW,OAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,QAAQ,IAAI;AACjE;AAAA,EACF;AACA,SAAO,OAAO,QAAQ,KAAK;AAC7B;","names":[]}
package/dist/index.mjs CHANGED
@@ -1,11 +1,13 @@
1
- const toDecimalPrecision = (value, digits) => {
2
- let fixed = 0;
3
- const result = parseFloat(value.toPrecision(digits));
4
- while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {
5
- fixed++;
6
- }
7
- return result.toFixed(fixed);
1
+ // src/index.ts
2
+ var toDecimalPrecision = (value, digits) => {
3
+ let fixed = 0;
4
+ const result = parseFloat(value.toPrecision(digits));
5
+ while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {
6
+ fixed++;
7
+ }
8
+ return result.toFixed(fixed);
8
9
  };
9
-
10
- export { toDecimalPrecision };
11
- //# sourceMappingURL=index.mjs.map
10
+ export {
11
+ toDecimalPrecision
12
+ };
13
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAA,kBAA+B,GAAA,CAAA,KAAA,EAAA,MAAA;;;;;;;;;;;"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const toDecimalPrecision = (value: number, digits: number) => {\n let fixed = 0\n const result = parseFloat(value.toPrecision(digits))\n while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {\n fixed++\n }\n return result.toFixed(fixed)\n}\n"],"mappings":";AAAO,IAAM,qBAAqB,CAAC,OAAe,WAAmB;AACnE,MAAI,QAAQ;AACZ,QAAM,SAAS,WAAW,MAAM,YAAY,MAAM,CAAC;AACnD,SAAO,WAAW,OAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,QAAQ,IAAI;AACjE;AAAA,EACF;AACA,SAAO,OAAO,QAAQ,KAAK;AAC7B;","names":[]}
package/package.json CHANGED
@@ -39,8 +39,8 @@
39
39
  "esm"
40
40
  ],
41
41
  "devDependencies": {
42
- "@xylabs/ts-scripts-yarn3": "^3.0.0",
43
- "@xylabs/tsconfig": "^3.0.0",
42
+ "@xylabs/ts-scripts-yarn3": "^3.0.20",
43
+ "@xylabs/tsconfig": "^3.0.20",
44
44
  "typescript": "^5.2.2"
45
45
  },
46
46
  "publishConfig": {
@@ -51,5 +51,5 @@
51
51
  "url": "https://github.com/xylabs/sdk-js.git"
52
52
  },
53
53
  "sideEffects": false,
54
- "version": "2.11.3"
54
+ "version": "2.11.4"
55
55
  }