@jamesrock/rockjs 1.6.0 → 1.7.0

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/index.js +21 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -157,3 +157,24 @@ export class GUID {
157
157
  };
158
158
  segments = 3;
159
159
  };
160
+
161
+ export class Scaler {
162
+ constructor(scale) {
163
+ this.scale = scale;
164
+ }
165
+ inflate(value) {
166
+ return value * this.scale;
167
+ };
168
+ deflate(value) {
169
+ return value / this.scale;
170
+ };
171
+ };
172
+
173
+ export class Rounder {
174
+ constructor(tolerance) {
175
+ this.tolerance = tolerance;
176
+ };
177
+ round(value) {
178
+ return Math.round(value / this.tolerance) * this.tolerance;
179
+ };
180
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesrock/rockjs",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "utility bliss",
5
5
  "license": "ISC",
6
6
  "author": "James Rock",