MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / string

Method string

shared/rison.ts:146–156  ·  view source on GitHub ↗
(x: string)

Source from the content-addressed store, hash-verified

144 return '!n';
145 }
146 static string(x: string) {
147 if (x === '') return "''";
148
149 if (id_ok.test(x)) return x;
150
151 x = x.replace(/(['!])/g, (a, b) => {
152 if (string_table[b as keyof typeof string_table]) return '!' + b;
153 return b;
154 });
155 return "'" + x + "'";
156 }
157 static undefined() {
158 // ignore undefined just like JSON
159 return undefined;

Callers 6

registerCompilersToolFunction · 0.80
registerLibrariesToolFunction · 0.80
registerAsmDocsToolFunction · 0.80
registerShortlinkToolsFunction · 0.80
registerCompileToolFunction · 0.80
objectMethod · 0.80

Calls 1

testMethod · 0.80

Tested by

no test coverage detected