@@ -98,7 +98,6 @@ const utils = {
9898 data . bucket = bucketData . bucket ;
9999 data . endpoint = bucketData . endpoint ;
100100 data . key = bucketData . key ;
101- // data.public = bucketData.public;
102101 data . secretAccessKey = bucketData . secretAccessKey ;
103102 if ( bucketData . region ) data . region = bucketData . region ;
104103 } else if ( utils . getConfigBoolean ( 'objectStorage.enabled' ) ) {
@@ -496,7 +495,7 @@ const utils = {
496495
497496 /**
498497 * @function stripDelimit
499- * Yields a string `s` that will never have a trailing delimiter. Returns an empty string if falsy.
498+ * Yields a string `s` that will never have a trailing delimiter.
500499 * @param {string } s The input string
501500 * @returns {string } The string `s` without the trailing delimiter, or an empty string.
502501 */
@@ -505,6 +504,23 @@ const utils = {
505504 else return '' ;
506505 } ,
507506
507+ /**
508+ * @function trimResourcePath
509+ * Yields a string `s` without trailing delimiters or asterixes.
510+ * @param {string } s The input string
511+ * @returns {string } The string `s` without trailing delimiters or asterix, or an empty string.
512+ */
513+ trimResourcePath ( s ) {
514+ switch ( true ) {
515+ case s . endsWith ( DELIMITER ) :
516+ return utils . stripDelimit ( s . slice ( 0 , - 1 ) ) ;
517+ case s . endsWith ( DELIMITER + '*' ) :
518+ return utils . stripDelimit ( s . slice ( 0 , - 2 ) ) ;
519+ default :
520+ return s ;
521+ }
522+ } ,
523+
508524 /**
509525 * @function toLowerKeys
510526 * Converts all key names for all objects in an array to lowercase
0 commit comments