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

genfun

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genfun - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

22

lib/genfun.js

@@ -49,2 +49,3 @@ 'use strict';

fun.rm = removeMethod;
fun.hasMethod = hasMethod;
fun.callNextMethod = Genfun.callNextMethod;

@@ -108,2 +109,19 @@ fun.getContext = Genfun.getContext;

/**
* Returns true if there are methods that apply to the given arguments on
* `genfun`. Additionally, makes sure the cache is warmed up for the given
* arguments.
*
*/
function hasMethod() {
var genfun = typeof this === 'function' && this.genfun ? this.genfun : this;
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var methods = getApplicableMethods(genfun, args || []);
return !!(methods && methods.length);
}
/**
* This generic function is called when `genfun` has been called and no

@@ -175,4 +193,4 @@ * applicable method was found. The default method throws an `Error`.

if (this.hasNextMethod()) {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}

@@ -179,0 +197,0 @@

2

package.json

@@ -25,3 +25,3 @@ {

"main": "lib/genfun.js",
"version": "3.1.0",
"version": "3.2.0",
"license": "CC0-1.0",

@@ -28,0 +28,0 @@ "files": [

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