@creuna/utils
Advanced tools
Comparing version 0.4.0 to 1.0.0
# Changelog | ||
# 1.0.0 | ||
* Renames `isElementInViewport` to `isFullyInViewport` | ||
* Adds `isInViewport` | ||
## 0.4.0 | ||
@@ -4,0 +9,0 @@ |
20
index.js
@@ -54,14 +54,20 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "IsElementInViewport", { | ||
Object.defineProperty(exports, "IsEqual", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isElementInViewport.default; | ||
return _isEqual.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "IsEqual", { | ||
Object.defineProperty(exports, "IsFullyInViewport", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isEqual.default; | ||
return _isFullyInViewport.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "IsInViewport", { | ||
enumerable: true, | ||
get: function get() { | ||
return _isInViewport.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "IsRunningOnClient", { | ||
@@ -156,6 +162,8 @@ enumerable: true, | ||
var _isElementInViewport = _interopRequireDefault(require("./is-element-in-viewport")); | ||
var _isEqual = _interopRequireDefault(require("./is-equal")); | ||
var _isFullyInViewport = _interopRequireDefault(require("./is-fully-in-viewport")); | ||
var _isInViewport = _interopRequireDefault(require("./is-in-viewport")); | ||
var _isRunningOnClient = _interopRequireDefault(require("./is-running-on-client")); | ||
@@ -162,0 +170,0 @@ |
{ | ||
"name": "@creuna/utils", | ||
"version": "0.4.0", | ||
"version": "1.0.0", | ||
"description": "Creuna js utils", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
"*.js", | ||
"CHANGELOG.md", | ||
"README.md", | ||
@@ -40,6 +41,7 @@ "LICENSE" | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.0", | ||
"@babel/preset-env": "^7.2.0", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/preset-env": "^7.2.3", | ||
"@babel/register": "^7.0.0", | ||
"ava": "^1.0.1", | ||
"ava": "1.0.1", | ||
"babel-eslint": "^10.0.1", | ||
@@ -50,3 +52,4 @@ "chalk": "^2.4.1", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"prettier": "^1.15.3" | ||
"prettier": "^1.15.3", | ||
"proxyquire": "^2.1.0" | ||
}, | ||
@@ -53,0 +56,0 @@ "ava": { |
@@ -134,20 +134,31 @@ # Creuna JS utils | ||
### isElementInViewport(_node_) | ||
### isEqual(_a, b_) | ||
_@creuna/utils/is-element-in-viewport_ | ||
_@creuna/utils/is-equal_ | ||
* `a`: any | ||
* `b`: any | ||
* returns: boolean | ||
Checks whether `a` and `b` are equal (deep comparison for objects and arrays). This uses `JSON.stringify`, so be aware that array elements or object values that are `undefined` will be stripped. | ||
### isFullyInViewport(_node_) | ||
_@creuna/utils/is-fully-in-viewport_ | ||
* `node`: DOM node | ||
* returns: boolean | ||
Checks whether the given element is fully visible in the viewport | ||
Checks whether the given element is fully visible in the viewport. This is a special case of `isInViewport` where the offsets are the dimensions of the element. | ||
### isEqual(_a, b_) | ||
### isInViewport(_node, offset[, offsetX]_) | ||
_@creuna/utils/is-equal_ | ||
_@creuna/utils/is-in-viewport_ | ||
* `a`: any | ||
* `b`: any | ||
* `node`: DOM node | ||
* `offset`: number | ||
* `offsetX`: number (defaults to `offset`) | ||
* returns: boolean | ||
Checks whether `a` and `b` are equal (deep comparison for objects and arrays). This uses `JSON.stringify`, so be aware that array elements or object values that are `undefined` will be stripped. | ||
Checks whether the given element is visible in the viewport. Positive numbers for `offset` mean more of the element needs to be in the viewport while negative numbers mean that the element can be outside of the viewport. | ||
@@ -154,0 +165,0 @@ ### isRunningOnClient: _bool_ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
30767
28
569
0
322
0
12