@e-mc/document 0.10.2 → 0.10.4
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/README.md +9 -9
- package/asset.d.ts +1 -1
- package/index.d.ts +4 -4
- package/package.json +7 -5
- package/parse/dom.js +1 -1
- package/parse/index.js +1 -1
- package/parse/types/index.d.ts +3 -3
- package/transform/index.d.ts +7 -7
- package/transform/index.js +1 -1
- package/util.js +11 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.10.4/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { DataSource, ViewEngine } from "./squared";
|
|
@@ -183,14 +183,14 @@ NOTE: **@e-mc/document** is an abstract base class and cannot be instantiated. *
|
|
|
183
183
|
|
|
184
184
|
## References
|
|
185
185
|
|
|
186
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
187
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
188
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
189
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
190
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
191
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
192
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
193
|
-
- https://www.unpkg.com/@e-mc/types@0.10.
|
|
186
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/squared.d.ts
|
|
187
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/asset.d.ts
|
|
188
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/core.d.ts
|
|
189
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/document.d.ts
|
|
190
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/filemanager.d.ts
|
|
191
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/logger.d.ts
|
|
192
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/settings.d.ts
|
|
193
|
+
- https://www.unpkg.com/@e-mc/types@0.10.4/lib/watch.d.ts
|
|
194
194
|
|
|
195
195
|
## LICENSE
|
|
196
196
|
|
package/asset.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DocumentConstructor, IFileManager } from '
|
|
2
|
-
|
|
3
|
-
declare const Document: DocumentConstructor<IFileManager>;
|
|
4
|
-
|
|
1
|
+
import type { DocumentConstructor, IFileManager } from '@e-mc/types/lib';
|
|
2
|
+
|
|
3
|
+
declare const Document: DocumentConstructor<IFileManager>;
|
|
4
|
+
|
|
5
5
|
export = Document;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/document",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Document constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -17,13 +17,15 @@
|
|
|
17
17
|
"squared-functions"
|
|
18
18
|
],
|
|
19
19
|
"author": "An Pham <anpham6@gmail.com>",
|
|
20
|
-
"license": "BSD
|
|
20
|
+
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/core": "0.10.
|
|
24
|
-
"@e-mc/db": "0.10.
|
|
25
|
-
"@e-mc/types": "0.10.
|
|
23
|
+
"@e-mc/core": "0.10.4",
|
|
24
|
+
"@e-mc/db": "0.10.4",
|
|
25
|
+
"@e-mc/types": "0.10.4",
|
|
26
26
|
"chalk": "4.1.2",
|
|
27
|
+
"domhandler": "^5.0.3",
|
|
28
|
+
"domutils": "^3.1.0",
|
|
27
29
|
"htmlparser2": "^9.1.0",
|
|
28
30
|
"js-yaml": "^4.1.0",
|
|
29
31
|
"picomatch": "^4.0.2"
|
package/parse/dom.js
CHANGED
|
@@ -3,9 +3,9 @@ exports.IGNORE_FLAG = exports.HtmlElement = exports.DomWriter = void 0;
|
|
|
3
3
|
const htmlparser2 = require("htmlparser2");
|
|
4
4
|
const domhandler = require("domhandler");
|
|
5
5
|
const domutils = require("domutils");
|
|
6
|
+
const types_1 = require("@e-mc/types");
|
|
6
7
|
const index_1 = require("@e-mc/document/parse");
|
|
7
8
|
Object.defineProperty(exports, "IGNORE_FLAG", { enumerable: true, get: function () { return index_1.IGNORE_FLAG; } });
|
|
8
|
-
const types_1 = require("@e-mc/types");
|
|
9
9
|
const util_1 = require("@e-mc/document/util");
|
|
10
10
|
const Parser = htmlparser2.Parser;
|
|
11
11
|
const DomHandler = domhandler.DomHandler;
|
package/parse/index.js
CHANGED
|
@@ -4,8 +4,8 @@ const htmlparser2 = require("htmlparser2");
|
|
|
4
4
|
const domhandler = require("domhandler");
|
|
5
5
|
const domutils = require("domutils");
|
|
6
6
|
const crypto = require("crypto");
|
|
7
|
-
const module_1 = require("@e-mc/module");
|
|
8
7
|
const types_1 = require("@e-mc/types");
|
|
8
|
+
const module_1 = require("@e-mc/module");
|
|
9
9
|
const util_1 = require("@e-mc/document/util");
|
|
10
10
|
var IGNORE_FLAG;
|
|
11
11
|
(function (IGNORE_FLAG) {
|
package/parse/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { XmlTagNode as IXmlTagNode, TagAppend, TagData } from '
|
|
1
|
+
import type { XmlTagNode as IXmlTagNode, TagAppend, TagData } from '@e-mc/types/lib/squared';
|
|
2
2
|
|
|
3
3
|
import type { ParserOptions } from 'htmlparser2';
|
|
4
4
|
import type { AnyNode, Element } from 'domhandler';
|
|
@@ -150,8 +150,8 @@ export interface XmlWriterConstructor {
|
|
|
150
150
|
readonly PATTERN_QUOTEVALUE: string;
|
|
151
151
|
readonly PATTERN_COMMENT: string;
|
|
152
152
|
readonly PATTERN_TRAILINGSPACE: string;
|
|
153
|
-
replaceMatch(match: RegExpMatchArray, source: string, content:
|
|
154
|
-
replaceMatch(match: RegExpMatchArray, source: string, content?:
|
|
153
|
+
replaceMatch(match: RegExpMatchArray, source: string, content: NumString, options: ReplaceMatchOptions): string;
|
|
154
|
+
replaceMatch(match: RegExpMatchArray, source: string, content?: NumString, pattern?: RegExp): string;
|
|
155
155
|
escapeXmlString(value: string, ampersand?: boolean): string;
|
|
156
156
|
escapeAttributes(source: string): string;
|
|
157
157
|
getNewlineString(leading: string, trailing: string, newline?: string): string;
|
package/transform/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SourceMapConstructor, TransformSeriesConstructor } from '
|
|
2
|
-
|
|
3
|
-
declare namespace transform {
|
|
4
|
-
const TransformSeries: TransformSeriesConstructor;
|
|
5
|
-
const SourceMap: SourceMapConstructor;
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
import type { SourceMapConstructor, TransformSeriesConstructor } from '@e-mc/types/lib/document';
|
|
2
|
+
|
|
3
|
+
declare namespace transform {
|
|
4
|
+
const TransformSeries: TransformSeriesConstructor;
|
|
5
|
+
const SourceMap: SourceMapConstructor;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
8
|
export = transform;
|
package/transform/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
var _a, _b, _c, _d;
|
|
3
3
|
exports.SourceMap = exports.TransformSeries = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const core_1 = require("@e-mc/core");
|
|
6
5
|
const types_1 = require("@e-mc/types");
|
|
6
|
+
const core_1 = require("@e-mc/core");
|
|
7
7
|
const kCode = Symbol('code');
|
|
8
8
|
const kMap = Symbol('map');
|
|
9
9
|
const kOut = Symbol('out');
|
package/util.js
CHANGED
|
@@ -22,10 +22,18 @@ function loadPlugins(name, plugins = []) {
|
|
|
22
22
|
plugins = name;
|
|
23
23
|
}
|
|
24
24
|
const result = [];
|
|
25
|
-
for (const plugin of plugins.map(item => (0, types_1.isString)(item) ? [item] : Array.isArray(item) && (0, types_1.isString)(item[0]) ? item : null)) {
|
|
25
|
+
for (const plugin of plugins.map(item => (0, types_1.isString)(item) ? [item, undefined] : Array.isArray(item) && (0, types_1.isString)(item[0]) ? item : null)) {
|
|
26
26
|
if (plugin) {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
let method = require(plugin[0]), options = plugin[1];
|
|
28
|
+
if ((0, types_1.isPlainObject)(method)) {
|
|
29
|
+
const attr = options?.__default__;
|
|
30
|
+
if ((0, types_1.isString)(attr)) {
|
|
31
|
+
method = method[attr];
|
|
32
|
+
options = { ...options };
|
|
33
|
+
delete options.__default__;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
result.push(method(options));
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
39
|
return result;
|