Repair rewrite.ts attenuate()
This commit is contained in:
parent
036c342264
commit
63b5d23391
|
@ -1,9 +1,9 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
import { Turn } from "./actor.js";
|
||||
import { Turn, Ref } from "./actor.js";
|
||||
import { Bytes, Dictionary, DoubleFloat, IdentityMap, is, isEmbedded, Record, Tuple, stringify } from "@preserves/core";
|
||||
import type { Assertion, Handle, Ref } from "./actor.js";
|
||||
import type { Assertion, Handle } from "./actor.js";
|
||||
import type { SturdyValue } from "../transport/sturdy.js";
|
||||
|
||||
import {
|
||||
|
@ -200,7 +200,7 @@ export function rmap(... rewrites: [Pattern, Template][]): Caveat {
|
|||
|
||||
export function attenuate(ref: Ref, ... a: Caveat[]): Ref {
|
||||
if (a.length === 0) return ref;
|
||||
return { ... ref, attenuation: [... (ref.attenuation ?? []), ... a] };
|
||||
return new Ref(ref.relay, ref.target, [... (ref.attenuation ?? []), ... a]);
|
||||
}
|
||||
|
||||
export function forwarder(ref: Ref): { proxy: Ref, revoker: Ref } {
|
||||
|
|
Loading…
Reference in New Issue