From b6aa70f239ab69873f7e74a4b1ad84b5a891844d Mon Sep 17 00:00:00 2001 From: wizard04wsu Date: Sun, 29 Aug 2021 10:27:04 -0400 Subject: [PATCH 1/3] - update README --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0662ba9..8eefd6a 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,19 @@ Return value: The **Type** class extends the **String** class. In addition to storing a type name, its properties reveal whether the tested value was an object or a primitive. Syntax: -> `new Type(typeName, isPrimitive)` +> `new Type(typeName)` +> `new Type(typeName, objectType)` Parameters: - ***typeName*** - (string) -- ***objectType*** - (string) Optional. The object name used by `Object.prototype.toString()`. Pass this argument for object types only. +- ***objectType*** - (string) The object name used by `Object.prototype.toString()`. If `objectType` is truthy, the Type instance is considered to be for a type of object (not a primitive). | Property | Type | Description | | --- | --- | --- | -| .**type** | string | The type name. This is also the instance's primitive value. | -| .**objectType** | string | The object name used by `Object.prototype.toString()`.. | -| .**primitive** | string | If the `objectType` argument was falsy when constructed, this property was set to the type name. Otherwise, it's undefined. | -| .**object** | string | If the `objectType` argument was truthy when constructed, this property was set to the type name. Otherwise, it's undefined. | +| .**type** | string | The type name (`typeName`). This is also the instance's primitive value. | +| .**objectType** | string | The object name used by `Object.prototype.toString()`. | +| .**primitive** | string | For primitive types, this property is set to `typeName`. Otherwise, it's undefined. | +| .**object** | string | For object types (i.e., `objectType` is truthy), this property is set to `typeName`. Otherwise, it's undefined. | ### Example From e815afd851bb290b9dbf4203f9d6d9a507390244 Mon Sep 17 00:00:00 2001 From: wizard04wsu Date: Sun, 29 Aug 2021 10:27:57 -0400 Subject: [PATCH 2/3] - update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8eefd6a..1d3e6d9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Return value: The **Type** class extends the **String** class. In addition to storing a type name, its properties reveal whether the tested value was an object or a primitive. Syntax: -> `new Type(typeName)` +> `new Type(typeName)` > `new Type(typeName, objectType)` Parameters: From a82de6cc857d59b16033f201a5fb03fcf5c1d74d Mon Sep 17 00:00:00 2001 From: wizard04wsu Date: Sun, 29 Aug 2021 10:32:37 -0400 Subject: [PATCH 3/3] - update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d3e6d9..d29d9f5 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ Syntax: Parameters: - ***typeName*** - (string) -- ***objectType*** - (string) The object name used by `Object.prototype.toString()`. If `objectType` is truthy, the Type instance is considered to be for a type of object (not a primitive). +- ***objectType*** - (string) The object name used by `Object.prototype.toString()`. Include this for object types. Do not include this for primitive types. | Property | Type | Description | | --- | --- | --- | | .**type** | string | The type name (`typeName`). This is also the instance's primitive value. | | .**objectType** | string | The object name used by `Object.prototype.toString()`. | | .**primitive** | string | For primitive types, this property is set to `typeName`. Otherwise, it's undefined. | -| .**object** | string | For object types (i.e., `objectType` is truthy), this property is set to `typeName`. Otherwise, it's undefined. | +| .**object** | string | For object types, this property is set to `typeName`. Otherwise, it's undefined. | ### Example