relation-matcher 1.0.13 → 1.1.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.
Files changed (40) hide show
  1. package/.vscode/settings.json +4 -4
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/releases/yarn-4.13.0.cjs +940 -940
  4. package/.yarnrc.yml +3 -3
  5. package/README.md +185 -150
  6. package/dist/src/index.d.ts +10 -5
  7. package/dist/src/index.js +35 -46
  8. package/dist/src/types/generic-bases.d.ts +2 -1
  9. package/dist/src/types/generic-less.d.ts +8 -3
  10. package/dist/src/types/inputs.d.ts +14 -7
  11. package/dist/src/types/return.d.ts +5 -2
  12. package/dist/src/types/typetest.d.ts +1 -0
  13. package/dist/src/types/utils.d.ts +3 -0
  14. package/dist/src/utils/invertInput.d.ts +2 -1
  15. package/dist/src/utils/invertInput.js +4 -9
  16. package/dist/src/utils/isNullable.d.ts +2 -0
  17. package/dist/src/utils/isNullable.js +6 -0
  18. package/dist/src/utils/joins.d.ts +5 -0
  19. package/dist/src/utils/joins.js +9 -0
  20. package/dist/src/utils/keys.js +6 -1
  21. package/dist/src/utils/matcher.d.ts +3 -3
  22. package/dist/src/utils/matcher.js +2 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +36 -36
  25. package/src/index.test.ts +105 -105
  26. package/src/index.ts +124 -151
  27. package/src/testing/file-output.ts +15 -15
  28. package/src/testing/test-data.ts +172 -172
  29. package/src/types/generic-bases.ts +10 -9
  30. package/src/types/generic-less.ts +20 -14
  31. package/src/types/index.ts +5 -5
  32. package/src/types/inputs.ts +36 -30
  33. package/src/types/return.ts +65 -67
  34. package/src/types/typetest.ts +87 -84
  35. package/src/types/utils.ts +33 -28
  36. package/src/utils/invertInput.ts +27 -28
  37. package/src/utils/isNullable.ts +11 -0
  38. package/src/utils/joins.ts +22 -0
  39. package/src/utils/keys.ts +7 -1
  40. package/src/utils/matcher.ts +16 -8
@@ -1,4 +1,4 @@
1
- import type { TInputBase } from "~/types/generic-bases";
2
- import type { InvertedInput } from "./invertInput";
1
+ import type { TInputBase, TInputBaseJoin } from "~/types/generic-bases";
3
2
  import type { Output } from "~/types/generic-less";
4
- export declare const matcherFunc: <TInput extends TInputBase>(row: TInput[keyof TInput], value: Output) => (item: InvertedInput[keyof InvertedInput][number]) => boolean;
3
+ export type MatcherFunc = (item: TInputBaseJoin | null) => item is TInputBaseJoin;
4
+ export declare const createMatcherFunc: <TInput extends TInputBase>(row: TInput[keyof TInput], value: Output) => MatcherFunc;
@@ -1 +1,2 @@
1
- export const matcherFunc = (row, value) => (item) => row?.[value.joinsFrom] === item?.[value.joinsTo];
1
+ export const createMatcherFunc = (row, value) => (item) => !!item &&
2
+ row?.[value.joinsFrom] === item?.[value.joinsTo];