inferred-types 1.0.0-beta.7 → 1.0.1
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/constants/dist/index.d.ts.map +1 -1
- package/modules/runtime/dist/index.cjs +43 -40
- package/modules/runtime/dist/index.cjs.map +1 -1
- package/modules/runtime/dist/index.d.cts +7 -28
- package/modules/runtime/dist/index.d.cts.map +1 -1
- package/modules/runtime/dist/index.d.ts +7 -28
- package/modules/runtime/dist/index.d.ts.map +1 -1
- package/modules/runtime/dist/index.js +44 -40
- package/modules/runtime/dist/index.js.map +1 -1
- package/modules/types/dist/{index.mjs → index.cjs} +17 -2
- package/modules/types/dist/{index.mjs.map → index.cjs.map} +1 -1
- package/modules/types/dist/{index.d.mts → index.d.cts} +4 -2
- package/modules/types/dist/{index.d.mts.map → index.d.cts.map} +1 -1
- package/modules/types/dist/index.d.ts +3 -1
- package/modules/types/dist/index.d.ts.map +1 -1
- package/modules/types/dist/index.js +1 -16
- package/modules/types/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -7169,7 +7169,7 @@ function isDateLike(val) {
|
|
|
7169
7169
|
* type guard which validates that `val` is the type `DateMeta`.
|
|
7170
7170
|
*/
|
|
7171
7171
|
function isDateMeta(val) {
|
|
7172
|
-
return isDictionary(val) && "dateType" in val && DATE_TYPE.includes(val);
|
|
7172
|
+
return isDictionary(val) && "dateType" in val && DATE_TYPE.includes(val.dateType);
|
|
7173
7173
|
}
|
|
7174
7174
|
|
|
7175
7175
|
//#endregion
|
|
@@ -8272,28 +8272,6 @@ function createCssSelector(_opt) {
|
|
|
8272
8272
|
};
|
|
8273
8273
|
}
|
|
8274
8274
|
|
|
8275
|
-
//#endregion
|
|
8276
|
-
//#region src/functions/fnMeta.ts
|
|
8277
|
-
/**
|
|
8278
|
-
* **fnMeta**(func)
|
|
8279
|
-
*
|
|
8280
|
-
* Runtime utility which provides a `fn` and `props` property which are
|
|
8281
|
-
* decomposed from the input function.
|
|
8282
|
-
*
|
|
8283
|
-
* - the `fn` is a clone of the underlying function
|
|
8284
|
-
*/
|
|
8285
|
-
function fnMeta(func) {
|
|
8286
|
-
const fn$1 = (...args) => func(...args);
|
|
8287
|
-
const props = Object.keys(fn$1).reduce((acc, key) => ({
|
|
8288
|
-
...acc,
|
|
8289
|
-
[key]: fn$1[key]
|
|
8290
|
-
}), {});
|
|
8291
|
-
return {
|
|
8292
|
-
fn: fn$1,
|
|
8293
|
-
props
|
|
8294
|
-
};
|
|
8295
|
-
}
|
|
8296
|
-
|
|
8297
8275
|
//#endregion
|
|
8298
8276
|
//#region src/functions/fnProps.ts
|
|
8299
8277
|
/**
|
|
@@ -13000,30 +12978,47 @@ function offsetMinutesToString(mins) {
|
|
|
13000
12978
|
*/
|
|
13001
12979
|
function asDateTime(input) {
|
|
13002
12980
|
if (isMoment(input)) {
|
|
13003
|
-
const
|
|
13004
|
-
const
|
|
12981
|
+
const parsed = input.parseZone();
|
|
12982
|
+
const d = new Date(parsed.toISOString());
|
|
12983
|
+
const offsetMins = parsed.utcOffset();
|
|
12984
|
+
const tz = isTimezoneOffset(offsetMinutesToString(offsetMins)) ? offsetMinutesToString(offsetMins) : null;
|
|
13005
12985
|
d.offset = tz;
|
|
13006
12986
|
d.tz = isIanaTimezone(input._z?.name) ? input._z.name : null;
|
|
13007
12987
|
d.source = "moment";
|
|
13008
|
-
const sourceIso =
|
|
12988
|
+
const sourceIso = parsed.toISOString(true);
|
|
13009
12989
|
d.sourceIso = sourceIso.endsWith("+00:00") ? sourceIso.replace("+00:00", "Z") : sourceIso;
|
|
13010
12990
|
return d;
|
|
13011
12991
|
}
|
|
13012
12992
|
if (isLuxonDate(input)) {
|
|
13013
12993
|
const d = input.toJSDate();
|
|
13014
|
-
d.offset =
|
|
12994
|
+
d.offset = offsetMinutesToString(input.offset);
|
|
13015
12995
|
d.tz = isIanaTimezone(input.zoneName) ? input.zoneName : null;
|
|
13016
12996
|
d.source = "luxon";
|
|
13017
|
-
d.sourceIso = input.
|
|
12997
|
+
d.sourceIso = input.toISO();
|
|
13018
12998
|
return d;
|
|
13019
12999
|
}
|
|
13020
13000
|
if (isTemporalDate(input)) {
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13001
|
+
let d;
|
|
13002
|
+
if ("epochNanoseconds" in input) {
|
|
13003
|
+
const zdt = input.toZonedDateTimeISO(getLocalIanaZone());
|
|
13004
|
+
d = new Date(zdt.epochMilliseconds);
|
|
13005
|
+
d.offset = isTimezoneOffset(zdt.offset) ? zdt.offset : null;
|
|
13006
|
+
d.tz = zdt.timeZone && isIanaTimezone(zdt.timeZone.id) ? zdt.timeZone.id : null;
|
|
13007
|
+
d.sourceIso = zdt.toString();
|
|
13008
|
+
} else if ("timeZone" in input) {
|
|
13009
|
+
const zdt = input;
|
|
13010
|
+
d = new Date(zdt.epochMilliseconds);
|
|
13011
|
+
d.offset = isTimezoneOffset(zdt.offset) ? zdt.offset : null;
|
|
13012
|
+
d.tz = zdt.timeZone && isIanaTimezone(zdt.timeZone.id) ? zdt.timeZone.id : null;
|
|
13013
|
+
d.sourceIso = zdt.toString();
|
|
13014
|
+
} else {
|
|
13015
|
+
const instant = input.toZonedDateTime("UTC").toInstant();
|
|
13016
|
+
d = new Date(instant.epochMilliseconds);
|
|
13017
|
+
d.offset = null;
|
|
13018
|
+
d.tz = null;
|
|
13019
|
+
d.sourceIso = null;
|
|
13020
|
+
}
|
|
13025
13021
|
d.source = "temporal";
|
|
13026
|
-
d.sourceIso = zdt.toString();
|
|
13027
13022
|
return d;
|
|
13028
13023
|
}
|
|
13029
13024
|
if (isDayJs(input)) {
|
|
@@ -13673,17 +13668,26 @@ function parseDate(d) {
|
|
|
13673
13668
|
*/
|
|
13674
13669
|
function parseDateObject(d) {
|
|
13675
13670
|
const date = d instanceof Date ? d : asDateTime(d);
|
|
13671
|
+
if (isError(date)) return date;
|
|
13676
13672
|
const utcIso = date.toISOString();
|
|
13677
13673
|
const utcParsed = parseIsoDate(utcIso);
|
|
13678
|
-
if (isError(utcParsed))
|
|
13679
|
-
const
|
|
13674
|
+
if (isError(utcParsed)) return utcParsed;
|
|
13675
|
+
const datePlus = date;
|
|
13676
|
+
const sourceIso = datePlus.sourceIso;
|
|
13680
13677
|
if (sourceIso) {
|
|
13681
13678
|
const sourceParsed = parseIsoDate(sourceIso);
|
|
13682
|
-
if (
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13679
|
+
if (isDateMeta(sourceParsed) && sourceParsed.timezone) {
|
|
13680
|
+
const timezone = sourceParsed.timezone === "+00:00" ? "Z" : sourceParsed.timezone;
|
|
13681
|
+
return {
|
|
13682
|
+
...utcParsed,
|
|
13683
|
+
timezone
|
|
13684
|
+
};
|
|
13685
|
+
}
|
|
13686
13686
|
}
|
|
13687
|
+
if (datePlus.offset === null && datePlus.source) return {
|
|
13688
|
+
...utcParsed,
|
|
13689
|
+
timezone: null
|
|
13690
|
+
};
|
|
13687
13691
|
return utcParsed;
|
|
13688
13692
|
}
|
|
13689
13693
|
|
|
@@ -16196,5 +16200,5 @@ function asVueRef(value) {
|
|
|
16196
16200
|
}
|
|
16197
16201
|
|
|
16198
16202
|
//#endregion
|
|
16199
|
-
export { NO_MATCH, ShapeApiImplementation, abs, add, addFnToProps, addPropsToFn, addToken, afterFirst, and, append, array, asArray, asChars, asDate, asDateTime, asEpochTimestamp, asFourDigitYear, asFromTo, asInputToken, asIsoDate, asIsoDateTime, asNumber, asOutputFunction, asPhoneFormat, asRecord, asString, asTakeState, asTemplate, asTwoDigitMonth, asType, asTypeSubtype, asTypedError, asUnion, asVueRef, between, boolean, brand, capitalize, cardType, choices, compare, contains, createConstant, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createGrammar, createLifoQueue, createNestingConfig, createStaticTakeFunction, createTakeFunction, createTakeStartEndFunction, createTakeWhileFunction, createTemplateRegExp, createToken, createTokenSyntax, cssColor, cssFromDefinition, csv, dateObjectToIso, daysInMonth, decrement, defineCss, defineObj, defineObject, defineObjectWith, defineTuple, doesExtend, dropFirstStackFrame, eachAsString, endsWith, endsWithTypeguard, ensureLeading, ensureSurround, ensureTrailing, entries, equalsSome, err, errCondition, every, filter, filterEmpty, filterUndefined, find, firstChar, fn,
|
|
16203
|
+
export { NO_MATCH, ShapeApiImplementation, abs, add, addFnToProps, addPropsToFn, addToken, afterFirst, and, append, array, asArray, asChars, asDate, asDateTime, asEpochTimestamp, asFourDigitYear, asFromTo, asInputToken, asIsoDate, asIsoDateTime, asNumber, asOutputFunction, asPhoneFormat, asRecord, asString, asTakeState, asTemplate, asTwoDigitMonth, asType, asTypeSubtype, asTypedError, asUnion, asVueRef, between, boolean, brand, capitalize, cardType, choices, compare, contains, createConstant, createConverter, createCssKeyframe, createCssSelector, createErrorCondition, createFifoQueue, createFixedLengthArray, createFnWithProps, createGrammar, createLifoQueue, createNestingConfig, createStaticTakeFunction, createTakeFunction, createTakeStartEndFunction, createTakeWhileFunction, createTemplateRegExp, createToken, createTokenSyntax, cssColor, cssFromDefinition, csv, dateObjectToIso, daysInMonth, decrement, defineCss, defineObj, defineObject, defineObjectWith, defineTuple, doesExtend, dropFirstStackFrame, eachAsString, endsWith, endsWithTypeguard, ensureLeading, ensureSurround, ensureTrailing, entries, equalsSome, err, errCondition, every, filter, filterEmpty, filterUndefined, find, firstChar, fn, fnProps, fourDigitYear, freeze, fromDefineObject, fromDefineTuple, fromInputToken, fromKeyValue, get, getDaysBetween, getEach, getMonthAbbrev, getMonthName, getMonthNumber, getPhoneCountryCode, getSeason, getTailwindModifiers, getToday, getTokenData, getTokenKind, getTomorrow, getTypeSubtype, getUrlBase, getUrlDefaultPort, getUrlDynamics, getUrlPath, getUrlPort, getUrlProtocol, getUrlQueryParams, getUrlSource, getWeekNumber, getYear, getYesterday, getYouTubePageType, handleDoneFn, hasCountryCode, hasDefaultValue, hasHtml, hasIndexOf, hasKeys, hasNonStringKeys, hasOnlyStringKeys, hasOnlyStringValues, hasOnlySymbolKeys, hasOverlappingKeys, hasProtocol, hasProtocolPrefix, hasSymbolKeys, hasUrlPort, hasUrlQueryParameter, hasValidHtml, hasWhiteSpace, idLiteral, idTypeGuard, identity, ifArray, ifArrayPartial, ifBoolean, ifChar, ifContainer, ifDefined, ifEmpty, ifEqual, ifError, ifFalse, ifFunction, ifHasKey, ifLength, ifLowercaseChar, ifNotNull, ifNull, ifNumber, ifObject, ifSameType, ifScalar, ifString, ifTrue, ifUndefined, ifUppercaseChar, increment, indexOf, infer, integer, intersect, intersection, ip6GroupExpansion, isAccelerationMetric, isAccelerationUom, isAfter, isAlpha, isAmazonUrl, isAmericanExpress, isApi, isApiSurface, isAppleUrl, isAreaMetric, isAreaUom, isArray, isAustralianNewsUrl, isBefore, isBelgiumNewsUrl, isBestBuyUrl, isBitbucketUrl, isBoolean, isBooleanArray, isBooleanLike, isCanadianNewsUrl, isChineseNewsUrl, isCodeCommitUrl, isComparisonOperation, isConstant, isContainer, isCostCoUrl, isCountryAbbrev, isCountryCode2, isCountryCode3, isCountryName, isCreditCard, isCssAspectRatio, isCsv, isCurrentMetric, isCurrentUom, isCvsUrl, isDanishNewsUrl, isDate, isDateLike, isDateMeta, isDayJs, isDefineObject, isDefineTuple, isDefined, isDellUrl, isDeltaReturn, isDictionary, isDistanceMetric, isDistanceUom, isDomainName, isDoneFn, isDoubleLeap, isDutchNewsUrl, isEbayUrl, isEmail, isEmpty, isEnergyMetric, isEnergyUom, isEpochInMilliseconds, isEpochInSeconds, isEqual, isErr, isError, isEscapeFunction, isEtsyUrl, isEven, isFalse, isFalsy, isFnWithParams, isFourDigitYear, isFrenchNewsUrl, isFrequencyMetric, isFrequencyUom, isFunction, isGermanNewsUrl, isGithubIssueUrl, isGithubIssuesListUrl, isGithubOrgUrl, isGithubProjectUrl, isGithubProjectsListUrl, isGithubReleaseTagUrl, isGithubReleasesListUrl, isGithubRepoReleaseTagUrl, isGithubRepoReleasesUrl, isGithubRepoUrl, isGithubUrl, isGreaterThan, isGreaterThanOrEqual, isHexadecimal, isHmUrl, isHomeDepotUrl, isHtml, isHtmlComponentTag, isHtmlElement, isIanaTimezone, isIkeaUrl, isInUnion, isIndexable, isIndianNewsUrl, isInlineSvg, isInputToken, isInputToken__String, isInteger, isIp4Address, isIp6Address, isIp6Subnet, isIpAddress, isIso3166Alpha2, isIso3166Alpha3, isIso3166CountryCode, isIso3166CountryName, isIsoDate, isIsoDateTime, isIsoExplicitDate, isIsoExplicitTime, isIsoImplicitDate, isIsoImplicitTime, isIsoMonthDate, isIsoTime, isIsoYear, isIsoYearMonth, isItalianNewsUrl, isJapaneseNewsUrl, isKrogersUrl, isLeapYear, isLength, isLikeRegExp, isLowesUrl, isLuminosityMetric, isLuminosityUom, isLuxonDate, isMacysUrl, isMap, isMassMetric, isMassUom, isMastercard, isMetric, isMetricCategory, isMexicanNewsUrl, isMinimalDigitDate, isMoment, isMonthAbbrev, isMonthName, isNarrowable, isNarrowableArray, isNarrowableDictionary, isNegativeNumber, isNestingEnd, isNestingEndMatch, isNestingKeyValue, isNestingStart, isNestingTuple, isNever, isNewsUrl, isNikeUrl, isNorwegianNewsUrl, isNotEmpty, isNotError, isNotNull, isNotUnset, isNothing, isNull, isNumber, isNumberLike, isNumericArray, isNumericString, isObject, isObjectKey, isObjectKeyRequiringQuotes, isOdd, isOk, isOptionalParamFunction, isParsedDate, isPhoneNumber, isPowerMetric, isPowerUom, isPressureMetric, isPressureUom, isProtocol, isProtocolPrefix, isReadonlyArray, isRef, isRegExp, isRepoSource, isRepoUrl, isResistanceMetric, isResistanceUom, isRetailUrl, isSameDay, isSameMonth, isSameMonthYear, isSameTypeOf, isSameYear, isScalar, isSemanticVersion, isSet, isSetContainer, isShape, isShapeCallback, isSimpleContainerToken, isSimpleContainerTokenTuple, isSimpleScalarToken, isSimpleScalarTokenTuple, isSimpleToken, isSimpleTokenTuple, isSocialMediaProfileUrl, isSocialMediaUrl, isSouthKoreanNewsUrl, isSpanishNewsUrl, isSpecificConstant, isSpeedMetric, isSpeedUom, isStaticTemplate, isString, isStringArray, isStringLiteral, isStringOrNumericArray, isSwissNewsUrl, isSymbol, isTailwindColor, isTailwindColorClass, isTailwindColorName, isTailwindColorTarget, isTailwindColorWithLuminosity, isTailwindColorWithLuminosityAndOpacity, isTailwindModifier, isTakeState, isTargetUrl, isTemperatureMetric, isTemperatureUom, isTemporalDate, isThenable, isThisMonth, isThisWeek, isThisYear, isThreeDigitMillisecond, isTimeMetric, isTimeUom, isTimezoneOffset, isToday, isTomorrow, isTrimable, isTrue, isTruthy, isTuple, isTurkishNewsUrl, isTwoDigitDate, isTwoDigitHour, isTwoDigitMinute, isTwoDigitMonth, isTwoDigitSecond, isTypeOf, isTypeSubtype, isTypeTuple, isTypedError, isUkNewsUrl, isUndefined, isUnset, isUom, isUomCategory, isUri, isUrl, isUrlPath, isUrlSource, isUsNewsUrl, isUsPhoneNumber, isUsStateAbbreviation, isUsStateName, isValidAtomicTag, isValidBlockTag, isValidComparisonParams, isValidHtml, isValidHtmlTag, isVariable, isVisa, isVisaMastercard, isVoltageMetric, isVoltageUom, isVolumeMetric, isVolumeUom, isWalgreensUrl, isWalmartUrl, isWayfairUrl, isWeakMap, isWholeFoodsUrl, isYesterday, isYouTubeCreatorUrl, isYouTubeFeedHistoryUrl, isYouTubeFeedUrl, isYouTubePlaylistUrl, isYouTubePlaylistsUrl, isYouTubeShareUrl, isYouTubeSubscriptionsUrl, isYouTubeTrendingUrl, isYouTubeUrl, isYouTubeVideoUrl, isYouTubeVideosInPlaylist, isZaraUrl, isZipCode, isZipCode5, isZipPlus4, joinWith, keysOf, keysWithError, kindLiteral, last, lastChar, lessThan, lessThanOrEqual, literal, logicalReturns, lookupCountryAlpha2, lookupCountryAlpha3, lookupCountryCode, lookupCountryName, lowercase, map, maybePhoneNumber, mergeObjects, mergeScalars, mergeTuples, mutable, nameLiteral, narrow, nbsp, nestedSplit, nesting, not, nullType, objectValues, omitKeys, optional, optionalOrNull, or, orNull, parseDate, parseDateObject, parseIsoDate, parseNumericDate, pathJoin, pluralize, pop, record, regexToken, removePhoneCountryCode, removeTailwindModifiers, removeUrlProtocol, replace, replaceAll, replaceAllFromTo, result, retainAfter, retainAfterInclusive, retainChars, retainKeys, retainUntil, retainUntilInclusive, retainUntil__Nested, retainWhile, reverse, reverseLookup, rightWhitespace, setupSafeStringEncoding, shape, sharedKeys, shift, simpleContainerToken, simpleContainerType, simpleScalarToken, simpleScalarType, simpleToken, simpleType, slice, sortByKey, split, startsWith, startsWithTypeguard, stripAfter, stripAfterLast, stripBefore, stripChars, stripLeading, stripParenthesis, stripSurround, stripTrailing, stripUntil, stripWhile, surround, take, takeNumericCharacters, takeStart, takeStringToken, threeDigitMillisecond, toAllCaps, toCamelCase, toInteger, toIsoDateString, toJSON, toKebabCase, toKeyValue, toLowercase, toNumber, toNumericArray, toPascalCase, toSnakeCase, toString, toStringLiteral, toStringLiteral__Tuple, toStringToken, trim, trimEnd, trimStart, truncate, tuple, twColor, twoDigitHour, twoDigitMinute, twoDigitSecond, typedError, unbrand, uncapitalize, undefinedType, unionize, unique, uniqueKeys, unknown, unset, urlMeta, usingLookup, validHtmlAttributes, valuesOf, weakMap, widen, withDefaults, withKeys, withValue, withoutKeys, withoutValue, youtubeEmbed, youtubeMeta };
|
|
16200
16204
|
//# sourceMappingURL=index.js.map
|