@lijuhong1981/jsmath 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/src/Interval.js +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijuhong1981/jsmath",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "> TODO: description",
5
5
  "author": "lijuhong1981",
6
6
  "homepage": "https://github.com/lijuhong1981/jslibs#readme",
@@ -17,5 +17,6 @@
17
17
  },
18
18
  "bugs": {
19
19
  "url": "https://github.com/lijuhong1981/jslibs/issues"
20
- }
20
+ },
21
+ "gitHead": "851e45e302941f84a40e102f847bda053a8e8fbe"
21
22
  }
package/src/Interval.js CHANGED
@@ -53,6 +53,22 @@ class Interval {
53
53
  return this.end - this.start;
54
54
  }
55
55
 
56
+ set minimum(value) {
57
+ this.start = value;
58
+ }
59
+
60
+ get minimum() {
61
+ return this.start;
62
+ }
63
+
64
+ set maximum(value) {
65
+ this.end = value;
66
+ }
67
+
68
+ get maximum() {
69
+ return this.end;
70
+ }
71
+
56
72
  /**
57
73
  * 判断一个数值是否处于该区间内
58
74
  * @param {Number} 需要判断的数值
@@ -62,6 +78,10 @@ class Interval {
62
78
  return isBetween(value, this.start, this.end, this.equalsStart, this.equalsEnd);
63
79
  }
64
80
 
81
+ between(value) {
82
+ return this.isBetween(value);
83
+ }
84
+
65
85
  /**
66
86
  * 在该区间内线性插值
67
87
  * @param {Number} scalar 插值标量,needClamp为true时约束在[0,1]区间内,为false时可超出[0,1]区间