@fluid-experimental/property-common 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (127) hide show
  1. package/.eslintrc.js +9 -11
  2. package/.mocharc.json +6 -6
  3. package/README.md +1 -0
  4. package/api-extractor.json +2 -2
  5. package/dist/chronometer.d.ts.map +1 -1
  6. package/dist/chronometer.js.map +1 -1
  7. package/dist/consoleUtils.d.ts.map +1 -1
  8. package/dist/consoleUtils.js +4 -1
  9. package/dist/consoleUtils.js.map +1 -1
  10. package/dist/constants.d.ts +6 -6
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +16 -26
  13. package/dist/constants.js.map +1 -1
  14. package/dist/datastructures/collection.d.ts.map +1 -1
  15. package/dist/datastructures/collection.js +5 -4
  16. package/dist/datastructures/collection.js.map +1 -1
  17. package/dist/datastructures/dataArray.d.ts.map +1 -1
  18. package/dist/datastructures/dataArray.js +18 -9
  19. package/dist/datastructures/dataArray.js.map +1 -1
  20. package/dist/datastructures/integer64.d.ts.map +1 -1
  21. package/dist/datastructures/integer64.js +1 -1
  22. package/dist/datastructures/integer64.js.map +1 -1
  23. package/dist/datastructures/sortedCollection.d.ts.map +1 -1
  24. package/dist/datastructures/sortedCollection.js +3 -1
  25. package/dist/datastructures/sortedCollection.js.map +1 -1
  26. package/dist/deferredPromise.d.ts +1 -1
  27. package/dist/deferredPromise.d.ts.map +1 -1
  28. package/dist/deferredPromise.js +9 -3
  29. package/dist/deferredPromise.js.map +1 -1
  30. package/dist/deterministicRandomGenerator.d.ts.map +1 -1
  31. package/dist/deterministicRandomGenerator.js +6 -6
  32. package/dist/deterministicRandomGenerator.js.map +1 -1
  33. package/dist/error_objects/flaggedError.d.ts.map +1 -1
  34. package/dist/error_objects/flaggedError.js.map +1 -1
  35. package/dist/error_objects/httpError.d.ts.map +1 -1
  36. package/dist/error_objects/httpError.js +9 -9
  37. package/dist/error_objects/httpError.js.map +1 -1
  38. package/dist/error_objects/httpErrorNoStack.d.ts.map +1 -1
  39. package/dist/error_objects/httpErrorNoStack.js.map +1 -1
  40. package/dist/error_objects/operationError.d.ts +7 -7
  41. package/dist/error_objects/operationError.d.ts.map +1 -1
  42. package/dist/error_objects/operationError.js +7 -7
  43. package/dist/error_objects/operationError.js.map +1 -1
  44. package/dist/guidUtils.d.ts.map +1 -1
  45. package/dist/guidUtils.js +10 -9
  46. package/dist/guidUtils.js.map +1 -1
  47. package/dist/hashCalculator.d.ts.map +1 -1
  48. package/dist/hashCalculator.js.map +1 -1
  49. package/dist/joinPaths.d.ts.map +1 -1
  50. package/dist/joinPaths.js.map +1 -1
  51. package/dist/packageVersion.d.ts +1 -1
  52. package/dist/packageVersion.js +1 -1
  53. package/dist/packageVersion.js.map +1 -1
  54. package/lib/chronometer.d.ts.map +1 -1
  55. package/lib/chronometer.js.map +1 -1
  56. package/lib/consoleUtils.d.ts.map +1 -1
  57. package/lib/consoleUtils.js +4 -1
  58. package/lib/consoleUtils.js.map +1 -1
  59. package/lib/constants.d.ts +6 -6
  60. package/lib/constants.d.ts.map +1 -1
  61. package/lib/constants.js +16 -26
  62. package/lib/constants.js.map +1 -1
  63. package/lib/datastructures/collection.d.ts.map +1 -1
  64. package/lib/datastructures/collection.js +5 -4
  65. package/lib/datastructures/collection.js.map +1 -1
  66. package/lib/datastructures/dataArray.d.ts.map +1 -1
  67. package/lib/datastructures/dataArray.js +18 -9
  68. package/lib/datastructures/dataArray.js.map +1 -1
  69. package/lib/datastructures/integer64.d.ts.map +1 -1
  70. package/lib/datastructures/integer64.js +1 -1
  71. package/lib/datastructures/integer64.js.map +1 -1
  72. package/lib/datastructures/sortedCollection.d.ts.map +1 -1
  73. package/lib/datastructures/sortedCollection.js +3 -1
  74. package/lib/datastructures/sortedCollection.js.map +1 -1
  75. package/lib/deferredPromise.d.ts +1 -1
  76. package/lib/deferredPromise.d.ts.map +1 -1
  77. package/lib/deferredPromise.js +9 -3
  78. package/lib/deferredPromise.js.map +1 -1
  79. package/lib/deterministicRandomGenerator.d.ts.map +1 -1
  80. package/lib/deterministicRandomGenerator.js +6 -6
  81. package/lib/deterministicRandomGenerator.js.map +1 -1
  82. package/lib/error_objects/flaggedError.d.ts.map +1 -1
  83. package/lib/error_objects/flaggedError.js.map +1 -1
  84. package/lib/error_objects/httpError.d.ts.map +1 -1
  85. package/lib/error_objects/httpError.js +9 -9
  86. package/lib/error_objects/httpError.js.map +1 -1
  87. package/lib/error_objects/httpErrorNoStack.d.ts.map +1 -1
  88. package/lib/error_objects/httpErrorNoStack.js.map +1 -1
  89. package/lib/error_objects/operationError.d.ts +7 -7
  90. package/lib/error_objects/operationError.d.ts.map +1 -1
  91. package/lib/error_objects/operationError.js +7 -7
  92. package/lib/error_objects/operationError.js.map +1 -1
  93. package/lib/guidUtils.d.ts.map +1 -1
  94. package/lib/guidUtils.js +10 -9
  95. package/lib/guidUtils.js.map +1 -1
  96. package/lib/hashCalculator.d.ts.map +1 -1
  97. package/lib/hashCalculator.js.map +1 -1
  98. package/lib/joinPaths.d.ts.map +1 -1
  99. package/lib/joinPaths.js.map +1 -1
  100. package/lib/packageVersion.d.ts +1 -1
  101. package/lib/packageVersion.js +1 -1
  102. package/lib/packageVersion.js.map +1 -1
  103. package/package.json +42 -40
  104. package/platform-dependent/README.md +1 -0
  105. package/platform-dependent/browser.js +5 -5
  106. package/platform-dependent/package.json +14 -14
  107. package/platform-dependent/server.js +5 -5
  108. package/prettier.config.cjs +1 -1
  109. package/src/chronometer.ts +174 -169
  110. package/src/consoleUtils.ts +16 -11
  111. package/src/constants.ts +1683 -1640
  112. package/src/datastructures/collection.ts +417 -416
  113. package/src/datastructures/dataArray.ts +516 -492
  114. package/src/datastructures/integer64.ts +102 -99
  115. package/src/datastructures/sortedCollection.ts +155 -145
  116. package/src/deferredPromise.ts +43 -42
  117. package/src/deterministicRandomGenerator.ts +59 -59
  118. package/src/error_objects/flaggedError.ts +29 -29
  119. package/src/error_objects/httpError.ts +45 -42
  120. package/src/error_objects/httpErrorNoStack.ts +17 -17
  121. package/src/error_objects/operationError.ts +62 -62
  122. package/src/guidUtils.ts +182 -171
  123. package/src/hashCalculator.ts +5 -2
  124. package/src/joinPaths.ts +15 -9
  125. package/src/packageVersion.ts +1 -1
  126. package/tsconfig.esnext.json +6 -6
  127. package/tsconfig.json +9 -13
