diff --git a/@coven/compare/deno.json b/@coven/compare/deno.json index 4838f6c..94fe9f8 100644 --- a/@coven/compare/deno.json +++ b/@coven/compare/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/compare", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/constants/deno.json b/@coven/constants/deno.json index 3678327..d2e4696 100644 --- a/@coven/constants/deno.json +++ b/@coven/constants/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/constants", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/cron/cronRegExp.ts b/@coven/cron/cronRegExp.ts index 2a31e30..bb3ca03 100644 --- a/@coven/cron/cronRegExp.ts +++ b/@coven/cron/cronRegExp.ts @@ -46,7 +46,7 @@ import { valueRangeOrListRegExp } from "./valueRangeOrListRegExp.ts"; * new RegExp(cronRegExp).test("1 2 3 4 5"); // true * ``` */ -export const cronRegExp: "^\\s*(?!(?:\\S+\\s+){2}(?:(?:(?:3[01](?:-3[01])?|(?:(?:3[01](?:-3[01])?,)+3[01](?:-3[01])?))\\s+(?:(?:0?2|feb)(?:-(?:0?2|feb))?|(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?,)+(?:0?2|feb)(?:-(?:0?2|feb))?)))|(?:(?:31(?:-31)?|(?:(?:31(?:-31)?,)+31(?:-31)?))\\s+(?:(?:0?[2469]|11|feb|apr|jun|sep|nov)|(?:(?:(?:0?[2469]|11|feb|apr|jun|sep|nov),)+(?:0?[2469]|11|feb|apr|jun|sep|nov)))))\\s+\\S+)(?\\*|(?:(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?|(?:(?:(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?,)+(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?)))\\s+(?\\*|(?:(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?|(?:(?:(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?,)+(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?)))\\s+(?\\*|(?:(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?|(?:(?:(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?,)+(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?)))\\s+(?\\*|(?:(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?|(?:(?:(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?,)+(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?)))\\s+(?\\*|(?:(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?|(?:(?:(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?,)+(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?)))\\s*$" = +export const cronRegExp: "^\\s*(?!(?:\\S+\\s+){2}(?:(?:(?:3[01](?:-3[01])?|(?:(?:3[01](?:-3[01])?,)+3[01](?:-3[01])?))\\s+(?:(?:0?2|feb)(?:-(?:0?2|feb))?|(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?,)+(?:0?2|feb)(?:-(?:0?2|feb))?)))|(?:(?:31(?:-31)?|(?:(?:31(?:-31)?,)+31(?:-31)?))\\s+(?:(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?|(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?,)+(?:0?2|feb)(?:-(?:0?2|feb))?))|(?:(?:0?4|apr)(?:-(?:0?4|apr))?|(?:(?:(?:0?4|apr)(?:-(?:0?4|apr))?,)+(?:0?4|apr)(?:-(?:0?4|apr))?))|(?:(?:0?6|jun)(?:-(?:0?6|jun))?|(?:(?:(?:0?6|jun)(?:-(?:0?6|jun))?,)+(?:0?6|jun)(?:-(?:0?6|jun))?))|(?:(?:0?9|sep)(?:-(?:0?9|sep))?|(?:(?:(?:0?9|sep)(?:-(?:0?9|sep))?,)+(?:0?9|sep)(?:-(?:0?9|sep))?))|(?:(?:11|nov)(?:-(?:11|nov))?|(?:(?:(?:11|nov)(?:-(?:11|nov))?,)+(?:11|nov)(?:-(?:11|nov))?)))|(?:(?:(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?|(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?,)+(?:0?2|feb)(?:-(?:0?2|feb))?))|(?:(?:0?4|apr)(?:-(?:0?4|apr))?|(?:(?:(?:0?4|apr)(?:-(?:0?4|apr))?,)+(?:0?4|apr)(?:-(?:0?4|apr))?))|(?:(?:0?6|jun)(?:-(?:0?6|jun))?|(?:(?:(?:0?6|jun)(?:-(?:0?6|jun))?,)+(?:0?6|jun)(?:-(?:0?6|jun))?))|(?:(?:0?9|sep)(?:-(?:0?9|sep))?|(?:(?:(?:0?9|sep)(?:-(?:0?9|sep))?,)+(?:0?9|sep)(?:-(?:0?9|sep))?))|(?:(?:11|nov)(?:-(?:11|nov))?|(?:(?:(?:11|nov)(?:-(?:11|nov))?,)+(?:11|nov)(?:-(?:11|nov))?))),)+(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?|(?:(?:(?:0?2|feb)(?:-(?:0?2|feb))?,)+(?:0?2|feb)(?:-(?:0?2|feb))?))|(?:(?:0?4|apr)(?:-(?:0?4|apr))?|(?:(?:(?:0?4|apr)(?:-(?:0?4|apr))?,)+(?:0?4|apr)(?:-(?:0?4|apr))?))|(?:(?:0?6|jun)(?:-(?:0?6|jun))?|(?:(?:(?:0?6|jun)(?:-(?:0?6|jun))?,)+(?:0?6|jun)(?:-(?:0?6|jun))?))|(?:(?:0?9|sep)(?:-(?:0?9|sep))?|(?:(?:(?:0?9|sep)(?:-(?:0?9|sep))?,)+(?:0?9|sep)(?:-(?:0?9|sep))?))|(?:(?:11|nov)(?:-(?:11|nov))?|(?:(?:(?:11|nov)(?:-(?:11|nov))?,)+(?:11|nov)(?:-(?:11|nov))?)))))))\\s+\\S+)(?\\*|(?:(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?|(?:(?:(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?,)+(?:0?\\d|[1-5]\\d)(?:-(?:0?\\d|[1-5]\\d))?)))\\s+(?\\*|(?:(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?|(?:(?:(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?,)+(?:0?\\d|1\\d|20-3)(?:-(?:0?\\d|1\\d|20-3))?)))\\s+(?\\*|(?:(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?|(?:(?:(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?,)+(?:0?[1-9]|[12]\\d|3[01])(?:-(?:0?[1-9]|[12]\\d|3[01]))?)))\\s+(?\\*|(?:(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?|(?:(?:(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?,)+(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2])(?:-(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|0?[1-9]|1[0-2]))?)))\\s+(?\\*|(?:(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?|(?:(?:(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?,)+(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6])(?:-(?:sun|mon|tue|wed|thu|fri|sat|0?[0-6]))?)))\\s*$" = join( START, allow(WHITESPACE), @@ -67,13 +67,30 @@ export const cronRegExp: "^\\s*(?!(?:\\S+\\s+){2}(?:(?:(?:3[01](?:-3[01])?|(?:(? valueOrListRegExp( group( disjunction( - paddedRegExp(characterClass(2, 4, 6, 9)), - 11, - "feb", - "apr", - "jun", - "sep", - "nov", + valueRangeOrListRegExp( + group( + disjunction(paddedRegExp(2), "feb"), + ), + ), + valueRangeOrListRegExp( + group( + disjunction(paddedRegExp(4), "apr"), + ), + ), + + valueRangeOrListRegExp( + group( + disjunction(paddedRegExp(6), "jun"), + ), + ), + valueRangeOrListRegExp( + group( + disjunction(paddedRegExp(9), "sep"), + ), + ), + valueRangeOrListRegExp( + group(disjunction(11, "nov")), + ), ), ), ), diff --git a/@coven/cron/deno.json b/@coven/cron/deno.json index e305797..cd20dd3 100644 --- a/@coven/cron/deno.json +++ b/@coven/cron/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/cron", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/cron/isRangeField.ts b/@coven/cron/isRangeField.ts index e9758a4..f29cc73 100644 --- a/@coven/cron/isRangeField.ts +++ b/@coven/cron/isRangeField.ts @@ -21,6 +21,5 @@ export const isRangeField: ( && hasFrom(value) && hasTo(value) && isNumber(value.from) - && isNumber(value.to) - && value.from < value.to, + && isNumber(value.to), ); diff --git a/@coven/cron/nextISODate.ts b/@coven/cron/nextISODate.ts index db79669..f586fdb 100644 --- a/@coven/cron/nextISODate.ts +++ b/@coven/cron/nextISODate.ts @@ -8,6 +8,12 @@ import { nextISODates } from "./nextISODates.ts"; /** * Get next ISO date string for the given date and the given cron expression. * + * > [!NOTE] + * > This function is expensive because it relies on {@linkcode nextISODates} which is also expensive (it goes minute by minute). + * + * > [!WARNING] + * > If user input will be passed to this function, make sure to validate it first because this has the potential to loop forever. + * * @example Getting the next ISO Date string corresponding to the given cron expression * ```typescript * nextISODate("1989-10-13T10:15:00.000Z")("* * * * *"); // "1989-10-13T10:16:00.000Z" diff --git a/@coven/cron/nextISODates.ts b/@coven/cron/nextISODates.ts index ce3e4be..deb63a3 100644 --- a/@coven/cron/nextISODates.ts +++ b/@coven/cron/nextISODates.ts @@ -24,6 +24,12 @@ const filterIsISODate = filter( /** * Get next ISO date string iterator for the given date and the given cron expression. * + * > [!NOTE] + * > This function is expensive. It goes minute by minute scanning for matches. + * + * > [!WARNING] + * > If user input will be passed to this function, make sure to validate it first because this has the potential to loop forever. + * * @example Using `take` from `@coven/iterables` to get some ISO Dates following the given one with the given cron expression * ```typescript * import { take } from "@coven/iterables"; diff --git a/@coven/cron/tests/isRangeField.test.ts b/@coven/cron/tests/isRangeField.test.ts index 1a6da87..c143014 100644 --- a/@coven/cron/tests/isRangeField.test.ts +++ b/@coven/cron/tests/isRangeField.test.ts @@ -10,7 +10,3 @@ Deno.test("Array of numbers returns true", () => ); Deno.test("Range returns true", () => assert(isRangeField({ from: 3, to: 5 }))); - -Deno.test("Range with inverted from and to returns false", () => - assertFalse(isRangeField({ from: 5, to: 3 })), -); diff --git a/@coven/cron/tests/isValidExpression.test.ts b/@coven/cron/tests/isValidExpression.test.ts index 4e26d9d..f77a3fc 100644 --- a/@coven/cron/tests/isValidExpression.test.ts +++ b/@coven/cron/tests/isValidExpression.test.ts @@ -5,6 +5,79 @@ Deno.test("String that is a * returns false", () => assertFalse(isValidExpression("*")), ); +const shortMonths = [ + [4, "apr"], + [6, "jun"], + [9, "sep"], + [11, "nov"], +] as const; + +const getAllVariations = ([number, name]: readonly [ + number: number, + name: string, +]) => { + const stringNumber = `${number}`; + const paddedStringNumber = stringNumber.padStart(2, "0"); + const ranges = [ + `${stringNumber}-${stringNumber}`, + `${stringNumber}-${paddedStringNumber}`, + `${stringNumber}-${name}`, + `${paddedStringNumber}-${stringNumber}`, + `${paddedStringNumber}-${paddedStringNumber}`, + `${paddedStringNumber}-${name}`, + `${name}-${stringNumber}`, + `${name}-${paddedStringNumber}`, + `${name}-${name}`, + ]; + const lists = [ + `${stringNumber},${stringNumber}`, + `${stringNumber},${paddedStringNumber}`, + `${stringNumber},${name}`, + `${paddedStringNumber},${stringNumber}`, + `${paddedStringNumber},${paddedStringNumber}`, + `${paddedStringNumber},${name}`, + `${name},${stringNumber}`, + `${name},${paddedStringNumber}`, + `${name},${name}`, + ]; + + return [stringNumber, paddedStringNumber, name, ...ranges, ...lists]; +}; + +const shortMonthsInvalidExpressions = [ + ...getAllVariations([2, "feb"]).flatMap( + (month) => + [ + `* * 30 ${month} *`, + `* * 31 ${month} *`, + `* * 30-30 ${month} *`, + `* * 30-31 ${month} *`, + `* * 30,30 ${month} *`, + `* * 30,31 ${month} *`, + `* * 31-31 ${month} *`, + `* * 31,31 ${month} *`, + ] as const, + ), + ...shortMonths + .flatMap(getAllVariations) + .flatMap( + (month) => + [ + `* * 31 ${month} *`, + `* * 31-31 ${month} *`, + `* * 31,31 ${month} *`, + ] as const, + ), +]; + +Deno.test("Invalid ranges and lists returns false", () => + assert( + shortMonthsInvalidExpressions.every( + (expression) => !isValidExpression(expression), + ), + ), +); + Deno.test("Valid expression returns true", () => assert(isValidExpression("* * * * *")), ); diff --git a/@coven/cron/tests/nextISODate.test.ts b/@coven/cron/tests/nextISODate.test.ts index feee96c..fa9c8c1 100644 --- a/@coven/cron/tests/nextISODate.test.ts +++ b/@coven/cron/tests/nextISODate.test.ts @@ -63,6 +63,36 @@ Deno.test( () => assertStrictEquals(testDate({ dayOfMonth: 31, month: 2 }), undefined), ); +Deno.test( + "* * 31 2-2 * as object returns nothing because it's an invalid date", + () => + assertStrictEquals( + testDate({ dayOfMonth: 31, month: { from: 2, to: 2 } }), + undefined, + ), +); + +Deno.test( + "* * 31-31 4 * as object returns nothing because it's an invalid date", + () => + assertStrictEquals( + testDate({ dayOfMonth: { from: 31, to: 31 }, month: 4 }), + undefined, + ), +); + +Deno.test( + "* * 31-31 4-4 * as object returns nothing because it's an invalid date", + () => + assertStrictEquals( + testDate({ + dayOfMonth: { from: 31, to: 31 }, + month: { from: 4, to: 4 }, + }), + undefined, + ), +); + Deno.test( "* * 29,30,31 2 * as an object gets first minute of next february 29", () => diff --git a/@coven/expression/deno.json b/@coven/expression/deno.json index 25cdfd9..8f309cd 100644 --- a/@coven/expression/deno.json +++ b/@coven/expression/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/expression", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/iterables/deno.json b/@coven/iterables/deno.json index 8d4b4bc..fee0544 100644 --- a/@coven/iterables/deno.json +++ b/@coven/iterables/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": { ".": "./mod.ts", "./async": "./async/mod.ts" }, "name": "@coven/iterables", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/math/deno.json b/@coven/math/deno.json index e470404..89cf625 100644 --- a/@coven/math/deno.json +++ b/@coven/math/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/math", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/memo/deno.json b/@coven/memo/deno.json index ccd0eec..5722282 100644 --- a/@coven/memo/deno.json +++ b/@coven/memo/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/memo", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/pair/deno.json b/@coven/pair/deno.json index af48da8..56ccb35 100644 --- a/@coven/pair/deno.json +++ b/@coven/pair/deno.json @@ -2,13 +2,13 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": { "./preact": "./preact/mod.ts", "./react": "./react/mod.ts" }, "imports": { - "@types/react": "npm:@types/react@^19.2.17", - "@types/react-dom": "npm:@types/react-dom@^19.2.3", - "preact": "npm:preact@^10.29.2", + "@types/react": "npm:@types/react@^19.2.18", + "@types/react-dom": "npm:@types/react-dom@^19.2.4", + "preact": "npm:preact@^10.29.8", "preact-render-to-string": "npm:preact-render-to-string@^6.7.0", - "react": "npm:react@^19.2.7", - "react-dom": "npm:react-dom@^19.2.7" + "react": "npm:react@^19.2.8", + "react-dom": "npm:react-dom@^19.2.8" }, "name": "@coven/pair", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/parsers/deno.json b/@coven/parsers/deno.json index 531362e..26ec1c9 100644 --- a/@coven/parsers/deno.json +++ b/@coven/parsers/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/parsers", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/predicates/deno.json b/@coven/predicates/deno.json index 29f05eb..b714d10 100644 --- a/@coven/predicates/deno.json +++ b/@coven/predicates/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/predicates", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/rules/deno.json b/@coven/rules/deno.json index a6f9812..a8a71a4 100644 --- a/@coven/rules/deno.json +++ b/@coven/rules/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/rules", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/template/deno.json b/@coven/template/deno.json index a86b8db..8d53550 100644 --- a/@coven/template/deno.json +++ b/@coven/template/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/template", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/terminal/deno.json b/@coven/terminal/deno.json index 1fa210e..9f91fe3 100644 --- a/@coven/terminal/deno.json +++ b/@coven/terminal/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/terminal", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/types/EntryOf.ts b/@coven/types/EntryOf.ts index 036b684..f777843 100644 --- a/@coven/types/EntryOf.ts +++ b/@coven/types/EntryOf.ts @@ -17,14 +17,12 @@ import type { ReadonlyArrayLike } from "./ReadonlyArrayLike.ts"; * @see {@linkcode ReadonlyArrayLike} * @template Object Object to get the entry from. */ -export type EntryOf = Readonly< - { - /** - * @see {@linkcode EntryOf} property that shouldn't be referenced directly - */ - [Property in keyof Object]: Entry< - NormalizeEntryKey, - Object extends ReadonlyArrayLike ? Object[number] : Object[Property] - >; - } ->[keyof Object]; +export type EntryOf = Readonly<{ + /** + * @see {@linkcode EntryOf} property that shouldn't be referenced directly + */ + [Property in keyof Object]: Entry< + NormalizeEntryKey, + Object extends ReadonlyArrayLike ? Object[number] : Object[Property] + >; +}>[keyof Object]; diff --git a/@coven/types/deno.json b/@coven/types/deno.json index bb26541..2395866 100644 --- a/@coven/types/deno.json +++ b/@coven/types/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/types", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@coven/utils/deno.json b/@coven/utils/deno.json index af632b2..0abc966 100644 --- a/@coven/utils/deno.json +++ b/@coven/utils/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@coven/utils", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@simulcast/core/BroadcastObject.ts b/@simulcast/core/BroadcastObject.ts index 44fbc61..a20e76f 100644 --- a/@simulcast/core/BroadcastObject.ts +++ b/@simulcast/core/BroadcastObject.ts @@ -37,13 +37,13 @@ export type BroadcastObject = Readonly< * Dynamically generated `emit`. */ [ - Event in keyof Events as `emit${Capitalize}` + Event in keyof Events as `emit${Capitalize}` ]: EventHandler; } & { /** * Dynamically generated `on`. */ - [Event in keyof Events as `on${Capitalize}`]: ( + [Event in keyof Events as `on${Capitalize}`]: ( handler: EventHandler, ) => Effect; } diff --git a/@simulcast/core/deno.json b/@simulcast/core/deno.json index f13ebda..acafddf 100644 --- a/@simulcast/core/deno.json +++ b/@simulcast/core/deno.json @@ -2,5 +2,5 @@ "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", "exports": "./mod.ts", "name": "@simulcast/core", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@simulcast/core/tests/broadcast.test.ts b/@simulcast/core/tests/broadcast.test.ts index 072b69a..3b826eb 100644 --- a/@simulcast/core/tests/broadcast.test.ts +++ b/@simulcast/core/tests/broadcast.test.ts @@ -1,7 +1,10 @@ import { assert, assertStrictEquals } from "@std/assert"; import { broadcast } from "../broadcast.ts"; -const { emitTest, onTest, on, emit } = broadcast<{ test: never }>(); +const { emitTest, onTest, on, emit } = broadcast<{ + test: never; + other: string; +}>(); const customEmitTest = emit("test"); const customOnTest = on("test"); diff --git a/@simulcast/preact/UseBroadcastObject.ts b/@simulcast/preact/UseBroadcastObject.ts index f2e6954..a1a624f 100644 --- a/@simulcast/preact/UseBroadcastObject.ts +++ b/@simulcast/preact/UseBroadcastObject.ts @@ -23,7 +23,7 @@ export type UseBroadcastObject = Readonly< * @param handler Function to run when event is emitted. * @param dependencies Passed directly to the underlying effect. */ - [Event in keyof Events as `on${Capitalize}`]: ( + [Event in keyof Events as `on${Capitalize}`]: ( handler: EventHandler, dependencies?: ReadonlyArray, ) => void; diff --git a/@simulcast/preact/deno.json b/@simulcast/preact/deno.json index b7f716a..11520c7 100644 --- a/@simulcast/preact/deno.json +++ b/@simulcast/preact/deno.json @@ -4,9 +4,9 @@ "exports": "./mod.ts", "imports": { "@testing-library/preact": "npm:@testing-library/preact@^3.2.4", - "@testing-library/user-event": "npm:@testing-library/user-event@^14.6.1", - "preact": "npm:preact@^10.29.2" + "@testing-library/user-event": "npm:@testing-library/user-event@^14.6.3", + "preact": "npm:preact@^10.29.8" }, "name": "@simulcast/preact", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@simulcast/react/deno.json b/@simulcast/react/deno.json index d36273c..fb55c17 100644 --- a/@simulcast/react/deno.json +++ b/@simulcast/react/deno.json @@ -4,10 +4,10 @@ "exports": "./mod.ts", "imports": { "@testing-library/react": "npm:@testing-library/react@^16.3.2", - "@testing-library/user-event": "npm:@testing-library/user-event@^14.6.1", - "@types/react": "npm:@types/react@^19.2.17", - "react": "npm:react@^19.2.7" + "@testing-library/user-event": "npm:@testing-library/user-event@^14.6.3", + "@types/react": "npm:@types/react@^19.2.18", + "react": "npm:react@^19.2.8" }, "name": "@simulcast/react", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/@simulcast/vue/UseBroadcastObject.ts b/@simulcast/vue/UseBroadcastObject.ts index 0e53a52..29eec7e 100644 --- a/@simulcast/vue/UseBroadcastObject.ts +++ b/@simulcast/vue/UseBroadcastObject.ts @@ -21,7 +21,7 @@ export type UseBroadcastObject = Readonly< /** * @param handler Function to run when event is emitted. */ - [Event in keyof Events as `on${Capitalize}`]: ( + [Event in keyof Events as `on${Capitalize}`]: ( handler: EventHandler, ) => void; } diff --git a/@simulcast/vue/deno.json b/@simulcast/vue/deno.json index 66cb852..4fe7378 100644 --- a/@simulcast/vue/deno.json +++ b/@simulcast/vue/deno.json @@ -3,8 +3,8 @@ "exports": "./mod.ts", "imports": { "@vue/test-utils": "npm:@vue/test-utils@^2.4.11", - "vue": "npm:vue@^3.5.38" + "vue": "npm:vue@^3.5.41" }, "name": "@simulcast/vue", - "version": "0.9.9" + "version": "0.9.10" } diff --git a/deno.json b/deno.json index 681a9c9..4fc356d 100644 --- a/deno.json +++ b/deno.json @@ -37,8 +37,8 @@ }, "imports": { "@std/assert": "jsr:@std/assert@^1.0.19", - "happy-dom": "npm:happy-dom@^20.10.5", - "prettier": "npm:prettier@^3.8.4" + "happy-dom": "npm:happy-dom@^20.11.1", + "prettier": "npm:prettier@^3.9.6" }, "lint": { "plugins": ["jsr:@coven/rules"],