MCPcopy Create free account
hub / github.com/bigcommerce/stencil-cli / getLangHelpersPaths

Method getLangHelpersPaths

lib/lang/validator.js:78–91  ·  view source on GitHub ↗
(templatesPath)

Source from the content-addressed store, hash-verified

76 }
77
78 async getLangHelpersPaths(templatesPath) {
79 const files = await recursiveReadDir(templatesPath);
80 const paths = [];
81 for await (const file of files) {
82 const content = await fs.promises.readFile(file, { encoding: 'utf-8' });
83 const result = content.matchAll(LANG_HELPER_REGEXP);
84 const arr = [...result];
85 if (arr.length > 0) {
86 const langPath = arr[0][1];
87 paths.push(langPath);
88 }
89 }
90 return paths;
91 }
92
93 async getLangFilesContent(defaultLang = null) {
94 const filesContent = {};

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected