Files
klz-cables.com/.pnpm-store/v10/files/52/57947f17edf0dfd6c95287ad1b9d4db451774a19cc293319cac19e9e6bacf5daf1553ac14d88d675923d1313154c489fc3e1711ce066db1e53d2820a86407a
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

40 lines
1.1 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumn, MySqlColumnBuilder } from "./common.js";
class MySqlBinaryBuilder extends MySqlColumnBuilder {
static [entityKind] = "MySqlBinaryBuilder";
constructor(name, length) {
super(name, "string", "MySqlBinary");
this.config.length = length;
}
/** @internal */
build(table) {
return new MySqlBinary(table, this.config);
}
}
class MySqlBinary extends MySqlColumn {
static [entityKind] = "MySqlBinary";
length = this.config.length;
mapFromDriverValue(value) {
if (typeof value === "string") return value;
if (Buffer.isBuffer(value)) return value.toString();
const str = [];
for (const v of value) {
str.push(v === 49 ? "1" : "0");
}
return str.join("");
}
getSQLType() {
return this.length === void 0 ? `binary` : `binary(${this.length})`;
}
}
function binary(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new MySqlBinaryBuilder(name, config.length);
}
export {
MySqlBinary,
MySqlBinaryBuilder,
binary
};
//# sourceMappingURL=binary.js.map