@@ -25,7 +25,7 @@ const writeFile = promiseify(fs.writeFile);
25
25
26
26
/**
27
27
* Inline resources in a tsc/ngc compilation.
28
- * @param projectPath { string} Path to the project.
28
+ * @param { string } projectPath Path to the project.
29
29
*/
30
30
function inlineResources ( projectPath ) {
31
31
@@ -41,17 +41,15 @@ function inlineResources(projectPath) {
41
41
return path . join ( path . dirname ( fullFilePath ) , url ) ;
42
42
} ) )
43
43
. then ( content => writeFile ( fullFilePath , content ) )
44
- . catch ( err => {
45
- console . error ( 'An error occured: ' , err ) ;
46
- } ) ;
44
+ . catch ( err => console . error ( 'An error occured: ' , err ) ) ;
47
45
} ) ) ;
48
46
}
49
47
50
48
/**
51
49
* Inline resources from a string content.
52
- * @param content { string} The source file's content.
53
- * @param urlResolver { Function} A resolver that takes a URL and return a path.
54
- * @returns { string } The content with resources inlined.
50
+ * @param { string } content The source file's content.
51
+ * @param { Function } urlResolver A resolver that takes a URL and return a path.
52
+ * @return { string } The content with resources inlined.
55
53
*/
56
54
function inlineResourcesFromString ( content , urlResolver ) {
57
55
// Curry through the inlining functions.
@@ -63,11 +61,12 @@ function inlineResourcesFromString(content, urlResolver) {
63
61
}
64
62
65
63
/**
66
- * Inline the templates for a source file. Simply search for instances of `templateUrl: ...` and
67
- * replace with `template: ...` (with the content of the file included).
68
- * @param content {string} The source file's content.
69
- * @param urlResolver {Function} A resolver that takes a URL and return a path.
70
- * @return {string } The content with all templates inlined.
64
+ * Inline the templates for a source file.
65
+ * Search for instances of `templateUrl: ...` and replace with `template: ...`
66
+ * (with the content of the file included).
67
+ * @param { string } content The source file's content.
68
+ * @param { Function } urlResolver A resolver that takes a URL and return a path.
69
+ * @return { string } The content with all templates inlined.
71
70
*/
72
71
function inlineTemplate ( content , urlResolver ) {
73
72
return content . replace ( / t e m p l a t e U r l : \s * ' ( [ ^ ' ] + ?\. h t m l ) ' / g, function ( m , templateUrl ) {
@@ -83,9 +82,9 @@ function inlineTemplate(content, urlResolver) {
83
82
/**
84
83
* Inline the styles for a source file. Search for instances of `styleUrls: [...]`
85
84
* and replace with `styles: [...]` (with the content of the file included).
86
- * @param urlResolver { Function} A resolver that takes a URL and return a path.
87
- * @param content { string} The source file's content.
88
- * @return {string } The content with all styles inlined.
85
+ * @param { Function } urlResolver A resolver that takes a URL and return a path.
86
+ * @param { string } content The source file's content.
87
+ * @return { string } The content with all styles inlined.
89
88
*/
90
89
function inlineStyle ( content , urlResolver ) {
91
90
return content . replace ( / s t y l e U r l s : \s * ( \[ [ \s \S ] * ?\] ) / gm, function ( m , styleUrls ) {
@@ -104,8 +103,8 @@ function inlineStyle(content, urlResolver) {
104
103
105
104
/**
106
105
* Remove every mention of `moduleId: module.id`.
107
- * @param content { string} The source file's content.
108
- * @returns { string } The content with all moduleId: mentions removed.
106
+ * @param { string } content The source file's content.
107
+ * @return { string } The content with all moduleId: mentions removed.
109
108
*/
110
109
function removeModuleId ( content ) {
111
110
return content . replace ( / \s * m o d u l e I d : \s * m o d u l e \. i d \s * , ? \s * / gm, '' ) ;
0 commit comments