@@ -21,69 +21,69 @@ import { calculateHash } from "./hashCalculator";
21
21
  * efficient.
22
22
  */
23
23
  export class DeterministicRandomGenerator {
24
- _guid1: Uint32Array;
25
- _guid2: Uint32Array;
26
- _result: Uint32Array;
24
+ _guid1: Uint32Array;
25
+ _guid2: Uint32Array;
26
+ _result: Uint32Array;
27
27
 
28
- /**
29
- * @param in_seed - The initial seed (it can be either a GUID or a number)
30
- * which is used to initialize the random number generator.
31
- */
32
- constructor(in_seed: string | number) {
33
- // Initialize the internal state from the given initial guid
34
- this._guid1 = _.isString(in_seed)
35
- ? GuidUtils.guidToUint32x4(in_seed)
36
- : GuidUtils.guidToUint32x4(calculateHash(String(in_seed)));
37
- this._guid2 = new Uint32Array(4);
38
- this._guid2[0] = (this._guid1[0] + 1) >>> 0;
39
- this._guid2[1] = (this._guid1[1] + 1) >>> 0;
40
- this._guid2[2] = (this._guid1[2] + 1) >>> 0;
41
- this._guid2[3] = (this._guid1[3] + 1) >>> 0;
28
+ /**
29
+ * @param in_seed - The initial seed (it can be either a GUID or a number)
30
+ * which is used to initialize the random number generator.
31
+ */
32
+ constructor(in_seed: string | number) {
33
+ // Initialize the internal state from the given initial guid
34
+ this._guid1 = _.isString(in_seed)
35
+ ? GuidUtils.guidToUint32x4(in_seed)
36
+ : GuidUtils.guidToUint32x4(calculateHash(String(in_seed)));
37
+ this._guid2 = new Uint32Array(4);
38
+ this._guid2[0] = (this._guid1[0] + 1) >>> 0;
39
+ this._guid2[1] = (this._guid1[1] + 1) >>> 0;
40
+ this._guid2[2] = (this._guid1[2] + 1) >>> 0;
41
+ this._guid2[3] = (this._guid1[3] + 1) >>> 0;
42
42
 
43
- this._result = new Uint32Array(4);
44
- }
43
+ this._result = new Uint32Array(4);
44
+ }
45
45
 
46
- /**
47
- * Creates a floating point random number.
48
- *
49
- * @param in_max - If supplied the returned number will be 0 \<= number \< `in_max`.
50
- * If none is given, `in_max` = 1 is assumed.
51
- *
52
- * @returns The random number.
53
- */
54
- random(in_max = 1.0) {
55
- const randomInteger = this.irandom();
56
- return randomInteger / 4294967296 * in_max;
57
- }
46
+ /**
47
+ * Creates a floating point random number.
48
+ *
49
+ * @param in_max - If supplied the returned number will be 0 \<= number \< `in_max`.
50
+ * If none is given, `in_max` = 1 is assumed.
51
+ *
52
+ * @returns The random number.
53
+ */
54
+ random(in_max = 1.0) {
55
+ const randomInteger = this.irandom();
56
+ return (randomInteger / 4294967296) * in_max;
57
+ }
58
58
 
59
- /**
60
- * Creates an integer point random number.
61
- *
62
- * @param in_max - If supplied the returned number will be 0 \<= number \< `in_max`.
63
- * If none is given, `in_max` = 14294967296 (2^32) is assumed.
64
- *
65
- * @returns The random number.
66
- */
67
- irandom(in_max?: number): number {
68
- // Create a new hash
69
- GuidUtils.hashCombine4xUint32(this._guid1, this._guid2, this._result);
59
+ /**
60
+ * Creates an integer point random number.
61
+ *
62
+ * @param in_max - If supplied the returned number will be 0 \<= number \< `in_max`.
63
+ * If none is given, `in_max` = 14294967296 (2^32) is assumed.
64
+ *
65
+ * @returns The random number.
66
+ */
67
+ irandom(in_max?: number): number {
68
+ // Create a new hash
69
+ GuidUtils.hashCombine4xUint32(this._guid1, this._guid2, this._result);
70
70
 
71
- // Permute the hashes
72
- for (let i = 0; i < 4; i++) {
73
- this._guid1[i] = this._guid2[i];
74
- this._guid2[i] = this._result[i];
75
- }
71
+ // Permute the hashes
72
+ for (let i = 0; i < 4; i++) {
73
+ this._guid1[i] = this._guid2[i];
74
+ this._guid2[i] = this._result[i];
75
+ }
76
76
 
77
- if (in_max === undefined) {
78
- return this._guid1[0];
79
- } else {
80
- return in_max < 16777619
81
- // The random generator doesn't seem to be very good.
82
- // It is quite biased (e.g. it generates too many even numbers)
83
- // this is a hack to solve at least this problem, but we probably should
84
- // instead use a different approach altogether
85
- ? ((this._guid1[0]) % 16777619) % in_max
86
- : this._guid1[0] % in_max;
87
- }
88
- }
77
+ if (in_max === undefined) {
78
+ return this._guid1[0];
79
+ } else {
80
+ return in_max < 16777619
81
+ ? // The random generator doesn't seem to be very good.
82
+ // It is quite biased (e.g. it generates too many even numbers)
83
+ // this is a hack to solve at least this problem, but we probably should
84
+ // instead use a different approach altogether
85
+ (this._guid1[0] % 16777619) % in_max
86
+ : this._guid1[0] % in_max;
87
+ }
88
+ }
89
89
  }
