From c0268b20368209955f9fe1ad51ebe4884cd8e166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Aeebor=20Rudnicki?= Date: Fri, 25 Jun 2021 23:19:15 +0200 Subject: [PATCH 1/3] docs: fix documentation --- README.md | 31 ++++++++++++++++--------------- src/is/lib/is-regexp.func.ts | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1fc5bae1..348cc38a 100644 --- a/README.md +++ b/README.md @@ -159,16 +159,15 @@ Checks if **any** value is * an `object` with the [`Key`][key] by using the [`in`][js-in-operator] operator with [`isObjectKeyIn()`](#isobjectkeyin). * an `object` with some of its own specified [`Key`][key] with [`isObjectKeys()`](#isobjectkeys). * primitive of a [`Primitive`](#primitive) type with [`isPrimitive()`](#isprimitive). -* a regular expression of a `RegExp` type with [`isRegExp()`](#isregexp). +* a regular expression of a [`RegExp`][js-regexp] type with [`isRegExp()`](#isregexp). * a `string` with [`isString()`](#isstring). -* a `string` with the specified length with [`isStringLength`](#isstringlength). +* a `string` with the specified length with [`isStringLength()`](#isstringlength). * an `object` type and instance of [`String`][js-string] and [`Object`][js-object] with [`isStringObject()`](#isstringobject). * a `string` type and **not** instance of [`String`][js-string] and [`Object`][js-object] with [`isStringType()`](#isstringtype). * a `symbol` with [`isSymbol()`](#issymbol). * a `true` value with [`isTrue()`](#istrue). * a generic type instance, `function`, `object` or primitive type with [`isType()`](#istype). * `undefined` with [`isUndefined()`](#isundefined). -* a generic type value is * **not** * a `boolean` with [`isNotBoolean()`](#isnotboolean) * a `function` with [`isNotFunction()`](#isnotfunction) @@ -840,11 +839,11 @@ const isFalse: IsFalse = ( **Returns:** -| Returns | Type | Description | -| :--------------- | :-------: | :--------------------------------------------------------------------------------------------------- | -| `value is false` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is `false` | +| Returns | Type | Description | +| :--------------- | :-------: | :----------------------------------------------------------------------------------------------------------- | +| `value is false` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is equal to`false` | -The **return value** is a `boolean` indicating whether or not the `value` is a date. +The **return value** is a `boolean` indicating whether or not the `value` is a `boolean` equal to `false`. **Usage:** @@ -859,7 +858,7 @@ isFalse(true); // false; value is false ### `isFunction()` -Use `isFunction()` or `is.function()` to check if **any** `value` is a `function` type, an instance of [`Function`][js-function] and [`Object`][js-object]. It also **denies** with the regexp that function is a [`class`][ts-classes]. +Use `isFunction()` or `is.function()` to check if **any** `value` is a `function` type, an instance of [`Function`][js-function] and [`Object`][js-object]. It also **denies** with the [`RegExp`][js-regexp] that function is a [`class`][ts-classes]. ```typescript const isFunction: IsFunction = ( @@ -1106,7 +1105,7 @@ isNull(NUMBER); // false ![new][new] -Use `isNumberBetween()` or `is.numberBetween()` to check if **any** `value` is a `boolean` type **not** an instance of [`Boolean`][js-boolean] and [`Object`][js-object], or is an `object` type and instance of [`Boolean`][js-boolean] and [`Object`][js-object], and equal to `false`. +Use `isNumberBetween()` or `is.numberBetween()` to check if **any** `value` is a `number` type, not instance of [`Object`][js-object] and [`Number`][js-number] or `object` type and instance of [`Number`][js-number] and [`Object`][js-object], in the specified range. ```typescript const isNumberBetween = ( @@ -1884,7 +1883,7 @@ The **return value** is a `boolean` indicating whether or not the `value` is a ` ![new][new] -Use `isRegExp()` or `is.regexp()` to check if **any** `value` is a `regexp` type, an instance of `Object` and `RegExp`. +Use `isRegExp()` or `is.regexp()` to check if **any** `value` is a regular expression of a [`RegExp`][js-regexp] type, an instance of [`Object`][js-object] and [`RegExp`][js-regexp]. ```typescript const isRegExp: IsRegExp = ( @@ -1910,7 +1909,7 @@ const isRegExp: IsRegExp = ( | Returns | Type | Description | | :---------------- | :-------: | :---------------------------------------------------------------- | -| `value is RegExp` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is a regular expression of a `RegExp` type | +| `value is RegExp` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is a regular expression of a [`RegExp`][js-regexp] type | The **return value** is a `boolean` indicating whether or not the `value` is a regular expression. @@ -2162,9 +2161,9 @@ const isTrue: IsTrue = ( **Returns:** -| Returns | Type | Description | -| :--------------- | :-------: | :--------------------------------------------------------------------------------------------------- | -| `value is false` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is `true` | +| Returns | Type | Description | +| :-------------- | :-------: | :--------------------------------------------------------------------------------------------------- | +| `value is true` | `boolean` | The **return type** is a `boolean` as the result of its statement, indicating the `value` is `true` | The **return value** is a `boolean` indicating whether or not the `value` is a `boolean` equal to `true`. @@ -3765,7 +3764,7 @@ Callback function for `callback` parameter. type ResultCallback = (result: boolean, value?: any) => boolean; ``` -### StringOfLength +### StringLength ![new][new] @@ -4190,6 +4189,8 @@ MIT © angular-package ([license][property-badge-license]) [primitive]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive +[js-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp + [js-string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String [stringconstructor]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/String diff --git a/src/is/lib/is-regexp.func.ts b/src/is/lib/is-regexp.func.ts index acd95199..fbcf67dc 100644 --- a/src/is/lib/is-regexp.func.ts +++ b/src/is/lib/is-regexp.func.ts @@ -5,7 +5,7 @@ import { typeOf } from '../../lib/type-of.func'; import { IsRegExp } from '../type/is-regexp.type'; import { ResultCallback } from '../../type/result-callback.type'; /** - * Checks if any `value` is a `regexp` type, an instance of `Object` and `RegExp`. + * Checks if any `value` is a regular expression of a `RegExp` type, an instance of `Object` and `RegExp`. * @param value Any `value` to check. * @param callback An optional `ResultCallback` function to handle the result before returns. * @returns A `boolean` indicating whether or not the `value` is a regular expression. From 779737859c3a6e6d34f9d2d89d5a798ac6b3b02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Aeebor=20Rudnicki?= Date: Fri, 25 Jun 2021 23:21:26 +0200 Subject: [PATCH 2/3] docs(README.md): fix `StringOfLength` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 348cc38a..291a04cf 100644 --- a/README.md +++ b/README.md @@ -3764,7 +3764,7 @@ Callback function for `callback` parameter. type ResultCallback = (result: boolean, value?: any) => boolean; ``` -### StringLength +### StringOfLength ![new][new] From 0c0bfba97407d76b758182540a03e1aed2b6bde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Aeebor=20Rudnicki?= Date: Fri, 25 Jun 2021 23:28:21 +0200 Subject: [PATCH 3/3] chore(package): new keywords --- package.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package.json b/package.json index 336f81e5..8ec83ec0 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,31 @@ "bigint", "boolean", "check", + "class", + "date", "defined", "determine", + "false", "function", "guard", "instance", "key", "propertyKey", + "null", "number", + "number between", + "number object", + "number type", "object", "primitive", + "RegExp", "string", + "string length", + "string object", + "string type", "symbol", "undefined", + "true", "type", "types", "type guards",