@openstax/ts-utils 1.24.3 → 1.24.5

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,5 +1,5 @@
1
1
  import { IndexOptions, SearchOptions } from '.';
2
- export declare const memorySearchTheBadWay: <T>({ store }: {
2
+ export declare const memorySearchTheBadWay: () => <T>({ store }: {
3
3
  store: {
4
4
  loadAllDocumentsTheBadWay: () => Promise<T[]>;
5
5
  };
@@ -13,7 +13,7 @@ var MatchType;
13
13
  MatchType[MatchType["Should"] = 2] = "Should";
14
14
  })(MatchType || (MatchType = {}));
15
15
  const resolveField = (document, field) => field.key.toString().split('.').reduce((result, key) => result[key], document);
16
- const memorySearchTheBadWay = ({ store }) => {
16
+ const memorySearchTheBadWay = () => ({ store }) => {
17
17
  return {
18
18
  ensureIndexCreated: async () => undefined,
19
19
  index: async (_options) => undefined,
@@ -12,10 +12,10 @@ export declare type IndexConfig = {
12
12
  mappings: Record<string, any>;
13
13
  pageSize?: number;
14
14
  };
15
- export declare const openSearchService: <C extends string = "deployed">(initializer?: Initializer<C>) => <T>(configProvider: { [key in C]: {
15
+ export declare const openSearchService: <C extends string = "deployed">(initializer?: Initializer<C>) => (configProvider: { [key in C]: {
16
16
  node: import("../../config").ConfigValueProvider<string>;
17
17
  region: import("../../config").ConfigValueProvider<string>;
18
- }; }) => (indexConfig: IndexConfig) => {
18
+ }; }) => <T>(indexConfig: IndexConfig) => {
19
19
  ensureIndexCreated: () => Promise<void>;
20
20
  index: (params: IndexOptions<T>) => Promise<void>;
21
21
  search: (options: SearchOptions) => Promise<{