MCPcopy Index your code
hub / github.com/meteor/meteor / set

Method set

tools/fs/files.ts:1371–1388  ·  view source on GitHub ↗
(k: string, v: any)

Source from the content-addressed store, hash-verified

1369 constructor(public path: string) {}
1370
1371 set(k: string, v: any) {
1372 const data = (this.readAll() || '').toString("utf8");
1373 const lines = data.split(/\n/);
1374
1375 let found = false;
1376 for (let i = 0; i < lines.length; i++) {
1377 const trimmed = lines[i].trim();
1378 if (trimmed.indexOf(k + '=') == 0) {
1379 lines[i] = k + '=' + v;
1380 found = true;
1381 }
1382 }
1383 if (!found) {
1384 lines.push(k + "=" + v);
1385 }
1386 const newdata = lines.join('\n') + '\n';
1387 writeFile(this.path, newdata, 'utf8');
1388 }
1389
1390 private readAll() {
1391 if (exists(this.path)) {

Callers 15

captureFunction · 0.45
enterJobFunction · 0.45
withValueFunction · 0.45
run-selenium.jsFile · 0.45
linker.jsFile · 0.45
getTreeFunction · 0.45
handleMissingMethod · 0.45
_linkJSMethod · 0.45
minifyJsMethod · 0.45

Calls 3

readAllMethod · 0.95
indexOfMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected