"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.tryGetChunk = exports.cursorChunk = exports.dummyRoot = void 0;
const common_utils_1 = require("@fluidframework/common-utils");
const core_1 = require("../../core");
/**
 * The key used for the field that contains the root of chunks when not parented anywhere.
 *
 * For now this is using the document root key to ease testing/compatibility, but this may change.
 */
exports.dummyRoot = core_1.rootFieldKey;
/**
 * A symbol for extracting a TreeChunk from {@link ITreeCursor}.
 */
exports.cursorChunk = Symbol("cursorChunk");
/**
 * See {@link WithChunk}.
 */
function tryGetChunk(cursor) {
    (0, common_utils_1.assert)(cursor.mode === 0 /* Nodes */, 0x57b /* cursorChunk only accessible in nodes mode */);
    return cursor[exports.cursorChunk];
}
exports.tryGetChunk = tryGetChunk;
//# sourceMappingURL=chunk.js.map