-
Notifications
You must be signed in to change notification settings - Fork 5
/
explicit.js
41 lines (34 loc) · 833 Bytes
/
explicit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function P(target){
if(target == null)
return P.call.apply(P, arguments)
for(var i = 1; i < arguments.length; i++)
for(var key in arguments[i])
if(arguments[i].hasOwnProperty(key))
(arguments[i][key] === D)
? delete target[key]
: target[key] =
arguments[i][key] instanceof S
? arguments[i][key].apply(target[key])
: arguments[i][key]
return target
}
function S(closure){
if(!(this instanceof S))
return new S(closure)
this.apply = closure
}
function PS(target, input){
return new S(
arguments.length === 2
? function(definition){
return P(target, definition, input)
}
: function(definition){
return P(definition, target)
}
)
}
function D(){}
try {
module.exports = {P: P, S: S, PS: PS, D: D}
} catch(e) {}