@@ -9,39 +9,39 @@
9
9
  * @param flag - A flag to be checked
10
10
  * @returns True if the flag is set in passed flags, false otherwise.
11
11
  */
12
- const _isFlagSet = (flags: number, flag: number) => {
13
- // eslint-disable-next-line no-bitwise
14
- return (flags & flag) === flag;
12
+ const _isFlagSet = (flags: number, flag: number) => {
13
+ // eslint-disable-next-line no-bitwise
14
+ return (flags & flag) === flag;
15
15
  };
16
16
 
17
17
  export class FlaggedError {
18
- /**
19
- * Flags that may be set on an error instance.
20
- */
21
- static FLAGS = {
22
- /**
23
- * A transient error results from an operation that could succeed if retried.
24
- */
25
- TRANSIENT: 1,
26
- /**
27
- * A quiet error should not trigger an error log.
28
- */
29
- QUIET: 2,
30
- };
18
+ /**
19
+ * Flags that may be set on an error instance.
20
+ */
21
+ static FLAGS = {
22
+ /**
23
+ * A transient error results from an operation that could succeed if retried.
24
+ */
25
+ TRANSIENT: 1,
26
+ /**
27
+ * A quiet error should not trigger an error log.
28
+ */
29
+ QUIET: 2,
30
+ };
31
31
 
32
- protected flags: number = 0;
32
+ protected flags: number = 0;
33
33
 
34
- /**
35
- * @returns True if the quiet flag is set.
36
- */
37
- isQuiet(): boolean {
38
- return _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);
39
- }
34
+ /**
35
+ * @returns True if the quiet flag is set.
36
+ */
37
+ isQuiet(): boolean {
38
+ return _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);
39
+ }
40
40
 
