ng-talkback 21.0.17 → 21.0.19

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.
Files changed (38) hide show
  1. package/browser/package.json +1 -1
  2. package/browser-prod/package.json +1 -1
  3. package/lib/build-info._auto-generated_.d.ts +1 -1
  4. package/lib/build-info._auto-generated_.js +1 -1
  5. package/lib/package.json +1 -1
  6. package/lib-prod/build-info._auto-generated_.js +26 -14
  7. package/lib-prod/env/env.angular-node-app.js +66 -130
  8. package/lib-prod/env/env.docs-webapp.js +66 -130
  9. package/lib-prod/env/env.electron-app.js +66 -130
  10. package/lib-prod/env/env.mobile-app.js +66 -130
  11. package/lib-prod/env/env.npm-lib-and-cli-tool.js +66 -130
  12. package/lib-prod/env/env.vscode-plugin.js +66 -130
  13. package/lib-prod/env/index.js +6 -6
  14. package/lib-prod/es6.backend.js +2 -5
  15. package/lib-prod/features/error-rate.backend.js +20 -24
  16. package/lib-prod/features/latency.backend.js +25 -27
  17. package/lib-prod/index._auto-generated_.js +5 -0
  18. package/lib-prod/index.js +12 -14
  19. package/lib-prod/logger.backend.js +17 -21
  20. package/lib-prod/migrations/index.js +2 -1
  21. package/lib-prod/migrations/migrations_index._auto-generated_.js +3 -0
  22. package/lib-prod/options.backend.js +75 -85
  23. package/lib-prod/package.json +1 -1
  24. package/lib-prod/request-handler.backend.js +131 -125
  25. package/lib-prod/server.backend.js +76 -79
  26. package/lib-prod/summary.backend.js +16 -21
  27. package/lib-prod/talkback-factory.backend.js +15 -18
  28. package/lib-prod/tape-matcher.backend.js +84 -88
  29. package/lib-prod/tape-renderer.backend.js +90 -89
  30. package/lib-prod/tape-store.backend.js +85 -87
  31. package/lib-prod/tape.backend.js +64 -70
  32. package/lib-prod/types.backend.js +1 -0
  33. package/lib-prod/utils/content-encoding.backend.js +31 -35
  34. package/lib-prod/utils/headers.backend.js +12 -14
  35. package/lib-prod/utils/media-type.backend.js +41 -46
  36. package/package.json +1 -1
  37. package/websql/package.json +1 -1
  38. package/websql-prod/package.json +1 -1
