Socket
Socket
Sign inDemoInstall

happy-dom

Package Overview
Dependencies
Maintainers
1
Versions
575
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 14.2.1 to 14.3.0

7

cjs/nodes/html-select-element/HTMLSelectElement.d.ts

@@ -12,2 +12,3 @@ import HTMLElement from '../html-element/HTMLElement.cjs';

import NamedNodeMap from '../../named-node-map/NamedNodeMap.cjs';
import HTMLCollection from '../element/HTMLCollection.cjs';
/**

@@ -144,2 +145,8 @@ * HTML Select Element.

/**
* Returns selected options.
*
* @returns HTMLCollection.
*/
get selectedOptions(): HTMLCollection<HTMLOptionElement>;
/**
* Returns the associated label elements.

@@ -146,0 +153,0 @@ *

@@ -12,2 +12,3 @@ import HTMLElement from '../html-element/HTMLElement.js';

import NamedNodeMap from '../../named-node-map/NamedNodeMap.js';
import HTMLCollection from '../element/HTMLCollection.js';
/**

@@ -144,2 +145,8 @@ * HTML Select Element.

/**
* Returns selected options.
*
* @returns HTMLCollection.
*/
get selectedOptions(): HTMLCollection<HTMLOptionElement>;
/**
* Returns the associated label elements.

@@ -146,0 +153,0 @@ *

@@ -15,2 +15,3 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {

import HTMLSelectElementNamedNodeMap from './HTMLSelectElementNamedNodeMap.js';
import HTMLCollection from '../element/HTMLCollection.js';
/**

@@ -239,2 +240,16 @@ * HTML Select Element.

/**
* Returns selected options.
*
* @returns HTMLCollection.
*/
get selectedOptions() {
const selectedOptions = new HTMLCollection();
for (let i = 0, max = this[PropertySymbol.options].length; i < max; i++) {
if (this[PropertySymbol.options][i][PropertySymbol.selectedness]) {
selectedOptions.push(this[PropertySymbol.options][i]);
}
}
return selectedOptions;
}
/**
* Returns the associated label elements.

@@ -241,0 +256,0 @@ *

2

package.json
{
"name": "happy-dom",
"version": "14.2.1",
"version": "14.3.0",
"license": "MIT",

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

@@ -15,2 +15,3 @@ import HTMLElement from '../html-element/HTMLElement.js';

import HTMLSelectElementNamedNodeMap from './HTMLSelectElementNamedNodeMap.js';
import HTMLCollection from '../element/HTMLCollection.js';

@@ -256,2 +257,17 @@ /**

/**
* Returns selected options.
*
* @returns HTMLCollection.
*/
public get selectedOptions(): HTMLCollection<HTMLOptionElement> {
const selectedOptions = new HTMLCollection<HTMLOptionElement>();
for (let i = 0, max = this[PropertySymbol.options].length; i < max; i++) {
if ((<HTMLOptionElement>this[PropertySymbol.options][i])[PropertySymbol.selectedness]) {
selectedOptions.push(<HTMLOptionElement>this[PropertySymbol.options][i]);
}
}
return selectedOptions;
}
/**
* Returns the associated label elements.

@@ -258,0 +274,0 @@ *

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc