@pixwel/pixwel-sdk 2.1.40 → 2.1.42
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/dist/index.js +5 -5
- package/dist/src/Ass.js +153 -153
- package/dist/src/Asset.js +25 -25
- package/dist/src/AssetType.js +9 -9
- package/dist/src/Encode.js +9 -9
- package/dist/src/File.js +9 -9
- package/dist/src/Filename.js +4 -4
- package/dist/src/Ingest.js +2532 -2380
- package/dist/src/IngestFile.js +6 -6
- package/dist/src/Model.js +129 -129
- package/dist/src/Order.js +35 -35
- package/dist/src/Srt.js +68 -68
- package/dist/src/Sub.js +35 -35
- package/dist/src/Tag.js +9 -9
- package/dist/src/TimeFormat.js +43 -43
- package/dist/src/fileType.js +22 -22
- package/package.json +3 -3
- package/src/Ingest.js +114 -88
- package/test/Ingest.spec.js +21 -0
- package/update-sdk.sh +3 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var path = '/Users/jeff/www/
|
|
5
|
-
hash = '
|
|
3
|
+
var cov_gpod5ngfj = function () {
|
|
4
|
+
var path = '/Users/jeff/www/platform-x4/pixwel-sdk/index.js',
|
|
5
|
+
hash = '1ade1100b4129fca3b2ec9d62f74753c19b477a4',
|
|
6
6
|
Function = function () {}.constructor,
|
|
7
7
|
global = new Function('return this')(),
|
|
8
8
|
gcv = '__coverage__',
|
|
9
9
|
coverageData = {
|
|
10
|
-
path: '/Users/jeff/www/
|
|
10
|
+
path: '/Users/jeff/www/platform-x4/pixwel-sdk/index.js',
|
|
11
11
|
statementMap: {
|
|
12
12
|
'0': {
|
|
13
13
|
start: {
|
|
@@ -144,7 +144,7 @@ Object.defineProperty(exports, 'TimeFormat', {
|
|
|
144
144
|
|
|
145
145
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
146
146
|
|
|
147
|
-
var Pixwel = exports.Pixwel = (
|
|
147
|
+
var Pixwel = exports.Pixwel = (cov_gpod5ngfj.s[0]++, {
|
|
148
148
|
credentials: {
|
|
149
149
|
token: null
|
|
150
150
|
},
|
package/dist/src/Ass.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var path = '/Users/jeff/www/
|
|
5
|
-
hash = '
|
|
3
|
+
var cov_1cpy3i283b = function () {
|
|
4
|
+
var path = '/Users/jeff/www/platform-x4/pixwel-sdk/src/Ass.js',
|
|
5
|
+
hash = 'ca1f826571506e5960ca20ecd1faed78b82ab197',
|
|
6
6
|
Function = function () {}.constructor,
|
|
7
7
|
global = new Function('return this')(),
|
|
8
8
|
gcv = '__coverage__',
|
|
9
9
|
coverageData = {
|
|
10
|
-
path: '/Users/jeff/www/
|
|
10
|
+
path: '/Users/jeff/www/platform-x4/pixwel-sdk/src/Ass.js',
|
|
11
11
|
statementMap: {
|
|
12
12
|
'0': {
|
|
13
13
|
start: {
|
|
@@ -2225,351 +2225,351 @@ var _TimeFormat2 = _interopRequireDefault(_TimeFormat);
|
|
|
2225
2225
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2226
2226
|
|
|
2227
2227
|
function trim(str) {
|
|
2228
|
-
|
|
2229
|
-
|
|
2228
|
+
cov_1cpy3i283b.f[0]++;
|
|
2229
|
+
cov_1cpy3i283b.s[0]++;
|
|
2230
2230
|
|
|
2231
2231
|
return str.replace(/^\s+|\s+$/g, '');
|
|
2232
2232
|
}
|
|
2233
2233
|
|
|
2234
2234
|
function searchIndex(lines, pattern, startIndex) {
|
|
2235
|
-
|
|
2235
|
+
cov_1cpy3i283b.f[1]++;
|
|
2236
2236
|
|
|
2237
|
-
var len = (
|
|
2238
|
-
|
|
2239
|
-
startIndex = (
|
|
2237
|
+
var len = (cov_1cpy3i283b.s[1]++, lines.length);
|
|
2238
|
+
cov_1cpy3i283b.s[2]++;
|
|
2239
|
+
startIndex = (cov_1cpy3i283b.b[0][0]++, startIndex) || (cov_1cpy3i283b.b[0][1]++, 0);
|
|
2240
2240
|
|
|
2241
|
-
|
|
2241
|
+
cov_1cpy3i283b.s[3]++;
|
|
2242
2242
|
for (var i = startIndex; i < len; i++) {
|
|
2243
|
-
var line = (
|
|
2244
|
-
|
|
2243
|
+
var line = (cov_1cpy3i283b.s[4]++, lines[i]);
|
|
2244
|
+
cov_1cpy3i283b.s[5]++;
|
|
2245
2245
|
if (line.match(pattern)) {
|
|
2246
|
-
|
|
2247
|
-
|
|
2246
|
+
cov_1cpy3i283b.b[1][0]++;
|
|
2247
|
+
cov_1cpy3i283b.s[6]++;
|
|
2248
2248
|
|
|
2249
2249
|
return i;
|
|
2250
2250
|
} else {
|
|
2251
|
-
|
|
2251
|
+
cov_1cpy3i283b.b[1][1]++;
|
|
2252
2252
|
}
|
|
2253
2253
|
}
|
|
2254
|
-
|
|
2254
|
+
cov_1cpy3i283b.s[7]++;
|
|
2255
2255
|
return false;
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
2258
2258
|
function extractStyles(lines) {
|
|
2259
|
-
|
|
2259
|
+
cov_1cpy3i283b.f[2]++;
|
|
2260
2260
|
|
|
2261
2261
|
var line,
|
|
2262
|
-
styles = (
|
|
2262
|
+
styles = (cov_1cpy3i283b.s[8]++, {});
|
|
2263
2263
|
|
|
2264
|
-
var currentIndex = (
|
|
2264
|
+
var currentIndex = (cov_1cpy3i283b.s[9]++, searchIndex(lines, /^\[V4\+ Styles\]$/));
|
|
2265
2265
|
|
|
2266
|
-
|
|
2266
|
+
cov_1cpy3i283b.s[10]++;
|
|
2267
2267
|
if (currentIndex === false) {
|
|
2268
|
-
|
|
2269
|
-
|
|
2268
|
+
cov_1cpy3i283b.b[2][0]++;
|
|
2269
|
+
cov_1cpy3i283b.s[11]++;
|
|
2270
2270
|
|
|
2271
2271
|
return styles;
|
|
2272
2272
|
} else {
|
|
2273
|
-
|
|
2273
|
+
cov_1cpy3i283b.b[2][1]++;
|
|
2274
2274
|
}
|
|
2275
2275
|
|
|
2276
|
-
|
|
2276
|
+
cov_1cpy3i283b.s[12]++;
|
|
2277
2277
|
currentIndex = searchIndex(lines, /^Format:/, ++currentIndex);
|
|
2278
2278
|
|
|
2279
|
-
|
|
2279
|
+
cov_1cpy3i283b.s[13]++;
|
|
2280
2280
|
if (currentIndex === false) {
|
|
2281
|
-
|
|
2282
|
-
|
|
2281
|
+
cov_1cpy3i283b.b[3][0]++;
|
|
2282
|
+
cov_1cpy3i283b.s[14]++;
|
|
2283
2283
|
|
|
2284
2284
|
return styles;
|
|
2285
2285
|
} else {
|
|
2286
|
-
|
|
2286
|
+
cov_1cpy3i283b.b[3][1]++;
|
|
2287
2287
|
}
|
|
2288
2288
|
|
|
2289
|
-
|
|
2289
|
+
cov_1cpy3i283b.s[15]++;
|
|
2290
2290
|
line = trim(lines[currentIndex]);
|
|
2291
|
-
var fields = (
|
|
2292
|
-
var nameIndex = (
|
|
2293
|
-
var alignmentIndex = (
|
|
2291
|
+
var fields = (cov_1cpy3i283b.s[16]++, line.replace(/^Format:\s+/, '').split(/\s*,\s*/));
|
|
2292
|
+
var nameIndex = (cov_1cpy3i283b.s[17]++, fields.indexOf('Name'));
|
|
2293
|
+
var alignmentIndex = (cov_1cpy3i283b.s[18]++, fields.indexOf('Alignment'));
|
|
2294
2294
|
|
|
2295
|
-
|
|
2295
|
+
cov_1cpy3i283b.s[19]++;
|
|
2296
2296
|
if (nameIndex === -1) {
|
|
2297
|
-
|
|
2298
|
-
|
|
2297
|
+
cov_1cpy3i283b.b[4][0]++;
|
|
2298
|
+
cov_1cpy3i283b.s[20]++;
|
|
2299
2299
|
|
|
2300
2300
|
return styles;
|
|
2301
2301
|
} else {
|
|
2302
|
-
|
|
2302
|
+
cov_1cpy3i283b.b[4][1]++;
|
|
2303
2303
|
}
|
|
2304
2304
|
|
|
2305
|
-
var pattern = (
|
|
2305
|
+
var pattern = (cov_1cpy3i283b.s[21]++, new RegExp('^' + new Array(fields.length).join('\s*(.*?)\s*,') + '(.*?)$'));
|
|
2306
2306
|
|
|
2307
|
-
|
|
2307
|
+
cov_1cpy3i283b.s[22]++;
|
|
2308
2308
|
currentIndex = searchIndex(lines, /^Style:/, ++currentIndex);
|
|
2309
2309
|
|
|
2310
|
-
|
|
2310
|
+
cov_1cpy3i283b.s[23]++;
|
|
2311
2311
|
while (currentIndex !== false) {
|
|
2312
|
-
|
|
2312
|
+
cov_1cpy3i283b.s[24]++;
|
|
2313
2313
|
|
|
2314
2314
|
line = trim(lines[currentIndex]);
|
|
2315
2315
|
|
|
2316
|
-
var parts = (
|
|
2317
|
-
|
|
2316
|
+
var parts = (cov_1cpy3i283b.s[25]++, line.replace(/^Style:\s+/, '').match(pattern));
|
|
2317
|
+
cov_1cpy3i283b.s[26]++;
|
|
2318
2318
|
if (!parts) {
|
|
2319
|
-
|
|
2320
|
-
|
|
2319
|
+
cov_1cpy3i283b.b[5][0]++;
|
|
2320
|
+
cov_1cpy3i283b.s[27]++;
|
|
2321
2321
|
|
|
2322
2322
|
throw new Error('Error, missing fields in a `Style` entry');
|
|
2323
2323
|
} else {
|
|
2324
|
-
|
|
2324
|
+
cov_1cpy3i283b.b[5][1]++;
|
|
2325
2325
|
}
|
|
2326
|
-
|
|
2326
|
+
cov_1cpy3i283b.s[28]++;
|
|
2327
2327
|
if (parts.length) {
|
|
2328
|
-
|
|
2328
|
+
cov_1cpy3i283b.b[6][0]++;
|
|
2329
2329
|
|
|
2330
|
-
var style = (
|
|
2331
|
-
|
|
2330
|
+
var style = (cov_1cpy3i283b.s[29]++, {});
|
|
2331
|
+
cov_1cpy3i283b.s[30]++;
|
|
2332
2332
|
if (alignmentIndex !== -1) {
|
|
2333
|
-
|
|
2333
|
+
cov_1cpy3i283b.b[7][0]++;
|
|
2334
2334
|
|
|
2335
|
-
var alignmentNumber = (
|
|
2336
|
-
|
|
2337
|
-
style.alignment = alignmentNumber >= 7 ? (
|
|
2335
|
+
var alignmentNumber = (cov_1cpy3i283b.s[31]++, parts[alignmentIndex + 1]);
|
|
2336
|
+
cov_1cpy3i283b.s[32]++;
|
|
2337
|
+
style.alignment = alignmentNumber >= 7 ? (cov_1cpy3i283b.b[8][0]++, 'top') : (cov_1cpy3i283b.b[8][1]++, 'bottom');
|
|
2338
2338
|
} else {
|
|
2339
|
-
|
|
2339
|
+
cov_1cpy3i283b.b[7][1]++;
|
|
2340
2340
|
}
|
|
2341
|
-
|
|
2341
|
+
cov_1cpy3i283b.s[33]++;
|
|
2342
2342
|
styles[parts[nameIndex + 1]] = style;
|
|
2343
2343
|
} else {
|
|
2344
|
-
|
|
2344
|
+
cov_1cpy3i283b.b[6][1]++;
|
|
2345
2345
|
}
|
|
2346
|
-
|
|
2346
|
+
cov_1cpy3i283b.s[34]++;
|
|
2347
2347
|
currentIndex = searchIndex(lines, /^Style:/, ++currentIndex);
|
|
2348
2348
|
}
|
|
2349
|
-
|
|
2349
|
+
cov_1cpy3i283b.s[35]++;
|
|
2350
2350
|
return styles;
|
|
2351
2351
|
}
|
|
2352
2352
|
|
|
2353
2353
|
exports.default = {
|
|
2354
2354
|
parse: function parse(lines) {
|
|
2355
|
-
|
|
2355
|
+
cov_1cpy3i283b.f[3]++;
|
|
2356
2356
|
|
|
2357
2357
|
var line;
|
|
2358
|
-
var currentIndex = (
|
|
2358
|
+
var currentIndex = (cov_1cpy3i283b.s[36]++, 0);
|
|
2359
2359
|
|
|
2360
2360
|
function normalizeTime(time) {
|
|
2361
|
-
|
|
2362
|
-
|
|
2361
|
+
cov_1cpy3i283b.f[4]++;
|
|
2362
|
+
cov_1cpy3i283b.s[37]++;
|
|
2363
2363
|
|
|
2364
2364
|
if (time.charAt(1) === ':') {
|
|
2365
|
-
|
|
2366
|
-
|
|
2365
|
+
cov_1cpy3i283b.b[9][0]++;
|
|
2366
|
+
cov_1cpy3i283b.s[38]++;
|
|
2367
2367
|
|
|
2368
2368
|
time = '0' + time;
|
|
2369
2369
|
} else {
|
|
2370
|
-
|
|
2370
|
+
cov_1cpy3i283b.b[9][1]++;
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
cov_1cpy3i283b.s[39]++;
|
|
2373
2373
|
return time.replace('.', ',') + '0';
|
|
2374
2374
|
}
|
|
2375
2375
|
|
|
2376
2376
|
function normalizeText(text) {
|
|
2377
|
-
|
|
2378
|
-
|
|
2377
|
+
cov_1cpy3i283b.f[5]++;
|
|
2378
|
+
cov_1cpy3i283b.s[40]++;
|
|
2379
2379
|
|
|
2380
2380
|
return text.replace(/\\n|\\N/, '\n').replace(/{\\(.*)1}(.*){\\\1[0]}/g, function (match, tag, content) {
|
|
2381
|
-
|
|
2382
|
-
|
|
2381
|
+
cov_1cpy3i283b.f[6]++;
|
|
2382
|
+
cov_1cpy3i283b.s[41]++;
|
|
2383
2383
|
|
|
2384
2384
|
return '<' + tag + '>' + content + '</' + tag + '>';
|
|
2385
2385
|
});
|
|
2386
2386
|
}
|
|
2387
2387
|
|
|
2388
|
-
var styles = (
|
|
2388
|
+
var styles = (cov_1cpy3i283b.s[42]++, extractStyles(lines));
|
|
2389
2389
|
|
|
2390
|
-
|
|
2390
|
+
cov_1cpy3i283b.s[43]++;
|
|
2391
2391
|
currentIndex = searchIndex(lines, /^\[Events\]$/);
|
|
2392
2392
|
|
|
2393
|
-
|
|
2393
|
+
cov_1cpy3i283b.s[44]++;
|
|
2394
2394
|
if (currentIndex === false) {
|
|
2395
|
-
|
|
2396
|
-
|
|
2395
|
+
cov_1cpy3i283b.b[10][0]++;
|
|
2396
|
+
cov_1cpy3i283b.s[45]++;
|
|
2397
2397
|
|
|
2398
2398
|
throw new Error('Error, missing `[Events]` section');
|
|
2399
2399
|
} else {
|
|
2400
|
-
|
|
2400
|
+
cov_1cpy3i283b.b[10][1]++;
|
|
2401
2401
|
}
|
|
2402
2402
|
|
|
2403
|
-
|
|
2403
|
+
cov_1cpy3i283b.s[46]++;
|
|
2404
2404
|
currentIndex = searchIndex(lines, /^Format:/, ++currentIndex);
|
|
2405
2405
|
|
|
2406
|
-
|
|
2406
|
+
cov_1cpy3i283b.s[47]++;
|
|
2407
2407
|
if (currentIndex === false) {
|
|
2408
|
-
|
|
2409
|
-
|
|
2408
|
+
cov_1cpy3i283b.b[11][0]++;
|
|
2409
|
+
cov_1cpy3i283b.s[48]++;
|
|
2410
2410
|
|
|
2411
2411
|
throw new Error('Error, missing `Format` entry');
|
|
2412
2412
|
} else {
|
|
2413
|
-
|
|
2413
|
+
cov_1cpy3i283b.b[11][1]++;
|
|
2414
2414
|
}
|
|
2415
2415
|
|
|
2416
|
-
|
|
2416
|
+
cov_1cpy3i283b.s[49]++;
|
|
2417
2417
|
line = trim(lines[currentIndex]);
|
|
2418
|
-
var fields = (
|
|
2419
|
-
var startIndex = (
|
|
2420
|
-
var endIndex = (
|
|
2421
|
-
var styleIndex = (
|
|
2422
|
-
var textIndex = (
|
|
2418
|
+
var fields = (cov_1cpy3i283b.s[50]++, line.replace(/^Format:\s+/, '').split(/\s*,\s*/));
|
|
2419
|
+
var startIndex = (cov_1cpy3i283b.s[51]++, fields.indexOf('Start'));
|
|
2420
|
+
var endIndex = (cov_1cpy3i283b.s[52]++, fields.indexOf('End'));
|
|
2421
|
+
var styleIndex = (cov_1cpy3i283b.s[53]++, fields.indexOf('Style'));
|
|
2422
|
+
var textIndex = (cov_1cpy3i283b.s[54]++, fields.indexOf('Text'));
|
|
2423
2423
|
|
|
2424
|
-
|
|
2425
|
-
if ((
|
|
2426
|
-
|
|
2427
|
-
|
|
2424
|
+
cov_1cpy3i283b.s[55]++;
|
|
2425
|
+
if ((cov_1cpy3i283b.b[13][0]++, startIndex === -1) || (cov_1cpy3i283b.b[13][1]++, endIndex === -1) || (cov_1cpy3i283b.b[13][2]++, textIndex === -1)) {
|
|
2426
|
+
cov_1cpy3i283b.b[12][0]++;
|
|
2427
|
+
cov_1cpy3i283b.s[56]++;
|
|
2428
2428
|
|
|
2429
2429
|
throw new Error('Error, missing fields in a `Format` entry');
|
|
2430
2430
|
} else {
|
|
2431
|
-
|
|
2431
|
+
cov_1cpy3i283b.b[12][1]++;
|
|
2432
2432
|
}
|
|
2433
2433
|
|
|
2434
|
-
var result = (
|
|
2435
|
-
var pattern = (
|
|
2434
|
+
var result = (cov_1cpy3i283b.s[57]++, []);
|
|
2435
|
+
var pattern = (cov_1cpy3i283b.s[58]++, new RegExp('^' + new Array(fields.length).join('\s*(.*?)\s*,') + '(.*?)$'));
|
|
2436
2436
|
|
|
2437
|
-
|
|
2437
|
+
cov_1cpy3i283b.s[59]++;
|
|
2438
2438
|
currentIndex = searchIndex(lines, /^Dialogue:/, ++currentIndex);
|
|
2439
2439
|
|
|
2440
|
-
|
|
2440
|
+
cov_1cpy3i283b.s[60]++;
|
|
2441
2441
|
while (currentIndex !== false) {
|
|
2442
|
-
|
|
2442
|
+
cov_1cpy3i283b.s[61]++;
|
|
2443
2443
|
|
|
2444
2444
|
line = trim(lines[currentIndex]);
|
|
2445
|
-
var parts = (
|
|
2446
|
-
|
|
2445
|
+
var parts = (cov_1cpy3i283b.s[62]++, line.replace(/^Dialogue:\s+/, '').match(pattern));
|
|
2446
|
+
cov_1cpy3i283b.s[63]++;
|
|
2447
2447
|
if (!parts) {
|
|
2448
|
-
|
|
2449
|
-
|
|
2448
|
+
cov_1cpy3i283b.b[14][0]++;
|
|
2449
|
+
cov_1cpy3i283b.s[64]++;
|
|
2450
2450
|
|
|
2451
2451
|
throw new Error('Error, missing fields in a `Dialogue` entry');
|
|
2452
2452
|
} else {
|
|
2453
|
-
|
|
2453
|
+
cov_1cpy3i283b.b[14][1]++;
|
|
2454
2454
|
}
|
|
2455
|
-
|
|
2455
|
+
cov_1cpy3i283b.s[65]++;
|
|
2456
2456
|
if (parts.length) {
|
|
2457
|
-
|
|
2457
|
+
cov_1cpy3i283b.b[15][0]++;
|
|
2458
2458
|
|
|
2459
|
-
var entry = (
|
|
2459
|
+
var entry = (cov_1cpy3i283b.s[66]++, {
|
|
2460
2460
|
startTime: normalizeTime(parts[startIndex + 1]),
|
|
2461
2461
|
stopTime: normalizeTime(parts[endIndex + 1]),
|
|
2462
2462
|
text: normalizeText(parts[textIndex + 1]),
|
|
2463
2463
|
alignment: 'bottom'
|
|
2464
2464
|
});
|
|
2465
|
-
|
|
2465
|
+
cov_1cpy3i283b.s[67]++;
|
|
2466
2466
|
if (styleIndex !== -1) {
|
|
2467
|
-
|
|
2467
|
+
cov_1cpy3i283b.b[16][0]++;
|
|
2468
2468
|
|
|
2469
|
-
var style = (
|
|
2470
|
-
|
|
2471
|
-
if ((
|
|
2472
|
-
|
|
2473
|
-
|
|
2469
|
+
var style = (cov_1cpy3i283b.s[68]++, styles[parts[styleIndex + 1]]);
|
|
2470
|
+
cov_1cpy3i283b.s[69]++;
|
|
2471
|
+
if ((cov_1cpy3i283b.b[18][0]++, style) && (cov_1cpy3i283b.b[18][1]++, style.alignment)) {
|
|
2472
|
+
cov_1cpy3i283b.b[17][0]++;
|
|
2473
|
+
cov_1cpy3i283b.s[70]++;
|
|
2474
2474
|
|
|
2475
2475
|
entry.alignment = style.alignment;
|
|
2476
2476
|
} else {
|
|
2477
|
-
|
|
2477
|
+
cov_1cpy3i283b.b[17][1]++;
|
|
2478
2478
|
}
|
|
2479
2479
|
} else {
|
|
2480
|
-
|
|
2480
|
+
cov_1cpy3i283b.b[16][1]++;
|
|
2481
2481
|
}
|
|
2482
|
-
|
|
2482
|
+
cov_1cpy3i283b.s[71]++;
|
|
2483
2483
|
result.push(entry);
|
|
2484
2484
|
} else {
|
|
2485
|
-
|
|
2485
|
+
cov_1cpy3i283b.b[15][1]++;
|
|
2486
2486
|
}
|
|
2487
|
-
|
|
2487
|
+
cov_1cpy3i283b.s[72]++;
|
|
2488
2488
|
currentIndex = searchIndex(lines, /^Dialogue:/, ++currentIndex);
|
|
2489
2489
|
}
|
|
2490
|
-
|
|
2490
|
+
cov_1cpy3i283b.s[73]++;
|
|
2491
2491
|
return result;
|
|
2492
2492
|
},
|
|
2493
2493
|
export: function _export(lines, options) {
|
|
2494
|
-
|
|
2494
|
+
cov_1cpy3i283b.f[7]++;
|
|
2495
2495
|
|
|
2496
|
-
var result = (
|
|
2496
|
+
var result = (cov_1cpy3i283b.s[74]++, '');
|
|
2497
2497
|
|
|
2498
|
-
|
|
2499
|
-
options = (
|
|
2498
|
+
cov_1cpy3i283b.s[75]++;
|
|
2499
|
+
options = (cov_1cpy3i283b.b[19][0]++, options) || (cov_1cpy3i283b.b[19][1]++, {});
|
|
2500
2500
|
|
|
2501
|
-
var font = (
|
|
2501
|
+
var font = (cov_1cpy3i283b.s[76]++, (cov_1cpy3i283b.b[20][0]++, options.font) || (cov_1cpy3i283b.b[20][1]++, {
|
|
2502
2502
|
face: 'Arial',
|
|
2503
2503
|
size: 20
|
|
2504
2504
|
}));
|
|
2505
2505
|
|
|
2506
|
-
|
|
2506
|
+
cov_1cpy3i283b.s[77]++;
|
|
2507
2507
|
result += "[Script Info]\n";
|
|
2508
|
-
|
|
2508
|
+
cov_1cpy3i283b.s[78]++;
|
|
2509
2509
|
result += "ScriptType: v4.00+\n\n";
|
|
2510
2510
|
|
|
2511
|
-
|
|
2511
|
+
cov_1cpy3i283b.s[79]++;
|
|
2512
2512
|
result += "[V4+ Styles]\n";
|
|
2513
|
-
|
|
2513
|
+
cov_1cpy3i283b.s[80]++;
|
|
2514
2514
|
result += "Format: Name, Fontname, Fontsize, PrimaryColour,Shadow,MarginV,Alignment\n";
|
|
2515
|
-
|
|
2515
|
+
cov_1cpy3i283b.s[81]++;
|
|
2516
2516
|
result += "Style: Bottom," + font.face + "," + font.size + ",&H00FFFFFF,1,20,2\n";
|
|
2517
|
-
|
|
2517
|
+
cov_1cpy3i283b.s[82]++;
|
|
2518
2518
|
result += "Style: Top," + font.face + "," + font.size + ",&H00FFFFFF,1,20,8\n\n";
|
|
2519
2519
|
|
|
2520
|
-
|
|
2520
|
+
cov_1cpy3i283b.s[83]++;
|
|
2521
2521
|
result += "[Events]\n";
|
|
2522
|
-
|
|
2522
|
+
cov_1cpy3i283b.s[84]++;
|
|
2523
2523
|
result += "Format: Layer, Start, End, Style, Text\n";
|
|
2524
2524
|
|
|
2525
2525
|
function normalizeTime(time) {
|
|
2526
|
-
|
|
2527
|
-
|
|
2526
|
+
cov_1cpy3i283b.f[8]++;
|
|
2527
|
+
cov_1cpy3i283b.s[85]++;
|
|
2528
2528
|
|
|
2529
2529
|
if (time.charAt(0) === '0') {
|
|
2530
|
-
|
|
2531
|
-
|
|
2530
|
+
cov_1cpy3i283b.b[21][0]++;
|
|
2531
|
+
cov_1cpy3i283b.s[86]++;
|
|
2532
2532
|
|
|
2533
2533
|
time = time.substr(1);
|
|
2534
2534
|
} else {
|
|
2535
|
-
|
|
2535
|
+
cov_1cpy3i283b.b[21][1]++;
|
|
2536
2536
|
}
|
|
2537
|
-
|
|
2537
|
+
cov_1cpy3i283b.s[87]++;
|
|
2538
2538
|
return time.replace(',', '.').slice(0, -1);
|
|
2539
2539
|
}
|
|
2540
2540
|
|
|
2541
2541
|
function normalizeText(text) {
|
|
2542
|
-
|
|
2543
|
-
|
|
2542
|
+
cov_1cpy3i283b.f[9]++;
|
|
2543
|
+
cov_1cpy3i283b.s[88]++;
|
|
2544
2544
|
|
|
2545
2545
|
return _lodash2.default.unescape(text.replace(/<div>/g, '\\N').replace(/<\/div>/g, '').replace(/\n/g, '\\N').replace(/<br>/g, '\\N').replace(/<i>/g, '{\\i1}').replace(/<\/i>/g, '{\\i0}').replace(/<b>/g, '{\\b1}').replace(/<\/b>/g, '{\\b0}'));
|
|
2546
2546
|
}
|
|
2547
2547
|
|
|
2548
|
-
|
|
2548
|
+
cov_1cpy3i283b.s[89]++;
|
|
2549
2549
|
lines.forEach(function (line) {
|
|
2550
|
-
|
|
2551
|
-
|
|
2550
|
+
cov_1cpy3i283b.f[10]++;
|
|
2551
|
+
cov_1cpy3i283b.s[90]++;
|
|
2552
2552
|
|
|
2553
2553
|
if (line.text === undefined) {
|
|
2554
|
-
|
|
2555
|
-
|
|
2554
|
+
cov_1cpy3i283b.b[22][0]++;
|
|
2555
|
+
cov_1cpy3i283b.s[91]++;
|
|
2556
2556
|
|
|
2557
2557
|
return;
|
|
2558
2558
|
} else {
|
|
2559
|
-
|
|
2559
|
+
cov_1cpy3i283b.b[22][1]++;
|
|
2560
2560
|
}
|
|
2561
|
-
|
|
2561
|
+
cov_1cpy3i283b.s[92]++;
|
|
2562
2562
|
result += "Dialogue: 0";
|
|
2563
|
-
|
|
2563
|
+
cov_1cpy3i283b.s[93]++;
|
|
2564
2564
|
result += "," + normalizeTime(_TimeFormat2.default.startTime(line));
|
|
2565
|
-
|
|
2565
|
+
cov_1cpy3i283b.s[94]++;
|
|
2566
2566
|
result += "," + normalizeTime(_TimeFormat2.default.stopTime(line));
|
|
2567
|
-
|
|
2568
|
-
result += line.alignment === 'top' ? (
|
|
2569
|
-
|
|
2567
|
+
cov_1cpy3i283b.s[95]++;
|
|
2568
|
+
result += line.alignment === 'top' ? (cov_1cpy3i283b.b[23][0]++, ",Top") : (cov_1cpy3i283b.b[23][1]++, ",Bottom");
|
|
2569
|
+
cov_1cpy3i283b.s[96]++;
|
|
2570
2570
|
result += "," + normalizeText(line.text) + "\n";
|
|
2571
2571
|
});
|
|
2572
|
-
|
|
2572
|
+
cov_1cpy3i283b.s[97]++;
|
|
2573
2573
|
return result;
|
|
2574
2574
|
}
|
|
2575
2575
|
};
|
package/dist/src/Asset.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var path = "/Users/jeff/www/
|
|
5
|
-
hash = "
|
|
3
|
+
var cov_13aymflpn4 = function () {
|
|
4
|
+
var path = "/Users/jeff/www/platform-x4/pixwel-sdk/src/Asset.js",
|
|
5
|
+
hash = "184ecabf3ed49219ea96be7358cf2af3b35ecd84",
|
|
6
6
|
Function = function () {}.constructor,
|
|
7
7
|
global = new Function('return this')(),
|
|
8
8
|
gcv = "__coverage__",
|
|
9
9
|
coverageData = {
|
|
10
|
-
path: "/Users/jeff/www/
|
|
10
|
+
path: "/Users/jeff/www/platform-x4/pixwel-sdk/src/Asset.js",
|
|
11
11
|
statementMap: {
|
|
12
12
|
"0": {
|
|
13
13
|
start: {
|
|
@@ -347,50 +347,50 @@ var Asset = function () {
|
|
|
347
347
|
(0, _createClass3.default)(Asset, null, [{
|
|
348
348
|
key: "mapFromOrder",
|
|
349
349
|
value: function mapFromOrder(order) {
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
cov_13aymflpn4.f[0]++;
|
|
351
|
+
cov_13aymflpn4.s[0]++;
|
|
352
352
|
|
|
353
353
|
if (!order) {
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
cov_13aymflpn4.b[0][0]++;
|
|
355
|
+
cov_13aymflpn4.s[1]++;
|
|
356
356
|
|
|
357
357
|
throw new Error("missing order");
|
|
358
358
|
} else {
|
|
359
|
-
|
|
359
|
+
cov_13aymflpn4.b[0][1]++;
|
|
360
360
|
}
|
|
361
|
-
|
|
361
|
+
cov_13aymflpn4.s[2]++;
|
|
362
362
|
if (!order.asset) {
|
|
363
|
-
|
|
364
|
-
|
|
363
|
+
cov_13aymflpn4.b[1][0]++;
|
|
364
|
+
cov_13aymflpn4.s[3]++;
|
|
365
365
|
|
|
366
366
|
throw new Error("missing order.asset");
|
|
367
367
|
} else {
|
|
368
|
-
|
|
368
|
+
cov_13aymflpn4.b[1][1]++;
|
|
369
369
|
}
|
|
370
|
-
|
|
370
|
+
cov_13aymflpn4.s[4]++;
|
|
371
371
|
if (!order.project) {
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
cov_13aymflpn4.b[2][0]++;
|
|
373
|
+
cov_13aymflpn4.s[5]++;
|
|
374
374
|
|
|
375
375
|
throw new Error("missing order.project");
|
|
376
376
|
} else {
|
|
377
|
-
|
|
377
|
+
cov_13aymflpn4.b[2][1]++;
|
|
378
378
|
}
|
|
379
|
-
|
|
379
|
+
cov_13aymflpn4.s[6]++;
|
|
380
380
|
if (!order.project.slug) {
|
|
381
|
-
|
|
382
|
-
|
|
381
|
+
cov_13aymflpn4.b[3][0]++;
|
|
382
|
+
cov_13aymflpn4.s[7]++;
|
|
383
383
|
|
|
384
384
|
throw new Error("missing order.project.slug");
|
|
385
385
|
} else {
|
|
386
|
-
|
|
386
|
+
cov_13aymflpn4.b[3][1]++;
|
|
387
387
|
}
|
|
388
|
-
var asset = (
|
|
389
|
-
|
|
388
|
+
var asset = (cov_13aymflpn4.s[8]++, order.asset);
|
|
389
|
+
cov_13aymflpn4.s[9]++;
|
|
390
390
|
asset.project = order.project;
|
|
391
|
-
|
|
391
|
+
cov_13aymflpn4.s[10]++;
|
|
392
392
|
asset.project.filePrefix = order.project.slug.toUpperCase();
|
|
393
|
-
|
|
393
|
+
cov_13aymflpn4.s[11]++;
|
|
394
394
|
return asset;
|
|
395
395
|
}
|
|
396
396
|
}]);
|