41
- /**
42
- * @returns True if the transient flag is set.
43
- */
44
- isTransient(): boolean {
45
- return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);
46
- }
41
+ /**
42
+ * @returns True if the transient flag is set.
43
+ */
44
+ isTransient(): boolean {
45
+ return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);
46
+ }
47
47
  }
@@ -14,54 +14,57 @@ import { FlaggedError } from "./flaggedError";
14
14
  * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
15
15
  */
16
16
  export class HTTPError extends Error {
17
- constructor(
18
- public title?: string,
19
- public statusCode?: number,
20
- public statusMessage?: string,
21
- public method?: string,
22
- public url?: string,
23
- public flags = 0,
24
- ) {
25
- super();
26
- Object.setPrototypeOf(this, HTTPError.prototype);
27
- this.name = "HTTPError";
28
- this.message = this._generateMessage(title, statusCode, statusMessage, method, url);
29
- this.stack = (new Error(this.message)).stack;
30
- }
17
+ constructor(
18
+ public title?: string,
19
+ public statusCode?: number,
20
+ public statusMessage?: string,
21
+ public method?: string,
22
+ public url?: string,
23
+ public flags = 0,
24
+ ) {
25
+ super();
26
+ Object.setPrototypeOf(this, HTTPError.prototype);
27
+ this.name = "HTTPError";
28
+ this.message = this._generateMessage(title, statusCode, statusMessage, method, url);
29
+ this.stack = new Error(this.message).stack;
30
+ }
31
31
 
32
- static FLAGS = FlaggedError.FLAGS;
32
+ static FLAGS = FlaggedError.FLAGS;
33
33
 
34
- isQuiet(): boolean {
35
- return FlaggedError.prototype.isQuiet.call(this);
36
- }
34
+ isQuiet(): boolean {
35
+ return FlaggedError.prototype.isQuiet.call(this);
36
+ }
37
37
 
38
- isTransient(): boolean {
39
- return FlaggedError.prototype.isTransient.call(this);
40
- }
38
+ isTransient(): boolean {
39
+ return FlaggedError.prototype.isTransient.call(this);
40
+ }
41
41
 
42
- private _generateMessage(title, statusCode, statusMessage, method, url) {
43
- const titleStr = (title === undefined) ? "" : String(title);
44
- const statusCodeStr = (statusCode === undefined) ? "" : String(statusCode);
45
- const statusMessageStr = (statusMessage === undefined) ? "" : String(statusMessage);
46
- const methodStr = (method === undefined) ? "" : String(method);
47
- const urlStr = (url === undefined) ? "" : String(url);
42
+ private _generateMessage(title, statusCode, statusMessage, method, url) {
43
+ const titleStr = title === undefined ? "" : String(title);
44
+ const statusCodeStr = statusCode === undefined ? "" : String(statusCode);
45
+ const statusMessageStr = statusMessage === undefined ? "" : String(statusMessage);
46
+ const methodStr = method === undefined ? "" : String(method);
47
+ const urlStr = url === undefined ? "" : String(url);
48
48
 
49
- return `HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +
50
- `statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`;
51
- }
49
+ return (
50
+ `HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +
51
+ `statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`
52
+ );
53
+ }
52
54
 
53
- /**
54
- * Returns a string representing the HTTPError object
55
- * @returns a string representing the HTTPError object
56
- */
57
- toString(): string {
58
- const stack = (this.stack === undefined) ? "" : String(this.stack);
55
+ /**
56
+ * Returns a string representing the HTTPError object
57
+ * @returns a string representing the HTTPError object
58
+ */
59
+ toString(): string {
60
+ const stack = this.stack === undefined ? "" : String(this.stack);
59
61
 
60
- const isFirefox = typeof window !== "undefined" &&
61
- typeof window.navigator !== "undefined" &&
62
- typeof window.navigator.userAgent !== "undefined" &&
63
- window.navigator.userAgent.toLowerCase().includes("firefox");
62
+ const isFirefox =
63
+ typeof window !== "undefined" &&
64
+ typeof window.navigator !== "undefined" &&
65
+ typeof window.navigator.userAgent !== "undefined" &&
66
+ window.navigator.userAgent.toLowerCase().includes("firefox");
64
67
 
65
- return isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;
66
- }
68
+ return isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;
69
+ }
67
70
  }
