"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.nodeKeyTreeIdentifier = exports.nodeKeyFieldKey = exports.compareLocalNodeKeys = void 0;
const util_1 = require("../../util");
/**
 * Compares two {@link LocalNodeKey}s.
 * All {@link LocalNodeKey}s retrieved from a single SharedTree client can be totally ordered using this comparator.
 * @param a - the first key to compare
 * @param b - the second key to compare
 * @returns `0` if `a` and `b` are the same key, otherwise `-1` if `a` is ordered before `b` or `1` if `a` is ordered after `b`.
 * @alpha
 */
function compareLocalNodeKeys(a, b) {
    return a === b ? 0 : a > b ? 1 : -1;
}
exports.compareLocalNodeKeys = compareLocalNodeKeys;
/**
 * The key for the special field for {@link LocalNodeKey}s,
 * which allows nodes to be given keys that can be used to find the nodes via the node key index.
 * @alpha
 * @privateRemarks TODO: Come up with a unified and collision-resistant naming schema for fields defined by the system.
 * For now, we'll use `__` to reduce the change of collision, since this is what other internal properties use in Fluid.
 */
exports.nodeKeyFieldKey = "__n_id__";
/**
 * The TreeSchemaIdentifier for node keys.
 * @alpha
 * @privateRemarks TODO: Come up with a unified and collision-resistant naming schema for types defined by the system.
 * For now, we'll use `__` to reduce the change of collision, since this is what other internal properties use in Fluid.
 */
exports.nodeKeyTreeIdentifier = (0, util_1.brand)(exports.nodeKeyFieldKey);
//# sourceMappingURL=nodeKey.js.map