@asamuzakjp/dom-selector
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -44,3 +44,3 @@ { | ||
}, | ||
"version": "0.8.0" | ||
"version": "0.8.1" | ||
} |
@@ -7,2 +7,3 @@ /*! | ||
*/ | ||
'use strict'; | ||
@@ -9,0 +10,0 @@ /* import */ |
/** | ||
* constant.js | ||
*/ | ||
'use strict'; | ||
@@ -5,0 +6,0 @@ module.exports = { |
/** | ||
* matcher.js | ||
*/ | ||
'use strict'; | ||
/* import */ | ||
const DOMException = require('domexception'); | ||
const DOMException = require('./domexception.js'); | ||
const { generateCSS, parseSelector, walkAST } = require('./parser.js'); | ||
@@ -8,0 +9,0 @@ |
/** | ||
* parser.js | ||
*/ | ||
'use strict'; | ||
/* api */ | ||
const DOMException = require('domexception'); | ||
/* import */ | ||
const { generate, parse, toPlainObject, walk } = require('css-tree'); | ||
const { SELECTOR } = require('./constant.js'); | ||
const DOMException = require('./domexception.js'); | ||
/* constants */ | ||
const TYPE_FROM = 8; | ||
const TYPE_TO = -1; | ||
/** | ||
@@ -16,2 +21,6 @@ * create AST from CSS selector | ||
const parseSelector = selector => { | ||
if (selector === undefined || selector === null) { | ||
selector = Object.prototype.toString.call(selector) | ||
.slice(TYPE_FROM, TYPE_TO).toLowerCase(); | ||
} | ||
// invalid selectors | ||
@@ -18,0 +27,0 @@ if (typeof selector !== 'string' || selector === '' || |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55420
13
1626