@confect/core 2.0.0 → 4.0.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.
package/src/Refs.ts CHANGED
@@ -38,18 +38,31 @@ type OmitEmpty<T> = {
38
38
  [K in keyof T as keyof T[K] extends never ? never : K]: T[K];
39
39
  };
40
40
 
41
+ type FunctionSpecMatchesPredicate<
42
+ FunctionSpec_ extends FunctionSpec.AnyWithProps,
43
+ Predicate extends Ref.Any,
44
+ > =
45
+ Ref.Ref<
46
+ FunctionSpec.GetRuntimeAndFunctionType<FunctionSpec_>,
47
+ FunctionSpec.GetFunctionVisibility<FunctionSpec_>,
48
+ any,
49
+ any
50
+ > extends Predicate
51
+ ? true
52
+ : false;
53
+
41
54
  type FilteredFunctions<
42
- Functions extends FunctionSpec.AnyWithProps,
55
+ FunctionSpecs extends FunctionSpec.AnyWithProps,
43
56
  Predicate extends Ref.Any,
44
57
  > = {
45
- [Name in FunctionSpec.Name<Functions> as FunctionSpec.WithName<
46
- Functions,
58
+ [Name in FunctionSpec.Name<FunctionSpecs> as FunctionSpec.WithName<
59
+ FunctionSpecs,
47
60
  Name
48
- > extends infer F extends FunctionSpec.AnyWithProps
49
- ? Ref.FromFunctionSpec<F> extends Predicate
61
+ > extends infer FunctionSpec_ extends FunctionSpec.AnyWithProps
62
+ ? FunctionSpecMatchesPredicate<FunctionSpec_, Predicate> extends true
50
63
  ? Name
51
64
  : never
52
- : never]: FunctionSpec.WithName<Functions, Name> extends infer F extends
65
+ : never]: FunctionSpec.WithName<FunctionSpecs, Name> extends infer F extends
53
66
  FunctionSpec.AnyWithProps
54
67
  ? Ref.FromFunctionSpec<F>
55
68
  : never;
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * as FunctionProvenance from "./FunctionProvenance";
1
2
  export * as FunctionSpec from "./FunctionSpec";
2
3
  export * as GenericId from "./GenericId";
3
4
  export * as GroupPath from "./GroupPath";