New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@stackflow/core

Package Overview
Dependencies
Maintainers
5
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackflow/core - npm Package Compare versions

Comparing version
1.2.0
to
1.3.0
+1
-1
dist/activity-utils/findNewActivityIndex.d.ts

@@ -0,4 +1,4 @@

import type { PushedEvent, ReplacedEvent } from "../event-types";
import type { Activity } from "../Stack";
import type { PushedEvent, ReplacedEvent } from "../event-types";
export declare function findNewActivityIndex(activities: Activity[], event: PushedEvent | ReplacedEvent): number;
//# sourceMappingURL=findNewActivityIndex.d.ts.map

@@ -0,3 +1,3 @@

import type { DomainEvent } from "../event-types";
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
export declare function findTargetActivityIndices(activities: Activity[], event: DomainEvent, context: {

@@ -4,0 +4,0 @@ now: number;

@@ -0,3 +1,3 @@

import type { DomainEvent } from "../event-types";
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
/**

@@ -4,0 +4,0 @@ * Create activity list reducers for each event type (Activity[] + Event => Activity[])

@@ -0,4 +1,4 @@

import type { PushedEvent, ReplacedEvent } from "../event-types";
import type { Activity, ActivityTransitionState } from "../Stack";
import type { PushedEvent, ReplacedEvent } from "../event-types";
export declare function makeActivityFromEvent(event: PushedEvent | ReplacedEvent, transitionState: ActivityTransitionState): Activity;
//# sourceMappingURL=makeActivityFromEvent.d.ts.map

@@ -0,3 +1,3 @@

import type { DomainEvent } from "../event-types";
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
/**

@@ -4,0 +4,0 @@ * Create activity reducers for each event type (Activity + Event => Activity)

@@ -0,3 +1,3 @@

import type { DomainEvent } from "../event-types";
import type { Stack } from "../Stack";
import type { DomainEvent } from "../event-types";
export declare function makeStackReducer(context: {

@@ -4,0 +4,0 @@ now: number;

@@ -0,4 +1,4 @@

import type { DomainEvent } from "./event-types";
import type { Stack } from "./Stack";
import type { DomainEvent } from "./event-types";
export declare function aggregate(inputEvents: DomainEvent[], now: number): Stack;
//# sourceMappingURL=aggregate.d.ts.map

@@ -14,10 +14,10 @@ import type { ActivityRegisteredEvent } from "./ActivityRegisteredEvent";

export * from "./InitializedEvent";
export * from "./PausedEvent";
export * from "./PoppedEvent";
export * from "./PushedEvent";
export * from "./ReplacedEvent";
export * from "./ResumedEvent";
export * from "./StepPoppedEvent";
export * from "./StepPushedEvent";
export * from "./StepReplacedEvent";
export * from "./PausedEvent";
export * from "./ResumedEvent";
//# sourceMappingURL=index.d.ts.map

@@ -459,4 +459,4 @@ "use strict";

}
function noop3(stack) {
return stack;
function noop3(stack, event) {
return __spreadProps(__spreadValues({}, stack), { events: [...stack.events, event] });
}

@@ -468,3 +468,4 @@ function makeStackReducer(context) {

return __spreadProps(__spreadValues({}, stack), {
transitionDuration: event.transitionDuration
transitionDuration: event.transitionDuration,
events: [...stack.events, event]
});

@@ -484,3 +485,4 @@ }, context)

} : null)
]
],
events: [...stack.events, event]
});

@@ -494,3 +496,4 @@ },

return __spreadProps(__spreadValues({}, stack), {
globalTransitionState: "paused"
globalTransitionState: "paused",
events: [...stack.events, event]
});

@@ -502,3 +505,3 @@ }, context)

if (stack.globalTransitionState !== "paused" || !stack.pausedEvents) {
return stack;
return __spreadProps(__spreadValues({}, stack), { events: [...stack.events, event] });
}

@@ -510,5 +513,8 @@ const reducer = makeStackReducer({

const _a = stack, { pausedEvents } = _a, rest = __objRest(_a, ["pausedEvents"]);
return pausedEvents.reduce(reducer, __spreadProps(__spreadValues({}, rest), {
const resumedStack = pausedEvents.reduce(reducer, __spreadProps(__spreadValues({}, rest), {
globalTransitionState: "idle"
}));
return __spreadProps(__spreadValues({}, resumedStack), {
events: [...resumedStack.events, event]
});
},

@@ -563,3 +569,3 @@ context

const events = uniqBy(
[...inputEvents].sort((a, b) => compareBy(a, b, (e) => e.id)),
[...inputEvents].sort((a, b) => a.eventDate - b.eventDate),
(e) => e.id

@@ -573,3 +579,4 @@ );

registeredActivities: [],
transitionDuration: 0
transitionDuration: 0,
events: []
});

@@ -576,0 +583,0 @@ const visibleActivities = stack.activities.filter(

@@ -422,4 +422,4 @@ var __defProp = Object.defineProperty;

}
function noop3(stack) {
return stack;
function noop3(stack, event) {
return __spreadProps(__spreadValues({}, stack), { events: [...stack.events, event] });
}

@@ -431,3 +431,4 @@ function makeStackReducer(context) {

return __spreadProps(__spreadValues({}, stack), {
transitionDuration: event.transitionDuration
transitionDuration: event.transitionDuration,
events: [...stack.events, event]
});

@@ -447,3 +448,4 @@ }, context)

} : null)
]
],
events: [...stack.events, event]
});

@@ -457,3 +459,4 @@ },

return __spreadProps(__spreadValues({}, stack), {
globalTransitionState: "paused"
globalTransitionState: "paused",
events: [...stack.events, event]
});

@@ -465,3 +468,3 @@ }, context)

if (stack.globalTransitionState !== "paused" || !stack.pausedEvents) {
return stack;
return __spreadProps(__spreadValues({}, stack), { events: [...stack.events, event] });
}

@@ -473,5 +476,8 @@ const reducer = makeStackReducer({

const _a = stack, { pausedEvents } = _a, rest = __objRest(_a, ["pausedEvents"]);
return pausedEvents.reduce(reducer, __spreadProps(__spreadValues({}, rest), {
const resumedStack = pausedEvents.reduce(reducer, __spreadProps(__spreadValues({}, rest), {
globalTransitionState: "idle"
}));
return __spreadProps(__spreadValues({}, resumedStack), {
events: [...resumedStack.events, event]
});
},

@@ -526,3 +532,3 @@ context

const events = uniqBy(
[...inputEvents].sort((a, b) => compareBy(a, b, (e) => e.id)),
[...inputEvents].sort((a, b) => a.eventDate - b.eventDate),
(e) => e.id

@@ -536,3 +542,4 @@ );

registeredActivities: [],
transitionDuration: 0
transitionDuration: 0,
events: []
});

@@ -539,0 +546,0 @@ const visibleActivities = stack.activities.filter(

@@ -1,5 +0,5 @@

import type { Stack } from "../Stack";
import type { PausedEvent, PoppedEvent, PushedEvent, ReplacedEvent, ResumedEvent, StepPoppedEvent, StepPushedEvent, StepReplacedEvent } from "../event-types";
import type { BaseDomainEvent } from "../event-types/_base";
import type { DispatchEvent } from "../event-utils";
import type { Stack } from "../Stack";
export type StackflowActions = {

@@ -6,0 +6,0 @@ /**

@@ -41,3 +41,4 @@ import type { DomainEvent, PoppedEvent, PushedEvent, ReplacedEvent, StepPoppedEvent, StepPushedEvent, StepReplacedEvent } from "./event-types";

pausedEvents?: DomainEvent[];
events: DomainEvent[];
};
//# sourceMappingURL=Stack.d.ts.map

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

import type { StackflowActions } from "../interfaces";
import type { StackflowPlugin } from "../interfaces";
import type { StackflowActions, StackflowPlugin } from "../interfaces";
type ActionCreatorOptions = {

@@ -4,0 +3,0 @@ dispatchEvent: StackflowActions["dispatchEvent"];

import type { DomainEvent } from "../event-types";
import type { BaseDomainEvent } from "../event-types/_base";
import type { StackflowPlugin } from "../interfaces";
import type { StackflowActions } from "../interfaces";
import type { StackflowActions, StackflowPlugin } from "../interfaces";
type PreEffectHookResult<T> = {

@@ -6,0 +5,0 @@ isPrevented: boolean;

{
"name": "@stackflow/core",
"version": "1.2.0",
"version": "1.3.0",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -0,3 +1,3 @@

import type { PushedEvent, ReplacedEvent } from "../event-types";
import type { Activity } from "../Stack";
import type { PushedEvent, ReplacedEvent } from "../event-types";
import { findIndices, last } from "../utils";

@@ -4,0 +4,0 @@

@@ -0,3 +1,3 @@

import type { DomainEvent } from "../event-types";
import type { Activity, ActivityTransitionState } from "../Stack";
import type { DomainEvent } from "../event-types";
import { findIndices, last } from "../utils";

@@ -4,0 +4,0 @@

@@ -0,3 +1,3 @@

import type { DomainEvent, PushedEvent, ReplacedEvent } from "../event-types";
import type { Activity, ActivityTransitionState } from "../Stack";
import type { DomainEvent, PushedEvent, ReplacedEvent } from "../event-types";
import { findNewActivityIndex } from "./findNewActivityIndex";

@@ -4,0 +4,0 @@ import { makeActivityFromEvent } from "./makeActivityFromEvent";

@@ -0,3 +1,3 @@

import type { PushedEvent, ReplacedEvent } from "../event-types";
import type { Activity, ActivityTransitionState } from "../Stack";
import type { PushedEvent, ReplacedEvent } from "../event-types";

@@ -4,0 +4,0 @@ export function makeActivityFromEvent(

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

import type { Activity, ActivityTransitionState } from "../Stack";
import type {

@@ -10,2 +9,3 @@ DomainEvent,

} from "../event-types";
import type { Activity, ActivityTransitionState } from "../Stack";
import { last } from "../utils";

@@ -12,0 +12,0 @@ import { makeReducer } from "./makeReducer";

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

import type { Activity, Stack } from "../Stack";
import type {

@@ -9,2 +8,3 @@ ActivityRegisteredEvent,

} from "../event-types";
import type { Stack } from "../Stack";
import { findTargetActivityIndices } from "./findTargetActivityIndices";

@@ -84,10 +84,7 @@ import { makeActivitiesReducer } from "./makeActivitiesReducer";

function noop(stack: Stack) {
return stack;
function noop(stack: Stack, event: DomainEvent) {
return { ...stack, events: [...stack.events, event] };
}
export function makeStackReducer(context: {
now: number;
resumedAt?: number;
}) {
export function makeStackReducer(context: { now: number; resumedAt?: number }) {
return makeReducer({

@@ -99,2 +96,3 @@ Initialized: withPauseReducer(

transitionDuration: event.transitionDuration,
events: [...stack.events, event],
};

@@ -119,2 +117,3 @@ }, context),

],
events: [...stack.events, event],
};

@@ -130,2 +129,3 @@ },

globalTransitionState: "paused",
events: [...stack.events, event],
};

@@ -137,3 +137,3 @@ }, context),

if (stack.globalTransitionState !== "paused" || !stack.pausedEvents) {
return stack;
return { ...stack, events: [...stack.events, event] };
}

@@ -147,6 +147,11 @@

const { pausedEvents, ...rest } = stack;
return pausedEvents.reduce(reducer, {
const resumedStack = pausedEvents.reduce(reducer, {
...rest,
globalTransitionState: "idle",
});
return {
...resumedStack,
events: [...resumedStack.events, event],
};
},

@@ -153,0 +158,0 @@ context,

@@ -1,5 +0,5 @@

import type { ActivityStep, Stack } from "./Stack";
import { makeStackReducer } from "./activity-utils/makeStackReducer";
import type { DomainEvent } from "./event-types";
import { validateEvents } from "./event-utils";
import type { ActivityStep, Stack } from "./Stack";
import { compareBy, last, uniqBy } from "./utils";

@@ -12,3 +12,3 @@

const events = uniqBy(
[...inputEvents].sort((a, b) => compareBy(a, b, (e) => e.id)),
[...inputEvents].sort((a, b) => a.eventDate - b.eventDate),
(e) => e.id,

@@ -31,2 +31,3 @@ );

transitionDuration: 0,
events: [],
});

@@ -33,0 +34,0 @@

@@ -26,9 +26,9 @@ import type { ActivityRegisteredEvent } from "./ActivityRegisteredEvent";

export * from "./InitializedEvent";
export * from "./PausedEvent";
export * from "./PoppedEvent";
export * from "./PushedEvent";
export * from "./ReplacedEvent";
export * from "./ResumedEvent";
export * from "./StepPoppedEvent";
export * from "./StepPushedEvent";
export * from "./StepReplacedEvent";
export * from "./PausedEvent";
export * from "./ResumedEvent";

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

import type { Stack } from "../Stack";
import type {

@@ -14,2 +13,3 @@ PausedEvent,

import type { DispatchEvent } from "../event-utils";
import type { Stack } from "../Stack";

@@ -16,0 +16,0 @@ export type StackflowActions = {

import isEqual from "react-fast-compare";
import type { Stack } from "./Stack";
import { aggregate } from "./aggregate";

@@ -9,2 +7,3 @@ import type { DomainEvent, PushedEvent, StepPushedEvent } from "./event-types";

import { produceEffects } from "./produceEffects";
import type { Stack } from "./Stack";
import { divideBy, once } from "./utils";

@@ -11,0 +10,0 @@ import { makeActions } from "./utils/makeActions";

@@ -35,2 +35,3 @@ import { produceEffects } from "./produceEffects";

globalTransitionState: "idle",
events: [],
},

@@ -68,2 +69,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -86,2 +88,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -117,2 +120,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -161,2 +165,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -215,2 +220,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -332,2 +338,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -386,2 +393,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -477,2 +485,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -531,2 +540,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -648,2 +658,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -702,2 +713,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -793,2 +805,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -870,2 +883,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -961,2 +975,3 @@ ),

globalTransitionState: "loading",
events: [],
},

@@ -1015,2 +1030,3 @@ {

globalTransitionState: "idle",
events: [],
},

@@ -1080,2 +1096,3 @@ ),

globalTransitionState: "loading",
events: [],
},

@@ -1134,2 +1151,3 @@ {

globalTransitionState: "idle",
events: [],
},

@@ -1199,2 +1217,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -1253,2 +1272,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -1321,2 +1341,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -1368,2 +1389,3 @@ {

globalTransitionState: "idle",
events: [],
},

@@ -1595,2 +1617,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -1727,2 +1750,3 @@ {

globalTransitionState: "idle",
events: [],
},

@@ -1860,2 +1884,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -1895,2 +1920,3 @@ {

globalTransitionState: "idle",
events: [],
},

@@ -1993,2 +2019,3 @@ ),

globalTransitionState: "idle",
events: [],
},

@@ -2024,2 +2051,3 @@ {

globalTransitionState: "loading",
events: [],
},

@@ -2120,2 +2148,3 @@ ),

transitionDuration: 270,
events: [],
},

@@ -2127,2 +2156,3 @@ {

transitionDuration: 270,
events: [],
},

@@ -2146,2 +2176,3 @@ ),

transitionDuration: 270,
events: [],
},

@@ -2153,2 +2184,3 @@ {

transitionDuration: 270,
events: [],
},

@@ -2174,2 +2206,3 @@ ),

transitionDuration: 270,
events: [],
},

@@ -2181,2 +2214,3 @@ {

transitionDuration: 270,
events: [],
},

@@ -2200,2 +2234,3 @@ ),

transitionDuration: 270,
events: [],
},

@@ -2207,2 +2242,3 @@ {

transitionDuration: 270,
events: [],
},

@@ -2209,0 +2245,0 @@ ),

@@ -56,2 +56,3 @@ import type { BaseDomainEvent } from "event-types/_base";

pausedEvents?: DomainEvent[];
events: DomainEvent[];
};

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

import type { StackflowActions } from "../interfaces";
import type { StackflowPlugin } from "../interfaces";
import type { StackflowActions, StackflowPlugin } from "../interfaces";
import { triggerPreEffectHook } from "./triggerPreEffectHooks";

@@ -4,0 +3,0 @@

import type { DomainEvent } from "../event-types";
import type { BaseDomainEvent } from "../event-types/_base";
import type { StackflowPlugin } from "../interfaces";
import type { StackflowActions } from "../interfaces";
import type { StackflowActions, StackflowPlugin } from "../interfaces";
import type { StackflowPluginPreEffectHook } from "../interfaces/StackflowPluginHook";

@@ -6,0 +5,0 @@

import type { Activity, ActivityTransitionState } from "../Stack";
import type { PushedEvent, ReplacedEvent } from "../event-types";
export declare const createActivityFromEvent: (event: PushedEvent | ReplacedEvent, transitionState: ActivityTransitionState) => Activity;
//# sourceMappingURL=createActivityFromEvent.d.ts.map
{"version":3,"file":"createActivityFromEvent.d.ts","sourceRoot":"","sources":["../../src/activity-utils/createActivityFromEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,eAAO,MAAM,uBAAuB,UAC3B,WAAW,GAAG,aAAa,mBACjB,uBAAuB,KACvC,QAkBD,CAAC"}
import type { DomainEvent } from "..";
export declare function createReducer<T>(reducerMap: {
[key in DomainEvent["name"]]: (state: T, event: Extract<DomainEvent, {
name: key;
}>) => T;
}): (activity: T, event: DomainEvent) => T;
//# sourceMappingURL=createReducer.d.ts.map
{"version":3,"file":"createReducer.d.ts","sourceRoot":"","sources":["../../src/activity-utils/createReducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,IAAI,CAAC;AAIhD,wBAAgB,aAAa,CAAC,CAAC,EAC7B,UAAU,EAAE;KACT,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAC5B,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,CAAC,KACvC,CAAC;CACP,cAEiB,CAAC,SAAS,WAAW,OAOxC"}
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
export default function findTargetActivityIndexes(activities: Activity[], event: DomainEvent, isTransitionDone: boolean): number[];
//# sourceMappingURL=findTargetActivityIndexes.d.ts.map
{"version":3,"file":"findTargetActivityIndexes.d.ts","sourceRoot":"","sources":["../../src/activity-utils/findTargetActivityIndexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiBlD,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,UAAU,EAAE,QAAQ,EAAE,EACtB,KAAK,EAAE,WAAW,EAClB,gBAAgB,EAAE,OAAO,GACxB,MAAM,EAAE,CAmFV"}
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
/**
* Create activity list reducers for each event type (Activity[] + Event => Activity[])
*/
export declare const makeActivitiesReducers: (isTransitionDone: boolean) => (activity: Activity[], event: DomainEvent) => Activity[];
//# sourceMappingURL=makeActivitiesReducers.d.ts.map
{"version":3,"file":"makeActivitiesReducers.d.ts","sourceRoot":"","sources":["../../src/activity-utils/makeActivitiesReducers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAEV,WAAW,EAQZ,MAAM,gBAAgB,CAAC;AAKxB;;GAEG;AACH,eAAO,MAAM,sBAAsB,qBAAsB,OAAO,6DAwE5D,CAAC"}
import type { Activity } from "../Stack";
import type { DomainEvent } from "../event-types";
/**
* Create activity reducers for each event type (Activity + Event => Activity)
*/
export declare const makeActivityReducers: (isTransitionDone: boolean) => (activity: Activity, event: DomainEvent) => Activity;
//# sourceMappingURL=makeActivityReducers.d.ts.map
{"version":3,"file":"makeActivityReducers.d.ts","sourceRoot":"","sources":["../../src/activity-utils/makeActivityReducers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA2B,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAEV,WAAW,EAQZ,MAAM,gBAAgB,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,oBAAoB,qBAAsB,OAAO,yDAoGjD,CAAC"}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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