document-ir 0.4.1 → 0.4.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/dist/index.js +17 -20
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (c, t, e) =>
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var d = (c, t, e) => t in c ? y(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
|
+
var h = (c, t, e) => d(c, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
class u {
|
|
5
5
|
async beforeBlock() {
|
|
6
6
|
}
|
|
@@ -92,7 +92,7 @@ class u {
|
|
|
92
92
|
type: "code",
|
|
93
93
|
content: e
|
|
94
94
|
};
|
|
95
|
-
return t.diff != null && (i.diff = t.diff), t.lineNumbers != null && (i.lineNumbers = t.lineNumbers), t.id != null && (i.id = t.id), i;
|
|
95
|
+
return t.language != null && (i.language = t.language), t.diff != null && (i.diff = t.diff), t.lineNumbers != null && (i.lineNumbers = t.lineNumbers), t.id != null && (i.id = t.id), i;
|
|
96
96
|
}
|
|
97
97
|
async codeBlock(t) {
|
|
98
98
|
const i = {
|
|
@@ -273,10 +273,9 @@ class u {
|
|
|
273
273
|
await this.beforeBlock(), await this.afterBlock();
|
|
274
274
|
const e = {
|
|
275
275
|
type: "formatted-text",
|
|
276
|
-
text: t.text || ""
|
|
277
|
-
language: t.language
|
|
276
|
+
text: t.text || ""
|
|
278
277
|
};
|
|
279
|
-
return t.id != null && (e.id = t.id), e;
|
|
278
|
+
return t.language != null && (e.language = t.language), t.id != null && (e.id = t.id), e;
|
|
280
279
|
}
|
|
281
280
|
async header(t) {
|
|
282
281
|
await this.beforeBlock();
|
|
@@ -405,10 +404,9 @@ class u {
|
|
|
405
404
|
type: "quote",
|
|
406
405
|
icon: t.icon,
|
|
407
406
|
name: t.name,
|
|
408
|
-
content: e
|
|
409
|
-
url: t.url
|
|
407
|
+
content: e
|
|
410
408
|
};
|
|
411
|
-
return t.id != null && (i.id = t.id), t.orientation && (i.orientation = t.orientation), i;
|
|
409
|
+
return t.id != null && (i.id = t.id), t.url && (i.url = t.url), t.orientation && (i.orientation = t.orientation), i;
|
|
412
410
|
}
|
|
413
411
|
async redacted(t) {
|
|
414
412
|
t.style == "block" ? await this.beforeBlock() : await this.beforeInline();
|
|
@@ -622,10 +620,9 @@ class u {
|
|
|
622
620
|
content: e,
|
|
623
621
|
attribution: i,
|
|
624
622
|
header: s,
|
|
625
|
-
media: r
|
|
626
|
-
original: t.original
|
|
623
|
+
media: r
|
|
627
624
|
};
|
|
628
|
-
return t.id != null && (n.id = t.id), n;
|
|
625
|
+
return t.original && (n.original = t.original), t.id != null && (n.id = t.id), n;
|
|
629
626
|
}
|
|
630
627
|
async date(t) {
|
|
631
628
|
await this.beforeInline();
|
|
@@ -857,7 +854,7 @@ class u {
|
|
|
857
854
|
return await this.document(t);
|
|
858
855
|
}
|
|
859
856
|
}
|
|
860
|
-
class
|
|
857
|
+
class g extends u {
|
|
861
858
|
async chooseChildren(t) {
|
|
862
859
|
const e = await super.chooseChildren(t), i = [];
|
|
863
860
|
for (const s of e)
|
|
@@ -890,7 +887,7 @@ class I extends u {
|
|
|
890
887
|
return i;
|
|
891
888
|
}
|
|
892
889
|
}
|
|
893
|
-
class
|
|
890
|
+
class k extends u {
|
|
894
891
|
async text(t) {
|
|
895
892
|
return t.text == "" ? null : t;
|
|
896
893
|
}
|
|
@@ -923,7 +920,7 @@ class T extends u {
|
|
|
923
920
|
type: "code",
|
|
924
921
|
content: e.content
|
|
925
922
|
};
|
|
926
|
-
return e.diff != null && (i.diff = e.diff), e.lineNumbers != null && (i.lineNumbers = e.lineNumbers), e.id != null && (i.id = e.id), i;
|
|
923
|
+
return e.language != null && (i.language = e.language), e.diff != null && (i.diff = e.diff), e.lineNumbers != null && (i.lineNumbers = e.lineNumbers), e.id != null && (i.id = e.id), i;
|
|
927
924
|
}
|
|
928
925
|
async beforeBlock() {
|
|
929
926
|
this.stripLastText();
|
|
@@ -933,7 +930,7 @@ class T extends u {
|
|
|
933
930
|
}
|
|
934
931
|
async transform(e) {
|
|
935
932
|
const i = await super.transform(e);
|
|
936
|
-
return await new
|
|
933
|
+
return await new k().transform(i);
|
|
937
934
|
}
|
|
938
935
|
}
|
|
939
936
|
class v extends u {
|
|
@@ -994,7 +991,7 @@ class v extends u {
|
|
|
994
991
|
type: "code",
|
|
995
992
|
content: e.content
|
|
996
993
|
};
|
|
997
|
-
return e.diff != null && (i.diff = e.diff), e.lineNumbers != null && (i.lineNumbers = e.lineNumbers), e.id != null && (i.id = e.id), i;
|
|
994
|
+
return e.language != null && (i.language = e.language), e.diff != null && (i.diff = e.diff), e.lineNumbers != null && (i.lineNumbers = e.lineNumbers), e.id != null && (i.id = e.id), i;
|
|
998
995
|
}
|
|
999
996
|
async text(e) {
|
|
1000
997
|
const i = {
|
|
@@ -1343,7 +1340,7 @@ class m extends w {
|
|
|
1343
1340
|
return this.textList.join("");
|
|
1344
1341
|
}
|
|
1345
1342
|
}
|
|
1346
|
-
class B extends
|
|
1343
|
+
class B extends g {
|
|
1347
1344
|
async sticker(t) {
|
|
1348
1345
|
if (t.content.length == 0)
|
|
1349
1346
|
return null;
|
|
@@ -1616,7 +1613,7 @@ class N extends u {
|
|
|
1616
1613
|
}
|
|
1617
1614
|
}
|
|
1618
1615
|
export {
|
|
1619
|
-
|
|
1616
|
+
g as ArrayCollapseTransformer,
|
|
1620
1617
|
B as DocumentThinningTransformer,
|
|
1621
1618
|
u as IdentityTransformer,
|
|
1622
1619
|
w as NodeVisitor,
|
package/dist/types.d.ts
CHANGED