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

jssm

Package Overview
Dependencies
Maintainers
1
Versions
324
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jssm - npm Package Compare versions

Comparing version 5.72.2 to 5.72.3

68

CHANGELOG.md

@@ -5,3 +5,3 @@ # Changelog

920 merges; 114 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)
922 merges; 114 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)

@@ -26,2 +26,32 @@

## [Untagged] - 6/24/2022 7:36:27 PM
Commit [adfa9069ba5e78d8a227896a5f7e14a8f4b80117](https://github.com/StoneCypher/jssm/commit/adfa9069ba5e78d8a227896a5f7e14a8f4b80117)
Author: `John Haugeland <stonecypher@gmail.com>`
* the conversion continues
&nbsp;
&nbsp;
## [Untagged] - 6/24/2022 5:49:06 PM
Commit [b0cbe1c1ae0199c8d78a82f624e8ee94b344cf71](https://github.com/StoneCypher/jssm/commit/b0cbe1c1ae0199c8d78a82f624e8ee94b344cf71)
Author: `John Haugeland <stonecypher@gmail.com>`
* Normalize hook return pattern, fixes StoneCypher/fsl#930
&nbsp;
&nbsp;
## [Untagged] - 6/24/2022 4:55:33 PM

@@ -144,36 +174,2 @@

* another trigger commit with mild doc extension
&nbsp;
&nbsp;
<a name="5__70__33" />
## [5.70.33] - 6/18/2022 8:57:42 PM
Commit [ca254f455f2c19f21e77834e993c310e05272822](https://github.com/StoneCypher/jssm/commit/ca254f455f2c19f21e77834e993c310e05272822)
Author: `John Haugeland <stonecypher@gmail.com>`
* holy another facile build for triggering, batman
&nbsp;
&nbsp;
<a name="5__70__32" />
## [5.70.32] - 6/18/2022 8:48:07 PM
Commit [8115e8b62d8ac1cff3c7eb07afabced097f1be42](https://github.com/StoneCypher/jssm/commit/8115e8b62d8ac1cff3c7eb07afabced097f1be42)
Author: `John Haugeland <stonecypher@gmail.com>`
* yet another small commit as a trigger, this time to get the extended diff
* another trigger commit with mild doc extension

@@ -201,2 +201,7 @@ declare type StateType = string;

declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT>;
declare type HookComplexResult<mDT> = {
pass: boolean;
state?: StateType;
data?: mDT;
};
declare type HookResult = true | false | undefined | void;

@@ -210,2 +215,2 @@ declare type HookContext<mDT> = {

};
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookResult };
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
declare type StateType = string;
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookResult } from './jssm_types';
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';

@@ -226,7 +226,7 @@ import { shapes, gviz_shapes, named_colors } from './jssm_constants';

_has_transition_hooks: boolean;
_hooks: Map<string, Function>;
_named_hooks: Map<string, Function>;
_entry_hooks: Map<string, Function>;
_exit_hooks: Map<string, Function>;
_global_action_hooks: Map<string, Function>;
_hooks: Map<string, HookHandler<mDT>>;
_named_hooks: Map<string, HookHandler<mDT>>;
_entry_hooks: Map<string, HookHandler<mDT>>;
_exit_hooks: Map<string, HookHandler<mDT>>;
_global_action_hooks: Map<string, HookHandler<mDT>>;
_any_action_hook: HookHandler<mDT> | undefined;

@@ -673,2 +673,3 @@ _standard_transition_hook: HookHandler<mDT> | undefined;

declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
declare function is_hook_rejection(hr: HookResult): boolean;
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection };

@@ -1331,4 +1331,2 @@ // whargarbl lots of these return arrays could/should be sets

}
// todo whargarbl implement data stuff
// todo major incomplete whargarbl comeback
if (valid) {

@@ -1339,13 +1337,10 @@ if (this._has_hooks) {

// 1. any action hook
if (this._any_action_hook !== undefined) {
if (this._any_action_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._any_action_hook, hook_args);
if (outcome.pass === false) {
return false;
}
// 2. global specific action hook
const maybe_ga_hook = this._global_action_hooks.get(newStateOrAction);
if (maybe_ga_hook !== undefined) {
if (maybe_ga_hook(hook_args) === false) {
return false;
}
const outcome2 = AbstractHookStep(this._global_action_hooks.get(newStateOrAction), hook_args);
if (outcome2.pass === false) {
return false;
}

@@ -1355,3 +1350,4 @@ }

if (this._any_transition_hook !== undefined) {
if (this._any_transition_hook(hook_args) === false) {
const outcome = AbstractHookStep(this._any_transition_hook, hook_args);
if (outcome.pass === false) {
return false;

@@ -1362,7 +1358,5 @@ }

if (this._has_exit_hooks) {
const maybe_ex_hook = this._exit_hooks.get(this._state);
if (maybe_ex_hook !== undefined) {
if (maybe_ex_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._exit_hooks.get(this._state), hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1373,7 +1367,5 @@ }

if (wasAction) {
const nhn = named_hook_name(this._state, newState, newStateOrAction), n_maybe_hook = this._named_hooks.get(nhn);
if (n_maybe_hook !== undefined) {
if (n_maybe_hook(hook_args) === false) {
return false;
}
const nhn = named_hook_name(this._state, newState, newStateOrAction), outcome = AbstractHookStep(this._named_hooks.get(nhn), hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1384,7 +1376,5 @@ }

if (this._has_basic_hooks) {
const hn = hook_name(this._state, newState), maybe_hook = this._hooks.get(hn);
if (maybe_hook !== undefined) {
if (maybe_hook(hook_args) === false) {
return false;
}
const hn = hook_name(this._state, newState), outcome = AbstractHookStep(this._hooks.get(hn), hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1395,8 +1385,5 @@ }

if (trans_type === 'legal') {
if (this._standard_transition_hook !== undefined) {
// todo handle actions
// todo handle forced
if (this._standard_transition_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._standard_transition_hook, hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1406,8 +1393,5 @@ }

if (trans_type === 'main') {
if (this._main_transition_hook !== undefined) {
// todo handle actions
// todo handle forced
if (this._main_transition_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._main_transition_hook, hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1417,8 +1401,5 @@ }

if (trans_type === 'forced') {
if (this._forced_transition_hook !== undefined) {
// todo handle actions
// todo handle forced
if (this._forced_transition_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._forced_transition_hook, hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1428,7 +1409,5 @@ }

if (this._has_entry_hooks) {
const maybe_en_hook = this._entry_hooks.get(newState);
if (maybe_en_hook !== undefined) {
if (maybe_en_hook(hook_args) === false) {
return false;
}
const outcome = AbstractHookStep(this._entry_hooks.get(newState), hook_args);
if (outcome.pass === false) {
return false;
}

@@ -1628,4 +1607,49 @@ }

}
function is_hook_complex_result(hr) {
if (typeof hr === 'object') {
if (typeof hr.pass === 'boolean') {
return true;
}
}
return false;
}
function is_hook_rejection(hr) {
if (hr === true) {
return false;
}
if (hr === undefined) {
return false;
}
if (hr === false) {
return true;
}
if (is_hook_complex_result(hr)) {
return (!(hr.pass));
}
throw new TypeError('unknown hook rejection type result');
}
// TODO hook_args: unknown
function AbstractHookStep(maybe_hook, hook_args) {
if (maybe_hook !== undefined) {
const result = maybe_hook(hook_args);
if (result === undefined) {
return { pass: true };
}
if (result === true) {
return { pass: true };
}
if (result === false) {
return { pass: false };
}
// if (is_hook_complex_result(result)) {
// return result;
// }
throw new TypeError(`Unknown hook result type ${result}`);
}
else {
return { pass: true };
}
}
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind,
// WHARGARBL TODO these should be exported to a utility library
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection };

@@ -1,2 +0,2 @@

const version = "5.72.2";
const version = "5.72.3";
export { version };

@@ -201,2 +201,7 @@ declare type StateType = string;

declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT>;
declare type HookComplexResult<mDT> = {
pass: boolean;
state?: StateType;
data?: mDT;
};
declare type HookResult = true | false | undefined | void;

@@ -210,2 +215,2 @@ declare type HookContext<mDT> = {

};
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookResult };
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
declare type StateType = string;
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler, HookResult } from './jssm_types';
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';

@@ -226,7 +226,7 @@ import { shapes, gviz_shapes, named_colors } from './jssm_constants';

_has_transition_hooks: boolean;
_hooks: Map<string, Function>;
_named_hooks: Map<string, Function>;
_entry_hooks: Map<string, Function>;
_exit_hooks: Map<string, Function>;
_global_action_hooks: Map<string, Function>;
_hooks: Map<string, HookHandler<mDT>>;
_named_hooks: Map<string, HookHandler<mDT>>;
_entry_hooks: Map<string, HookHandler<mDT>>;
_exit_hooks: Map<string, HookHandler<mDT>>;
_global_action_hooks: Map<string, HookHandler<mDT>>;
_any_action_hook: HookHandler<mDT> | undefined;

@@ -673,2 +673,3 @@ _standard_transition_hook: HookHandler<mDT> | undefined;

declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
declare function is_hook_rejection(hr: HookResult): boolean;
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors, is_hook_rejection };
{
"name": "jssm",
"version": "5.72.2",
"version": "5.72.3",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=10.0.0"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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