@jxsuite/parser 1.7.0 → 1.8.0
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/content-loader.js +9 -59
- package/dist/content.js +0 -50
- package/dist/csv.js +0 -50
- package/dist/markdown.js +37199 -37290
- package/dist/serialize.js +6477 -6497
- package/package.json +6 -6
- package/src/Content.class.json +1 -1
- package/src/transpile.ts +37 -7
package/dist/content-loader.js
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
-
var __returnValue = (v) => v;
|
|
36
|
-
function __exportSetter(name, newValue) {
|
|
37
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
38
|
-
}
|
|
39
|
-
var __export = (target, all) => {
|
|
40
|
-
for (var name in all)
|
|
41
|
-
__defProp(target, name, {
|
|
42
|
-
get: all[name],
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
set: __exportSetter.bind(all, name)
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
|
-
|
|
51
1
|
// src/content-loader.ts
|
|
52
2
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
53
3
|
import { basename, dirname, extname, resolve } from "node:path";
|
|
@@ -479,14 +429,14 @@ async function loadContentType(name, contentTypeDef, projectRoot, registry, moun
|
|
|
479
429
|
throw new Error(`Content type "${name}": format "${entry.name}" does not support remote sources ` + `(its format block lacks "remote": true).`);
|
|
480
430
|
}
|
|
481
431
|
try {
|
|
482
|
-
const
|
|
432
|
+
const entries = await entry.call("load", source, {
|
|
483
433
|
directiveOptions,
|
|
484
434
|
schema
|
|
485
435
|
});
|
|
486
436
|
if (schema) {
|
|
487
|
-
validateEntries(
|
|
437
|
+
validateEntries(entries, schema, name);
|
|
488
438
|
}
|
|
489
|
-
return
|
|
439
|
+
return entries;
|
|
490
440
|
} catch (error) {
|
|
491
441
|
console.warn(`Content type "${name}": ${errorMessage(error)}`);
|
|
492
442
|
return [];
|
|
@@ -495,19 +445,19 @@ async function loadContentType(name, contentTypeDef, projectRoot, registry, moun
|
|
|
495
445
|
const resolvedSource = resolve(projectRoot, source).split("\\").join("/");
|
|
496
446
|
const ext = extname(source).toLowerCase();
|
|
497
447
|
if (formatName === "json" || !entry && ext === ".json") {
|
|
498
|
-
const
|
|
499
|
-
const
|
|
500
|
-
for (const filePath of
|
|
448
|
+
const files = discoverJSONFiles(resolvedSource);
|
|
449
|
+
const entries = [];
|
|
450
|
+
for (const filePath of files) {
|
|
501
451
|
const fileEntries = loadJSONEntries(filePath);
|
|
502
452
|
if (mount) {
|
|
503
453
|
rewriteEntryAssets(fileEntries, filePath, mount, name, schema);
|
|
504
454
|
}
|
|
505
|
-
|
|
455
|
+
entries.push(...fileEntries);
|
|
506
456
|
}
|
|
507
457
|
if (schema) {
|
|
508
|
-
validateEntries(
|
|
458
|
+
validateEntries(entries, schema, name);
|
|
509
459
|
}
|
|
510
|
-
return
|
|
460
|
+
return entries;
|
|
511
461
|
}
|
|
512
462
|
if (!entry && ext) {
|
|
513
463
|
entry = registry.byExtension(ext, "load");
|
package/dist/content.js
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
-
var __returnValue = (v) => v;
|
|
36
|
-
function __exportSetter(name, newValue) {
|
|
37
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
38
|
-
}
|
|
39
|
-
var __export = (target, all) => {
|
|
40
|
-
for (var name in all)
|
|
41
|
-
__defProp(target, name, {
|
|
42
|
-
get: all[name],
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
set: __exportSetter.bind(all, name)
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
|
-
|
|
51
1
|
// src/dates.ts
|
|
52
2
|
var DATE_FORMATS = ["date", "date-time"];
|
|
53
3
|
function isDateFormat(format) {
|
package/dist/csv.js
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
|
-
var __returnValue = (v) => v;
|
|
36
|
-
function __exportSetter(name, newValue) {
|
|
37
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
38
|
-
}
|
|
39
|
-
var __export = (target, all) => {
|
|
40
|
-
for (var name in all)
|
|
41
|
-
__defProp(target, name, {
|
|
42
|
-
get: all[name],
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
set: __exportSetter.bind(all, name)
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
|
-
|
|
51
1
|
// src/csv.ts
|
|
52
2
|
function parseCSV(csv) {
|
|
53
3
|
const rows = [];
|