Skip to content

Commit 78bc88c

Browse files
Merge pull request #29 from angular-package/4.1.x
4.1.4
2 parents dd4a6eb + 206f667 commit 78bc88c

File tree

9 files changed

+94
-813
lines changed

9 files changed

+94
-813
lines changed

.editorconfig

Lines changed: 0 additions & 16 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,3 @@ build
126126
dist
127127
graphics
128128
fonts
129-
130-
# Packages
131-
packages/change-detection
132-
packages/component-loader
133-
packages/core
134-
packages/property
135-
# packages/type

README.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,23 @@ import { are, guard, is, isNot } from '@angular-package/type';
102102

103103
```typescript
104104
// Types.
105-
import { Constructor, CycleHook, Defined, Func, Key, Primitive, Primitives, ResultCallback, Type, Types } from '@angular-package/type';
105+
import {
106+
AnyBoolean,
107+
AnyNumber,
108+
AnyString,
109+
Constructor,
110+
CycleHook,
111+
Defined,
112+
Func,
113+
Key,
114+
Never,
115+
NotUndefined,
116+
Primitive,
117+
Primitives,
118+
ResultCallback,
119+
Type,
120+
Types,
121+
} from '@angular-package/type';
106122
```
107123

108124
## Features
@@ -358,7 +374,10 @@ const is: Is = {
358374
Use `isArray()` or `is.array()` to check if **any** `value` is an [`Array`][array], [`Array`][array] instance, and `object` type.
359375

360376
```typescript
361-
const isArray: IsArray = <Type = any>(value: any, callback: ResultCallback = resultCallback): value is Array<Type> =>
377+
const isArray: IsArray = <Type = any>(
378+
value: any,
379+
callback: ResultCallback = resultCallback
380+
): value is Array<Type> =>
362381
callback(
363382
typeOf(value) === 'array' &&
364383
Array.isArray(value) === true &&
@@ -2009,14 +2028,16 @@ isNotBoolean(objectBoolean); // false; return type is `value is never`
20092028
Use `isNotDefined()` or `is.not.defined()` to check if a generic `Type` `value` is an `undefined` type and is equal to `undefined`.
20102029

20112030
```typescript
2012-
const isNotDefined: IsNotDefined =
2013-
<Type>(value: Type, callback: ResultCallback = resultCallback): value is Undefined<Type> =>
2014-
callback(
2015-
typeOf(value) === 'undefined' &&
2016-
typeof value === 'undefined' &&
2017-
value === undefined,
2018-
value
2019-
);
2031+
const isNotDefined: IsNotDefined = <Type>(
2032+
value: Type,
2033+
callback: ResultCallback = resultCallback
2034+
): value is Undefined<Type> =>
2035+
callback(
2036+
typeOf(value) === 'undefined' &&
2037+
typeof value === 'undefined' &&
2038+
value === undefined,
2039+
value
2040+
);
20202041
```
20212042

20222043
**Generic type variables:**
@@ -3343,23 +3364,23 @@ guardUndefined(5); // false; type error
33433364

33443365
### AnyBoolean
33453366

3346-
Represents `boolean` type or `Boolean` object.
3367+
Represents `boolean` type or [`Boolean`][boolean] object.
33473368

33483369
```typescript
33493370
type AnyBoolean = Exclude<boolean | Boolean, true | false>;
33503371
```
33513372

33523373
### AnyNumber
33533374

3354-
Represents `number` type or `Number` object.
3375+
Represents `number` type or [`Number`][number] object.
33553376

33563377
```typescript
33573378
type AnyNumber = number | Number;
33583379
```
33593380

33603381
### AnyString
33613382

3362-
Represents `string` type or `String` object.
3383+
Represents `string` type or [`String`][string] object.
33633384

33643385
```typescript
33653386
type AnyString = string | String;
@@ -3373,15 +3394,26 @@ type Constructor<Type> = new (...args: any[]) => Type;
33733394

33743395
### Defined
33753396

3397+
Indicate that `Type` variable is defined.
3398+
33763399
```typescript
33773400
type Defined<Type> = Never<undefined, Type>;
33783401
```
33793402

33803403
### CycleHook
33813404

3405+
Angular cycle hooks method names.
3406+
33823407
```typescript
3383-
type CycleHook = 'ngAfterContentInit' | 'ngAfterContentChecked' | 'ngAfterViewInit' | 'ngAfterViewChecked'
3384-
| 'ngAfterViewChecked' | 'ngOnInit' | 'ngOnDestroy' | 'ngOnChanges';
3408+
type CycleHook =
3409+
| 'ngAfterContentInit'
3410+
| 'ngAfterContentChecked'
3411+
| 'ngAfterViewInit'
3412+
| 'ngAfterViewChecked'
3413+
| 'ngAfterViewChecked'
3414+
| 'ngOnInit'
3415+
| 'ngOnDestroy'
3416+
| 'ngOnChanges';
33853417
```
33863418

33873419
### Func

0 commit comments

Comments
 (0)