/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
export function makeChangeAtomIdCodec(revisionTagCodec) {
    return {
        encode(changeAtomId, context) {
            return changeAtomId.revision === undefined
                ? changeAtomId.localId
                : [changeAtomId.localId, revisionTagCodec.encode(changeAtomId.revision, context)];
        },
        decode(changeAtomId, context) {
            return Array.isArray(changeAtomId)
                ? {
                    localId: changeAtomId[0],
                    revision: revisionTagCodec.decode(changeAtomId[1], context),
                }
                : { localId: changeAtomId };
        },
    };
}
//# sourceMappingURL=changeAtomIdCodec.js.map