@uppy/utils
Advanced tools
Comparing version 0.29.1 to 0.30.0
@@ -12,4 +12,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
module.exports = function findDOMElement(element) { | ||
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; | ||
if (typeof element === 'string') { | ||
return document.querySelector(element); | ||
return context.querySelector(element); | ||
} | ||
@@ -16,0 +18,0 @@ |
{ | ||
"name": "@uppy/utils", | ||
"description": "Shared utility functions for Uppy Core and plugins maintained by the Uppy team.", | ||
"version": "0.29.1", | ||
"version": "0.30.0", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "3ddf4c7548766a0c522b9a45c03b1fd7d4e03d43" | ||
"gitHead": "4dcef4c3b949a35ccfe7b4339a776a5d43052664" | ||
} |
@@ -9,5 +9,5 @@ const isDOMElement = require('./isDOMElement') | ||
*/ | ||
module.exports = function findDOMElement (element) { | ||
module.exports = function findDOMElement (element, context = document) { | ||
if (typeof element === 'string') { | ||
return document.querySelector(element) | ||
return context.querySelector(element) | ||
} | ||
@@ -14,0 +14,0 @@ |
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
87402
1428