Skip to content

Commit d2447aa

Browse files
Remove tree's forwarding fail function (#24221)
## Description Now that `@fluidframework/core-utils/internal` exists, use it.
1 parent da6da71 commit d2447aa

File tree

72 files changed

+151
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+151
-185
lines changed

packages/dds/tree/src/codec/codec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
*/
55

66
import { IsoBuffer, bufferToString } from "@fluid-internal/client-utils";
7-
import { assert } from "@fluidframework/core-utils/internal";
7+
import { assert, fail } from "@fluidframework/core-utils/internal";
88
import type { Static, TAnySchema, TSchema } from "@sinclair/typebox";
99

1010
import type { ChangeEncodingContext } from "../core/index.js";
11-
import { type JsonCompatibleReadOnly, fail } from "../util/index.js";
11+
import type { JsonCompatibleReadOnly } from "../util/index.js";
1212

1313
/**
1414
* Translates decoded data to encoded data.

packages/dds/tree/src/codec/discriminatedUnions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { assert } from "@fluidframework/core-utils/internal";
6+
import { assert, fail } from "@fluidframework/core-utils/internal";
77
import type { ObjectOptions } from "@sinclair/typebox";
88

9-
import { type _InlineTrick, fail, objectToMap } from "../util/index.js";
9+
import { type _InlineTrick, objectToMap } from "../util/index.js";
1010

1111
/**
1212
* This module contains utilities for an encoding of a discriminated union that is efficient to validate using

packages/dds/tree/src/core/schema-stored/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* Licensed under the MIT License.
44
*/
55

6+
import { fail } from "@fluidframework/core-utils/internal";
67
import type { ErasedType } from "@fluidframework/core-interfaces";
78
import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
8-
import { type MakeNominal, brand, fail, invertMap } from "../../util/index.js";
9+
import { type MakeNominal, brand, invertMap } from "../../util/index.js";
910
import {
1011
type FieldKey,
1112
type FieldKindIdentifier,

packages/dds/tree/src/core/tree/anchorSet.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* eslint-disable @typescript-eslint/no-non-null-assertion */
77

8-
import { assert } from "@fluidframework/core-utils/internal";
8+
import { assert, fail } from "@fluidframework/core-utils/internal";
99

1010
import type { Listenable } from "@fluidframework/core-interfaces/internal";
1111
import { createEmitter } from "@fluid-internal/client-utils";
@@ -17,7 +17,6 @@ import {
1717
ReferenceCountedBase,
1818
brand,
1919
brandedSlot,
20-
fail,
2120
getOrAddEmptyToMap,
2221
getOrCreate,
2322
} from "../../util/index.js";

packages/dds/tree/src/core/tree/treeTextFormat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { fail } from "../../util/index.js";
6+
import { fail } from "@fluidframework/core-utils/internal";
77
import type { FieldKey } from "../schema-stored/index.js";
88

99
import type { NodeData } from "./types.js";

packages/dds/tree/src/feature-libraries/chunked-forest/basicChunk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { assert, oob } from "@fluidframework/core-utils/internal";
6+
import { assert, oob, fail } from "@fluidframework/core-utils/internal";
77

88
import {
99
CursorLocationType,
@@ -20,7 +20,7 @@ import {
2020
cursorChunk,
2121
dummyRoot,
2222
} from "../../core/index.js";
23-
import { ReferenceCountedBase, fail } from "../../util/index.js";
23+
import { ReferenceCountedBase } from "../../util/index.js";
2424
import { SynchronousCursor, prefixPath } from "../treeCursorUtils.js";
2525

2626
/**

packages/dds/tree/src/feature-libraries/chunked-forest/chunkTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { assert, debugAssert, oob } from "@fluidframework/core-utils/internal";
6+
import { assert, debugAssert, oob, fail } from "@fluidframework/core-utils/internal";
77

88
import {
99
CursorLocationType,
@@ -24,7 +24,7 @@ import {
2424
type TreeChunk,
2525
tryGetChunk,
2626
} from "../../core/index.js";
27-
import { fail, getOrCreate } from "../../util/index.js";
27+
import { getOrCreate } from "../../util/index.js";
2828
import type { FullSchemaPolicy } from "../modular-schema/index.js";
2929

3030
import { BasicChunk } from "./basicChunk.js";

packages/dds/tree/src/feature-libraries/chunked-forest/chunkedForest.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { assert, oob } from "@fluidframework/core-utils/internal";
6+
import { assert, oob, fail } from "@fluidframework/core-utils/internal";
77
import type { Listenable } from "@fluidframework/core-interfaces";
88
import { createEmitter } from "@fluid-internal/client-utils";
99

@@ -37,7 +37,6 @@ import {
3737
import {
3838
assertValidRange,
3939
brand,
40-
fail,
4140
getLast,
4241
getOrAddEmptyToMap,
4342
hasSome,

packages/dds/tree/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Licensed under the MIT License.
44
*/
55

6+
import { fail } from "@fluidframework/core-utils/internal";
67
import type { TreeValue } from "../../../core/index.js";
7-
import { fail } from "../../../util/index.js";
88
import type { FluidSerializableReadOnly } from "../../valueUtilities.js";
99

1010
import {

packages/dds/tree/src/feature-libraries/chunked-forest/codec/compressedEncode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
6+
import { assert, unreachableCase, fail } from "@fluidframework/core-utils/internal";
77

88
import {
99
CursorLocationType,
@@ -15,7 +15,7 @@ import {
1515
type Value,
1616
forEachNode,
1717
} from "../../../core/index.js";
18-
import { fail, getOrCreate } from "../../../util/index.js";
18+
import { getOrCreate } from "../../../util/index.js";
1919
import type { FlexFieldKind } from "../../modular-schema/index.js";
2020

2121
import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";

0 commit comments

Comments
 (0)