Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

function-overloader

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-overloader - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc