@bessemer/cornerstone 0.5.113 → 0.5.115
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/dist/array.d.ts.map +1 -1
- package/dist/array.js +28 -28
- package/dist/array.js.map +1 -1
- package/dist/aspect-ratio.d.ts +3 -3
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +13 -12
- package/dist/aspect-ratio.js.map +1 -1
- package/dist/assertion.d.ts.map +1 -1
- package/dist/assertion.js +5 -5
- package/dist/assertion.js.map +1 -1
- package/dist/async-value.js +2 -2
- package/dist/async-value.js.map +1 -1
- package/dist/async.d.ts.map +1 -1
- package/dist/async.js +2 -2
- package/dist/async.js.map +1 -1
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +11 -12
- package/dist/cache.js.map +1 -1
- package/dist/combinable.js +5 -5
- package/dist/combinable.js.map +1 -1
- package/dist/comparator.js +8 -8
- package/dist/comparator.js.map +1 -1
- package/dist/data-size.d.ts +2 -1
- package/dist/data-size.d.ts.map +1 -1
- package/dist/data-size.js +3 -3
- package/dist/data-size.js.map +1 -1
- package/dist/either.js +5 -5
- package/dist/either.js.map +1 -1
- package/dist/equalitor.d.ts.map +1 -1
- package/dist/equalitor.js +2 -2
- package/dist/equalitor.js.map +1 -1
- package/dist/error/error-cause.d.ts.map +1 -1
- package/dist/error/error-cause.js +14 -14
- package/dist/error/error-cause.js.map +1 -1
- package/dist/error/error-code.js +2 -2
- package/dist/error/error-code.js.map +1 -1
- package/dist/error/error-event.d.ts +3 -2
- package/dist/error/error-event.d.ts.map +1 -1
- package/dist/error/error-event.js +28 -28
- package/dist/error/error-event.js.map +1 -1
- package/dist/error/error-type.d.ts +2 -1
- package/dist/error/error-type.d.ts.map +1 -1
- package/dist/error/error-type.js +2 -2
- package/dist/error/error-type.js.map +1 -1
- package/dist/error/error.js +5 -5
- package/dist/error/error.js.map +1 -1
- package/dist/expression/array-expression.js +3 -3
- package/dist/expression/array-expression.js.map +1 -1
- package/dist/expression/core-expression.d.ts.map +1 -1
- package/dist/expression/core-expression.js +19 -19
- package/dist/expression/core-expression.js.map +1 -1
- package/dist/expression/expression-evaluator.js +2 -2
- package/dist/expression/expression-evaluator.js.map +1 -1
- package/dist/expression/expression-mapper.js +4 -4
- package/dist/expression/expression-mapper.js.map +1 -1
- package/dist/expression/internal.js +3 -3
- package/dist/expression/internal.js.map +1 -1
- package/dist/expression/numeric-expression.js +13 -13
- package/dist/expression/numeric-expression.js.map +1 -1
- package/dist/expression/string-expression.js +4 -4
- package/dist/expression/string-expression.js.map +1 -1
- package/dist/expression.d.ts +17 -1
- package/dist/expression.d.ts.map +1 -1
- package/dist/expression.js.map +1 -1
- package/dist/glob.d.ts +3 -3
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +11 -12
- package/dist/glob.js.map +1 -1
- package/dist/global-variable.d.ts.map +1 -1
- package/dist/global-variable.js +5 -5
- package/dist/global-variable.js.map +1 -1
- package/dist/hex-code.d.ts +3 -3
- package/dist/hex-code.d.ts.map +1 -1
- package/dist/hex-code.js +11 -10
- package/dist/hex-code.js.map +1 -1
- package/dist/index.d.ts +311 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/intl/country-code.d.ts +3 -3
- package/dist/intl/country-code.d.ts.map +1 -1
- package/dist/intl/country-code.js +9 -10
- package/dist/intl/country-code.js.map +1 -1
- package/dist/intl/country-subdivision-code.d.ts +3 -3
- package/dist/intl/country-subdivision-code.d.ts.map +1 -1
- package/dist/intl/country-subdivision-code.js +13 -11
- package/dist/intl/country-subdivision-code.js.map +1 -1
- package/dist/intl/currency-code.d.ts +3 -3
- package/dist/intl/currency-code.d.ts.map +1 -1
- package/dist/intl/currency-code.js +9 -10
- package/dist/intl/currency-code.js.map +1 -1
- package/dist/intl/language-code.d.ts +3 -3
- package/dist/intl/language-code.d.ts.map +1 -1
- package/dist/intl/language-code.js +9 -10
- package/dist/intl/language-code.js.map +1 -1
- package/dist/intl/locale.d.ts +3 -3
- package/dist/intl/locale.d.ts.map +1 -1
- package/dist/intl/locale.js +18 -19
- package/dist/intl/locale.js.map +1 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +2 -2
- package/dist/json.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +12 -12
- package/dist/logger.js.map +1 -1
- package/dist/map.d.ts +306 -0
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +8 -8
- package/dist/map.js.map +1 -1
- package/dist/mime-type.d.ts +3 -3
- package/dist/mime-type.d.ts.map +1 -1
- package/dist/mime-type.js +9 -10
- package/dist/mime-type.js.map +1 -1
- package/dist/misc.js +4 -4
- package/dist/misc.js.map +1 -1
- package/dist/monetary-amount.d.ts +3 -2
- package/dist/monetary-amount.d.ts.map +1 -1
- package/dist/monetary-amount.js +16 -16
- package/dist/monetary-amount.js.map +1 -1
- package/dist/net/content-type.d.ts +2 -1
- package/dist/net/content-type.d.ts.map +1 -1
- package/dist/net/content-type.js +2 -2
- package/dist/net/content-type.js.map +1 -1
- package/dist/net/domain-name.d.ts +3 -3
- package/dist/net/domain-name.d.ts.map +1 -1
- package/dist/net/domain-name.js +10 -11
- package/dist/net/domain-name.js.map +1 -1
- package/dist/net/http-method.d.ts.map +1 -1
- package/dist/net/http-method.js +9 -9
- package/dist/net/http-method.js.map +1 -1
- package/dist/net/ipv4-address.d.ts +3 -3
- package/dist/net/ipv4-address.d.ts.map +1 -1
- package/dist/net/ipv4-address.js +10 -11
- package/dist/net/ipv4-address.js.map +1 -1
- package/dist/net/ipv6-address.d.ts +3 -3
- package/dist/net/ipv6-address.d.ts.map +1 -1
- package/dist/net/ipv6-address.js +10 -11
- package/dist/net/ipv6-address.js.map +1 -1
- package/dist/net/uri-host-name.d.ts +3 -3
- package/dist/net/uri-host-name.d.ts.map +1 -1
- package/dist/net/uri-host-name.js +15 -16
- package/dist/net/uri-host-name.js.map +1 -1
- package/dist/net/uri.d.ts +1 -2
- package/dist/net/uri.d.ts.map +1 -1
- package/dist/net/uri.js +5 -3
- package/dist/net/uri.js.map +1 -1
- package/dist/net/url.d.ts.map +1 -1
- package/dist/net/url.js +6 -7
- package/dist/net/url.js.map +1 -1
- package/dist/object/object-path.d.ts.map +1 -1
- package/dist/object/object-path.js +23 -28
- package/dist/object/object-path.js.map +1 -1
- package/dist/object/type-path.js +19 -19
- package/dist/object/type-path.js.map +1 -1
- package/dist/patch.js +4 -4
- package/dist/patch.js.map +1 -1
- package/dist/promise.js +2 -2
- package/dist/promise.js.map +1 -1
- package/dist/property.d.ts.map +1 -1
- package/dist/property.js +7 -7
- package/dist/property.js.map +1 -1
- package/dist/proxy.js +2 -2
- package/dist/proxy.js.map +1 -1
- package/dist/range.js +2 -2
- package/dist/range.js.map +1 -1
- package/dist/reference.d.ts +2 -1
- package/dist/reference.d.ts.map +1 -1
- package/dist/reference.js +13 -13
- package/dist/reference.js.map +1 -1
- package/dist/resource-key.js +2 -2
- package/dist/resource-key.js.map +1 -1
- package/dist/result.js +5 -5
- package/dist/result.js.map +1 -1
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +12 -12
- package/dist/retry.js.map +1 -1
- package/dist/rich-text.js +2 -2
- package/dist/rich-text.js.map +1 -1
- package/dist/signature.d.ts.map +1 -1
- package/dist/signature.js +9 -9
- package/dist/signature.js.map +1 -1
- package/dist/sql/sql-expression-parser.js +2 -2
- package/dist/sql/sql-expression-parser.js.map +1 -1
- package/dist/sql.d.ts +5 -1
- package/dist/sql.d.ts.map +1 -1
- package/dist/sql.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +9 -9
- package/dist/store.js.map +1 -1
- package/dist/string.js +4 -4
- package/dist/string.js.map +1 -1
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +10 -10
- package/dist/tag.js.map +1 -1
- package/dist/temporal/clock.d.ts +13 -13
- package/dist/temporal/clock.d.ts.map +1 -1
- package/dist/temporal/clock.js +10 -10
- package/dist/temporal/clock.js.map +1 -1
- package/dist/temporal/duration.d.ts +15 -9
- package/dist/temporal/duration.d.ts.map +1 -1
- package/dist/temporal/duration.js +30 -31
- package/dist/temporal/duration.js.map +1 -1
- package/dist/temporal/instant.d.ts +18 -15
- package/dist/temporal/instant.d.ts.map +1 -1
- package/dist/temporal/instant.js +42 -43
- package/dist/temporal/instant.js.map +1 -1
- package/dist/temporal/plain-date-time.d.ts +16 -13
- package/dist/temporal/plain-date-time.d.ts.map +1 -1
- package/dist/temporal/plain-date-time.js +36 -38
- package/dist/temporal/plain-date-time.js.map +1 -1
- package/dist/temporal/plain-date.d.ts +16 -13
- package/dist/temporal/plain-date.d.ts.map +1 -1
- package/dist/temporal/plain-date.js +35 -37
- package/dist/temporal/plain-date.js.map +1 -1
- package/dist/temporal/plain-month-day.d.ts +37 -0
- package/dist/temporal/plain-month-day.d.ts.map +1 -0
- package/dist/temporal/plain-month-day.js +84 -0
- package/dist/temporal/plain-month-day.js.map +1 -0
- package/dist/temporal/plain-time.d.ts +19 -17
- package/dist/temporal/plain-time.d.ts.map +1 -1
- package/dist/temporal/plain-time.js +43 -42
- package/dist/temporal/plain-time.js.map +1 -1
- package/dist/temporal/plain-year-month.d.ts +57 -0
- package/dist/temporal/plain-year-month.d.ts.map +1 -0
- package/dist/temporal/plain-year-month.js +109 -0
- package/dist/temporal/plain-year-month.js.map +1 -0
- package/dist/temporal/time-zone-id.d.ts +5 -4
- package/dist/temporal/time-zone-id.d.ts.map +1 -1
- package/dist/temporal/time-zone-id.js +11 -11
- package/dist/temporal/time-zone-id.js.map +1 -1
- package/dist/temporal/time-zone-offset.d.ts +12 -11
- package/dist/temporal/time-zone-offset.d.ts.map +1 -1
- package/dist/temporal/time-zone-offset.js +42 -50
- package/dist/temporal/time-zone-offset.js.map +1 -1
- package/dist/temporal/zoned-date-time.d.ts +16 -13
- package/dist/temporal/zoned-date-time.d.ts.map +1 -1
- package/dist/temporal/zoned-date-time.js +35 -36
- package/dist/temporal/zoned-date-time.js.map +1 -1
- package/dist/uuid/ulid.d.ts +3 -3
- package/dist/uuid/ulid.d.ts.map +1 -1
- package/dist/uuid/ulid.js +9 -10
- package/dist/uuid/ulid.js.map +1 -1
- package/dist/uuid/uuid-v4.d.ts +3 -3
- package/dist/uuid/uuid-v4.d.ts.map +1 -1
- package/dist/uuid/uuid-v4.js +13 -14
- package/dist/uuid/uuid-v4.js.map +1 -1
- package/dist/uuid/uuid-v7.d.ts +1 -2
- package/dist/uuid/uuid-v7.d.ts.map +1 -1
- package/dist/uuid/uuid-v7.js +1 -2
- package/dist/uuid/uuid-v7.js.map +1 -1
- package/dist/zod-util.d.ts +4 -3
- package/dist/zod-util.d.ts.map +1 -1
- package/dist/zod-util.js +21 -11
- package/dist/zod-util.js.map +1 -1
- package/package.json +6 -4
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// src/temporal/plain-month-day.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import * as ResourceKeys from "@bessemer/cornerstone/resource-key";
|
|
4
|
+
import * as Equalitors from "@bessemer/cornerstone/equalitor";
|
|
5
|
+
import * as Results from "@bessemer/cornerstone/result";
|
|
6
|
+
import * as ErrorEvents from "@bessemer/cornerstone/error/error-event";
|
|
7
|
+
import * as Errors from "@bessemer/cornerstone/error/error";
|
|
8
|
+
import * as ZodUtil from "@bessemer/cornerstone/zod-util";
|
|
9
|
+
import Zod from "zod";
|
|
10
|
+
import * as Strings from "@bessemer/cornerstone/string";
|
|
11
|
+
import * as Objects from "@bessemer/cornerstone/object";
|
|
12
|
+
var Namespace = ResourceKeys.createNamespace("plain-month-day");
|
|
13
|
+
function from(value) {
|
|
14
|
+
if (Objects.isNil(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
if (value instanceof Temporal.PlainMonthDay) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
if (Strings.isString(value)) {
|
|
21
|
+
return ErrorEvents.unpackResult(parseString(value));
|
|
22
|
+
}
|
|
23
|
+
return Temporal.PlainMonthDay.from(value);
|
|
24
|
+
}
|
|
25
|
+
var CompareBy = (first, second) => {
|
|
26
|
+
if (first.monthCode !== second.monthCode) {
|
|
27
|
+
return first.monthCode < second.monthCode ? -1 : 1;
|
|
28
|
+
}
|
|
29
|
+
return first.day - second.day;
|
|
30
|
+
};
|
|
31
|
+
var EqualBy = Equalitors.fromComparator(CompareBy);
|
|
32
|
+
var parseString = (value) => {
|
|
33
|
+
try {
|
|
34
|
+
return Results.success(Temporal.PlainMonthDay.from(value));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
if (!Errors.isError(e)) {
|
|
37
|
+
throw e;
|
|
38
|
+
}
|
|
39
|
+
return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
function toLiteral(likeValue) {
|
|
43
|
+
if (Objects.isNil(likeValue)) {
|
|
44
|
+
return likeValue;
|
|
45
|
+
}
|
|
46
|
+
const value = from(likeValue);
|
|
47
|
+
return value.toString();
|
|
48
|
+
}
|
|
49
|
+
var SchemaLiteral = ZodUtil.structuredTransform(Zod.string(), (it) => Results.map(parseString(it), (it2) => toLiteral(it2)));
|
|
50
|
+
var SchemaInstance = ZodUtil.structuredTransform(Zod.string(), parseString);
|
|
51
|
+
var isPlainMonthDay = (value) => {
|
|
52
|
+
return value instanceof Temporal.PlainMonthDay;
|
|
53
|
+
};
|
|
54
|
+
var merge = (element, builder) => {
|
|
55
|
+
return from(element).with(builder);
|
|
56
|
+
};
|
|
57
|
+
function isEqual(element, other) {
|
|
58
|
+
if (Objects.isNil(element) || Objects.isNil(other)) {
|
|
59
|
+
return element === other;
|
|
60
|
+
}
|
|
61
|
+
return EqualBy(from(element), from(other));
|
|
62
|
+
}
|
|
63
|
+
var isBefore = (element, other) => {
|
|
64
|
+
return CompareBy(from(element), from(other)) < 0;
|
|
65
|
+
};
|
|
66
|
+
var isAfter = (element, other) => {
|
|
67
|
+
return CompareBy(from(element), from(other)) > 0;
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
CompareBy,
|
|
71
|
+
EqualBy,
|
|
72
|
+
Namespace,
|
|
73
|
+
SchemaInstance,
|
|
74
|
+
SchemaLiteral,
|
|
75
|
+
from,
|
|
76
|
+
isAfter,
|
|
77
|
+
isBefore,
|
|
78
|
+
isEqual,
|
|
79
|
+
isPlainMonthDay,
|
|
80
|
+
merge,
|
|
81
|
+
parseString,
|
|
82
|
+
toLiteral
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=plain-month-day.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/temporal/plain-month-day.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill'\nimport * as ResourceKeys from '@bessemer/cornerstone/resource-key'\nimport { NominalType } from '@bessemer/cornerstone/types'\nimport { Comparator } from '@bessemer/cornerstone/comparator'\nimport * as Equalitors from '@bessemer/cornerstone/equalitor'\nimport * as Results from '@bessemer/cornerstone/result'\nimport * as ErrorEvents from '@bessemer/cornerstone/error/error-event'\nimport * as Errors from '@bessemer/cornerstone/error/error'\nimport * as ZodUtil from '@bessemer/cornerstone/zod-util'\nimport Zod from 'zod'\nimport * as Strings from '@bessemer/cornerstone/string'\nimport * as Objects from '@bessemer/cornerstone/object'\n\nexport type PlainMonthDay = Temporal.PlainMonthDay\nexport const Namespace = ResourceKeys.createNamespace('plain-month-day')\nexport type PlainMonthDayLiteral = NominalType<string, typeof Namespace>\nexport type PlainMonthDayBuilder = {\n month: number\n day: number\n}\n\nexport type PlainMonthDayLike = PlainMonthDay | PlainMonthDayLiteral | PlainMonthDayBuilder\n\nexport function from(value: PlainMonthDayLike | string): PlainMonthDay\nexport function from(value: PlainMonthDayLike | string | null): PlainMonthDay | null\nexport function from(value: PlainMonthDayLike | string | undefined): PlainMonthDay | undefined\nexport function from(value: PlainMonthDayLike | string | null | undefined): PlainMonthDay | null | undefined\nexport function from(value: PlainMonthDayLike | string | null | undefined): PlainMonthDay | null | undefined {\n if (Objects.isNil(value)) {\n return value\n }\n\n if (value instanceof Temporal.PlainMonthDay) {\n return value\n }\n\n if (Strings.isString(value)) {\n return ErrorEvents.unpackResult(parseString(value))\n }\n\n return Temporal.PlainMonthDay.from(value)\n}\n\nexport const CompareBy: Comparator<PlainMonthDay> = (first: PlainMonthDay, second: PlainMonthDay): number => {\n if (first.monthCode !== second.monthCode) {\n return first.monthCode < second.monthCode ? -1 : 1\n }\n\n return first.day - second.day\n}\nexport const EqualBy = Equalitors.fromComparator(CompareBy)\n\nexport const parseString = (value: string): Results.Result<PlainMonthDay, ErrorEvents.ErrorEvent> => {\n try {\n return Results.success(Temporal.PlainMonthDay.from(value))\n } catch (e) {\n if (!Errors.isError(e)) {\n throw e\n }\n\n return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }))\n }\n}\n\nexport function toLiteral(likeValue: PlainMonthDayLike): PlainMonthDayLiteral\nexport function toLiteral(likeValue: PlainMonthDayLike | null): PlainMonthDayLiteral | null\nexport function toLiteral(likeValue: PlainMonthDayLike | undefined): PlainMonthDayLiteral | undefined\nexport function toLiteral(likeValue: PlainMonthDayLike | null | undefined): PlainMonthDayLiteral | null | undefined\nexport function toLiteral(likeValue: PlainMonthDayLike | null | undefined): PlainMonthDayLiteral | null | undefined {\n if (Objects.isNil(likeValue)) {\n return likeValue\n }\n\n const value = from(likeValue)\n return value.toString() as PlainMonthDayLiteral\n}\n\nexport const SchemaLiteral = ZodUtil.structuredTransform(Zod.string(), (it: string) => Results.map(parseString(it), (it) => toLiteral(it)))\nexport const SchemaInstance = ZodUtil.structuredTransform(Zod.string(), parseString)\n\nexport const isPlainMonthDay = (value: unknown): value is PlainMonthDay => {\n return value instanceof Temporal.PlainMonthDay\n}\n\nexport const merge = (element: PlainMonthDayLike, builder: Partial<PlainMonthDayBuilder>): PlainMonthDay => {\n return from(element).with(builder)\n}\n\nexport function isEqual(element: PlainMonthDayLike, other: PlainMonthDayLike): boolean\nexport function isEqual(element: PlainMonthDayLike | null, other: PlainMonthDayLike | null): boolean\nexport function isEqual(element: PlainMonthDayLike | undefined, other: PlainMonthDayLike | undefined): boolean\nexport function isEqual(element: PlainMonthDayLike | null | undefined, other: PlainMonthDayLike | null | undefined): boolean {\n if (Objects.isNil(element) || Objects.isNil(other)) {\n return element === other\n }\n\n return EqualBy(from(element), from(other))\n}\n\nexport const isBefore = (element: PlainMonthDayLike, other: PlainMonthDayLike): boolean => {\n return CompareBy(from(element), from(other)) < 0\n}\n\nexport const isAfter = (element: PlainMonthDayLike, other: PlainMonthDayLike): boolean => {\n return CompareBy(from(element), from(other)) > 0\n}\n\n// export type MonthDayFormatOptions = {\n// month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' | undefined\n// day?: 'numeric' | '2-digit' | undefined\n// }\n//\n// export const format = (element: PlainMonthDayLike, locale: Locale, options: MonthDayFormatOptions): string => {\n// const plainMonthDay = from(element)\n//\n// const date = new Date(2000, plainMonthDay.month - 1, plainMonthDay.day)\n//\n// const formatter = new Intl.DateTimeFormat(locale, options)\n// return formatter.format(date)\n// }\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,YAAY,kBAAkB;AAG9B,YAAY,gBAAgB;AAC5B,YAAY,aAAa;AACzB,YAAY,iBAAiB;AAC7B,YAAY,YAAY;AACxB,YAAY,aAAa;AACzB,OAAO,SAAS;AAChB,YAAY,aAAa;AACzB,YAAY,aAAa;AAGlB,IAAM,YAAyB,6BAAgB,iBAAiB;AAahE,SAAS,KAAK,OAAwF;AAC3G,MAAY,cAAM,KAAK,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,iBAAiB,SAAS,eAAe;AAC3C,WAAO;AAAA,EACT;AAEA,MAAY,iBAAS,KAAK,GAAG;AAC3B,WAAmB,yBAAa,YAAY,KAAK,CAAC;AAAA,EACpD;AAEA,SAAO,SAAS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K,KAAK,CAAC,IAAI;AACjD;AAEO,IAAM,UAAU,CAAC,SAA4B,UAAsC;AACxF,SAAO,UAAU,KAAK,OAAO,GAAG,KAAK,KAAK,CAAC,IAAI;AACjD;","names":["it"]}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import * as ResourceKeys from '@bessemer/cornerstone/resource-key';
|
|
2
3
|
import { NominalType } from '@bessemer/cornerstone/types';
|
|
3
4
|
import { Comparator } from '@bessemer/cornerstone/comparator';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import * as Equalitors from '@bessemer/cornerstone/equalitor';
|
|
6
|
+
import * as Results from '@bessemer/cornerstone/result';
|
|
7
|
+
import * as ErrorEvents from '@bessemer/cornerstone/error/error-event';
|
|
8
|
+
import * as Clocks from '@bessemer/cornerstone/temporal/clock';
|
|
9
|
+
import * as Durations from '@bessemer/cornerstone/temporal/duration';
|
|
10
|
+
import * as Instants from '@bessemer/cornerstone/temporal/instant';
|
|
9
11
|
import { TimeZoneId } from '@bessemer/cornerstone/temporal/time-zone-id';
|
|
10
12
|
import { TimeUnit } from '@bessemer/cornerstone/temporal/chrono';
|
|
11
13
|
import { Locale } from '@bessemer/cornerstone/intl/locale';
|
|
12
14
|
export type PlainTime = Temporal.PlainTime;
|
|
13
|
-
export declare const Namespace:
|
|
15
|
+
export declare const Namespace: ResourceKeys.ResourceNamespace<"plain-time">;
|
|
14
16
|
export type PlainTimeLiteral = NominalType<string, typeof Namespace>;
|
|
15
17
|
export type PlainTimeBuilder = {
|
|
16
18
|
hour: number;
|
|
@@ -26,26 +28,26 @@ export declare function from(value: PlainTimeLike | string | null): PlainTime |
|
|
|
26
28
|
export declare function from(value: PlainTimeLike | string | undefined): PlainTime | undefined;
|
|
27
29
|
export declare function from(value: PlainTimeLike | string | null | undefined): PlainTime | null | undefined;
|
|
28
30
|
export declare const CompareBy: Comparator<PlainTime>;
|
|
29
|
-
export declare const EqualBy:
|
|
30
|
-
export declare const parseString: (value: string) => Result<PlainTime, ErrorEvent>;
|
|
31
|
-
export declare const fromDuration: (duration: DurationLike) => PlainTime;
|
|
32
|
-
export declare const fromInstant: (instant: InstantLike, zone: TimeZoneId) => PlainTime;
|
|
31
|
+
export declare const EqualBy: Equalitors.Equalitor<Temporal.PlainTime>;
|
|
32
|
+
export declare const parseString: (value: string) => Results.Result<PlainTime, ErrorEvents.ErrorEvent>;
|
|
33
|
+
export declare const fromDuration: (duration: Durations.DurationLike) => PlainTime;
|
|
34
|
+
export declare const fromInstant: (instant: Instants.InstantLike, zone: TimeZoneId) => PlainTime;
|
|
33
35
|
export declare function toLiteral(likeValue: PlainTimeLike): PlainTimeLiteral;
|
|
34
36
|
export declare function toLiteral(likeValue: PlainTimeLike | null): PlainTimeLiteral | null;
|
|
35
37
|
export declare function toLiteral(likeValue: PlainTimeLike | undefined): PlainTimeLiteral | undefined;
|
|
36
38
|
export declare function toLiteral(likeValue: PlainTimeLike | null | undefined): PlainTimeLiteral | null | undefined;
|
|
37
|
-
export declare const SchemaLiteral:
|
|
38
|
-
export declare const SchemaInstance:
|
|
39
|
+
export declare const SchemaLiteral: import("zod").ZodType<PlainTimeLiteral, PlainTimeLiteral, import("zod/v4/core").$ZodTypeInternals<PlainTimeLiteral, PlainTimeLiteral>>;
|
|
40
|
+
export declare const SchemaInstance: import("zod").ZodPipe<import("zod").ZodType<string, string, import("zod/v4/core").$ZodTypeInternals<string, string>>, import("zod").ZodTransform<Temporal.PlainTime, string>>;
|
|
39
41
|
export declare const isPlainTime: (value: unknown) => value is PlainTime;
|
|
40
42
|
export declare const now: (zone: TimeZoneId, clock?: {
|
|
41
43
|
readonly zone: TimeZoneId;
|
|
42
|
-
instant():
|
|
43
|
-
withZone(zone: TimeZoneId):
|
|
44
|
+
instant(): Instants.Instant;
|
|
45
|
+
withZone(zone: TimeZoneId): Clocks.Clock;
|
|
44
46
|
}) => PlainTime;
|
|
45
47
|
export declare const merge: (element: PlainTimeLike, builder: Partial<PlainTimeBuilder>) => PlainTime;
|
|
46
|
-
export declare const add: (element: PlainTimeLike, duration: DurationLike) => PlainTime;
|
|
47
|
-
export declare const subtract: (element: PlainTimeLike, duration: DurationLike) => PlainTime;
|
|
48
|
-
export declare const until: (element: PlainTimeLike, other: PlainTimeLike) => Duration;
|
|
48
|
+
export declare const add: (element: PlainTimeLike, duration: Durations.DurationLike) => PlainTime;
|
|
49
|
+
export declare const subtract: (element: PlainTimeLike, duration: Durations.DurationLike) => PlainTime;
|
|
50
|
+
export declare const until: (element: PlainTimeLike, other: PlainTimeLike) => Durations.Duration;
|
|
49
51
|
export declare const round: (element: PlainTimeLike, unit: TimeUnit) => PlainTime;
|
|
50
52
|
export declare function isEqual(element: PlainTimeLike, other: PlainTimeLike): boolean;
|
|
51
53
|
export declare function isEqual(element: PlainTimeLike | null, other: PlainTimeLike | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plain-time.d.ts","sourceRoot":"","sources":["../../src/temporal/plain-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"plain-time.d.ts","sourceRoot":"","sources":["../../src/temporal/plain-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAA;AACvD,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAA;AAGtE,OAAO,KAAK,MAAM,MAAM,sCAAsC,CAAA;AAC9D,O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,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,SAAS,aAAa,EAAE,MAAM,QAAQ,KAAG,SAE9D,CAAA;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAA;AAC9E,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAA;AAC5F,wBAAgB,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,EAAE,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAAA;AAStG,eAAO,MAAM,QAAQ,GAAI,SAAS,aAAa,EAAE,OAAO,aAAa,KAAG,OAEvE,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,SAAS,aAAa,EAAE,OAAO,aAAa,KAAG,OAEtE,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IACxC,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAC1C,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,SAAS,aAAa,EAAE,QAAQ,MAAM,EAAE,UAAU,iBAAiB,KAAG,MAW5F,CAAA;AAED,eAAO,MAAM,QAAQ,oBAAoB,CAAA;AACzC,eAAO,MAAM,IAAI,oBAAqB,CAAA"}
|
|
@@ -1,105 +1,106 @@
|
|
|
1
1
|
// src/temporal/plain-time.ts
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import * as ResourceKeys from "@bessemer/cornerstone/resource-key";
|
|
4
|
+
import * as Equalitors from "@bessemer/cornerstone/equalitor";
|
|
5
5
|
import * as Results from "@bessemer/cornerstone/result";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function from(value) {
|
|
18
|
-
if (isNil(value)) {
|
|
6
|
+
import * as ErrorEvents from "@bessemer/cornerstone/error/error-event";
|
|
7
|
+
import * as Errors from "@bessemer/cornerstone/error/error";
|
|
8
|
+
import * as ZodUtil from "@bessemer/cornerstone/zod-util";
|
|
9
|
+
import * as Clocks from "@bessemer/cornerstone/temporal/clock";
|
|
10
|
+
import * as Durations from "@bessemer/cornerstone/temporal/duration";
|
|
11
|
+
import * as Instants from "@bessemer/cornerstone/temporal/instant";
|
|
12
|
+
import * as Strings from "@bessemer/cornerstone/string";
|
|
13
|
+
import * as Objects from "@bessemer/cornerstone/object";
|
|
14
|
+
var Namespace = ResourceKeys.createNamespace("plain-time");
|
|
15
|
+
function from3(value) {
|
|
16
|
+
if (Objects.isNil(value)) {
|
|
19
17
|
return value;
|
|
20
18
|
}
|
|
21
19
|
if (value instanceof Temporal.PlainTime) {
|
|
22
20
|
return value;
|
|
23
21
|
}
|
|
24
|
-
if (isString(value)) {
|
|
25
|
-
return unpackResult(parseString(value));
|
|
22
|
+
if (Strings.isString(value)) {
|
|
23
|
+
return ErrorEvents.unpackResult(parseString(value));
|
|
26
24
|
}
|
|
27
25
|
return Temporal.PlainTime.from(value);
|
|
28
26
|
}
|
|
29
27
|
var CompareBy = (first, second) => Temporal.PlainTime.compare(first, second);
|
|
30
|
-
var EqualBy = fromComparator(CompareBy);
|
|
28
|
+
var EqualBy = Equalitors.fromComparator(CompareBy);
|
|
31
29
|
var parseString = (value) => {
|
|
32
30
|
try {
|
|
33
|
-
return success(Temporal.PlainTime.from(value));
|
|
31
|
+
return Results.success(Temporal.PlainTime.from(value));
|
|
34
32
|
} catch (e) {
|
|
35
|
-
if (!isError(e)) {
|
|
33
|
+
if (!Errors.isError(e)) {
|
|
36
34
|
throw e;
|
|
37
35
|
}
|
|
38
|
-
return failure(invalidValue(value, { namespace: Namespace, message: e.message }));
|
|
36
|
+
return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }));
|
|
39
37
|
}
|
|
40
38
|
};
|
|
41
39
|
var fromDuration = (duration) => {
|
|
42
|
-
return Midnight.add(
|
|
40
|
+
return Midnight.add(Durations.from(duration));
|
|
43
41
|
};
|
|
44
42
|
var fromInstant = (instant, zone) => {
|
|
45
|
-
return
|
|
43
|
+
return Instants.from(instant).toZonedDateTimeISO(zone).toPlainTime();
|
|
46
44
|
};
|
|
47
45
|
function toLiteral(likeValue) {
|
|
48
|
-
if (isNil(likeValue)) {
|
|
46
|
+
if (Objects.isNil(likeValue)) {
|
|
49
47
|
return likeValue;
|
|
50
48
|
}
|
|
51
|
-
const value =
|
|
49
|
+
const value = from3(likeValue);
|
|
52
50
|
if (value.second === 0 && value.millisecond === 0 && value.microsecond === 0 && value.nanosecond === 0) {
|
|
53
51
|
return `${value.hour.toString().padStart(2, "0")}:${value.minute.toString().padStart(2, "0")}`;
|
|
54
52
|
}
|
|
55
53
|
return value.toString();
|
|
56
54
|
}
|
|
57
|
-
var SchemaLiteral =
|
|
58
|
-
|
|
55
|
+
var SchemaLiteral = ZodUtil.structuredRefine(
|
|
56
|
+
ZodUtil.string(),
|
|
57
|
+
(it) => Results.map(parseString(it), (it2) => toLiteral(it2))
|
|
58
|
+
);
|
|
59
|
+
var SchemaInstance = ZodUtil.structuredTransform(ZodUtil.string(), parseString);
|
|
59
60
|
var isPlainTime = (value) => {
|
|
60
61
|
return value instanceof Temporal.PlainTime;
|
|
61
62
|
};
|
|
62
|
-
var now = (zone, clock =
|
|
63
|
+
var now = (zone, clock = Clocks.Default) => {
|
|
63
64
|
return fromInstant(clock.instant(), zone);
|
|
64
65
|
};
|
|
65
66
|
var merge = (element, builder) => {
|
|
66
|
-
return
|
|
67
|
+
return from3(element).with(builder);
|
|
67
68
|
};
|
|
68
69
|
var add = (element, duration) => {
|
|
69
|
-
return
|
|
70
|
+
return from3(element).add(Durations.from(duration));
|
|
70
71
|
};
|
|
71
72
|
var subtract = (element, duration) => {
|
|
72
|
-
return
|
|
73
|
+
return from3(element).subtract(Durations.from(duration));
|
|
73
74
|
};
|
|
74
75
|
var until = (element, other) => {
|
|
75
|
-
return
|
|
76
|
+
return from3(element).until(from3(other));
|
|
76
77
|
};
|
|
77
78
|
var round = (element, unit) => {
|
|
78
|
-
return
|
|
79
|
+
return from3(element).round({ smallestUnit: unit });
|
|
79
80
|
};
|
|
80
81
|
function isEqual(element, other) {
|
|
81
|
-
if (isNil(element) || isNil(other)) {
|
|
82
|
+
if (Objects.isNil(element) || Objects.isNil(other)) {
|
|
82
83
|
return element === other;
|
|
83
84
|
}
|
|
84
|
-
return EqualBy(
|
|
85
|
+
return EqualBy(from3(element), from3(other));
|
|
85
86
|
}
|
|
86
87
|
var isBefore = (element, other) => {
|
|
87
|
-
return CompareBy(
|
|
88
|
+
return CompareBy(from3(element), from3(other)) < 0;
|
|
88
89
|
};
|
|
89
90
|
var isAfter = (element, other) => {
|
|
90
|
-
return CompareBy(
|
|
91
|
+
return CompareBy(from3(element), from3(other)) > 0;
|
|
91
92
|
};
|
|
92
93
|
var format = (element, locale, options) => {
|
|
93
|
-
const plainTime =
|
|
94
|
+
const plainTime = from3(element);
|
|
94
95
|
const date = new Date(1970, 0, 1, plainTime.hour, plainTime.minute, plainTime.second, plainTime.millisecond);
|
|
95
|
-
if (isNil(options) || isNil(options.hour) && isNil(options.minute) && isNil(options.second)) {
|
|
96
|
+
if (Objects.isNil(options) || Objects.isNil(options.hour) && Objects.isNil(options.minute) && Objects.isNil(options.second)) {
|
|
96
97
|
options = { ...options, hour: "numeric", minute: "2-digit", ...plainTime.second > 0 || plainTime.millisecond > 0 ? { second: "2-digit" } : {} };
|
|
97
98
|
}
|
|
98
99
|
const formatter = new Intl.DateTimeFormat(locale, options);
|
|
99
100
|
return formatter.format(date);
|
|
100
101
|
};
|
|
101
|
-
var Midnight =
|
|
102
|
-
var Noon =
|
|
102
|
+
var Midnight = from3({ hour: 0 });
|
|
103
|
+
var Noon = from3({ hour: 12 });
|
|
103
104
|
export {
|
|
104
105
|
CompareBy,
|
|
105
106
|
EqualBy,
|
|
@@ -110,7 +111,7 @@ export {
|
|
|
110
111
|
SchemaLiteral,
|
|
111
112
|
add,
|
|
112
113
|
format,
|
|
113
|
-
from,
|
|
114
|
+
from3 as from,
|
|
114
115
|
fromDuration,
|
|
115
116
|
fromInstant,
|
|
116
117
|
isAfter,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/temporal/plain-time.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill'\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/temporal/plain-time.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill'\nimport * as ResourceKeys from '@bessemer/cornerstone/resource-key'\nimport { NominalType } from '@bessemer/cornerstone/types'\nimport { Comparator } from '@bessemer/cornerstone/comparator'\nimport * as Equalitors from '@bessemer/cornerstone/equalitor'\nimport * as Results from '@bessemer/cornerstone/result'\nimport * as ErrorEvents from '@bessemer/cornerstone/error/error-event'\nimport * as Errors from '@bessemer/cornerstone/error/error'\nimport * as ZodUtil from '@bessemer/cornerstone/zod-util'\nimport * as Clocks from '@bessemer/cornerstone/temporal/clock'\nimport * as Durations from '@bessemer/cornerstone/temporal/duration'\nimport * as Instants from '@bessemer/cornerstone/temporal/instant'\nimport { TimeZoneId } from '@bessemer/cornerstone/temporal/time-zone-id'\nimport { TimeUnit } from '@bessemer/cornerstone/temporal/chrono'\nimport * as Strings from '@bessemer/cornerstone/string'\nimport * as Objects from '@bessemer/cornerstone/object'\nimport { Locale } from '@bessemer/cornerstone/intl/locale'\n\nexport type PlainTime = Temporal.PlainTime\nexport const Namespace = ResourceKeys.createNamespace('plain-time')\nexport type PlainTimeLiteral = NominalType<string, typeof Namespace>\nexport type PlainTimeBuilder = {\n hour: number\n minute?: number\n second?: number\n millisecond?: number\n microsecond?: number\n nanosecond?: number\n}\nexport type PlainTimeLike = PlainTime | PlainTimeLiteral | PlainTimeBuilder\n\nexport function from(value: PlainTimeLike | string): PlainTime\nexport function from(value: PlainTimeLike | string | null): PlainTime | null\nexport function from(value: PlainTimeLike | string | undefined): PlainTime | undefined\nexport function from(value: PlainTimeLike | string | null | undefined): PlainTime | null | undefined\nexport function from(value: PlainTimeLike | string | null | undefined): PlainTime | null | undefined {\n if (Objects.isNil(value)) {\n return value\n }\n\n if (value instanceof Temporal.PlainTime) {\n return value\n }\n if (Strings.isString(value)) {\n return ErrorEvents.unpackResult(parseString(value))\n }\n\n return Temporal.PlainTime.from(value)\n}\n\nexport const CompareBy: Comparator<PlainTime> = (first: PlainTime, second: PlainTime): number => Temporal.PlainTime.compare(first, second)\nexport const EqualBy = Equalitors.fromComparator(CompareBy)\n\nexport const parseString = (value: string): Results.Result<PlainTime, ErrorEvents.ErrorEvent> => {\n try {\n return Results.success(Temporal.PlainTime.from(value))\n } catch (e) {\n if (!Errors.isError(e)) {\n throw e\n }\n\n return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }))\n }\n}\n\nexport const fromDuration = (duration: Durations.DurationLike): PlainTime => {\n return Midnight.add(Durations.from(duration))\n}\n\nexport const fromInstant = (instant: Instants.InstantLike, zone: TimeZoneId): PlainTime => {\n return Instants.from(instant).toZonedDateTimeISO(zone).toPlainTime()\n}\n\nexport function toLiteral(likeValue: PlainTimeLike): PlainTimeLiteral\nexport function toLiteral(likeValue: PlainTimeLike | null): PlainTimeLiteral | null\nexport function toLiteral(likeValue: PlainTimeLike | undefined): PlainTimeLiteral | undefined\nexport function toLiteral(likeValue: PlainTimeLike | null | undefined): PlainTimeLiteral | null | undefined\nexport function toLiteral(likeValue: PlainTimeLike | null | undefined): PlainTimeLiteral | null | undefined {\n if (Objects.isNil(likeValue)) {\n return likeValue\n }\n\n const value = from(likeValue)\n\n if (value.second === 0 && value.millisecond === 0 && value.microsecond === 0 && value.nanosecond === 0) {\n return `${value.hour.toString().padStart(2, '0')}:${value.minute.toString().padStart(2, '0')}` as PlainTimeLiteral\n }\n\n return value.toString() as PlainTimeLiteral\n}\n\nexport const SchemaLiteral = ZodUtil.structuredRefine<PlainTimeLiteral>(ZodUtil.string(), (it: string) =>\n Results.map(parseString(it), (it) => toLiteral(it))\n)\nexport const SchemaInstance = ZodUtil.structuredTransform(ZodUtil.string(), parseString)\n\nexport const isPlainTime = (value: unknown): value is PlainTime => {\n return value instanceof Temporal.PlainTime\n}\n\nexport const now = (zone: TimeZoneId, clock = Clocks.Default): PlainTime => {\n return fromInstant(clock.instant(), zone)\n}\n\nexport const merge = (element: PlainTimeLike, builder: Partial<PlainTimeBuilder>): PlainTime => {\n return from(element).with(builder)\n}\n\nexport const add = (element: PlainTimeLike, duration: Durations.DurationLike): PlainTime => {\n return from(element).add(Durations.from(duration))\n}\n\nexport const subtract = (element: PlainTimeLike, duration: Durations.DurationLike): PlainTime => {\n return from(element).subtract(Durations.from(duration))\n}\n\nexport const until = (element: PlainTimeLike, other: PlainTimeLike): Durations.Duration => {\n return from(element).until(from(other))\n}\n\nexport const round = (element: PlainTimeLike, unit: TimeUnit): PlainTime => {\n return from(element).round({ smallestUnit: unit })\n}\n\nexport function isEqual(element: PlainTimeLike, other: PlainTimeLike): boolean\nexport function isEqual(element: PlainTimeLike | null, other: PlainTimeLike | null): boolean\nexport function isEqual(element: PlainTimeLike | undefined, other: PlainTimeLike | undefined): boolean\nexport function isEqual(element: PlainTimeLike | null | undefined, other: PlainTimeLike | null | undefined): boolean {\n if (Objects.isNil(element) || Objects.isNil(other)) {\n return element === other\n }\n\n return EqualBy(from(element), from(other))\n}\n\nexport const isBefore = (element: PlainTimeLike, other: PlainTimeLike): boolean => {\n return CompareBy(from(element), from(other)) < 0\n}\n\nexport const isAfter = (element: PlainTimeLike, other: PlainTimeLike): boolean => {\n return CompareBy(from(element), from(other)) > 0\n}\n\nexport type TimeFormatOptions = {\n hour12?: boolean | undefined\n hour?: 'numeric' | '2-digit' | undefined\n minute?: 'numeric' | '2-digit' | undefined\n second?: 'numeric' | '2-digit' | undefined\n}\n\nexport const format = (element: PlainTimeLike, locale: Locale, options?: TimeFormatOptions): string => {\n const plainTime = from(element)\n\n const date = new Date(1970, 0, 1, plainTime.hour, plainTime.minute, plainTime.second, plainTime.millisecond)\n\n if (Objects.isNil(options) || (Objects.isNil(options.hour) && Objects.isNil(options.minute) && Objects.isNil(options.second))) {\n options = { ...options, hour: 'numeric', minute: '2-digit', ...(plainTime.second > 0 || plainTime.millisecond > 0 ? { second: '2-digit' } : {}) }\n }\n\n const formatter = new Intl.DateTimeFormat(locale, options)\n return formatter.format(date)\n}\n\nexport const Midnight = from({ hour: 0 })\nexport const Noon = from({ hour: 12 })\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,YAAY,kBAAkB;AAG9B,YAAY,gBAAgB;AAC5B,YAAY,aAAa;AACzB,YAAY,iBAAiB;AAC7B,YAAY,YAAY;AACxB,YAAY,aAAa;AACzB,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAG1B,YAAY,aAAa;AACzB,YAAY,aAAa;AAIlB,IAAM,YAAyB,6BAAgB,YAAY;AAgB3D,SAASA,MAAK,OAAgF;AACnG,MAAY,cAAM,KAAK,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,iBAAiB,SAAS,WAAW;AACvC,WAAO;AAAA,EACT;AACA,MAAY,iBAAS,KAAK,GAAG;AAC3B,WAAmB,yBAAa,YAAY,KAAK,CAAC;AAAA,EACpD;AAEA,SAAO,SAAS,UAAU,KAAK,KAAK;AACtC;AAEO,IAAM,YAAmC,CAAC,OAAkB,WAA8B,SAAS,UAAU,QAAQ,OAAO,MAAM;AAClI,IAAM,UAAqB,0BAAe,SAAS;AAEnD,IAAM,cA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AAA,EAClJ;AAEA,QAAM,YAAY,IAAI,KAAK,eAAe,QAAQ,OAAO;AACzD,SAAO,UAAU,OAAO,IAAI;AAC9B;AAEO,IAAM,WAAWA,MAAK,EAAE,MAAM,EAAE,CAAC;AACjC,IAAM,OAAOA,MAAK,EAAE,MAAM,GAAG,CAAC;","names":["from","it"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import * as ResourceKeys from '@bessemer/cornerstone/resource-key';
|
|
3
|
+
import { NominalType } from '@bessemer/cornerstone/types';
|
|
4
|
+
import { Comparator } from '@bessemer/cornerstone/comparator';
|
|
5
|
+
import * as Equalitors from '@bessemer/cornerstone/equalitor';
|
|
6
|
+
import * as Results from '@bessemer/cornerstone/result';
|
|
7
|
+
import * as ErrorEvents from '@bessemer/cornerstone/error/error-event';
|
|
8
|
+
import Zod from 'zod';
|
|
9
|
+
import * as Clocks from '@bessemer/cornerstone/temporal/clock';
|
|
10
|
+
import * as Durations from '@bessemer/cornerstone/temporal/duration';
|
|
11
|
+
import * as Instants from '@bessemer/cornerstone/temporal/instant';
|
|
12
|
+
import { TimeZoneId } from '@bessemer/cornerstone/temporal/time-zone-id';
|
|
13
|
+
import { Locale } from '@bessemer/cornerstone/intl/locale';
|
|
14
|
+
export type PlainYearMonth = Temporal.PlainYearMonth;
|
|
15
|
+
export declare const Namespace: ResourceKeys.ResourceNamespace<"plain-year-month">;
|
|
16
|
+
export type PlainYearMonthLiteral = NominalType<string, typeof Namespace>;
|
|
17
|
+
export type PlainYearMonthBuilder = {
|
|
18
|
+
year: number;
|
|
19
|
+
month: number;
|
|
20
|
+
};
|
|
21
|
+
export type PlainYearMonthLike = PlainYearMonth | PlainYearMonthLiteral | PlainYearMonthBuilder;
|
|
22
|
+
export declare function from(value: PlainYearMonthLike | string): PlainYearMonth;
|
|
23
|
+
export declare function from(value: PlainYearMonthLike | string | null): PlainYearMonth | null;
|
|
24
|
+
export declare function from(value: PlainYearMonthLike | string | undefined): PlainYearMonth | undefined;
|
|
25
|
+
export declare function from(value: PlainYearMonthLike | string | null | undefined): PlainYearMonth | null | undefined;
|
|
26
|
+
export declare const CompareBy: Comparator<PlainYearMonth>;
|
|
27
|
+
export declare const EqualBy: Equalitors.Equalitor<Temporal.PlainYearMonth>;
|
|
28
|
+
export declare const parseString: (value: string) => Results.Result<PlainYearMonth, ErrorEvents.ErrorEvent>;
|
|
29
|
+
export declare const fromInstant: (instant: Instants.InstantLike, zone: TimeZoneId) => PlainYearMonth;
|
|
30
|
+
export declare function toLiteral(likeValue: PlainYearMonthLike): PlainYearMonthLiteral;
|
|
31
|
+
export declare function toLiteral(likeValue: PlainYearMonthLike | null): PlainYearMonthLiteral | null;
|
|
32
|
+
export declare function toLiteral(likeValue: PlainYearMonthLike | undefined): PlainYearMonthLiteral | undefined;
|
|
33
|
+
export declare function toLiteral(likeValue: PlainYearMonthLike | null | undefined): PlainYearMonthLiteral | null | undefined;
|
|
34
|
+
export declare const SchemaLiteral: Zod.ZodPipe<Zod.ZodString, Zod.ZodTransform<PlainYearMonthLiteral, string>>;
|
|
35
|
+
export declare const SchemaInstance: Zod.ZodPipe<Zod.ZodString, Zod.ZodTransform<Temporal.PlainYearMonth, string>>;
|
|
36
|
+
export declare const isPlainYearMonth: (value: unknown) => value is PlainYearMonth;
|
|
37
|
+
export declare const now: (zone: TimeZoneId, clock?: {
|
|
38
|
+
readonly zone: TimeZoneId;
|
|
39
|
+
instant(): Instants.Instant;
|
|
40
|
+
withZone(zone: TimeZoneId): Clocks.Clock;
|
|
41
|
+
}) => PlainYearMonth;
|
|
42
|
+
export declare const merge: (element: PlainYearMonthLike, builder: Partial<PlainYearMonthBuilder>) => PlainYearMonth;
|
|
43
|
+
export declare const add: (element: PlainYearMonthLike, duration: Durations.DurationLike) => PlainYearMonth;
|
|
44
|
+
export declare const subtract: (element: PlainYearMonthLike, duration: Durations.DurationLike) => PlainYearMonth;
|
|
45
|
+
export declare const until: (element: PlainYearMonthLike, other: PlainYearMonthLike) => Durations.Duration;
|
|
46
|
+
export declare function isEqual(element: PlainYearMonthLike, other: PlainYearMonthLike): boolean;
|
|
47
|
+
export declare function isEqual(element: PlainYearMonthLike | null, other: PlainYearMonthLike | null): boolean;
|
|
48
|
+
export declare function isEqual(element: PlainYearMonthLike | undefined, other: PlainYearMonthLike | undefined): boolean;
|
|
49
|
+
export declare const isBefore: (element: PlainYearMonthLike, other: PlainYearMonthLike) => boolean;
|
|
50
|
+
export declare const isAfter: (element: PlainYearMonthLike, other: PlainYearMonthLike) => boolean;
|
|
51
|
+
export type YearMonthFormatOptions = {
|
|
52
|
+
era?: 'long' | 'short' | 'narrow' | undefined;
|
|
53
|
+
year?: 'numeric' | '2-digit' | undefined;
|
|
54
|
+
month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' | undefined;
|
|
55
|
+
};
|
|
56
|
+
export declare const format: (element: PlainYearMonthLike, locale: Locale, options: YearMonthFormatOptions) => string;
|
|
57
|
+
//# sourceMappingURL=plain-year-month.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain-year-month.d.ts","sourceRoot":"","sources":["../../src/temporal/plain-year-month.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAA;AACvD,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAA;AAGtE,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,KAAK,MAAM,MAAM,sCAAsC,CAAA;AAC9D,OAAO,KAAK,SAAS,MAAM,yCAAyC,CAAA;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KAAK,EAAE,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAAA;AAShH,eAAO,MAAM,QAAQ,GAAI,SAAS,kBAAkB,EAAE,OAAO,kBAAkB,KAAG,OAEjF,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,SAAS,kBAAkB,EAAE,OAAO,kBAAkB,KAAG,OAEhF,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC7C,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IACxC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;CACxE,CAAA;AAED,eAAO,MAAM,MAAM,GAAI,SAAS,kBAAkB,EAAE,QAAQ,MAAM,EAAE,SAAS,sBAAsB,KAAG,MAOrG,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/temporal/plain-year-month.ts
|
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
+
import * as ResourceKeys from "@bessemer/cornerstone/resource-key";
|
|
4
|
+
import * as Equalitors from "@bessemer/cornerstone/equalitor";
|
|
5
|
+
import * as Results from "@bessemer/cornerstone/result";
|
|
6
|
+
import * as ErrorEvents from "@bessemer/cornerstone/error/error-event";
|
|
7
|
+
import * as Errors from "@bessemer/cornerstone/error/error";
|
|
8
|
+
import * as ZodUtil from "@bessemer/cornerstone/zod-util";
|
|
9
|
+
import Zod from "zod";
|
|
10
|
+
import * as Clocks from "@bessemer/cornerstone/temporal/clock";
|
|
11
|
+
import * as Durations from "@bessemer/cornerstone/temporal/duration";
|
|
12
|
+
import * as Instants from "@bessemer/cornerstone/temporal/instant";
|
|
13
|
+
import * as Strings from "@bessemer/cornerstone/string";
|
|
14
|
+
import * as Objects from "@bessemer/cornerstone/object";
|
|
15
|
+
var Namespace = ResourceKeys.createNamespace("plain-year-month");
|
|
16
|
+
function from3(value) {
|
|
17
|
+
if (Objects.isNil(value)) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
if (value instanceof Temporal.PlainYearMonth) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
if (Strings.isString(value)) {
|
|
24
|
+
return ErrorEvents.unpackResult(parseString(value));
|
|
25
|
+
}
|
|
26
|
+
return Temporal.PlainYearMonth.from(value);
|
|
27
|
+
}
|
|
28
|
+
var CompareBy = (first, second) => Temporal.PlainYearMonth.compare(first, second);
|
|
29
|
+
var EqualBy = Equalitors.fromComparator(CompareBy);
|
|
30
|
+
var parseString = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
return Results.success(Temporal.PlainYearMonth.from(value));
|
|
33
|
+
} catch (e) {
|
|
34
|
+
if (!Errors.isError(e)) {
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
37
|
+
return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var fromInstant = (instant, zone) => {
|
|
41
|
+
return Instants.from(instant).toZonedDateTimeISO(zone).toPlainDate().toPlainYearMonth();
|
|
42
|
+
};
|
|
43
|
+
function toLiteral(likeValue) {
|
|
44
|
+
if (Objects.isNil(likeValue)) {
|
|
45
|
+
return likeValue;
|
|
46
|
+
}
|
|
47
|
+
const value = from3(likeValue);
|
|
48
|
+
return value.toString();
|
|
49
|
+
}
|
|
50
|
+
var SchemaLiteral = ZodUtil.structuredTransform(Zod.string(), (it) => Results.map(parseString(it), (it2) => toLiteral(it2)));
|
|
51
|
+
var SchemaInstance = ZodUtil.structuredTransform(Zod.string(), parseString);
|
|
52
|
+
var isPlainYearMonth = (value) => {
|
|
53
|
+
return value instanceof Temporal.PlainYearMonth;
|
|
54
|
+
};
|
|
55
|
+
var now = (zone, clock = Clocks.Default) => {
|
|
56
|
+
return fromInstant(clock.instant(), zone);
|
|
57
|
+
};
|
|
58
|
+
var merge = (element, builder) => {
|
|
59
|
+
return from3(element).with(builder);
|
|
60
|
+
};
|
|
61
|
+
var add = (element, duration) => {
|
|
62
|
+
return from3(element).add(Durations.from(duration));
|
|
63
|
+
};
|
|
64
|
+
var subtract = (element, duration) => {
|
|
65
|
+
return from3(element).subtract(Durations.from(duration));
|
|
66
|
+
};
|
|
67
|
+
var until = (element, other) => {
|
|
68
|
+
return from3(element).until(from3(other));
|
|
69
|
+
};
|
|
70
|
+
function isEqual(element, other) {
|
|
71
|
+
if (Objects.isNil(element) || Objects.isNil(other)) {
|
|
72
|
+
return element === other;
|
|
73
|
+
}
|
|
74
|
+
return EqualBy(from3(element), from3(other));
|
|
75
|
+
}
|
|
76
|
+
var isBefore = (element, other) => {
|
|
77
|
+
return CompareBy(from3(element), from3(other)) < 0;
|
|
78
|
+
};
|
|
79
|
+
var isAfter = (element, other) => {
|
|
80
|
+
return CompareBy(from3(element), from3(other)) > 0;
|
|
81
|
+
};
|
|
82
|
+
var format = (element, locale, options) => {
|
|
83
|
+
const plainYearMonth = from3(element);
|
|
84
|
+
const date = new Date(plainYearMonth.year, plainYearMonth.month - 1, 1);
|
|
85
|
+
const formatter = new Intl.DateTimeFormat(locale, options);
|
|
86
|
+
return formatter.format(date);
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
CompareBy,
|
|
90
|
+
EqualBy,
|
|
91
|
+
Namespace,
|
|
92
|
+
SchemaInstance,
|
|
93
|
+
SchemaLiteral,
|
|
94
|
+
add,
|
|
95
|
+
format,
|
|
96
|
+
from3 as from,
|
|
97
|
+
fromInstant,
|
|
98
|
+
isAfter,
|
|
99
|
+
isBefore,
|
|
100
|
+
isEqual,
|
|
101
|
+
isPlainYearMonth,
|
|
102
|
+
merge,
|
|
103
|
+
now,
|
|
104
|
+
parseString,
|
|
105
|
+
subtract,
|
|
106
|
+
toLiteral,
|
|
107
|
+
until
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=plain-year-month.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/temporal/plain-year-month.ts"],"sourcesContent":["import { Temporal } from '@js-temporal/polyfill'\nimport * as ResourceKeys from '@bessemer/cornerstone/resource-key'\nimport { NominalType } from '@bessemer/cornerstone/types'\nimport { Comparator } from '@bessemer/cornerstone/comparator'\nimport * as Equalitors from '@bessemer/cornerstone/equalitor'\nimport * as Results from '@bessemer/cornerstone/result'\nimport * as ErrorEvents from '@bessemer/cornerstone/error/error-event'\nimport * as Errors from '@bessemer/cornerstone/error/error'\nimport * as ZodUtil from '@bessemer/cornerstone/zod-util'\nimport Zod from 'zod'\nimport * as Clocks from '@bessemer/cornerstone/temporal/clock'\nimport * as Durations from '@bessemer/cornerstone/temporal/duration'\nimport * as Instants from '@bessemer/cornerstone/temporal/instant'\nimport { TimeZoneId } from '@bessemer/cornerstone/temporal/time-zone-id'\nimport * as Strings from '@bessemer/cornerstone/string'\nimport * as Objects from '@bessemer/cornerstone/object'\nimport { Locale } from '@bessemer/cornerstone/intl/locale'\n\nexport type PlainYearMonth = Temporal.PlainYearMonth\nexport const Namespace = ResourceKeys.createNamespace('plain-year-month')\nexport type PlainYearMonthLiteral = NominalType<string, typeof Namespace>\nexport type PlainYearMonthBuilder = {\n year: number\n month: number\n}\n\nexport type PlainYearMonthLike = PlainYearMonth | PlainYearMonthLiteral | PlainYearMonthBuilder\n\nexport function from(value: PlainYearMonthLike | string): PlainYearMonth\nexport function from(value: PlainYearMonthLike | string | null): PlainYearMonth | null\nexport function from(value: PlainYearMonthLike | string | undefined): PlainYearMonth | undefined\nexport function from(value: PlainYearMonthLike | string | null | undefined): PlainYearMonth | null | undefined\nexport function from(value: PlainYearMonthLike | string | null | undefined): PlainYearMonth | null | undefined {\n if (Objects.isNil(value)) {\n return value\n }\n\n if (value instanceof Temporal.PlainYearMonth) {\n return value\n }\n\n if (Strings.isString(value)) {\n return ErrorEvents.unpackResult(parseString(value))\n }\n\n return Temporal.PlainYearMonth.from(value)\n}\n\nexport const CompareBy: Comparator<PlainYearMonth> = (first: PlainYearMonth, second: PlainYearMonth): number =>\n Temporal.PlainYearMonth.compare(first, second)\nexport const EqualBy = Equalitors.fromComparator(CompareBy)\n\nexport const parseString = (value: string): Results.Result<PlainYearMonth, ErrorEvents.ErrorEvent> => {\n try {\n return Results.success(Temporal.PlainYearMonth.from(value))\n } catch (e) {\n if (!Errors.isError(e)) {\n throw e\n }\n\n return Results.failure(ErrorEvents.invalidValue(value, { namespace: Namespace, message: e.message }))\n }\n}\n\nexport const fromInstant = (instant: Instants.InstantLike, zone: TimeZoneId): PlainYearMonth => {\n return Instants.from(instant).toZonedDateTimeISO(zone).toPlainDate().toPlainYearMonth()\n}\n\nexport function toLiteral(likeValue: PlainYearMonthLike): PlainYearMonthLiteral\nexport function toLiteral(likeValue: PlainYearMonthLike | null): PlainYearMonthLiteral | null\nexport function toLiteral(likeValue: PlainYearMonthLike | undefined): PlainYearMonthLiteral | undefined\nexport function toLiteral(likeValue: PlainYearMonthLike | null | undefined): PlainYearMonthLiteral | null | undefined\nexport function toLiteral(likeValue: PlainYearMonthLike | null | undefined): PlainYearMonthLiteral | null | undefined {\n if (Objects.isNil(likeValue)) {\n return likeValue\n }\n\n const value = from(likeValue)\n return value.toString() as PlainYearMonthLiteral\n}\n\nexport const SchemaLiteral = ZodUtil.structuredTransform(Zod.string(), (it: string) => Results.map(parseString(it), (it) => toLiteral(it)))\nexport const SchemaInstance = ZodUtil.structuredTransform(Zod.string(), parseString)\n\nexport const isPlainYearMonth = (value: unknown): value is PlainYearMonth => {\n return value instanceof Temporal.PlainYearMonth\n}\n\nexport const now = (zone: TimeZoneId, clock = Clocks.Default): PlainYearMonth => {\n return fromInstant(clock.instant(), zone)\n}\n\nexport const merge = (element: PlainYearMonthLike, builder: Partial<PlainYearMonthBuilder>): PlainYearMonth => {\n return from(element).with(builder)\n}\n\nexport const add = (element: PlainYearMonthLike, duration: Durations.DurationLike): PlainYearMonth => {\n return from(element).add(Durations.from(duration))\n}\n\nexport const subtract = (element: PlainYearMonthLike, duration: Durations.DurationLike): PlainYearMonth => {\n return from(element).subtract(Durations.from(duration))\n}\n\nexport const until = (element: PlainYearMonthLike, other: PlainYearMonthLike): Durations.Duration => {\n return from(element).until(from(other))\n}\n\nexport function isEqual(element: PlainYearMonthLike, other: PlainYearMonthLike): boolean\nexport function isEqual(element: PlainYearMonthLike | null, other: PlainYearMonthLike | null): boolean\nexport function isEqual(element: PlainYearMonthLike | undefined, other: PlainYearMonthLike | undefined): boolean\nexport function isEqual(element: PlainYearMonthLike | null | undefined, other: PlainYearMonthLike | null | undefined): boolean {\n if (Objects.isNil(element) || Objects.isNil(other)) {\n return element === other\n }\n\n return EqualBy(from(element), from(other))\n}\n\nexport const isBefore = (element: PlainYearMonthLike, other: PlainYearMonthLike): boolean => {\n return CompareBy(from(element), from(other)) < 0\n}\n\nexport const isAfter = (element: PlainYearMonthLike, other: PlainYearMonthLike): boolean => {\n return CompareBy(from(element), from(other)) > 0\n}\n\nexport type YearMonthFormatOptions = {\n era?: 'long' | 'short' | 'narrow' | undefined\n year?: 'numeric' | '2-digit' | undefined\n month?: 'numeric' | '2-digit' | 'long' | 'short' | 'narrow' | undefined\n}\n\nexport const format = (element: PlainYearMonthLike, locale: Locale, options: YearMonthFormatOptions): string => {\n const plainYearMonth = from(element)\n\n const date = new Date(plainYearMonth.year, plainYearMonth.month - 1, 1)\n\n const formatter = new Intl.DateTimeFormat(locale, options)\n return formatter.format(date)\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,YAAY,kBAAkB;AAG9B,YAAY,gBAAgB;AAC5B,YAAY,aAAa;AACzB,YAAY,iBAAiB;AAC7B,YAAY,YAAY;AACxB,YAAY,aAAa;AACzB,OAAO,SAAS;AAChB,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,cAAc;AAE1B,YAAY,aAAa;AACzB,YAAY,aAAa;AAIlB,IAAM,YAAyB,6B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AM,QAAQ,GAAG,IAAI;AAC1C;AAEO,IAAM,QAAQ,CAAC,SAA6B,YAA4D;AAC7G,SAAOD,MAAK,OAAO,EAAE,KAAK,OAAO;AACnC;AAEO,IAAM,MAAM,CAAC,SAA6B,aAAqD;AACpG,SAAOA,MAAK,OAAO,EAAE,IAAc,eAAK,QAAQ,CAAC;AACnD;AAEO,IAAM,WAAW,CAAC,SAA6B,aAAqD;AACzG,SAAOA,MAAK,OAAO,EAAE,SAAmB,eAAK,QAAQ,CAAC;AACxD;AAEO,IAAM,QAAQ,CAAC,SAA6B,UAAkD;AACnG,SAAOA,MAAK,OAAO,EAAE,MAAMA,MAAK,KAAK,CAAC;AACxC;AAKO,SAAS,QAAQ,SAAgD,OAAuD;AAC7H,MAAY,cAAM,OAAO,KAAa,cAAM,KAAK,GAAG;AAClD,WAAO,YAAY;AAAA,EACrB;AAEA,SAAO,QAAQA,MAAK,OAAO,GAAGA,MAAK,KAAK,CAAC;AAC3C;AAEO,IAAM,WAAW,CAAC,SAA6B,UAAuC;AAC3F,SAAO,UAAUA,MAAK,OAAO,GAAGA,MAAK,KAAK,CAAC,IAAI;AACjD;AAEO,IAAM,UAAU,CAAC,SAA6B,UAAuC;AAC1F,SAAO,UAAUA,MAAK,OAAO,GAAGA,MAAK,KAAK,CAAC,IAAI;AACjD;AAQO,IAAM,SAAS,CAAC,SAA6B,QAAgB,YAA4C;AAC9G,QAAM,iBAAiBA,MAAK,OAAO;AAEnC,QAAM,OAAO,IAAI,KAAK,eAAe,MAAM,eAAe,QAAQ,GAAG,CAAC;AAEtE,QAAM,YAAY,IAAI,KAAK,eAAe,QAAQ,OAAO;AACzD,SAAO,UAAU,OAAO,IAAI;AAC9B;","names":["from","it"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Results from '@bessemer/cornerstone/result';
|
|
2
2
|
import Zod from 'zod';
|
|
3
3
|
import { NominalType } from '@bessemer/cornerstone/types';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import * as ResourceKeys from '@bessemer/cornerstone/resource-key';
|
|
5
|
+
import * as ErrorEvents from '@bessemer/cornerstone/error/error-event';
|
|
6
|
+
export declare const Namespace: ResourceKeys.ResourceNamespace<"time-zone-id">;
|
|
6
7
|
export type TimeZoneId = NominalType<string, typeof Namespace>;
|
|
7
|
-
export declare const parseString: (value: string) => Result<TimeZoneId, ErrorEvent>;
|
|
8
|
+
export declare const parseString: (value: string) => Results.Result<TimeZoneId, ErrorEvents.ErrorEvent>;
|
|
8
9
|
export declare const from: (value: string) => TimeZoneId;
|
|
9
10
|
export declare const Schema: Zod.ZodPipe<Zod.ZodString, Zod.ZodTransform<TimeZoneId, string>>;
|
|
10
11
|
export declare const Utc: TimeZoneId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-zone-id.d.ts","sourceRoot":"","sources":["../../src/temporal/time-zone-id.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"time-zone-id.d.ts","sourceRoot":"","sources":["../../src/temporal/time-zone-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAA;AACvD,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAClE,OAAO,KAAK,WAAW,MAAM,yCAAyC,CAAA;AAItE,eAAO,MAAM,SAAS,gDAA+C,CAAA;AACrE,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,SAAS,CAAC,CAAA;AAE9D,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,UAAU,CAW5F,CAAA;AAED,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,KAAG,UAEpC,CAAA;AAED,eAAO,MAAM,MAAM,kEAAyD,CAAA;AAE5E,eAAO,MAAM,GAAG,EAAY,UAAU,CAAA;AACtC,eAAO,MAAM,gBAAgB,QAAO,UAEnC,CAAA"}
|