@vaadin/vaadin-development-mode-detector
Advanced tools
Comparing version 1.0.3-pre.4 to 1.0.3-pre.5
@@ -5,3 +5,3 @@ { | ||
"name": "@vaadin/vaadin-development-mode-detector", | ||
"version": "1.0.3-pre.4", | ||
"version": "1.0.3-pre.5", | ||
"author": "Vaadin Ltd", | ||
@@ -13,11 +13,12 @@ "license": "Apache-2.0", | ||
"supports-color": "3.1.2", | ||
"type-detect": "1.0.0" | ||
"type-detect": "1.0.0", | ||
"@webcomponents/webcomponentsjs": "2.0.0-beta.2" | ||
}, | ||
"main": "vaadin-development-mode-detector.js", | ||
"dependencies": { | ||
"@polymer/polymer": "^3.0.0-pre.12" | ||
"@polymer/polymer": "^3.0.0-pre.13" | ||
}, | ||
"devDependencies": { | ||
"@webcomponents/webcomponentsjs": "^1.0.0" | ||
"@webcomponents/webcomponentsjs": "^2.0.0-beta.2" | ||
} | ||
} |
import { importHref } from '@polymer/polymer/lib/utils/import-href.js'; | ||
import { DomModule } from '@polymer/polymer/lib/elements/dom-module.js'; | ||
const $_documentContainer = document.createElement('div'); | ||
const $_documentContainer = document.createElement('template'); | ||
$_documentContainer.setAttribute('style', 'display: none;'); | ||
@@ -9,3 +9,3 @@ | ||
document.head.appendChild($_documentContainer); | ||
document.head.appendChild($_documentContainer.content); | ||
const version = window['Polymer'] && window['Polymer'].version; | ||
@@ -37,12 +37,2 @@ | ||
function getEsModules() { | ||
// native ES modules | ||
const modules = document.querySelectorAll("script[type=module]"); | ||
// require.js modules | ||
const require = document.querySelectorAll("script[data-requiremodule]"); | ||
return Array.from(modules).concat(Array.from(require)); | ||
} | ||
function isUnbundled() { | ||
@@ -54,4 +44,7 @@ if (useHtmlImports) { | ||
} else { | ||
const modules = getEsModules(); | ||
return modules.filter(function (m) { return m.src.indexOf("vaadin-") > -1 }).length > 0; | ||
const scripts = Array.from(document.querySelectorAll("script")); | ||
// TODO(web-padawan): this is not expected to work for applications using native ES modules, | ||
// since the index.html is unlikely to contain any direct imports of Vaadin components. | ||
// It works with the AMD transform of CLI, as the <script> tags are being added to <head>. | ||
return scripts.filter(script => script.src.indexOf("@vaadin") > -1).length > 0; | ||
} | ||
@@ -58,0 +51,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
7208
135
1