inferred-types 0.25.0 → 0.27.0

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.
@@ -1,35 +0,0 @@
1
- // inspired by [article](https://medium.com/@reidev275/creating-a-type-safe-dsl-for-filtering-in-typescript-53fe68a7942e)]
2
-
3
-
4
- export type Filter<A> =
5
- | { kind: "Equals"; field: keyof A; val: A[keyof A] }
6
- | { kind: "Greater"; field: keyof A; val: A[keyof A] }
7
- | { kind: "Less"; field: keyof A; val: A[keyof A] }
8
- | { kind: "And"; a: Filter<A>; b: Filter<A> }
9
- | { kind: "Or"; a: Filter<A>; b: Filter<A> };
10
-
11
- export const equals = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({
12
- kind: "Equals",
13
- field,
14
- val
15
- });
16
- export const greater = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({
17
- kind: "Greater",
18
- field,
19
- val
20
- });
21
- export const less = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({
22
- kind: "Less",
23
- field,
24
- val
25
- });
26
- export const and = <A>(a: Filter<A>, b: Filter<A>): Filter<A> => ({
27
- kind: "And",
28
- a,
29
- b
30
- });
31
- export const or = <A>(a: Filter<A>, b: Filter<A>): Filter<A> => ({
32
- kind: "Or",
33
- a,
34
- b
35
- });
@@ -1,12 +0,0 @@
1
- // #autoindex
2
- // #region auto-indexed files
3
- // index last changed at: 8th Aug, 2022, 09:51 AM ( GMT-7 )
4
- // hash-code: 5ffc538b
5
-
6
- // file exports
7
- export * from "./filter";
8
-
9
- // #endregion auto-indexed files
10
-
11
- // see https://github.com/inocan-group/do-devops/docs/autoindex.md
12
- // for more info