@rimbu/deep
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -11,3 +11,3 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./internal"), exports); | ||
tslib_1.__exportStar(require("./internal"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
(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); | ||
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); | ||
//# sourceMappingURL=internal.js.map |
@@ -28,3 +28,3 @@ "use strict"; | ||
try { | ||
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()) { | ||
for (var matchers_1 = 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; | ||
@@ -66,3 +66,3 @@ if (!matchSingle(value, matcher, value, value)) { | ||
try { | ||
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()) { | ||
for (var matchers_2 = 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; | ||
@@ -109,3 +109,3 @@ if (matchSingle(value, matcher, value, value)) { | ||
} | ||
return function (value) { return Match.all(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(matches), false)); }; | ||
return function (value) { return Match.all(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(matches), false)); }; | ||
} | ||
@@ -139,3 +139,3 @@ Match.createAll = createAll; | ||
} | ||
return function (value) { return Match.any(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(matches), false)); }; | ||
return function (value) { return Match.any(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(matches), false)); }; | ||
} | ||
@@ -142,0 +142,0 @@ Match.createAny = createAny; |
@@ -32,3 +32,3 @@ "use strict"; | ||
try { | ||
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()) { | ||
for (var patches_1 = 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; | ||
@@ -71,3 +71,3 @@ result = patchSingle(result, p, result, result); | ||
return function (value) { | ||
return patch(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(patches), false)); | ||
return patch(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(patches), false)); | ||
}; | ||
@@ -118,3 +118,3 @@ } | ||
} | ||
var clone = valueIsArray ? (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(value), false) : (0, tslib_1.__assign)({}, value); | ||
var clone = valueIsArray ? tslib_1.__spreadArray([], tslib_1.__read(value), false) : tslib_1.__assign({}, value); | ||
var changed = false; | ||
@@ -121,0 +121,0 @@ for (var key in patcher) { |
@@ -27,3 +27,3 @@ "use strict"; | ||
try { | ||
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()) { | ||
for (var items_1 = 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; | ||
@@ -57,8 +57,8 @@ result = result[item]; | ||
var last = items.pop(); | ||
var result = (0, tslib_1.__assign)({}, source); | ||
var result = tslib_1.__assign({}, source); | ||
var current = result; | ||
try { | ||
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()) { | ||
for (var items_2 = 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] = (0, tslib_1.__assign)({}, current[item]); | ||
current[item] = tslib_1.__assign({}, current[item]); | ||
current = current[item]; | ||
@@ -99,3 +99,3 @@ } | ||
var value = Path.getValue(source, path); | ||
var newValue = (0, internal_1.patch)(value).apply(void 0, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(patches), false)); | ||
var newValue = (0, internal_1.patch)(value).apply(void 0, tslib_1.__spreadArray([], tslib_1.__read(patches), false)); | ||
if (Object.is(value, newValue)) | ||
@@ -102,0 +102,0 @@ return source; |
@@ -115,3 +115,3 @@ "use strict"; | ||
} | ||
return (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(tuple), false), (0, tslib_1.__read)(values), false); | ||
return tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(tuple), false), tslib_1.__read(values), false); | ||
} | ||
@@ -118,0 +118,0 @@ Tuple.append = append; |
{ | ||
"name": "@rimbu/deep", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Tools to use handle plain JS objects as immutable objects", | ||
@@ -60,5 +60,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/base": "^0.8.1", | ||
"@rimbu/common": "^0.9.1", | ||
"tslib": "^2.3.1" | ||
"@rimbu/base": "^0.8.2", | ||
"@rimbu/common": "^0.9.2", | ||
"tslib": "^2.4.0" | ||
}, | ||
@@ -72,3 +72,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "f44e1b43f07ac973555270806bbdde5f06400941" | ||
"gitHead": "33dd7ca935f19f513586834a2ce1b1f886352ae7" | ||
} |
@@ -9,3 +9,3 @@ <p align="center"> | ||
For complete documentation please visit the [Immutable Objects overview](https://rimbu.org/docs/deep/overview) in the _[Rimbu Docs](https://rimbu.org)_. | ||
For complete documentation please visit the [Immutable Objects overview](https://rimbu.org/docs/deep/overview) in the _[Rimbu Docs](https://rimbu.org)_, or directly see the _[Rimbu Deep API Docs](https://rimbu.org/api/rimbu/deep)_. | ||
@@ -30,26 +30,37 @@ Or [Try Out Rimbu](https://codesandbox.io/s/github/vitoke/rimbu-sandbox/tree/main?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox. | ||
Create a file called `rimbu.ts` and add the following: | ||
For Deno, the following approach is recommended: | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/deep/mod.ts'; | ||
> ``` | ||
In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu): | ||
Or using a pinned version (`x.y.z`): | ||
```json | ||
{ | ||
"imports": { | ||
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/" | ||
} | ||
} | ||
``` | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/deep@x.y.z/mod.ts'; | ||
> ``` | ||
**Note: The trailing slashes are important!** | ||
Then import what you need from `rimbu.ts`: | ||
In this way you can use relative imports from Rimbu in your code, like so: | ||
```ts | ||
import { patch } from './rimbu.ts'; | ||
import { List } from '@rimbu/core/mod.ts'; | ||
import { HashMap } from '@rimbu/hashed/mod.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. | ||
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so: | ||
Running your script then becomes: | ||
```ts | ||
import { HashMap } from '@rimbu/hashed/map/index.ts'; | ||
``` | ||
> `deno run --no-check --config tsconfig.json <your-script>.ts` | ||
To run your script (let's assume the entry point is in `src/main.ts`): | ||
`deno run --import-map import_map.json src/main.ts` | ||
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag: | ||
`deno run --import-map import_map.json --no-check src/main.ts` | ||
## Usage | ||
@@ -82,3 +93,3 @@ | ||
<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/> | ||
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/> | ||
@@ -85,0 +96,0 @@ Made with [contributors-img](https://contrib.rocks). |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107292
100
Updated@rimbu/base@^0.8.2
Updated@rimbu/common@^0.9.2
Updatedtslib@^2.4.0