Comparing version 0.1.1 to 0.1.2
@@ -5,1 +5,10 @@ declare type Attributes = { | ||
declare function element(tag: string, content?: string, selfClosing?: boolean, tagInfo?: string): string; | ||
/** | ||
* Create an HTML tag string. | ||
* @param {string} tag HTML tag name. | ||
* @param {string} textContent Text content for the element. | ||
* @param {Attributes} attributes Object representing attribute key/value pairs. | ||
* @param {boolean} selfClosing Boolean representing a self closing element. Default: false | ||
* @return {string} A string representing the constructed HTML element. | ||
*/ | ||
declare function getTag(tag: string, textContent: string, attributes: Attributes | undefined, isSelfClosing?: boolean): string; |
@@ -14,3 +14,3 @@ "use strict"; | ||
*/ | ||
module.exports = (tag, textContent, attributes, isSelfClosing = false) => { | ||
function getTag(tag, textContent, attributes, isSelfClosing = false) { | ||
const selfClosingTags = ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]; | ||
@@ -27,2 +27,3 @@ tag = tag.toLowerCase(); | ||
return element(tag, textContent, selfClosing); | ||
}; | ||
} | ||
module.exports = getTag; |
{ | ||
"name": "get-tag", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Create HTML tag strings on the fly.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/get-tag.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
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
4822
40