MCPcopy Create free account
hub / github.com/Keyang/node-csvtojson / bufFromString

Function bufFromString

src/util.ts:1–8  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1export function bufFromString(str: string): Buffer {
2 const length = Buffer.byteLength(str);
3 const buffer = Buffer.allocUnsafe
4 ? Buffer.allocUnsafe(length)
5 : new Buffer(length);
6 buffer.write(str);
7 return buffer;
8}
9
10export function emptyBuffer(): Buffer {
11 const buffer = Buffer.allocUnsafe

Callers 3

processCSVMethod · 0.90
processDataWithHeadMethod · 0.90
processCSVBodyMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected