import { getChangeStore } from "./store.js";
import { isLike } from "../../is.js";
export async function listChanges(options) {
    const store = getChangeStore(options);
    let changes = await store.values();
    if (isChangeTarget(options.target)) {
        const id = options.target.id;
        changes = changes.filter(change => change.target.id === id);
    }
    return changes;
}
function isChangeTarget(target) {
    return isLike(target) && !!target.id;
}
//# sourceMappingURL=list-changes.js.map