swc/bundler/tests/.cache/deno/fd72ddc09bf0f35aee37f2c93afe50696af3776f.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

15 lines
464 B
TypeScript

// Loaded from https://deno.land/x/mysql/src/packets/builders/query.ts
import { encode, replaceParams } from "../../../deps.ts";
import { BufferWriter } from "../../buffer.ts";
/** @ignore */
export function buildQuery(sql: string, params: any[] = []): Uint8Array {
const data = encode(replaceParams(sql, params));
const writer = new BufferWriter(new Uint8Array(data.length + 1));
writer.write(0x03);
writer.writeBuffer(data);
return writer.buffer;
}