MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / fromString

Method fromString

contributes/src/vs/base/common/buffer.ts:36–47  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

34 }
35
36 static fromString(source: string): VSBuffer {
37 if (hasBuffer) {
38 return new VSBuffer(Buffer.from(source));
39 } else if (hasTextEncoder) {
40 if (!textEncoder) {
41 textEncoder = new TextEncoder();
42 }
43 return new VSBuffer(textEncoder.encode(source));
44 } else {
45 return new VSBuffer(strings.encodeUTF8(source));
46 }
47 }
48
49 static concat(buffers: VSBuffer[], totalLength?: number): VSBuffer {
50 if (typeof totalLength === 'undefined') {

Callers

nothing calls this directly

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected