Skip to content

Commit 58cd294

Browse files
Merge pull request #30 from angular-package/4.2.x
4.2.0
2 parents 78bc88c + c799fae commit 58cd294

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1802
-434
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,8 @@ build
126126
dist
127127
graphics
128128
fonts
129+
*.ignore*
130+
131+
# demos
132+
demo
133+

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
# Change Log
3+
4+
All notable changes to this project will be documented in this file.
5+
6+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
7+
and this project adheres to [Semantic Versioning](http://semver.org/).
8+
9+
## [4.2.0] - 2021-06-25
10+
11+
### Added
12+
13+
- [`a6b567f`](https://github.com/angular-package/type/commit/a6b567f32a00726d2b7ecf38ce7a57a42366aaf6)
14+
New `NumberBetween` and `StringOfLength` type.
15+
16+
- [`21f3f48`](https://github.com/angular-package/type/commit/21f3f48029d79e1dfd4507d3a684ec1e81e44713)
17+
New functions `isDate()`, `isFalse()`, `isNumberBetween()`, `isRegExp()`, `isStringLength()`, `isTrue()` with tests and types.
18+
19+
- [`7d4cda7`](https://github.com/angular-package/type/commit/7d4cda7d3c91fca89a35baed6c1db9cd35070f4e)
20+
This `CHANGELOG.md`.
21+
22+
### Changed
23+
24+
- [`e70b034`](https://github.com/angular-package/type/commit/e70b034934b81b3af6ab1976153cbbad8c148f78)
25+
All types description in the `README.md`.
26+
27+
- [`61e9376`](https://github.com/angular-package/type/commit/61e93766fab7d72cafa70da712f296c6ca6e9304)
28+
Add possibility to use `is` prefixed functions directly from the `guard` eg. `guard.array()`.
29+
30+
### Fixed

README.md

Lines changed: 755 additions & 403 deletions
Large diffs are not rendered by default.

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.

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": "4.1.4",
3+
"version": "4.2.0",
44
"description": "Common types, type guards and type checkers.",
55
"author": "Angular Package <angular-package@wvvw.dev> (https://wvvw.dev)",
66
"homepage": "https://github.com/angular-package/type#readme",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { GuardIs } from './guard-is.interface';
2-
export interface Guard {
2+
export interface Guard extends GuardIs {
33
is: GuardIs;
44
}

src/guard/interface/guard-is.interface.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Import: Type.
12
import { GuardArray } from '../type/guard-array.type';
23
import { GuardBigInt } from '../type/guard-big-int.type';
34
import { GuardBoolean } from '../type/guard-boolean.type';
@@ -16,7 +17,7 @@ import { GuardInstance } from '../type/guard-instance.type';
1617
import { GuardNull } from '../type/guard-null.type';
1718
import { GuardSymbol } from '../type/guard-symbol.type';
1819
import { GuardUndefined } from '../type/guard-undefined.type';
19-
20+
// Export: Interface.
2021
export interface GuardIs {
2122
array: GuardArray;
2223
bigint: GuardBigInt;
@@ -30,7 +31,7 @@ export interface GuardIs {
3031
number: GuardNumber;
3132
object: GuardObject;
3233
objectKey: GuardObjectKey;
33-
objectKeys: GuardObjectKeys,
34+
objectKeys: GuardObjectKeys;
3435
primitive: GuardPrimitive;
3536
string: GuardString;
3637
symbol: GuardSymbol;

src/guard/lib/guard.object.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// Object.
1+
// Import: Object.
22
import { guardIs } from './guard-is.object';
3-
// Interface.
3+
// Import: Interface.
44
import { Guard } from '../interface/guard-interface';
5-
// `guard`
6-
export const guard: Guard = {
7-
is: guardIs
8-
};
5+
// Export: `guard`
6+
export const guard: Guard = { ...guardIs, is: guardIs };

src/is/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,29 @@ export { isBoolean } from './lib/is-boolean.func';
55
export { isBooleanObject } from './lib/is-boolean-object.func';
66
export { isBooleanType } from './lib/is-boolean-type.func';
77
export { isClass } from './lib/is-class.func';
8+
export { isDate } from './lib/is-date.func'; // From 4.2.0
89
export { isDefined } from './lib/is-defined.func';
10+
export { isFalse } from './lib/is-false.func'; // From 4.2.0
911
export { isFunction } from './lib/is-function.func';
1012
export { isInstance } from './lib/is-instance.func';
1113
export { isKey } from './lib/is-key.func';
1214
export { isNull } from './lib/is-null.func';
1315
export { isNumber } from './lib/is-number.func';
16+
export { isNumberBetween } from './lib/is-number-between.func'; // From 4.2.0
1417
export { isNumberObject } from './lib/is-number-object.func';
1518
export { isNumberType } from './lib/is-number-type.func';
1619
export { isObject } from './lib/is-object.func';
1720
export { isObjectKey } from './lib/is-object-key.func';
1821
export { isObjectKeyIn } from './lib/is-object-key-in.func';
1922
export { isObjectKeys } from './lib/is-object-keys.func';
2023
export { isPrimitive } from './lib/is-primitive.func';
24+
export { isRegExp } from './lib/is-regexp.func'; // From 4.2.0
2125
export { isString } from './lib/is-string.func';
26+
export { isStringLength } from './lib/is-string-length.func'; // From 4.2.0
2227
export { isStringObject } from './lib/is-string-object.func';
2328
export { isStringType } from './lib/is-string-type.func';
2429
export { isSymbol } from './lib/is-symbol.func';
30+
export { isTrue } from './lib/is-true.func'; // From 4.2.0
2531
export { isType } from './lib/is-type.func';
2632
export { isUndefined } from './lib/is-undefined.func';
2733
// `is` object.

src/is/interface/is.interface.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
1+
// Import: Type.
12
import { IsArray } from '../type/is-array.type';
23
import { IsBigInt } from '../type/is-big-int.type';
34
import { IsBoolean } from '../type/is-boolean.type';
45
import { IsBooleanObject } from '../type/is-boolean-object.type';
56
import { IsBooleanType } from '../type/is-boolean-type.type';
67
import { IsClass } from '../type/is-class.type';
8+
import { IsDate } from '../type/is-date.type';
79
import { IsDefined } from '../type/is-defined.type';
10+
import { IsFalse } from '../type/is-false.type';
811
import { IsFunction } from '../type/is-function.type';
912
import { IsInstance } from '../type/is-instance.type';
1013
import { IsKey } from '../type/is-key.type';
1114
import { IsNot } from '../not/interface/is-not.interface';
1215
import { IsNull } from '../type/is-null.type';
1316
import { IsNumber } from '../type/is-number.type';
17+
import { IsNumberBetween } from '../type/is-number-between.type';
1418
import { IsNumberObject } from '../type/is-number-object.type';
1519
import { IsNumberType } from '../type/is-number-type.type';
1620
import { IsObject } from '../type/is-object.type';
1721
import { IsObjectKey } from '../type/is-object-key.type';
1822
import { IsObjectKeyIn } from '../type/is-object-key-in.type';
1923
import { IsObjectKeys } from '../type/is-object-keys.type';
2024
import { IsPrimitive } from '../type/is-primitive.type';
25+
import { IsRegExp } from '../type/is-regexp.type';
2126
import { IsString } from '../type/is-string.type';
27+
import { IsStringLength } from '../type/is-string-length.type';
2228
import { IsStringObject } from '../type/is-string-object.type';
2329
import { IsStringType } from '../type/is-string-type.type';
2430
import { IsSymbol } from '../type/is-symbol.type';
31+
import { IsTrue } from '../type/is-true.type';
2532
import { IsType } from '../type/is-type.type';
2633
import { IsUndefined } from '../type/is-undefined.type';
2734
/**
35+
* Export: Interface.
2836
* Object with prefixed `is` functions.
2937
*/
3038
export interface Is {
@@ -35,24 +43,30 @@ export interface Is {
3543
booleanObject: IsBooleanObject;
3644
booleanType: IsBooleanType;
3745
class: IsClass;
46+
date: IsDate; // From 4.2.0
3847
defined: IsDefined;
48+
false: IsFalse; // From `4.2.0`
3949
function: IsFunction;
4050
instance: IsInstance;
4151
key: IsKey;
4252
not: IsNot;
4353
null: IsNull;
4454
number: IsNumber;
55+
numberBetween: IsNumberBetween; // From `4.2.0`
4556
numberObject: IsNumberObject;
4657
numberType: IsNumberType;
4758
object: IsObject;
4859
objectKey: IsObjectKey;
4960
objectKeyIn: IsObjectKeyIn;
5061
objectKeys: IsObjectKeys;
5162
primitive: IsPrimitive;
63+
regexp: IsRegExp; // From 4.2.0
5264
string: IsString;
65+
stringLength: IsStringLength;
5366
stringObject: IsStringObject;
5467
stringType: IsStringType;
5568
symbol: IsSymbol;
69+
true: IsTrue; // From 4.2.0
5670
type: IsType;
5771
undefined: IsUndefined;
5872
}

0 commit comments

Comments
 (0)