MCPcopy
hub / github.com/vercel/hyper / loadRcFile

Function loadRcFile

bin/yarn-standalone.js:69878–69896  ·  view source on GitHub ↗
(fileText, filePath)

Source from the content-addressed store, hash-verified

69876}
69877
69878function loadRcFile(fileText, filePath) {
69879 var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc');
69880
69881 let values = _parse.object;
69882
69883
69884 if (filePath.match(/\.yml$/)) {
69885 values = { 'yarn-path': values.yarnPath };
69886 }
69887
69888 // some keys reference directories so keep their relativity
69889 for (const key in values) {
69890 if (PATH_KEYS.has(key.replace(/^(--)?([^.]+\.)*/, ''))) {
69891 values[key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[key]);
69892 }
69893 }
69894
69895 return values;
69896}
69897
69898// get the built of arguments of a .yarnrc chain of the passed cwd
69899function buildRcArgs(cwd, args) {

Callers 2

getRcConfigForCwdFunction · 0.85
getRcConfigForFolderFunction · 0.85

Calls 4

_load_lockfileFunction · 0.85
_load_pathFunction · 0.85
matchMethod · 0.80
hasMethod · 0.80

Tested by

no test coverage detected