@sub37/webvtt-adapter 1.1.1 → 1.1.2
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/lib/Adapter.js +11 -5
- package/lib/Parser/RenderingModifiers.d.ts +2 -2
- package/lib/Parser/RenderingModifiers.js +32 -24
- package/lib/Parser/Tags/Node.d.ts +1 -1
- package/lib/Parser/Tags/Node.js +3 -1
- package/lib/Parser/Tags/NodeQueue.d.ts +1 -1
- package/lib/Parser/Tags/NodeQueue.js +1 -3
- package/lib/Parser/Tags/utils.js +2 -4
- package/lib/Parser/Timestamps.utils.js +2 -2
- package/lib/Parser/parseCue.d.ts +1 -1
- package/lib/Parser/parseRegion.d.ts +1 -1
- package/lib/Parser/parseRegion.js +20 -7
- package/lib/Parser/parseStyle.d.ts +1 -1
- package/lib/Parser/parseStyle.js +12 -4
- package/lib/Token.js +6 -0
- package/lib/Tokenizer.d.ts +2 -2
- package/lib/Tokenizer.js +6 -5
- package/package.json +4 -4
package/lib/Adapter.js
CHANGED
|
@@ -24,7 +24,7 @@ export default class WebVTTAdapter extends BaseAdapter {
|
|
|
24
24
|
}
|
|
25
25
|
parse(rawContent) {
|
|
26
26
|
if (!rawContent) {
|
|
27
|
-
return BaseAdapter.ParseResult(
|
|
27
|
+
return BaseAdapter.ParseResult([], [
|
|
28
28
|
{
|
|
29
29
|
error: new MissingContentError(),
|
|
30
30
|
failedChunk: "",
|
|
@@ -78,7 +78,7 @@ export default class WebVTTAdapter extends BaseAdapter {
|
|
|
78
78
|
const shouldProcessNonCues = latestBlockPhase & (BlockType.REGION | BlockType.STYLE | BlockType.HEADER);
|
|
79
79
|
if (isRegion(blockEvaluationResult) && shouldProcessNonCues) {
|
|
80
80
|
const [blockType, parsedContent] = blockEvaluationResult;
|
|
81
|
-
if (parsedContent
|
|
81
|
+
if (parsedContent?.id) {
|
|
82
82
|
latestBlockPhase = blockType;
|
|
83
83
|
regions[parsedContent.id] = parsedContent;
|
|
84
84
|
}
|
|
@@ -146,7 +146,7 @@ export default class WebVTTAdapter extends BaseAdapter {
|
|
|
146
146
|
content: parsedCue.text,
|
|
147
147
|
renderingModifiers: parsedCue.renderingModifiers,
|
|
148
148
|
});
|
|
149
|
-
if (parsedCue.renderingModifiers
|
|
149
|
+
if (parsedCue.renderingModifiers?.regionIdentifier) {
|
|
150
150
|
cue.region = regions[parsedCue.renderingModifiers.regionIdentifier];
|
|
151
151
|
}
|
|
152
152
|
if (!latestRootCue) {
|
|
@@ -224,7 +224,7 @@ export default class WebVTTAdapter extends BaseAdapter {
|
|
|
224
224
|
}
|
|
225
225
|
catch (err) {
|
|
226
226
|
const error = err instanceof Error ? err : new Error(JSON.stringify(err));
|
|
227
|
-
return BaseAdapter.ParseResult(
|
|
227
|
+
return BaseAdapter.ParseResult([], [
|
|
228
228
|
{
|
|
229
229
|
error,
|
|
230
230
|
isCritical: true,
|
|
@@ -246,15 +246,21 @@ function evaluateBlock(content, start, end) {
|
|
|
246
246
|
}
|
|
247
247
|
const contentSection = content.substring(start, end);
|
|
248
248
|
const blockMatch = contentSection.match(BLOCK_MATCH_REGEX);
|
|
249
|
-
if (blockMatch
|
|
249
|
+
if (blockMatch?.groups["blocktype"]) {
|
|
250
250
|
switch (blockMatch.groups["blocktype"]) {
|
|
251
251
|
case "REGION": {
|
|
252
252
|
const payload = Parser.parseRegion(blockMatch.groups["payload"]);
|
|
253
|
+
if (!payload) {
|
|
254
|
+
return [BlockType.IGNORED, undefined];
|
|
255
|
+
}
|
|
253
256
|
return [BlockType.REGION, payload];
|
|
254
257
|
}
|
|
255
258
|
case "STYLE": {
|
|
256
259
|
try {
|
|
257
260
|
const payload = Parser.parseStyle(blockMatch.groups["payload"]);
|
|
261
|
+
if (!payload) {
|
|
262
|
+
return [BlockType.IGNORED, undefined];
|
|
263
|
+
}
|
|
258
264
|
return [BlockType.STYLE, payload];
|
|
259
265
|
}
|
|
260
266
|
catch (err) {
|
|
@@ -3,7 +3,7 @@ export declare class WebVTTRenderingModifiers implements RenderingModifiers {
|
|
|
3
3
|
static fromString(source: string | undefined): WebVTTRenderingModifiers;
|
|
4
4
|
private position?;
|
|
5
5
|
private positionAlignment?;
|
|
6
|
-
private align
|
|
6
|
+
private align;
|
|
7
7
|
private region?;
|
|
8
8
|
/**
|
|
9
9
|
* @TODO support vertical in renderer
|
|
@@ -14,5 +14,5 @@ export declare class WebVTTRenderingModifiers implements RenderingModifiers {
|
|
|
14
14
|
get width(): number;
|
|
15
15
|
get leftOffset(): number;
|
|
16
16
|
get textAlignment(): typeof this.align;
|
|
17
|
-
get regionIdentifier(): string;
|
|
17
|
+
get regionIdentifier(): string | undefined;
|
|
18
18
|
}
|
|
@@ -12,25 +12,14 @@ const ALIGNMENT_NUMBER_IDENTIFIERS = {
|
|
|
12
12
|
end: 5,
|
|
13
13
|
};
|
|
14
14
|
export class WebVTTRenderingModifiers {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.position = 50;
|
|
17
|
-
this.positionAlignment = "center";
|
|
18
|
-
this.align = "center";
|
|
19
|
-
/**
|
|
20
|
-
* @TODO support vertical in renderer
|
|
21
|
-
* along with a new property "writing mode"
|
|
22
|
-
*/
|
|
23
|
-
// private vertical?: HORIZONTAL | GROWING_LEFT | GROWING_RIGHT = HORIZONTAL;
|
|
24
|
-
this.size = 100;
|
|
25
|
-
}
|
|
26
15
|
static fromString(source) {
|
|
27
16
|
const modifier = new WebVTTRenderingModifiers();
|
|
28
|
-
if (!
|
|
17
|
+
if (!source?.length) {
|
|
29
18
|
return modifier;
|
|
30
19
|
}
|
|
31
20
|
const properties = source.split(" ").reduce((acc, curr) => {
|
|
32
21
|
const [key, value] = curr.split(":");
|
|
33
|
-
return (key && value &&
|
|
22
|
+
return (key && value && { ...acc, [key]: value }) || acc;
|
|
34
23
|
}, {});
|
|
35
24
|
let position = "auto";
|
|
36
25
|
let positionAlignment = "auto";
|
|
@@ -42,7 +31,7 @@ export class WebVTTRenderingModifiers {
|
|
|
42
31
|
if (isPositionAlignmentStandard(posAlignment)) {
|
|
43
32
|
positionAlignment = posAlignment;
|
|
44
33
|
}
|
|
45
|
-
if (pos !== "auto") {
|
|
34
|
+
if (pos && pos !== "auto") {
|
|
46
35
|
const integerPosition = (pos.endsWith("%") && parseInt(pos)) || NaN;
|
|
47
36
|
if (!Number.isNaN(integerPosition)) {
|
|
48
37
|
position = Math.min(Math.max(0, integerPosition), 100);
|
|
@@ -134,10 +123,24 @@ export class WebVTTRenderingModifiers {
|
|
|
134
123
|
}
|
|
135
124
|
return modifier;
|
|
136
125
|
}
|
|
126
|
+
position = 50;
|
|
127
|
+
positionAlignment = "center";
|
|
128
|
+
align = "center";
|
|
129
|
+
region;
|
|
130
|
+
/**
|
|
131
|
+
* @TODO support vertical in renderer
|
|
132
|
+
* along with a new property "writing mode"
|
|
133
|
+
*/
|
|
134
|
+
// private vertical?: HORIZONTAL | GROWING_LEFT | GROWING_RIGHT = HORIZONTAL;
|
|
135
|
+
size = 100;
|
|
137
136
|
get id() {
|
|
138
137
|
return Math.abs(this.width + this.leftOffset - ALIGNMENT_NUMBER_IDENTIFIERS[this.align]);
|
|
139
138
|
}
|
|
140
139
|
get width() {
|
|
140
|
+
if (!this.positionAlignment) {
|
|
141
|
+
return 100;
|
|
142
|
+
}
|
|
143
|
+
const position = this.position || 0;
|
|
141
144
|
/**
|
|
142
145
|
* Width, and hence cuebox left offset, calculation is
|
|
143
146
|
* highly influenced by the alignment.
|
|
@@ -166,7 +169,7 @@ export class WebVTTRenderingModifiers {
|
|
|
166
169
|
* | | |
|
|
167
170
|
* |----|----|----|----|----|----|----|----|----|----|
|
|
168
171
|
*/
|
|
169
|
-
return Math.min(this.size, 100 -
|
|
172
|
+
return Math.min(this.size, 100 - position);
|
|
170
173
|
}
|
|
171
174
|
case "center": {
|
|
172
175
|
/**
|
|
@@ -189,8 +192,8 @@ export class WebVTTRenderingModifiers {
|
|
|
189
192
|
* | | |
|
|
190
193
|
* |----|----|----|----|----|----|----|----|----|----|
|
|
191
194
|
*/
|
|
192
|
-
if (
|
|
193
|
-
return Math.min(this.size,
|
|
195
|
+
if (position <= 50) {
|
|
196
|
+
return Math.min(this.size, position * 2);
|
|
194
197
|
}
|
|
195
198
|
/**
|
|
196
199
|
* @example scheme, point > 50%
|
|
@@ -205,7 +208,7 @@ export class WebVTTRenderingModifiers {
|
|
|
205
208
|
* | | |
|
|
206
209
|
* |----|----|----|----|----|----|----|----|----|----|
|
|
207
210
|
*/
|
|
208
|
-
return Math.min(this.size, (100 -
|
|
211
|
+
return Math.min(this.size, (100 - position) * 2);
|
|
209
212
|
}
|
|
210
213
|
case "line-right": {
|
|
211
214
|
/**
|
|
@@ -225,11 +228,12 @@ export class WebVTTRenderingModifiers {
|
|
|
225
228
|
* | | |
|
|
226
229
|
* |----|----|----|----|----|----|----|----|----|----|
|
|
227
230
|
*/
|
|
228
|
-
return Math.min(this.size,
|
|
231
|
+
return Math.min(this.size, position);
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
}
|
|
232
235
|
get leftOffset() {
|
|
236
|
+
const position = this.position || 0;
|
|
233
237
|
/**
|
|
234
238
|
* Width, and hence cuebox left offset, calculation is
|
|
235
239
|
* highly influenced by the alignment.
|
|
@@ -247,7 +251,7 @@ export class WebVTTRenderingModifiers {
|
|
|
247
251
|
*
|
|
248
252
|
* For schemas, refer to width on "line-left" case.
|
|
249
253
|
*/
|
|
250
|
-
return
|
|
254
|
+
return position;
|
|
251
255
|
}
|
|
252
256
|
case "center": {
|
|
253
257
|
/**
|
|
@@ -261,10 +265,10 @@ export class WebVTTRenderingModifiers {
|
|
|
261
265
|
*
|
|
262
266
|
* For schemas, refer to width on "center" case.
|
|
263
267
|
*/
|
|
264
|
-
if (
|
|
268
|
+
if (position <= 50) {
|
|
265
269
|
return 0;
|
|
266
270
|
}
|
|
267
|
-
const width = (100 -
|
|
271
|
+
const width = (100 - position) * 2;
|
|
268
272
|
return 100 - width;
|
|
269
273
|
}
|
|
270
274
|
case "line-right": {
|
|
@@ -278,6 +282,7 @@ export class WebVTTRenderingModifiers {
|
|
|
278
282
|
return 0;
|
|
279
283
|
}
|
|
280
284
|
}
|
|
285
|
+
return 0;
|
|
281
286
|
}
|
|
282
287
|
get textAlignment() {
|
|
283
288
|
return this.align;
|
|
@@ -292,9 +297,12 @@ function isPositionAlignmentStandard(alignment) {
|
|
|
292
297
|
function isTextAlignmentStandard(alignment) {
|
|
293
298
|
return ["start", "left", "center", "right", "end"].includes(alignment);
|
|
294
299
|
}
|
|
300
|
+
//
|
|
301
|
+
// type VerticalWritingMode = HORIZONTAL | GROWING_LEFT | GROWING_RIGHT;
|
|
302
|
+
//
|
|
295
303
|
// function isVerticalStandard(
|
|
296
304
|
// vertical: string,
|
|
297
|
-
// ): vertical is
|
|
298
|
-
// return [HORIZONTAL, GROWING_LEFT, GROWING_RIGHT].includes(vertical);
|
|
305
|
+
// ): vertical is VerticalWritingMode {
|
|
306
|
+
// return [HORIZONTAL, GROWING_LEFT, GROWING_RIGHT].includes(vertical as VerticalWritingMode);
|
|
299
307
|
// }
|
|
300
308
|
//# sourceMappingURL=RenderingModifiers.js.map
|
|
@@ -3,7 +3,7 @@ export default class Node {
|
|
|
3
3
|
/** Zero-based position of cue (or timestamp section) content */
|
|
4
4
|
index: number;
|
|
5
5
|
token: Token;
|
|
6
|
-
parent: Node;
|
|
6
|
+
parent: Node | null;
|
|
7
7
|
constructor(
|
|
8
8
|
/** Zero-based position of cue (or timestamp section) content */
|
|
9
9
|
index: number, token: Token);
|
package/lib/Parser/Tags/Node.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export default class Node {
|
|
2
|
+
index;
|
|
3
|
+
token;
|
|
4
|
+
parent = null;
|
|
2
5
|
constructor(
|
|
3
6
|
/** Zero-based position of cue (or timestamp section) content */
|
|
4
7
|
index, token) {
|
|
5
8
|
this.index = index;
|
|
6
9
|
this.token = token;
|
|
7
|
-
this.parent = null;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=Node.js.map
|
package/lib/Parser/Tags/utils.js
CHANGED
|
@@ -37,10 +37,8 @@ export function createTagEntity(currentCue, tagStart) {
|
|
|
37
37
|
* the beginning of the **current cue** and the length should be set to
|
|
38
38
|
* current cue content.
|
|
39
39
|
*/
|
|
40
|
-
var _a;
|
|
41
40
|
const tagOpenedInCurrentCue = currentCue.text.length - tagStart.index > 0;
|
|
42
|
-
const attributes = new Map(
|
|
43
|
-
var _a;
|
|
41
|
+
const attributes = new Map(tagStart.token.annotations?.map((annotation) => {
|
|
44
42
|
if (tagStart.token.content === "lang") {
|
|
45
43
|
return ["lang", annotation];
|
|
46
44
|
}
|
|
@@ -48,7 +46,7 @@ export function createTagEntity(currentCue, tagStart) {
|
|
|
48
46
|
return ["voice", annotation];
|
|
49
47
|
}
|
|
50
48
|
const attribute = annotation.split("=");
|
|
51
|
-
return [attribute[0],
|
|
49
|
+
return [attribute[0], attribute[1]?.replace(/["']/g, "")];
|
|
52
50
|
}));
|
|
53
51
|
return new Entities.Tag({
|
|
54
52
|
tagType: EntitiesTokenMap[tagStart.token.content],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const TIME_REGEX = /(?<hours>(\d{2})?):?(?<minutes>(\d{2})):(?<seconds>(\d{2}))(?:\.(?<milliseconds>(\d{0,3})))?/;
|
|
2
2
|
export function parseMs(timestring) {
|
|
3
3
|
const timeMatch = timestring.match(TIME_REGEX);
|
|
4
|
-
if (!timeMatch) {
|
|
4
|
+
if (!timeMatch?.groups) {
|
|
5
5
|
throw new Error("Time format is not valid. Ignoring cue.");
|
|
6
6
|
}
|
|
7
|
-
const { groups: { hours, minutes, seconds, milliseconds }, } = timeMatch;
|
|
7
|
+
const { groups: { hours = "", minutes = "", seconds = "", milliseconds = "" }, } = timeMatch;
|
|
8
8
|
const hoursInSeconds = zeroFallback(parseInt(hours)) * 60 * 60;
|
|
9
9
|
const minutesInSeconds = zeroFallback(parseInt(minutes)) * 60;
|
|
10
10
|
const parsedSeconds = zeroFallback(parseInt(seconds));
|
package/lib/Parser/parseCue.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface CueParsedData {
|
|
|
14
14
|
regionName?: string;
|
|
15
15
|
tags: Entities.Tag[];
|
|
16
16
|
text: string;
|
|
17
|
-
renderingModifiers
|
|
17
|
+
renderingModifiers?: RenderingModifiers | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* Grouping identifier allows us to skip
|
|
20
20
|
* uniqueness checks for ids for cues nodes
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* @param rawRegionData
|
|
3
3
|
*/
|
|
4
4
|
export function parseRegion(rawRegionData) {
|
|
5
|
+
if (!rawRegionData) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
5
8
|
const region = new WebVTTRegion();
|
|
6
9
|
const attributes = rawRegionData.split(/[\n\t\s]+/);
|
|
7
10
|
for (let i = 0; i < attributes.length; i++) {
|
|
@@ -66,13 +69,23 @@ export function parseRegion(rawRegionData) {
|
|
|
66
69
|
*/
|
|
67
70
|
const VH_LINE_HEIGHT = 5.33;
|
|
68
71
|
class WebVTTRegion {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
id = "";
|
|
73
|
+
/**
|
|
74
|
+
* Region width expressed in percentage
|
|
75
|
+
*/
|
|
76
|
+
width = 100;
|
|
77
|
+
lines = 3;
|
|
78
|
+
scroll;
|
|
79
|
+
/**
|
|
80
|
+
* Position of region based on video region.
|
|
81
|
+
* Couple of numbers expressed in percentage
|
|
82
|
+
*/
|
|
83
|
+
viewportanchor;
|
|
84
|
+
/**
|
|
85
|
+
* Position of region based on viewportAnchor
|
|
86
|
+
* Couple of numbers expressed in percentage
|
|
87
|
+
*/
|
|
88
|
+
regionanchor;
|
|
76
89
|
getOrigin() {
|
|
77
90
|
const height = VH_LINE_HEIGHT * this.lines;
|
|
78
91
|
const [regionAnchorWidth = 0, regionAnchorHeight = 0] = this.regionanchor || [];
|
|
@@ -18,5 +18,5 @@ type SelectorTarget = {
|
|
|
18
18
|
export type Style = SelectorTarget & {
|
|
19
19
|
styleString: string;
|
|
20
20
|
};
|
|
21
|
-
export declare function parseStyle(rawStyleData: string): Style | undefined;
|
|
21
|
+
export declare function parseStyle(rawStyleData: string | undefined): Style | undefined;
|
|
22
22
|
export {};
|
package/lib/Parser/parseStyle.js
CHANGED
|
@@ -63,7 +63,10 @@ export function parseStyle(rawStyleData) {
|
|
|
63
63
|
if (!parsedSelector) {
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return {
|
|
67
|
+
...parsedSelector,
|
|
68
|
+
styleString,
|
|
69
|
+
};
|
|
67
70
|
}
|
|
68
71
|
function getParsedSelector(selector, classesChain) {
|
|
69
72
|
if (!selector && !classesChain.length) {
|
|
@@ -78,14 +81,19 @@ function getParsedSelector(selector, classesChain) {
|
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
83
|
const selectorComponents = getSelectorComponents(selector);
|
|
81
|
-
if (!selectorComponents
|
|
84
|
+
if (!selectorComponents ||
|
|
85
|
+
(!selectorComponents.tagName && !selectorComponents.attributes.size && !classesChain.length)) {
|
|
82
86
|
/** Invalid */
|
|
83
87
|
return undefined;
|
|
84
88
|
}
|
|
85
|
-
return
|
|
89
|
+
return {
|
|
90
|
+
type: 2 /* StyleDomain.TAG */,
|
|
91
|
+
classes: (classesChain.length && classesChain.split(".")) || [],
|
|
92
|
+
...selectorComponents,
|
|
93
|
+
};
|
|
86
94
|
}
|
|
87
95
|
function getSelectorComponents(rawSelector) {
|
|
88
|
-
let selector =
|
|
96
|
+
let selector = "";
|
|
89
97
|
const attributes = [];
|
|
90
98
|
/**
|
|
91
99
|
* This is too recent and will likely require a polyfill from
|
package/lib/Token.js
CHANGED
|
@@ -6,6 +6,12 @@ export var TokenType;
|
|
|
6
6
|
TokenType[TokenType["TIMESTAMP"] = 3] = "TIMESTAMP";
|
|
7
7
|
})(TokenType || (TokenType = {}));
|
|
8
8
|
export class Token {
|
|
9
|
+
annotations = [];
|
|
10
|
+
classes = [];
|
|
11
|
+
offset = 0;
|
|
12
|
+
length = 0;
|
|
13
|
+
type;
|
|
14
|
+
content;
|
|
9
15
|
constructor(type, content) {
|
|
10
16
|
this.type = type;
|
|
11
17
|
this.content = content;
|
package/lib/Tokenizer.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export declare class Tokenizer {
|
|
|
25
25
|
/** Next token index in the content */
|
|
26
26
|
private startPoint;
|
|
27
27
|
constructor(rawContent: string);
|
|
28
|
-
static isWhitespace(character: string):
|
|
29
|
-
static isNewLine(character: string):
|
|
28
|
+
static isWhitespace(character: string): character is " " | "\t" | "\f";
|
|
29
|
+
static isNewLine(character: string): character is "\n";
|
|
30
30
|
/**
|
|
31
31
|
* Attempts to convert a set of character (a supposed HTML Entity)
|
|
32
32
|
* to the correct character, by accumulating its char code;
|
package/lib/Tokenizer.js
CHANGED
|
@@ -32,12 +32,13 @@ var TokenizerState;
|
|
|
32
32
|
})(TokenizerState || (TokenizerState = {}));
|
|
33
33
|
const SHARED_DOM_PARSER = new DOMParser();
|
|
34
34
|
export class Tokenizer {
|
|
35
|
+
rawContent;
|
|
36
|
+
/** Character index in the content */
|
|
37
|
+
cursor = 0;
|
|
38
|
+
/** Next token index in the content */
|
|
39
|
+
startPoint = 0;
|
|
35
40
|
constructor(rawContent) {
|
|
36
41
|
this.rawContent = rawContent;
|
|
37
|
-
/** Character index in the content */
|
|
38
|
-
this.cursor = 0;
|
|
39
|
-
/** Next token index in the content */
|
|
40
|
-
this.startPoint = 0;
|
|
41
42
|
}
|
|
42
43
|
static isWhitespace(character) {
|
|
43
44
|
return character == "\x20" || character == "\x09" || character == "\x0C";
|
|
@@ -55,7 +56,7 @@ export class Tokenizer {
|
|
|
55
56
|
* @returns
|
|
56
57
|
*/
|
|
57
58
|
static parseHTMLEntity(source, currentCursor, additionalAllowedCharacters = []) {
|
|
58
|
-
if (!
|
|
59
|
+
if (!source?.length) {
|
|
59
60
|
return ["", currentCursor];
|
|
60
61
|
}
|
|
61
62
|
let cursor = currentCursor;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sub37/webvtt-adapter",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A subtitles adapter for WebVTT subtitles",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@sub37/server": "
|
|
8
|
+
"@sub37/server": "1.1.1"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "rm -rf lib && pnpm tsc
|
|
11
|
+
"build": "rm -rf lib && pnpm tsc --build --force",
|
|
12
12
|
"test": "pnpm build && pnpm --prefix ../.. run test",
|
|
13
13
|
"prepublishOnly": "pnpm build"
|
|
14
14
|
},
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"lib/**/*.+(js|d.ts)!(*.map)"
|
|
27
27
|
],
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "0d8b842834856464dde9890feb4c39b5823699ab"
|
|
29
29
|
}
|