mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
22 lines
600 B
JavaScript
22 lines
600 B
JavaScript
var MCommon = (function () {
|
|
return {
|
|
/**
|
|
* Get file extension.
|
|
*/
|
|
getExtension: function (filename, defaultExt) {
|
|
return /(?:\.([^.]+))?$/.exec(filename)[1] || defaultExt;
|
|
},
|
|
|
|
/**
|
|
* Regular expression to strip key if dictionary's "StripKey" attribute is true.
|
|
*/
|
|
REGEXP_STRIPKEY: {
|
|
'mdx' : /[()., '/\\@_-]()/g,
|
|
'mdd' : /([.][^.]*$)|[()., '/\\@_-]/g // strip '.' before file extension that is keeping the last period
|
|
},
|
|
|
|
log: function() {
|
|
console.log.apply(console, [].slice.apply(arguments));
|
|
}
|
|
};
|
|
}());
|