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

optimal-select

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optimal-select - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [v2.0.0]
> Jan 15, 2016
- enable filtering with RegExp to exclude specific property values
- replace complex key-value and classname selectors with tags
## [v1.0.2]

@@ -2,0 +9,0 @@ > Jan 2, 2016

53

lib/match.js

@@ -26,4 +26,4 @@ 'use strict';

// global
if (checkId(element, path)) break;
if (checkClassGlobal(element, path)) break;
if (checkId(element, path, options)) break;
if (checkClassGlobal(element, path, options)) break;
if (checkAttributeGlobal(element, path, options)) break;

@@ -33,3 +33,3 @@ if (checkTagGlobal(element, path)) break;

// local
checkClassLocal(element, path);
checkClassLocal(element, path, options);

@@ -45,3 +45,3 @@ // define only one selector each iteration

if (path.length === length) {
checkClassChild(element, path);
checkClassChild(element, path, options);
}

@@ -72,4 +72,4 @@ if (path.length === length) {

*/
function checkClassGlobal(element, path) {
return checkClass(element, path, document);
function checkClassGlobal(element, path, options) {
return checkClass(element, path, document, options);
}

@@ -83,4 +83,4 @@

*/
function checkClassLocal(element, path) {
return checkClass(element, path, element.parentNode);
function checkClassLocal(element, path, options) {
return checkClass(element, path, element.parentNode, options);
}

@@ -94,5 +94,5 @@

*/
function checkClassChild(element, path) {
function checkClassChild(element, path, options) {
var className = element.className;
if (!className) {
if (!className || compareExcludes(className, options.excludes.class)) {
return false;

@@ -137,6 +137,10 @@ }

var attributeName = attribute.name;
if (['id', 'class'].concat(options.excludes).indexOf(attributeName) > -1) {
var attributeValue = attribute.value;
// include 'id', 'class' check ?
// if (['id', 'class'].concat(options.excludes).indexOf(attributeName) > -1) {
// return false
// }
if (compareExcludes(attributeValue, options.excludes[attributeName])) {
return false;
}
var attributeValue = attribute.value;
var pattern = '[' + attributeName + '="' + attributeValue + '"]';

@@ -199,5 +203,5 @@ return checkChild(element, path, pattern, options);

*/
function checkClass(element, path, parent) {
function checkClass(element, path, parent, options) {
var className = element.className;
if (!className) {
if (!className || compareExcludes(className, options.excludes.class)) {
return false;

@@ -226,6 +230,6 @@ }

var attributeName = attribute.name;
if (['id', 'class'].concat(options.excludes).indexOf(attributeName) > -1) {
var attributeValue = attribute.value;
if (compareExcludes(attributeValue, options.excludes[attributeName])) {
return false;
}
var attributeValue = attribute.value;
var pattern = '[' + attributeName + '="' + attributeValue + '"]';

@@ -275,3 +279,18 @@ var matches = parent.querySelectorAll(pattern);

}
/**
* [compareExcludes description]
* @param {String} value - [description]
* @param {Null|String|Array} excludes - [description]
* @return {Boolean} - [description]
*/
function compareExcludes(value, excludes) {
if (!excludes) {
return false;
}
return excludes.some(function (exclude) {
return exclude.test(value);
});
}
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hdGNoLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O2tCQVl3QixLQUFLOzs7Ozs7Ozs7Ozs7O0FBQWQsU0FBUyxLQUFLLENBQUUsSUFBSSxFQUFFLE9BQU8sRUFBRTtBQUM1QyxNQUFNLElBQUksR0FBRyxFQUFFLENBQUE7QUFDZixNQUFJLE9BQU8sR0FBRyxJQUFJLENBQUE7QUFDbEIsTUFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQTs7QUFFeEIsU0FBTyxPQUFPLEtBQUssUUFBUSxFQUFFOztBQUUzQixRQUFJLE9BQU8sQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLEVBQUUsTUFBSztBQUNqQyxRQUFJLGdCQUFnQixDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsRUFBRSxNQUFLO0FBQzFDLFFBQUksb0JBQW9CLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRSxPQUF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dXG4gKi9cbmZ1bmN0aW9uIGNvbXBhcmVFeGNsdWRlcyAodmFsdWUsIGV4Y2x1ZGVzKSB7XG4gIGlmICghZXhjbHVkZXMpIHtcbiAgICByZXR1cm4gZmFsc2VcbiAgfVxuICByZXR1cm4gZXhjbHVkZXMuc29tZSgoZXhjbHVkZSkgPT4gZXhjbHVkZS50ZXN0KHZhbHVlKSlcbn1cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

@@ -61,2 +61,26 @@ 'use strict';

// robustness: attribute without value (generalization)
if (/\[*\]/.test(current)) {
var key = current.replace(/=.*$/, ']');
var pattern = '' + prePart + key + postPart;
var matches = document.querySelectorAll(pattern);
if (matches.length === 1 && matches[0] === element) {
current = key;
} else {
// robustness: replace specific key-value with tag (heuristic)
var references = document.querySelectorAll('' + prePart + key);
for (var i = 0, l = references.length; i < l; i++) {
if (references[i].contains(element)) {
var description = references[i].tagName.toLowerCase();
var pattern = '' + prePart + description + postPart;
var matches = document.querySelectorAll(pattern);
if (matches.length === 1 && matches[0] === element) {
current = description;
}
break;
}
}
}
}
// robustness: descendant instead child (heuristic)

@@ -72,13 +96,3 @@ if (/>/.test(current)) {

// robustness: attribute without value (generalization)
if (/\[*\]/.test(current)) {
var key = current.replace(/=.*$/, ']');
var pattern = '' + prePart + key + postPart;
var matches = document.querySelectorAll(pattern);
if (matches.length === 1 && matches[0] === element) {
current = key;
}
}
// // robustness: 'nth-of-type' instead 'nth-child' (heuristic)
// robustness: 'nth-of-type' instead 'nth-child' (heuristic)
if (/\:nth-child/.test(current)) {

@@ -108,2 +122,19 @@ var type = current.replace(/nth-child/g, 'nth-of-type');

}
// robustness: degrade complex classname (heuristic)
if (current && current.match(/\./g).length > 2) {
var references = document.querySelectorAll('' + prePart + current);
for (var i = 0, l = references.length; i < l; i++) {
if (references[i].contains(element)) {
// TODO:
// - check using attributes + regard excludes
var description = references[i].tagName.toLowerCase();
var pattern = '' + prePart + description + postPart;
var matches = document.querySelectorAll(pattern);
if (matches.length === 1 && matches[0] === element) {
current = description;
}
break;
}
}
}
}

@@ -114,2 +145,2 @@

module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wdGltaXplLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O2tCQWF3QixRQUFROzs7Ozs7Ozs7Ozs7OztBQUFqQixTQUFTLFFBQVEsQ0FBRSxRQUFRLEVBQUUsT0FBTyxFQUFFO0FBQ25ELE1BQUksSUFBSSxHQUFHLFFBQVEsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQTs7QUFFbEQsTUFBSSxJQUFJLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtBQUNuQixXQUFPLFFBQVEsQ0FBQTtHQUNoQjs7QUFFRCxNQUFNLFNBQVMsR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFBO0FBQzlCLFNBQU8sSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUc7QUFDdkIsUUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFBO0FBQzFCLFFBQU0sT0FBTyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUE7QUFDOUIsUUFBTSxRQUFRLEdBQUcsU0FBUyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQTs7QUFFcEMsUUFBTSxPQUFPLEdBQU0sT0FBTyxTQUFJLFFBQVEsQUFBRSxDQUFBO0FBQ3hDLFFBQU0sT0FBTyxHQUFHLFFBQVEsQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFPLENBQUMsQ0FBQTtBQUNsRCxRQUFJLE9BQU8sQ0FBQyxNQUFNLEtBQUssQ0FBQyxFQUFFO0FBQ3hCLG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N0aWMpXG4gICAgaWYgKGN1cnJlbnQgJiYgY3VycmVudC5tYXRjaCgvXFwuL2cpLmxlbmd0aCA+IDIpIHtcbiAgICAgIGNvbnN0IHJlZmVyZW5jZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKGAke3ByZVBhcnR9JHtjdXJyZW50fWApXG4gICAgICBmb3IgKHZhciBpID0gMCwgbCA9IHJlZmVyZW5jZXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgIGlmIChyZWZlcmVuY2VzW2ldLmNvbnRhaW5zKGVsZW1lbnQpKSB7XG4gICAgICAgICAgLy8gVE9ETzpcbiAgICAgICAgICAvLyAtIGNoZWNrIHVzaW5nIGF0dHJpYnV0ZXMgKyByZWdhcmQgZXhjbHVkZXNcbiAgICAgICAgICBjb25zdCBkZXNjcmlwdGlvbiA9IHJlZmVyZW5jZXNbaV0udGFnTmFtZS50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgdmFyIHBhdHRlcm4gPSBgJHtwcmVQYXJ0fSR7ZGVzY3JpcHRpb259JHtwb3N0UGFydH1gXG4gICAgICAgICAgdmFyIG1hdGNoZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKHBhdHRlcm4pXG4gICAgICAgICAgaWYgKG1hdGNoZXMubGVuZ3RoID09PSAxICYmIG1hdGNoZXNbMF0gPT09IGVsZW1lbnQpIHtcbiAgICAgICAgICAgIGN1cnJlbnQgPSBkZXNjcmlwdGlvblxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGN1cnJlbnRcbn1cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**
* # Select
*
* Construct a unique CSS queryselector to access the selected DOM element(s).
* Applies different matching and optimization strategies for efficiency.
*/
Object.defineProperty(exports, "__esModule", {

@@ -20,11 +27,8 @@ value: true

/**
* # Select
*
* Construct a unique CSS queryselector to access the selected DOM element(s).
* Applies different matching and optimization strategies for efficiency.
*/
var defaultOptions = {
excludes: ['style', 'data-reactid', 'data-react-checksum']
excludes: {
'style': '.*',
'data-reactid': '.*',
'data-react-checksum': '.*'
}
};

@@ -39,4 +43,14 @@

function getQuerySelector(input) {
var options = arguments.length <= 1 || arguments[1] === undefined ? defaultOptions : arguments[1];
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
options = _extends({}, defaultOptions, options);
Object.keys(options.excludes).forEach(function (attribute) {
var patterns = options.excludes[attribute];
if (!Array.isArray(patterns)) {
patterns = [patterns];
}
options.excludes[attribute] = patterns.map(function (pattern) {
return new RegExp(pattern);
});
});
if (Array.isArray(input)) {

@@ -139,2 +153,2 @@ return getMultiSelector(input, options);

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztrQkF3QndCLGdCQUFnQjtRQWF4QixpQkFBaUIsR0FBakIsaUJBQWlCO1FBMkJqQixnQkFBZ0IsR0FBaEIsZ0JBQWdCOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBdERoQyxJQUFNLGNBQWMsR0FBRztBQUNyQixVQUFRLEVBQUUsQ0FDUixPQUFPLEVBQ1AsY0FBYyxFQUNkLHFCQUFxQixDQUN0QjtDQUNGOzs7Ozs7OztBQUFBLEFBUWMsU0FBUyxnQkFBZ0IsQ0FBRSxLQUFLLEVBQTRCO01BQTFCLE9BQU8seURBQUcsY0FBYzs7QUFDdkUsTUFBSSxLQUFLLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxFQUFFO0FBQ3hCLFdBQU8sZ0JBQWdCLENBQUMsS0FB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ICAvL1xuICAvLyB9XG4gIGlmIChjb21tb25UYWdOYW1lKSB7XG4gICAgcmV0dXJuIGAke3NlbGVjdG9yfSA+ICR7Y29tbW9uVGFnTmFtZS50b0xvd2VyQ2FzZSgpfWBcbiAgfVxuICByZXR1cm4gYCR7c2VsZWN0b3J9ID4gKmBcbn1cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
{
"name": "optimal-select",
"description": "Get efficient & robust CSS selectors for HTML elements",
"version": "1.0.2",
"version": "2.0.0",
"author": "Stefan Dühring | Autarc <autarc@gmail.com>",

@@ -10,12 +10,12 @@ "bugs": {

"devDependencies": {
"babel-loader": "^6.2.0",
"babel-loader": "^6.2.1",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"babel-register": "^6.3.13",
"babel-register": "^6.4.3",
"deep-merge": "^1.0.0",
"fs-extra": "^0.26.3",
"fs-extra": "^0.26.4",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
"gulp-load-plugins": "^1.1.0",
"gulp-load-plugins": "^1.2.0",
"gulp-plumber": "^1.0.1",

@@ -25,3 +25,3 @@ "gulp-sourcemaps": "^1.6.0",

"gulp-watch": "^4.3.5",
"webpack": "^1.12.9"
"webpack": "^1.12.11"
},

@@ -28,0 +28,0 @@ "homepage": "https://github.com/Autarc/optimal-select",

@@ -12,3 +12,3 @@ [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

- allow single and multiple element inputs
- configurations for excludes can be defined
- configurations for excludes can be defined with filters
- micro library (~ 5kb + no external dependency)

@@ -21,3 +21,3 @@ - shortest path and fastest selection in [comparison](https://github.com/fczbkk/css-selector-generator-benchmark)

```js
import { select } from 'optimize-select' // global: 'OptimalSelect'
import { select } from 'optimal-select' // global: 'OptimalSelect'

@@ -37,12 +37,18 @@ document.addEventListener('click', (e) => {

```js
// pass the attribute as additional parameters (overwrites defaults)
var selector = select(element, { excludes: ['href'] })
// pass the attribute as additional parameters (extends defaults)
var selector = select(element, {
excludes: {
'href': '.*',
'class': ['^example']
}
})
```
### TODO
### TODO
- extend documentation
- add tests
- check attributes in multi-select
- check attributes for complex classname
### Development

@@ -49,0 +55,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