Skip to content

Commit e20bae9

Browse files
committed
feat: remove parse method
BREAKING CHANGE: `parse` is no longer needed, since `numberValue` is exposed by `useCurrencyInput`.
1 parent aaf95e6 commit e20bae9

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

docs/api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
declare const useCurrencyInput: (options: CurrencyInputOptions, autoEmit?: boolean) => UseCurrencyInput
99
```
1010
11-
### parse
12-
13-
```typescript
14-
declare const parse: (formattedValue: string | null, options: CurrencyFormatOptions) => number | null
15-
```
16-
1711
## Enums
1812
1913
### CurrencyDisplay

src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import useCurrencyInput from './useCurrencyInput'
2-
import CurrencyFormat from './currencyFormat'
3-
import { CurrencyFormatOptions } from './api'
4-
5-
const parse = (formattedValue: string | null, options: CurrencyFormatOptions): number | null => {
6-
return new CurrencyFormat(options).parse(formattedValue)
7-
}
82

93
/**
104
* @deprecated Use the named export `useCurrencyInput` instead.
115
*/
126
export default useCurrencyInput
137
export * from './api'
148

15-
export { useCurrencyInput, parse }
9+
export { useCurrencyInput }

tests/unit/api.spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)