@accordproject/concerto-util 4.2.0 → 5.0.0-beta.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/baseexception.d.ts +2 -1
- package/dist/baseexception.js +5 -2
- package/dist/basefileexception.d.ts +3 -2
- package/dist/basefileexception.js +10 -4
- package/dist/esm/baseexception.mjs +13 -0
- package/dist/esm/baseexception.mjs.map +7 -0
- package/dist/esm/basefileexception.mjs +14 -0
- package/dist/esm/basefileexception.mjs.map +7 -0
- package/dist/esm/chunk-3RJ6JXLX.mjs +29 -0
- package/dist/esm/chunk-3RJ6JXLX.mjs.map +7 -0
- package/dist/esm/chunk-3U4T7O4P.mjs +41 -0
- package/dist/esm/chunk-3U4T7O4P.mjs.map +7 -0
- package/dist/esm/chunk-D4MNWWBB.mjs +43 -0
- package/dist/esm/chunk-D4MNWWBB.mjs.map +7 -0
- package/dist/esm/chunk-DTVQ7VXD.mjs +30 -0
- package/dist/esm/chunk-DTVQ7VXD.mjs.map +7 -0
- package/dist/esm/chunk-FHUVVHGR.mjs +48 -0
- package/dist/esm/chunk-FHUVVHGR.mjs.map +7 -0
- package/dist/esm/chunk-FK2LDKS6.mjs +36 -0
- package/dist/esm/chunk-FK2LDKS6.mjs.map +7 -0
- package/dist/esm/chunk-G6IDW2UD.mjs +183 -0
- package/dist/esm/chunk-G6IDW2UD.mjs.map +7 -0
- package/dist/esm/chunk-GOLEPEBI.mjs +56 -0
- package/dist/esm/chunk-GOLEPEBI.mjs.map +7 -0
- package/dist/esm/chunk-I33X6SGY.mjs +70 -0
- package/dist/esm/chunk-I33X6SGY.mjs.map +7 -0
- package/dist/esm/chunk-K4OOJFK5.mjs +93 -0
- package/dist/esm/chunk-K4OOJFK5.mjs.map +7 -0
- package/dist/esm/chunk-LPNGJFU2.mjs +22 -0
- package/dist/esm/chunk-LPNGJFU2.mjs.map +7 -0
- package/dist/esm/chunk-PBL5N3A2.mjs +33 -0
- package/dist/esm/chunk-PBL5N3A2.mjs.map +7 -0
- package/dist/esm/chunk-PMP2SMHG.mjs +17 -0
- package/dist/esm/chunk-PMP2SMHG.mjs.map +7 -0
- package/dist/esm/chunk-Q6G4HQJ7.mjs +151 -0
- package/dist/esm/chunk-Q6G4HQJ7.mjs.map +7 -0
- package/dist/esm/chunk-RBUQLLXW.mjs +51 -0
- package/dist/esm/chunk-RBUQLLXW.mjs.map +7 -0
- package/dist/esm/chunk-T6ZBQYEB.mjs +97 -0
- package/dist/esm/chunk-T6ZBQYEB.mjs.map +7 -0
- package/dist/esm/chunk-TP3CT6S4.mjs +35 -0
- package/dist/esm/chunk-TP3CT6S4.mjs.map +7 -0
- package/dist/esm/chunk-WPVG6LP3.mjs +63 -0
- package/dist/esm/chunk-WPVG6LP3.mjs.map +7 -0
- package/dist/esm/chunk-YQVUNOO6.mjs +93 -0
- package/dist/esm/chunk-YQVUNOO6.mjs.map +7 -0
- package/dist/esm/errorcodes.mjs +22 -0
- package/dist/esm/errorcodes.mjs.map +7 -0
- package/dist/esm/filedownloader.mjs +12 -0
- package/dist/esm/filedownloader.mjs.map +7 -0
- package/dist/esm/filewriter.mjs +13 -0
- package/dist/esm/filewriter.mjs.map +7 -0
- package/dist/esm/identifiers.mjs +12 -0
- package/dist/esm/identifiers.mjs.map +7 -0
- package/dist/esm/index.mjs +78 -0
- package/dist/esm/index.mjs.map +7 -0
- package/dist/esm/inmemorywriter.mjs +13 -0
- package/dist/esm/inmemorywriter.mjs.map +7 -0
- package/dist/esm/label.mjs +12 -0
- package/dist/esm/label.mjs.map +7 -0
- package/dist/esm/loaders/compositefileloader.mjs +12 -0
- package/dist/esm/loaders/compositefileloader.mjs.map +7 -0
- package/dist/esm/loaders/defaultfileloader.mjs +15 -0
- package/dist/esm/loaders/defaultfileloader.mjs.map +7 -0
- package/dist/esm/loaders/fileloader.mjs +3 -0
- package/dist/esm/loaders/fileloader.mjs.map +7 -0
- package/dist/esm/loaders/githubfileloader.mjs +13 -0
- package/dist/esm/loaders/githubfileloader.mjs.map +7 -0
- package/dist/esm/loaders/httpfileloader.mjs +12 -0
- package/dist/esm/loaders/httpfileloader.mjs.map +7 -0
- package/dist/esm/logger.mjs +12 -0
- package/dist/esm/logger.mjs.map +7 -0
- package/dist/esm/modelwriter.mjs +10 -0
- package/dist/esm/modelwriter.mjs.map +7 -0
- package/dist/esm/null.mjs +12 -0
- package/dist/esm/null.mjs.map +7 -0
- package/dist/esm/typedstack.mjs +12 -0
- package/dist/esm/typedstack.mjs.map +7 -0
- package/dist/esm/warning.mjs +10 -0
- package/dist/esm/warning.mjs.map +7 -0
- package/dist/esm/writer.mjs +12 -0
- package/dist/esm/writer.mjs.map +7 -0
- package/dist/esm-browser/baseexception.mjs +11 -0
- package/dist/esm-browser/baseexception.mjs.map +7 -0
- package/dist/esm-browser/basefileexception.mjs +12 -0
- package/dist/esm-browser/basefileexception.mjs.map +7 -0
- package/dist/esm-browser/chunk-3XGAUT4O.mjs +100 -0
- package/dist/esm-browser/chunk-3XGAUT4O.mjs.map +7 -0
- package/dist/esm-browser/chunk-4X5DBZDM.mjs +24 -0
- package/dist/esm-browser/chunk-4X5DBZDM.mjs.map +7 -0
- package/dist/esm-browser/chunk-6SOOHVQB.mjs +65 -0
- package/dist/esm-browser/chunk-6SOOHVQB.mjs.map +7 -0
- package/dist/esm-browser/chunk-7DYPHXUR.mjs +50 -0
- package/dist/esm-browser/chunk-7DYPHXUR.mjs.map +7 -0
- package/dist/esm-browser/chunk-7LYWQ57N.mjs +461 -0
- package/dist/esm-browser/chunk-7LYWQ57N.mjs.map +7 -0
- package/dist/esm-browser/chunk-BDMF4RRF.mjs +72 -0
- package/dist/esm-browser/chunk-BDMF4RRF.mjs.map +7 -0
- package/dist/esm-browser/chunk-BSBOEFWN.mjs +57 -0
- package/dist/esm-browser/chunk-BSBOEFWN.mjs.map +7 -0
- package/dist/esm-browser/chunk-DOL2YKDZ.mjs +26 -0
- package/dist/esm-browser/chunk-DOL2YKDZ.mjs.map +7 -0
- package/dist/esm-browser/chunk-EGOFDABS.mjs +62 -0
- package/dist/esm-browser/chunk-EGOFDABS.mjs.map +7 -0
- package/dist/esm-browser/chunk-LZTTRWN3.mjs +153 -0
- package/dist/esm-browser/chunk-LZTTRWN3.mjs.map +7 -0
- package/dist/esm-browser/chunk-MCUSZIV7.mjs +41 -0
- package/dist/esm-browser/chunk-MCUSZIV7.mjs.map +7 -0
- package/dist/esm-browser/chunk-N42BHUZ6.mjs +35 -0
- package/dist/esm-browser/chunk-N42BHUZ6.mjs.map +7 -0
- package/dist/esm-browser/chunk-NAP47VIV.mjs +36 -0
- package/dist/esm-browser/chunk-NAP47VIV.mjs.map +7 -0
- package/dist/esm-browser/chunk-NQ5PDAAD.mjs +95 -0
- package/dist/esm-browser/chunk-NQ5PDAAD.mjs.map +7 -0
- package/dist/esm-browser/chunk-NSJTBLWA.mjs +71 -0
- package/dist/esm-browser/chunk-NSJTBLWA.mjs.map +7 -0
- package/dist/esm-browser/chunk-R6CSKES3.mjs +183 -0
- package/dist/esm-browser/chunk-R6CSKES3.mjs.map +7 -0
- package/dist/esm-browser/chunk-S52XDDAF.mjs +30 -0
- package/dist/esm-browser/chunk-S52XDDAF.mjs.map +7 -0
- package/dist/esm-browser/chunk-SU6SG5PJ.mjs +45 -0
- package/dist/esm-browser/chunk-SU6SG5PJ.mjs.map +7 -0
- package/dist/esm-browser/chunk-WCGRUR5U.mjs +30 -0
- package/dist/esm-browser/chunk-WCGRUR5U.mjs.map +7 -0
- package/dist/esm-browser/chunk-YJQCJTA7.mjs +53 -0
- package/dist/esm-browser/chunk-YJQCJTA7.mjs.map +7 -0
- package/dist/esm-browser/chunk-YURYZDD2.mjs +453 -0
- package/dist/esm-browser/chunk-YURYZDD2.mjs.map +7 -0
- package/dist/esm-browser/errorcodes.mjs +20 -0
- package/dist/esm-browser/errorcodes.mjs.map +7 -0
- package/dist/esm-browser/filedownloader.mjs +11 -0
- package/dist/esm-browser/filedownloader.mjs.map +7 -0
- package/dist/esm-browser/filewriter.mjs +12 -0
- package/dist/esm-browser/filewriter.mjs.map +7 -0
- package/dist/esm-browser/identifiers.mjs +10 -0
- package/dist/esm-browser/identifiers.mjs.map +7 -0
- package/dist/esm-browser/index.mjs +83 -0
- package/dist/esm-browser/index.mjs.map +7 -0
- package/dist/esm-browser/inmemorywriter.mjs +11 -0
- package/dist/esm-browser/inmemorywriter.mjs.map +7 -0
- package/dist/esm-browser/label.mjs +10 -0
- package/dist/esm-browser/label.mjs.map +7 -0
- package/dist/esm-browser/loaders/compositefileloader.mjs +10 -0
- package/dist/esm-browser/loaders/compositefileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/defaultfileloader.mjs +14 -0
- package/dist/esm-browser/loaders/defaultfileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/fileloader.mjs +7 -0
- package/dist/esm-browser/loaders/fileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/githubfileloader.mjs +12 -0
- package/dist/esm-browser/loaders/githubfileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/httpfileloader.mjs +11 -0
- package/dist/esm-browser/loaders/httpfileloader.mjs.map +7 -0
- package/dist/esm-browser/logger.mjs +10 -0
- package/dist/esm-browser/logger.mjs.map +7 -0
- package/dist/esm-browser/modelwriter.mjs +9 -0
- package/dist/esm-browser/modelwriter.mjs.map +7 -0
- package/dist/esm-browser/null.mjs +10 -0
- package/dist/esm-browser/null.mjs.map +7 -0
- package/dist/esm-browser/typedstack.mjs +10 -0
- package/dist/esm-browser/typedstack.mjs.map +7 -0
- package/dist/esm-browser/warning.mjs +8 -0
- package/dist/esm-browser/warning.mjs.map +7 -0
- package/dist/esm-browser/writer.mjs +10 -0
- package/dist/esm-browser/writer.mjs.map +7 -0
- package/dist/filedownloader.d.ts +14 -6
- package/dist/filedownloader.js +32 -12
- package/dist/filewriter.d.ts +3 -2
- package/dist/filewriter.js +10 -4
- package/dist/identifiers.js +4 -2
- package/dist/index.d.ts +18 -17
- package/dist/index.js +34 -31
- package/dist/inmemorywriter.d.ts +3 -2
- package/dist/inmemorywriter.js +10 -4
- package/dist/loaders/compositefileloader.d.ts +2 -1
- package/dist/loaders/compositefileloader.js +5 -2
- package/dist/loaders/defaultfileloader.d.ts +3 -2
- package/dist/loaders/defaultfileloader.js +14 -8
- package/dist/loaders/githubfileloader.d.ts +3 -2
- package/dist/loaders/githubfileloader.js +10 -4
- package/dist/loaders/httpfileloader.d.ts +2 -1
- package/dist/loaders/httpfileloader.js +10 -3
- package/dist/logger.d.ts +2 -1
- package/dist/logger.js +5 -2
- package/dist/modelwriter.js +6 -4
- package/dist/null.d.ts +3 -2
- package/dist/null.js +5 -2
- package/dist/typedstack.d.ts +2 -1
- package/dist/typedstack.js +5 -2
- package/dist/writer.d.ts +2 -1
- package/dist/writer.js +5 -2
- package/package.json +16 -8
- package/dist/concerto-util.js +0 -2
- package/dist/concerto-util.js.LICENSE.txt +0 -19
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
GitHubFileLoader,
|
|
5
|
+
githubfileloader_default
|
|
6
|
+
} from "../chunk-D4MNWWBB.mjs";
|
|
7
|
+
import "../chunk-GOLEPEBI.mjs";
|
|
8
|
+
import "../chunk-PMP2SMHG.mjs";
|
|
9
|
+
export {
|
|
10
|
+
GitHubFileLoader,
|
|
11
|
+
githubfileloader_default as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=githubfileloader.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
HTTPFileLoader,
|
|
5
|
+
httpfileloader_default
|
|
6
|
+
} from "../chunk-GOLEPEBI.mjs";
|
|
7
|
+
import "../chunk-PMP2SMHG.mjs";
|
|
8
|
+
export {
|
|
9
|
+
HTTPFileLoader,
|
|
10
|
+
httpfileloader_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=httpfileloader.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
Logger,
|
|
5
|
+
logger_default
|
|
6
|
+
} from "./chunk-Q6G4HQJ7.mjs";
|
|
7
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
8
|
+
export {
|
|
9
|
+
Logger,
|
|
10
|
+
logger_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=logger.mjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
writeModelsToFileSystem
|
|
5
|
+
} from "./chunk-TP3CT6S4.mjs";
|
|
6
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
7
|
+
export {
|
|
8
|
+
writeModelsToFileSystem
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=modelwriter.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
NullUtil,
|
|
5
|
+
null_default
|
|
6
|
+
} from "./chunk-LPNGJFU2.mjs";
|
|
7
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
8
|
+
export {
|
|
9
|
+
NullUtil,
|
|
10
|
+
null_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=null.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
TypedStack,
|
|
5
|
+
typedstack_default
|
|
6
|
+
} from "./chunk-WPVG6LP3.mjs";
|
|
7
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
8
|
+
export {
|
|
9
|
+
TypedStack,
|
|
10
|
+
typedstack_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=typedstack.mjs.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
printDeprecationWarning
|
|
5
|
+
} from "./chunk-3RJ6JXLX.mjs";
|
|
6
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
7
|
+
export {
|
|
8
|
+
printDeprecationWarning
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=warning.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
Writer,
|
|
5
|
+
writer_default
|
|
6
|
+
} from "./chunk-K4OOJFK5.mjs";
|
|
7
|
+
import "./chunk-PMP2SMHG.mjs";
|
|
8
|
+
export {
|
|
9
|
+
Writer,
|
|
10
|
+
writer_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=writer.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseException,
|
|
3
|
+
baseexception_default
|
|
4
|
+
} from "./chunk-R6CSKES3.mjs";
|
|
5
|
+
import "./chunk-NAP47VIV.mjs";
|
|
6
|
+
import "./chunk-NSJTBLWA.mjs";
|
|
7
|
+
export {
|
|
8
|
+
BaseException,
|
|
9
|
+
baseexception_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=baseexception.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseFileException,
|
|
3
|
+
basefileexception_default
|
|
4
|
+
} from "./chunk-YJQCJTA7.mjs";
|
|
5
|
+
import "./chunk-R6CSKES3.mjs";
|
|
6
|
+
import "./chunk-NAP47VIV.mjs";
|
|
7
|
+
import "./chunk-NSJTBLWA.mjs";
|
|
8
|
+
export {
|
|
9
|
+
BaseFileException,
|
|
10
|
+
basefileexception_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=basefileexception.mjs.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_fs,
|
|
3
|
+
require_path
|
|
4
|
+
} from "./chunk-DOL2YKDZ.mjs";
|
|
5
|
+
import {
|
|
6
|
+
writer_default
|
|
7
|
+
} from "./chunk-NQ5PDAAD.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__toESM,
|
|
10
|
+
init_browser_process_shim
|
|
11
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
12
|
+
|
|
13
|
+
// src/filewriter.ts
|
|
14
|
+
init_browser_process_shim();
|
|
15
|
+
var fs = __toESM(require_fs());
|
|
16
|
+
var path = __toESM(require_path());
|
|
17
|
+
var FileWriter = class extends writer_default {
|
|
18
|
+
/**
|
|
19
|
+
* Create a FileWriter.
|
|
20
|
+
* @param outputDirectory - the output directory
|
|
21
|
+
*/
|
|
22
|
+
constructor(outputDirectory) {
|
|
23
|
+
super();
|
|
24
|
+
this.fileName = null;
|
|
25
|
+
this.relativeDir = null;
|
|
26
|
+
this.outputDirectory = outputDirectory;
|
|
27
|
+
this.relativeDir = null;
|
|
28
|
+
this.fileName = null;
|
|
29
|
+
fs.mkdirSync(outputDirectory, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Open a file for writing. The file is created in the
|
|
33
|
+
* output directory.
|
|
34
|
+
* @param fileName - the name of the file to open
|
|
35
|
+
*/
|
|
36
|
+
openFile(fileName) {
|
|
37
|
+
this.fileName = fileName;
|
|
38
|
+
this.relativeDir = null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Open a file for writing. The file is created in the
|
|
42
|
+
* output directory, plus the relative directory path.
|
|
43
|
+
* @param relativeDir - the relative directory
|
|
44
|
+
* @param fileName - the name of the file to open
|
|
45
|
+
*/
|
|
46
|
+
openRelativeFile(relativeDir, fileName) {
|
|
47
|
+
this.fileName = fileName;
|
|
48
|
+
this.relativeDir = relativeDir;
|
|
49
|
+
this.clearBuffer();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Writes text to the current open file
|
|
53
|
+
* @param tabs - the number of tabs to use
|
|
54
|
+
* @param text - the text to write
|
|
55
|
+
*/
|
|
56
|
+
writeLine(tabs, text) {
|
|
57
|
+
if (this.fileName) {
|
|
58
|
+
super.writeLine(tabs, text);
|
|
59
|
+
} else {
|
|
60
|
+
throw new Error("File has not been opened!");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Writes text to the start of the current open file
|
|
65
|
+
* @param tabs - the number of tabs to use
|
|
66
|
+
* @param text - the text to write
|
|
67
|
+
*/
|
|
68
|
+
writeBeforeLine(tabs, text) {
|
|
69
|
+
if (this.fileName) {
|
|
70
|
+
super.writeBeforeLine(tabs, text);
|
|
71
|
+
} else {
|
|
72
|
+
throw new Error("File has not been opened!");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Closes the file, flushing the buffer to disk.
|
|
77
|
+
*/
|
|
78
|
+
closeFile() {
|
|
79
|
+
if (!this.fileName) {
|
|
80
|
+
throw new Error("No file open");
|
|
81
|
+
}
|
|
82
|
+
let filePath = this.outputDirectory;
|
|
83
|
+
if (this.relativeDir) {
|
|
84
|
+
filePath = path.resolve(filePath, this.relativeDir);
|
|
85
|
+
}
|
|
86
|
+
filePath = path.resolve(filePath, this.fileName);
|
|
87
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
88
|
+
fs.writeFileSync(filePath, this.getBuffer());
|
|
89
|
+
this.fileName = null;
|
|
90
|
+
this.relativeDir = null;
|
|
91
|
+
this.clearBuffer();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var filewriter_default = FileWriter;
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
FileWriter,
|
|
98
|
+
filewriter_default
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=chunk-3XGAUT4O.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/filewriter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport Writer from './writer';\n\n/**\n * FileWriter buffers text to be written to a file.\n * @private\n * @class\n * @memberof module:concerto-util\n */\nclass FileWriter extends Writer {\n public outputDirectory: string;\n public fileName: string | null = null;\n public relativeDir: string | null = null;\n\n /**\n * Create a FileWriter.\n * @param outputDirectory - the output directory\n */\n constructor(outputDirectory: string) {\n super();\n this.outputDirectory = outputDirectory;\n this.relativeDir = null;\n this.fileName = null;\n fs.mkdirSync(outputDirectory, {recursive:true});\n }\n\n /**\n * Open a file for writing. The file is created in the\n * output directory.\n * @param fileName - the name of the file to open\n */\n openFile(fileName: string): void {\n this.fileName = fileName;\n this.relativeDir = null;\n }\n\n /**\n * Open a file for writing. The file is created in the\n * output directory, plus the relative directory path.\n * @param relativeDir - the relative directory\n * @param fileName - the name of the file to open\n */\n openRelativeFile(relativeDir: string, fileName: string): void {\n this.fileName = fileName;\n this.relativeDir = relativeDir;\n this.clearBuffer();\n }\n\n /**\n * Writes text to the current open file\n * @param tabs - the number of tabs to use\n * @param text - the text to write\n */\n writeLine(tabs: number, text: string): void {\n if (this.fileName) {\n super.writeLine(tabs,text);\n } else {\n throw new Error('File has not been opened!');\n }\n }\n\n /**\n * Writes text to the start of the current open file\n * @param tabs - the number of tabs to use\n * @param text - the text to write\n */\n writeBeforeLine(tabs: number, text: string): void {\n if (this.fileName) {\n super.writeBeforeLine(tabs,text);\n } else {\n throw new Error('File has not been opened!');\n }\n }\n\n /**\n * Closes the file, flushing the buffer to disk.\n */\n closeFile(): void {\n if (!this.fileName) {\n throw new Error('No file open');\n }\n\n let filePath = this.outputDirectory;\n if (this.relativeDir) {\n filePath = path.resolve(filePath, this.relativeDir);\n }\n filePath = path.resolve(filePath, this.fileName);\n\n //console.log('Writing to ' + filePath );\n fs.mkdirSync(path.dirname(filePath), {recursive:true});\n fs.writeFileSync(filePath, this.getBuffer());\n\n this.fileName = null;\n this.relativeDir = null;\n this.clearBuffer();\n }\n}\n\nexport { FileWriter };\nexport default FileWriter;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA;AAcA,SAAoB;AACpB,WAAsB;AAStB,IAAM,aAAN,cAAyB,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5B,YAAY,iBAAyB;AACjC,UAAM;AARV,SAAO,WAA0B;AACjC,SAAO,cAA6B;AAQhC,SAAK,kBAAkB;AACvB,SAAK,cAAc;AACnB,SAAK,WAAW;AAChB,IAAG,aAAU,iBAAiB,EAAC,WAAU,KAAI,CAAC;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,UAAwB;AAC7B,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,iBAAiB,aAAqB,UAAwB;AAC1D,SAAK,WAAW;AAChB,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,UAAU,MAAc,MAAoB;AACxC,QAAI,KAAK,UAAU;AACf,YAAM,UAAU,MAAK,IAAI;AAAA,IAC7B,OAAO;AACH,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC/C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgB,MAAc,MAAoB;AAC9C,QAAI,KAAK,UAAU;AACf,YAAM,gBAAgB,MAAK,IAAI;AAAA,IACnC,OAAO;AACH,YAAM,IAAI,MAAM,2BAA2B;AAAA,IAC/C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,YAAkB;AACd,QAAI,CAAC,KAAK,UAAU;AAChB,YAAM,IAAI,MAAM,cAAc;AAAA,IAClC;AAEA,QAAI,WAAW,KAAK;AACpB,QAAI,KAAK,aAAa;AAClB,iBAAgB,aAAQ,UAAU,KAAK,WAAW;AAAA,IACtD;AACA,eAAgB,aAAQ,UAAU,KAAK,QAAQ;AAG/C,IAAG,aAAe,aAAQ,QAAQ,GAAG,EAAC,WAAU,KAAI,CAAC;AACrD,IAAG,iBAAc,UAAU,KAAK,UAAU,CAAC;AAE3C,SAAK,WAAW;AAChB,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EACrB;AACJ;AAGA,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_browser_process_shim
|
|
3
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
4
|
+
|
|
5
|
+
// src/null.ts
|
|
6
|
+
init_browser_process_shim();
|
|
7
|
+
var NullUtil = class {
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if the typeof the object === 'undefined' or
|
|
10
|
+
* the object === null.
|
|
11
|
+
* @param obj - the object to be tested
|
|
12
|
+
* @returns true if the object is null or undefined
|
|
13
|
+
*/
|
|
14
|
+
static isNull(obj) {
|
|
15
|
+
return typeof obj === "undefined" || obj === null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var null_default = NullUtil;
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
NullUtil,
|
|
22
|
+
null_default
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-4X5DBZDM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/null.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Internal Utility Class\n * @class\n * @memberof module:concerto-util\n */\nclass NullUtil {\n\n /**\n * Returns true if the typeof the object === 'undefined' or\n * the object === null.\n * @param obj - the object to be tested\n * @returns true if the object is null or undefined\n */\n static isNull(obj: unknown): obj is null | undefined {\n return(typeof(obj) === 'undefined' || obj === null);\n }\n}\n\nexport { NullUtil };\nexport default NullUtil;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;AAmBA,IAAM,WAAN,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQX,OAAO,OAAO,KAAuC;AACjD,WAAO,OAAO,QAAS,eAAe,QAAQ;AAAA,EAClD;AACJ;AAGA,IAAO,eAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_browser_process_shim
|
|
3
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
4
|
+
|
|
5
|
+
// src/typedstack.ts
|
|
6
|
+
init_browser_process_shim();
|
|
7
|
+
var TypedStack = class {
|
|
8
|
+
/**
|
|
9
|
+
* Create the Stack with the resource at the head.
|
|
10
|
+
* @param resource - the resource to be put at the head of the stack
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
constructor(resource) {
|
|
14
|
+
this.stack = [];
|
|
15
|
+
this.push(resource);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Push a new object.
|
|
19
|
+
* @param obj - the object being visited
|
|
20
|
+
* @param expectedType - the expected type of the object being pushed
|
|
21
|
+
*/
|
|
22
|
+
push(obj, expectedType) {
|
|
23
|
+
if (expectedType && !(obj instanceof expectedType)) {
|
|
24
|
+
throw new Error("Did not find expected type " + expectedType.name + " as argument to push. Found: " + obj?.toString());
|
|
25
|
+
}
|
|
26
|
+
this.stack.push(obj);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Push a new object.
|
|
30
|
+
* @param expectedType - the type that should be the result of pop
|
|
31
|
+
* @return the result of pop
|
|
32
|
+
*/
|
|
33
|
+
pop(expectedType) {
|
|
34
|
+
this.peek(expectedType);
|
|
35
|
+
return this.stack.pop();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Peek the top of the stack
|
|
39
|
+
* @param expectedType - the type that should be the result of pop
|
|
40
|
+
* @return the result of peek
|
|
41
|
+
*/
|
|
42
|
+
peek(expectedType) {
|
|
43
|
+
if (this.stack.length < 1) {
|
|
44
|
+
throw new Error("Stack is empty!");
|
|
45
|
+
}
|
|
46
|
+
const result = this.stack[this.stack.length - 1];
|
|
47
|
+
if (expectedType && !(result instanceof expectedType)) {
|
|
48
|
+
throw new Error("Did not find expected type " + expectedType.name + " on head of stack. Found: " + result);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Clears the stack
|
|
54
|
+
*/
|
|
55
|
+
clear() {
|
|
56
|
+
this.stack = [];
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var typedstack_default = TypedStack;
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
TypedStack,
|
|
63
|
+
typedstack_default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-6SOOHVQB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/typedstack.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ntype Constructor<T> = new (...args: unknown[]) => T;\n\n/**\n * Tracks a stack of typed instances. The type information is used to detect\n * overflow / underflow bugs by the caller. It also performs basic sanity\n * checking on push/pop to make detecting bugs easier.\n * @class\n * @memberof module:concerto-core\n */\nclass TypedStack<T> {\n public stack: T[];\n\n /**\n * Create the Stack with the resource at the head.\n * @param resource - the resource to be put at the head of the stack\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(resource: T) {\n this.stack = [];\n this.push(resource);\n }\n\n /**\n * Push a new object.\n * @param obj - the object being visited\n * @param expectedType - the expected type of the object being pushed\n */\n push(obj: T, expectedType?: Constructor<T>): void {\n if(expectedType && !(obj instanceof expectedType)) {\n throw new Error('Did not find expected type ' + expectedType.name + ' as argument to push. Found: ' + obj?.toString());\n }\n\n this.stack.push(obj);\n }\n\n /**\n * Push a new object.\n * @param expectedType - the type that should be the result of pop\n * @return the result of pop\n */\n pop(expectedType?: Constructor<T>): T | undefined {\n this.peek(expectedType);\n return this.stack.pop();\n }\n\n /**\n * Peek the top of the stack\n * @param expectedType - the type that should be the result of pop\n * @return the result of peek\n */\n peek(expectedType?: Constructor<T>): T {\n\n if(this.stack.length < 1) {\n throw new Error('Stack is empty!');\n }\n\n const result = this.stack[this.stack.length-1];\n if(expectedType && !(result instanceof expectedType)) {\n throw new Error('Did not find expected type ' + expectedType.name + ' on head of stack. Found: ' + result);\n }\n\n return result;\n }\n\n /**\n * Clears the stack\n */\n clear(): void {\n this.stack = [];\n }\n}\n\nexport { TypedStack };\nexport default TypedStack;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;AAuBA,IAAM,aAAN,MAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhB,YAAY,UAAa;AACrB,SAAK,QAAQ,CAAC;AACd,SAAK,KAAK,QAAQ;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,KAAK,KAAQ,cAAqC;AAC9C,QAAG,gBAAgB,EAAE,eAAe,eAAe;AAC/C,YAAM,IAAI,MAAM,gCAAgC,aAAa,OAAO,kCAAkC,KAAK,SAAS,CAAC;AAAA,IACzH;AAEA,SAAK,MAAM,KAAK,GAAG;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,cAA8C;AAC9C,SAAK,KAAK,YAAY;AACtB,WAAO,KAAK,MAAM,IAAI;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,KAAK,cAAkC;AAEnC,QAAG,KAAK,MAAM,SAAS,GAAG;AACtB,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACrC;AAEA,UAAM,SAAS,KAAK,MAAM,KAAK,MAAM,SAAO,CAAC;AAC7C,QAAG,gBAAgB,EAAE,kBAAkB,eAAe;AAClD,YAAM,IAAI,MAAM,gCAAgC,aAAa,OAAO,+BAA+B,MAAM;AAAA,IAC7G;AAEA,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,QAAc;AACV,SAAK,QAAQ,CAAC;AAAA,EAClB;AACJ;AAGA,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
writer_default
|
|
3
|
+
} from "./chunk-NQ5PDAAD.mjs";
|
|
4
|
+
import {
|
|
5
|
+
init_browser_process_shim
|
|
6
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
7
|
+
|
|
8
|
+
// src/inmemorywriter.ts
|
|
9
|
+
init_browser_process_shim();
|
|
10
|
+
var InMemoryWriter = class extends writer_default {
|
|
11
|
+
/**
|
|
12
|
+
* Create a FileWriter.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.fileName = "";
|
|
18
|
+
this.data = /* @__PURE__ */ new Map();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates the filename which will be used for association with its string content.
|
|
22
|
+
*
|
|
23
|
+
* @param fileName - the name of the file.
|
|
24
|
+
*/
|
|
25
|
+
openFile(fileName) {
|
|
26
|
+
this.fileName = fileName;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Writes the contents of the buffer to the Map store.
|
|
30
|
+
*/
|
|
31
|
+
closeFile() {
|
|
32
|
+
this.data.set(this.fileName, this.getBuffer());
|
|
33
|
+
this.clearBuffer();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns the content of the Map store.
|
|
37
|
+
*
|
|
38
|
+
* @return - a Map containing the string representation of files. (k,v) => (filename, file content).
|
|
39
|
+
*/
|
|
40
|
+
getFilesInMemory() {
|
|
41
|
+
return this.data;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var inmemorywriter_default = InMemoryWriter;
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
InMemoryWriter,
|
|
48
|
+
inmemorywriter_default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-7DYPHXUR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/inmemorywriter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Writer from './writer';\n\n/**\n * InMemoryWriter stores string representation of files in a map structure.\n * The Map key is the filename, and the value are its string contents.\n *\n * @private\n * @extends Writer\n * @see See {@link Writer}\n * @class\n * @memberof module:concerto-core\n */\nclass InMemoryWriter extends Writer {\n public fileName: string;\n public data: Map<string, string>;\n\n /**\n * Create a FileWriter.\n *\n */\n constructor() {\n super();\n this.fileName = '';\n this.data = new Map<string, string>();\n }\n\n /**\n * Creates the filename which will be used for association with its string content.\n *\n * @param fileName - the name of the file.\n */\n openFile(fileName: string): void {\n this.fileName = fileName;\n }\n\n /**\n * Writes the contents of the buffer to the Map store.\n */\n closeFile(): void {\n this.data.set(this.fileName, this.getBuffer());\n this.clearBuffer();\n }\n\n /**\n * Returns the content of the Map store.\n *\n * @return - a Map containing the string representation of files. (k,v) => (filename, file content).\n */\n getFilesInMemory(): Map<string, string> {\n return this.data;\n }\n}\n\nexport { InMemoryWriter };\nexport default InMemoryWriter;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAAA;AA0BA,IAAM,iBAAN,cAA6B,eAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhC,cAAc;AACV,UAAM;AACN,SAAK,WAAW;AAChB,SAAK,OAAO,oBAAI,IAAoB;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,UAAwB;AAC7B,SAAK,WAAW;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,YAAkB;AACd,SAAK,KAAK,IAAI,KAAK,UAAU,KAAK,UAAU,CAAC;AAC7C,SAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAwC;AACpC,WAAO,KAAK;AAAA,EAChB;AACJ;AAGA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|