diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcf8db..213cdf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # deverything +## 0.46.0 + +### Minor Changes + +- WithDatey + ## 0.45.0 ### Minor Changes diff --git a/package.json b/package.json index c16976c..dd5dc7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deverything", - "version": "0.45.0", + "version": "0.46.0", "description": "Everything you need for Dev", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/src/types/WithDatey.ts b/src/types/WithDatey.ts new file mode 100644 index 0000000..7be1da3 --- /dev/null +++ b/src/types/WithDatey.ts @@ -0,0 +1,23 @@ +import { Datey } from "./Date"; + +export type WithDatey = T extends Date + ? Datey + : T extends Array + ? Array> + : T extends object + ? { [K in keyof T]: WithDatey } + : T; + +// TEST +// type WithDates = { +// a: Date; +// b: { +// c: Date; +// c1: Date | null; +// c12: Date | undefined; +// c123: Date | undefined | null; +// }; +// d: Date[]; +// }; + +// type DateyDates = WithDatey; diff --git a/src/types/index.ts b/src/types/index.ts index df783cb..537171c 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -9,3 +9,4 @@ export * from "./Object"; export * from "./PlainObject"; export * from "./Point"; export * from "./PrismaSelect"; +export * from "./WithDatey";