1.9.8 • Published 3 years ago
@guanghechen/option-helper v1.9.8
A collection of utility functions for processing options.
Install
npm
npm install --save-dev @guanghechen/option-helperyarn
yarn add --dev @guanghechen/option-helper
Usage
isName Description isArrayCheck if the given data is a ArraytypeisBigintCheck if the given data is a biginttypeisBooleanCheck if the given data is a boolean/BooleantypeisDateCheck if the given data is a DatetypeisFunctionCheck if the given data is a FunctiontypeisIntegerCheck if the given data is a IntegertypeisNumberCheck if the given data is a number/NumbertypeisObjectCheck if the given data is a ObjecttypeisStringCheck if the given data is a string/StringtypeisSymbolCheck if the given data is a symboltypeisUndefinedCheck if the given data is a undefinedtypeisPrimitiveBooleanCheck if the given data is a booleantypeisPrimitiveIntegerCheck if the given data is a integertypeisPrimitiveNumberCheck if the given data is a numbertypeisPrimitiveStringCheck if the given data is a stringtypeisNonBlankStringCheck if the given data is an non-blank string/StringtypeisNotEmptyArrayCheck if the given data is an not-empty ArraytypeisNotEmptyObjectCheck if the given data is an not-empty ObjecttypeisEmptyObjectCheck if the given data is an empty ObjecttypeisNumberLikeCheck if the given data is an number/Numberor number likestringtype
stringutilitiesName Description toCamelCase'test string' => 'testString'toCapitalCase'test string' => 'Test String'toConstantCase'test string' => 'TEST_STRING'toDotCase'test string' => 'test.string'toKebabCase'test string' => 'test-string'toLowerCase'TEST STRING' => 'test string'toPascalCase'test string' => 'TestString'toPathCase'test string' => 'test/string'toSentenceCase'testString' => 'Test string'toSnakeCase'test string' => 'test_string'toTitleCase'a simple test' => 'A Simple Test'toUpperCase'test string' => 'TEST STRING'
- `composeTextTransformers`: Compose multiple TextTransformer into one.
```typescript
import {
composeTextTransformers,
toKebabCase,
toTrim,
} from '@guanghechen/option-helper'
// function composeTextTransformers (
// ...transformers: ReadonlyArray<TextTransformer>
// ): TextTransformer
const transform = composeTextTransformers(toTrim, toKebabCase)
const text: string = transform(' TeSt_StrinG ')
// => 'test-string'
```coverutilitiesName Description cover- coverBoolean- coverInteger- coverNumber- coverString- convertutilitiesName Description convertToBoolean- convertToInteger- convertToNumber- convertToString-
1.9.8
3 years ago
1.9.7
3 years ago
1.9.6
3 years ago
1.9.5
3 years ago
1.9.4
4 years ago
1.9.3
4 years ago
1.9.2
4 years ago
1.9.0-alpha.0
4 years ago
1.9.1
4 years ago
1.9.0
4 years ago
1.8.6
4 years ago
1.8.5
4 years ago
1.8.4
4 years ago
1.8.3
4 years ago
1.8.2
4 years ago
1.8.1
4 years ago
1.8.0
4 years ago
1.7.1
4 years ago
1.7.0
4 years ago
1.7.0-alpha.3
4 years ago
1.7.0-alpha.1
4 years ago
1.7.0-alpha.2
4 years ago
1.7.0-alpha.0
4 years ago
1.6.1
4 years ago
1.6.0
4 years ago
1.5.5
4 years ago
1.5.4
4 years ago
1.5.3
4 years ago
1.5.2
4 years ago
1.5.1
4 years ago
1.5.0
4 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.0
5 years ago
1.0.13
5 years ago
1.0.11
5 years ago
1.0.12
5 years ago
1.0.9
5 years ago
1.0.10
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago