@mondaycom/apps-cli
Version:
A cli tool to manage apps (and monday-code projects) in monday.com
17 lines (16 loc) • 501 B
JavaScript
import { getAppsDomain } from '../services/env-service.js';
const appsUrlBuilder = (url) => {
const baseDomain = getAppsDomain();
const constructedUrl = new URL(url, baseDomain);
return constructedUrl.href;
};
const getLastParam = (url) => {
return url.split('/').pop() || url;
};
const addPrefixIfNotExists = (url, prefix) => {
if (url.startsWith(prefix)) {
return url;
}
return `${prefix}${url}`;
};
export { addPrefixIfNotExists, appsUrlBuilder, getLastParam };