refactor: add license header to JS files & format files (#12081)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
d25cd244af
commit
0fde7ecd0f
@ -1,15 +1,24 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
function file2moduleName(filePath) {
|
||||
return filePath.replace(/\\/g, '/')
|
||||
// module name should be relative to `modules` and `tools` folder
|
||||
.replace(/.*\/modules\//, '')
|
||||
// and 'dist' folder
|
||||
.replace(/.*\/dist\/js\/dev\/es5\//, '')
|
||||
// module name should not include `lib`, `web` folders
|
||||
// as they are wrapper packages for dart
|
||||
.replace(/\/web\//, '/')
|
||||
.replace(/\/lib\//, '/')
|
||||
// module name should not have a suffix
|
||||
.replace(/\.\w*$/, '');
|
||||
return filePath
|
||||
.replace(/\\/g, '/')
|
||||
// module name should be relative to `modules` and `tools` folder
|
||||
.replace(/.*\/modules\//, '')
|
||||
// and 'dist' folder
|
||||
.replace(/.*\/dist\/js\/dev\/es5\//, '')
|
||||
// module name should not include `lib`, `web` folders
|
||||
// as they are wrapper packages for dart
|
||||
.replace(/\/web\//, '/')
|
||||
.replace(/\/lib\//, '/')
|
||||
// module name should not have a suffix
|
||||
.replace(/\.\w*$/, '');
|
||||
}
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = file2moduleName;
|
||||
|
Reference in New Issue
Block a user