@rimbu/deep
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -6,5 +6,5 @@ declare const LITERAL: unique symbol; | ||
*/ | ||
export declare type Literal<T> = { | ||
export interface Literal<T> { | ||
readonly [LITERAL]: T; | ||
}; | ||
} | ||
export declare namespace Literal { | ||
@@ -19,5 +19,5 @@ /** | ||
*/ | ||
type NoIterable = { | ||
[Symbol.iterator]?: never; | ||
}; | ||
interface NoIterable { | ||
readonly [Symbol.iterator]?: never; | ||
} | ||
/** | ||
@@ -24,0 +24,0 @@ * A plain object that is not iterable |
{ | ||
"name": "@rimbu/deep", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Tools to use handle plain JS objects as immutable objects", | ||
@@ -15,3 +15,3 @@ "keywords": [ | ||
], | ||
"homepage": "http://rimbu.org", | ||
"homepage": "https://rimbu.org", | ||
"author": { | ||
@@ -60,4 +60,4 @@ "name": "Arvid Nicolaas", | ||
"dependencies": { | ||
"@rimbu/base": "^0.6.6", | ||
"@rimbu/common": "^0.7.4", | ||
"@rimbu/base": "^0.6.7", | ||
"@rimbu/common": "^0.7.5", | ||
"tslib": "^2.3.1" | ||
@@ -71,3 +71,3 @@ }, | ||
}, | ||
"gitHead": "e509f9938fad6253702f6b78eb9f8e3b3a8f92ac" | ||
"gitHead": "20739fd0c0d5c565eeecd3e266dd51f893e8d67c" | ||
} |
@@ -7,7 +7,7 @@ <p align="center"> | ||
Offers tools to use handle plain JS objects as immutable objects. | ||
Offers tools to use handle plain JS objects as immutable objects. The [`Patch` object](https://rimbu.org/docs/deep/patch) allows convenient immutable modification of simple objects. The [`Match` object](https://rimbu.org/docs/deep/match) allows easy matching on plain objects. The [`Path` object](https://rimbu.org/docs/deep/path) allows easy querying of nested values. The [`Immutable` type](https://rimbu.org/docs/deep/immutable) makes it easy to create plain objects that that have compile-time protection against mutation. The [`Tuple` type](https://rimbu.org/docs/deep/tuple) is a utility to have similar functionality as `as const` but less strict. | ||
For complete documentation please visit the _[Rimbu Docs](http://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 [Try Me Out](https://codesandbox.io/s/rimbu-sandbox-d4tbk?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox. | ||
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. | ||
@@ -14,0 +14,0 @@ ## Installation |
@@ -7,5 +7,5 @@ const LITERAL = Symbol('LITERAL'); | ||
*/ | ||
export type Literal<T> = { | ||
export interface Literal<T> { | ||
readonly [LITERAL]: T; | ||
}; | ||
} | ||
@@ -24,3 +24,5 @@ export namespace Literal { | ||
*/ | ||
export type NoIterable = { [Symbol.iterator]?: never }; | ||
export interface NoIterable { | ||
readonly [Symbol.iterator]?: never; | ||
} | ||
@@ -27,0 +29,0 @@ /** |
@@ -74,3 +74,3 @@ import { RimbuError } from '@rimbu/base'; | ||
export function all<T>(value: T): (...matchers: Match.Multi<T>) => boolean { | ||
return (...matchers) => { | ||
return (...matchers): boolean => { | ||
for (const matcher of matchers) { | ||
@@ -96,3 +96,3 @@ if (!matchSingle<any, any, any>(value, matcher, value, value)) { | ||
export function any<T>(value: T): (...matchers: Match.Multi<T>) => boolean { | ||
return (...matchers) => { | ||
return (...matchers): boolean => { | ||
for (const matcher of matchers) { | ||
@@ -128,3 +128,3 @@ if (matchSingle<any, any, any>(value, matcher, value, value)) { | ||
): (value: T) => boolean { | ||
return (value) => Match.all<any>(value)(...matches); | ||
return (value): boolean => Match.all<any>(value)(...matches); | ||
} | ||
@@ -154,3 +154,3 @@ | ||
): (value: T) => boolean { | ||
return (value) => Match.any<any>(value)(...matches); | ||
return (value): boolean => Match.any<any>(value)(...matches); | ||
} | ||
@@ -157,0 +157,0 @@ } |
@@ -32,3 +32,3 @@ import { RimbuError } from '@rimbu/base'; | ||
export function patch<T>(value: T): (...patches: Patch.Multi<T>) => T { | ||
return function (...patches) { | ||
return function (...patches): T { | ||
let result = value; | ||
@@ -102,3 +102,3 @@ | ||
): (value: T) => T { | ||
return (value) => | ||
return (value): T => | ||
patch<T>(value)(...(patches as unknown as Patch.Multi<T>)); | ||
@@ -105,0 +105,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
103704
2182
Updated@rimbu/base@^0.6.7
Updated@rimbu/common@^0.7.5