diff --git a/lib/properties/index.ts b/lib/properties/index.ts index 3b20f6e..27e19e5 100644 --- a/lib/properties/index.ts +++ b/lib/properties/index.ts @@ -6,9 +6,7 @@ export { PropertyObject } from "./PropertyObject"; export { PropertyString } from "./PropertyString"; export const test = ""; -export type UnionToIntersection = ((x: T) => any) extends (x: infer R) => any - ? R - : never; +export type UnionToIntersection = ((x: T) => any) extends (x: infer R) => any ? R : never; /** * This is used during creating the type of properties fn in the service package. @@ -20,8 +18,12 @@ export type UnionToIntersection = ((x: T) => any) extends (x: infer R) => any export function setupPropertiesExport( fn: ( ...args: Parameters - ) => Promise> + ) => void | Promise | Promise> ): ExpectedExports.properties { - return (...args: Parameters) => - fn(...args).then((x) => x.build()); + return async (...args: Parameters) => { + const result = await fn(...args); + if (result) { + return result.build(); + } + }; } diff --git a/package.json b/package.json index 0ba4683..5810700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "start-sdk", - "version": "0.4.0-lib0.charlie18", + "version": "0.4.0-lib0.charlie19", "description": "For making the patterns that are wanted in making services for the startOS.", "main": "./lib/index.js", "types": "./lib/index.d.ts",