MCPcopy
hub / github.com/breejs/bree / getJobPath

Function getJobPath

src/job-utils.js:117–129  ·  view source on GitHub ↗
(name, acceptedExtensions, defaultExtension)

Source from the content-addressed store, hash-verified

115 * @returns {string} job path
116 */
117const getJobPath = (name, acceptedExtensions, defaultExtension) => {
118 const extFindArray = acceptedExtensions.map((ext) => {
119 return ext.startsWith('.') ? ext : `.${ext}`;
120 });
121
122 const hasExt = extFindArray.find((ext) => name.endsWith(ext));
123
124 if (hasExt) return name;
125
126 return defaultExtension.startsWith('.')
127 ? `${name}${defaultExtension}`
128 : `${name}.${defaultExtension}`;
129};
130
131module.exports = {
132 getHumanToMs,

Callers 3

buildJobFunction · 0.85
validateStringJobFunction · 0.85
validateJobPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…