inferred-types 0.55.15 → 0.55.16
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.
- package/modules/inferred-types/dist/index.cjs +118 -19
- package/modules/inferred-types/dist/index.cjs.map +1 -1
- package/modules/inferred-types/dist/index.d.ts +340 -34
- package/modules/inferred-types/dist/index.js +115 -18
- package/modules/inferred-types/dist/index.js.map +1 -1
- package/modules/runtime/dist/index.cjs +118 -19
- package/modules/runtime/dist/index.cjs.map +1 -1
- package/modules/runtime/dist/index.d.ts +186 -18
- package/modules/runtime/dist/index.js +115 -18
- package/modules/runtime/dist/index.js.map +1 -1
- package/modules/types/dist/index.d.ts +154 -16
- package/package.json +1 -1
|
@@ -8129,6 +8129,160 @@ type FrequencyUom = {
|
|
|
8129
8129
|
*/
|
|
8130
8130
|
type Frequency = `${number}${OptSpace}${FrequencyUom}`;
|
|
8131
8131
|
|
|
8132
|
+
/**
|
|
8133
|
+
* **MetricCategory**
|
|
8134
|
+
*
|
|
8135
|
+
* A valid "category" for a `Metric` or `Uom`.
|
|
8136
|
+
*
|
|
8137
|
+
* **Related:** `Uom`, `Metric`
|
|
8138
|
+
*/
|
|
8139
|
+
type MetricCategory = "Acceleration" | "Area" | "Current" | "Distance" | "Frequency" | "Luminosity" | "Mass" | "Power" | "Pressure" | "Resistance" | "Speed" | "Temperature" | "Time" | "Voltage" | "Volume";
|
|
8140
|
+
type UnitsByCategory<T extends string, M extends readonly [string, string][], R extends string = never> = [] extends M ? R : UnitsByCategory<T, AfterFirst<M>, T extends First<M>[0] ? R | First<M>[1] : R>;
|
|
8141
|
+
/**
|
|
8142
|
+
* **Uom**`<[T]>`
|
|
8143
|
+
*
|
|
8144
|
+
* A _unit of measure_ for a **metric**.
|
|
8145
|
+
*
|
|
8146
|
+
* - you may filter down to only units of a certain category(s) of `MetricCategory`
|
|
8147
|
+
* by adjusting `T`.
|
|
8148
|
+
*
|
|
8149
|
+
* **Related:** `Metric`, `MetricCategory`, `AreaUom`, `SpeedUom`, ...
|
|
8150
|
+
*/
|
|
8151
|
+
type Uom<T extends MetricCategory = MetricCategory> = UnitsByCategory<T, [
|
|
8152
|
+
[
|
|
8153
|
+
"Acceleration",
|
|
8154
|
+
AccelerationUom
|
|
8155
|
+
],
|
|
8156
|
+
[
|
|
8157
|
+
"Area",
|
|
8158
|
+
AreaUom
|
|
8159
|
+
],
|
|
8160
|
+
[
|
|
8161
|
+
"Current",
|
|
8162
|
+
CurrentUom
|
|
8163
|
+
],
|
|
8164
|
+
[
|
|
8165
|
+
"Distance",
|
|
8166
|
+
DistanceUom
|
|
8167
|
+
],
|
|
8168
|
+
[
|
|
8169
|
+
"Frequency",
|
|
8170
|
+
FrequencyUom
|
|
8171
|
+
],
|
|
8172
|
+
[
|
|
8173
|
+
"Luminosity",
|
|
8174
|
+
LuminosityUom
|
|
8175
|
+
],
|
|
8176
|
+
[
|
|
8177
|
+
"Mass",
|
|
8178
|
+
MassUom
|
|
8179
|
+
],
|
|
8180
|
+
[
|
|
8181
|
+
"Power",
|
|
8182
|
+
PowerUom
|
|
8183
|
+
],
|
|
8184
|
+
[
|
|
8185
|
+
"Pressure",
|
|
8186
|
+
PressureUom
|
|
8187
|
+
],
|
|
8188
|
+
[
|
|
8189
|
+
"Resistance",
|
|
8190
|
+
ResistanceUom
|
|
8191
|
+
],
|
|
8192
|
+
[
|
|
8193
|
+
"Speed",
|
|
8194
|
+
SpeedUom
|
|
8195
|
+
],
|
|
8196
|
+
[
|
|
8197
|
+
"Temperature",
|
|
8198
|
+
TemperatureUom
|
|
8199
|
+
],
|
|
8200
|
+
[
|
|
8201
|
+
"Time",
|
|
8202
|
+
TimeUom
|
|
8203
|
+
],
|
|
8204
|
+
[
|
|
8205
|
+
"Volume",
|
|
8206
|
+
VoltageUom
|
|
8207
|
+
],
|
|
8208
|
+
[
|
|
8209
|
+
"Voltage",
|
|
8210
|
+
VolumeUom
|
|
8211
|
+
]
|
|
8212
|
+
]>;
|
|
8213
|
+
/**
|
|
8214
|
+
* **Metric**`<T>`
|
|
8215
|
+
*
|
|
8216
|
+
* A measurement which includes a numeric value plus the Unit of Measure (UOM).
|
|
8217
|
+
*
|
|
8218
|
+
* - you may filter down to only metrics of a certain category(s) of `MetricCategory`
|
|
8219
|
+
* by adjusting `T`.
|
|
8220
|
+
*
|
|
8221
|
+
* **Related:** `Uom`, `MetricCategory`
|
|
8222
|
+
*/
|
|
8223
|
+
type Metric<T extends MetricCategory = MetricCategory> = UnitsByCategory<T, [
|
|
8224
|
+
[
|
|
8225
|
+
"Acceleration",
|
|
8226
|
+
Acceleration
|
|
8227
|
+
],
|
|
8228
|
+
[
|
|
8229
|
+
"Area",
|
|
8230
|
+
Area
|
|
8231
|
+
],
|
|
8232
|
+
[
|
|
8233
|
+
"Current",
|
|
8234
|
+
Current
|
|
8235
|
+
],
|
|
8236
|
+
[
|
|
8237
|
+
"Distance",
|
|
8238
|
+
Distance
|
|
8239
|
+
],
|
|
8240
|
+
[
|
|
8241
|
+
"Frequency",
|
|
8242
|
+
Frequency
|
|
8243
|
+
],
|
|
8244
|
+
[
|
|
8245
|
+
"Luminosity",
|
|
8246
|
+
Luminosity
|
|
8247
|
+
],
|
|
8248
|
+
[
|
|
8249
|
+
"Mass",
|
|
8250
|
+
Mass
|
|
8251
|
+
],
|
|
8252
|
+
[
|
|
8253
|
+
"Power",
|
|
8254
|
+
Power
|
|
8255
|
+
],
|
|
8256
|
+
[
|
|
8257
|
+
"Pressure",
|
|
8258
|
+
Pressure
|
|
8259
|
+
],
|
|
8260
|
+
[
|
|
8261
|
+
"Resistance",
|
|
8262
|
+
Resistance
|
|
8263
|
+
],
|
|
8264
|
+
[
|
|
8265
|
+
"Speed",
|
|
8266
|
+
Speed
|
|
8267
|
+
],
|
|
8268
|
+
[
|
|
8269
|
+
"Temperature",
|
|
8270
|
+
Temperature
|
|
8271
|
+
],
|
|
8272
|
+
[
|
|
8273
|
+
"TimeMetric",
|
|
8274
|
+
TimeMetric
|
|
8275
|
+
],
|
|
8276
|
+
[
|
|
8277
|
+
"Voltage",
|
|
8278
|
+
Voltage
|
|
8279
|
+
],
|
|
8280
|
+
[
|
|
8281
|
+
"Volume",
|
|
8282
|
+
Volume
|
|
8283
|
+
]
|
|
8284
|
+
]>;
|
|
8285
|
+
|
|
8132
8286
|
type LuminosityMetricsLookup = typeof LUMINOSITY_METRICS_LOOKUP;
|
|
8133
8287
|
/**
|
|
8134
8288
|
* Unit of measure for metrics associated with **Luminosity**.
|
|
@@ -8297,22 +8451,6 @@ type VolumeUom = {
|
|
|
8297
8451
|
*/
|
|
8298
8452
|
type Volume = `${number}${OptSpace}${VolumeUom}`;
|
|
8299
8453
|
|
|
8300
|
-
/**
|
|
8301
|
-
* A measurement which includes a numeric value plus the Unit of Measure (UOM).
|
|
8302
|
-
*
|
|
8303
|
-
* **Related:** `Uom`
|
|
8304
|
-
*/
|
|
8305
|
-
type Metric = Acceleration | Area | Current | Distance | Frequency | Luminosity | Mass | Power | Pressure | Resistance | Speed | Temperature | TimeMetric | Voltage | Volume;
|
|
8306
|
-
type MetricCategory = "Acceleration" | "Area" | "Current" | "Distance" | "Frequency" | "Luminosity" | "Mass" | "Power" | "Pressure" | "Resistance" | "Speed" | "Temperature" | "Time" | "Voltage" | "Volume";
|
|
8307
|
-
/**
|
|
8308
|
-
* **Uom**
|
|
8309
|
-
*
|
|
8310
|
-
* A _unit of measure_ for a **metric**.
|
|
8311
|
-
*
|
|
8312
|
-
* **Related:** `Metric`, `AreaUom`, `SpeedUom`,`MassUom`, `DistanceUom`, ...
|
|
8313
|
-
*/
|
|
8314
|
-
type Uom = AccelerationUom | AreaUom | CurrentUom | DistanceUom | FrequencyUom | LuminosityUom | MassUom | PowerUom | PressureUom | ResistanceUom | SpeedUom | TemperatureUom | TimeUom | VoltageUom | VolumeUom;
|
|
8315
|
-
|
|
8316
8454
|
/**
|
|
8317
8455
|
* **TypeRequired**
|
|
8318
8456
|
*
|
|
@@ -14849,7 +14987,7 @@ declare function isVariable(val: unknown): val is Variable;
|
|
|
14849
14987
|
|
|
14850
14988
|
declare function isAreaMetric(val: unknown): val is Area;
|
|
14851
14989
|
declare function isLuminosityMetric(val: unknown): val is Luminosity;
|
|
14852
|
-
declare function
|
|
14990
|
+
declare function isResistanceMetric(val: unknown): val is Resistance;
|
|
14853
14991
|
declare function isCurrentMetric(val: unknown): val is Current;
|
|
14854
14992
|
declare function isVoltageMetric(val: unknown): val is Voltage;
|
|
14855
14993
|
declare function isFrequencyMetric(val: unknown): val is Frequency;
|
|
@@ -14868,6 +15006,19 @@ declare function isDistanceMetric(val: unknown): val is Distance;
|
|
|
14868
15006
|
* of measure).
|
|
14869
15007
|
*/
|
|
14870
15008
|
declare function isMetric(val: unknown): val is Metric;
|
|
15009
|
+
type MetricTypeGuard<TCat extends readonly MetricCategory[]> = ((val: unknown) => boolean) & {
|
|
15010
|
+
categories: TCat;
|
|
15011
|
+
kind: "MetricTypeGuard";
|
|
15012
|
+
};
|
|
15013
|
+
/**
|
|
15014
|
+
* **isMetricCategory**`(...categories) => (val) => val is Uom<T>`
|
|
15015
|
+
*
|
|
15016
|
+
* A higher order type guard which validates that a value is a metric
|
|
15017
|
+
* with the specified category(s) UOM's.
|
|
15018
|
+
*
|
|
15019
|
+
* **Related:** `isMetric()`, `isAreaMetric()`, `isSpeedMetric()`, ...
|
|
15020
|
+
*/
|
|
15021
|
+
declare function isMetricCategory<TCat extends readonly [MetricCategory, ...MetricCategory[]]>(...categories: TCat): MetricTypeGuard<TCat>;
|
|
14871
15022
|
|
|
14872
15023
|
declare function isAreaUom(val: unknown): val is AreaUom;
|
|
14873
15024
|
declare function isLuminosityUom(val: unknown): val is LuminosityUom;
|
|
@@ -14888,8 +15039,25 @@ declare function isDistanceUom(val: unknown): val is DistanceUom;
|
|
|
14888
15039
|
/**
|
|
14889
15040
|
* Type guard which validates the passed in `val` is a `Uom` (unit
|
|
14890
15041
|
* of measure).
|
|
15042
|
+
*
|
|
15043
|
+
* **Related:**
|
|
15044
|
+
* - `isUomCategory(c)(v)`
|
|
15045
|
+
* - `isSpeedUom(v)`, `isMassUom(v)`, ...
|
|
14891
15046
|
*/
|
|
14892
15047
|
declare function isUom(val: unknown): val is Uom;
|
|
15048
|
+
type UomTypeGuard<TCat extends readonly MetricCategory[]> = ((val: unknown) => boolean) & {
|
|
15049
|
+
categories: TCat;
|
|
15050
|
+
kind: "UomTypeGuard";
|
|
15051
|
+
};
|
|
15052
|
+
/**
|
|
15053
|
+
* **isUomCategory**`(...categories) => (val) => val is Uom<T>`
|
|
15054
|
+
*
|
|
15055
|
+
* A higher order type guard which validates that a value is of
|
|
15056
|
+
* the specified metric category or categories.
|
|
15057
|
+
*
|
|
15058
|
+
* **Related:** `isUom()`, `isAreaUom()`, `isSpeedUom()`, ...
|
|
15059
|
+
*/
|
|
15060
|
+
declare function isUomCategory<TCat extends readonly [MetricCategory, ...MetricCategory[]]>(...categories: TCat): UomTypeGuard<TCat>;
|
|
14893
15061
|
|
|
14894
15062
|
/**
|
|
14895
15063
|
* **isIp4Address**`(val)`
|
|
@@ -15637,4 +15805,4 @@ declare function isVueRef(val: unknown): val is VueRef;
|
|
|
15637
15805
|
*/
|
|
15638
15806
|
declare function asVueRef<T extends Narrowable>(value: T): VueRef<T>;
|
|
15639
15807
|
|
|
15640
|
-
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 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 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, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, 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, 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, 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,
|
|
15808
|
+
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, hasIndexOf, hasKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasUrlPort, hasUrlQueryParameter, 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, 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, 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 };
|
|
@@ -3688,58 +3688,107 @@ function isVariable(val) {
|
|
|
3688
3688
|
function separate(s) {
|
|
3689
3689
|
return stripWhile(s.toLowerCase(), ...NUMERIC_CHAR).trim();
|
|
3690
3690
|
}
|
|
3691
|
+
function startsWithNumber(val) {
|
|
3692
|
+
return isString(val) && isNumberLike(val.slice(0, 1));
|
|
3693
|
+
}
|
|
3691
3694
|
function isAreaMetric(val) {
|
|
3692
|
-
return isString(val) && AREA_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3695
|
+
return isString(val) && startsWithNumber(val) && AREA_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3693
3696
|
}
|
|
3694
3697
|
function isLuminosityMetric(val) {
|
|
3695
|
-
return isString(val) && LUMINOSITY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3698
|
+
return isString(val) && startsWithNumber(val) && LUMINOSITY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3696
3699
|
}
|
|
3697
|
-
function
|
|
3698
|
-
return isString(val) && RESISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3700
|
+
function isResistanceMetric(val) {
|
|
3701
|
+
return isString(val) && startsWithNumber(val) && RESISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3699
3702
|
}
|
|
3700
3703
|
function isCurrentMetric(val) {
|
|
3701
|
-
return isString(val) && CURRENT_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3704
|
+
return isString(val) && startsWithNumber(val) && CURRENT_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3702
3705
|
}
|
|
3703
3706
|
function isVoltageMetric(val) {
|
|
3704
|
-
return isString(val) && VOLTAGE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3707
|
+
return isString(val) && startsWithNumber(val) && VOLTAGE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3705
3708
|
}
|
|
3706
3709
|
function isFrequencyMetric(val) {
|
|
3707
|
-
return isString(val) && FREQUENCY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3710
|
+
return isString(val) && startsWithNumber(val) && FREQUENCY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3708
3711
|
}
|
|
3709
3712
|
function isPowerMetric(val) {
|
|
3710
|
-
return isString(val) && POWER_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3713
|
+
return isString(val) && startsWithNumber(val) && POWER_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3711
3714
|
}
|
|
3712
3715
|
function isTimeMetric(val) {
|
|
3713
|
-
return isString(val) && TIME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3716
|
+
return isString(val) && startsWithNumber(val) && TIME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3714
3717
|
}
|
|
3715
3718
|
function isEnergyMetric(val) {
|
|
3716
|
-
return isString(val) && ENERGY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3719
|
+
return isString(val) && startsWithNumber(val) && ENERGY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3717
3720
|
}
|
|
3718
3721
|
function isPressureMetric(val) {
|
|
3719
|
-
return isString(val) && PRESSURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3722
|
+
return isString(val) && startsWithNumber(val) && PRESSURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3720
3723
|
}
|
|
3721
3724
|
function isTemperatureMetric(val) {
|
|
3722
|
-
return isString(val) && TEMPERATURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3725
|
+
return isString(val) && startsWithNumber(val) && TEMPERATURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3723
3726
|
}
|
|
3724
3727
|
function isVolumeMetric(val) {
|
|
3725
|
-
return isString(val) && VOLUME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3728
|
+
return isString(val) && startsWithNumber(val) && VOLUME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3726
3729
|
}
|
|
3727
3730
|
function isAccelerationMetric(val) {
|
|
3728
|
-
return isString(val) && ACCELERATION_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3731
|
+
return isString(val) && startsWithNumber(val) && ACCELERATION_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3729
3732
|
}
|
|
3730
3733
|
function isSpeedMetric(val) {
|
|
3731
3734
|
const speed = SPEED_METRICS_LOOKUP.map((i) => i.abbrev);
|
|
3732
|
-
return isString(val) && speed.includes(separate(val));
|
|
3735
|
+
return isString(val) && startsWithNumber(val) && speed.includes(separate(val));
|
|
3733
3736
|
}
|
|
3734
3737
|
function isMassMetric(val) {
|
|
3735
|
-
return isString(val) && MASS_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3738
|
+
return isString(val) && startsWithNumber(val) && MASS_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3736
3739
|
}
|
|
3737
3740
|
function isDistanceMetric(val) {
|
|
3738
|
-
return isString(val) && DISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3741
|
+
return isString(val) && startsWithNumber(val) && DISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3739
3742
|
}
|
|
3740
3743
|
function isMetric(val) {
|
|
3741
3744
|
return isDistanceMetric(val) || isMassMetric(val) || isSpeedMetric(val) || isAccelerationMetric(val) || isVoltageMetric(val) || isTemperatureMetric(val) || isPressureMetric(val) || isEnergyMetric(val) || isTimeMetric(val) || isPowerMetric(val) || isFrequencyMetric(val) || isVoltageMetric(val) || isCurrentMetric(val) || isLuminosityMetric(val) || isAreaMetric(val);
|
|
3742
3745
|
}
|
|
3746
|
+
function getCategories(c) {
|
|
3747
|
+
return c.map(
|
|
3748
|
+
(i) => {
|
|
3749
|
+
switch (i) {
|
|
3750
|
+
case "Acceleration":
|
|
3751
|
+
return isAccelerationMetric;
|
|
3752
|
+
case "Area":
|
|
3753
|
+
return isAreaMetric;
|
|
3754
|
+
case "Current":
|
|
3755
|
+
return isCurrentMetric;
|
|
3756
|
+
case "Distance":
|
|
3757
|
+
return isDistanceMetric;
|
|
3758
|
+
case "Frequency":
|
|
3759
|
+
return isFrequencyMetric;
|
|
3760
|
+
case "Luminosity":
|
|
3761
|
+
return isLuminosityMetric;
|
|
3762
|
+
case "Mass":
|
|
3763
|
+
return isMassMetric;
|
|
3764
|
+
case "Power":
|
|
3765
|
+
return isPowerMetric;
|
|
3766
|
+
case "Pressure":
|
|
3767
|
+
return isPressureMetric;
|
|
3768
|
+
case "Resistance":
|
|
3769
|
+
return isResistanceMetric;
|
|
3770
|
+
case "Speed":
|
|
3771
|
+
return isSpeedMetric;
|
|
3772
|
+
case "Temperature":
|
|
3773
|
+
return isTemperatureMetric;
|
|
3774
|
+
case "Time":
|
|
3775
|
+
return isTimeMetric;
|
|
3776
|
+
case "Voltage":
|
|
3777
|
+
return isVoltageMetric;
|
|
3778
|
+
case "Volume":
|
|
3779
|
+
return isVoltageMetric;
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
);
|
|
3783
|
+
}
|
|
3784
|
+
function isMetricCategory(...categories) {
|
|
3785
|
+
const fn2 = (val) => {
|
|
3786
|
+
const tests = getCategories(categories);
|
|
3787
|
+
return tests.some((i) => i(val));
|
|
3788
|
+
};
|
|
3789
|
+
const props = { categories, kind: "MetricTypeGuard" };
|
|
3790
|
+
return createFnWithProps(fn2, props);
|
|
3791
|
+
}
|
|
3743
3792
|
|
|
3744
3793
|
// src/type-guards/metrics/isUom.ts
|
|
3745
3794
|
function isAreaUom(val) {
|
|
@@ -3793,6 +3842,52 @@ function isDistanceUom(val) {
|
|
|
3793
3842
|
function isUom(val) {
|
|
3794
3843
|
return isDistanceUom(val) || isMassUom(val) || isSpeedUom(val) || isAccelerationUom(val) || isVoltageUom(val) || isTemperatureUom(val) || isPressureUom(val) || isEnergyUom(val) || isTimeUom(val) || isPowerUom(val) || isFrequencyUom(val) || isVoltageUom(val) || isCurrentUom(val) || isLuminosityUom(val) || isAreaUom(val);
|
|
3795
3844
|
}
|
|
3845
|
+
function getCategories2(c) {
|
|
3846
|
+
return c.map(
|
|
3847
|
+
(i) => {
|
|
3848
|
+
switch (i) {
|
|
3849
|
+
case "Acceleration":
|
|
3850
|
+
return isAccelerationUom;
|
|
3851
|
+
case "Area":
|
|
3852
|
+
return isAreaUom;
|
|
3853
|
+
case "Current":
|
|
3854
|
+
return isCurrentUom;
|
|
3855
|
+
case "Distance":
|
|
3856
|
+
return isDistanceUom;
|
|
3857
|
+
case "Frequency":
|
|
3858
|
+
return isFrequencyUom;
|
|
3859
|
+
case "Luminosity":
|
|
3860
|
+
return isLuminosityUom;
|
|
3861
|
+
case "Mass":
|
|
3862
|
+
return isMassUom;
|
|
3863
|
+
case "Power":
|
|
3864
|
+
return isPowerUom;
|
|
3865
|
+
case "Pressure":
|
|
3866
|
+
return isPressureUom;
|
|
3867
|
+
case "Resistance":
|
|
3868
|
+
return isResistanceUom;
|
|
3869
|
+
case "Speed":
|
|
3870
|
+
return isSpeedUom;
|
|
3871
|
+
case "Temperature":
|
|
3872
|
+
return isTemperatureUom;
|
|
3873
|
+
case "Time":
|
|
3874
|
+
return isTimeUom;
|
|
3875
|
+
case "Voltage":
|
|
3876
|
+
return isVoltageUom;
|
|
3877
|
+
case "Volume":
|
|
3878
|
+
return isVoltageUom;
|
|
3879
|
+
}
|
|
3880
|
+
}
|
|
3881
|
+
);
|
|
3882
|
+
}
|
|
3883
|
+
function isUomCategory(...categories) {
|
|
3884
|
+
const fn2 = (val) => {
|
|
3885
|
+
const tests = getCategories2(categories);
|
|
3886
|
+
return tests.some((i) => i(val));
|
|
3887
|
+
};
|
|
3888
|
+
const prop = { categories, kind: "UomTypeGuard" };
|
|
3889
|
+
return createFnWithProps(fn2, prop);
|
|
3890
|
+
}
|
|
3796
3891
|
|
|
3797
3892
|
// src/type-guards/network-tg.ts
|
|
3798
3893
|
function isIp4Address(val) {
|
|
@@ -5901,6 +5996,7 @@ export {
|
|
|
5901
5996
|
isMassUom,
|
|
5902
5997
|
isMastercard,
|
|
5903
5998
|
isMetric,
|
|
5999
|
+
isMetricCategory,
|
|
5904
6000
|
isMexicanNewsUrl,
|
|
5905
6001
|
isMoment,
|
|
5906
6002
|
isNarrowableObject,
|
|
@@ -5932,7 +6028,7 @@ export {
|
|
|
5932
6028
|
isRegExp,
|
|
5933
6029
|
isRepoSource,
|
|
5934
6030
|
isRepoUrl,
|
|
5935
|
-
|
|
6031
|
+
isResistanceMetric,
|
|
5936
6032
|
isResistanceUom,
|
|
5937
6033
|
isRetailUrl,
|
|
5938
6034
|
isSameTypeOf,
|
|
@@ -5997,6 +6093,7 @@ export {
|
|
|
5997
6093
|
isUndefined,
|
|
5998
6094
|
isUnset,
|
|
5999
6095
|
isUom,
|
|
6096
|
+
isUomCategory,
|
|
6000
6097
|
isUri,
|
|
6001
6098
|
isUrl,
|
|
6002
6099
|
isUrlPath,
|