@pixwel/pixwel-sdk 2.1.26 → 2.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/clover.xml +445 -418
- package/coverage/coverage-final.json +14 -14
- package/coverage/lcov-report/Ass.js.html +176 -176
- package/coverage/lcov-report/Asset.js.html +4 -4
- package/coverage/lcov-report/AssetType.js.html +12 -12
- package/coverage/lcov-report/Encode.js.html +12 -12
- package/coverage/lcov-report/File.js.html +17 -17
- package/coverage/lcov-report/Filename.js.html +1 -1
- package/coverage/lcov-report/Ingest.js.html +520 -520
- package/coverage/lcov-report/IngestFile.js.html +5 -5
- package/coverage/lcov-report/Model.js.html +144 -144
- package/coverage/lcov-report/Order.js.html +33 -30
- package/coverage/lcov-report/Srt.js.html +97 -97
- package/coverage/lcov-report/Sub.js.html +35 -35
- package/coverage/lcov-report/Tag.js.html +12 -12
- package/coverage/lcov-report/TimeFormat.js.html +14 -14
- package/coverage/lcov-report/fileType.js.html +14 -14
- package/coverage/lcov-report/index.html +82 -82
- package/coverage/lcov.info +953 -852
- package/dist/src/Ingest.js +2 -2
- package/dist/src/Order.js +1 -0
- package/package.json +1 -1
- package/src/Ingest.js +2 -2
- package/src/Order.js +1 -0
- package/test/Ingest.spec.js +62 -17
- package/test/Order.spec.js +7 -1
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
23
|
<span class="strong">0% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>0/
|
|
25
|
+
<span class='fraction'>0/105</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
28
|
<span class="strong">0% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>0/
|
|
30
|
+
<span class='fraction'>0/53</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/12</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
38
|
<span class="strong">0% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>0/
|
|
40
|
+
<span class='fraction'>0/105</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
@@ -237,7 +237,20 @@
|
|
|
237
237
|
192
|
|
238
238
|
193
|
|
239
239
|
194
|
|
240
|
-
195</td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
240
|
+
195</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
241
|
+
<span class="cline-any cline-neutral"> </span>
|
|
242
|
+
<span class="cline-any cline-no"> </span>
|
|
243
|
+
<span class="cline-any cline-neutral"> </span>
|
|
244
|
+
<span class="cline-any cline-neutral"> </span>
|
|
245
|
+
<span class="cline-any cline-neutral"> </span>
|
|
246
|
+
<span class="cline-any cline-no"> </span>
|
|
247
|
+
<span class="cline-any cline-neutral"> </span>
|
|
248
|
+
<span class="cline-any cline-no"> </span>
|
|
249
|
+
<span class="cline-any cline-neutral"> </span>
|
|
250
|
+
<span class="cline-any cline-no"> </span>
|
|
251
|
+
<span class="cline-any cline-neutral"> </span>
|
|
252
|
+
<span class="cline-any cline-no"> </span>
|
|
253
|
+
<span class="cline-any cline-neutral"> </span>
|
|
241
254
|
<span class="cline-any cline-no"> </span>
|
|
242
255
|
<span class="cline-any cline-neutral"> </span>
|
|
243
256
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -258,6 +271,7 @@
|
|
|
258
271
|
<span class="cline-any cline-neutral"> </span>
|
|
259
272
|
<span class="cline-any cline-neutral"> </span>
|
|
260
273
|
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
|
261
275
|
<span class="cline-any cline-no"> </span>
|
|
262
276
|
<span class="cline-any cline-neutral"> </span>
|
|
263
277
|
<span class="cline-any cline-no"> </span>
|
|
@@ -305,7 +319,7 @@
|
|
|
305
319
|
<span class="cline-any cline-no"> </span>
|
|
306
320
|
<span class="cline-any cline-neutral"> </span>
|
|
307
321
|
<span class="cline-any cline-neutral"> </span>
|
|
308
|
-
<span class="cline-any cline-
|
|
322
|
+
<span class="cline-any cline-no"> </span>
|
|
309
323
|
<span class="cline-any cline-neutral"> </span>
|
|
310
324
|
<span class="cline-any cline-neutral"> </span>
|
|
311
325
|
<span class="cline-any cline-no"> </span>
|
|
@@ -319,7 +333,6 @@
|
|
|
319
333
|
<span class="cline-any cline-neutral"> </span>
|
|
320
334
|
<span class="cline-any cline-neutral"> </span>
|
|
321
335
|
<span class="cline-any cline-no"> </span>
|
|
322
|
-
<span class="cline-any cline-neutral"> </span>
|
|
323
336
|
<span class="cline-any cline-no"> </span>
|
|
324
337
|
<span class="cline-any cline-neutral"> </span>
|
|
325
338
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -411,14 +424,6 @@
|
|
|
411
424
|
<span class="cline-any cline-no"> </span>
|
|
412
425
|
<span class="cline-any cline-neutral"> </span>
|
|
413
426
|
<span class="cline-any cline-neutral"> </span>
|
|
414
|
-
<span class="cline-any cline-neutral"> </span>
|
|
415
|
-
<span class="cline-any cline-neutral"> </span>
|
|
416
|
-
<span class="cline-any cline-neutral"> </span>
|
|
417
|
-
<span class="cline-any cline-neutral"> </span>
|
|
418
|
-
<span class="cline-any cline-neutral"> </span>
|
|
419
|
-
<span class="cline-any cline-neutral"> </span>
|
|
420
|
-
<span class="cline-any cline-neutral"> </span>
|
|
421
|
-
<span class="cline-any cline-neutral"> </span>
|
|
422
427
|
<span class="cline-any cline-no"> </span>
|
|
423
428
|
<span class="cline-any cline-no"> </span>
|
|
424
429
|
<span class="cline-any cline-no"> </span>
|
|
@@ -426,212 +431,207 @@
|
|
|
426
431
|
<span class="cline-any cline-no"> </span>
|
|
427
432
|
<span class="cline-any cline-no"> </span>
|
|
428
433
|
<span class="cline-any cline-no"> </span>
|
|
429
|
-
<span class="cline-any cline-no"> </span>
|
|
430
|
-
|
|
431
|
-
<span class="
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" >import _ from 'lodash';</span>
|
|
435
|
-
<span class="cstat-no" title="statement not covered" >import TimeFormat from './TimeFormat';</span>
|
|
436
|
-
|
|
437
|
-
function <span class="fstat-no" title="function not covered" >trim(str) {</span>
|
|
438
|
-
<span class="cstat-no" title="statement not covered" > return str.replace(/^\s+|\s+$/g, '');</span>
|
|
434
|
+
<span class="cline-any cline-no"> </span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash';
|
|
435
|
+
import TimeFormat from './TimeFormat';
|
|
436
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
437
|
+
function trim(str) {
|
|
438
|
+
return str.replace(/^\s+|\s+$/g, '');
|
|
439
439
|
}
|
|
440
|
-
|
|
441
|
-
function
|
|
442
|
-
var len = <span class="cstat-no" title="statement not covered" >
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
440
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
441
|
+
function searchIndex(lines, pattern, startIndex) {
|
|
442
|
+
var len = l<span class="cstat-no" title="statement not covered" >ines.length;</span>
|
|
443
|
+
startIndex = startIndex || 0;
|
|
444
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
445
|
+
for (var i = startIndex; i < len; i++) {
|
|
446
446
|
var line = <span class="cstat-no" title="statement not covered" >lines[i];</span>
|
|
447
|
-
|
|
448
|
-
<span class="
|
|
447
|
+
if (line.match(pattern)) {
|
|
448
|
+
<span class="fstat-no" title="function not covered" > return i;<span class="cstat-no" title="statement not covered" ></span></span>
|
|
449
449
|
}
|
|
450
|
-
}
|
|
450
|
+
}<span class="fstat-no" title="function not covered" ></span>
|
|
451
451
|
<span class="cstat-no" title="statement not covered" > return false;</span>
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
function <span class="fstat-no" title="function not covered" >
|
|
455
|
-
var line,
|
|
456
|
-
|
|
457
|
-
var currentIndex =
|
|
458
|
-
|
|
459
|
-
<span class="cstat-no" title="statement not covered" >
|
|
454
|
+
function <span class="fstat-no" title="function not covered" >extractStyle</span>s(lines) {
|
|
455
|
+
var line, <span class="cstat-no" title="statement not covered" >styles = {};</span>
|
|
456
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
457
|
+
var currentIndex = searchIndex(lines, /^\[V4\+ Styles\]$/);
|
|
458
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
459
|
+
if (currentInde<span class="cstat-no" title="statement not covered" >x === fal</span>se) {
|
|
460
460
|
<span class="cstat-no" title="statement not covered" > return styles;</span>
|
|
461
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
462
|
+
|
|
463
|
+
currentIndex = searchIndex(lines, /^Format:/, ++currentIndex);
|
|
464
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
465
|
+
if (currentIndex === false) {
|
|
466
|
+
return styles;
|
|
467
|
+
}<span class="fstat-no" title="function not covered" ></span>
|
|
468
|
+
|
|
469
|
+
line = trim(l<span class="cstat-no" title="statement not covered" >ine</span>s[currentIndex]);
|
|
470
|
+
var fields = line.replace(/^Format:\s+/, '').split(/\s*,\s*/);
|
|
471
|
+
var nameIndex = fie<span class="cstat-no" title="statement not covered" >lds.indexOf('Name');</span>
|
|
472
|
+
var alignmentIndex = fields.indexOf('Alignment');
|
|
473
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
474
|
+
if (<span class="cstat-no" title="statement not covered" >nameIndex === -</span>1) {
|
|
475
|
+
return styles;
|
|
461
476
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
<span class="cstat-no" title="statement not covered" >
|
|
466
|
-
|
|
477
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
478
|
+
var pattern = new RegExp('^' + (new Array(fields.length).join('\s*(.*?)\s*,')) + '(.*?)$');
|
|
479
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
480
|
+
curr<span class="cstat-no" title="statement not covered" >entIndex = sear</span>chIndex(lines, /^Style:/, ++currentIndex);
|
|
481
|
+
|
|
482
|
+
while (currentIndex !== false) {
|
|
483
|
+
<span class="cstat-no" title="statement not covered" > line = trim(lines[currentIndex</span>]);
|
|
484
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
485
|
+
var parts = <span class="cstat-no" title="statement not covered" >line.replace(/^Style:\s</span>+/, '').match(pattern);
|
|
486
|
+
if (!parts) {<span class="cstat-no" title="statement not covered" ></span>
|
|
487
|
+
throw new Error('Error, missing fields in a `Style` entry');
|
|
488
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
489
|
+
<span class="cstat-no" title="statement not covered" > if (parts.lengt</span>h) {
|
|
490
|
+
var style = {};
|
|
491
|
+
if (alignmentIndex !== -1) {
|
|
492
|
+
va<span class="cstat-no" title="statement not covered" >r alignmentNumber = parts[alignmentIndex + 1];</span>
|
|
493
|
+
style.alignment = alignmentNumber >= 7 ? 'top' : 'bottom';
|
|
494
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
495
|
+
styles[parts[nameIndex + 1]] = style;
|
|
496
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
497
|
+
<span class="cstat-no" title="statement not covered" > currentIndex = searchIndex(lines, </span>/^Style:/, ++currentIndex);
|
|
467
498
|
}
|
|
468
|
-
|
|
469
|
-
<span class="cstat-no" title="statement not covered"
|
|
470
|
-
|
|
471
|
-
var nameIndex = <span class="cstat-no" title="statement not covered" >fields.indexOf('Name');</span>
|
|
472
|
-
var alignmentIndex = <span class="cstat-no" title="statement not covered" >fields.indexOf('Alignment');</span>
|
|
473
|
-
|
|
474
|
-
<span class="cstat-no" title="statement not covered" > if (nameIndex === -1) {</span>
|
|
475
|
-
<span class="cstat-no" title="statement not covered" > return styles;</span>
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
var pattern = <span class="cstat-no" title="statement not covered" >new RegExp('^' + (new Array(fields.length).join('\s*(.*?)\s*,')) + '(.*?)$');</span>
|
|
479
|
-
|
|
480
|
-
<span class="cstat-no" title="statement not covered" > currentIndex = searchIndex(lines, /^Style:/, ++currentIndex);</span>
|
|
481
|
-
|
|
482
|
-
<span class="cstat-no" title="statement not covered" > while (currentIndex !== false) {</span>
|
|
483
|
-
<span class="cstat-no" title="statement not covered" > line = trim(lines[currentIndex]);</span>
|
|
484
|
-
|
|
485
|
-
var parts = <span class="cstat-no" title="statement not covered" >line.replace(/^Style:\s+/, '').match(pattern);</span>
|
|
486
|
-
<span class="cstat-no" title="statement not covered" > if (!parts) {</span>
|
|
487
|
-
<span class="cstat-no" title="statement not covered" > throw new Error('Error, missing fields in a `Style` entry');</span>
|
|
488
|
-
}
|
|
489
|
-
<span class="cstat-no" title="statement not covered" > if (parts.length) {</span>
|
|
490
|
-
var style = <span class="cstat-no" title="statement not covered" >{};</span>
|
|
491
|
-
<span class="cstat-no" title="statement not covered" > if (alignmentIndex !== -1) {</span>
|
|
492
|
-
var alignmentNumber = <span class="cstat-no" title="statement not covered" >parts[alignmentIndex + 1];</span>
|
|
493
|
-
<span class="cstat-no" title="statement not covered" > style.alignment = alignmentNumber >= 7 ? 'top' : 'bottom';</span>
|
|
494
|
-
}
|
|
495
|
-
<span class="cstat-no" title="statement not covered" > styles[parts[nameIndex + 1]] = style;</span>
|
|
496
|
-
}
|
|
497
|
-
<span class="cstat-no" title="statement not covered" > currentIndex = searchIndex(lines, /^Style:/, ++currentIndex);</span>
|
|
498
|
-
}
|
|
499
|
-
<span class="cstat-no" title="statement not covered" > return styles;</span>
|
|
500
|
-
}
|
|
501
|
-
|
|
499
|
+
return styles;<span class="cstat-no" title="statement not covered" ></span>
|
|
500
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
501
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
502
502
|
export default {
|
|
503
|
-
|
|
504
|
-
var line
|
|
505
|
-
var
|
|
506
|
-
|
|
507
|
-
function
|
|
508
|
-
|
|
503
|
+
pars<span class="cstat-no" title="statement not covered" >e: function(lines) {</span>
|
|
504
|
+
var line;<span class="cstat-no" title="statement not covered" ></span>
|
|
505
|
+
var <span class="cstat-no" title="statement not covered" >currentIndex = 0;</span>
|
|
506
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
507
|
+
function<span class="cstat-no" title="statement not covered" > normalizeTime(time) {</span>
|
|
508
|
+
if (time.charAt(1) === ':') {
|
|
509
509
|
<span class="cstat-no" title="statement not covered" > time = '0' + time;</span>
|
|
510
510
|
}
|
|
511
511
|
<span class="cstat-no" title="statement not covered" > return time.replace('.', ',') + '0';</span>
|
|
512
512
|
}
|
|
513
|
-
|
|
514
|
-
function
|
|
515
|
-
|
|
516
|
-
.replace(/{\\(.*)1}(.*){\\\1[0]}/g,
|
|
517
|
-
<span class="
|
|
513
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
514
|
+
function normalizeText(text) {
|
|
515
|
+
return text.replace(/\\n|\\N/, '\n')
|
|
516
|
+
<span class="cstat-no" title="statement not covered" > .replace(/{\\(.*)1}(.*){\\\1[0]}/g, function(match, tag, content) {</span>
|
|
517
|
+
<span class="fstat-no" title="function not covered" > return</span> '<' + tag + '>' + content + '</' + tag + '>';
|
|
518
518
|
});
|
|
519
|
-
}
|
|
519
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
520
520
|
|
|
521
|
-
var
|
|
521
|
+
var style<span class="fstat-no" title="function not covered" >s = extractSty</span>les(lines);
|
|
522
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
523
|
+
currentI<span class="cstat-no" title="statement not covered" >ndex = searchIndex(</span>lines, /^\[Events\]$/);
|
|
522
524
|
|
|
523
|
-
<span class="cstat-no" title="statement not covered" >
|
|
524
|
-
|
|
525
|
-
<span class="cstat-no" title="statement not covered" > if (currentIndex === false) {</span>
|
|
526
|
-
<span class="cstat-no" title="statement not covered" > throw new Error('Error, missing `[Events]` section');</span>
|
|
525
|
+
if (<span class="cstat-no" title="statement not covered" >currentIndex === false) {</span>
|
|
526
|
+
throw new Error('Error, missing `[Events]` section');
|
|
527
527
|
}
|
|
528
|
-
|
|
529
|
-
<span class="cstat-no" title="statement not covered" >
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
528
|
+
<span class="fstat-no" title="function not covered" ></span>
|
|
529
|
+
curr<span class="cstat-no" title="statement not covered" >entIndex = searchIndex(lines, /^Format:/, ++currentIndex);<span class="fstat-no" title="function not covered" ></span></span>
|
|
530
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
531
|
+
if (currentIndex === false) {
|
|
532
|
+
throw new Error('Error, missing `Format` entry');
|
|
533
533
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var startIndex =
|
|
538
|
-
|
|
539
|
-
var
|
|
540
|
-
var textIndex =
|
|
534
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
535
|
+
line = trim(lines[currentIndex]);
|
|
536
|
+
<span class="cstat-no" title="statement not covered" > var fields = line.replace(/^Format:\s+/, '').split(</span>/\s*,\s*/);
|
|
537
|
+
var startIndex = fields.indexOf('Start');
|
|
538
|
+
<span class="cstat-no" title="statement not covered" > var endIndex = fields.indexOf('End');</span>
|
|
539
|
+
var <span class="cstat-no" title="statement not covered" >styleIndex = fields.indexOf('Style');</span>
|
|
540
|
+
var textIndex = fields.indexOf('Text');
|
|
541
541
|
|
|
542
542
|
<span class="cstat-no" title="statement not covered" > if (startIndex === -1 || endIndex === -1 || textIndex === -1) {</span>
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
var result =
|
|
547
|
-
var pattern =
|
|
548
|
-
|
|
549
|
-
<span class="cstat-no" title="statement not covered"
|
|
550
|
-
|
|
551
|
-
<span class="cstat-no" title="statement not covered" >
|
|
552
|
-
<span class="cstat-no" title="statement not covered" >
|
|
553
|
-
var parts = <span class="cstat-no" title="statement not covered" >line.replace(/^Dialogue
|
|
554
|
-
|
|
543
|
+
throw new Error('Error, missing fields in a `Format` entry');
|
|
544
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
545
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
546
|
+
var result = [];
|
|
547
|
+
var pattern = new RegExp('^' + (new Array(fields.length).join('\s*(.*?)\s*,')) + '(.*?)$');
|
|
548
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
549
|
+
currentIndex <span class="cstat-no" title="statement not covered" >= searchIndex(lines, /^Dialogue:/, ++currentIndex</span>);
|
|
550
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
551
|
+
while (currentI<span class="cstat-no" title="statement not covered" >ndex !== false) {</span>
|
|
552
|
+
line = trim(l<span class="cstat-no" title="statement not covered" >ines[currentIndex]);</span>
|
|
553
|
+
var parts = <span class="cstat-no" title="statement not covered" >line.replace(/^Dialogue</span>:\s+/, '').match(pattern);
|
|
554
|
+
if (!parts) {
|
|
555
555
|
<span class="cstat-no" title="statement not covered" > throw new Error('Error, missing fields in a `Dialogue` entry');</span>
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
var entry =
|
|
559
|
-
|
|
560
|
-
|
|
556
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
557
|
+
if (parts.length) {
|
|
558
|
+
var entry = {
|
|
559
|
+
s<span class="cstat-no" title="statement not covered" >tar</span>tTime: normalizeTime(parts[startIndex + 1]),
|
|
560
|
+
st<span class="cstat-no" title="statement not covered" >opTime: normalizeTime(parts[endIndex + 1]),</span>
|
|
561
561
|
text: normalizeText(parts[textIndex + 1]),
|
|
562
|
-
alignment: 'bottom'
|
|
562
|
+
<span class="cstat-no" title="statement not covered" > alignment: 'bottom'</span>
|
|
563
563
|
};
|
|
564
564
|
<span class="cstat-no" title="statement not covered" > if (styleIndex !== -1) {</span>
|
|
565
|
-
|
|
566
|
-
<span class="cstat-no" title="statement not covered" >
|
|
565
|
+
<span class="cstat-no" title="statement not covered" > var style = styles[parts[s</span>tyleIndex + 1]];
|
|
566
|
+
if (<span class="cstat-no" title="statement not covered" >style && style.alignment) {</span>
|
|
567
567
|
<span class="cstat-no" title="statement not covered" > entry.alignment = style.alignment;</span>
|
|
568
|
-
}
|
|
568
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
569
569
|
}
|
|
570
570
|
<span class="cstat-no" title="statement not covered" > result.push(entry);</span>
|
|
571
|
-
}
|
|
572
|
-
|
|
571
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
572
|
+
currentIndex = searchIndex(lines, /^Dialogue:/, ++currentIndex);
|
|
573
573
|
}
|
|
574
|
-
|
|
574
|
+
return result;
|
|
575
575
|
},
|
|
576
|
-
export:
|
|
577
|
-
var
|
|
578
|
-
|
|
579
|
-
<span class="cstat-no" title="statement not covered" >
|
|
580
|
-
|
|
581
|
-
var font =
|
|
576
|
+
export: function(lines, options) {
|
|
577
|
+
var resu<span class="cstat-no" title="statement not covered" >lt = '';</span>
|
|
578
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
579
|
+
options = op<span class="cstat-no" title="statement not covered" >tions || {};</span>
|
|
580
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
581
|
+
var font = options.font || {
|
|
582
582
|
face: 'Arial',
|
|
583
|
-
size
|
|
583
|
+
size<span class="cstat-no" title="statement not covered" >: 20</span>
|
|
584
584
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
<span class="cstat-no" title="statement not covered" > result += "
|
|
588
|
-
|
|
589
|
-
<span class="
|
|
590
|
-
<span class="cstat-no" title="statement not covered" >
|
|
591
|
-
|
|
592
|
-
<span class="cstat-no" title="statement not covered" > result += "Style: Top,"
|
|
593
|
-
|
|
594
|
-
<span class="cstat-no" title="statement not covered" >
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
function
|
|
598
|
-
|
|
599
|
-
<span class="cstat-no" title="statement not covered" > time = time.substr(1)
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
|
|
585
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
586
|
+
result += "[Script Info]\n";
|
|
587
|
+
<span class="cstat-no" title="statement not covered" > result += "Scri</span>ptType: v4.00+\n\n";
|
|
588
|
+
|
|
589
|
+
result += "[V<span class="fstat-no" title="function not covered" >4+ Style</span>s]\n";
|
|
590
|
+
result += "Fo<span class="cstat-no" title="statement not covered" >rma</span>t: Name, Fontname, Fontsize, PrimaryColour,Shadow,MarginV,Alignment\n";
|
|
591
|
+
result += "Style: Bottom," + font.face + "," + font.size + ",&H00FFFFFF,1,20,2\n";
|
|
592
|
+
<span class="cstat-no" title="statement not covered" > result += "Style: Top," +</span> font.face + "," + font.size + ",&H00FFFFFF,1,20,8\n\n";
|
|
593
|
+
|
|
594
|
+
result += "<span class="cstat-no" title="statement not covered" >[Events]\n";</span>
|
|
595
|
+
result += "Format: Layer, Start, End, Style, Text\n";
|
|
596
|
+
|
|
597
|
+
function normalizeTime(time) {
|
|
598
|
+
if (time.charAt(0) === '0') {
|
|
599
|
+
<span class="cstat-no" title="statement not covered" > time = time.substr(1)</span>;
|
|
600
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
601
|
+
return time.replace(',', '.').slice(0, -1);
|
|
602
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
603
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
604
|
+
<span class="cstat-no" title="statement not covered" > function normalizeText(text) {</span>
|
|
605
605
|
<span class="cstat-no" title="statement not covered" > return _.unescape(text</span>
|
|
606
606
|
.replace(/<div>/g, '\\N')
|
|
607
|
-
.replace(/<\/div
|
|
608
|
-
.replace(/\n/g, '\\N')
|
|
607
|
+
<span class="cstat-no" title="statement not covered" > .replace(/<\/div</span>>/g, '')
|
|
608
|
+
<span class="cstat-no" title="statement not covered" > .replace(/\n/g, '\\N')</span>
|
|
609
609
|
.replace(/<br>/g, '\\N')
|
|
610
|
-
|
|
611
|
-
.replace(/<\/i>/g, '{\\i0}')
|
|
612
|
-
.replace(/<b>/g, '{\\b1}')
|
|
610
|
+
.<span class="fstat-no" title="function not covered" >replace(/<i>/g</span>, '{\\i1}')
|
|
611
|
+
<span class="cstat-no" title="statement not covered" > .replace(/<\/i>/g, '{\\i0}')</span>
|
|
612
|
+
<span class="cstat-no" title="statement not covered" > .replace(/<b>/g, '{\\b1</span>}')
|
|
613
613
|
.replace(/<\/b>/g, '{\\b0}'))
|
|
614
|
-
}
|
|
614
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
615
615
|
|
|
616
|
-
|
|
617
|
-
<span class="
|
|
616
|
+
lines.forEach(function(line) {
|
|
617
|
+
if (l<span class="fstat-no" title="function not covered" >ine.text === u</span>ndefined) {
|
|
618
618
|
<span class="cstat-no" title="statement not covered" > return;</span>
|
|
619
619
|
}
|
|
620
|
-
|
|
621
|
-
<span class="cstat-no" title="statement not covered" > result += "
|
|
620
|
+
result += "Dialogue: 0";
|
|
621
|
+
<span class="cstat-no" title="statement not covered" > result += <span class="fstat-no" title="function not covered" >",</span>" + normalizeTime(TimeFormat.startTime(line));</span>
|
|
622
622
|
<span class="cstat-no" title="statement not covered" > result += "," + normalizeTime(TimeFormat.stopTime(line));</span>
|
|
623
|
-
<span class="cstat-no" title="statement not covered" >
|
|
624
|
-
|
|
625
|
-
})
|
|
626
|
-
<span class="cstat-no" title="statement not covered" >
|
|
627
|
-
}
|
|
628
|
-
}
|
|
623
|
+
resu<span class="cstat-no" title="statement not covered" >lt += li</span>ne.alignment === 'top' ? ",Top" : ",Bottom";
|
|
624
|
+
result += "," + normalizeText(line.text) + "\n";
|
|
625
|
+
});<span class="cstat-no" title="statement not covered" ></span>
|
|
626
|
+
retu<span class="cstat-no" title="statement not covered" >rn result;</span>
|
|
627
|
+
}<span class="cstat-no" title="statement not covered" ></span>
|
|
628
|
+
};<span class="cstat-no" title="statement not covered" ></span></pre></td></tr>
|
|
629
629
|
</table></pre>
|
|
630
630
|
<div class='push'></div><!-- for sticky footer -->
|
|
631
631
|
</div><!-- /wrapper -->
|
|
632
632
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
633
633
|
Code coverage
|
|
634
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
634
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Nov 12 2019 10:11:27 GMT-0600 (Central Standard Time)
|
|
635
635
|
</div>
|
|
636
636
|
</div>
|
|
637
637
|
<script src="prettify.js"></script>
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
<span class='fraction'>0/8</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/1</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
38
|
<span class="strong">0% </span>
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
<span class="cline-any cline-neutral"> </span>
|
|
85
85
|
<span class="cline-any cline-neutral"> </span>
|
|
86
86
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">export default class Asset {
|
|
87
|
-
|
|
87
|
+
<span class="fstat-no" title="function not covered" > st</span>atic mapFromOrder(order) {
|
|
88
88
|
<span class="cstat-no" title="statement not covered" > if (!order) {</span>
|
|
89
89
|
<span class="cstat-no" title="statement not covered" > throw new Error("missing order");</span>
|
|
90
90
|
}
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</div><!-- /wrapper -->
|
|
110
110
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
111
111
|
Code coverage
|
|
112
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
112
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Nov 12 2019 10:11:27 GMT-0600 (Central Standard Time)
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
115
|
<script src="prettify.js"></script>
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
23
|
<span class="strong">0% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>0/
|
|
25
|
+
<span class='fraction'>0/3</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">100% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>0/
|
|
30
|
+
<span class='fraction'>0/0</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/2</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
38
|
<span class="strong">0% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>0/
|
|
40
|
+
<span class='fraction'>0/3</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
@@ -54,25 +54,25 @@
|
|
|
54
54
|
9
|
|
55
55
|
10
|
|
56
56
|
11
|
|
57
|
-
12</td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
57
|
+
12</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
58
58
|
<span class="cline-any cline-neutral"> </span>
|
|
59
59
|
<span class="cline-any cline-neutral"> </span>
|
|
60
|
-
<span class="cline-any cline-no"> </span>
|
|
61
60
|
<span class="cline-any cline-neutral"> </span>
|
|
62
61
|
<span class="cline-any cline-no"> </span>
|
|
62
|
+
<span class="cline-any cline-no"> </span>
|
|
63
63
|
<span class="cline-any cline-neutral"> </span>
|
|
64
64
|
<span class="cline-any cline-neutral"> </span>
|
|
65
65
|
<span class="cline-any cline-no"> </span>
|
|
66
66
|
<span class="cline-any cline-neutral"> </span>
|
|
67
67
|
<span class="cline-any cline-neutral"> </span>
|
|
68
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"
|
|
68
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import Model from "./Model";
|
|
69
69
|
|
|
70
70
|
export default class AssetType extends Model {
|
|
71
|
-
<span class="fstat-no" title="function not covered" >
|
|
72
|
-
super(data)
|
|
71
|
+
<span class="fstat-no" title="function not covered" > co</span>nstructor(data) {
|
|
72
|
+
<span class="cstat-no" title="statement not covered" > super(data);</span>
|
|
73
73
|
<span class="cstat-no" title="statement not covered" > this._resource = 'assettypes';</span>
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
<span class="fstat-no" title="function not covered" > st</span>atic get _resource() {
|
|
76
76
|
<span class="cstat-no" title="statement not covered" > return 'assettypes';</span>
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -82,7 +82,7 @@ export default class AssetType extends Model {
|
|
|
82
82
|
</div><!-- /wrapper -->
|
|
83
83
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
84
84
|
Code coverage
|
|
85
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
85
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Nov 12 2019 10:11:27 GMT-0600 (Central Standard Time)
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
<script src="prettify.js"></script>
|