@yamato-daiwa/es-extensions v1.7.2
Yamato Daiwa ES Extensions γYDEEγ
Helper functions and classes aimed to reduce the routine code.
Build-in TypeScript type safety without any
type.
Oriented to TypeScript users investing the time to quality including type-safety.
Installation
npm i @yamato-daiwa/es-extensions -E
Notice about "Unpacked size" (displaying in npmjs.com)
The displaying "Unpacked size" (for example, 633 kB for version 1.4.5 as in image below) is the total size of all built CommonJS and ECMAScript modules.
ECMAScript modules are preferred for the browser JavaScript while CommonJS - for Node.js.
For the websites and web applications where each kilobyte on count it is possible to automatically exclude the unused functionality of @yamato-daiwa/es-extensions (and possibly other dependencies) from built JavaScript. The JavaScript bundlers like Webpack can exclude the unused functionality under certain conditions. For the TypeScript and Webpack combination case, it is required to use ECMAScript modules to activate the tree shaking functionality (works on production mode).
Documentation
Get functionality
All available functionality could be imported from @yamato-daiwa/es-extensions
:
export { isUndefined, isNull } from "@yamato-daiwa/es-extensions";
Functionality reference
RawObjectDataProcessor
The tool for the validation and processing of unknown at advance external data (from HTTP requests/responses, files, etc.).
Pre-made pre-validation modifiers
Intended to be used when some property is expected to be the string but also expected to be a valid number if to parse it.
Numbers
Strings
All functions working with strings are supporting the surrogate pairs. If some function works incorrectly with surrogate pairs, it means the bug; please feel free to open issue in this case.
Objects
Arrays
Retrieving of elements
Retrieving of indexes
Replacing of elements
Adding of elements
Removing of elements
Other
Sets
Maps
Date and Time
Types
Type guards
Default value subsituters
The nullish coalescing operator makes below functions redundant, but they still could be used in the environments with old ECMAScript versions.
Value transformers
- emptyStringToNull
- nullToEmptyString
- nullToUndefined
- nullToZero
- undefinedToEmptyArray
- undefinedToEmptyString
- undefinedToNull
Random values generators
Constants and enumerations
Date and time
HTTP
Pagination
Logging
4 months ago
5 months ago
5 months ago
7 months ago
7 months ago
8 months ago
8 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago