Skip to content

Commit

Permalink
possible fix of trimSlashes error on Content creation
Browse files Browse the repository at this point in the history
  • Loading branch information
VargaJoe committed Oct 12, 2023
1 parent e698fe7 commit 081ff57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sn-client-utils/src/path-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export class PathHelper {
* @param {string} path The source path that should be trimmed
*/
public static trimSlashes(path: string) {
while (path.endsWith('/')) {
while (path?.endsWith('/')) {
path = path.substring(0, path.length - 1)
}
while (path.startsWith('/')) {
while (path?.startsWith('/')) {
path = path.substring(1, path.length)
}
return path
Expand Down

0 comments on commit 081ff57

Please sign in to comment.