Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

robot3

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robot3 - npm Package Compare versions

Comparing version 0.2.21 to 0.3.0

2

dist/logging.js

@@ -10,3 +10,3 @@ 'use strict';

console.log(`Current state`, state);
console.log(`Previous state`, state);
console.log(`Previous state`, prevState);

@@ -13,0 +13,0 @@ if (typeof event === "string") {

declare module 'robot3' {
/**
* TS Helpers
*/
type NestedKeys<T> = T extends object
? {
[P in keyof T]-?: P extends string ? keyof T[P] : never
}[keyof T]
: never
type AllStateKeys<T> = NestedKeys<T> | keyof T
/**
* The debugging object contains an _onEnter method, wich can be set to invoke

@@ -23,3 +34,3 @@ * this function on every transition.

context?: ContextFunction<C>
): Machine<typeof states, C, keyof typeof states>
): Machine<typeof states, C, AllStateKeys<S>>
/**

@@ -35,3 +46,3 @@ * The `createMachine` function creates a state machine. It takes an object of *states* with the key being the state name.

context?: ContextFunction<C>
): Machine<typeof states, C, keyof typeof states>
): Machine<typeof states, C, AllStateKeys<S>>

@@ -113,4 +124,4 @@ /**

*/
export function invoke<C, T>(fn: (ctx: C) => Promise<T>, ...args: (Transition | Immediate)[]): MachineState
export function invoke<C, T, E extends {} = any>(fn: (ctx: C, e?: E) => Promise<T>, ...args: (Transition | Immediate)[]): MachineState
/**

@@ -191,2 +202,3 @@ * The `invoke` is a special type of state that immediately invokes a Promise-returning function or another machine.

export interface Service<M extends Machine> {
child?: Service<M>
machine: M

@@ -193,0 +205,0 @@ context: M['context']

@@ -8,3 +8,3 @@ import { d } from './machine.js';

console.log(`Current state`, state);
console.log(`Previous state`, state);
console.log(`Previous state`, prevState);

@@ -11,0 +11,0 @@ if (typeof event === "string") {

{
"name": "robot3",
"version": "0.2.21",
"version": "0.3.0",
"description": "A function, immutable Finite State Machine library",

@@ -5,0 +5,0 @@ "main": "dist/machine.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc