MCPcopy
hub / github.com/statelyai/xstate / normalizeTarget

Function normalizeTarget

packages/core/src/utils.ts:222–232  ·  view source on GitHub ↗
(
  target: SingleOrArray<string | StateNode<TContext, TEvent>> | undefined
)

Source from the content-addressed store, hash-verified

220}
221
222export function normalizeTarget<
223 TContext extends MachineContext,
224 TEvent extends EventObject
225>(
226 target: SingleOrArray<string | StateNode<TContext, TEvent>> | undefined
227): ReadonlyArray<string | StateNode<TContext, TEvent>> | undefined {
228 if (target === undefined || target === TARGETLESS_KEY) {
229 return undefined;
230 }
231 return toArray(target);
232}
233
234export function toObserver<T>(
235 nextHandler?: Observer<T> | ((value: T) => void),

Callers 2

formatTransitionFunction · 0.90

Calls 1

toArrayFunction · 0.85

Tested by

no test coverage detected