Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-tag

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-tag - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

9

dist/get-tag.d.ts

@@ -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;

5

dist/get-tag.js

@@ -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;

2

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc