Usage
const ovl = ovlconst func =
For the arguments, see the Example
section
Examples
1
{ return n === ~~n }const obj = a: 1 const f1 = // 1 {a: 1} 1 2 3 4 // 2 "abc" 2017-03-25T06:48:20.127Z [ 100, 200 ] // No matched function [1, 2] // 3 1 200 // 4 -10 -20 30 // No matched function [10, 20, 30]
2
const f2 = console// [ [ 1, 2 ], [ 3, 4, 5, 6 ] ] console// [ [ 1, 2, 3 ], [ 4, 5 ] ]
3
const f3 = // [ -100, 200, -100, 200] <-- before callback// 1 {a: 1} -100 200 -100 200 <-- matched function// 3 -100 200 <-- matched function// 4 -100 200 -100 <-- matched function// [ "NNNN", null, "IF", "XXX<1" ] <-- after callback// [ "NNNN", null, "IF", "XXX<1" ] <-- return value // [ 100, 200] <-- before callback// 3 100 200 <-- matched function// [ null, null, "IF", null ] <-- after callback// [ null, null, "IF", null ] <-- return value
4
const f4 = console// true console// true console// false console// true console// false
5
const f5 = // 1 1 true // 1 null true // 1 undefined true // 2 2020-12-30T15:00:00.000Z // 2 2020-12-30T15:00:00.000Z
Matching
type: ["number", "number"]
arguments: [1, 2]
result: yes
type: ["number", "string"]
arguments: [1, 2]
result: no
type: ["number"]
arguments: [1, 2]
result: yes
type: ["number", function(x){ return x === 2 }]
arguments: [1, 2]
result: yes
type: ["number", function(x){ return x === 1 }]
arguments: [1, 2]
result: no
type: ["number", "number?"]
arguments: [1, null]
result: yes
type: ["number", "number"]
arguments: [1, null]
result: no
type: ["number", "number|string"]
arguments: [1, 1]
result: yes
type: ["number", "number|string"]
arguments: [1, "a"]
result: yes
type: function(a, b){return a === 1 && b === 2}
arguments: [1, 2]
result: yes
type: {a: "number", b: "string"}
arguments: [{a: 1, b: "a"}]
result: yes
type: {a: "number", b: "string"}
arguments: [{a: 1, b: 2}]
result: no
Change log
1.0.2 fix readme
1.0.1 add readme and fix meta data