prvi
This commit is contained in:
24
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/path/normalize.js
vendored
Normal file
24
EveryThing/wwwroot/vendor/libs/cldrjs/dist/.build/path/normalize.js
vendored
Normal 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( "/" );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user