mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 04:11:57 +00:00
feat: remove the file things since we now are in node
This commit is contained in:
@@ -30,27 +30,11 @@ T extends object ? {} & {[P in keyof T]: T[P]} :
|
||||
|
||||
export type _<T> = FlattenIntersection<T>
|
||||
|
||||
/** Used to check if the file exists before hand */
|
||||
export const exists = (
|
||||
effects: T.Effects,
|
||||
props: { path: string; volumeId: string },
|
||||
) =>
|
||||
effects.metadata(props).then(
|
||||
(_) => true,
|
||||
(_) => false,
|
||||
)
|
||||
|
||||
export const isKnownError = (e: unknown): e is T.KnownError =>
|
||||
e instanceof Object && ("error" in e || "error-code" in e)
|
||||
|
||||
type Cdr<A> = A extends [unknown, ...infer Cdr] ? Cdr : []
|
||||
|
||||
declare const affine: unique symbol
|
||||
|
||||
function withAffine<B>() {
|
||||
return {} as { [affine]: B }
|
||||
}
|
||||
|
||||
export type WrapperDataOptionals<WrapperData, Path extends string> = {
|
||||
validator?: Parser<unknown, ExtractWrapperData<WrapperData, Path>>
|
||||
/** Defaults to what ever the package currently in */
|
||||
@@ -95,7 +79,6 @@ export type Utils<WD, WrapperOverWrite = { const: never }> = {
|
||||
bindLan: (port: number) => Promise<LocalBinding>
|
||||
networkBuilder: () => NetworkBuilder
|
||||
torHostName: (id: string) => TorHostname
|
||||
exists: (props: { path: string; volumeId: string }) => Promise<boolean>
|
||||
nullIfEmpty: typeof nullIfEmpty
|
||||
}
|
||||
export const utils = <WrapperData = never, WrapperOverWrite = { const: never }>(
|
||||
@@ -106,7 +89,6 @@ export const utils = <WrapperData = never, WrapperOverWrite = { const: never }>(
|
||||
readFile: <A>(fileHelper: FileHelper<A>) => fileHelper.read(effects),
|
||||
writeFile: <A>(fileHelper: FileHelper<A>, data: A) =>
|
||||
fileHelper.write(data, effects),
|
||||
exists: (props: { path: string; volumeId: string }) => exists(effects, props),
|
||||
nullIfEmpty,
|
||||
getWrapperData: <WrapperData = never, Path extends string = never>(
|
||||
packageId: string,
|
||||
|
||||
Reference in New Issue
Block a user