@zinaid/num 0.0.4 → 0.0.6

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,5 +1,5 @@
1
1
  import { clamp as a, currency as l, defaultCurrency as o, defaultLocale as n, fileSize as s, forHumans as u, format as t, minutesToHuman as c, ordinal as m, pairs as p, parse as i, parseFloat as f, parseInt as d, percentage as y, secondsToHuman as C, spell as H, spellOrdinal as L, summarize as h, trim as w, useCurrency as x, useLocale as z, withCurrency as S, withLocale as T } from "./num.js";
2
- import { Speller as F } from "./speller.js";
2
+ import { Speller as F } from "./speller/index.js";
3
3
  export {
4
4
  F as Speller,
5
5
  a as clamp,
@@ -0,0 +1,7 @@
1
+ import { ToWords as ToWordsType, ToWords } from 'to-words';
2
+ export declare class Speller {
3
+ protected toWords: ToWordsType | undefined;
4
+ protected getToWords(): ToWords;
5
+ spellNumber(num: number): string;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/speller/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,qBAAa,OAAO;IAChB,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAE3C,SAAS,CAAC,UAAU,IAAI,OAAO;IAOxB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAG1C"}
@@ -0,0 +1,13 @@
1
+ import { ToWords as r } from "to-words";
2
+ class e {
3
+ toWords;
4
+ getToWords() {
5
+ return this.toWords || (this.toWords = new r()), this.toWords;
6
+ }
7
+ spellNumber(o) {
8
+ return this.getToWords().convert(o);
9
+ }
10
+ }
11
+ export {
12
+ e as Speller
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinaid/num",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Utilities for working with numbers similar to Laravel's Num class facade.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -35,13 +35,18 @@
35
35
  "require": "./dist/index.js",
36
36
  "types": "./dist/index.d.ts"
37
37
  },
38
+ "./*": {
39
+ "import": "./dist/*",
40
+ "require": "./dist/*",
41
+ "types": "./dist/*"
42
+ },
38
43
  "./num": {
39
44
  "import": "./dist/num.js",
40
45
  "types": "./dist/num.d.ts"
41
46
  },
42
47
  "./speller": {
43
- "import": "./dist/speller.js",
44
- "types": "./dist/speller.d.ts"
48
+ "import": "./dist/speller/index.js",
49
+ "types": "./dist/speller/index.d.ts"
45
50
  }
46
51
  }
47
52
  }
package/dist/speller.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { ToWords } from 'to-words';
2
- export declare class Speller {
3
- protected toWords: ToWords | undefined;
4
- protected getToWords(): ToWords;
5
- spellNumber(num: number): string;
6
- }
7
- //# sourceMappingURL=speller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"speller.d.ts","sourceRoot":"","sources":["../src/speller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,OAAO;IAChB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAEvC,SAAS,CAAC,UAAU,IAAI,OAAO;IAWxB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAG1C"}
package/dist/speller.js DELETED
@@ -1,20 +0,0 @@
1
- import { optionalRequire as s } from "@zinaid/utils";
2
- class e {
3
- toWords;
4
- getToWords() {
5
- if (!this.toWords) {
6
- const o = s(
7
- "to-words",
8
- 'The "to-words" package is required for spelling numbers. Please install it: npm install to-words'
9
- ).ToWords;
10
- this.toWords = new o();
11
- }
12
- return this.toWords;
13
- }
14
- spellNumber(o) {
15
- return this.getToWords().convert(o);
16
- }
17
- }
18
- export {
19
- e as Speller
20
- };