@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 640 B
Source Map (JSON)
{"version":3,"file":"url-add-path.mjs","names":[],"sources":["../../../src/utils/helpers/url-add-path.ts"],"sourcesContent":["/**\n * Joins a path to a URL ensuring we dont add a double slash\n */\nconst urlAddPath = (url: string, path?: string): string => {\n\tconst urlNoSlash = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n\tif (!path) return urlNoSlash;\n\n\treturn `${urlNoSlash}${path.startsWith(\"/\") ? path : `/${path}`}`;\n};\n\nexport default urlAddPath;\n"],"mappings":"AAGA,MAAM,GAAc,EAAa,IAA0B,CAC1D,IAAM,EAAa,EAAI,SAAS,GAAG,EAAI,EAAI,MAAM,EAAG,EAAE,EAAI,EAG1D,OAFK,EAEE,GAAG,IAAa,EAAK,WAAW,GAAG,EAAI,EAAO,IAAI,MAFvC,CAGnB"}