New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

html-spec-tags

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-spec-tags - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

dist/tag-name-by-constructor.d.ts

17

dist/all-tags.d.ts

@@ -1,5 +0,5 @@

import { Constructor } from 'type-fest';
import { HtmlSpecTagName } from './html';
import { MathmlSpecTagName } from './mathml';
import { SvgSpecTagName } from './svg';
import { PropertyValueType } from '@augment-vir/common';
import { HtmlSpecTagName, htmlSpecConstructorsByTagName } from './html';
import { MathmlSpecTagName, mathmlSpecConstructorsByTagName } from './mathml';
import { SvgSpecTagName, svgSpecConstructorsByTagName } from './svg';
/** All possible spec tag names in a single array. */

@@ -9,2 +9,4 @@ export declare const allSpecTagNames: ReadonlyArray<SpecTagName>;

export type SpecTagName = HtmlSpecTagName | SvgSpecTagName | MathmlSpecTagName;
/** Any of the possible spec tag name constructors. */
export type SpecTagNameConstructor = PropertyValueType<typeof htmlSpecConstructorsByTagName> | PropertyValueType<typeof mathmlSpecConstructorsByTagName> | PropertyValueType<typeof svgSpecConstructorsByTagName>;
/**

@@ -22,3 +24,3 @@ * Get the constructor for the given tag name. Since there are some duplicate tag names, the

*/
export declare function getTagNameConstructor(tagName: SpecTagName): Constructor<Element>;
export declare function getSpecTagNameConstructor(tagName: SpecTagName): SpecTagNameConstructor;
/** Type guards the input as a valid spec tag name. */

@@ -30,1 +32,6 @@ export declare function isSpecTagName(input: unknown): input is SpecTagName;

export declare function ensureSpecTagName(input: unknown): SpecTagName;
/**
* Get a spec tag name from the given constructor. Note that some constructors match multiple tags
* so you might get an unexpected output here.
*/
export declare function getSpecTagNameFromConstructor(constructor: SpecTagNameConstructor): SpecTagName;

@@ -6,2 +6,3 @@ import { isTruthy, typedArrayIncludes, wrapInTry } from '@augment-vir/common';

import { allSvgSpecTagNames, svgSpecConstructorsByTagName } from './svg';
import { specTagNameByConstructor } from './tag-name-by-constructor';
/** All possible spec tag names in a single array. */

@@ -25,3 +26,3 @@ export const allSpecTagNames = Array.from(new Set([

*/
export function getTagNameConstructor(tagName) {
export function getSpecTagNameConstructor(tagName) {
const constructor = htmlSpecConstructorsByTagName[tagName] ||

@@ -69,1 +70,12 @@ svgSpecConstructorsByTagName[tagName] ||

}
/**
* Get a spec tag name from the given constructor. Note that some constructors match multiple tags
* so you might get an unexpected output here.
*/
export function getSpecTagNameFromConstructor(constructor) {
const tagName = specTagNameByConstructor.get(constructor);
if (!tagName) {
throw new TypeError(`'${constructor.name}' is not a valid spec tag name constructor.`);
}
return tagName;
}
{
"name": "html-spec-tags",
"version": "2.1.0",
"version": "2.2.0",
"description": "All HTML tags supported by the current spec. With types!",

@@ -5,0 +5,0 @@ "keywords": [

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