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