@@ -9,23 +9,23 @@ import { FlaggedError } from "./flaggedError";
9
9
  * Class extending HTTPError without storing the stack
10
10
  */
11
11
  export class HTTPErrorNoStack extends HTTPError {
12
- static FLAGS = FlaggedError.FLAGS;
12
+ static FLAGS = FlaggedError.FLAGS;
13
13
 
14
- /**
15
- * @param message - The error message
16
- * @param statusCode - A numeric HTTP status code
17
- * @param statusMessage - A string message representing the response status message
18
- * @param method - The HTTP method used in the request
19
- * @param url - The URL that the request was sent to
20
- * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
21
- */
22
- constructor(message?, statusCode?, statusMessage?, method?, url?, flags?) {
23
- super(message, statusCode, statusMessage, method, url, flags);
24
- Object.setPrototypeOf(this, HTTPErrorNoStack.prototype);
25
- delete this.stack;
26
- }
14
+ /**
15
+ * @param message - The error message
16
+ * @param statusCode - A numeric HTTP status code
17
+ * @param statusMessage - A string message representing the response status message
18
+ * @param method - The HTTP method used in the request
19
+ * @param url - The URL that the request was sent to
20
+ * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
21
+ */
22
+ constructor(message?, statusCode?, statusMessage?, method?, url?, flags?) {
23
+ super(message, statusCode, statusMessage, method, url, flags);
24
+ Object.setPrototypeOf(this, HTTPErrorNoStack.prototype);
25
+ delete this.stack;
26
+ }
27
27
 
28
- toString(): string {
29
- return this.message;
30
- }
28
+ toString(): string {
29
+ return this.message;
30
+ }
31
31
  }
@@ -13,78 +13,78 @@ import _ from "lodash";
13
13
  import { FlaggedError } from "./flaggedError";
14
14
 
