mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 18:31:52 +00:00
13 lines
436 B
TypeScript
13 lines
436 B
TypeScript
import { Affine, _ } from "../util"
|
|
import { PathBuilder, extractJsonPath, pathBuilder } from "./PathBuilder"
|
|
|
|
export type ExposedStorePaths = string[] & Affine<"ExposedStorePaths">
|
|
|
|
export const setupExposeStore = <Store extends Record<string, any>>(
|
|
fn: (pathBuilder: PathBuilder<Store>) => PathBuilder<Store, any>[],
|
|
) => {
|
|
return fn(pathBuilder<Store>()).map(
|
|
(x) => extractJsonPath(x) as string,
|
|
) as ExposedStorePaths
|
|
}
|