@adviser/cement 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/node/index.d.ts +1 -0
- package/node/index.d.ts.map +1 -1
- package/node/index.js +1 -0
- package/node/index.js.map +1 -1
- package/node/mock_file_service.d.ts.map +1 -1
- package/node/mock_file_service.js +2 -1
- package/node/mock_file_service.js.map +1 -1
- package/node/mock_file_service.test.js +8 -4
- package/node/mock_file_service.test.js.map +1 -1
- package/package.json +4 -4
package/node/index.d.ts
CHANGED
package/node/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
package/node/index.js
CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./node_file_service"), exports);
|
18
18
|
__exportStar(require("./node_sys_abstraction"), exports);
|
19
|
+
__exportStar(require("./mock_file_service"), exports);
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/node/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,yDAAuC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,yDAAuC;AACvC,sDAAoC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mock_file_service.d.ts","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,QAAQ,CAAC,KAAK,gCAAuC;
|
1
|
+
{"version":3,"file":"mock_file_service.d.ts","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,QAAQ,CAAC,KAAK,gCAAuC;IAMtC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA2BnE"}
|
@@ -10,13 +10,14 @@ class MockFileService extends node_file_service_1.NodeFileService {
|
|
10
10
|
async create(fname) {
|
11
11
|
let oName = fname;
|
12
12
|
if (!this.isAbsolute(fname)) {
|
13
|
-
oName = this.abs(fname);
|
13
|
+
oName = await this.abs(fname);
|
14
14
|
}
|
15
15
|
const fc = {
|
16
16
|
name: oName,
|
17
17
|
content: "",
|
18
18
|
};
|
19
19
|
this.files[oName] = fc;
|
20
|
+
this.files[fname] = fc;
|
20
21
|
const decoder = new TextDecoder();
|
21
22
|
return {
|
22
23
|
name: oName,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mock_file_service.js","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAOtD,MAAa,eAAgB,SAAQ,mCAAe;IAApD;;QACW,UAAK,GAAG,EAAmC,CAAC;
|
1
|
+
{"version":3,"file":"mock_file_service.js","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAOtD,MAAa,eAAgB,SAAQ,mCAAe;IAApD;;QACW,UAAK,GAAG,EAAmC,CAAC;IAiCvD,CAAC;IA3BU,KAAK,CAAC,MAAM,CAAC,KAAa;QACjC,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,MAAM,EAAE,GAAG;YACT,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,EAAE;SACZ,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAElC,OAAO;YACL,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,IAAI,cAAc,CAAa;gBACrC,KAAK,CAAC,KAAK;oBACT,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClD,CAAC;gBACD,KAAK,KAAI,CAAC;gBACV,KAAK;oBACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;gBACrC,CAAC;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AAlCD,0CAkCC"}
|
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mock_file_service_1 = require("./mock_file_service");
|
4
4
|
it("writeFileString", async () => {
|
5
5
|
const f = new mock_file_service_1.MockFileService();
|
6
|
-
const
|
7
|
-
await f.writeFileString(
|
6
|
+
const absFname = f.abs("test");
|
7
|
+
await f.writeFileString("test", "hello");
|
8
8
|
expect(f.files).toEqual({
|
9
|
-
[
|
10
|
-
|
9
|
+
[absFname]: {
|
10
|
+
content: "hello",
|
11
|
+
name: absFname,
|
12
|
+
},
|
13
|
+
test: {
|
14
|
+
name: absFname,
|
11
15
|
content: "hello",
|
12
16
|
},
|
13
17
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mock_file_service.test.js","sourceRoot":"","sources":["../../src/node/mock_file_service.test.ts"],"names":[],"mappings":";;AAAA,2DAAsD;AAEtD,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,CAAC,GAAG,IAAI,mCAAe,EAAE,CAAC;IAChC,MAAM,
|
1
|
+
{"version":3,"file":"mock_file_service.test.js","sourceRoot":"","sources":["../../src/node/mock_file_service.test.ts"],"names":[],"mappings":";;AAAA,2DAAsD;AAEtD,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,CAAC,GAAG,IAAI,mCAAe,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;QACtB,CAAC,QAAQ,CAAC,EAAE;YACV,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adviser/cement",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.8",
|
4
4
|
"description": "better try/catch/finally handling",
|
5
5
|
"main": "index.js",
|
6
6
|
"keywords": [],
|
@@ -12,15 +12,15 @@
|
|
12
12
|
"homepage": "https://github.com/mabels/cement#readme",
|
13
13
|
"devDependencies": {
|
14
14
|
"@types/jest": "^29.5.12",
|
15
|
-
"@types/node": "^20.
|
15
|
+
"@types/node": "^20.12.3",
|
16
16
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
17
17
|
"@typescript-eslint/parser": "^6.21.0",
|
18
|
-
"eslint": "^8.
|
18
|
+
"eslint": "^8.57.0",
|
19
19
|
"jest": "^29.7.0",
|
20
20
|
"prettier": "^3.2.5",
|
21
21
|
"ts-jest": "^29.1.2",
|
22
22
|
"ts-node": "^10.9.2",
|
23
|
-
"typescript": "^5.
|
23
|
+
"typescript": "^5.4.3"
|
24
24
|
},
|
25
25
|
"engines": {
|
26
26
|
"node": ">=16"
|