inferred-types 0.55.18 → 0.55.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -281,6 +281,15 @@ declare const US_STATE_LOOKUP: readonly [{
281
281
  readonly abbrev: "GU";
282
282
  }];
283
283
 
284
+ /**
285
+ * An array of all valid HTML tags that have both opening and closing tags.
286
+ */
287
+ declare const HTML_BLOCK_TAGS: readonly ["a", "abbr", "address", "article", "aside", "b", "bdi", "bdo", "blockquote", "body", "button", "canvas", "caption", "cite", "code", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "html", "i", "iframe", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video"];
288
+ /**
289
+ * An array of all valid HTML tags that are self-closing (do not have closing tags).
290
+ */
291
+ declare const HTML_ATOMIC_TAGS: readonly ["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"];
292
+
284
293
  /**
285
294
  * All country codes (name, alpha-2, country-code)
286
295
  */
@@ -4503,6 +4512,15 @@ type _Validate<T extends object> = "value" extends keyof T ? true : false;
4503
4512
  */
4504
4513
  type IsVueRef<T> = T extends object ? If<IsEqual<_Len<T>, 0>, false, Retain<_Keys$6<T>, string>["length"] extends 1 ? _Validate<T> : false> : false;
4505
4514
 
4515
+ /**
4516
+ * **IsWideString**`<T>`
4517
+ *
4518
+ * Boolean operator which returns `true` when a _wide_ string
4519
+ * is passed in as `T`. It reports `false` on all other values
4520
+ * including _literal strings_.
4521
+ */
4522
+ type IsWideString<T> = IsEqual<T, string>;
4523
+
4506
4524
  /**
4507
4525
  * **IsWideScalar**`<T>`
4508
4526
  *
@@ -6949,6 +6967,52 @@ type GenList<TContainer, IsRoot extends boolean = true, K extends keyof TContain
6949
6967
  */
6950
6968
  type DotPathFor<TContainer> = TContainer extends Container ? "" | GenList<TContainer, true> : "";
6951
6969
 
6970
+ /**
6971
+ * a valid HTML "block tag" (aka, a tag which requires
6972
+ * an openning and closing tag pair to be valid HTML)
6973
+ */
6974
+ type Html__BlockTag = typeof HTML_BLOCK_TAGS[number];
6975
+ /**
6976
+ * a valid HTML "atomic tag" (aka, a tag which does
6977
+ * NOT have a closing tag)
6978
+ */
6979
+ type Html__AtomicTag = typeof HTML_ATOMIC_TAGS[number];
6980
+ /**
6981
+ * A union of valid _openning_ HTML Block Tags.
6982
+ *
6983
+ * - You can use the generic `T` to isolate down to a subset
6984
+ */
6985
+ type HtmlTagOpen<T extends Html__BlockTag = Html__BlockTag> = `<${T}${string}>`;
6986
+ /**
6987
+ * A union of valid _closing_ HTML Block Tags.
6988
+ *
6989
+ * - You can use the generic `T` to isolate down to a subset
6990
+ */
6991
+ type HtmlTagClose<T extends Html__BlockTag = Html__BlockTag> = `</${T}>`;
6992
+ /**
6993
+ * A union type of valid _atomic_ tags.
6994
+ *
6995
+ * - you can use the generic `T` to isolate down to a subset
6996
+ * of Atomic Tags
6997
+ */
6998
+ type HtmlTagAtomic<T extends Html__AtomicTag = Html__AtomicTag> = `<${T}${string}>`;
6999
+ /**
7000
+ * Allows for any valid HTML tag: openning, closing and atomic.
7001
+ */
7002
+ type HtmlTag = HtmlTagOpen | HtmlTagClose | HtmlTagAtomic;
7003
+ /**
7004
+ * A narrowing utility which takes an input and ensures it's type
7005
+ * is within the _scope_ of the tags provided in `TScope`.
7006
+ */
7007
+ type AsHtmlTag<TInput, TScope extends Html__AtomicTag | Html__BlockTag> = TInput extends HtmlTagAtomic ? TInput : TInput extends HtmlTagOpen ? TInput : TInput extends HtmlTagClose ? TInput : TInput extends `</${string}>` ? HtmlTagClose<Exclude<TScope, Html__AtomicTag>> : TInput extends `<${string}` ? HtmlTagOpen<Exclude<TScope, Html__AtomicTag>> | HtmlTagAtomic extends TInput ? HtmlTagOpen<Exclude<TScope, Html__AtomicTag>> | HtmlTagAtomic : never : IsWideString<TInput> extends true ? HtmlTag : never;
7008
+ /**
7009
+ * **AsHtmlComponentTag**`<T>`
7010
+ *
7011
+ * A type utility that narrows the input type to valid HTML component tags
7012
+ * (`kebab-case` or `PascalCase`) and ensures valid attributes.
7013
+ */
7014
+ type AsHtmlComponentTag<T> = T extends `<${infer Name} ${infer Attr}/>` ? T & (`<${PascalCase<Name>} ${Attr}/>` | `<${KebabCase<Name>} ${Attr}/>`) : T extends `<${infer Name} ${infer Attr}>` ? T & (`<${PascalCase<Name>} ${Attr}>` | `<${KebabCase<Name>} ${Attr}>`) : T extends `<${infer Name}/>` ? T & (`<${PascalCase<Name>}/>` | `<${KebabCase<Name>}/>`) : T extends `<${infer Name}>` ? T & (`<${PascalCase<Name>}` | `<${KebabCase<Name>}`) : T extends string ? IsWideString<T> extends true ? T & `<${PascalCase<StripSurround<T, "<" | ">">>}${string}>` : never : never;
7015
+
6952
7016
  /**
6953
7017
  * **InlineSvg**`<[T]>`
6954
7018
  *
@@ -14530,6 +14594,16 @@ type StartingWithTypeGuard<TStartsWith extends string> = <TValue extends Narrowa
14530
14594
  */
14531
14595
  declare function startsWith<TStartsWith extends string>(startingWith: TStartsWith): StartingWithTypeGuard<TStartsWith>;
14532
14596
 
14597
+ /**
14598
+ * **isHtmlComponentTag**`(...names)`
14599
+ *
14600
+ * A type guard that validates if a value matches a valid HTML component tag.
14601
+ * Supports both `kebab-case` and `PascalCase` component names.
14602
+ *
14603
+ * Attributes are validated using `areAttributesValid()`.
14604
+ */
14605
+ declare function isHtmlComponentTag<T extends readonly string[]>(...names: T): <V>(val: V) => val is V & AsHtmlComponentTag<T[number]>;
14606
+
14533
14607
  /**
14534
14608
  * Tests whether the passed in `val` contains some HTML-like tags in it.
14535
14609
  *
@@ -14545,15 +14619,31 @@ declare function hasHtml(val: unknown): val is string;
14545
14619
  declare function hasValidHtml(val: unknown): val is string;
14546
14620
 
14547
14621
  /**
14548
- * tests whether the `val` passed in is the name of a valid
14622
+ * tests whether the `val` passed in is the **name** of a valid
14549
14623
  * HTML block tag (e.g., "div", "span", etc.)
14624
+ *
14625
+ * **Note:** this will _not_ match with leading or trailing whitespace
14550
14626
  */
14551
14627
  declare function isValidBlockTag(val: unknown): val is string;
14552
14628
  /**
14553
- * test whetehr the `val` pass in is a the name of a valid HTML
14629
+ * test whetehr the `val` pass in is a the **name** of a valid HTML
14554
14630
  * atomic tag (e.g., "br", "meta", etc.)
14631
+ *
14632
+ * **Note:** this will _not_ match with leading or trailing whitespace
14555
14633
  */
14556
14634
  declare function isValidAtomicTag(val: unknown): val is string;
14635
+ /**
14636
+ * **isValidHtmlTag**`(...tags)(val)`
14637
+ *
14638
+ * A higher order type guard which tests that the `val` passed in
14639
+ * is a valid HTML tag (block or atomic) or the types specified.
14640
+ *
14641
+ * - if it's an openning or atomic tag then the tag name is validated
14642
+ * but so are the characters between the tag name and the close.
14643
+ * - if it's a closing tag then NO characters are allowed beyond
14644
+ * that of the tag and the brackets.
14645
+ */
14646
+ declare function isValidHtmlTag<T extends readonly (Html__BlockTag | Html__AtomicTag)[]>(...tags: T): <V>(val: V) => val is V & AsHtmlTag<V, T[number]>;
14557
14647
 
14558
14648
  /**
14559
14649
  * **isHtml**`(val)`
@@ -14582,6 +14672,12 @@ declare function isValidHtml(val: unknown): val is string;
14582
14672
  */
14583
14673
  declare function isHtmlElement(val: unknown): val is HTMLElement;
14584
14674
 
14675
+ /**
14676
+ * type guard which validates that `val` is a string which could represent
14677
+ * the attributes in an HTML tag.
14678
+ */
14679
+ declare function validHtmlAttributes(val: unknown): val is string;
14680
+
14585
14681
  /**
14586
14682
  * **isAlpha**(value)
14587
14683
  *
@@ -15850,4 +15946,4 @@ declare function isVueRef(val: unknown): val is VueRef;
15850
15946
  */
15851
15947
  declare function asVueRef<T extends Narrowable>(value: T): VueRef<T>;
15852
15948
 
15853
- export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type ConfigRestApi, type CssFromDefnOption, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type DictionaryWithValueFilter, type DictionaryWithoutValueFilter, type DoesExtendTypeguard, type EndingWithTypeGuard, type EndpointGenerator, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetInferenceProps, type GetOptions, type Joiner, type KeyframeApi, type Mapper, type MetricTypeGuard, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type ToKeyValueSort, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UomTypeGuard, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, cardType, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createMapper, createObjectMap, createTypeToken, cssColor, cssFromDefinition, csv, defineCss, defineObj, defineObject, defineObjectApi, defineTuple, doesExtend, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, filterEmpty, filterUndefined, find, fnMeta, fromDefineObject, fromKeyValue, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasHtml, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMap, isMapToken, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMoment, isNarrowableObject, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetContainer, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeSubtype, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidHtml, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isVueRef, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, narrowObjectTo, narrowObjectToType, never, objectToApi, objectValues, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toKeyValue, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, valuesOf, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };
15949
+ export { type AsClassSelector, type AsList, type BoxValue, type BoxedFnParams, type ConfigRestApi, type CssFromDefnOption, type CssKeyframeCallback, type CssSelectorOptions, type CsvFormat, type DictionaryWithValueFilter, type DictionaryWithoutValueFilter, type DoesExtendTypeguard, type EndingWithTypeGuard, type EndpointGenerator, type EqualTo, type Finder, type FnParam, type FnParams, type GenParam, type GenParams, type GetEachOptions, type GetInference, type GetInferenceProps, type GetOptions, type Joiner, type KeyframeApi, type Mapper, type MetricTypeGuard, type Rtn, ShapeApiImplementation, type SingletonClosure, type StartingWithTypeGuard, type StripSurroundConfigured, type SurroundWith, type ToKeyValueSort, type TokenContainerClosure, type TokenFunctionClosure, type TokenSetClosure, type TypeOfTypeGuard, type Unbox, type UndefinedArrayIsUnknown, type UnionClosure, type UomTypeGuard, type UrlMeta, type YouTubeMeta, addFnToProps, addPropsToFn, and, asApi, asArray, asChars, asDate, asEscapeFunction, asIsoDate, asOptionalParamFunction, asPhoneFormat, asRecord, asString, asStringLiteral, asType, asTypeToken, asVueRef, box, boxDictionaryValues, capitalize, cardType, choices, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createFnWithPropsExplicit, createLifoQueue, createMapper, createObjectMap, createTypeToken, cssColor, cssFromDefinition, csv, defineCss, defineObj, defineObject, defineObjectApi, defineTuple, doesExtend, endsWith, ensureLeading, ensureSurround, ensureTrailing, entries, errCondition, filter, filterEmpty, filterUndefined, find, fnMeta, fromDefineObject, fromKeyValue, get, getDaysBetween, getEach, getPhoneCountryCode, getTailwindModifiers, getToday, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasHtml, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, indexOf, infer, intersect, intersection, ip6GroupExpansion, ip6Prefix, isAccelerationMetric, isAccelerationUom, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isArrayToken, isAtomicKind, isAtomicToken, isAustralianNewsUrl, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanLike, isBox, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isConstant, isContainer, isContainerToken, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDefineObject, isDefined, isDellUrl, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEqual, isErrorCondition, isEscapeFunction, isEtsyUrl, isFalse, isFalsy, isFnBasedKind, isFnBasedToken, isFnWithParams, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlComponentTag, isHtmlElement, isIkeaUrl, isIndexable, isIndianNewsUrl, isInlineSvg, isIp4Address, isIp6Address, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoTime, isIsoYear, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDateTime, isMacysUrl, isMap, isMapToken, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMoment, isNarrowableObject, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotNull, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectToken, isOptionalParamFunction, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRecordToken, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isSameTypeOf, isScalar, isSemanticVersion, isSet, isSetBasedKind, isSetBasedToken, isSetContainer, isSetToken, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSingletonKind, isSingletonToken, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isString, isStringArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTargetUrl, isTemperatureMetric, isTemperatureUom, isThenable, isThisMonth, isThisWeek, isThisYear, isTimeMetric, isTimeUom, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTupleToken, isTurkishNewsUrl, isTypeOf, isTypeSubtype, isTypeToken, isTypeTokenKind, isTypeTuple, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidHtml, isValidHtmlTag, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isVueRef, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, jsonValue, jsonValues, keysOf, kindLiteral, last, list, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, nameLiteral, narrow, narrowObjectTo, narrowObjectToType, never, objectToApi, objectValues, omit, optional, optionalOrNull, or, orNull, pathJoin, pluralize, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, result, retain, retainAfter, retainAfterInclusive, retainChars, retainUntil, retainUntilInclusive, retainWhile, reverse, rightWhitespace, shape, sharedKeys, shift, simpleContainerToken, simpleContainerTokenToTypeToken, simpleContainerType, simpleScalarToken, simpleScalarTokenToTypeToken, simpleScalarType, simpleToken, simpleType, simpleUnionTokenToTypeToken, slice, split, startsWith, stripAfter, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, takeNumericCharacters, takeProp, toCamelCase, toKebabCase, toKeyValue, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toUppercase, trim, trimEnd, trimLeft, trimRight, trimStart, truncate, tuple, twColor, unbox, uncapitalize, union, unionize, unique, uniqueKeys, unset, uppercase, urlMeta, validHtmlAttributes, valuesOf, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, wrapFn, youtubeEmbed, youtubeMeta };
@@ -3491,6 +3491,36 @@ function startsWith(startingWith) {
3491
3491
  };
