function-overloader
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "function-overloader", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "improve overloading functions and methods in js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -151,4 +151,16 @@ # FUNCTION OVERLOADER | ||
Which accept description of arguments and return `Function Response` | ||
It is for describe when to run related `do` method. | ||
Return `Function Response` | ||
Accept multiple values that will descibe function. | ||
Possible values: | ||
* **"boolean"** | ||
* **"number"** | ||
* **"string"** | ||
* **"symbol"** | ||
* **"function"** | ||
* **"undefined"** | ||
* **Constructor function / class** to define that argument should be an instance of provided class / constructor. | ||
```javascript | ||
@@ -155,0 +167,0 @@ .done() |
@@ -14,2 +14,12 @@ import Overload from "./Overload"; | ||
expect(result).to.be.equal("correct result"); | ||
result = Overload.set(undefined, 12345) | ||
.when("number", "string") | ||
.do(() => "wrong result") | ||
.when("undefined", "number") | ||
.do(() => "correct result") | ||
.when("number", "object") | ||
.do(() => "wrong result") | ||
.done(); | ||
expect(result).to.be.equal("correct result"); | ||
}); | ||
@@ -16,0 +26,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68490
319
185