export async function ignore(codes, fn) {
    try {
        return await fn();
    }
    catch (error) {
        const errorCode = error.code || error.name;
        if (Array.isArray(codes) ? codes.includes(errorCode) : errorCode === codes) {
            return undefined;
        }
        throw error;
    }
}
//# sourceMappingURL=ignore.js.map