-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcommon.js
More file actions
81 lines (65 loc) · 1.87 KB
/
common.js
File metadata and controls
81 lines (65 loc) · 1.87 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Generated by CoffeeScript 1.10.0
(function() {
var Combiner, Common;
Combiner = require('./combiner');
Common = (function() {
function Common() {}
Common.prototype.combine = function(type, other) {
switch (type) {
case 'add':
case 'plus':
return Combiner.add(this, other);
case 'sub':
case 'subtract':
case 'minus':
return Combiner.subtract(this, other);
case 'mul':
case 'multiply':
case 'times':
return Combiner.multiply(this, other);
case 'div':
case 'divide':
return Combiner.divide(this, other);
case 'exp':
case 'exponent':
case 'pow':
case 'power':
return Combiner.exponent(this, other);
case 'mod':
case 'modulo':
case 'rem':
case 'remainder':
return Combiner.modulo(this, other);
case 'mix':
return Combiner.mix(this, other);
default:
return raise("Invalid combiner type " + type);
}
};
Common.prototype.add = function(other) {
return this.combine('add', other);
};
Common.prototype.subtract = function(other) {
return this.combine('sub', other);
};
Common.prototype.divide = function(other) {
return this.combine('div', other);
};
Common.prototype.multiply = function(other) {
return this.combine('mul', other);
};
Common.prototype.exponent = function(other) {
return this.combine('exp', other);
};
Common.prototype.modulo = function(other) {
return this.combine('mod', other);
};
Common.prototype.mix = function(other) {
return this.combine('mix', other);
};
return Common;
})();
module.exports = Common;
Combiner.prototype.__proto__ = Common.prototype;
}).call(this);
//# sourceMappingURL=common.js.map