File tree 1 file changed +3
-4
lines changed
packages/components/timed-text-editor/UpdateTimestamps
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,13 @@ function adjustTimecodesBoundaries(words) {
100
100
}
101
101
102
102
function interpolate ( wordsList ) {
103
- const words = interpolationOptimization ( wordsList ) ;
104
- const indicies = [ ...Array ( words . length ) . keys ( ) ] ;
103
+ const indicies = [ ...Array ( wordsList . length ) . keys ( ) ] ;
105
104
const indiciesWithStart = [ ] ;
106
105
const indiciesWithEnd = [ ] ;
107
106
const startTimes = [ ] ;
108
107
const endTimes = [ ] ;
109
108
110
- words . forEach ( ( word , index ) => {
109
+ wordsList . forEach ( ( word , index ) => {
111
110
if ( 'start' in word ) {
112
111
indiciesWithStart . push ( index ) ;
113
112
startTimes . push ( word . start ) ;
@@ -121,7 +120,7 @@ function interpolate(wordsList) {
121
120
// http://borischumichev.github.io/everpolate/#linear
122
121
const outStartTimes = everpolate . linear ( indicies , indiciesWithStart , startTimes ) ;
123
122
const outEndTimes = everpolate . linear ( indicies , indiciesWithEnd , endTimes ) ;
124
- const wordsResults = words . map ( ( word , index ) => {
123
+ const wordsResults = wordsList . map ( ( word , index ) => {
125
124
if ( ! ( 'start' in word ) ) {
126
125
word . start = outStartTimes [ index ] ;
127
126
}
You can’t perform that action at this time.
0 commit comments