@@ -1,95 +1,91 @@
1
- import ContentEncoding from "./utils/content-encoding.backend";
2
- import MediaType from "./utils/media-type.backend";
3
- import { ___NS__isEqual } from "tnp-core/lib-prod";
4
- class TapeMatcher {
5
- tape;
6
- options;
7
- constructor(tape, options) {
8
- this.tape = tape;
9
- this.options = options;
10
- }
11
- sameAs(otherTape) {
12
- const otherReq = otherTape.req;
13
- const req = this.tape.req;
14
- if (!this.isSameUrl(req, otherReq)) {
15
- return false;
1
+ import ContentEncoding from './utils/content-encoding.backend';
2
+ import MediaType from './utils/media-type.backend';
3
+ import { ___NS__isEqual } from 'tnp-core/lib-prod';
4
+ export default class TapeMatcher {
5
+ constructor(tape, options) {
6
+ this.tape = tape;
7
+ this.options = options;
16
8
  }
17
- if (!this.isSameMethod(req, otherReq)) {
18
- return false;
9
+ sameAs(otherTape) {
10
+ const otherReq = otherTape.req;
11
+ const req = this.tape.req;
12
+ if (!this.isSameUrl(req, otherReq)) {
13
+ return false;
14
+ }
15
+ if (!this.isSameMethod(req, otherReq)) {
16
+ return false;
17
+ }
18
+ if (!this.isSameHeaders(req, otherReq)) {
19
+ return false;
20
+ }
21
+ return this.options.ignoreBody || this.isSameBody(req, otherReq);
19
22
  }
20
- if (!this.isSameHeaders(req, otherReq)) {
21
- return false;
23
+ isSameBody(req, otherReq) {
24
+ const mediaType = new MediaType(req);
25
+ const contentEncoding = new ContentEncoding(req);
26
+ let sameBody;
27
+ if (contentEncoding.isUncompressed() && mediaType.isJSON() && req.body.length > 0 && otherReq.body.length > 0) {
28
+ const parsedReqBody = JSON.parse(req.body.toString());
29
+ const parsedOtherReqBody = JSON.parse(otherReq.body.toString());
30
+ sameBody = ___NS__isEqual(parsedReqBody, parsedOtherReqBody);
31
+ }
32
+ else {
33
+ sameBody = req.body.equals(otherReq.body);
34
+ }
35
+ if (!sameBody) {
36
+ if (!this.options.bodyMatcher) {
37
+ this.options.logger.debug(`Not same BODY ${req.body} vs ${otherReq.body}`);
38
+ return false;
39
+ }
40
+ const bodyMatches = this.options.bodyMatcher(this.tape, otherReq);
41
+ if (!bodyMatches) {
42
+ this.options.logger.debug(`Not same bodyMatcher ${req.body} vs ${otherReq.body}`);
43
+ return false;
44
+ }
45
+ }
46
+ return true;
22
47
  }
23
- return this.options.ignoreBody || this.isSameBody(req, otherReq);
24
- }
25
- isSameBody(req, otherReq) {
26
- const mediaType = new MediaType(req);
27
- const contentEncoding = new ContentEncoding(req);
28
- let sameBody;
29
- if (contentEncoding.isUncompressed() && mediaType.isJSON() && req.body.length > 0 && otherReq.body.length > 0) {
30
- const parsedReqBody = JSON.parse(req.body.toString());
31
- const parsedOtherReqBody = JSON.parse(otherReq.body.toString());
32
- sameBody = ___NS__isEqual(parsedReqBody, parsedOtherReqBody);
33
- } else {
34
- sameBody = req.body.equals(otherReq.body);
48
+ isSameHeaders(req, otherReq) {
49
+ const currentHeadersLength = Object.keys(req.headers).length;
50
+ const otherHeadersLength = Object.keys(otherReq.headers).length;
51
+ const sameNumberOfHeaders = currentHeadersLength === otherHeadersLength;
52
+ if (!sameNumberOfHeaders) {
53
+ this.options.logger.debug(`Not same #HEADERS ${JSON.stringify(req.headers)} vs ${JSON.stringify(otherReq.headers)}`);
54
+ return false;
55
+ }
56
+ let headersSame = true;
57
+ Object.keys(req.headers).forEach(k => {
58
+ const entryHeader = req.headers[k];
59
+ const header = otherReq.headers[k];
60
+ headersSame = headersSame && entryHeader === header;
61
+ });
62
+ if (!headersSame) {
63
+ this.options.logger.debug(`Not same HEADERS values ${JSON.stringify(req.headers)} vs ${JSON.stringify(otherReq.headers)}`);
64
+ return false;
65
+ }
66
+ return true;
35
67
  }
36
- if (!sameBody) {
37
- if (!this.options.bodyMatcher) {
38
- this.options.logger.debug(`Not same BODY ${req.body} vs ${otherReq.body}`);
39
- return false;
40
- }
41
- const bodyMatches = this.options.bodyMatcher(this.tape, otherReq);
42
- if (!bodyMatches) {
43
- this.options.logger.debug(`Not same bodyMatcher ${req.body} vs ${otherReq.body}`);
44
- return false;
45
- }
68
+ isSameMethod(req, otherReq) {
69
+ const sameMethod = req.method === otherReq.method;
70
+ if (!sameMethod) {
71
+ this.options.logger.debug(`Not same METHOD ${req.method} vs ${otherReq.method}`);
72
+ return false;
73
+ }
74
+ return true;
46
75
  }
47
- return true;
48
- }
49
- isSameHeaders(req, otherReq) {
50
- const currentHeadersLength = Object.keys(req.headers).length;
51
- const otherHeadersLength = Object.keys(otherReq.headers).length;
52
- const sameNumberOfHeaders = currentHeadersLength === otherHeadersLength;
53
- if (!sameNumberOfHeaders) {
54
- this.options.logger.debug(`Not same #HEADERS ${JSON.stringify(req.headers)} vs ${JSON.stringify(otherReq.headers)}`);
55
- return false;
76
+ isSameUrl(req, otherReq) {
77
+ const sameURL = req.url === otherReq.url;
78
+ if (!sameURL) {
79
+ if (!this.options.urlMatcher) {
80
+ this.options.logger.debug(`Not same URL ${req.url} vs ${otherReq.url}`);
81
+ return false;
82
+ }
83
+ const urlMatches = this.options.urlMatcher(this.tape, otherReq);
84
+ if (!urlMatches) {
85
+ this.options.logger.debug(`Not same urlMatcher ${req.url} vs ${otherReq.url}`);
86
+ return false;
87
+ }
88
+ }
89
+ return true;
56
90
  }
57
- let headersSame = true;
58
- Object.keys(req.headers).forEach((k) => {
59
- const entryHeader = req.headers[k];
60
- const header = otherReq.headers[k];
61
- headersSame = headersSame && entryHeader === header;
62
- });
63
- if (!headersSame) {
64
- this.options.logger.debug(`Not same HEADERS values ${JSON.stringify(req.headers)} vs ${JSON.stringify(otherReq.headers)}`);
65
- return false;
66
- }
67
- return true;
68
- }
69
- isSameMethod(req, otherReq) {
70
- const sameMethod = req.method === otherReq.method;
71
- if (!sameMethod) {
72
- this.options.logger.debug(`Not same METHOD ${req.method} vs ${otherReq.method}`);
73
- return false;
74
- }
75
- return true;
76
- }
77
- isSameUrl(req, otherReq) {
78
- const sameURL = req.url === otherReq.url;
79
- if (!sameURL) {
80
- if (!this.options.urlMatcher) {
81
- this.options.logger.debug(`Not same URL ${req.url} vs ${otherReq.url}`);
82
- return false;
83
- }
84
- const urlMatches = this.options.urlMatcher(this.tape, otherReq);
85
- if (!urlMatches) {
86
- this.options.logger.debug(`Not same urlMatcher ${req.url} vs ${otherReq.url}`);
87
- return false;
88
- }
89
- }
90
- return true;
91
- }
92
91
  }
93
- export {
94
- TapeMatcher as default
95
- };
@@ -1,93 +1,94 @@
1
- import Headers from "./utils/headers.backend";
2
- import MediaType from "./utils/media-type.backend";
3
- import Tape from "./tape.backend";
4
- import ContentEncoding from "./utils/content-encoding.backend";
5
- import * as bufferShim from "buffer-shims";
6
- class TapeRenderer {
7
- tape;
8
- constructor(tape) {
9
- this.tape = tape;
10
- }
11
- static async fromStore(raw, options) {
12
- const req = { ...raw.req };
13
- req.body = await this.prepareBody(raw, req, req.body, "req");
14
- const tape = new Tape(req, options);
15
- tape.meta = { ...raw.meta };
16
- const baseRes = { ...raw.res };
17
- const resBody = await this.prepareBody(tape, baseRes, baseRes.body, "res");
18
- tape.res = {
19
- ...baseRes,
20
- body: resBody
21
- };
22
- return tape;
23
- }
24
- static async prepareBody(tape, reqResObj, rawBody, metaPrefix) {
25
- const contentEncoding = new ContentEncoding(reqResObj);
26
- const isTapeUncompressed = tape.meta[metaPrefix + "Uncompressed"];
27
- const isTapeHumanReadable = tape.meta[metaPrefix + "HumanReadable"];
28
- const isTapeInPlainText = isTapeUncompressed || contentEncoding.isUncompressed();
29
- if (isTapeHumanReadable && isTapeInPlainText) {
30
- const mediaType = new MediaType(reqResObj);
31
- let bufferContent = rawBody;
32
- const isResAnObject = typeof bufferContent === "object";
33
- if (isResAnObject && mediaType.isJSON()) {
34
- bufferContent = JSON.stringify(bufferContent, null, 2);
35
- }
36
- if (Headers.read(reqResObj.headers, "content-length")) {
37
- Headers.write(reqResObj.headers, "content-length", Buffer.byteLength(bufferContent).toString(), metaPrefix);
38
- }
39
- if (isTapeUncompressed) {
40
- return await contentEncoding.compressedBody(bufferContent);
41
- }
42
- return bufferShim.from(bufferContent);
43
- } else {
44
- return bufferShim.from(rawBody, "base64");
1
+ import Headers from './utils/headers.backend';
2
+ import MediaType from './utils/media-type.backend';
3
+ import Tape from './tape.backend';
4
+ import ContentEncoding from './utils/content-encoding.backend';
5
+ import * as bufferShim from 'buffer-shims';
6
+ // const bufferShim = require('buffer-shims')/
7
+ export default class TapeRenderer {
8
+ constructor(tape) {
9
+ this.tape = tape;
45
10
  }
46
- }
47
- async render() {
48
- const reqBody = await this.bodyFor(this.tape.req, "req");
49
- const resBody = await this.bodyFor(this.tape.res, "res");
50
- return {
51
- meta: this.tape.meta,
52
- req: {
53
- ...this.tape.req,
54
- body: reqBody
55
- },
56
- res: {
57
- ...this.tape.res,
58
- body: resBody
59
- }
60
- };
61
- }
62
- async bodyFor(reqResObj, metaPrefix) {
63
- const mediaType = new MediaType(reqResObj);
64
- const contentEncoding = new ContentEncoding(reqResObj);
65
- const bodyLength = reqResObj.body.length;
66
- const isUncompressed = contentEncoding.isUncompressed();
67
- const contentEncodingSupported = isUncompressed || contentEncoding.supportedAlgorithm();
68
- if (mediaType.isHumanReadable() && contentEncodingSupported && bodyLength > 0) {
69
- this.tape.meta[metaPrefix + "HumanReadable"] = true;
70
- let body = reqResObj.body;
71
- if (!isUncompressed) {
72
- this.tape.meta[metaPrefix + "Uncompressed"] = true;
73
- body = await contentEncoding.uncompressedBody(body);
74
- }
75
- const rawBody = body.toString("utf8");
76
- if (mediaType.isJSON()) {
77
- try {
78
- const parsed = JSON.parse(rawBody);
79
- return parsed;
80
- } catch (error) {
81
- return rawBody;
11
+ static async fromStore(raw, options) {
12
+ const req = { ...raw.req };
13
+ req.body = await this.prepareBody(raw, req, req.body, "req");
14
+ const tape = new Tape(req, options);
15
+ tape.meta = { ...raw.meta };
16
+ const baseRes = { ...raw.res };
17
+ const resBody = await this.prepareBody(tape, baseRes, baseRes.body, "res");
18
+ tape.res = {
19
+ ...baseRes,
20
+ body: resBody
21
+ };
22
+ return tape;
23
+ }
24
+ static async prepareBody(tape, reqResObj, rawBody, metaPrefix) {
25
+ const contentEncoding = new ContentEncoding(reqResObj);
26
+ const isTapeUncompressed = tape.meta[metaPrefix + "Uncompressed"];
27
+ const isTapeHumanReadable = tape.meta[metaPrefix + "HumanReadable"];
28
+ const isTapeInPlainText = isTapeUncompressed || contentEncoding.isUncompressed();
29
+ if (isTapeHumanReadable && isTapeInPlainText) {
30
+ const mediaType = new MediaType(reqResObj);
31
+ let bufferContent = rawBody;
32
+ const isResAnObject = typeof (bufferContent) === "object";
33
+ if (isResAnObject && mediaType.isJSON()) {
34
+ bufferContent = JSON.stringify(bufferContent, null, 2);
35
+ }
36
+ if (Headers.read(reqResObj.headers, "content-length")) {
37
+ Headers.write(reqResObj.headers, "content-length", Buffer.byteLength(bufferContent).toString(), metaPrefix);
38
+ }
39
+ if (isTapeUncompressed) {
40
+ return await contentEncoding.compressedBody(bufferContent);
41
+ }
42
+ return bufferShim.from(bufferContent);
43
+ }
44
+ else {
45
+ return bufferShim.from(rawBody, "base64");
46
+ }
47
+ }
48
+ async render() {
49
+ const reqBody = await this.bodyFor(this.tape.req, "req");
50
+ const resBody = await this.bodyFor(this.tape.res, "res");
51
+ return {
52
+ meta: this.tape.meta,
53
+ req: {
54
+ ...this.tape.req,
55
+ body: reqBody
56
+ },
57
+ res: {
58
+ ...this.tape.res,
59
+ body: resBody
60
+ }
61
+ };
62
+ }
63
+ async bodyFor(reqResObj, metaPrefix) {
64
+ const mediaType = new MediaType(reqResObj);
65
+ const contentEncoding = new ContentEncoding(reqResObj);
66
+ const bodyLength = reqResObj.body.length;
67
+ const isUncompressed = contentEncoding.isUncompressed();
68
+ const contentEncodingSupported = isUncompressed || contentEncoding.supportedAlgorithm();
69
+ if (mediaType.isHumanReadable() && contentEncodingSupported && bodyLength > 0) {
70
+ this.tape.meta[metaPrefix + "HumanReadable"] = true;
71
+ let body = reqResObj.body;
72
+ if (!isUncompressed) {
73
+ this.tape.meta[metaPrefix + "Uncompressed"] = true;
74
+ body = await contentEncoding.uncompressedBody(body);
75
+ }
76
+ const rawBody = body.toString("utf8");
77
+ if (mediaType.isJSON()) {
78
+ try { // TODO handle this better in future not based on mediaType.isJSON
79
+ const parsed = JSON.parse(rawBody);
80
+ return parsed;
81
+ }
82
+ catch (error) {
83
+ return rawBody;
84
+ }
85
+ }
86
+ else {
87
+ return rawBody;
88
+ }
89
+ }
90
+ else {
91
+ return reqResObj.body.toString("base64");
82
92
  }
83
- } else {
84
- return rawBody;
85
- }
86
- } else {
87
- return reqResObj.body.toString("base64");
88
93
  }
89
- }
90
94
  }
91
- export {
92
- TapeRenderer as default
93
- };
@@ -1,94 +1,92 @@
1
- import { fse, path, json5, mkdirp } from "tnp-core/lib-prod";
2
- import Tape from "./tape.backend";
3
- import TapeMatcher from "./tape-matcher.backend";
4
- import TapeRenderer from "./tape-renderer.backend";
5
- class TapeStore {
6
- path;
7
- options;
8
- tapes;
9
- constructor(options) {
10
- this.path = path.normalize(options.path + "/");
11
- this.options = options;
12
- this.tapes = [];
13
- }
14
- async load() {
15
- mkdirp.sync(this.path);
16
- await this.loadTapesAtDir(this.path);
17
- console.log(`Loaded ${this.tapes.length} tapes`);
18
- }
19
- async loadTapesAtDir(directory) {
20
- const items = fse.readdirSync(directory);
21
- for (let i = 0; i < items.length; i++) {
22
- const filename = items[i];
23
- const fullPath = `${directory}${filename}`;
24
- const stat = fse.statSync(fullPath);
25
- if (!stat.isDirectory()) {
26
- try {
27
- const data = fse.readFileSync(fullPath, "utf8");
28
- const raw = json5.parse(data);
29
- const tape = await Tape.fromStore(raw, this.options);
30
- tape.path = filename;
31
- this.tapes.push(tape);
32
- } catch (e) {
33
- console.log(`Error reading tape ${fullPath}`, e.message);
1
+ import { fse, path, json5, mkdirp } from 'tnp-core/lib-prod';
2
+ import Tape from './tape.backend';
3
+ import TapeMatcher from './tape-matcher.backend';
4
+ import TapeRenderer from './tape-renderer.backend';
5
+ export default class TapeStore {
6
+ constructor(options) {
7
+ this.path = path.normalize(options.path + "/");
8
+ this.options = options;
9
+ this.tapes = [];
10
+ }
11
+ async load() {
12
+ mkdirp.sync(this.path);
13
+ await this.loadTapesAtDir(this.path);
14
+ console.log(`Loaded ${this.tapes.length} tapes`);
15
+ }
16
+ async loadTapesAtDir(directory) {
17
+ const items = fse.readdirSync(directory);
18
+ for (let i = 0; i < items.length; i++) {
19
+ const filename = items[i];
20
+ const fullPath = `${directory}${filename}`;
21
+ const stat = fse.statSync(fullPath);
22
+ if (!stat.isDirectory()) {
23
+ try {
24
+ const data = fse.readFileSync(fullPath, "utf8");
25
+ const raw = json5.parse(data);
26
+ const tape = await Tape.fromStore(raw, this.options);
27
+ tape.path = filename;
28
+ this.tapes.push(tape);
29
+ }
30
+ catch (e) {
31
+ console.log(`Error reading tape ${fullPath}`, e.message);
32
+ }
33
+ }
34
+ else {
35
+ this.loadTapesAtDir(fullPath + "/");
36
+ }
34
37
  }
35
- } else {
36
- this.loadTapesAtDir(fullPath + "/");
37
- }
38
38
  }
39
- }
40
- find(newTape) {
41
- const foundTape = this.tapes.find((t) => {
42
- this.options.logger.debug(`Comparing against tape ${t.path}`);
43
- return new TapeMatcher(t, this.options).sameAs(newTape);
44
- });
45
- if (foundTape) {
46
- foundTape.used = true;
47
- this.options.logger.log(`Found matching tape for ${newTape.req.url} at ${foundTape.path}`);
48
- return foundTape;
39
+ find(newTape) {
40
+ const foundTape = this.tapes.find(t => {
41
+ this.options.logger.debug(`Comparing against tape ${t.path}`);
42
+ return new TapeMatcher(t, this.options).sameAs(newTape);
43
+ });
44
+ if (foundTape) {
45
+ foundTape.used = true;
46
+ this.options.logger.log(`Found matching tape for ${newTape.req.url} at ${foundTape.path}`);
47
+ return foundTape;
48
+ }
49
49
  }
50
- }
51
- async save(tape) {
52
- tape.new = true;
53
- tape.used = true;
54
- const tapePath = tape.path;
55
- let fullFilename;
56
- if (tapePath) {
57
- fullFilename = path.join(this.path, tapePath);
58
- } else {
59
- this.tapes.push(tape);
60
- fullFilename = this.createTapePath(tape);
61
- tape.path = path.relative(this.path, fullFilename);
50
+ async save(tape) {
51
+ tape.new = true;
52
+ tape.used = true;
53
+ const tapePath = tape.path;
54
+ let fullFilename;
55
+ if (tapePath) {
56
+ fullFilename = path.join(this.path, tapePath);
57
+ }
58
+ else {
59
+ // If the tape doesn't have a path then it's new
60
+ this.tapes.push(tape);
61
+ fullFilename = this.createTapePath(tape);
62
+ tape.path = path.relative(this.path, fullFilename);
63
+ }
64
+ this.options.logger.log(`Saving request ${tape.req.url} at ${tape.path}`);
65
+ const tapeRenderer = new TapeRenderer(tape);
66
+ const toSave = await tapeRenderer.render();
67
+ fse.writeFileSync(fullFilename, json5.stringify(toSave, null, 4));
62
68
  }
63
- this.options.logger.log(`Saving request ${tape.req.url} at ${tape.path}`);
64
- const tapeRenderer = new TapeRenderer(tape);
65
- const toSave = await tapeRenderer.render();
66
- fse.writeFileSync(fullFilename, json5.stringify(toSave, null, 4));
67
- }
68
- currentTapeId() {
69
- return this.tapes.length;
70
- }
71
- hasTapeBeenUsed(tapeName) {
72
- return this.tapes.some((t) => t.used && t.path === tapeName);
73
- }
74
- resetTapeUsage() {
75
- return this.tapes.forEach((t) => t.used = false);
76
- }
77
- createTapePath(tape) {
78
- const currentTapeId = this.currentTapeId();
79
- let tapePath = `unnamed-${currentTapeId}.json5`;
80
- if (this.options.tapeNameGenerator) {
81
- tapePath = this.options.tapeNameGenerator(currentTapeId, tape);
69
+ currentTapeId() {
70
+ return this.tapes.length;
82
71
  }
83
- let result = path.normalize(path.join(this.options.path, tapePath));
84
- if (!result.endsWith(".json5")) {
85
- result = `${result}.json5`;
72
+ hasTapeBeenUsed(tapeName) {
73
+ return this.tapes.some(t => t.used && t.path === tapeName);
74
+ }
75
+ resetTapeUsage() {
76
+ return this.tapes.forEach(t => t.used = false);
77
+ }
78
+ createTapePath(tape) {
79
+ const currentTapeId = this.currentTapeId();
80
+ let tapePath = `unnamed-${currentTapeId}.json5`;
81
+ if (this.options.tapeNameGenerator) {
82
+ tapePath = this.options.tapeNameGenerator(currentTapeId, tape);
83
+ }
84
+ let result = path.normalize(path.join(this.options.path, tapePath));
85
+ if (!result.endsWith(".json5")) {
86
+ result = `${result}.json5`;
87
+ }
88
+ const dir = path.dirname(result);
89
+ mkdirp.sync(dir);
90
+ return result;
86
91
  }
87
- const dir = path.dirname(result);
88
- mkdirp.sync(dir);
89
- return result;
90
- }
91
92
  }
92
- export {
93
- TapeStore as default
94
- };