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

overload2

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

overload2 - npm Package Versions

0.3.2

Diff

Changelog

Source

[0.3.2] - Sep 11th, 2020

  • 支持数量符号 ?
youngoat
published 0.3.1 •

Changelog

Source

[0.3.1] - Mar 2nd, 2018

  • Fixed 2 bugs on processing optional parameters, absent value may be regarded as arguments and taken to match the following parameters.
    这个问题出现在可选参数的“让贤匹配”过程中,由于缺省值上位后未及时终止匹配,导致缺省值被当作实参继续“让贤匹配”流程,最终结果变得不可预测。
    上一个版本标注为 RISKY 真是一语成谶!
youngoat
published 0.3.0 •

Changelog

Source

[0.3.0] - Feb 23th, 2018, RISKY

New

  • Optional parameter avaiable.

Fixed

  • Bugs hiding in mutable parameters.
youngoat
published 0.2.1 •

Changelog

Source

[0.2.1] - Nov, 2017

Fixed

  • In the previous version, if argument is valued with null / undefined and param is not defined with NULL / UNDEFINED, overload2 will conclude that the argument and the param are not matching, even if the param's datatype accepts null / undefined. It is really ambiguous and has been corrected in this version.
youngoat
published 0.2.0 •

Changelog

Source

[0.2.0] - 2017-06, Mutable Param

What's New?

Since this section, programmers are allowed to use mutable param. E.g.

overload2()
	.overload('+', Function, function(/*Array*/ data, callback) {
		// ...
	})
	.overload(Error, '*', function(err, /*Array*/ rest) {
		// ...
	})

For more details, see the testcase named mutable.js.

ATTENTION: Before, '*' is alias of overload2.Type.ANY. And now, it is mapped to any number of arguments of any type.

Fixed

Next bugs have been fixed in this version:

  • Failed to run the default method when no predefined paramlist matched.

    In previous version, TypeError: Cannot read property 'apply' of undefined will be thrown when overload2 tries to execute the default method.

youngoat
published 0.1.0 •

Changelog

Source

[0.1.0] - 2017-06

Functions Added

  • overload2.Type.and()
  • overload2.Type.or()
  • overload2.Type.not()

Changed

Predefined datatypes are moved from overload2.* to overload2.Type.*.

youngoat
published 0.0.5 •

Changelog

Source

[0.0.5] - 2017-05

No material changes, but TRAVIS-CI and COVERALLS integrated.

youngoat
published 0.0.4 •

Changelog

Source

[0.0.4] - 2017-05

Usage in browsers supported since this version. Three ways to import the package(module):

  • as CommonJS
    e.g. in Node.js runtime

  • as AMD (Asynchronous Module Definition)
    e.g. RequireJS

  • directly exposed in global context

REFERENCE

youngoat
published 0.0.3 •

Changelog

Source

[0.0.3] - 2017-05

overload2() will create a new overloaded function. Before, in v0.0.2, the overloaded function may be appended with an implementation meanwhile being created, if overload2() is called with arguments. This pattern is not only ambiguous, but also restrict the future expandability of overload2 (arguments passed to overload2() SHOULD be used to define attributes concerned with overloading, instead of specific implementation). So, since this version, overload2() will return an overloaded function WITHOUT ANY IMPLEMENTATION. And programmers must implement it by calling .overload() method.

youngoat
published 0.0.2 •

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