@anselan/maprange
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -47,2 +47,18 @@ "use strict"; | ||
}); | ||
describe('clamping', () => { | ||
test('200% clamped at 100%', () => { | ||
const value = 2; | ||
expect(_1.default(value, 0, 1, 0, 100, true)).toBe(100); | ||
}); | ||
test('clamp the bottom end', () => { | ||
const value = -10; | ||
expect(_1.default(value, -1, 1, -1000, 1000, true)).toBe(-1000); | ||
}); | ||
}); | ||
// describe('default input range [0,1]', () => { | ||
// test('halfway', () => { | ||
// const value = 0.5; | ||
// expect(remap(value, 0, 100)).toBe(50) | ||
// }) | ||
// }) | ||
//# sourceMappingURL=index.test.js.map |
{ | ||
"name": "@anselan/maprange", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Map values from one range to another", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -47,2 +47,22 @@ import remap from '.' | ||
}) | ||
}) | ||
}) | ||
describe('clamping', () => { | ||
test('200% clamped at 100%', () => { | ||
const value = 2; | ||
expect(remap(value, 0, 1, 0, 100, true)).toBe(100) | ||
}) | ||
test('clamp the bottom end', () => { | ||
const value = -10; | ||
expect(remap(value, -1, 1, -1000, 1000, true)).toBe(-1000) | ||
}) | ||
}) | ||
// describe('default input range [0,1]', () => { | ||
// test('halfway', () => { | ||
// const value = 0.5; | ||
// expect(remap(value, 0, 100)).toBe(50) | ||
// }) | ||
// }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9159
177