@fetoolkit/utils
v2.1.0
Published
 (This thumbnail was created by Chat GPT)
Downloads
102
Readme
FEToolkit/Utils
(This thumbnail was created by Chat GPT)
English | 한국어
FEToolkit utils is a library that provides utility functions that can be used during feature development.
1. Getting Started
1-1. Installation
- npm
npm i @fetoolkit/utils - yarn
yarn add @fetoolkit/utils - pnpm
pnpm add @fetoolkit/utils
2. Features
2-1. Array
| Name | Description | Docs | | :-------- | :---------------------------------------------------------------------------------------- | :--------------------------------------: | | at | Return element in a particular index in an array.(include negative index like Python) | Document | | first | Return first element of array. | Document | | last | Return last element of array. | Document | | filter | Return filtered elements in array. | Document | | mapByKey | Return array of elements that mapped to particular key in object array. | Document | | chunk | Chunk an array to a specific length. | Document | | count | Count a length of array. | Document | | countBy | Classify and counting number of array values according to result of mapper Function. | Document | | countOf | count a number of array values satisfied by specific condition. | Document | | find | return first element satisfied by specific condition. | Document | | findIndex | return first element's index satisfied by specific condition. | Document | | groupBy | classify elements in an array according to given key generation function. | Document | | isSameArr | chaek that whether the elements in both arrays are same until the order. | Document | | uniqArray | returns a new array that removes duplicate elements. | Document |
2-2. Number
| Name | Description | Docs | | :---------------- | :------------------------------------------------ | :-----------------------------------------------: | | commaizeNumber | generate number seperated by comma. | Document | | decommaizeNumber | remove comma from number | Document | | formatPhoneNumber | convert a phone number into a hyphen type. | Document | | percent | Calculate the result of division as a percentage. | Document | | sum | add all the numbers of values in an array. | Document | | isInteger | check the value is integer. | Document | | isPositiveInteger | check the value is positive integer.(except 0) | Document | | isNegativeInteger | check the value is negative integer.(except 0) | Document |
2-3. Mask
Notice
In the case of these functions, they play some role as utility functions, but they were judged to be insufficient in usability as utility functions that can only be used in Korea. Also, there was a function that provided the same function in toth-slash, so we decided to process it Deprecated. Please note that the function will continue to be provided, but no updates will be provided.
| Name | Description | Docs | | :---------------------------------------------------------------- | :--------------------------------------------------------------------- | :------: | | ~~maskName~~Deprecated | ~~masking user name~~Deprecated | Document | | ~~maskPhoneNumber~~Deprecated | ~~masking phone number~~Deprecated | Document |
2-4. Object
| Name | Description | Docs | | :-------- | :--------------------------------------------------------------------- | :---------------------------------------: | | forIn | call iteratee function for each attribute while traversing the object. | Document | | keys | return keys of object. | Document | | values | return values of object. | Document | | omit | generates a new object that omits a particular key from the object. | Document | | pick | creates a new object containing only a specific key in the object. | Document | | isSameObj | check that whether both object is same | Document |
2-5. Utility Types
| Name | Description | Docs | | :------------- | :------------------------------------------------------- | :------------------------------------------: | | PartialPath | Make specific properties optional | Document | | RequiredPath | Make specific properties required | Document | | Path | Convert object type keys to literal types | Document | | TypeOfProperty | Return the type of a specific property in an object type | Document |
