Socket
Socket
Sign inDemoInstall

happy-dom

Package Overview
Dependencies
Maintainers
1
Versions
576
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happy-dom - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

12

lib/nodes/basic-types/node/Node.d.ts

@@ -57,2 +57,14 @@ import NodeType from './NodeType';

/**
* Previous element sibling.
*
* @return {Node} Node.
*/
readonly previousElementSibling: Node;
/**
* Next element sibling.
*
* @return {Node} Node.
*/
readonly nextElementSibling: Node;
/**
* First child.

@@ -59,0 +71,0 @@ *

@@ -141,2 +141,34 @@ "use strict";

});
Object.defineProperty(Node.prototype, "previousElementSibling", {
/**
* Previous element sibling.
*
* @return {Node} Node.
*/
get: function () {
var previousSibling = this.previousSibling;
while (previousSibling !== null && previousSibling.nodeType !== NodeType_1.default.ELEMENT_NODE) {
previousSibling = this.previousSibling;
}
return previousSibling;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Node.prototype, "nextElementSibling", {
/**
* Next element sibling.
*
* @return {Node} Node.
*/
get: function () {
var nextSibling = this.nextSibling;
while (nextSibling !== null && nextSibling.nodeType !== NodeType_1.default.ELEMENT_NODE) {
nextSibling = this.nextSibling;
}
return nextSibling;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Node.prototype, "firstChild", {

@@ -143,0 +175,0 @@ /**

2

package.json
{
"name": "happy-dom",
"version": "0.7.0",
"version": "0.8.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom#readme",

@@ -221,2 +221,3 @@ # Happy DOM

| ------- | ---------- | ---------------- |
| 0.8.0 | 2019-11-21 | Adds support for previousElementSibling and nextElementSibling. (#18).
| 0.7.0 | 2019-11-21 | Thanks to [@AdeAttwood](https://github.com/AdeAttwood) we now have support for requestAnimationFrame() and cancelAnimationFrame(). (#9).

@@ -223,0 +224,0 @@ | 0.6.0 | 2019-10-28 | Thanks to [@mat3e](https://github.com/mat3e) we now have support for hasAttributes(). The "attributes" property has also been changed. It is now returning an object instead of array. (#13).

@@ -120,2 +120,28 @@ import NodeType from './NodeType';

/**
* Previous element sibling.
*
* @return {Node} Node.
*/
public get previousElementSibling(): Node {
let previousSibling = this.previousSibling;
while(previousSibling !== null && previousSibling.nodeType !== NodeType.ELEMENT_NODE) {
previousSibling = this.previousSibling;
}
return previousSibling;
}
/**
* Next element sibling.
*
* @return {Node} Node.
*/
public get nextElementSibling(): Node {
let nextSibling = this.nextSibling;
while(nextSibling !== null && nextSibling.nodeType !== NodeType.ELEMENT_NODE) {
nextSibling = this.nextSibling;
}
return nextSibling;
}
/**
* First child.

@@ -122,0 +148,0 @@ *

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