File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -78,18 +78,19 @@ filename based on path and current time.
78
78
79
79
_ Example:_
80
80
81
- ``` js
82
- const strftime = require ( ' ultra-strftime' )
81
+ ``` ts
82
+ import strftime from ' ultra-strftime'
83
83
84
84
class MyFileTimestampStream extends FileTimestampStream {
85
- constructor (options ) {
86
- super (options)
87
- /** count how many files has been created */
88
- this .counter = 0
89
- }
90
- function newFilename () {
85
+ /** count how many files has been created */
86
+ counter = 0
87
+
88
+ // for pure Javascript explicit constructor is necessary
89
+ // constructor (options) { super(options); this.counter = 0 }
90
+
91
+ protected newFilename (): string {
91
92
const filename = strftime (this .path )
92
- if (filename !== this .currentFilename ) counter++
93
+ if (filename !== this .currentFilename ) this . counter ++
93
94
return filename
94
95
}
95
96
}
You can’t perform that action at this time.
0 commit comments