15
15
  export class OperationError extends Error {
16
- static FLAGS = FlaggedError.FLAGS;
17
- public stack: string | undefined;
18
- public readonly name: string;
16
+ static FLAGS = FlaggedError.FLAGS;
17
+ public stack: string | undefined;
18
+ public readonly name: string;
19
19
 
20
- /**
21
- * Instantiates an OperationError, which mimics the Error class with added properties
22
- * meant for reporting the result of operations.
23
- * @param message - The error message.
24
- * @param operation - The operation name.
25
- * @param statusCode - The operation result as a numerical status code.
26
- * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
27
- */
28
- constructor(
29
- message?: string,
30
- public operation?: string,
31
- public statusCode?: number,
32
- public flags: number = 0,
33
- ) {
34
- super(message);
35
- Object.setPrototypeOf(this, OperationError.prototype);
36
- this.name = "OperationError";
37
- this.stack = Error(message).stack;
38
- }
20
+ /**
21
+ * Instantiates an OperationError, which mimics the Error class with added properties
22
+ * meant for reporting the result of operations.
23
+ * @param message - The error message.
24
+ * @param operation - The operation name.
25
+ * @param statusCode - The operation result as a numerical status code.
26
+ * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
27
+ */
28
+ constructor(
29
+ message?: string,
30
+ public operation?: string,
31
+ public statusCode?: number,
32
+ public flags: number = 0,
33
+ ) {
34
+ super(message);
35
+ Object.setPrototypeOf(this, OperationError.prototype);
36
+ this.name = "OperationError";
37
+ this.stack = Error(message).stack;
38
+ }
39
39
 
40
- isQuiet() {
41
- return FlaggedError.prototype.isQuiet.call(this);
42
- }
40
+ isQuiet() {
41
+ return FlaggedError.prototype.isQuiet.call(this);
42
+ }
43
43
 
44
- isTransient() {
45
- return FlaggedError.prototype.isTransient.call(this);
46
- }
44
+ isTransient() {
45
+ return FlaggedError.prototype.isTransient.call(this);
46
+ }
47
47
 
48
- /**
49
- * @returns A string representation of the error flags.
50
- */
51
- private _flagsToString() {
52
- const flagArray: string[] = [];
53
- _.mapValues(FlaggedError.FLAGS, (flagValue, flagName) => {
54
- // eslint-disable-next-line no-bitwise
55
- if ((this.flags & flagValue) === flagValue) {
56
- flagArray.push(flagName);
57
- }
58
- });
59
- return `${this.flags} [${flagArray.join(",")}]`;
60
- }
48
+ /**
49
+ * @returns A string representation of the error flags.
50
+ */
51
+ private _flagsToString() {
52
+ const flagArray: string[] = [];
53
+ _.mapValues(FlaggedError.FLAGS, (flagValue, flagName) => {
54
+ // eslint-disable-next-line no-bitwise
55
+ if ((this.flags & flagValue) === flagValue) {
56
+ flagArray.push(flagName);
57
+ }
58
+ });
59
+ return `${this.flags} [${flagArray.join(",")}]`;
60
+ }
61
61
 
62
- toString(): string {
63
- const extendedFieldsArray: string[] = [];
64
- if (this.operation !== undefined) {
65
- extendedFieldsArray.push(this.operation);
66
- }
62
+ toString(): string {
63
+ const extendedFieldsArray: string[] = [];
64
+ if (this.operation !== undefined) {
65
+ extendedFieldsArray.push(this.operation);
66
+ }
67
67
 
68
- if (this.statusCode !== undefined) {
69
- extendedFieldsArray.push(this.statusCode.toString());
70
- }
68
+ if (this.statusCode !== undefined) {
69
+ extendedFieldsArray.push(this.statusCode.toString());
70
+ }
71
71
 
72
- if (this.flags) {
73
- extendedFieldsArray.push(this._flagsToString.call(this));
74
- }
72
+ if (this.flags) {
73
+ extendedFieldsArray.push(this._flagsToString.call(this));
74
+ }
75
75
 
76
- let msg = this.name;
76
+ let msg = this.name;
77
77
 
78
- if (extendedFieldsArray.length > 0) {
79
- msg += `[${extendedFieldsArray.join(", ")}]`;
80
- }
78
+ if (extendedFieldsArray.length > 0) {
79
+ msg += `[${extendedFieldsArray.join(", ")}]`;
80
+ }
81
81
 
82
- msg += `: ${this.message}`;
82
+ msg += `: ${this.message}`;
83
83
 
84
- if (this.stack !== undefined) {
85
- msg += `, stack: ${this.stack}`;
86
- }
84
+ if (this.stack !== undefined) {
85
+ msg += `, stack: ${this.stack}`;
86
+ }
87
87
 
88
- return msg;
89
- }
88
+ return msg;
89
+ }
90
90
  }