This commit is contained in:
David Štaleker
2025-07-18 05:33:16 +02:00
parent 401a367e5d
commit db0cc8d3de
14776 changed files with 9251484 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
var pathNormalize = function( path, attributes ) {
if ( arrayIsArray( path ) ) {
path = path.join( "/" );
}
if ( typeof path !== "string" ) {
throw new Error( "invalid path \"" + path + "\"" );
}
// 1: Ignore leading slash `/`
// 2: Ignore leading `cldr/`
path = path
.replace( /^\// , "" ) /* 1 */
.replace( /^cldr\// , "" ); /* 2 */
// Replace {attribute}'s
path = path.replace( /{[a-zA-Z]+}/g, function( name ) {
name = name.replace( /^{([^}]*)}$/, "$1" );
return attributes[ name ];
});
return path.split( "/" );
};