@aneuhold/core-ts-lib 1.1.5 → 1.1.7
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/lib/index.d.ts +3 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/utils/ErrorUtils.d.ts +11 -0
- package/lib/utils/ErrorUtils.d.ts.map +1 -0
- package/lib/utils/ErrorUtils.js +21 -0
- package/package.json +1 -2
- package/readme.md +2 -0
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import datesAreOnSameDay from './helperFunctions/dateFunctions';
|
|
2
2
|
import sleep from './helperFunctions/sleep';
|
|
3
3
|
import DependencyService from './services/DependencyService';
|
|
4
|
-
import DOFunctionService, { DOFunction } from './services/DOFunctionService/DOFunctionService';
|
|
5
|
-
import { DOAuthCheckPasswordInput, DOAuthCheckPasswordOutput, DOAuthCheckPasswordRawOutput } from './services/DOFunctionService/functionsInfo/authCheckPassword';
|
|
6
4
|
import FileSystemService from './services/FileSystemService/FileSystemService';
|
|
7
5
|
import StringService from './services/StringService';
|
|
6
|
+
import ErrorUtils from './utils/ErrorUtils';
|
|
8
7
|
import Logger from './utils/Logger';
|
|
9
8
|
import TestUtils from './utils/TestUtils';
|
|
10
|
-
export { datesAreOnSameDay, DependencyService,
|
|
11
|
-
export type {
|
|
9
|
+
export { datesAreOnSameDay, DependencyService, FileSystemService, Logger, sleep, StringService, TestUtils, ErrorUtils };
|
|
10
|
+
export type {};
|
|
12
11
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,gDAAgD,CAAC;AAC/E,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAC5C,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,aAAa,EACb,SAAS,EACT,UAAU,EACX,CAAC;AAGF,YAAY,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TestUtils = exports.StringService = exports.sleep = exports.Logger = exports.FileSystemService = exports.
|
|
6
|
+
exports.ErrorUtils = exports.TestUtils = exports.StringService = exports.sleep = exports.Logger = exports.FileSystemService = exports.DependencyService = exports.datesAreOnSameDay = void 0;
|
|
7
7
|
const dateFunctions_1 = __importDefault(require("./helperFunctions/dateFunctions"));
|
|
8
8
|
exports.datesAreOnSameDay = dateFunctions_1.default;
|
|
9
9
|
const sleep_1 = __importDefault(require("./helperFunctions/sleep"));
|
|
10
10
|
exports.sleep = sleep_1.default;
|
|
11
11
|
const DependencyService_1 = __importDefault(require("./services/DependencyService"));
|
|
12
12
|
exports.DependencyService = DependencyService_1.default;
|
|
13
|
-
const DOFunctionService_1 = __importDefault(require("./services/DOFunctionService/DOFunctionService"));
|
|
14
|
-
exports.DOFunctionService = DOFunctionService_1.default;
|
|
15
13
|
const FileSystemService_1 = __importDefault(require("./services/FileSystemService/FileSystemService"));
|
|
16
14
|
exports.FileSystemService = FileSystemService_1.default;
|
|
17
15
|
const StringService_1 = __importDefault(require("./services/StringService"));
|
|
18
16
|
exports.StringService = StringService_1.default;
|
|
17
|
+
const ErrorUtils_1 = __importDefault(require("./utils/ErrorUtils"));
|
|
18
|
+
exports.ErrorUtils = ErrorUtils_1.default;
|
|
19
19
|
const Logger_1 = __importDefault(require("./utils/Logger"));
|
|
20
20
|
exports.Logger = Logger_1.default;
|
|
21
21
|
const TestUtils_1 = __importDefault(require("./utils/TestUtils"));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class ErrorUtils {
|
|
2
|
+
/**
|
|
3
|
+
* Throws an array of errors in a formatted list.
|
|
4
|
+
*/
|
|
5
|
+
static throwErrorList(errorList: string[], erroneousObject: object): void;
|
|
6
|
+
/**
|
|
7
|
+
* Throws an error along with an accompanying erroroneous object.
|
|
8
|
+
*/
|
|
9
|
+
static throwError(errorMessage: string, erroneousObject: object): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ErrorUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorUtils.d.ts","sourceRoot":"","sources":["../../src/utils/ErrorUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,MAAM;IAUlE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAGhE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class ErrorUtils {
|
|
4
|
+
/**
|
|
5
|
+
* Throws an array of errors in a formatted list.
|
|
6
|
+
*/
|
|
7
|
+
static throwErrorList(errorList, erroneousObject) {
|
|
8
|
+
let errorString = '';
|
|
9
|
+
for (let i = 0; i < errorList.length; i += 1) {
|
|
10
|
+
errorString += `${errorList[i]}\n`;
|
|
11
|
+
}
|
|
12
|
+
throw new Error(`${errorString}${JSON.stringify(erroneousObject, null, 2)}`);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Throws an error along with an accompanying erroroneous object.
|
|
16
|
+
*/
|
|
17
|
+
static throwError(errorMessage, erroneousObject) {
|
|
18
|
+
ErrorUtils.throwErrorList([errorMessage], erroneousObject);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = ErrorUtils;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aneuhold/core-ts-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "A core library for all of my TypeScript projects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.5.8",
|
|
36
36
|
"@types/node": "^18.15.0",
|
|
37
|
-
"@types/node-fetch": "^2.6.9",
|
|
38
37
|
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
39
38
|
"@typescript-eslint/parser": "^5.54.1",
|
|
40
39
|
"eslint": "^8.35.0",
|