Comparing version 0.6.0 to 0.7.0
Changelog | ||
========= | ||
### 0.7.0 (January 3, 2017) | ||
* Update type annotations for compatibility with closure compiler | ||
### 0.6.0 (January 1, 2017) | ||
@@ -5,0 +9,0 @@ |
@@ -10,3 +10,3 @@ import matches from './matches'; | ||
* the passed element itself. | ||
* @return {?Element} The matching element or undefined. | ||
* @return {Element|undefined} The matching element or undefined. | ||
*/ | ||
@@ -13,0 +13,0 @@ export default function closest(element, selector, shouldCheckSelf) { |
@@ -7,3 +7,3 @@ import closest from './closest'; | ||
* ancestor of the matching element. | ||
* @param {Element} ancestor The ancestor element to add the listener to. | ||
* @param {Node} ancestor The ancestor element to add the listener to. | ||
* @param {string} eventType The event type to listen to. | ||
@@ -10,0 +10,0 @@ * @param {string} selector A CSS selector to match against child elements. |
/** | ||
* Gets all attributes of an element as a plain JavaScriot object. | ||
* @param {Element} element The element whose attributes to get. | ||
* @return {Object} An object whose keys are the attribute keys and whose | ||
* @return {!Object} An object whose keys are the attribute keys and whose | ||
* values are the attribute values. If no attributes exist, an empty | ||
@@ -6,0 +6,0 @@ * object is returned. |
@@ -13,3 +13,3 @@ const proto = window.Element.prototype; | ||
* @param {Element} element The DOM element to test. | ||
* @param {Element|string|Array<Element|String>} test A DOM element, a CSS | ||
* @param {Element|string|Array<Element|string>} test A DOM element, a CSS | ||
* selector, or an array of DOM elements or CSS selectors to match against. | ||
@@ -23,3 +23,4 @@ * @return {boolean} True of any part of the test matches. | ||
if (typeof test == 'string' || test.nodeType == 1) { | ||
return element == test || matchesSelector(element, test); | ||
return element == test || | ||
matchesSelector(element, /** @type {string} */ (test)); | ||
} else if ('length' in test) { | ||
@@ -26,0 +27,0 @@ // if it has a length property iterate over the items |
@@ -10,5 +10,6 @@ /** | ||
while (element && element.parentNode && element.parentNode.nodeType == 1) { | ||
list.push(element = element.parentNode); | ||
element = /** @type {!Element} */ (element.parentNode); | ||
list.push(element); | ||
} | ||
return list; | ||
} |
{ | ||
"name": "dom-utils", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "A small, modular DOM utilities library", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
32095
696