@rimbu/deep
Advanced tools
Comparing version 0.7.4 to 0.7.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./internal"), exports); | ||
(0, tslib_1.__exportStar)(require("./internal"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./tuple"), exports); | ||
tslib_1.__exportStar(require("./literal"), exports); | ||
tslib_1.__exportStar(require("./immutable"), exports); | ||
tslib_1.__exportStar(require("./match"), exports); | ||
tslib_1.__exportStar(require("./path"), exports); | ||
tslib_1.__exportStar(require("./patch"), exports); | ||
(0, tslib_1.__exportStar)(require("./tuple"), exports); | ||
(0, tslib_1.__exportStar)(require("./literal"), exports); | ||
(0, tslib_1.__exportStar)(require("./immutable"), exports); | ||
(0, tslib_1.__exportStar)(require("./match"), exports); | ||
(0, tslib_1.__exportStar)(require("./path"), exports); | ||
(0, tslib_1.__exportStar)(require("./patch"), exports); | ||
//# sourceMappingURL=internal.js.map |
@@ -26,3 +26,3 @@ "use strict"; | ||
try { | ||
for (var matchers_1 = tslib_1.__values(matchers), matchers_1_1 = matchers_1.next(); !matchers_1_1.done; matchers_1_1 = matchers_1.next()) { | ||
for (var matchers_1 = (0, tslib_1.__values)(matchers), matchers_1_1 = matchers_1.next(); !matchers_1_1.done; matchers_1_1 = matchers_1.next()) { | ||
var matcher = matchers_1_1.value; | ||
@@ -62,3 +62,3 @@ if (!matchSingle(value, matcher, value, value)) { | ||
try { | ||
for (var matchers_2 = tslib_1.__values(matchers), matchers_2_1 = matchers_2.next(); !matchers_2_1.done; matchers_2_1 = matchers_2.next()) { | ||
for (var matchers_2 = (0, tslib_1.__values)(matchers), matchers_2_1 = matchers_2.next(); !matchers_2_1.done; matchers_2_1 = matchers_2.next()) { | ||
var matcher = matchers_2_1.value; | ||
@@ -103,3 +103,3 @@ if (matchSingle(value, matcher, value, value)) { | ||
} | ||
return function (value) { return Match.all(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(matches))); }; | ||
return function (value) { return Match.all(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(matches), false)); }; | ||
} | ||
@@ -131,3 +131,3 @@ Match.createAll = createAll; | ||
} | ||
return function (value) { return Match.any(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(matches))); }; | ||
return function (value) { return Match.any(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(matches), false)); }; | ||
} | ||
@@ -134,0 +134,0 @@ Match.createAny = createAny; |
@@ -30,3 +30,3 @@ "use strict"; | ||
try { | ||
for (var patches_1 = tslib_1.__values(patches), patches_1_1 = patches_1.next(); !patches_1_1.done; patches_1_1 = patches_1.next()) { | ||
for (var patches_1 = (0, tslib_1.__values)(patches), patches_1_1 = patches_1.next(); !patches_1_1.done; patches_1_1 = patches_1.next()) { | ||
var p = patches_1_1.value; | ||
@@ -67,3 +67,3 @@ result = patchSingle(result, p, result, result); | ||
return function (value) { | ||
return patch(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(patches))); | ||
return patch(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(patches), false)); | ||
}; | ||
@@ -114,3 +114,3 @@ } | ||
} | ||
var clone = valueIsArray ? tslib_1.__spreadArray([], tslib_1.__read(value)) : tslib_1.__assign({}, value); | ||
var clone = valueIsArray ? (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(value), false) : (0, tslib_1.__assign)({}, value); | ||
var changed = false; | ||
@@ -117,0 +117,0 @@ for (var key in patcher) { |
@@ -25,3 +25,3 @@ "use strict"; | ||
try { | ||
for (var items_1 = tslib_1.__values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) { | ||
for (var items_1 = (0, tslib_1.__values)(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) { | ||
var item = items_1_1.value; | ||
@@ -53,8 +53,8 @@ result = result[item]; | ||
var last = items.pop(); | ||
var result = tslib_1.__assign({}, source); | ||
var result = (0, tslib_1.__assign)({}, source); | ||
var current = result; | ||
try { | ||
for (var items_2 = tslib_1.__values(items), items_2_1 = items_2.next(); !items_2_1.done; items_2_1 = items_2.next()) { | ||
for (var items_2 = (0, tslib_1.__values)(items), items_2_1 = items_2.next(); !items_2_1.done; items_2_1 = items_2.next()) { | ||
var item = items_2_1.value; | ||
current[item] = tslib_1.__assign({}, current[item]); | ||
current[item] = (0, tslib_1.__assign)({}, current[item]); | ||
current = current[item]; | ||
@@ -93,3 +93,3 @@ } | ||
var value = Path.getValue(source, path); | ||
var newValue = internal_1.patch(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(patches))); | ||
var newValue = (0, internal_1.patch)(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(patches), false)); | ||
if (Object.is(value, newValue)) | ||
@@ -96,0 +96,0 @@ return source; |
@@ -101,3 +101,3 @@ "use strict"; | ||
} | ||
return tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(tuple)), tslib_1.__read(values)); | ||
return (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tuple), false), (0, tslib_1.__read)(values), false); | ||
} | ||
@@ -104,0 +104,0 @@ Tuple.append = append; |
{ | ||
"name": "@rimbu/deep", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Tools to use handle plain JS objects as immutable objects", | ||
@@ -59,5 +59,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/base": "^0.6.5", | ||
"@rimbu/common": "^0.7.3", | ||
"tslib": "^2.3.0" | ||
"@rimbu/base": "^0.6.6", | ||
"@rimbu/common": "^0.7.4", | ||
"tslib": "^2.3.1" | ||
}, | ||
@@ -70,3 +70,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "f6fad673f48ce3d44d6b0f931c0182c8231526ca" | ||
"gitHead": "e509f9938fad6253702f6b78eb9f8e3b3a8f92ac" | ||
} |
@@ -15,2 +15,8 @@ <p align="center"> | ||
All types are exported through `@rimbu/core`. It is recommended to use that package. | ||
To install this package only: | ||
### Yarn/NPM | ||
> `yarn add @rimbu/deep` | ||
@@ -22,4 +28,30 @@ | ||
### recommended tsconfig.json settings | ||
### Deno | ||
Create a file called `rimbu.ts` and add the following: | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/deep/mod.ts'; | ||
> ``` | ||
Or using a pinned version (`x.y.z`): | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/deep@x.y.z/mod.ts'; | ||
> ``` | ||
Then import what you need from `rimbu.ts`: | ||
```ts | ||
import { patch } from './rimbu.ts'; | ||
``` | ||
Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below. | ||
Running your script then becomes: | ||
> `deno run --no-check --config tsconfig.json <your-script>.ts` | ||
## Recommended `tsconfig.json` settings | ||
Rimbu uses advanced and recursive typing, potentially making the TS compiler quite slow. It is recommended to set the following values in the `tsconfig.json` file of your project: | ||
@@ -26,0 +58,0 @@ |
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
102950
102
Updated@rimbu/base@^0.6.6
Updated@rimbu/common@^0.7.4
Updatedtslib@^2.3.1