tanisa 1.0.0 → 1.0.1

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.
@@ -0,0 +1 @@
1
+ yarn lint-staged
@@ -0,0 +1 @@
1
+ yarn test
@@ -0,0 +1,3 @@
1
+ {
2
+ "*.{js,ts,md,json}": ["eslint --fix", "prettier --write"]
3
+ }
package/.prettierrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "trailingComma": "es5",
3
+ "singleQuote": true,
4
+ "semi": false,
5
+ "tabWidth": 2
6
+ }
package/README.md CHANGED
@@ -1,2 +1,42 @@
1
1
  # tanisa
2
- An utility to convert Malagasy 🇲🇬 numbers, including decimals, into their word representations.
2
+
3
+ [![npm version](https://badge.fury.io/js/tanisa.svg)](https://www.npmjs.com/package/tanisa)
4
+ ![License](https://img.shields.io/badge/License-MIT-yellow.svg)
5
+
6
+ **Tanisa** (Malagasy 🇲🇬 for "to count") is here to give those digits a voice, transforming them into elegant Malagasy words.
7
+
8
+ ## Features
9
+
10
+ - ✅ **Handles whole numbers** : From a humble "aotra" (zero) to numbers that make your calculator sweat.
11
+ - ✅ **Decimal support** : Gracefully converts those pesky fractions into spoken form.
12
+ - ✅ **Large number linguistics**: Tackles big numbers with the appropriate Malagasy terminology.
13
+ - ✅ **User-friendly API** : So intuitive, you'll feel like you've been speaking number-words your whole life.
14
+ - 🛡️ **Error Handling** : Throws helpful errors when you try to feed it something it can't digest.
15
+
16
+ ## Installation
17
+
18
+ `yarn add tanisa`
19
+
20
+ ## Usage
21
+
22
+ 1. Import the Magic:
23
+
24
+ ```
25
+ import { MalagasyNumberToWords } from 'tanisa'
26
+ ```
27
+
28
+ 2. Simply use it:
29
+
30
+ ```
31
+ const tanisa = new MalagasyNumberToWords();
32
+
33
+ tanisa.toWords(233)
34
+ ```
35
+
36
+ 3. Examples:
37
+
38
+ ```
39
+ tanisa.toWords(233) ==> Telo amby telopolo sy roanjato
40
+ tanisa.toWords(18.3) ==> Valo amby folo faingo telo
41
+ tanisa.toWords(0.008) ==> Aotra faingo aotra aotra valo
42
+ ```
@@ -0,0 +1,13 @@
1
+ // @ts-check
2
+
3
+ import eslint from '@eslint/js'
4
+ import tseslint from 'typescript-eslint'
5
+
6
+ export default tseslint.config(
7
+ eslint.configs.recommended,
8
+ tseslint.configs.recommended,
9
+ tseslint.configs.stylistic,
10
+ {
11
+ ignores: ['./dist', './node_modules'],
12
+ }
13
+ )
package/package.json CHANGED
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "tanisa",
3
- "version": "1.0.0",
4
- "main": "src/converter.ts",
3
+ "version": "1.0.1",
4
+ "main": "src/index.ts",
5
5
  "description": "An utility to convert Malagasy 🇲🇬 numbers, including decimals, into their word representations.",
6
6
  "license": "MIT",
7
7
  "author": {
8
8
  "name": "Rija Nifaliana",
9
9
  "email": "rija.nifaliana@gmail.com"
10
10
  },
11
- "files": [
12
- "dist"
13
- ],
14
11
  "scripts": {
15
12
  "test": "vitest run",
16
13
  "test:watch": "vitest",
@@ -29,6 +26,7 @@
29
26
  "eslint": "^9.24.0",
30
27
  "globals": "^16.0.0",
31
28
  "husky": "^9.1.7",
29
+ "husky-init": "^8.0.0",
32
30
  "lint-staged": "^15.5.1",
33
31
  "pinst": "^3.0.0",
34
32
  "prettier": "^3.5.3",
@@ -37,9 +35,6 @@
37
35
  "typescript-eslint": "^8.30.1",
38
36
  "vitest": "^3.1.1"
39
37
  },
40
- "dependencies": {
41
- "husky-init": "^8.0.0"
42
- },
43
38
  "keywords": [
44
39
  "malagasy",
45
40
  "number",
package/src/converter.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { LargeNumberUnit, MalagasyNumerals } from '.'
1
+ import { LargeNumberUnit, MalagasyNumerals } from './dictionary'
2
2
 
3
- export class MalagasyNumberToWords {
3
+ export class Tanisa {
4
4
  public toWords(number: number | string): string {
5
5
  const numStr = String(number)
6
6
  const [integerPartStr, decimalPartStr] = numStr.split('.')
@@ -0,0 +1,73 @@
1
+ export const MalagasyNumerals = {
2
+ GLUE_SY: ' sy ',
3
+ GLUE_AMBY: ' amby ',
4
+ GLUE_FAINGO: ' faingo ',
5
+ GLUE_DECIMAL_ZERO: 'aotra ',
6
+
7
+ CUSTOM_ONE: 'iraika', // '1' used before 'amby'
8
+
9
+ ZERO: 'aotra',
10
+
11
+ // Digits 1-9
12
+ DIGITS: [
13
+ '',
14
+ 'iray',
15
+ 'roa',
16
+ 'telo',
17
+ 'efatra',
18
+ 'dimy',
19
+ 'enina',
20
+ 'fito',
21
+ 'valo',
22
+ 'sivy',
23
+ ],
24
+ // Tens 10-90
25
+ TENS: [
26
+ '',
27
+ 'folo',
28
+ 'roapolo',
29
+ 'telopolo',
30
+ 'efapolo',
31
+ 'dimampolo',
32
+ 'enimpolo',
33
+ 'fitopolo',
34
+ 'valopolo',
35
+ 'sivifolo',
36
+ ],
37
+ // Hundreds 100-900
38
+ HUNDREDS: [
39
+ '',
40
+ 'zato',
41
+ 'roanjato',
42
+ 'telonjato',
43
+ 'efajato',
44
+ 'dimanjato',
45
+ 'enin-jato',
46
+ 'fitonjato',
47
+ 'valonjato',
48
+ 'sivinjato',
49
+ ],
50
+ LARGE_NUMBER_UNITS: [
51
+ { threshold: 1_000_000_000_000_000_000, name: 'tsipesimpesinafaharoa' },
52
+ { threshold: 100_000_000_000_000_000, name: 'alinkisafaharoa' },
53
+ { threshold: 10_000_000_000_000_000, name: 'lavitrisafaharoa' },
54
+ { threshold: 1_000_000_000_000_000, name: 'tsitamboisafaharoa' },
55
+ { threshold: 100_000_000_000_000, name: 'safatsiroafaharoa' },
56
+ { threshold: 10_000_000_000_000, name: 'tsitanoanoa' },
57
+ { threshold: 1_000_000_000_000, name: 'tsitokotsiforohana' },
58
+ { threshold: 100_000_000_000, name: 'tsipesimpesina' },
59
+ { threshold: 10_000_000_000, name: 'alinkisa' },
60
+ { threshold: 1_000_000_000, name: 'lavitrisa' },
61
+ { threshold: 100_000_000, name: 'tsitamboisa' },
62
+ { threshold: 10_000_000, name: 'safatsiroa' },
63
+ { threshold: 1_000_000, name: 'tapitrisa' },
64
+ { threshold: 100_000, name: 'hetsy' },
65
+ { threshold: 10_000, name: 'alina' },
66
+ { threshold: 1_000, name: 'arivo' },
67
+ ] as const,
68
+
69
+ MAX_SUPPORTED_INTEGER: 1_000_000_000_000_000_000 * 1000,
70
+ } as const
71
+
72
+ export type LargeNumberUnit =
73
+ (typeof MalagasyNumerals.LARGE_NUMBER_UNITS)[number]
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ // src/index.ts
2
+ export { Tanisa } from './converter'
3
+ export { MalagasyNumerals, LargeNumberUnit } from './dictionary'
@@ -0,0 +1,127 @@
1
+ import { describe, it, expect, beforeEach } from 'vitest'
2
+ import { Tanisa, MalagasyNumerals } from '../src'
3
+
4
+ describe('MalagasyNumberToWords', () => {
5
+ let converter: Tanisa
6
+
7
+ beforeEach(() => {
8
+ converter = new Tanisa()
9
+ })
10
+
11
+ const testCases: [number | string, string][] = [
12
+ [0, 'aotra'],
13
+ [1, 'iray'],
14
+ [5, 'dimy'],
15
+ [9, 'sivy'],
16
+ // // Tens
17
+ [10, 'folo'],
18
+ [11, 'iraika amby folo'],
19
+ [15, 'dimy amby folo'],
20
+ [20, 'roapolo'],
21
+ [21, 'iraika amby roapolo'],
22
+ [35, 'dimy amby telopolo'],
23
+ [99, 'sivy amby sivifolo'],
24
+ // // Hundreds
25
+ [100, 'zato'],
26
+ [101, 'iraika amby zato'],
27
+ [110, 'folo amby zato'],
28
+ [111, 'iraika amby folo amby zato'],
29
+ [121, 'iraika amby roapolo amby zato'],
30
+ [200, 'roanjato'],
31
+ [201, 'iraika amby roanjato'],
32
+ [210, 'folo sy roanjato'],
33
+ [225, 'dimy amby roapolo sy roanjato'],
34
+ [600, 'enin-jato'],
35
+ [999, 'sivy amby sivifolo sy sivinjato'],
36
+ // // Thousands
37
+ [1000, 'arivo'],
38
+ [1001, 'iray sy arivo'],
39
+ [1010, 'folo sy arivo'],
40
+ [1011, 'iraika amby folo sy arivo'],
41
+ [1378, 'valo amby fitopolo sy telonjato sy arivo'],
42
+ [2000, 'roa arivo'],
43
+ [2023, 'telo amby roapolo sy roa arivo'],
44
+ // Ten Thousands (Alina)
45
+ [10000, 'iray alina'],
46
+ [15000, 'dimy arivo sy iray alina'],
47
+ [20000, 'roa alina'],
48
+ [98_765, 'dimy amby enimpolo sy fitonjato sy valo arivo sy sivy alina'],
49
+ // Hundred Thousands (Hetsy)
50
+ [100000, 'iray hetsy'],
51
+ [
52
+ 123456,
53
+ 'enina amby dimampolo sy efajato sy telo arivo sy roa alina sy iray hetsy',
54
+ ],
55
+ [500000, 'dimy hetsy'],
56
+ [
57
+ 654321,
58
+ 'iraika amby roapolo sy telonjato sy efatra arivo sy dimy alina sy enina hetsy',
59
+ ],
60
+ // Millions (Tapitrisa)
61
+ [1000000, 'iray tapitrisa'],
62
+ [1000001, 'iray sy iray tapitrisa'],
63
+ [2500000, 'dimy hetsy sy roa tapitrisa'],
64
+ [
65
+ 9876543,
66
+ 'telo amby efapolo sy dimanjato sy enina arivo sy fito alina sy valo hetsy sy sivy tapitrisa',
67
+ ],
68
+ // Larger Units
69
+ [10000000, 'iray safatsiroa'],
70
+ [100000000, 'iray tsitamboisa'],
71
+ [1000000000, 'iray lavitrisa'],
72
+ [
73
+ 12345678901,
74
+ 'iraika amby sivinjato sy valo arivo sy fito alina sy enina hetsy sy dimy tapitrisa sy efatra safatsiroa sy telo tsitamboisa sy roa lavitrisa sy iray alinkisa',
75
+ ],
76
+ [1_100_000_000_000, 'iray tsipesimpesina sy iray tsitokotsiforohana'],
77
+ // Decimals
78
+ [0.5, 'aotra faingo dimy'],
79
+ [0.1, 'aotra faingo iray'],
80
+ ['2.00100', 'roa faingo aotra aotra zato'],
81
+ [
82
+ 1378.23,
83
+ 'valo amby fitopolo sy telonjato sy arivo faingo telo amby roapolo',
84
+ ],
85
+ [100.01, 'zato faingo aotra iray'],
86
+ [0.005, 'aotra faingo aotra aotra dimy'],
87
+ ]
88
+
89
+ it.each(testCases)('should convert %s to "%s"', (input, expected) => {
90
+ expect(converter.toWords(input)).toBe(expected)
91
+ })
92
+
93
+ describe('Error Handling', () => {
94
+ it('should throw TypeError for invalid input', () => {
95
+ expect(() => converter.toWords('not a number')).toThrow(TypeError)
96
+ expect(() => converter.toWords('123.abc')).toThrow(TypeError)
97
+ expect(() => converter.toWords(NaN)).toThrow(TypeError)
98
+ })
99
+
100
+ it('should throw RangeError for negative numbers', () => {
101
+ expect(() => converter.toWords(-1)).toThrow(RangeError)
102
+ expect(() => converter.toWords(-100.5)).toThrow(RangeError)
103
+ expect(() => converter.toWords('-0')).not.toThrow(RangeError)
104
+ expect(converter.toWords('-0')).toBe('aotra')
105
+ })
106
+
107
+ it('should throw RangeError for numbers exceeding the limit', () => {
108
+ const limit = MalagasyNumerals.MAX_SUPPORTED_INTEGER
109
+ const largeNumber = BigInt(limit) + BigInt(1)
110
+
111
+ expect(() => converter.toWords(limit)).toThrow(RangeError)
112
+ expect(() => converter.toWords(largeNumber.toString())).toThrow(
113
+ RangeError
114
+ )
115
+ })
116
+
117
+ it('should handle string input correctly', () => {
118
+ expect(converter.toWords('123')).toBe('telo amby roapolo amby zato')
119
+ expect(converter.toWords('1000.5')).toBe('arivo faingo dimy')
120
+ })
121
+
122
+ it('should handle number input with maximum safe integer', () => {
123
+ const safeInt = Number.MAX_SAFE_INTEGER // 9_007_199_254_740_991
124
+ expect(() => converter.toWords(safeInt)).not.toThrow()
125
+ })
126
+ })
127
+ })
package/tsconfig.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "libReplacement": true, /* Enable lib replacement. */
18
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
19
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
20
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
21
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
22
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
23
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
24
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
25
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
26
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
27
+
28
+ /* Modules */
29
+ "module": "commonjs" /* Specify what module code is generated. */,
30
+ // "rootDir": "./", /* Specify the root folder within your source files. */
31
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
32
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
36
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
37
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
38
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
39
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
40
+ // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
41
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
42
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
43
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
44
+ // "noUncheckedSideEffectImports": true, /* Check side effect imports. */
45
+ // "resolveJsonModule": true, /* Enable importing .json files. */
46
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
47
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
48
+
49
+ /* JavaScript Support */
50
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
51
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
52
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
53
+
54
+ /* Emit */
55
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
56
+ // "declarationMap": true /* Create sourcemaps for d.ts files. */,
57
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
58
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
59
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
62
+ "outDir": "./dist" /* Specify an output folder for all emitted files. */,
63
+ "removeComments": true /* Disable emitting comments. */,
64
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
65
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
66
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
67
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
68
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
69
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
70
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
71
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
72
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
73
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
74
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
75
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
76
+
77
+ /* Interop Constraints */
78
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
79
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
80
+ // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
81
+ // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
82
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
83
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
84
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
85
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
86
+
87
+ /* Type Checking */
88
+ "strict": true /* Enable all strict type-checking options. */,
89
+ "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
90
+ "strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */,
91
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
92
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
93
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
94
+ // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
95
+ "noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
96
+ "useUnknownInCatchVariables": true /* Default catch clause variables as 'unknown' instead of 'any'. */,
97
+ "alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
98
+ "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
99
+ "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
100
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
101
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
102
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
103
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
104
+ "noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
105
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
106
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
107
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
108
+
109
+ /* Completeness */
110
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
111
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
112
+ }
113
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite'
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ exclude: ['./dist', './node_modules'],
6
+ },
7
+ })
@@ -1,8 +0,0 @@
1
- export declare class MalagasyNumberToWords {
2
- toWords(number: number | string): string;
3
- private convertInteger;
4
- private formatLargeNumber;
5
- private convertBelowThousand;
6
- private convertBelowHundred;
7
- }
8
- //# sourceMappingURL=converter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../src/converter.ts"],"names":[],"mappings":"AAEA,qBAAa,qBAAqB;IACzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IA6C/C,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,mBAAmB;CAmB5B"}
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MalagasyNumberToWords = void 0;
4
- const _1 = require(".");
5
- class MalagasyNumberToWords {
6
- toWords(number) {
7
- const numStr = String(number);
8
- const [integerPartStr, decimalPartStr] = numStr.split('.');
9
- const integerPartNum = parseInt(integerPartStr || '0', 10);
10
- if (isNaN(integerPartNum) ||
11
- (decimalPartStr && isNaN(parseInt(decimalPartStr, 10)))) {
12
- throw new TypeError(`Invalid number input: "${number}"`);
13
- }
14
- if (numStr.trim().startsWith('-') && integerPartNum !== 0) {
15
- throw new RangeError('Negative numbers are not supported.');
16
- }
17
- if (integerPartNum >= _1.MalagasyNumerals.MAX_SUPPORTED_INTEGER ||
18
- integerPartStr == _1.MalagasyNumerals.MAX_SUPPORTED_INTEGER.toString()) {
19
- throw new RangeError(`Number ${integerPartNum} exceeds the maximum supported value (${_1.MalagasyNumerals.MAX_SUPPORTED_INTEGER}).`);
20
- }
21
- const integerWords = this.convertInteger(integerPartNum);
22
- let decimalWords = '';
23
- if (decimalPartStr && decimalPartStr.length > 0) {
24
- for (let i = 0; i < decimalPartStr.length; i++) {
25
- const digit = decimalPartStr[i];
26
- if (digit === '0') {
27
- decimalWords += _1.MalagasyNumerals.GLUE_DECIMAL_ZERO;
28
- }
29
- else {
30
- const remainingDecimal = decimalPartStr.substring(i);
31
- decimalWords += this.convertInteger(parseInt(remainingDecimal, 10));
32
- break;
33
- }
34
- }
35
- return integerWords + _1.MalagasyNumerals.GLUE_FAINGO + decimalWords;
36
- }
37
- else {
38
- return integerWords;
39
- }
40
- }
41
- convertInteger(num) {
42
- if (num === 0) {
43
- return _1.MalagasyNumerals.ZERO;
44
- }
45
- for (const unit of _1.MalagasyNumerals.LARGE_NUMBER_UNITS) {
46
- if (num >= unit.threshold) {
47
- return this.formatLargeNumber(num, unit);
48
- }
49
- }
50
- return this.convertBelowThousand(num);
51
- }
52
- formatLargeNumber(num, unit) {
53
- const multiple = Math.floor(num / unit.threshold);
54
- const remainder = num % unit.threshold;
55
- let prefix = '';
56
- if (multiple > 1) {
57
- prefix = this.convertInteger(multiple) + ' ';
58
- }
59
- else if (multiple === 1 && unit.threshold > 1000) {
60
- prefix = _1.MalagasyNumerals.DIGITS[1] + ' ';
61
- }
62
- const basePart = prefix + unit.name;
63
- if (remainder > 0) {
64
- const remainderText = this.convertInteger(remainder);
65
- return remainderText + _1.MalagasyNumerals.GLUE_SY + basePart;
66
- }
67
- else {
68
- return basePart;
69
- }
70
- }
71
- convertBelowThousand(num) {
72
- if (num >= 100) {
73
- const hundredMultiple = Math.floor(num / 100);
74
- const remainder = num % 100;
75
- const hundredWord = _1.MalagasyNumerals.HUNDREDS[hundredMultiple];
76
- if (remainder === 0) {
77
- return hundredWord;
78
- }
79
- else {
80
- const remainderWords = this.convertBelowHundred(remainder);
81
- let glue = _1.MalagasyNumerals.GLUE_AMBY;
82
- if (hundredMultiple >= 2 && remainder >= 10) {
83
- glue = _1.MalagasyNumerals.GLUE_SY;
84
- }
85
- const finalRemainderWords = remainder === 1 ? _1.MalagasyNumerals.CUSTOM_ONE : remainderWords;
86
- return finalRemainderWords + glue + hundredWord;
87
- }
88
- }
89
- return this.convertBelowHundred(num);
90
- }
91
- convertBelowHundred(num) {
92
- if (num >= 10) {
93
- const tenMultiple = Math.floor(num / 10);
94
- const remainder = num % 10;
95
- const tenWord = _1.MalagasyNumerals.TENS[tenMultiple];
96
- if (remainder === 0) {
97
- return tenWord;
98
- }
99
- else {
100
- const digitWord = remainder === 1
101
- ? _1.MalagasyNumerals.CUSTOM_ONE
102
- : _1.MalagasyNumerals.DIGITS[remainder];
103
- return digitWord + _1.MalagasyNumerals.GLUE_AMBY + tenWord;
104
- }
105
- }
106
- return _1.MalagasyNumerals.DIGITS[num];
107
- }
108
- }
109
- exports.MalagasyNumberToWords = MalagasyNumberToWords;
@@ -1,63 +0,0 @@
1
- export declare const MalagasyNumerals: {
2
- readonly GLUE_SY: " sy ";
3
- readonly GLUE_AMBY: " amby ";
4
- readonly GLUE_FAINGO: " faingo ";
5
- readonly GLUE_DECIMAL_ZERO: "aotra ";
6
- readonly CUSTOM_ONE: "iraika";
7
- readonly ZERO: "aotra";
8
- readonly DIGITS: readonly ["", "iray", "roa", "telo", "efatra", "dimy", "enina", "fito", "valo", "sivy"];
9
- readonly TENS: readonly ["", "folo", "roapolo", "telopolo", "efapolo", "dimampolo", "enimpolo", "fitopolo", "valopolo", "sivifolo"];
10
- readonly HUNDREDS: readonly ["", "zato", "roanjato", "telonjato", "efajato", "dimanjato", "enin-jato", "fitonjato", "valonjato", "sivinjato"];
11
- readonly LARGE_NUMBER_UNITS: readonly [{
12
- readonly threshold: 1000000000000000000;
13
- readonly name: "tsipesimpesinafaharoa";
14
- }, {
15
- readonly threshold: 100000000000000000;
16
- readonly name: "alinkisafaharoa";
17
- }, {
18
- readonly threshold: 10000000000000000;
19
- readonly name: "lavitrisafaharoa";
20
- }, {
21
- readonly threshold: 1000000000000000;
22
- readonly name: "tsitamboisafaharoa";
23
- }, {
24
- readonly threshold: 100000000000000;
25
- readonly name: "safatsiroafaharoa";
26
- }, {
27
- readonly threshold: 10000000000000;
28
- readonly name: "tsitanoanoa";
29
- }, {
30
- readonly threshold: 1000000000000;
31
- readonly name: "tsitokotsiforohana";
32
- }, {
33
- readonly threshold: 100000000000;
34
- readonly name: "tsipesimpesina";
35
- }, {
36
- readonly threshold: 10000000000;
37
- readonly name: "alinkisa";
38
- }, {
39
- readonly threshold: 1000000000;
40
- readonly name: "lavitrisa";
41
- }, {
42
- readonly threshold: 100000000;
43
- readonly name: "tsitamboisa";
44
- }, {
45
- readonly threshold: 10000000;
46
- readonly name: "safatsiroa";
47
- }, {
48
- readonly threshold: 1000000;
49
- readonly name: "tapitrisa";
50
- }, {
51
- readonly threshold: 100000;
52
- readonly name: "hetsy";
53
- }, {
54
- readonly threshold: 10000;
55
- readonly name: "alina";
56
- }, {
57
- readonly threshold: 1000;
58
- readonly name: "arivo";
59
- }];
60
- readonly MAX_SUPPORTED_INTEGER: number;
61
- };
62
- export type LargeNumberUnit = (typeof MalagasyNumerals.LARGE_NUMBER_UNITS)[number];
63
- //# sourceMappingURL=dictionary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/dictionary.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEnB,CAAA;AAEV,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MalagasyNumerals = void 0;
4
- exports.MalagasyNumerals = {
5
- GLUE_SY: ' sy ',
6
- GLUE_AMBY: ' amby ',
7
- GLUE_FAINGO: ' faingo ',
8
- GLUE_DECIMAL_ZERO: 'aotra ',
9
- CUSTOM_ONE: 'iraika',
10
- ZERO: 'aotra',
11
- DIGITS: [
12
- '',
13
- 'iray',
14
- 'roa',
15
- 'telo',
16
- 'efatra',
17
- 'dimy',
18
- 'enina',
19
- 'fito',
20
- 'valo',
21
- 'sivy',
22
- ],
23
- TENS: [
24
- '',
25
- 'folo',
26
- 'roapolo',
27
- 'telopolo',
28
- 'efapolo',
29
- 'dimampolo',
30
- 'enimpolo',
31
- 'fitopolo',
32
- 'valopolo',
33
- 'sivifolo',
34
- ],
35
- HUNDREDS: [
36
- '',
37
- 'zato',
38
- 'roanjato',
39
- 'telonjato',
40
- 'efajato',
41
- 'dimanjato',
42
- 'enin-jato',
43
- 'fitonjato',
44
- 'valonjato',
45
- 'sivinjato',
46
- ],
47
- LARGE_NUMBER_UNITS: [
48
- { threshold: 1000000000000000000, name: 'tsipesimpesinafaharoa' },
49
- { threshold: 100000000000000000, name: 'alinkisafaharoa' },
50
- { threshold: 10000000000000000, name: 'lavitrisafaharoa' },
51
- { threshold: 1000000000000000, name: 'tsitamboisafaharoa' },
52
- { threshold: 100000000000000, name: 'safatsiroafaharoa' },
53
- { threshold: 10000000000000, name: 'tsitanoanoa' },
54
- { threshold: 1000000000000, name: 'tsitokotsiforohana' },
55
- { threshold: 100000000000, name: 'tsipesimpesina' },
56
- { threshold: 10000000000, name: 'alinkisa' },
57
- { threshold: 1000000000, name: 'lavitrisa' },
58
- { threshold: 100000000, name: 'tsitamboisa' },
59
- { threshold: 10000000, name: 'safatsiroa' },
60
- { threshold: 1000000, name: 'tapitrisa' },
61
- { threshold: 100000, name: 'hetsy' },
62
- { threshold: 10000, name: 'alina' },
63
- { threshold: 1000, name: 'arivo' },
64
- ],
65
- MAX_SUPPORTED_INTEGER: 1000000000000000000 * 1000,
66
- };
@@ -1,3 +0,0 @@
1
- export { MalagasyNumberToWords } from './converter';
2
- export { MalagasyNumerals, LargeNumberUnit } from './dictionary';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA"}
package/dist/src/index.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MalagasyNumerals = exports.MalagasyNumberToWords = void 0;
4
- var converter_1 = require("./converter");
5
- Object.defineProperty(exports, "MalagasyNumberToWords", { enumerable: true, get: function () { return converter_1.MalagasyNumberToWords; } });
6
- var dictionary_1 = require("./dictionary");
7
- Object.defineProperty(exports, "MalagasyNumerals", { enumerable: true, get: function () { return dictionary_1.MalagasyNumerals; } });
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const vitest_1 = require("vitest");
4
- const src_1 = require("../src");
5
- (0, vitest_1.describe)('MalagasyNumberToWords', () => {
6
- let converter;
7
- (0, vitest_1.beforeEach)(() => {
8
- converter = new src_1.MalagasyNumberToWords();
9
- });
10
- const testCases = [
11
- [0, 'aotra'],
12
- [1, 'iray'],
13
- [5, 'dimy'],
14
- [9, 'sivy'],
15
- [10, 'folo'],
16
- [11, 'iraika amby folo'],
17
- [15, 'dimy amby folo'],
18
- [20, 'roapolo'],
19
- [21, 'iraika amby roapolo'],
20
- [35, 'dimy amby telopolo'],
21
- [99, 'sivy amby sivifolo'],
22
- [100, 'zato'],
23
- [101, 'iraika amby zato'],
24
- [110, 'folo amby zato'],
25
- [111, 'iraika amby folo amby zato'],
26
- [121, 'iraika amby roapolo amby zato'],
27
- [200, 'roanjato'],
28
- [201, 'iraika amby roanjato'],
29
- [210, 'folo sy roanjato'],
30
- [225, 'dimy amby roapolo sy roanjato'],
31
- [600, 'enin-jato'],
32
- [999, 'sivy amby sivifolo sy sivinjato'],
33
- [1000, 'arivo'],
34
- [1001, 'iray sy arivo'],
35
- [1010, 'folo sy arivo'],
36
- [1011, 'iraika amby folo sy arivo'],
37
- [1378, 'valo amby fitopolo sy telonjato sy arivo'],
38
- [2000, 'roa arivo'],
39
- [2023, 'telo amby roapolo sy roa arivo'],
40
- [10000, 'iray alina'],
41
- [15000, 'dimy arivo sy iray alina'],
42
- [20000, 'roa alina'],
43
- [98765, 'dimy amby enimpolo sy fitonjato sy valo arivo sy sivy alina'],
44
- [100000, 'iray hetsy'],
45
- [
46
- 123456,
47
- 'enina amby dimampolo sy efajato sy telo arivo sy roa alina sy iray hetsy',
48
- ],
49
- [500000, 'dimy hetsy'],
50
- [
51
- 654321,
52
- 'iraika amby roapolo sy telonjato sy efatra arivo sy dimy alina sy enina hetsy',
53
- ],
54
- [1000000, 'iray tapitrisa'],
55
- [1000001, 'iray sy iray tapitrisa'],
56
- [2500000, 'dimy hetsy sy roa tapitrisa'],
57
- [
58
- 9876543,
59
- 'telo amby efapolo sy dimanjato sy enina arivo sy fito alina sy valo hetsy sy sivy tapitrisa',
60
- ],
61
- [10000000, 'iray safatsiroa'],
62
- [100000000, 'iray tsitamboisa'],
63
- [1000000000, 'iray lavitrisa'],
64
- [
65
- 12345678901,
66
- 'iraika amby sivinjato sy valo arivo sy fito alina sy enina hetsy sy dimy tapitrisa sy efatra safatsiroa sy telo tsitamboisa sy roa lavitrisa sy iray alinkisa',
67
- ],
68
- [1100000000000, 'iray tsipesimpesina sy iray tsitokotsiforohana'],
69
- [0.5, 'aotra faingo dimy'],
70
- [0.1, 'aotra faingo iray'],
71
- ['2.00100', 'roa faingo aotra aotra zato'],
72
- [
73
- 1378.23,
74
- 'valo amby fitopolo sy telonjato sy arivo faingo telo amby roapolo',
75
- ],
76
- [100.01, 'zato faingo aotra iray'],
77
- [0.005, 'aotra faingo aotra aotra dimy'],
78
- ];
79
- vitest_1.it.each(testCases)('should convert %s to "%s"', (input, expected) => {
80
- (0, vitest_1.expect)(converter.toWords(input)).toBe(expected);
81
- });
82
- (0, vitest_1.describe)('Error Handling', () => {
83
- (0, vitest_1.it)('should throw TypeError for invalid input', () => {
84
- (0, vitest_1.expect)(() => converter.toWords('not a number')).toThrow(TypeError);
85
- (0, vitest_1.expect)(() => converter.toWords('123.abc')).toThrow(TypeError);
86
- (0, vitest_1.expect)(() => converter.toWords(NaN)).toThrow(TypeError);
87
- });
88
- (0, vitest_1.it)('should throw RangeError for negative numbers', () => {
89
- (0, vitest_1.expect)(() => converter.toWords(-1)).toThrow(RangeError);
90
- (0, vitest_1.expect)(() => converter.toWords(-100.5)).toThrow(RangeError);
91
- (0, vitest_1.expect)(() => converter.toWords('-0')).not.toThrow(RangeError);
92
- (0, vitest_1.expect)(converter.toWords('-0')).toBe('aotra');
93
- });
94
- (0, vitest_1.it)('should throw RangeError for numbers exceeding the limit', () => {
95
- const limit = src_1.MalagasyNumerals.MAX_SUPPORTED_INTEGER;
96
- const largeNumber = BigInt(limit) + BigInt(1);
97
- (0, vitest_1.expect)(() => converter.toWords(limit)).toThrow(RangeError);
98
- (0, vitest_1.expect)(() => converter.toWords(largeNumber.toString())).toThrow(RangeError);
99
- });
100
- (0, vitest_1.it)('should handle string input correctly', () => {
101
- (0, vitest_1.expect)(converter.toWords('123')).toBe('telo amby roapolo amby zato');
102
- (0, vitest_1.expect)(converter.toWords('1000.5')).toBe('arivo faingo dimy');
103
- });
104
- (0, vitest_1.it)('should handle number input with maximum safe integer', () => {
105
- const safeInt = Number.MAX_SAFE_INTEGER;
106
- (0, vitest_1.expect)(() => converter.toWords(safeInt)).not.toThrow();
107
- });
108
- });
109
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=converter.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"converter.test.d.ts","sourceRoot":"","sources":["../../tests/converter.test.ts"],"names":[],"mappings":""}
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const vitest_1 = require("vitest");
4
- const src_1 = require("../src");
5
- (0, vitest_1.describe)('MalagasyNumberToWords', () => {
6
- let converter;
7
- (0, vitest_1.beforeEach)(() => {
8
- converter = new src_1.MalagasyNumberToWords();
9
- });
10
- const testCases = [
11
- [0, 'aotra'],
12
- [1, 'iray'],
13
- [5, 'dimy'],
14
- [9, 'sivy'],
15
- [10, 'folo'],
16
- [11, 'iraika amby folo'],
17
- [15, 'dimy amby folo'],
18
- [20, 'roapolo'],
19
- [21, 'iraika amby roapolo'],
20
- [35, 'dimy amby telopolo'],
21
- [99, 'sivy amby sivifolo'],
22
- [100, 'zato'],
23
- [101, 'iraika amby zato'],
24
- [110, 'folo amby zato'],
25
- [111, 'iraika amby folo amby zato'],
26
- [121, 'iraika amby roapolo amby zato'],
27
- [200, 'roanjato'],
28
- [201, 'iraika amby roanjato'],
29
- [210, 'folo sy roanjato'],
30
- [225, 'dimy amby roapolo sy roanjato'],
31
- [600, 'enin-jato'],
32
- [999, 'sivy amby sivifolo sy sivinjato'],
33
- [1000, 'arivo'],
34
- [1001, 'iray sy arivo'],
35
- [1010, 'folo sy arivo'],
36
- [1011, 'iraika amby folo sy arivo'],
37
- [1378, 'valo amby fitopolo sy telonjato sy arivo'],
38
- [2000, 'roa arivo'],
39
- [2023, 'telo amby roapolo sy roa arivo'],
40
- [10000, 'iray alina'],
41
- [15000, 'dimy arivo sy iray alina'],
42
- [20000, 'roa alina'],
43
- [98765, 'dimy amby enimpolo sy fitonjato sy valo arivo sy sivy alina'],
44
- [100000, 'iray hetsy'],
45
- [
46
- 123456,
47
- 'enina amby dimampolo sy efajato sy telo arivo sy roa alina sy iray hetsy',
48
- ],
49
- [500000, 'dimy hetsy'],
50
- [
51
- 654321,
52
- 'iraika amby roapolo sy telonjato sy efatra arivo sy dimy alina sy enina hetsy',
53
- ],
54
- [1000000, 'iray tapitrisa'],
55
- [1000001, 'iray sy iray tapitrisa'],
56
- [2500000, 'dimy hetsy sy roa tapitrisa'],
57
- [
58
- 9876543,
59
- 'telo amby efapolo sy dimanjato sy enina arivo sy fito alina sy valo hetsy sy sivy tapitrisa',
60
- ],
61
- [10000000, 'iray safatsiroa'],
62
- [100000000, 'iray tsitamboisa'],
63
- [1000000000, 'iray lavitrisa'],
64
- [
65
- 12345678901,
66
- 'iraika amby sivinjato sy valo arivo sy fito alina sy enina hetsy sy dimy tapitrisa sy efatra safatsiroa sy telo tsitamboisa sy roa lavitrisa sy iray alinkisa',
67
- ],
68
- [1100000000000, 'iray tsipesimpesina sy iray tsitokotsiforohana'],
69
- [0.5, 'aotra faingo dimy'],
70
- [0.1, 'aotra faingo iray'],
71
- ['2.00100', 'roa faingo aotra aotra zato'],
72
- [
73
- 1378.23,
74
- 'valo amby fitopolo sy telonjato sy arivo faingo telo amby roapolo',
75
- ],
76
- [100.01, 'zato faingo aotra iray'],
77
- [0.005, 'aotra faingo aotra aotra dimy'],
78
- ];
79
- vitest_1.it.each(testCases)('should convert %s to "%s"', (input, expected) => {
80
- (0, vitest_1.expect)(converter.toWords(input)).toBe(expected);
81
- });
82
- (0, vitest_1.describe)('Error Handling', () => {
83
- (0, vitest_1.it)('should throw TypeError for invalid input', () => {
84
- (0, vitest_1.expect)(() => converter.toWords('not a number')).toThrow(TypeError);
85
- (0, vitest_1.expect)(() => converter.toWords('123.abc')).toThrow(TypeError);
86
- (0, vitest_1.expect)(() => converter.toWords(NaN)).toThrow(TypeError);
87
- });
88
- (0, vitest_1.it)('should throw RangeError for negative numbers', () => {
89
- (0, vitest_1.expect)(() => converter.toWords(-1)).toThrow(RangeError);
90
- (0, vitest_1.expect)(() => converter.toWords(-100.5)).toThrow(RangeError);
91
- (0, vitest_1.expect)(() => converter.toWords('-0')).not.toThrow(RangeError);
92
- (0, vitest_1.expect)(converter.toWords('-0')).toBe('aotra');
93
- });
94
- (0, vitest_1.it)('should throw RangeError for numbers exceeding the limit', () => {
95
- const limit = src_1.MalagasyNumerals.MAX_SUPPORTED_INTEGER;
96
- const largeNumber = BigInt(limit) + BigInt(1);
97
- (0, vitest_1.expect)(() => converter.toWords(limit)).toThrow(RangeError);
98
- (0, vitest_1.expect)(() => converter.toWords(largeNumber.toString())).toThrow(RangeError);
99
- });
100
- (0, vitest_1.it)('should handle string input correctly', () => {
101
- (0, vitest_1.expect)(converter.toWords('123')).toBe('telo amby roapolo amby zato');
102
- (0, vitest_1.expect)(converter.toWords('1000.5')).toBe('arivo faingo dimy');
103
- });
104
- (0, vitest_1.it)('should handle number input with maximum safe integer', () => {
105
- const safeInt = Number.MAX_SAFE_INTEGER;
106
- (0, vitest_1.expect)(() => converter.toWords(safeInt)).not.toThrow();
107
- });
108
- });
109
- });
@@ -1,3 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
3
- //# sourceMappingURL=vitest.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAEA,wBAIE"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const vite_1 = require("vite");
4
- exports.default = (0, vite_1.defineConfig)({
5
- test: {
6
- exclude: ['./dist', './node_modules'],
7
- },
8
- });