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

@asamuzakjp/dom-selector

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asamuzakjp/dom-selector - npm Package Compare versions

Comparing version 0.12.2 to 0.12.3

2

package.json

@@ -45,3 +45,3 @@ {

},
"version": "0.12.2"
"version": "0.12.3"
}

@@ -28,2 +28,3 @@ /**

const HTML_INTERACT = /^d(?:etails|ialog)$/;
const INPUT_TYPE_BARRED = /^(?:(?:butto|hidde)n|reset)$/;
const PSEUDO_FUNC = /^(?:(?:ha|i)s|not|where)$/;

@@ -97,3 +98,3 @@ const PSEUDO_NTH = /^nth-(?:last-)?(?:child|of-type)$/;

const l = arr.length;
for (let i = 0; i < l; i++) {
for (let i = 1; i < l; i++) {
let item = arr[i];

@@ -119,3 +120,7 @@ if (i === l - 1 && item === '') {

}
item = item.replace(`${hex}`, str);
let postStr = '';
if (item.length > hex.length) {
postStr = item.substring(hex.length);
}
item = `${str}${postStr}`;
} else if (WHITESPACE.test(item)) {

@@ -971,16 +976,17 @@ item = '\\' + item;

case 'in-range':
if (localName === 'input' &&
node.hasAttribute('min') && node.hasAttribute('max')) {
if (!(node.validity.rangeUnderflow ||
node.validity.rangeOverflow)) {
matched.push(node);
}
if (localName === 'input' && !node.readonly &&
!(node.hasAttribute('type') &&
INPUT_TYPE_BARRED.test(node.getAttribute('type'))) &&
node.hasAttribute('min') && node.hasAttribute('max') &&
!(node.validity.rangeUnderflow || node.validity.rangeOverflow)) {
matched.push(node);
}
break;
case 'out-of-range':
if (localName === 'input' &&
node.hasAttribute('min') && node.hasAttribute('max')) {
if (node.validity.rangeUnderflow || node.validity.rangeOverflow) {
matched.push(node);
}
if (localName === 'input' && !node.readonly &&
!(node.hasAttribute('type') &&
INPUT_TYPE_BARRED.test(node.getAttribute('type'))) &&
node.hasAttribute('min') && node.hasAttribute('max') &&
(node.validity.rangeUnderflow || node.validity.rangeOverflow)) {
matched.push(node);
}

@@ -987,0 +993,0 @@ break;

@@ -26,12 +26,12 @@ /**

let [selector] = args;
if (typeof selector !== 'string') {
if (selector === undefined || selector === null) {
selector = Object.prototype.toString.call(selector)
.slice(TYPE_FROM, TYPE_TO).toLowerCase();
} else {
throw new DOMException(`invalid selector ${selector}`, 'SyntaxError');
}
if (typeof selector === 'string') {
selector = selector.replace(/\f|\r\n?/g, '\n')
.replace(/[\0\uD800-\uDFFF]|\\$/g, '\uFFFD').trim();
} else if (selector === undefined || selector === null) {
selector = Object.prototype.toString.call(selector)
.slice(TYPE_FROM, TYPE_TO).toLowerCase();
} else {
throw new DOMException(`invalid selector ${selector}`, 'SyntaxError');
}
return selector.replace(/\f|\r\n?/g, '\n')
.replace(/[\0\uD800-\uDFFF]/g, '\uFFFD').trim();
return selector;
};

@@ -38,0 +38,0 @@

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