@creuna/utils
Advanced tools
Comparing version 1.0.0 to 1.1.0
# Changelog | ||
# 1.0.0 | ||
## 1.1.0 | ||
* Renames `isElementInViewport` to `isFullyInViewport` | ||
* Adds `isInViewport` | ||
- Adds `pipe` and `pipeValue` | ||
## 1.0.0 | ||
- Renames `isElementInViewport` to `isFullyInViewport` | ||
- Adds `isInViewport` | ||
## 0.4.0 | ||
@@ -9,0 +13,0 @@ |
16
index.js
@@ -36,2 +36,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "CreatePipe", { | ||
enumerable: true, | ||
get: function get() { | ||
return _createPipe.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "DeepClone", { | ||
@@ -91,2 +97,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(exports, "Pipe", { | ||
enumerable: true, | ||
get: function get() { | ||
return _pipe.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "RangeMap", { | ||
@@ -157,2 +169,4 @@ enumerable: true, | ||
var _createPipe = _interopRequireDefault(require("./create-pipe")); | ||
var _deepClone = _interopRequireDefault(require("./deep-clone")); | ||
@@ -176,2 +190,4 @@ | ||
var _pipe = _interopRequireDefault(require("./pipe")); | ||
var _rangeMap = _interopRequireDefault(require("./range-map")); | ||
@@ -178,0 +194,0 @@ |
{ | ||
"name": "@creuna/utils", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Creuna js utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -88,2 +88,19 @@ # Creuna JS utils | ||
### createPipe(_...functions_) | ||
_@creuna/utils/create-pipe_ | ||
- `functions`: any number of functions | ||
- returns: function | ||
The pipe combines n functions, calling each function with the output of the last one. To actually execute the pipeline, call the returned function with a value. More on this concept [here](https://medium.com/front-end-weekly/pipe-and-compose-in-javascript-5b04004ac937). | ||
```js | ||
pipe( | ||
removeSpaces, | ||
capitalize, | ||
reverseString | ||
)("a b c"); // "CBA" | ||
``` | ||
### deepClone(_thing_) | ||
@@ -199,2 +216,16 @@ | ||
### pipe(_value, ...functions_) | ||
_@creuna/utils/pipe_ | ||
- `value`: any value | ||
- `functions`: any number of functions | ||
- returns: any (the result of running `value` through the pipeline) | ||
A function that emulates the [pipeline operator](https://github.com/tc39/proposal-pipeline-operator). For more advanced composition stuff, see `createPipe`. | ||
```js | ||
pipeValue("a b c", removeSpaces, capitalize, reverseString); // "CBA" | ||
``` | ||
### rangeMap(_val, inMin, inMax, outMin, outMax_) | ||
@@ -201,0 +232,0 @@ |
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
33105
30
611
353