diff --git a/docs/README.md b/docs/README.md index 75549e1..58f72ab 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,9 +14,12 @@ tiinvo - [foldables](modules/foldables.md) - [mappables](modules/mappables.md) - [maybe](modules/maybe.md) +- [num](modules/num.md) +- [obj](modules/obj.md) - [option](modules/option.md) - [predicate](modules/predicate.md) - [result](modules/result.md) +- [str](modules/str.md) - [unwrappables](modules/unwrappables.md) ### Interfaces @@ -29,8 +32,15 @@ tiinvo - [ArgsOf](README.md#argsof) - [Fn1](README.md#fn1) - [FnBase](README.md#fnbase) +- [FnBinary](README.md#fnbinary) +- [FnNary](README.md#fnnary) +- [FnNullary](README.md#fnnullary) +- [FnTernary](README.md#fnternary) +- [FnUnary](README.md#fnunary) - [IndexableObject](README.md#indexableobject) - [Notify](README.md#notify) +- [PrimitiveMethodMapper](README.md#primitivemethodmapper) +- [Primitives](README.md#primitives) - [Tagged](README.md#tagged) - [TaggedFactory](README.md#taggedfactory) - [TypegardsTuple](README.md#typegardstuple) @@ -59,6 +69,7 @@ tiinvo - [haskeyoftype](README.md#haskeyoftype) - [haslength](README.md#haslength) - [haslengthof](README.md#haslengthof) +- [implementing](README.md#implementing) - [isTagged](README.md#istagged) - [isTaggedOf](README.md#istaggedof) - [isTaggedWith](README.md#istaggedwith) @@ -78,11 +89,13 @@ tiinvo - [isnumber](README.md#isnumber) - [isobject](README.md#isobject) - [isstring](README.md#isstring) +- [istuple](README.md#istuple) - [isundefined](README.md#isundefined) - [mediator](README.md#mediator) - [nullable](README.md#nullable) - [optional](README.md#optional) - [panic](README.md#panic) +- [pass](README.md#pass) - [pipe](README.md#pipe) - [pipeasync](README.md#pipeasync) - [pushsub](README.md#pushsub) @@ -114,7 +127,7 @@ Name | Type | ------ | ------ | `Fn` | [*FnBase*](README.md#fnbase) | -Defined in: [applicative.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L16) +Defined in: [src/applicative.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L16) ___ @@ -124,6 +137,8 @@ ___ A function which takes one argument +**`deprecated`** use FnUnary + #### Type parameters: Name | @@ -131,7 +146,7 @@ Name | `FnIn` | `FnOut` | -Defined in: [applicative.ts:28](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L28) +Defined in: [src/applicative.ts:29](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L29) ___ @@ -141,7 +156,84 @@ ___ A generic function type -Defined in: [applicative.ts:23](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L23) +Defined in: [src/applicative.ts:23](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L23) + +___ + +### FnBinary + +Ƭ **FnBinary**: (`arg1`: T, `arg2`: U) => W + +#### Type parameters: + +Name | +------ | +`T` | +`U` | +`W` | + +Defined in: [src/applicative.ts:45](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L45) + +___ + +### FnNary + +Ƭ **FnNary**: (...`args`: T) => U + +#### Type parameters: + +Name | Type | +------ | ------ | +`T` | *any*[] | +`U` | - | + +Defined in: [src/applicative.ts:47](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L47) + +___ + +### FnNullary + +Ƭ **FnNullary**: () => T + +#### Type parameters: + +Name | +------ | +`T` | + +Defined in: [src/applicative.ts:43](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L43) + +___ + +### FnTernary + +Ƭ **FnTernary**: (`arg1`: T, `arg2`: U, `arg3`: W) => Z + +#### Type parameters: + +Name | +------ | +`T` | +`U` | +`W` | +`Z` | + +Defined in: [src/applicative.ts:46](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L46) + +___ + +### FnUnary + +Ƭ **FnUnary**: (`arg`: T) => U + +#### Type parameters: + +Name | +------ | +`T` | +`U` | + +Defined in: [src/applicative.ts:44](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L44) ___ @@ -157,7 +249,7 @@ Name | Default | ------ | ------ | `T` | *unknown* | -Defined in: [typeguards.ts:14](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L14) +Defined in: [src/typeguards.ts:14](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L14) ___ @@ -171,7 +263,33 @@ Name | Type | ------ | ------ | `Fn` | [*FnBase*](README.md#fnbase) | -Defined in: [push-sub.ts:9](https://github.com/OctoD/tiinvo/blob/0105242/src/push-sub.ts#L9) +Defined in: [src/push-sub.ts:9](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/push-sub.ts#L9) + +___ + +### PrimitiveMethodMapper + +Ƭ **PrimitiveMethodMapper**: (`key`: *key*) => (...`args`: T[*key*] *extends* (...`args`: *infer* Args) => *any* ? Args : *never*) => (`arg`: T) => T[*key*] *extends* (...`args`: *any*) => *infer* U ? U : *never* + +Maps a primitive type method + +#### Type parameters: + +Name | Type | +------ | ------ | +`T` | [*Primitives*](README.md#primitives) | + +Defined in: [src/applicative.ts:39](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L39) + +___ + +### Primitives + +Ƭ **Primitives**: *string* \| *number* \| *object* \| *symbol* + +Primitives + +Defined in: [src/applicative.ts:34](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L34) ___ @@ -195,7 +313,7 @@ Name | Type | `__tag` | Tagname | `value` | T | -Defined in: [tagged-type.ts:14](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L14) +Defined in: [src/tagged-type.ts:14](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L14) ___ @@ -211,7 +329,7 @@ Name | Type | ------ | ------ | `Tagname` | *string* | -Defined in: [tagged-type.ts:22](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L22) +Defined in: [src/tagged-type.ts:22](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L22) ___ @@ -225,7 +343,7 @@ Name | Type | ------ | ------ | `T` | [*Typeguard*](README.md#typeguard)<*any*\>[] | -Defined in: [typeguards.ts:29](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L29) +Defined in: [src/typeguards.ts:29](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L29) ___ @@ -241,7 +359,7 @@ Name | ------ | `IsOutput` | -Defined in: [typeguards.ts:9](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L9) +Defined in: [src/typeguards.ts:9](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L9) ___ @@ -255,7 +373,7 @@ Name | ------ | `T` | -Defined in: [typeguards.ts:304](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L304) +Defined in: [src/typeguards.ts:304](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L304) ___ @@ -269,7 +387,7 @@ Name | ------ | `T` | -Defined in: [typeguards.ts:21](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L21) +Defined in: [src/typeguards.ts:21](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L21) ___ @@ -277,7 +395,7 @@ ___ Ƭ **UnsubscribeFn**: () => *void* -Defined in: [push-sub.ts:10](https://github.com/OctoD/tiinvo/blob/0105242/src/push-sub.ts#L10) +Defined in: [src/push-sub.ts:10](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/push-sub.ts#L10) ___ @@ -293,7 +411,7 @@ Name | Type | ------ | ------ | `length` | *number* | -Defined in: [typeguards.ts:19](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L19) +Defined in: [src/typeguards.ts:19](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L19) ___ @@ -303,7 +421,7 @@ ___ Shorthand for undefined -Defined in: [applicative.ts:4](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L4) +Defined in: [src/applicative.ts:4](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L4) ## Functions @@ -325,7 +443,7 @@ Name | Type | **Returns:** [*Typeguard*](README.md#typeguard) -Defined in: [typeguards.ts:402](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L402) +Defined in: [src/typeguards.ts:461](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L461) ___ @@ -358,7 +476,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [applicative.ts:44](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L44) +Defined in: [src/applicative.ts:65](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L65) ___ @@ -391,7 +509,7 @@ Name | Type | **Returns:** [*Tagged*](README.md#tagged) -Defined in: [cast.ts:20](https://github.com/OctoD/tiinvo/blob/0105242/src/cast.ts#L20) +Defined in: [src/cast.ts:20](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/cast.ts#L20) ___ @@ -417,7 +535,7 @@ Name | Type | **Returns:** *function* -Defined in: [applicative.ts:63](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L63) +Defined in: [src/applicative.ts:84](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L84) ___ @@ -439,7 +557,7 @@ Name | Type | **Returns:** [*Typeguard*](README.md#typeguard) -Defined in: [typeguards.ts:392](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L392) +Defined in: [src/typeguards.ts:451](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L451) ___ @@ -471,7 +589,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [cast.ts:43](https://github.com/OctoD/tiinvo/blob/0105242/src/cast.ts#L43) +Defined in: [src/cast.ts:43](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/cast.ts#L43) ___ @@ -479,9 +597,11 @@ ___ ▸ `Const`**createStructOf**(`typeguard`: [*TypeguardsFromStruct*](README.md#typeguardsfromstruct)): *function* -cle * Creates a typeguard representing a complex data structure. It is useful +Creates a typeguard representing a complex data structure. It is useful for object validation. +**`deprecated`** use `implementing` instead + **`example`** ```ts @@ -520,7 +640,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:339](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L339) +Defined in: [src/typeguards.ts:400](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L400) ___ @@ -528,6 +648,10 @@ ___ ▸ `Const`**createTupleOf**(...`typeguards`: TG): *function* +**`deprecated`** use `istuple` instead + +**`example`** + #### Type parameters: Name | Type | @@ -542,7 +666,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:372](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L372) +Defined in: [src/typeguards.ts:440](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L440) ___ @@ -571,7 +695,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [applicative.ts:77](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L77) +Defined in: [src/applicative.ts:98](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L98) ___ @@ -609,7 +733,7 @@ Name | Type | Description | **Returns:** T \| F -Defined in: [conditionals.ts:21](https://github.com/OctoD/tiinvo/blob/0105242/src/conditionals.ts#L21) +Defined in: [src/conditionals.ts:21](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/conditionals.ts#L21) ___ @@ -650,7 +774,7 @@ Name | Type | Description | **Returns:** A \| B -Defined in: [conditionals.ts:47](https://github.com/OctoD/tiinvo/blob/0105242/src/conditionals.ts#L47) +Defined in: [src/conditionals.ts:47](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/conditionals.ts#L47) ___ @@ -674,7 +798,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:222](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L222) +Defined in: [src/typeguards.ts:222](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L222) ___ @@ -706,7 +830,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:260](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L260) +Defined in: [src/typeguards.ts:260](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L260) ___ @@ -738,7 +862,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:240](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L240) +Defined in: [src/typeguards.ts:240](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L240) ___ @@ -763,7 +887,7 @@ Name | Type | **Returns:** arg is WithLength -Defined in: [typeguards.ts:279](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L279) +Defined in: [src/typeguards.ts:279](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L279) ___ @@ -790,7 +914,59 @@ Name | Type | **Returns:** *function* -Defined in: [typeguards.ts:296](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L296) +Defined in: [src/typeguards.ts:296](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L296) + +___ + +### implementing + +▸ `Const`**implementing**(`typeguard`: [*TypeguardsFromStruct*](README.md#typeguardsfromstruct)): *function* + +Creates a Typeguard which checks if a given object is implementing a given interface. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { implementing } from 'tiinvo'; + +interface User { + name: string; + mail: string; + age: number; + status?: string; +} + +const isUser = implementing({ + name: isstring, + mail: isstring, + age: isnumber, + status: optional(isstring), +}); + +isUser({}) // false +isUser({ age: 100 }) // false +isUser({ age: 100, name: 'foo' }) // false +isUser({ age: 100, name: 'foo', mail: 'hello_at_world.com' }) // true +isUser({ age: '100', name: 'foo', mail: 'hello_at_world.com' }) // false +``` + +#### Type parameters: + +Name | Type | +------ | ------ | +`TG` | *unknown* | + +#### Parameters: + +Name | Type | +------ | ------ | +`typeguard` | [*TypeguardsFromStruct*](README.md#typeguardsfromstruct) | + +**Returns:** *function* + +Defined in: [src/typeguards.ts:340](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L340) ___ @@ -808,7 +984,7 @@ Name | Type | **Returns:** arg is Tagged -Defined in: [tagged-type.ts:78](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L78) +Defined in: [src/tagged-type.ts:78](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L78) ___ @@ -832,7 +1008,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](README.md#typeguard)<[*Tagged*](README.md#tagged)\> -Defined in: [tagged-type.ts:106](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L106) +Defined in: [src/tagged-type.ts:106](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L106) ___ @@ -854,7 +1030,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](README.md#typeguard)<[*Tagged*](README.md#tagged)<*unknown*, Tag\>\> -Defined in: [tagged-type.ts:90](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L90) +Defined in: [src/tagged-type.ts:90](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L90) ___ @@ -879,7 +1055,7 @@ Name | Type | **Returns:** arg is unknown[] -Defined in: [typeguards.ts:47](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L47) +Defined in: [src/typeguards.ts:47](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L47) ___ @@ -912,7 +1088,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:446](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L446) +Defined in: [src/typeguards.ts:505](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L505) ___ @@ -937,7 +1113,7 @@ Name | Type | **Returns:** arg is bigint -Defined in: [typeguards.ts:59](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L59) +Defined in: [src/typeguards.ts:59](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L59) ___ @@ -962,7 +1138,7 @@ Name | Type | **Returns:** arg is boolean -Defined in: [typeguards.ts:71](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L71) +Defined in: [src/typeguards.ts:71](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L71) ___ @@ -988,7 +1164,7 @@ Name | Type | **Returns:** arg is object -Defined in: [typeguards.ts:85](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L85) +Defined in: [src/typeguards.ts:85](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L85) ___ @@ -1006,7 +1182,7 @@ Name | Type | **Returns:** arg is Error -Defined in: [typeguards.ts:210](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L210) +Defined in: [src/typeguards.ts:210](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L210) ___ @@ -1039,7 +1215,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [typeguards.ts:502](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L502) +Defined in: [src/typeguards.ts:561](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L561) ___ @@ -1065,7 +1241,7 @@ Name | Type | **Returns:** arg is FnBase -Defined in: [typeguards.ts:99](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L99) +Defined in: [src/typeguards.ts:99](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L99) ___ @@ -1092,7 +1268,7 @@ Name | Type | **Returns:** arg is object -Defined in: [typeguards.ts:201](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L201) +Defined in: [src/typeguards.ts:201](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L201) ___ @@ -1118,7 +1294,7 @@ Name | Type | **Returns:** arg is object -Defined in: [typeguards.ts:429](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L429) +Defined in: [src/typeguards.ts:488](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L488) ___ @@ -1145,7 +1321,7 @@ Name | Type | **Returns:** arg is object -Defined in: [typeguards.ts:183](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L183) +Defined in: [src/typeguards.ts:183](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L183) ___ @@ -1172,7 +1348,7 @@ Name | Type | **Returns:** arg is null -Defined in: [typeguards.ts:169](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L169) +Defined in: [src/typeguards.ts:169](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L169) ___ @@ -1198,7 +1374,7 @@ Name | Type | **Returns:** arg is undefined \| null -Defined in: [typeguards.ts:416](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L416) +Defined in: [src/typeguards.ts:475](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L475) ___ @@ -1223,7 +1399,7 @@ Name | Type | **Returns:** arg is number -Defined in: [typeguards.ts:112](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L112) +Defined in: [src/typeguards.ts:112](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L112) ___ @@ -1250,7 +1426,7 @@ Name | Type | **Returns:** arg is object -Defined in: [typeguards.ts:126](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L126) +Defined in: [src/typeguards.ts:126](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L126) ___ @@ -1277,7 +1453,46 @@ Name | Type | **Returns:** arg is string -Defined in: [typeguards.ts:140](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L140) +Defined in: [src/typeguards.ts:140](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L140) + +___ + +### istuple + +▸ `Const`**istuple**(...`typeguards`: TG): *function* + +Creates a typeguard which checks if an array is a tuple +corresponding the given types + +**`example`** + +```ts +import { istuple, isstring, isnumber } from 'tiinvo'; + +const tg = istuple(isstring, isstring, isnumber); + +tg([10, 20, 30]) // false +tg(['10', 20, 30]) // false +tg(['10', '20', 30]) // true +tg(['10', '20', 30, 50]) // false + +``` + +#### Type parameters: + +Name | Type | +------ | ------ | +`TG` | [*Typeguard*](README.md#typeguard)<*any*\>[] | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`...typeguards` | TG | | + +**Returns:** *function* + +Defined in: [src/typeguards.ts:423](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L423) ___ @@ -1304,7 +1519,7 @@ Name | Type | **Returns:** arg is undefined -Defined in: [typeguards.ts:154](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L154) +Defined in: [src/typeguards.ts:154](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L154) ___ @@ -1347,7 +1562,7 @@ console.log(counter, evennumber, changeset) // logs 21, false, 3 **Returns:** [*Mediator*](interfaces/mediator.md) -Defined in: [mediator.ts:47](https://github.com/OctoD/tiinvo/blob/0105242/src/mediator.ts#L47) +Defined in: [src/mediator.ts:47](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mediator.ts#L47) ___ @@ -1380,7 +1595,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](README.md#typeguard)<*null* \| T\> -Defined in: [typeguards.ts:465](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L465) +Defined in: [src/typeguards.ts:524](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L524) ___ @@ -1414,7 +1629,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](README.md#typeguard)<*undefined* \| T\> -Defined in: [typeguards.ts:484](https://github.com/OctoD/tiinvo/blob/0105242/src/typeguards.ts#L484) +Defined in: [src/typeguards.ts:543](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/typeguards.ts#L543) ___ @@ -1439,13 +1654,37 @@ Name | Type | Default value | **Returns:** *never* -Defined in: [applicative.ts:87](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L87) +Defined in: [src/applicative.ts:116](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L116) + +___ + +### pass + +▸ `Const`**pass**(`arg`: T): T + +A function which passes the given argument. + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | T | + +**Returns:** T + +Defined in: [src/applicative.ts:106](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L106) ___ ### pipe -▸ `Const`**pipe**(...`f`: F & *AsChain*\>): *function* +▸ `Const`**pipe**(...`f`: F & *AsChain*\>): F[*0*] *extends* () => *any* ? () => *ReturnType*]\> : F[*0*] *extends* (`arg`: U) => *any* ? (`arg`: U) => *ReturnType*]\> : *never* Creates a pipeline of synchronous functions @@ -1470,15 +1709,15 @@ Name | Type | ------ | ------ | `...f` | F & *AsChain*\> | -**Returns:** *function* +**Returns:** F[*0*] *extends* () => *any* ? () => *ReturnType*]\> : F[*0*] *extends* (`arg`: U) => *any* ? (`arg`: U) => *ReturnType*]\> : *never* -Defined in: [pipe.ts:49](https://github.com/OctoD/tiinvo/blob/0105242/src/pipe.ts#L49) +Defined in: [src/pipe.ts:52](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/pipe.ts#L52) ___ ### pipeasync -▸ `Const`**pipeasync**(...`f`: F & *AsChain*\>): *function* +▸ `Const`**pipeasync**(...`f`: F & *AsChain*\>): F[*0*] *extends* () => *any* ? () => *ReturnType*]\> : F[*0*] *extends* (`arg`: U) => *any* ? (`arg`: U) => *ReturnType*]\> : *never* Creates a pipeline of asynchronous functions. @@ -1516,7 +1755,7 @@ await getactivetodoids('https://jsonplaceholder.typicode.com/todos'); Name | Type | ------ | ------ | -`F` | [(`arg`: *any*) => *Promise*<*any*\>, ...function[]] | +`F` | [(`arg`: *any*) => *Promise*<*any*\> \| () => *Promise*<*any*\>, ...function[]] | #### Parameters: @@ -1524,9 +1763,9 @@ Name | Type | ------ | ------ | `...f` | F & *AsChain*\> | -**Returns:** *function* +**Returns:** F[*0*] *extends* () => *any* ? () => *ReturnType*]\> : F[*0*] *extends* (`arg`: U) => *any* ? (`arg`: U) => *ReturnType*]\> : *never* -Defined in: [pipe-async.ts:74](https://github.com/OctoD/tiinvo/blob/0105242/src/pipe-async.ts#L74) +Defined in: [src/pipe-async.ts:75](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/pipe-async.ts#L75) ___ @@ -1572,7 +1811,7 @@ Name | Type | Description | **Returns:** [*PushSub*](interfaces/pushsub.md) -Defined in: [push-sub.ts:39](https://github.com/OctoD/tiinvo/blob/0105242/src/push-sub.ts#L39) +Defined in: [src/push-sub.ts:39](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/push-sub.ts#L39) ___ @@ -1604,7 +1843,7 @@ Name | Type | **Returns:** [*Tagged*](README.md#tagged) -Defined in: [tagged-type.ts:44](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L44) +Defined in: [src/tagged-type.ts:44](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L44) ___ @@ -1635,7 +1874,7 @@ Name | Type | **Returns:** [*TaggedFactory*](README.md#taggedfactory) -Defined in: [tagged-type.ts:63](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L63) +Defined in: [src/tagged-type.ts:63](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L63) ___ @@ -1659,7 +1898,7 @@ Name | Type | **Returns:** *function* -Defined in: [applicative.ts:101](https://github.com/OctoD/tiinvo/blob/0105242/src/applicative.ts#L101) +Defined in: [src/applicative.ts:130](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/applicative.ts#L130) ___ @@ -1698,7 +1937,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [cast.ts:70](https://github.com/OctoD/tiinvo/blob/0105242/src/cast.ts#L70) +Defined in: [src/cast.ts:70](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/cast.ts#L70) ___ @@ -1722,7 +1961,7 @@ Name | Type | **Returns:** [*Result*](modules/result.md#result)<*ReturnType*\> -Defined in: [trycatch.ts:12](https://github.com/OctoD/tiinvo/blob/0105242/src/trycatch.ts#L12) +Defined in: [src/trycatch.ts:12](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/trycatch.ts#L12) ___ @@ -1746,4 +1985,4 @@ Name | Type | **Returns:** *Promise*<*ReturnType* *extends* *Promise* ? [*Result*](modules/result.md#result) : *never*\> -Defined in: [trycatch.ts:32](https://github.com/OctoD/tiinvo/blob/0105242/src/trycatch.ts#L32) +Defined in: [src/trycatch.ts:32](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/trycatch.ts#L32) diff --git a/docs/interfaces/either.left.md b/docs/interfaces/either.left.md index 3719221..b2da96b 100644 --- a/docs/interfaces/either.left.md +++ b/docs/interfaces/either.left.md @@ -31,7 +31,7 @@ Name | Default | • `Readonly` **\_\_tag**: *left* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -39,4 +39,4 @@ ___ • `Readonly` **value**: T -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/either.right.md b/docs/interfaces/either.right.md index d01657f..66620bb 100644 --- a/docs/interfaces/either.right.md +++ b/docs/interfaces/either.right.md @@ -31,7 +31,7 @@ Name | Default | • `Readonly` **\_\_tag**: *right* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -39,4 +39,4 @@ ___ • `Readonly` **value**: T -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/maybe.just.md b/docs/interfaces/maybe.just.md index 61b377c..9439c81 100644 --- a/docs/interfaces/maybe.just.md +++ b/docs/interfaces/maybe.just.md @@ -31,7 +31,7 @@ Name | Default | • `Readonly` **\_\_tag**: *just* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -39,4 +39,4 @@ ___ • `Readonly` **value**: T -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/maybe.nothing.md b/docs/interfaces/maybe.nothing.md index e9780ab..1e3d37e 100644 --- a/docs/interfaces/maybe.nothing.md +++ b/docs/interfaces/maybe.nothing.md @@ -25,7 +25,7 @@ Represents a value which is falsy • `Readonly` **\_\_tag**: *nothing* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -33,4 +33,4 @@ ___ • `Readonly` **value**: *unknown* -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/mediator.md b/docs/interfaces/mediator.md index a6c47e0..3c8c771 100644 --- a/docs/interfaces/mediator.md +++ b/docs/interfaces/mediator.md @@ -20,7 +20,7 @@ • **publish**: (`topic`: *string*, ...`args`: T) => *void* -Defined in: [mediator.ts:6](https://github.com/OctoD/tiinvo/blob/0105242/src/mediator.ts#L6) +Defined in: [src/mediator.ts:6](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mediator.ts#L6) ___ @@ -28,7 +28,7 @@ ___ • **subscribe**: (`topic`: *string*, `fn`: Fn) => [*PushSub*](pushsub.md) -Defined in: [mediator.ts:7](https://github.com/OctoD/tiinvo/blob/0105242/src/mediator.ts#L7) +Defined in: [src/mediator.ts:7](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mediator.ts#L7) ___ @@ -36,4 +36,4 @@ ___ • **unsubscribe**: (`channel`: *string*) => *void* -Defined in: [mediator.ts:8](https://github.com/OctoD/tiinvo/blob/0105242/src/mediator.ts#L8) +Defined in: [src/mediator.ts:8](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mediator.ts#L8) diff --git a/docs/interfaces/option.none.md b/docs/interfaces/option.none.md index b3d42c9..b9056f1 100644 --- a/docs/interfaces/option.none.md +++ b/docs/interfaces/option.none.md @@ -23,7 +23,7 @@ • `Readonly` **\_\_tag**: *none* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -31,4 +31,4 @@ ___ • `Readonly` **value**: *any* -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/option.some.md b/docs/interfaces/option.some.md index 7609ab9..1470fc1 100644 --- a/docs/interfaces/option.some.md +++ b/docs/interfaces/option.some.md @@ -29,7 +29,7 @@ Name | Default | • `Readonly` **\_\_tag**: *some* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -37,4 +37,4 @@ ___ • `Readonly` **value**: *NonNullable* -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/interfaces/pushsub.md b/docs/interfaces/pushsub.md index 59d3b86..82d3750 100644 --- a/docs/interfaces/pushsub.md +++ b/docs/interfaces/pushsub.md @@ -24,7 +24,7 @@ Name | Type | **Returns:** *void* -Defined in: [push-sub.ts:4](https://github.com/OctoD/tiinvo/blob/0105242/src/push-sub.ts#L4) +Defined in: [src/push-sub.ts:4](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/push-sub.ts#L4) ## Table of contents @@ -38,4 +38,4 @@ Defined in: [push-sub.ts:4](https://github.com/OctoD/tiinvo/blob/0105242/src/pus • **unsubscribe**: [*UnsubscribeFn*](../README.md#unsubscribefn) -Defined in: [push-sub.ts:6](https://github.com/OctoD/tiinvo/blob/0105242/src/push-sub.ts#L6) +Defined in: [src/push-sub.ts:6](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/push-sub.ts#L6) diff --git a/docs/interfaces/result.err.md b/docs/interfaces/result.err.md index c301b8f..9b004a4 100644 --- a/docs/interfaces/result.err.md +++ b/docs/interfaces/result.err.md @@ -23,7 +23,7 @@ • `Readonly` **\_\_tag**: *err* -Defined in: [tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L15) +Defined in: [src/tagged-type.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L15) ___ @@ -31,4 +31,4 @@ ___ • `Readonly` **value**: Error -Defined in: [tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/0105242/src/tagged-type.ts#L16) +Defined in: [src/tagged-type.ts:16](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/tagged-type.ts#L16) diff --git a/docs/modules/array.md b/docs/modules/array.md index 42f5c21..270c057 100644 --- a/docs/modules/array.md +++ b/docs/modules/array.md @@ -57,7 +57,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:17](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L17) +Defined in: [src/array.ts:17](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L17) ___ @@ -83,7 +83,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:50](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L50) +Defined in: [src/array.ts:50](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L50) ___ @@ -115,7 +115,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:32](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L32) +Defined in: [src/array.ts:32](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L32) ___ @@ -146,7 +146,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:69](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L69) +Defined in: [src/array.ts:69](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L69) ___ @@ -178,7 +178,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:88](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L88) +Defined in: [src/array.ts:88](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L88) ___ @@ -197,7 +197,7 @@ flatnummatris([[1, 2], [3, 4]]) // [1, 2, 3, 4]; **Returns:** *function* -Defined in: [array.ts:104](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L104) +Defined in: [src/array.ts:104](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L104) ___ @@ -244,7 +244,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [array.ts:136](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L136) +Defined in: [src/array.ts:136](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L136) ___ @@ -263,7 +263,7 @@ getfirst()([100, 200]) // 100 **Returns:** *function* -Defined in: [array.ts:150](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L150) +Defined in: [src/array.ts:150](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L150) ___ @@ -294,7 +294,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:165](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L165) +Defined in: [src/array.ts:165](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L165) ___ @@ -313,7 +313,7 @@ getfirst()([100, 200]) // 100 **Returns:** *function* -Defined in: [array.ts:179](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L179) +Defined in: [src/array.ts:179](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L179) ___ @@ -345,7 +345,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:198](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L198) +Defined in: [src/array.ts:198](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L198) ___ @@ -378,7 +378,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:242](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L242) +Defined in: [src/array.ts:242](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L242) ___ @@ -397,7 +397,7 @@ isempty()([1]) // false **Returns:** *function* -Defined in: [array.ts:212](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L212) +Defined in: [src/array.ts:212](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L212) ___ @@ -416,7 +416,7 @@ isempty()([1]) // true **Returns:** *function* -Defined in: [array.ts:226](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L226) +Defined in: [src/array.ts:226](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L226) ___ @@ -436,7 +436,7 @@ length()(test) // 4 **Returns:** *function* -Defined in: [array.ts:257](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L257) +Defined in: [src/array.ts:257](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L257) ___ @@ -475,7 +475,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:280](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L280) +Defined in: [src/array.ts:280](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L280) ___ @@ -493,7 +493,7 @@ arr.includes(random()(arr)) // true **Returns:** *function* -Defined in: [array.ts:294](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L294) +Defined in: [src/array.ts:294](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L294) ___ @@ -527,7 +527,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:313](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L313) +Defined in: [src/array.ts:313](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L313) ___ @@ -561,7 +561,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:334](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L334) +Defined in: [src/array.ts:334](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L334) ___ @@ -579,7 +579,7 @@ reverse()([1, 2, 3]) // [3, 2, 1] **Returns:** *function* -Defined in: [array.ts:349](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L349) +Defined in: [src/array.ts:349](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L349) ___ @@ -595,7 +595,7 @@ shuffle()([1, 2, 3]) // could be [3, 2, 1] or [2, 1, 3] or [1, 3, 2] or... **Returns:** *function* -Defined in: [array.ts:360](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L360) +Defined in: [src/array.ts:360](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L360) ___ @@ -627,7 +627,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:383](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L383) +Defined in: [src/array.ts:383](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L383) ___ @@ -661,7 +661,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:401](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L401) +Defined in: [src/array.ts:401](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L401) ___ @@ -688,7 +688,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:420](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L420) +Defined in: [src/array.ts:420](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L420) ___ @@ -715,7 +715,7 @@ Name | Type | **Returns:** *function* -Defined in: [array.ts:438](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L438) +Defined in: [src/array.ts:438](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L438) ___ @@ -736,4 +736,4 @@ Name | **Returns:** *function* -Defined in: [array.ts:448](https://github.com/OctoD/tiinvo/blob/0105242/src/array.ts#L448) +Defined in: [src/array.ts:448](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/array.ts#L448) diff --git a/docs/modules/assertables.md b/docs/modules/assertables.md index b2c402d..3a5d522 100644 --- a/docs/modules/assertables.md +++ b/docs/modules/assertables.md @@ -24,7 +24,7 @@ Name | ------ | `T` | -Defined in: [assertables.ts:4](https://github.com/OctoD/tiinvo/blob/0105242/src/assertables.ts#L4) +Defined in: [src/assertables.ts:4](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/assertables.ts#L4) ## Functions @@ -66,4 +66,4 @@ Name | Type | **Returns:** [*Expect*](assertables.md#expect) -Defined in: [assertables.ts:31](https://github.com/OctoD/tiinvo/blob/0105242/src/assertables.ts#L31) +Defined in: [src/assertables.ts:31](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/assertables.ts#L31) diff --git a/docs/modules/derivables.md b/docs/modules/derivables.md index 43e1187..44cdf3a 100644 --- a/docs/modules/derivables.md +++ b/docs/modules/derivables.md @@ -74,4 +74,4 @@ Name | Type | Description | **Returns:** *function* -Defined in: [derivables.ts:53](https://github.com/OctoD/tiinvo/blob/0105242/src/derivables.ts#L53) +Defined in: [src/derivables.ts:53](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/derivables.ts#L53) diff --git a/docs/modules/either.md b/docs/modules/either.md index 7c0c27e..e199ae4 100644 --- a/docs/modules/either.md +++ b/docs/modules/either.md @@ -66,7 +66,7 @@ Name | Default | `TLeft` | *unknown* | `TRight` | *unknown* | -Defined in: [either.ts:45](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L45) +Defined in: [src/either.ts:45](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L45) ___ @@ -76,7 +76,7 @@ ___ Left or Right tagtypes -Defined in: [either.ts:31](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L31) +Defined in: [src/either.ts:31](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L31) ___ @@ -86,7 +86,7 @@ ___ Left tagtype -Defined in: [either.ts:23](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L23) +Defined in: [src/either.ts:23](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L23) ___ @@ -96,7 +96,7 @@ ___ Right tagtype -Defined in: [either.ts:27](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L27) +Defined in: [src/either.ts:27](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L27) ## Functions @@ -118,7 +118,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:167](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L167) +Defined in: [src/either.ts:167](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L167) ___ @@ -141,7 +141,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:176](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L176) +Defined in: [src/either.ts:176](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L176) ___ @@ -163,7 +163,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:181](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L181) +Defined in: [src/either.ts:181](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L181) ___ @@ -186,7 +186,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:190](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L190) +Defined in: [src/either.ts:190](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L190) ___ @@ -211,7 +211,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:202](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L202) +Defined in: [src/either.ts:202](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L202) ___ @@ -243,7 +243,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [either.ts:347](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L347) +Defined in: [src/either.ts:347](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L347) ___ @@ -261,7 +261,7 @@ Name | Type | **Returns:** arg is Either -Defined in: [either.ts:60](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L60) +Defined in: [src/either.ts:60](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L60) ___ @@ -296,7 +296,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](../README.md#typeguard)<*unknown*\> -Defined in: [either.ts:89](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L89) +Defined in: [src/either.ts:89](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L89) ___ @@ -314,7 +314,7 @@ Name | Type | **Returns:** arg is Left -Defined in: [either.ts:65](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L65) +Defined in: [src/either.ts:65](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L65) ___ @@ -351,7 +351,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](../README.md#typeguard)<*unknown*\> -Defined in: [either.ts:111](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L111) +Defined in: [src/either.ts:111](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L111) ___ @@ -369,7 +369,7 @@ Name | Type | **Returns:** arg is Right -Defined in: [either.ts:70](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L70) +Defined in: [src/either.ts:70](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L70) ___ @@ -406,7 +406,7 @@ Name | Type | Description | **Returns:** [*Typeguard*](../README.md#typeguard)<*unknown*\> -Defined in: [either.ts:133](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L133) +Defined in: [src/either.ts:133](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L133) ___ @@ -430,7 +430,7 @@ Name | Type | **Returns:** [*Left*](../interfaces/either.left.md) -Defined in: [either.ts:143](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L143) +Defined in: [src/either.ts:143](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L143) ___ @@ -455,7 +455,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:153](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L153) +Defined in: [src/either.ts:153](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L153) ___ @@ -480,7 +480,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:353](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L353) +Defined in: [src/either.ts:353](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L353) ___ @@ -503,7 +503,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:216](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L216) +Defined in: [src/either.ts:216](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L216) ___ @@ -527,7 +527,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:226](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L226) +Defined in: [src/either.ts:226](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L226) ___ @@ -551,7 +551,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:236](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L236) +Defined in: [src/either.ts:236](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L236) ___ @@ -574,7 +574,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:221](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L221) +Defined in: [src/either.ts:221](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L221) ___ @@ -598,7 +598,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:231](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L231) +Defined in: [src/either.ts:231](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L231) ___ @@ -622,7 +622,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:244](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L244) +Defined in: [src/either.ts:244](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L244) ___ @@ -646,7 +646,7 @@ Name | Type | **Returns:** [*Right*](../interfaces/either.right.md) -Defined in: [either.ts:148](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L148) +Defined in: [src/either.ts:148](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L148) ___ @@ -671,7 +671,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:158](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L158) +Defined in: [src/either.ts:158](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L158) ___ @@ -696,7 +696,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:358](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L358) +Defined in: [src/either.ts:358](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L358) ___ @@ -718,7 +718,7 @@ Name | Type | **Returns:** T[*__tag*] *extends* *left* ? [*Tagged*](../README.md#tagged) : [*Tagged*](../README.md#tagged) -Defined in: [either.ts:207](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L207) +Defined in: [src/either.ts:207](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L207) ___ @@ -746,7 +746,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [either.ts:258](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L258) +Defined in: [src/either.ts:258](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L258) ___ @@ -774,7 +774,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [either.ts:267](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L267) +Defined in: [src/either.ts:267](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L267) ___ @@ -804,7 +804,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:296](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L296) +Defined in: [src/either.ts:296](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L296) ___ @@ -834,7 +834,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:318](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L318) +Defined in: [src/either.ts:318](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L318) ___ @@ -865,7 +865,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [either.ts:282](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L282) +Defined in: [src/either.ts:282](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L282) ___ @@ -895,7 +895,7 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:307](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L307) +Defined in: [src/either.ts:307](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L307) ___ @@ -925,4 +925,4 @@ Name | Type | **Returns:** *function* -Defined in: [either.ts:329](https://github.com/OctoD/tiinvo/blob/0105242/src/either.ts#L329) +Defined in: [src/either.ts:329](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/either.ts#L329) diff --git a/docs/modules/filterables.md b/docs/modules/filterables.md index 3531007..135321c 100644 --- a/docs/modules/filterables.md +++ b/docs/modules/filterables.md @@ -32,7 +32,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [filterables.ts:13](https://github.com/OctoD/tiinvo/blob/0105242/src/filterables.ts#L13) +Defined in: [src/filterables.ts:13](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/filterables.ts#L13) ___ @@ -56,4 +56,4 @@ Name | Type | Description | **Returns:** *function* -Defined in: [filterables.ts:35](https://github.com/OctoD/tiinvo/blob/0105242/src/filterables.ts#L35) +Defined in: [src/filterables.ts:35](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/filterables.ts#L35) diff --git a/docs/modules/foldables.md b/docs/modules/foldables.md index fce5117..27f6e6f 100644 --- a/docs/modules/foldables.md +++ b/docs/modules/foldables.md @@ -27,7 +27,7 @@ Name | Type | `R` | - | `Tagname` | *string* | -Defined in: [foldables.ts:4](https://github.com/OctoD/tiinvo/blob/0105242/src/foldables.ts#L4) +Defined in: [src/foldables.ts:4](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/foldables.ts#L4) ## Functions @@ -52,7 +52,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [foldables.ts:30](https://github.com/OctoD/tiinvo/blob/0105242/src/foldables.ts#L30) +Defined in: [src/foldables.ts:30](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/foldables.ts#L30) ___ @@ -76,4 +76,4 @@ Name | Type | Description | **Returns:** *function* -Defined in: [foldables.ts:13](https://github.com/OctoD/tiinvo/blob/0105242/src/foldables.ts#L13) +Defined in: [src/foldables.ts:13](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/foldables.ts#L13) diff --git a/docs/modules/mappables.md b/docs/modules/mappables.md index 32ed235..61b7e73 100644 --- a/docs/modules/mappables.md +++ b/docs/modules/mappables.md @@ -27,7 +27,7 @@ Name | `T` | `U` | -Defined in: [mappables.ts:5](https://github.com/OctoD/tiinvo/blob/0105242/src/mappables.ts#L5) +Defined in: [src/mappables.ts:5](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mappables.ts#L5) ## Functions @@ -51,7 +51,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [mappables.ts:15](https://github.com/OctoD/tiinvo/blob/0105242/src/mappables.ts#L15) +Defined in: [src/mappables.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mappables.ts#L15) ___ @@ -75,7 +75,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [mappables.ts:34](https://github.com/OctoD/tiinvo/blob/0105242/src/mappables.ts#L34) +Defined in: [src/mappables.ts:34](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mappables.ts#L34) ___ @@ -99,4 +99,4 @@ Name | Type | Description | **Returns:** *function* -Defined in: [mappables.ts:53](https://github.com/OctoD/tiinvo/blob/0105242/src/mappables.ts#L53) +Defined in: [src/mappables.ts:53](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/mappables.ts#L53) diff --git a/docs/modules/maybe.md b/docs/modules/maybe.md index fed5496..a9eea22 100644 --- a/docs/modules/maybe.md +++ b/docs/modules/maybe.md @@ -51,7 +51,7 @@ Creates `Just` -Defined in: [maybe.ts:53](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L53) +Defined in: [src/maybe.ts:53](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L53) ___ @@ -59,7 +59,7 @@ ___ Ƭ **JustTag**: *typeof* JUSTTAG -Defined in: [maybe.ts:28](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L28) +Defined in: [src/maybe.ts:28](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L28) ___ @@ -75,7 +75,7 @@ Name | Default | ------ | ------ | `T` | *unknown* | -Defined in: [maybe.ts:44](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L44) +Defined in: [src/maybe.ts:44](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L44) ___ @@ -83,7 +83,7 @@ ___ Ƭ **MaybeTag**: [*JustTag*](maybe.md#justtag) \| [*NothingTag*](maybe.md#nothingtag) -Defined in: [maybe.ts:30](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L30) +Defined in: [src/maybe.ts:30](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L30) ___ @@ -93,7 +93,7 @@ ___ Creates `Nothing` -Defined in: [maybe.ts:49](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L49) +Defined in: [src/maybe.ts:49](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L49) ___ @@ -101,7 +101,7 @@ ___ Ƭ **NothingTag**: *typeof* NOTHINGTAG -Defined in: [maybe.ts:29](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L29) +Defined in: [src/maybe.ts:29](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L29) ## Functions @@ -119,7 +119,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:121](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L121) +Defined in: [src/maybe.ts:121](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L121) ___ @@ -144,7 +144,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:136](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L136) +Defined in: [src/maybe.ts:136](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L136) ___ @@ -170,7 +170,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:141](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L141) +Defined in: [src/maybe.ts:141](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L141) ___ @@ -198,7 +198,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:151](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L151) +Defined in: [src/maybe.ts:151](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L151) ___ @@ -222,7 +222,7 @@ Name | Type | **Returns:** [*Maybe*](maybe.md#maybe) -Defined in: [maybe.ts:110](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L110) +Defined in: [src/maybe.ts:110](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L110) ___ @@ -257,7 +257,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:211](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L211) +Defined in: [src/maybe.ts:211](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L211) ___ @@ -275,7 +275,7 @@ Name | Type | **Returns:** arg is Just -Defined in: [maybe.ts:73](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L73) +Defined in: [src/maybe.ts:73](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L73) ___ @@ -293,7 +293,7 @@ Name | Type | **Returns:** arg is Maybe -Defined in: [maybe.ts:65](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L65) +Defined in: [src/maybe.ts:65](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L65) ___ @@ -311,7 +311,7 @@ Name | Type | **Returns:** arg is Nothing -Defined in: [maybe.ts:78](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L78) +Defined in: [src/maybe.ts:78](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L78) ___ @@ -336,7 +336,7 @@ Name | Type | **Returns:** [*Tagged*](../README.md#tagged) -Defined in: [maybe.ts:93](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L93) +Defined in: [src/maybe.ts:93](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L93) ___ @@ -361,7 +361,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:105](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L105) +Defined in: [src/maybe.ts:105](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L105) ___ @@ -399,7 +399,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:230](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L230) +Defined in: [src/maybe.ts:230](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L230) ___ @@ -424,7 +424,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:160](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L160) +Defined in: [src/maybe.ts:160](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L160) ___ @@ -450,7 +450,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:165](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L165) +Defined in: [src/maybe.ts:165](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L165) ___ @@ -477,7 +477,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:171](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L171) +Defined in: [src/maybe.ts:171](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L171) ___ @@ -502,7 +502,7 @@ Name | Type | **Returns:** [*Nothing*](../interfaces/maybe.nothing.md) \| [*Tagged*](../README.md#tagged) -Defined in: [maybe.ts:100](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L100) +Defined in: [src/maybe.ts:100](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L100) ___ @@ -540,7 +540,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:248](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L248) +Defined in: [src/maybe.ts:248](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L248) ___ @@ -552,7 +552,7 @@ Creates a `Nothing` **Returns:** [*Nothing*](../interfaces/maybe.nothing.md) -Defined in: [maybe.ts:87](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L87) +Defined in: [src/maybe.ts:87](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L87) ___ @@ -570,7 +570,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:126](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L126) +Defined in: [src/maybe.ts:126](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L126) ___ @@ -594,7 +594,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [maybe.ts:180](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L180) +Defined in: [src/maybe.ts:180](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L180) ___ @@ -618,7 +618,7 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:188](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L188) +Defined in: [src/maybe.ts:188](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L188) ___ @@ -642,4 +642,4 @@ Name | Type | **Returns:** *function* -Defined in: [maybe.ts:193](https://github.com/OctoD/tiinvo/blob/0105242/src/maybe.ts#L193) +Defined in: [src/maybe.ts:193](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/maybe.ts#L193) diff --git a/docs/modules/num.md b/docs/modules/num.md new file mode 100644 index 0000000..90a6cc2 --- /dev/null +++ b/docs/modules/num.md @@ -0,0 +1,607 @@ +[tiinvo](../README.md) / num + +# Namespace: num + +## Table of contents + +### Type aliases + +- [NumberBinaryFn](num.md#numberbinaryfn) +- [NumberUnaryFn](num.md#numberunaryfn) + +### Functions + +- [badd](num.md#badd) +- [bdivide](num.md#bdivide) +- [bmax](num.md#bmax) +- [bmin](num.md#bmin) +- [bmultiply](num.md#bmultiply) +- [bpow](num.md#bpow) +- [bremainder](num.md#bremainder) +- [broot](num.md#broot) +- [bsubtract](num.md#bsubtract) +- [equals](num.md#equals) +- [greaterequalthan](num.md#greaterequalthan) +- [greaterthan](num.md#greaterthan) +- [inrange](num.md#inrange) +- [iseven](num.md#iseven) +- [isodd](num.md#isodd) +- [lessequalthan](num.md#lessequalthan) +- [lessthan](num.md#lessthan) +- [outofrange](num.md#outofrange) +- [toExponential](num.md#toexponential) +- [toFixed](num.md#tofixed) +- [toPrecision](num.md#toprecision) +- [toString](num.md#tostring) +- [uadd](num.md#uadd) +- [udivide](num.md#udivide) +- [umax](num.md#umax) +- [umin](num.md#umin) +- [umultiply](num.md#umultiply) +- [upow](num.md#upow) +- [uremainder](num.md#uremainder) +- [uroot](num.md#uroot) +- [usubtract](num.md#usubtract) + +## Type aliases + +### NumberBinaryFn + +Ƭ **NumberBinaryFn**: [*FnBinary*](../README.md#fnbinary)<*number*, *number*, *number*\> + +Defined in: src/num.ts:88 + +___ + +### NumberUnaryFn + +Ƭ **NumberUnaryFn**: [*FnUnary*](../README.md#fnunary)<*number*, [*FnUnary*](../README.md#fnunary)<*number*, *number*\>\> + +Defined in: src/num.ts:72 + +## Functions + +### badd + +▸ `Const`**badd**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:90 + +___ + +### bdivide + +▸ `Const`**bdivide**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:91 + +___ + +### bmax + +▸ `Const`**bmax**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:93 + +___ + +### bmin + +▸ `Const`**bmin**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:94 + +___ + +### bmultiply + +▸ `Const`**bmultiply**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:92 + +___ + +### bpow + +▸ `Const`**bpow**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:95 + +___ + +### bremainder + +▸ `Const`**bremainder**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:96 + +___ + +### broot + +▸ `Const`**broot**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:97 + +___ + +### bsubtract + +▸ `Const`**bsubtract**(`arg1`: *number*, `arg2`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg1` | *number* | +`arg2` | *number* | + +**Returns:** *number* + +Defined in: src/num.ts:98 + +___ + +### equals + +▸ `Const`**equals**(`comparator`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`comparator` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:56 + +___ + +### greaterequalthan + +▸ `Const`**greaterequalthan**(`comparator`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`comparator` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:58 + +___ + +### greaterthan + +▸ `Const`**greaterthan**(`comparator`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`comparator` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:57 + +___ + +### inrange + +▸ `Const`**inrange**(`min`: *number*, `max`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`min` | *number* | +`max` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:62 + +___ + +### iseven + +▸ `Const`**iseven**(`arg`: *number*): *boolean* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** *boolean* + +Defined in: src/num.ts:65 + +___ + +### isodd + +▸ `Const`**isodd**(`arg`: *number*): *boolean* + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** *boolean* + +Defined in: src/num.ts:66 + +___ + +### lessequalthan + +▸ `Const`**lessequalthan**(`comparator`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`comparator` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:60 + +___ + +### lessthan + +▸ `Const`**lessthan**(`comparator`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`comparator` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:59 + +___ + +### outofrange + +▸ `Const`**outofrange**(`min`: *number*, `max`: *number*): *function* + +#### Parameters: + +Name | Type | +------ | ------ | +`min` | *number* | +`max` | *number* | + +**Returns:** *function* + +Defined in: src/num.ts:63 + +___ + +### toExponential + +▸ `Const`**toExponential**(...`args`: [fractionDigits?: number]): *function* + +Returns a string containing a number represented in exponential notation. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { num } from 'tiinvo'; +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [fractionDigits?: number] | + +**Returns:** *function* + +Defined in: src/num.ts:17 + +___ + +### toFixed + +▸ `Const`**toFixed**(...`args`: [fractionDigits?: number]): *function* + +Returns a string representing a number in fixed-point notation. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { num } from 'tiinvo'; +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [fractionDigits?: number] | + +**Returns:** *function* + +Defined in: src/num.ts:28 + +___ + +### toPrecision + +▸ `Const`**toPrecision**(...`args`: [precision?: number]): *function* + +Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { num } from 'tiinvo'; +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [precision?: number] | + +**Returns:** *function* + +Defined in: src/num.ts:39 + +___ + +### toString + +▸ `Const`**toString**(...`args`: [radix?: number]): *function* + +Converts a numeric to a string type + +**`since`** 2.10.0 + +**`example`** + +```ts +import { num } from 'tiinvo'; +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [radix?: number] | + +**Returns:** *function* + +Defined in: src/num.ts:50 + +___ + +### uadd + +▸ `Const`**uadd**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:74 + +___ + +### udivide + +▸ `Const`**udivide**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:75 + +___ + +### umax + +▸ `Const`**umax**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:76 + +___ + +### umin + +▸ `Const`**umin**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:77 + +___ + +### umultiply + +▸ `Const`**umultiply**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:78 + +___ + +### upow + +▸ `Const`**upow**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:79 + +___ + +### uremainder + +▸ `Const`**uremainder**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:80 + +___ + +### uroot + +▸ `Const`**uroot**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:81 + +___ + +### usubtract + +▸ `Const`**usubtract**(`arg`: *number*): [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *number* | + +**Returns:** [*FnUnary*](../README.md#fnunary)<*number*, *number*\> + +Defined in: src/num.ts:82 diff --git a/docs/modules/obj.md b/docs/modules/obj.md new file mode 100644 index 0000000..104e8ea --- /dev/null +++ b/docs/modules/obj.md @@ -0,0 +1,349 @@ +[tiinvo](../README.md) / obj + +# Namespace: obj + +## Table of contents + +### Functions + +- [entries](obj.md#entries) +- [is](obj.md#is) +- [isExtensible](obj.md#isextensible) +- [isFrozen](obj.md#isfrozen) +- [isSealed](obj.md#issealed) +- [keys](obj.md#keys) +- [mapkey](obj.md#mapkey) +- [pick](obj.md#pick) +- [values](obj.md#values) + +## Functions + +### entries + +▸ `Const`**entries**(`o`: *ArrayLike* \| { [s: string]: T; }): [*string*, T][] + +Returns an array of key/values of the enumerable properties of an object + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +obj.entries({ foo: 10, bar: 20 }) // [["foo", 10], ["bar", 20]] +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`o` | *ArrayLike* \| { [s: string]: T; } | the object | + +**Returns:** [*string*, T][] + +Defined in: [src/obj.ts:15](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L15) + +___ + +### is + +▸ `Const`**is**(`t`: T): *function* + +Returns true if the object T and object U values are the same, false otherwise. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +obj.is({ lorem: "ipsum" })({ lorem: "ipsum" }) // true +obj.is({ foo: 100 })({ bar: 200 }) // false +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`t` | T | + +**Returns:** *function* + +Defined in: [src/obj.ts:32](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L32) + +___ + +### isExtensible + +▸ `Const`**isExtensible**(`o`: T): *boolean* + +Returns a value that indicates whether new properties can be added to an object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +const test = { foo: 100 } + +obj.isExtensible(test) // true + +Object.preventExtensions(test); + +obj.isExtensible(test) // false +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`o` | T | + +**Returns:** *boolean* + +Defined in: [src/obj.ts:54](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L54) + +___ + +### isFrozen + +▸ `Const`**isFrozen**(`o`: T): *boolean* + +Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +const test = { foo: 100 } + +obj.isFrozen(test) // false + +Object.freeze(test); + +obj.isFrozen(test) // true +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`o` | T | + +**Returns:** *boolean* + +Defined in: [src/obj.ts:76](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L76) + +___ + +### isSealed + +▸ `Const`**isSealed**(`o`: T): *boolean* + +Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +const test = { foo: 100 } + +obj.isSealed(test) // false + +Object.seal(test); + +obj.isSealed(test) // true +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`o` | T | + +**Returns:** *boolean* + +Defined in: [src/obj.ts:98](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L98) + +___ + +### keys + +▸ `Const`**keys**(`obj`: T): keyof T[] + +Returns the names of the enumerable string properties and methods of an object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +obj.keys({ foo: 1, bar: 2, baz: 3 }) // ["foo", "bar", "baz"] +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`obj` | T | + +**Returns:** keyof T[] + +Defined in: [src/obj.ts:114](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L114) + +___ + +### mapkey + +▸ `Const`**mapkey**(`key`: keyof T): *function* + +Creates a mapper function for the type T. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +const test = { foo: 200, bar: 'baz' }; + +const map = obj.mapkey('foo') + +map(test) // 200 + +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`key` | keyof T | + +**Returns:** *function* + +Defined in: [src/obj.ts:135](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L135) + +___ + +### pick + +▸ `Const`**pick**(...`keys`: T[]): *function* + +Given a set of properties T whose keys are in the object U, returns a new object with all picked properties + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +const test = { foo: 100, bar: 200, baz: 300 }; + +obj.pick(`foo`, `baz`)(test) // { foo: 100, baz: 300 } +``` + +#### Type parameters: + +Name | Type | +------ | ------ | +`T` | *string* | + +#### Parameters: + +Name | Type | +------ | ------ | +`...keys` | T[] | + +**Returns:** *function* + +Defined in: [src/obj.ts:153](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L153) + +___ + +### values + +▸ `Const`**values**(`obj`: { [s: string]: T; }): T[] + +Returns an array of values of the enumerable properties of an object + +**`since`** 2.10.0 + +**`example`** + +```ts +import { obj } from 'tiinvo'; + +obj.values({ foo: 1, bar: 2, baz: 3 }) // [1, 2, 3] +``` + +#### Type parameters: + +Name | +------ | +`T` | + +#### Parameters: + +Name | Type | +------ | ------ | +`obj` | { [s: string]: T; } | + +**Returns:** T[] + +Defined in: [src/obj.ts:172](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/obj.ts#L172) diff --git a/docs/modules/option.md b/docs/modules/option.md index 031df8a..c0eed34 100644 --- a/docs/modules/option.md +++ b/docs/modules/option.md @@ -47,7 +47,7 @@ Ƭ **NoneFactory**: () => [*None*](../interfaces/option.none.md) -Defined in: [option.ts:51](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L51) +Defined in: [src/option.ts:51](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L51) ___ @@ -55,7 +55,7 @@ ___ Ƭ **Nonetag**: *typeof* NONETAG -Defined in: [option.ts:23](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L23) +Defined in: [src/option.ts:23](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L23) ___ @@ -69,7 +69,7 @@ Name | Default | ------ | ------ | `T` | *unknown* | -Defined in: [option.ts:46](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L46) +Defined in: [src/option.ts:46](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L46) ___ @@ -77,7 +77,7 @@ ___ Ƭ **OptionFactory**: (`value`: T) => [*Option*](option.md#option) -Defined in: [option.ts:59](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L59) +Defined in: [src/option.ts:59](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L59) ___ @@ -85,7 +85,7 @@ ___ Ƭ **Optiontag**: [*Nonetag*](option.md#nonetag) \| [*Sometag*](option.md#sometag) -Defined in: [option.ts:31](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L31) +Defined in: [src/option.ts:31](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L31) ___ @@ -93,7 +93,7 @@ ___ Ƭ **SomeFactory**: (`value`: T) => [*Some*](../interfaces/option.some.md) -Defined in: [option.ts:55](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L55) +Defined in: [src/option.ts:55](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L55) ___ @@ -101,7 +101,7 @@ ___ Ƭ **Sometag**: *typeof* SOMETAG -Defined in: [option.ts:27](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L27) +Defined in: [src/option.ts:27](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L27) ## Functions @@ -117,7 +117,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:97](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L97) +Defined in: [src/option.ts:97](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L97) ___ @@ -139,7 +139,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:139](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L139) +Defined in: [src/option.ts:139](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L139) ___ @@ -162,7 +162,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:143](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L143) +Defined in: [src/option.ts:143](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L143) ___ @@ -187,7 +187,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:130](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L130) +Defined in: [src/option.ts:130](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L130) ___ @@ -212,7 +212,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:220](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L220) +Defined in: [src/option.ts:220](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L220) ___ @@ -228,7 +228,7 @@ Name | Type | **Returns:** arg is None -Defined in: [option.ts:76](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L76) +Defined in: [src/option.ts:76](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L76) ___ @@ -244,7 +244,7 @@ Name | Type | **Returns:** arg is Option -Defined in: [option.ts:72](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L72) +Defined in: [src/option.ts:72](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L72) ___ @@ -266,7 +266,7 @@ Name | Type | **Returns:** [*Typeguard*](../README.md#typeguard)<[*Option*](option.md#option)\> -Defined in: [option.ts:84](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L84) +Defined in: [src/option.ts:84](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L84) ___ @@ -282,7 +282,7 @@ Name | Type | **Returns:** arg is Some -Defined in: [option.ts:80](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L80) +Defined in: [src/option.ts:80](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L80) ___ @@ -305,7 +305,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:152](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L152) +Defined in: [src/option.ts:152](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L152) ___ @@ -329,7 +329,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:156](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L156) +Defined in: [src/option.ts:156](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L156) ___ @@ -353,7 +353,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:160](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L160) +Defined in: [src/option.ts:160](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L160) ___ @@ -363,7 +363,7 @@ ___ **Returns:** [*None*](../interfaces/option.none.md) -Defined in: [option.ts:110](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L110) +Defined in: [src/option.ts:110](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L110) ___ @@ -385,7 +385,7 @@ Name | Type | **Returns:** [*Option*](option.md#option)<*NonNullable*\> -Defined in: [option.ts:124](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L124) +Defined in: [src/option.ts:124](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L124) ___ @@ -407,7 +407,7 @@ Name | Type | **Returns:** [*Some*](../interfaces/option.some.md)<*NonNullable*\> -Defined in: [option.ts:115](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L115) +Defined in: [src/option.ts:115](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L115) ___ @@ -423,7 +423,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:101](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L101) +Defined in: [src/option.ts:101](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L101) ___ @@ -457,7 +457,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [option.ts:179](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L179) +Defined in: [src/option.ts:179](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L179) ___ @@ -491,7 +491,7 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:197](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L197) +Defined in: [src/option.ts:197](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L197) ___ @@ -526,4 +526,4 @@ Name | Type | **Returns:** *function* -Defined in: [option.ts:213](https://github.com/OctoD/tiinvo/blob/0105242/src/option.ts#L213) +Defined in: [src/option.ts:213](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/option.ts#L213) diff --git a/docs/modules/predicate.md b/docs/modules/predicate.md index 71c2872..d9a743c 100644 --- a/docs/modules/predicate.md +++ b/docs/modules/predicate.md @@ -35,7 +35,7 @@ Name | ------ | `T` | -Defined in: [predicate.ts:5](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L5) +Defined in: [src/predicate.ts:5](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L5) ## Functions @@ -73,7 +73,7 @@ Name | Type | Description | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:28](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L28) +Defined in: [src/predicate.ts:28](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L28) ___ @@ -111,7 +111,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:52](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L52) +Defined in: [src/predicate.ts:52](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L52) ___ @@ -145,7 +145,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:143](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L143) +Defined in: [src/predicate.ts:143](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L143) ___ @@ -179,7 +179,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:88](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L88) +Defined in: [src/predicate.ts:88](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L88) ___ @@ -213,7 +213,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:70](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L70) +Defined in: [src/predicate.ts:70](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L70) ___ @@ -247,7 +247,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:124](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L124) +Defined in: [src/predicate.ts:124](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L124) ___ @@ -281,7 +281,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [predicate.ts:106](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L106) +Defined in: [src/predicate.ts:106](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L106) ___ @@ -321,7 +321,7 @@ Name | Type | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:169](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L169) +Defined in: [src/predicate.ts:169](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L169) ___ @@ -360,7 +360,7 @@ Name | Type | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:195](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L195) +Defined in: [src/predicate.ts:195](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L195) ___ @@ -394,7 +394,7 @@ Name | Type | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:216](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L216) +Defined in: [src/predicate.ts:216](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L216) ___ @@ -428,7 +428,7 @@ Name | Type | Description | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:236](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L236) +Defined in: [src/predicate.ts:236](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L236) ___ @@ -462,4 +462,4 @@ Name | Type | Description | **Returns:** [*Predicate*](predicate.md#predicate) -Defined in: [predicate.ts:257](https://github.com/OctoD/tiinvo/blob/0105242/src/predicate.ts#L257) +Defined in: [src/predicate.ts:257](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/predicate.ts#L257) diff --git a/docs/modules/result.md b/docs/modules/result.md index cd98ee4..7f8db83 100644 --- a/docs/modules/result.md +++ b/docs/modules/result.md @@ -49,7 +49,7 @@ Ƭ **ErrFactory**: (`message`: *string* \| Error) => [*Err*](../interfaces/result.err.md) -Defined in: [result.ts:59](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L59) +Defined in: [src/result.ts:59](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L59) ___ @@ -57,7 +57,7 @@ ___ Ƭ **Errtag**: *typeof* ERRTAG -Defined in: [result.ts:29](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L29) +Defined in: [src/result.ts:29](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L29) ___ @@ -71,7 +71,7 @@ Name | ------ | `T` | -Defined in: [result.ts:69](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L69) +Defined in: [src/result.ts:69](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L69) ___ @@ -85,7 +85,7 @@ Name | Default | ------ | ------ | `T` | *unknown* | -Defined in: [result.ts:49](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L49) +Defined in: [src/result.ts:49](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L49) ___ @@ -93,7 +93,7 @@ ___ Ƭ **OkFactory**: (`arg`: T) => [*Ok*](result.md#ok) -Defined in: [result.ts:63](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L63) +Defined in: [src/result.ts:63](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L63) ___ @@ -101,7 +101,7 @@ ___ Ƭ **Oktag**: *typeof* OKTAG -Defined in: [result.ts:34](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L34) +Defined in: [src/result.ts:34](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L34) ___ @@ -115,7 +115,7 @@ Name | Default | ------ | ------ | `T` | *unknown* | -Defined in: [result.ts:54](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L54) +Defined in: [src/result.ts:54](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L54) ___ @@ -123,7 +123,7 @@ ___ Ƭ **ResultFactory**: (`arg`: T) => [*Result*](result.md#result) -Defined in: [result.ts:67](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L67) +Defined in: [src/result.ts:67](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L67) ___ @@ -131,7 +131,7 @@ ___ Ƭ **ResultTag**: [*Errtag*](result.md#errtag) \| [*Oktag*](result.md#oktag) -Defined in: [result.ts:39](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L39) +Defined in: [src/result.ts:39](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L39) ## Functions @@ -147,7 +147,7 @@ Name | Type | **Returns:** [*Err*](../interfaces/result.err.md) -Defined in: [result.ts:102](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L102) +Defined in: [src/result.ts:102](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L102) ___ @@ -165,7 +165,7 @@ Name | Type | **Returns:** [*Err*](../interfaces/result.err.md) -Defined in: [result.ts:123](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L123) +Defined in: [src/result.ts:123](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L123) ___ @@ -183,7 +183,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:147](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L147) +Defined in: [src/result.ts:147](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L147) ___ @@ -226,7 +226,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:179](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L179) +Defined in: [src/result.ts:179](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L179) ___ @@ -270,7 +270,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:207](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L207) +Defined in: [src/result.ts:207](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L207) ___ @@ -294,7 +294,7 @@ Name | Type | **Returns:** [*Result*](result.md#result) -Defined in: [result.ts:136](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L136) +Defined in: [src/result.ts:136](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L136) ___ @@ -318,7 +318,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:354](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L354) +Defined in: [src/result.ts:354](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L354) ___ @@ -334,7 +334,7 @@ Name | Type | **Returns:** arg is Err -Defined in: [result.ts:89](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L89) +Defined in: [src/result.ts:89](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L89) ___ @@ -350,7 +350,7 @@ Name | Type | **Returns:** arg is Tagged -Defined in: [result.ts:93](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L93) +Defined in: [src/result.ts:93](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L93) ___ @@ -366,7 +366,7 @@ Name | Type | **Returns:** arg is Tagged -Defined in: [result.ts:82](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L82) +Defined in: [src/result.ts:82](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L82) ___ @@ -409,7 +409,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:237](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L237) +Defined in: [src/result.ts:237](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L237) ___ @@ -453,7 +453,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:263](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L263) +Defined in: [src/result.ts:263](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L263) ___ @@ -497,7 +497,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:289](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L289) +Defined in: [src/result.ts:289](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L289) ___ @@ -519,7 +519,7 @@ Name | Type | **Returns:** [*Ok*](result.md#ok) -Defined in: [result.ts:108](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L108) +Defined in: [src/result.ts:108](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L108) ___ @@ -544,7 +544,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:131](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L131) +Defined in: [src/result.ts:131](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L131) ___ @@ -566,7 +566,7 @@ Name | Type | **Returns:** [*Result*](result.md#result) -Defined in: [result.ts:117](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L117) +Defined in: [src/result.ts:117](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L117) ___ @@ -584,7 +584,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:151](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L151) +Defined in: [src/result.ts:151](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L151) ___ @@ -620,7 +620,7 @@ Name | Type | **Returns:** Arg *extends* [*Tagged*](../README.md#tagged) ? U : *never* -Defined in: [result.ts:313](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L313) +Defined in: [src/result.ts:313](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L313) ___ @@ -656,7 +656,7 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:331](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L331) +Defined in: [src/result.ts:331](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L331) ___ @@ -692,4 +692,4 @@ Name | Type | **Returns:** *function* -Defined in: [result.ts:347](https://github.com/OctoD/tiinvo/blob/0105242/src/result.ts#L347) +Defined in: [src/result.ts:347](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/result.ts#L347) diff --git a/docs/modules/str.md b/docs/modules/str.md new file mode 100644 index 0000000..e5eed15 --- /dev/null +++ b/docs/modules/str.md @@ -0,0 +1,721 @@ +[tiinvo](../README.md) / str + +# Namespace: str + +## Table of contents + +### Functions + +- [charAt](str.md#charat) +- [charCodeAt](str.md#charcodeat) +- [concat](str.md#concat) +- [endsWith](str.md#endswith) +- [fromCharCode](str.md#fromcharcode) +- [includes](str.md#includes) +- [indexOf](str.md#indexof) +- [isempty](str.md#isempty) +- [lastIndexOf](str.md#lastindexof) +- [length](str.md#length) +- [lowercase](str.md#lowercase) +- [match](str.md#match) +- [padEnd](str.md#padend) +- [padStart](str.md#padstart) +- [repeat](str.md#repeat) +- [replace](str.md#replace) +- [search](str.md#search) +- [slice](str.md#slice) +- [split](str.md#split) +- [substring](str.md#substring) +- [substringI](str.md#substringi) +- [trim](str.md#trim) +- [trimEnd](str.md#trimend) +- [trimStart](str.md#trimstart) +- [uppercase](str.md#uppercase) + +## Functions + +### charAt + +▸ `Const`**charAt**(...`args`: [pos: number]): *function* + +Returns the character at the specified index. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +const sentence = 'The quick brown fox jumps over the lazy dog.'; +const index = 4; + +str.charAt(index)(sentence) // "q" + +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [pos: number] | + +**Returns:** *function* + +Defined in: src/str.ts:22 + +___ + +### charCodeAt + +▸ `Const`**charCodeAt**(...`args`: [index: number]): *function* + +Returns the Unicode value of the character at the specified location. + +**`since`** 2.10.0 + +**`example`** + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [index: number] | + +**Returns:** *function* + +Defined in: src/str.ts:29 + +___ + +### concat + +▸ `Const`**concat**(...`args`: *string*[]): *function* + +Returns a string that contains the concatenation of two or more strings. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.concat(`b`, `c`, `d`)(`abcd`) // true +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | *string*[] | + +**Returns:** *function* + +Defined in: src/str.ts:42 + +___ + +### endsWith + +▸ `Const`**endsWith**(...`args`: [searchString: string, endPosition?: number]): *function* + +Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at endPosition – length(this). Otherwise returns false. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.endsWith(`r`)(`foobar`) // true +str.endsWith(`w`)(`hellow`) // true +str.endsWith(`a`)(`foobar`) // false +str.endsWith(`b`)(`hellow`) // false +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [searchString: string, endPosition?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:58 + +___ + +### fromCharCode + +▸ `Const`**fromCharCode**(...`args`: *number*[]): *string* + +Returns a string created from the specified sequence of UTF-16 code units. + +**`since`** 2.10.0 + +**`example`** + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | *number*[] | + +**Returns:** *string* + +Defined in: src/str.ts:277 + +___ + +### includes + +▸ `Const`**includes**(...`args`: [searchString: string, position?: number]): *function* + +Returns true if searchString appears as a substring of the result of converting this object to a String, at one or more positions that are greater than or equal to position; otherwise, returns false. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.includes(`foo`)(`foobar`) // true +str.includes(`foo`)(`hellow`) // false +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [searchString: string, position?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:72 + +___ + +### indexOf + +▸ `Const`**indexOf**(...`args`: [searchString: string, position?: number]): *function* + +Returns the position of the first occurrence of a substring. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.indexOf(`b`)(`abcd`) // 1 +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [searchString: string, position?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:85 + +___ + +### isempty + +▸ `Const`**isempty**(`arg`: *string*): *boolean* + +Returns if a string is empty + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.isempty(``) // true +str.isempty(` `) // false +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *boolean* + +Defined in: src/str.ts:291 + +___ + +### lastIndexOf + +▸ `Const`**lastIndexOf**(...`args`: [searchString: string, position?: number]): *function* + +Returns the last occurrence of a substring in the string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.lastIndexOf(`b`)(`abcdb`) // 1 +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [searchString: string, position?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:98 + +___ + +### length + +▸ `Const`**length**(`arg`: *string*): *number* + +Returns a string length + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.length(`hello`) // 5 +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *number* + +Defined in: src/str.ts:304 + +___ + +### lowercase + +▸ `Const`**lowercase**(`arg`: *string*): *string* + +Returns a copy of a string in lower case + +**`since`** 2.10.0 + +**`example`** + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *string* + +Defined in: src/str.ts:311 + +___ + +### match + +▸ `Const`**match**(`regexp`: *RegExp*): *function* + +Matches a string with a regular expression, and returns an array containing the results of that search. +Differently from native implementation, it always returns an array + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.match(/abc/)(`abcd`) // [`abc`] +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`regexp` | *RegExp* | + +**Returns:** *function* + +Defined in: src/str.ts:112 + +___ + +### padEnd + +▸ `Const`**padEnd**(...`args`: [maxLength: number, fillString?: string]): *function* + +Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.padEnd('-', 5)(`a`) // "a----" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [maxLength: number, fillString?: string] | + +**Returns:** *function* + +Defined in: src/str.ts:125 + +___ + +### padStart + +▸ `Const`**padStart**(...`args`: [maxLength: number, fillString?: string]): *function* + +Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.padStart('-', 5)(`a`) // "----a" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [maxLength: number, fillString?: string] | + +**Returns:** *function* + +Defined in: src/str.ts:138 + +___ + +### repeat + +▸ `Const`**repeat**(...`args`: [count: number]): *function* + +Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.repeat(2)(`hello`) // "hellohello" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [count: number] | + +**Returns:** *function* + +Defined in: src/str.ts:151 + +___ + +### replace + +▸ `Const`**replace**(`regexp`: *string* \| *RegExp*, `replacewith`: *string* \| (`substring`: *string*, ...`args`: *any*[]) => *string*): *function* + +Replaces text in a string, using a regular expression or search string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.replace("goodbye cruel", "hello")("goodbye cruel world") // "hello world" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`regexp` | *string* \| *RegExp* | +`replacewith` | *string* \| (`substring`: *string*, ...`args`: *any*[]) => *string* | + +**Returns:** *function* + +Defined in: src/str.ts:163 + +___ + +### search + +▸ `Const`**search**(...`args`: [searcher: object]): *function* + +Finds the first substring match in a regular expression search. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.search(/a/)("testa") // 4 +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [searcher: object] | + +**Returns:** *function* + +Defined in: src/str.ts:176 + +___ + +### slice + +▸ `Const`**slice**(...`args`: [start?: number, end?: number]): *function* + +Returns a section of a string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.slice(1, 2)('hello') // "e" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [start?: number, end?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:189 + +___ + +### split + +▸ `Const`**split**(`splitter`: *string* \| *RegExp*, `limit?`: *number*): *function* + +Split a string into substrings using the specified separator and return them as an array. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.split("-")("1970-01-01") // ["1970", "01", "01"] +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`splitter` | *string* \| *RegExp* | +`limit?` | *number* | + +**Returns:** *function* + +Defined in: src/str.ts:202 + +___ + +### substring + +▸ `Const`**substring**(...`args`: [start: number, end?: number]): *function* + +Returns the substring at the specified location within a String object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.substring(1, 2)("pizza") // "i" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [start: number, end?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:228 + +___ + +### substringI + +▸ `Const`**substringI**(...`args`: [from: number, length?: number]): *function* + +Returns the substring at the specified location within a String object. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.substringi(1, 2)("pizza") // "iz" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`...args` | [from: number, length?: number] | + +**Returns:** *function* + +Defined in: src/str.ts:215 + +___ + +### trim + +▸ `Const`**trim**(`arg`: *string*): *string* + +Removes the leading and trailing white space and line terminator characters from a string. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.trim(` aaa `) // "aaa" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *string* + +Defined in: src/str.ts:241 + +___ + +### trimEnd + +▸ `Const`**trimEnd**(`arg`: *string*): *string* + +Returns a copy with trailing whitespace removed. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.trimEnd(` aaa `) // " aaa" +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *string* + +Defined in: src/str.ts:254 + +___ + +### trimStart + +▸ `Const`**trimStart**(`arg`: *string*): *string* + +Returns a copy with leading whitespace removed. + +**`since`** 2.10.0 + +**`example`** + +```ts +import { str } from 'tiinvo'; + +str.trimStart(` aaa `) // "aaa " +``` + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *string* + +Defined in: src/str.ts:267 + +___ + +### uppercase + +▸ `Const`**uppercase**(`arg`: *string*): *string* + +Returns a copy of a string in upper case + +**`since`** 2.10.0 + +**`example`** + +#### Parameters: + +Name | Type | +------ | ------ | +`arg` | *string* | + +**Returns:** *string* + +Defined in: src/str.ts:318 diff --git a/docs/modules/unwrappables.md b/docs/modules/unwrappables.md index 8e8e34d..5c51580 100644 --- a/docs/modules/unwrappables.md +++ b/docs/modules/unwrappables.md @@ -31,7 +31,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [unwrappables.ts:12](https://github.com/OctoD/tiinvo/blob/0105242/src/unwrappables.ts#L12) +Defined in: [src/unwrappables.ts:12](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/unwrappables.ts#L12) ___ @@ -53,7 +53,7 @@ Name | Type | Description | **Returns:** *function* -Defined in: [unwrappables.ts:26](https://github.com/OctoD/tiinvo/blob/0105242/src/unwrappables.ts#L26) +Defined in: [src/unwrappables.ts:26](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/unwrappables.ts#L26) ___ @@ -75,4 +75,4 @@ Name | Type | Description | **Returns:** *function* -Defined in: [unwrappables.ts:37](https://github.com/OctoD/tiinvo/blob/0105242/src/unwrappables.ts#L37) +Defined in: [src/unwrappables.ts:37](https://github.com/OctoD/tiinvo/blob/6f7ada4/src/unwrappables.ts#L37) diff --git a/src/__tests__/num.test.ts b/src/__tests__/num.test.ts new file mode 100644 index 0000000..855ca32 --- /dev/null +++ b/src/__tests__/num.test.ts @@ -0,0 +1,116 @@ +import * as num from '../num'; + +describe(`num`, () => { + test('toExponential', () => { + expect(num.toExponential(2)(2)).toBe((2).toExponential(2)); + }) + test('toFixed', () => { + expect(num.toFixed(2)(2)).toBe((2).toFixed(2)); + }) + test('toPrecision', () => { + expect(num.toPrecision(2)(2)).toBe((2).toPrecision(2)); + }) + test('toString', () => { + expect(num.toString(2)(2)).toBe((2).toString(2)); + }) + test('equals', () => { + expect(num.equals(2)(2)).toBeTruthy(); + expect(num.equals(2)(3)).toBeFalsy(); + }) + test('greaterthan', () => { + expect(num.greaterthan(2)(1)).toBeFalsy(); + expect(num.greaterthan(2)(2)).toBeFalsy(); + expect(num.greaterthan(2)(3)).toBeTruthy(); + }) + test('greaterequalthan', () => { + expect(num.greaterequalthan(2)(1)).toBeFalsy(); + expect(num.greaterequalthan(2)(2)).toBeTruthy(); + expect(num.greaterequalthan(2)(4)).toBeTruthy(); + }) + test('lessthan', () => { + expect(num.lessthan(2)(4)).toBeFalsy() + expect(num.lessthan(2)(2)).toBeFalsy() + expect(num.lessthan(2)(1)).toBeTruthy() + }) + test('lessequalthan', () => { + expect(num.lessequalthan(2)(3)).toBeFalsy(); + expect(num.lessequalthan(2)(2)).toBeTruthy(); + expect(num.lessequalthan(2)(1)).toBeTruthy(); + }) + test('inrange', () => { + expect(num.inrange(2, 5)(1)).toBeFalsy(); + expect(num.inrange(2, 5)(2)).toBeTruthy(); + expect(num.inrange(2, 5)(3)).toBeTruthy(); + expect(num.inrange(2, 5)(4)).toBeTruthy(); + expect(num.inrange(2, 5)(5)).toBeTruthy(); + expect(num.inrange(2, 5)(5.2)).toBeFalsy(); + }) + test('outofrange', () => { + expect(num.outofrange(2, 5)(1)).toBeTruthy(); + expect(num.outofrange(2, 5)(2)).toBeFalsy(); + expect(num.outofrange(2, 5)(3)).toBeFalsy(); + expect(num.outofrange(2, 5)(4)).toBeFalsy(); + expect(num.outofrange(2, 5)(5)).toBeFalsy(); + expect(num.outofrange(2, 5)(5.2)).toBeTruthy(); + }) + test('iseven', () => { + expect(num.iseven(2)).toBeTruthy() + }) + test('isodd', () => { + expect(num.isodd(2)).toBeFalsy() + }) + test('uadd', () => { + expect(num.uadd(2)(2)).toBe(4); + }) + test('udivide', () => { + expect(num.udivide(2)(4)).toBe(2); + }) + test('umax', () => { + expect(num.umax(2)(1)).toBe(2); + }) + test('umin', () => { + expect(num.umin(2)(4)).toBe(2); + }) + test('umultiply', () => { + expect(num.umultiply(2)(2)).toBe(4); + }) + test('upow', () => { + expect(num.upow(2)(3)).toBe(9); + }) + test('uremainder', () => { + expect(num.uremainder(2)(2.5)).toBe(.5); + }) + test('uroot', () => { + expect(num.uroot(2)(49)).toBe(7); + }) + test('usubtract', () => { + expect(num.usubtract(2)(5)).toBe(3); + }) + test('badd', () => { + expect(num.badd(2, 2)).toBe(4); + }) + test('bdivide', () => { + expect(num.bdivide(4, 2)).toBe(2); + }) + test('bmultiply', () => { + expect(num.bmultiply(2, 3)).toBe(6); + }) + test('bmax', () => { + expect(num.bmax(2, 5)).toBe(5); + }) + test('bmin', () => { + expect(num.bmin(2, 5)).toBe(2); + }) + test('bpow', () => { + expect(num.bpow(2, 3)).toBe(8); + }) + test('bremainder', () => { + expect(num.bremainder(2, 1.5)).toBe(.5); + }) + test('broot', () => { + expect(num.broot(9, 2)).toBe(3); + }) + test('bsubtract', () => { + expect(num.bsubtract(2, 2)).toBe(0); + }) +}); diff --git a/src/__tests__/str.test.ts b/src/__tests__/str.test.ts new file mode 100644 index 0000000..14857c7 --- /dev/null +++ b/src/__tests__/str.test.ts @@ -0,0 +1,81 @@ +import * as str from '../str' + +const teststr = `abcda`; + +describe(`str`, () =>{ + test(`charAt`, () => { + expect(str.charAt(2)(teststr)).toBe(teststr.charAt(2)); + }) + test(`charCodeAt`, () => { + expect(str.charCodeAt(2)(teststr)).toBe(teststr.charCodeAt(2)); + }) + test(`concat`, () => { + expect(str.concat(`b`, `c`, `d`, `a`)(`a`)).toBe(teststr); + }) + test(`endsWith`, () => { + expect(str.endsWith(`a`)(teststr)).toBe(true); + expect(str.endsWith(`h`)(teststr)).toBe(false); + }) + test(`includes`, () => { + expect(str.includes('a')(teststr)).toBe(true); + expect(str.includes('f')(teststr)).toBe(false); + }) + test(`indexOf`, () => { + expect(str.indexOf('b')(teststr)).toBe(1); + }) + test(`lastIndexOf`, () => { + expect(str.lastIndexOf('a')(teststr)).toBe(4); + }) + test(`match`, () => { + expect(str.match(/a/)(teststr).length).toBe(1); + }) + test(`padEnd`, () => { + expect(str.padEnd(6, 'x')(teststr)).toBe(teststr + `x`); + }) + test(`padStart`, () => { + expect(str.padStart(6, 'y')(teststr)).toBe(`y${teststr}`); + }) + test(`repeat`, () => { + expect(str.repeat(3)(teststr)).toBe(teststr+teststr+teststr); + }) + test(`replace`, () => { + expect(str.replace('a', '1')(teststr)).toBe(`1bcda`); + }) + test(`search`, () => { + expect(str.search(/a/)(teststr)).toBe(0); + }) + test(`slice`, () => { + expect(str.slice(2)(teststr)).toBe(teststr.slice(2)); + }) + test(`split`, () => { + expect(str.split('')(teststr)[2]).toBe(`c`); + }) + test(`substring`, () => { + expect(str.substring(1, 2)(teststr)).toBe(`b`); + }) + test(`trim`, () => { + expect(str.trim(` ${teststr} `)).toBe(teststr); + }) + test(`trimEnd`, () => { + expect(str.trimEnd(` ${teststr} `)).toBe(` ${teststr}`); + }) + test(`trimStart`, () => { + expect(str.trimStart(` ${teststr} `)).toBe(`${teststr} `); + }) + test(`fromCharCode`, () => { + expect(str.fromCharCode(200)).toBe(`È`); + }) + test(`isempty`, () => { + expect(str.isempty('')).toBe(true); + expect(str.isempty('1')).toBe(false); + }) + test(`length`, () => { + expect(str.length(teststr)).toBe(teststr.length); + }) + test(`lowercase`, () => { + expect(str.lowercase('LOWER')).toBe(`lower`); + }) + test(`uppercase`, () => { + expect(str.uppercase('uppercase')).toBe(`UPPERCASE`); + }) +}) \ No newline at end of file diff --git a/src/applicative.ts b/src/applicative.ts index 9e15cbc..91e1bda 100644 --- a/src/applicative.ts +++ b/src/applicative.ts @@ -24,9 +24,30 @@ export type FnBase = (...args: any[]) => any; /** * A function which takes one argument + * @deprecated use FnUnary */ export type Fn1 = (arg: FnIn) => FnOut; +/** + * Primitives + */ +export type Primitives = string | number | object | symbol; + +/** + * Maps a primitive type method + */ +export type PrimitiveMethodMapper = (key: key) => (... args: T[key] extends (... args: infer Args) => any ? Args : never) => (arg: T) => T[key] extends (... args: any) => infer U ? U : never; + +//#region arity types + +export type FnNullary = () => T; +export type FnUnary = (arg: T) => U; +export type FnBinary = (arg1: T, arg2: U) => W; +export type FnTernary = (arg1: T, arg2: U, arg3: W) => Z; +export type FnNary = (... args: T) => U; + +//#endregion + /** * Binds a function to a null `this`, then returns it * diff --git a/src/index.ts b/src/index.ts index f11ea7a..c296ec3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,10 +17,12 @@ import * as filterables from "./filterables"; import * as foldables from "./foldables"; import * as mappables from "./mappables"; import * as maybe from "./maybe"; +import * as num from "./num"; import * as obj from "./obj"; import * as option from "./option"; import * as predicate from "./predicate"; import * as result from "./result"; +import * as str from "./str"; import * as unwrappables from "./unwrappables"; export { @@ -32,9 +34,11 @@ export { foldables, mappables, maybe, + num, obj, option, predicate, result, + str, unwrappables, }; diff --git a/src/num.ts b/src/num.ts new file mode 100644 index 0000000..8d4e7d5 --- /dev/null +++ b/src/num.ts @@ -0,0 +1,100 @@ +import { FnBinary, FnUnary, PrimitiveMethodMapper } from './applicative'; + +const map: PrimitiveMethodMapper = key => (...args) => value => (Number.prototype[key] as any).apply(value, args); + +//#region natives methods mapping + +/** + * Returns a string containing a number represented in exponential notation. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { num } from 'tiinvo'; + * ``` + */ +export const toExponential = map(`toExponential`); +/** + * Returns a string representing a number in fixed-point notation. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { num } from 'tiinvo'; + * ``` + */ +export const toFixed = map(`toFixed`); +/** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { num } from 'tiinvo'; + * ``` + */ +export const toPrecision = map(`toPrecision`); +/** + * Converts a numeric to a string type + * + * @since 2.10.0 + * @example + * + * ```ts + * import { num } from 'tiinvo'; + * ``` + */ +export const toString = map(`toString`); + +//#endregion + +//#region predicates + +export const equals = (comparator: number) => (arg: number) => arg === comparator; +export const greaterthan = (comparator: number) => (arg: number) => arg > comparator; +export const greaterequalthan = (comparator: number) => (arg: number) => arg >= comparator; +export const lessthan = (comparator: number) => (arg: number) => arg < comparator; +export const lessequalthan = (comparator: number) => (arg: number) => arg <= comparator; + +export const inrange = (min: number, max: number) => (arg: number) => min <= arg && max >= arg; +export const outofrange = (min: number, max: number) => (arg: number) => min > arg || max < arg; + +export const iseven = (arg: number) => arg % 2 === 0; +export const isodd = (arg: number) => arg % 2 !== 0; + +//#region + +//#region unary functions + +export type NumberUnaryFn = FnUnary>; + +export const uadd: NumberUnaryFn = a => b => a + b; +export const udivide: NumberUnaryFn = a => b => b / a; +export const umax: NumberUnaryFn = a => b => Math.max(a, b); +export const umin: NumberUnaryFn = a => b => Math.min(a, b); +export const umultiply: NumberUnaryFn = a => b => a * b; +export const upow: NumberUnaryFn = a => b => b ** a; +export const uremainder: NumberUnaryFn = a => b => b % a; +export const uroot: NumberUnaryFn = a => b => b ** (1 / a); +export const usubtract: NumberUnaryFn = a => b => b - a; + +//#endregion + +//#region binary functions + +export type NumberBinaryFn = FnBinary; + +export const badd: NumberBinaryFn = (a, b) => a + b; +export const bdivide: NumberBinaryFn = (a, b) => a / b; +export const bmultiply: NumberBinaryFn = (a, b) => a * b; +export const bmax: NumberBinaryFn = (a, b) => Math.max(a, b) +export const bmin: NumberBinaryFn = (a, b) => Math.min(a, b) +export const bpow: NumberBinaryFn = (a, b) => a ** b; +export const bremainder: NumberBinaryFn = (a, b) => a % b; +export const broot: NumberBinaryFn = (a, b) => a ** (1 / b); +export const bsubtract: NumberBinaryFn = (a, b) => a - b; + +//#endregion diff --git a/src/str.ts b/src/str.ts new file mode 100644 index 0000000..2e8f076 --- /dev/null +++ b/src/str.ts @@ -0,0 +1,318 @@ +import { PrimitiveMethodMapper } from './applicative'; + +const map: PrimitiveMethodMapper = key => (... args) => value => (String.prototype[key] as any).apply(value, args); + +//#region primitives mappings +/** + * Returns the character at the specified index. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * const sentence = 'The quick brown fox jumps over the lazy dog.'; + * const index = 4; + * + * str.charAt(index)(sentence) // "q" + * + * ``` + */ +export const charAt = map('charAt'); +/** + * Returns the Unicode value of the character at the specified location. + * + * @since 2.10.0 + * @example + */ +export const charCodeAt = map('charCodeAt'); +/** + * Returns a string that contains the concatenation of two or more strings. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.concat(`b`, `c`, `d`)(`abcd`) // true + * ``` + */ +export const concat = map('concat'); +/** + * Returns true if the sequence of elements of searchString converted to a String is the same as the corresponding elements of this object (converted to a String) starting at endPosition – length(this). Otherwise returns false. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.endsWith(`r`)(`foobar`) // true + * str.endsWith(`w`)(`hellow`) // true + * str.endsWith(`a`)(`foobar`) // false + * str.endsWith(`b`)(`hellow`) // false + * ``` + */ +export const endsWith = map('endsWith'); +/** + * Returns true if searchString appears as a substring of the result of converting this object to a String, at one or more positions that are greater than or equal to position; otherwise, returns false. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.includes(`foo`)(`foobar`) // true + * str.includes(`foo`)(`hellow`) // false + * ``` + */ +export const includes = map('includes'); +/** + * Returns the position of the first occurrence of a substring. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.indexOf(`b`)(`abcd`) // 1 + * ``` + */ +export const indexOf = map('indexOf'); +/** + * Returns the last occurrence of a substring in the string. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.lastIndexOf(`b`)(`abcdb`) // 1 + * ``` + */ +export const lastIndexOf = map('lastIndexOf'); +/** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * Differently from native implementation, it always returns an array + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.match(/abc/)(`abcd`) // [`abc`] + * ``` + */ +export const match = (regexp: RegExp) => (str: string): RegExpMatchArray => str.match(regexp) ?? []; +/** + * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.padEnd('-', 5)(`a`) // "a----" + * ``` + */ +export const padEnd = map('padEnd'); +/** + * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.padStart('-', 5)(`a`) // "----a" + * ``` + */ +export const padStart = map('padStart'); +/** + * Returns a String value that is made from count copies appended together. If count is 0, the empty string is returned. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.repeat(2)(`hello`) // "hellohello" + * ``` + */ +export const repeat = map('repeat'); +/** + * Replaces text in a string, using a regular expression or search string. + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.replace("goodbye cruel", "hello")("goodbye cruel world") // "hello world" + * ``` + */ +export const replace = (regexp: RegExp | string, replacewith: string | ((substring: string, ...args: any[]) => string)) => (str: string) => str.replace(regexp, replacewith as string); +/** + * Finds the first substring match in a regular expression search. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.search(/a/)("testa") // 4 + * ``` + */ +export const search = map('search'); +/** + * Returns a section of a string. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.slice(1, 2)('hello') // "e" + * ``` + */ +export const slice = map('slice'); +/** + * Split a string into substrings using the specified separator and return them as an array. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.split("-")("1970-01-01") // ["1970", "01", "01"] + * ``` + */ +export const split = (splitter: string | RegExp, limit?: number) => (str: string) => str.split(splitter, limit); +/** + * Returns the substring at the specified location within a String object. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.substringi(1, 2)("pizza") // "iz" + * ``` + */ +export const substringI = map('substr'); +/** + * Returns the substring at the specified location within a String object. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.substring(1, 2)("pizza") // "i" + * ``` + */ +export const substring = map('substring'); +/** + * Removes the leading and trailing white space and line terminator characters from a string. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.trim(` aaa `) // "aaa" + * ``` + */ +export const trim = map(`trim`)(); +/** + * Returns a copy with trailing whitespace removed. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.trimEnd(` aaa `) // " aaa" + * ``` + */ +export const trimEnd = map('trimEnd')(); +/** + * Returns a copy with leading whitespace removed. + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.trimStart(` aaa `) // "aaa " + * ``` + */ +export const trimStart = map('trimStart')(); + +//#endregion + +/** + * Returns a string created from the specified sequence of UTF-16 code units. + * + * @since 2.10.0 + * @example + */ +export const fromCharCode = (... args: number[]) => String.fromCharCode.apply('', args); +/** + * Returns if a string is empty + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.isempty(``) // true + * str.isempty(` `) // false + * ``` + */ +export const isempty = (arg: string) => arg.length === 0; +/** + * Returns a string length + * + * @since 2.10.0 + * @example + * + * ```ts + * import { str } from 'tiinvo'; + * + * str.length(`hello`) // 5 + * ``` + */ +export const length = (arg: string) => arg.length; +/** + * Returns a copy of a string in lower case + * + * @since 2.10.0 + * @example + */ +export const lowercase = (arg: string) => arg.toLowerCase(); +/** + * Returns a copy of a string in upper case + * + * @since 2.10.0 + * @example + */ +export const uppercase = (arg: string) => arg.toUpperCase();