mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
15 lines
464 B
TypeScript
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;
|
|
}
|