dmp-template-data
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -6,3 +6,4 @@ module.exports = function(config) { | ||
files: [ | ||
{ pattern: 'spec/**/*-spec.js', watched: false } | ||
'node_modules/babel-polyfill/dist/polyfill.js', | ||
{ pattern: 'spec/**/*Spec.js', watched: false } | ||
], | ||
@@ -9,0 +10,0 @@ frameworks: ['jasmine'], |
{ | ||
"name": "dmp-template-data", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "component to analyze template DOM", | ||
@@ -22,3 +22,3 @@ "main": "src/index.js", | ||
"babel-loader": "^6.2.4", | ||
"babel-polyfill": "^6.9.0", | ||
"babel-polyfill": "^6.9.1", | ||
"babel-preset-es2015": "^6.6.0", | ||
@@ -25,0 +25,0 @@ "babel-register": "^6.8.0", |
@@ -24,4 +24,4 @@ # dmp-template-data | ||
* `dom` <Document Object> | ||
* `name`<String> | ||
* `dom` < Document Object > | ||
* `name`< String > | ||
@@ -38,4 +38,4 @@ The `templateData.metaTagValue` function returns the content of requested meta tag. | ||
* `dom` <Document Object> | ||
* `name`<String> | ||
* `dom` < Document Object > | ||
* `name`< String > | ||
@@ -52,3 +52,3 @@ The `templateData.hasMetaTag` function returns true if requested meta tag exists. | ||
* `dom` <Document Object> | ||
* `dom` < Document Object > | ||
@@ -66,4 +66,4 @@ The `templateData.hasBackgroundArea` function returns true if | ||
* `dom` <Document Object> | ||
* `type` <String> | ||
* `dom` < Document Object > | ||
* `type` < String > | ||
@@ -70,0 +70,0 @@ The `templateData.placeholdersFor` function returns an array of requested placeholders |
@@ -6,20 +6,6 @@ /* | ||
export function metaTagValue (dom, name) { | ||
if (hasMetaTag(dom, name)) { | ||
return dom.querySelector(`meta[name="${name}"]`).content | ||
} | ||
} | ||
export function hasMetaTag (dom, name) { | ||
return dom.querySelector(`meta[name="${name}"]`) !== null | ||
} | ||
export function hasBackgroundArea (dom) { | ||
let metaTagName = "jimdo.ownbg.allowed" | ||
return (hasMetaTag(dom, metaTagName) && metaTagValue(dom, metaTagName) == "yes") | ||
} | ||
export function placeholdersFor (dom, type) { | ||
let placeholders = [].slice.call(dom.querySelectorAll('var')) | ||
return placeholders.filter((placeholder) => placeholder.textContent == type) | ||
} | ||
export { default as placeholdersFor } from './placeholdersFor.js' | ||
export { default as hasBackgroundArea } from './hasBackgroundArea.js' | ||
export { default as metaTagValue } from './metaTagValue.js' | ||
export { default as hasMetaTag } from './hasMetaTag.js' | ||
export { default as getVariations } from './getVariations.js' |
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
13677
18
262
1