Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@creuna/utils

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creuna/utils - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0

is-fully-in-viewport.js

5

CHANGELOG.md
# 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_

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