@@ -118,7 +118,7 @@ async function build(): Promise<void> {
118
118
const prettyMethodName =
119
119
methodName . substring ( 0 , 1 ) . toUpperCase ( ) +
120
120
methodName . substring ( 1 ) . replace ( / ( [ A - Z ] + ) / g, ' $1' ) ;
121
- console . log ( `- method ${ prettyMethodName } ` ) ;
121
+ console . debug ( `- method ${ prettyMethodName } ` ) ;
122
122
const signature = method . signatures [ 0 ] ;
123
123
124
124
content += `
@@ -154,7 +154,7 @@ async function build(): Promise<void> {
154
154
` ;
155
155
156
156
// typeParameters
157
- typeParameters . forEach ( ( parameter , index ) => {
157
+ typeParameters . forEach ( ( parameter ) => {
158
158
const parameterName = parameter . name ;
159
159
160
160
signatureTypeParameters . push ( parameterName ) ;
@@ -220,10 +220,8 @@ async function build(): Promise<void> {
220
220
221
221
content += `faker.${ lowerModuleName } .${ methodName } ()` ;
222
222
content += ( example ? ` // => ${ example } ` : '' ) + '\n' ;
223
- } catch {
224
- console . log (
225
- `Failed to call: faker.${ lowerModuleName } ${ methodName } ()`
226
- ) ;
223
+ } catch ( error ) {
224
+ // Ignore the error => hide the example call + result.
227
225
}
228
226
}
229
227
const examples =
@@ -232,8 +230,7 @@ async function build(): Promise<void> {
232
230
. map ( ( tag ) => tag . text . trimEnd ( ) ) || [ ] ;
233
231
234
232
if ( examples . length !== 0 ) {
235
- console . log ( 'Example-Length:' , examples ) ;
236
- content += examples . join ( '\n' ) + '\n' ;
233
+ content += examples . join ( '\n' ) . trim ( ) + '\n' ;
237
234
}
238
235
239
236
content += '````\n\n' ;
@@ -249,10 +246,10 @@ async function build(): Promise<void> {
249
246
// Write to disk
250
247
251
248
writeFileSync ( resolve ( pathOutputDir , lowerModuleName + '.md' ) , content ) ;
252
- console . log ( `Done Module ${ moduleName } ` ) ;
253
249
}
254
250
255
251
// Write api-pages.mjs
252
+ console . log ( 'Updating api-pages.mjs' ) ;
256
253
modulesPages . sort ( ( a , b ) => a . text . localeCompare ( b . text ) ) ;
257
254
let apiPagesContent = `
258
255
// This file is automatically generated.
@@ -266,7 +263,6 @@ async function build(): Promise<void> {
266
263
} ) ;
267
264
268
265
writeFileSync ( pathDocsApiPages , apiPagesContent ) ;
269
- console . log ( 'Updated api-pages.mjs' ) ;
270
266
}
271
267
272
268
build ( ) . catch ( console . error ) ;
0 commit comments