New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mobx-state-tree

Package Overview
Dependencies
Maintainers
8
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx-state-tree - npm Package Compare versions

Comparing version 5.4.0-pre.1 to 5.4.0

16

dist/types/utility-types/snapshotProcessor.d.ts

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

import { IType, IAnyType } from "../../internal";
import { IType, IAnyType, Instance } from "../../internal";
/** @hidden */

@@ -18,7 +18,7 @@ declare const $mstNotCustomized: unique symbol;

*/
export interface ISnapshotProcessors<C, CustomC, S, CustomS> {
export interface ISnapshotProcessors<IT extends IAnyType, CustomC, CustomS> {
/**
* Function that transforms an input snapshot.
*/
preProcessor?(snapshot: CustomC): C;
preProcessor?(snapshot: CustomC): IT["CreationType"];
/**

@@ -28,3 +28,3 @@ * Function that transforms an output snapshot.

*/
postProcessor?(snapshot: S): CustomS;
postProcessor?(snapshot: IT["SnapshotType"], node: Instance<IT>): CustomS;
}

@@ -41,5 +41,6 @@ /**

* }
*
* const Todo2 = types.snapshotProcessor(Todo1, {
* // from snapshot to instance
* preProcessor(sn: BackendTodo) {
* preProcessor(snapshot: BackendTodo) {
* return {

@@ -49,4 +50,5 @@ * text: sn.text || "";

* },
*
* // from instance to snapshot
* postProcessor(sn): BackendTodo {
* postProcessor(snapshot, node): BackendTodo {
* return {

@@ -64,3 +66,3 @@ * text: !sn.text ? null : sn.text

*/
export declare function snapshotProcessor<IT extends IAnyType, CustomC = _NotCustomized, CustomS = _NotCustomized>(type: IT, processors: ISnapshotProcessors<IT["CreationType"], CustomC, IT["SnapshotType"], CustomS>, name?: string): ISnapshotProcessor<IT, CustomC, CustomS>;
export declare function snapshotProcessor<IT extends IAnyType, CustomC = _NotCustomized, CustomS = _NotCustomized>(type: IT, processors: ISnapshotProcessors<IT, CustomC, CustomS>, name?: string): ISnapshotProcessor<IT, CustomC, CustomS>;
export {};
{
"name": "mobx-state-tree",
"version": "5.4.0-pre.1",
"version": "5.4.0",
"description": "Opinionated, transactional, MobX powered state container",

@@ -20,3 +20,2 @@ "main": "dist/mobx-state-tree.js",

"build": "yarn clean && tsc && cpr lib dist --filter=\\.js$ && rollup -c",
"jest": "jest --testPathPattern=/__tests__/core/",
"jest:perf": "jest --testPathPattern=/__tests__/perf/",

@@ -23,0 +22,0 @@ "test:perf": "yarn build && yarn jest:perf && TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' /usr/bin/time node --expose-gc --require ts-node/register __tests__/perf/report.ts",

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

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

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

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