3492
3492
  }
3493
3493
 
3494
+ // src/type-guards/html/component-tags.ts
3495
+ function isHtmlComponentTag(...names) {
3496
+ return (val) => {
3497
+ if (typeof val !== "string")
3498
+ return false;
3499
+ const trimmedVal = val.trim();
3500
+ const tagRegex = /^<\/?([\w-]+)(.*?)>$/;
3501
+ const match = tagRegex.exec(trimmedVal);
3502
+ if (!match) {
3503
+ return false;
3504
+ }
3505
+ const [, tagName, attributes] = match;
3506
+ const isClosingTag = trimmedVal.startsWith("</");
3507
+ const isKebabCase = /^[a-z][a-z0-9-]*$/.test(tagName);
3508
+ const isPascalCase = /^[A-Z][a-zA-Z0-9]*$/.test(tagName);
3509
+ const normalizedKebabCase = toKebabCase(tagName);
3510
+ const normalizedPascalCase = toPascalCase(tagName);
3511
+ const isValidName = names.some(
3512
+ (name) => isKebabCase && normalizedKebabCase === toKebabCase(name) || isPascalCase && normalizedPascalCase === toPascalCase(name)
3513
+ );
3514
+ if (!isValidName) {
3515
+ return false;
3516
+ }
3517
+ if (isClosingTag) {
3518
+ return attributes.trim() === "";
3519
+ }
3520
+ return validHtmlAttributes(attributes);
3521
+ };
3522
+ }
3523
+
3494
3524
  // src/type-guards/html/hasHtml.ts
