-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Expand file tree
/
Copy path_transition.js
More file actions
33 lines (33 loc) · 1.03 KB
/
_transition.js
File metadata and controls
33 lines (33 loc) · 1.03 KB
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
export function getTogglingfunction() {
if (arguments.length == 0) {
function inner(input) {
return !input;
}
return inner;
} else if (arguments.length != 1) {
var args = arguments;
function inner(input){
let all_arguments = Array.from(args);
all_arguments_length = all_arguments.length;
index = all_arguments.indexOf(input);
return all_arguments[(index + 1) % all_arguments_length];
}
return inner
} else if (arguments[0] instanceof Array){
args = arguments[0];
function inner(input){
let all_arguments = args;
all_arguments_length = all_arguments.length;
index = all_arguments.indexOf(input);
return all_arguments[(index + 1) % all_arguments_length];
}
return inner
} else {
obj = arguments[0];
function inner(input) {
inner_obj = obj;
return inner_obj[input];
}
return inner
}
}