New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

map-number

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-number - npm Package Compare versions

Comparing version 1.1.6 to 1.2.0

src/wrap.ts

50

CHANGELOG.md

@@ -1,19 +0,27 @@

# 1.1.6 (07-06-2019)
# map-number changelog
## 1.2.0 (18-06-2019)
* create method deprecated
* wrap as default wrap method
* dependencies updated
# 1.1.5 (01-06-2019)
## 1.1.6 (07-06-2019)
* dependencies updated
# 1.1.4 (01-06-2019)
## 1.1.5 (01-06-2019)
* dependencies updated
## 1.1.4 (01-06-2019)
* dependencies updated
* improved documentation
# 1.1.3 (31-05-2019)
## 1.1.3 (31-05-2019)
* fixed cdn links for latest version
# 1.1.2 (30-05-2019)
## 1.1.2 (30-05-2019)

@@ -23,3 +31,3 @@ * build minified `umd` module

# 1.1.1 (29-05-2019)
## 1.1.1 (29-05-2019)

@@ -29,3 +37,3 @@ * improved documentation

# 1.1.0 (29-05-2019)
## 1.1.0 (29-05-2019)

@@ -37,3 +45,3 @@ * added `ceil` method

# 1.0.13 (28-05-2019)
## 1.0.13 (28-05-2019)

@@ -43,3 +51,3 @@ * added badge: `install size`

# 1.0.12 (28-05-2019)
## 1.0.12 (28-05-2019)

@@ -49,15 +57,15 @@ * dependencies updated

# 1.0.11 (27-05-2019)
## 1.0.11 (27-05-2019)
* added badge: `types`
# 1.0.10 (27-05-2019)
## 1.0.10 (27-05-2019)
* added test for alias
# 1.0.9 (27-05-2019)
## 1.0.9 (27-05-2019)
* implemented own `min` & `max` function
# 1.0.8 (25-05-2019)
## 1.0.8 (25-05-2019)

@@ -68,11 +76,11 @@ * improved documentation

# 1.0.7 (24-05-2019)
## 1.0.7 (24-05-2019)
* dependencies updated
# 1.0.6 (24-05-2019)
## 1.0.6 (24-05-2019)
* improved documentation
# 1.0.5 (22-05-2019)
## 1.0.5 (22-05-2019)

@@ -82,3 +90,3 @@ * added badge: `snyk`

# 1.0.4 (22-05-2019)
## 1.0.4 (22-05-2019)

@@ -89,3 +97,3 @@ * added new keywords

# 1.0.3 (22-05-2019)
## 1.0.3 (22-05-2019)

@@ -95,3 +103,3 @@ * improved documentation

# 1.0.2 (22-05-2019)
## 1.0.2 (22-05-2019)

@@ -101,3 +109,3 @@ * added `circleci` & `greenkeeper`

# 1.0.1 (21-05-2019)
## 1.0.1 (21-05-2019)

@@ -107,4 +115,4 @@ * fixed [#1](https://github.com/manferlo81/map-number/issues/1)

# 1.0.0 (21-05-2019)
## 1.0.0 (21-05-2019)
* first release

@@ -30,3 +30,3 @@ 'use strict';

function create(func, inMin, inMax, outMin, outMax) {
function wrap(func, inMin, inMax, outMin, outMax) {
return function (num) { return func(num, inMin, inMax, outMin, outMax); };

@@ -36,3 +36,3 @@ }

exports.ceil = ceil;
exports.create = create;
exports.create = wrap;
exports.floor = floor;

@@ -42,3 +42,3 @@ exports.limit = limit;

exports.round = round;
exports.wrap = create;
exports.wrap = wrap;
//# sourceMappingURL=map.cjs.js.map

@@ -28,7 +28,7 @@ function map(num, inMin, inMax, outMin, outMax) {

function create(func, inMin, inMax, outMin, outMax) {
function wrap(func, inMin, inMax, outMin, outMax) {
return function (num) { return func(num, inMin, inMax, outMin, outMax); };
}
export { ceil, create, floor, limit, map, round, create as wrap };
export { ceil, wrap as create, floor, limit, map, round, wrap };
//# sourceMappingURL=map.es.js.map

@@ -34,3 +34,3 @@ (function (global, factory) {

function create(func, inMin, inMax, outMin, outMax) {
function wrap(func, inMin, inMax, outMin, outMax) {
return function (num) { return func(num, inMin, inMax, outMin, outMax); };

@@ -40,3 +40,3 @@ }

exports.ceil = ceil;
exports.create = create;
exports.create = wrap;
exports.floor = floor;

@@ -46,5 +46,5 @@ exports.limit = limit;

exports.round = round;
exports.wrap = create;
exports.wrap = wrap;
}));
//# sourceMappingURL=map.umd.js.map
{
"name": "map-number",
"version": "1.1.6",
"version": "1.2.0",
"description": "processing/p5.js map like function, including floating point numbers support",

@@ -34,4 +34,4 @@ "main": "dist/map.cjs.js",

"devDependencies": {
"@types/jest": "^24.0.13",
"@types/node": "^12.0.6",
"@types/jest": "^24.0.15",
"@types/node": "^12.0.8",
"bundlib": "^0.5.1",

@@ -41,3 +41,3 @@ "eslint": "^5.16.0",

"tslint": "^5.17.0",
"typescript": "^3.5.1"
"typescript": "^3.5.2"
},

@@ -44,0 +44,0 @@ "files": [

@@ -120,3 +120,3 @@ # map-number

### create
### wrap

@@ -128,3 +128,3 @@ *Creates a single argument function implementing the given [`map`](#map), [`floor`](#floor), [`ceil`](#ceil), [`round`](#round) or [`limit`](#limit) function. Useful when you need to map values multiple times within the same range, [see example](#example).*

```typescript
function create(func: MapFunction, inMin: number, inMax: number, outMin: number, outMax: number): (num: number) => number;
function wrap(func: MapFunction, inMin: number, inMax: number, outMin: number, outMax: number): (num: number) => number;
```

@@ -135,18 +135,18 @@

```javascript
import { map, create } from "map-number";
import { map, wrap } from "map-number";
const myMap = create(map, -1, 1, 100, 0);
const myMap = wrap(map, -1, 1, 100, 0);
myMap(Math.sin(angle1));
myMap(Math.sin(angle2));
myMap(-0.2);
myMap(0.33);
// ... is equivalent to...
map(Math.sin(angle1), -1, 1, 100, 0);
map(Math.sin(angle2), -1, 1, 100, 0);
map(-0.2, -1, 1, 100, 0);
map(0.33, -1, 1, 100, 0);
```
### wrap
### create
*An alias for [create](#create) method.*
*An alias for [wrap](#wrap) method, deprecated in version* `1.2.0`*, use [wrap](#wrap) instead.*

@@ -153,0 +153,0 @@ ## License

@@ -6,2 +6,2 @@ export { default as map } from "./map";

export { default as limit } from "./limit";
export { default as create, default as wrap } from "./create";
export { default as wrap, default as create } from "./wrap";

@@ -6,2 +6,2 @@ export { default as map } from "./map";

export { default as limit } from "./limit";
export { default as create, default as wrap } from "./create";
export { default as wrap, default as create } from "./wrap";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc