diff --git a/package.json b/package.json index 53d4cdc..5bfd657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mutability", - "version": "0.3.1", + "version": "0.3.2", "description": "A JavaScript library for transactional mutable updates", "main": "dist/index.cjs.js", "unpkg": "dist/index.umd.js", diff --git a/src/index.ts b/src/index.ts index 0f083b3..c93776d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,11 @@ -import * as mutative from 'mutative'; +import { create } from 'mutative'; import { apply } from './apply'; /** * Transactional updates to the base state with the recipe. */ export const mutate = (baseState: T, recipe: (state: T) => void) => { - const [, patches] = mutative.create(baseState, recipe, { + const [, patches] = create(baseState, recipe, { enablePatches: true, }); apply(baseState, patches); diff --git a/tsconfig.json b/tsconfig.json index 7145423..64d5736 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "lib": [ "ES2019", "DOM" @@ -42,7 +42,7 @@ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ "rootDirs": [