Skip to content

Commit 5fe8440

Browse files
Merge pull request #7 from angular-package/3.2.x
3.2.4
2 parents decb691 + a8cb03d commit 5fe8440

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ import { Constructor, CycleHook, Func, Key, Primitive, Primitives, ResultCallbac
105105
* a `boolean` type not an instance of [`Boolean`][boolean] and [`Object`][object], and equal to `true` or `false` with [`isBooleanType()`](#isbooleantype).
106106
* a `function` with [`isFunction()`](#isfunction).
107107
* a generic type `instance` with [`isInstance()`](#isinstance).
108-
* a [`Key`](#key) type with [`isKey()`](#iskey).
108+
* a [`Key`][key] type with [`isKey()`](#iskey).
109109
* a `null` with [`isNull()`](#isnull).
110110
* a `number` with [`isNumber()`](#isnumber).
111111
* an `object` type and instance of [`Number`][Number] and [`Object`][object] with [`isNumberObject()`](#isnumberobject).
112112
* a `number` type and **not** instance of [`Number`][Number] and [`Object`][object] with [`isNumberType()`](#isnumbertype).
113113
* a generic type `object` with [`isObject()`](#isobject).
114-
* an `object` with its own specified [`Key`](#key) with [`isObjectKey()`](#isobjectkey).
114+
* an `object` with its own specified [`Key`][key] with [`isObjectKey()`](#isobjectkey).
115115
* a one of the primitive `boolean`, `bigint`, `number`, `string` with [`isPrimitive()`](#isPrimitive).
116116
* a `string` with [`isString()`](#isstring).
117117
* an `object` type and instance of [`String`][string] and [`Object`][object] with [`isStringObject()`](#isstringobject).
@@ -135,7 +135,7 @@ import { Constructor, CycleHook, Func, Key, Primitive, Primitives, ResultCallbac
135135
* a [`Func`](#func) type with [`guardFunction()`](#guardfunction).
136136
* an instance with [`guardInstance()`](#guardinstance).
137137
* a `null` with [`guardNull()`](#guardnull).
138-
* a [`Key`](#key) with [`guardKey()`](#guardkey).
138+
* a [`Key`][key] with [`guardKey()`](#guardkey).
139139
* a `number` with [`guardNumber()`](#guardnumber).
140140
* an `object` of a generic type with [`guardObject()`](#guardobject).
141141
* an `object` of a generic type that contains `key` with [`guardObjectKey()`](#guardobjectkey).
@@ -549,7 +549,7 @@ const isKey: IsKey = (value: any, callback: ResultCallback = resultCallback): va
549549
| value | `any` | Any `value` to check |
550550
| callback | [`ResultCallback`][resultcallback]=[`resultCallback`][callback] | [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
551551

552-
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`](#key).
552+
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`][key].
553553

554554
```typescript
555555
// Example usage
@@ -740,7 +740,7 @@ const isObject: IsObject = <Obj = object>(value: any, key?: Key): value is Obj =
740740
| Parameter | Type | Description |
741741
| :-------- | :-----------: | :---------- |
742742
| value | `any` | Any `value` to check |
743-
| key? | [`Key`](#key) | Property name to find in the `value` |
743+
| key? | [`Key`][key] | Property name to find in the `value` |
744744

745745
The **return value** is a `boolean` indicating whether or not the `value` is an `object`.
746746

@@ -826,7 +826,7 @@ isObject(OBJECT_ONE, SYMBOL_STRING); // true
826826

827827
### isObjectKey
828828

829-
Use `isObject()` or `is.object()` to check if **any** `value` is an `object` with its own specified keys of the [`Key`](#key).
829+
Use `isObject()` or `is.object()` to check if **any** `value` is an `object` with its own specified keys of the [`Key`][key].
830830

831831
```typescript
832832
const isObjectKey: IsObjectKey = <Type extends object>(
@@ -848,7 +848,7 @@ const isObjectKey: IsObjectKey = <Type extends object>(
848848
| Parameter | Type | Description |
849849
| :-------- | :------------------------------: | :---------------------------------------------------- |
850850
| value | `any` | Any `value` to check if it contains a specified `key` |
851-
| key | [`Key`](#key) \| [`Key`](#key)[] | A [`Key`](#key) type or an array of [`Key`](#key) type to check in the `value` |
851+
| key | [`Key`][key] \| [`Key`][key][] | A [`Key`][key] type or an array of [`Key`][key] type to check in the `value` |
852852
| callback | [`ResultCallback`][resultcallback]=[`resultCallback`][callback] | [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
853853

854854
The **return value** is a `boolean` indicating whether or not the `value` is an `object` with its own specified keys.
@@ -1315,10 +1315,10 @@ const guardKey: GuardKey = (value: Key, callback?: ResultCallback): value is Key
13151315

13161316
| Parameter | Type | Description |
13171317
| :-------- | :---------------------------------: | :------------------------------------ |
1318-
| value | [`Key`](#key) | A [`Key`](#key) type `value` to guard |
1318+
| value | [`Key`][key] | A [`Key`][key] type `value` to guard |
13191319
| callback? | [`ResultCallback`][resultcallback] | Optional [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
13201320

1321-
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`](#key).
1321+
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`][key].
13221322

13231323
----
13241324

@@ -1380,7 +1380,7 @@ The **return value** is a `boolean` indicating whether or not the `value` is an
13801380

13811381
### guardObjectKey
13821382

1383-
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key` property of the [`Key`](#key) type.
1383+
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key` property of the [`Key`][key] type.
13841384

13851385
```typescript
13861386
const guardObjectKey: GuardObjectKey = <Obj extends object, Key extends keyof Obj>(value: Obj, key: Key): value is Obj =>
@@ -1843,6 +1843,7 @@ MIT © angular-package ([license](https://github.com/angular-package/type/blob/m
18431843

18441844
[callback]: #callback
18451845
[resultcallback]: #resultcallback
1846+
[key]: #key
18461847

18471848
[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
18481849

packages/type/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ import { Constructor, CycleHook, Func, Key, Primitive, Primitives, ResultCallbac
105105
* a `boolean` type not an instance of [`Boolean`][boolean] and [`Object`][object], and equal to `true` or `false` with [`isBooleanType()`](#isbooleantype).
106106
* a `function` with [`isFunction()`](#isfunction).
107107
* a generic type `instance` with [`isInstance()`](#isinstance).
108-
* a [`Key`](#Key) type with [`isKey()`](#iskey).
108+
* a [`Key`][key] type with [`isKey()`](#iskey).
109109
* a `null` with [`isNull()`](#isnull).
110110
* a `number` with [`isNumber()`](#isnumber).
111111
* an `object` type and instance of [`Number`][Number] and [`Object`][object] with [`isNumberObject()`](#isnumberobject).
112112
* a `number` type and **not** instance of [`Number`][Number] and [`Object`][object] with [`isNumberType()`](#isnumbertype).
113113
* a generic type `object` with [`isObject()`](#isobject).
114-
* an `object` with its own specified [`Key`](#Key) with [`isObjectKey()`](#isobjectkey).
114+
* an `object` with its own specified [`Key`][key] with [`isObjectKey()`](#isobjectkey).
115115
* a one of the primitive `boolean`, `bigint`, `number`, `string` with [`isPrimitive()`](#isPrimitive).
116116
* a `string` with [`isString()`](#isstring).
117117
* an `object` type and instance of [`String`][string] and [`Object`][object] with [`isStringObject()`](#isstringobject).
@@ -135,7 +135,7 @@ import { Constructor, CycleHook, Func, Key, Primitive, Primitives, ResultCallbac
135135
* a [`Func`](#func) type with [`guardFunction()`](#guardfunction).
136136
* an instance with [`guardInstance()`](#guardinstance).
137137
* a `null` with [`guardNull()`](#guardnull).
138-
* a [`Key`](#Key) with [`guardKey()`](#guardkey).
138+
* a [`Key`][key] with [`guardKey()`](#guardkey).
139139
* a `number` with [`guardNumber()`](#guardnumber).
140140
* an `object` of a generic type with [`guardObject()`](#guardobject).
141141
* an `object` of a generic type that contains `key` with [`guardObjectKey()`](#guardobjectkey).
@@ -258,7 +258,7 @@ const is: Is = {
258258
defined: isDefined,
259259
function: isFunction,
260260
instance: isInstance,
261-
key: isKey,
261+
key: iskey,
262262
not: isNot,
263263
null: isNull,
264264
number: isNumber,
@@ -493,7 +493,7 @@ isFunction(() => 5); // true
493493

494494
### isInstance
495495

496-
Use `isInstance()` or `is.instance()` to check if **any** value is an `object` of a generic `Obj` type equal to an `instance` of [`Constructor`](#Constructor) type.
496+
Use `isInstance()` or `is.instance()` to check if **any** value is an `object` of a generic `Obj` type equal to an `instance` of [`Constructor`](#constructor) type.
497497

498498
```typescript
499499
const isInstance: IsInstance = <Obj>(
@@ -513,7 +513,7 @@ const isInstance: IsInstance = <Obj>(
513513
| Parameter | Type | Description |
514514
| :-------- | :--------------------------------: | :---------- |
515515
| value | `any` | Any `value` to compare with the `instance` |
516-
| instance | [`Constructor<Obj>`](#Constructor) | A generic `Obj` [`Constructor`](#Constructor) type to create an `instance` to compare with the `value` |
516+
| instance | [`Constructor<Obj>`](#constructor) | A generic `Obj` [`Constructor`](#constructor) type to create an `instance` to compare with the `value` |
517517
| callback | [`ResultCallback`][resultcallback]=[`resultCallback`][callback] | [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
518518

519519
The **return value** is a `boolean` indicating whether or not the `value` is an `instance` of a generic `Obj`.
@@ -549,7 +549,7 @@ const isKey: IsKey = (value: any, callback: ResultCallback = resultCallback): va
549549
| value | `any` | Any `value` to check |
550550
| callback | [`ResultCallback`][resultcallback]=[`resultCallback`][callback] | [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
551551

552-
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`](#Key).
552+
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`][key].
553553

554554
```typescript
555555
// Example usage
@@ -740,7 +740,7 @@ const isObject: IsObject = <Obj = object>(value: any, key?: Key): value is Obj =
740740
| Parameter | Type | Description |
741741
| :-------- | :-----------: | :---------- |
742742
| value | `any` | Any `value` to check |
743-
| key? | [`Key`](#Key) | Property name to find in the `value` |
743+
| key? | [`Key`][key] | Property name to find in the `value` |
744744

745745
The **return value** is a `boolean` indicating whether or not the `value` is an `object`.
746746

@@ -826,7 +826,7 @@ isObject(OBJECT_ONE, SYMBOL_STRING); // true
826826

827827
### isObjectKey
828828

829-
Use `isObject()` or `is.object()` to check if **any** `value` is an `object` with its own specified keys of the [`Key`](#Key).
829+
Use `isObject()` or `is.object()` to check if **any** `value` is an `object` with its own specified keys of the [`Key`][key].
830830

831831
```typescript
832832
const isObjectKey: IsObjectKey = <Type extends object>(
@@ -848,7 +848,7 @@ const isObjectKey: IsObjectKey = <Type extends object>(
848848
| Parameter | Type | Description |
849849
| :-------- | :------------------------------: | :---------------------------------------------------- |
850850
| value | `any` | Any `value` to check if it contains a specified `key` |
851-
| key | [`Key`](#key) \| [`Key`](#Key)[] | A [`Key`](#Key) type or an array of [`Key`](#Key) type to check in the `value` |
851+
| key | [`Key`][key] \| [`Key`][key][] | A [`Key`][key] type or an array of [`Key`][key] type to check in the `value` |
852852
| callback | [`ResultCallback`][resultcallback]=[`resultCallback`][callback] | [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
853853

854854
The **return value** is a `boolean` indicating whether or not the `value` is an `object` with its own specified keys.
@@ -1267,7 +1267,7 @@ The **return value** is a `boolean` indicating whether or not the `value` is a `
12671267

12681268
### guardFunction
12691269

1270-
Use `guardFunction()` or `guard.is.function()` to guard the `value` to be a [`Func`](#Func) type.
1270+
Use `guardFunction()` or `guard.is.function()` to guard the `value` to be a [`Func`](#func) type.
12711271

12721272
```typescript
12731273
const guardFunction: GuardFunction = (value: Func, callback?: ResultCallback): value is Func =>
@@ -1276,18 +1276,18 @@ const guardFunction: GuardFunction = (value: Func, callback?: ResultCallback): v
12761276

12771277
| Parameter | Type | Description |
12781278
| :-------- | :---------------------------------: | :-------------------------------------- |
1279-
| value | [`Func`](#Func) | A [`Func`](#Func) type `value` to guard |
1279+
| value | [`Func`](#func) | A [`Func`](#func) type `value` to guard |
12801280
| callback? | [`ResultCallback`][resultcallback] | Optional [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
12811281

1282-
The return value is a `boolean` indicating whether or not the `value` is a [`Func`](#Func).
1282+
The return value is a `boolean` indicating whether or not the `value` is a [`Func`](#func).
12831283

12841284
[Example usage on playground][guard-function]
12851285

12861286
----
12871287

12881288
### guardInstance
12891289

1290-
Use `guardInstance()` or `guard.is.instance()` to guard the `value` to be an `object` of a generic `Obj` type equal to an `instance` of [`Constructor`](#Constructor) type.
1290+
Use `guardInstance()` or `guard.is.instance()` to guard the `value` to be an `object` of a generic `Obj` type equal to an `instance` of [`Constructor`](#constructor) type.
12911291

12921292
```typescript
12931293
const guardInstance: GuardInstance = <Obj>(value: Obj, instance: Constructor<Obj>, callback?: ResultCallback): value is Obj =>
@@ -1297,7 +1297,7 @@ const guardInstance: GuardInstance = <Obj>(value: Obj, instance: Constructor<Obj
12971297
| Parameter | Type | Description |
12981298
| :-------- | :---------------------------------: | :--------------------------------------------------- |
12991299
| value | `Obj` | An `Obj` type `value` to compare with the `instance` |
1300-
| instance | [`Constructor<Obj>`](#Constructor) | A generic `Obj` [`Constructor`](#Constructor) type to create an `instance` to compare with the `value` |
1300+
| instance | [`Constructor<Obj>`](#constructor) | A generic `Obj` [`Constructor`](#constructor) type to create an `instance` to compare with the `value` |
13011301
| callback? | [`ResultCallback`][resultcallback] | Optional [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
13021302

13031303
The **return value** is a `boolean` indicating whether or not the `value` is an `instance` of a generic `Obj`.
@@ -1315,10 +1315,10 @@ const guardKey: GuardKey = (value: Key, callback?: ResultCallback): value is Key
13151315

13161316
| Parameter | Type | Description |
13171317
| :-------- | :---------------------------------: | :------------------------------------ |
1318-
| value | [`Key`](#Key) | A [`Key`](#Key) type `value` to guard |
1318+
| value | [`Key`][key] | A [`Key`][key] type `value` to guard |
13191319
| callback? | [`ResultCallback`][resultcallback] | Optional [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error` |
13201320

1321-
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`](#Key).
1321+
The **return value** is a `boolean` indicating whether or not the `value` is a [`Key`][key].
13221322

13231323
----
13241324

@@ -1380,7 +1380,7 @@ The **return value** is a `boolean` indicating whether or not the `value` is an
13801380

13811381
### guardObjectKey
13821382

1383-
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key` property of the [`Key`](#Key) type.
1383+
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key` property of the [`Key`][key] type.
13841384

13851385
```typescript
13861386
const guardObjectKey: GuardObjectKey = <Obj extends object, Key extends keyof Obj>(value: Obj, key: Key): value is Obj =>
@@ -1843,6 +1843,7 @@ MIT © angular-package ([license](https://github.com/angular-package/type/blob/m
18431843

18441844
[callback]: #callback
18451845
[resultcallback]: #resultcallback
1846+
[key]: #key
18461847

18471848
[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
18481849

packages/type/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/type/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-package/type",
3-
"version": "3.2.3",
3+
"version": "3.2.4",
44
"description": "Common types, type guards and type checkers.",
55
"author": "Angular Package <[email protected]> (https://wvvw.dev)",
66
"homepage": "https://github.com/angular-package/type#readme",

0 commit comments

Comments
 (0)