3495
3525
  function hasHtml(val) {
3496
3526
  if (typeof val !== "string")
@@ -3537,6 +3567,39 @@ function isValidBlockTag(val) {
3537
3567
  function isValidAtomicTag(val) {
3538
3568
  return isString(val) && HTML_ATOMIC_TAGS.includes(val.toLowerCase());
3539
3569
  }
3570
+ function isValidHtmlTag(...tags) {
3571
+ return (val) => {
3572
+ if (typeof val !== "string")
3573
+ return false;
3574
+ const trimmedVal = val.trim();
3575
+ const tagRegex = /^<\/?(\w+)(.*?)>$/;
3576
+ const match = tagRegex.exec(trimmedVal);
3577
+ if (!match) {
3578
+ return false;
3579
+ }
3580
+ const [, tagName, attributes] = match;
3581
+ const normalizedTagName = tagName.toLowerCase();
3582
+ const isClosingTag = trimmedVal.startsWith("</");
3583
+ const isAtomicTag = HTML_ATOMIC_TAGS.includes(normalizedTagName);
3584
+ const isBlockTag = HTML_BLOCK_TAGS.includes(normalizedTagName);
3585
+ if (
3586
+ // Validate tag name is within the provided `tags` scope
3587
+ !tags.map((t) => t.toLowerCase()).includes(normalizedTagName)
3588
+ ) {
3589
+ return false;
3590
+ }
3591
+ if (isClosingTag) {
3592
+ return attributes.trim() === "" && !isAtomicTag;
3593
+ }
3594
+ if (isAtomicTag) {
3595
+ return attributes.trim() === "" || validHtmlAttributes(attributes);
3596
+ }
3597
+ if (isBlockTag) {
3598
+ return validHtmlAttributes(attributes);
3599
+ }
3600
+ return false;
3601
+ };
3602
+ }
3540
3603
 
3541
3604
  // src/type-guards/html/isHtml.ts
3542
3605
  function isHtml(val) {
@@ -3584,6 +3647,16 @@ function isHtmlElement(val) {
3584
3647
  return isObject(val) && "attributes" in val && "firstElementChild" in val && "innerHTML" in val;
3585
3648
  }
3586
3649
 
3650
+ // src/type-guards/html/validHtmlAttributes.ts
3651
+ function validHtmlAttributes(val) {
3652
+ if (typeof val !== "string")
3653
+ return false;
3654
+ const quoteRegex = /["']/g;
3655
+ const unmatchedQuotes = (val.match(quoteRegex)?.length || 0) % 2 !== 0;
3656
+ const invalidAssignment = /(\w+=)(?=\s|>|$)/.test(val);
3657
+ return !val.includes(">") && !unmatchedQuotes && !invalidAssignment;
3658
+ }
3659
+
3587
3660
  // src/type-guards/isAlpha.ts
3588
3661
  function isAlpha(value) {
3589
3662
  return isString(value) && split(value).every((v) => ALPHA_CHARS.includes(v));
@@ -6164,6 +6237,7 @@ export {
6164
6237
  isHmUrl,
6165
6238
  isHomeDepotUrl,
6166
6239
  isHtml,
6240
+ isHtmlComponentTag,
6167
6241
  isHtmlElement,
6168
6242
  isIkeaUrl,
6169
6243
  isIndexable,
@@ -6310,6 +6384,7 @@ export {
6310
6384
  isValidAtomicTag,
6311
6385
  isValidBlockTag,
6312
6386
  isValidHtml,
6387
+ isValidHtmlTag,
6313
6388
  isVariable,
6314
6389
  isVisa,
6315
6390
  isVisaMastercard,
@@ -6436,6 +6511,7 @@ export {
6436
6511
  unset,
6437
6512
  uppercase,
6438
6513
  urlMeta,
6514
+ validHtmlAttributes,
6439
6515
  valuesOf,
6440
6516
  widen,
6441
6517
  withDefaults,