Skip to main content

toWorkspace

@a16njs/models


@a16njs/models / toWorkspace

Function: toWorkspace()

toWorkspace(rootOrWorkspace, id): Workspace

Defined in: workspace.ts:173

Convert a string root path or Workspace instance to a Workspace. If given a string, wraps it in a LocalWorkspace with the given id. If given a Workspace, returns it unchanged.

Parameters

rootOrWorkspace

A string root path or Workspace instance

string | Workspace

id

string = 'default'

Workspace id to use when wrapping a string (default: 'default')

Returns

Workspace

A Workspace instance