Socket
Socket
Sign inDemoInstall

immer

Package Overview
Dependencies
Maintainers
2
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immer - npm Package Compare versions

Comparing version 9.0.0-beta.0 to 9.0.0-beta.1

5

dist/types/types-external.d.ts

@@ -49,3 +49,3 @@ import { Nothing } from "../internal";

declare type InferInitialStateFromCurried<Curried> = Curried extends (base: infer State, ...rest: any[]) => any ? State : never;
declare type InferCurriedFromRecipe<Recipe, UsePatches extends boolean> = Recipe extends (draft: infer DraftState, ...args: infer RestArgs) => any ? ReturnType<Recipe> extends ValidRecipeReturnTypePossiblyPromise<DraftState> ? (base: Immutable<DraftState>, ...args: RestArgs) => PromisifyReturnIfNeeded<Immutable<DraftState>, Recipe, UsePatches> : never : never;
declare type InferCurriedFromRecipe<Recipe, UsePatches extends boolean> = Recipe extends (draft: infer DraftState, ...args: infer RestArgs) => any ? ReturnType<Recipe> extends ValidRecipeReturnTypePossiblyPromise<DraftState> ? (base: Immutable<DraftState>, ...args: RestArgs) => PromisifyReturnIfNeeded<DraftState, Recipe, UsePatches> : never : never;
declare type InferCurriedFromInitialStateAndRecipe<State, Recipe, UsePatches extends boolean> = Recipe extends (draft: Draft<State>, ...rest: infer RestArgs) => ValidRecipeReturnTypePossiblyPromise<State> ? (base?: State | undefined, ...args: RestArgs) => PromisifyReturnIfNeeded<State, Recipe, UsePatches> : never;

@@ -76,2 +76,5 @@ /**

<Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<Recipe, false>;
/** Curried producer that infers curried from the State generic, which is explicitly passed in. */
<State>(recipe: (state: Draft<State>) => ValidRecipeReturnType<State>): (state: State) => State;
<State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>): (state: State, ...args: Args) => State;
/** Curried producer with initial state, infers recipe from initial state */

@@ -78,0 +81,0 @@ <State, Recipe extends Function>(recipe: Recipe, initialState: State): InferCurriedFromInitialStateAndRecipe<State, Recipe, false>;

2

package.json
{
"name": "immer",
"version": "9.0.0-beta.0",
"version": "9.0.0-beta.1",
"description": "Create your next immutable state by mutating the current one",

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

@@ -135,5 +135,5 @@ import {Nothing} from "../internal"

? (
base: Immutable<DraftState>,
...args: RestArgs
) => PromisifyReturnIfNeeded<Immutable<DraftState>, Recipe, UsePatches>
base: Immutable<DraftState>,
...args: RestArgs
) => PromisifyReturnIfNeeded<DraftState, Recipe, UsePatches> // N.b. we return mutable draftstate, in case the recipe's first arg isn't read only, and that isn't expected as output either
: never // incorrect return type

@@ -182,2 +182,3 @@ : never // not a function

/** Curried producer that infers curried from the recipe */

@@ -189,2 +190,6 @@ <Recipe extends AnyFunc>(recipe: Recipe): InferCurriedFromRecipe<

/** Curried producer that infers curried from the State generic, which is explicitly passed in. */
<State>(recipe: (state: Draft<State>) => ValidRecipeReturnType<State>): (state: State) => State
<State, Args extends any[]>(recipe: (state: Draft<State>, ...args: Args) => ValidRecipeReturnType<State>): (state: State, ...args: Args) => State
/** Curried producer with initial state, infers recipe from initial state */

@@ -191,0 +196,0 @@ <State, Recipe extends Function>(

Sorry, the diff of this file is not supported yet

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