Skip to content

Commit

Permalink
update with seperator
Browse files Browse the repository at this point in the history
  • Loading branch information
namnh240795 committed Apr 12, 2022
1 parent bd260bc commit e310f44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 56 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ Support integer to text only
import { getText } from 'number-to-text-vietnamese';
getText(123456);
```

Support integer to text only with seperator
```
import { getText } from 'number-to-text-vietnamese';
getText(123456, '|');
```
2 changes: 1 addition & 1 deletion dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 0 additions & 54 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,70 +1,16 @@
const toString = Object.prototype.toString;

/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function getTag(value) {
if (value == null) {
return value === undefined ? "[object Undefined]" : "[object Null]";
}
return toString.call(value);
}

/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* isObjectLike({})
* // => true
*
* isObjectLike([1, 2, 3])
* // => true
*
* isObjectLike(Function)
* // => false
*
* isObjectLike(null)
* // => false
*/
function isObjectLike(value) {
return typeof value === "object" && value !== null;
}

/**
* Checks if `value` is classified as a `Number` primitive or object.
*
* **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
* classified as numbers, use the `Number.isFinite` method.
*
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
* @see isInteger, toInteger, toNumber
* @example
*
* isNumber(3)
* // => true
*
* isNumber(Number.MIN_VALUE)
* // => true
*
* isNumber(Infinity)
* // => true
*
* isNumber('3')
* // => false
*/
export function isNumber(value) {
return (
typeof value === "number" ||
Expand Down

0 comments on commit e310f44

Please sign in to comment.