@moreapp/common-nodejs 0.7.12 → 0.7.13
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/utils.js +2 -2
- package/dist/utils.test.js +1 -0
- package/package.json +25 -21
package/dist/utils.js
CHANGED
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.isValidEmail = exports.currentTraceId = exports.environmentVariable = void 0;
|
|
7
|
-
const context_utils_1 = require("@opentelemetry/api/build/src/trace/context-utils");
|
|
8
7
|
const api_1 = require("@opentelemetry/api");
|
|
9
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
10
9
|
function environmentVariable(key, fallback) {
|
|
@@ -29,7 +28,7 @@ function environmentVariable(key, fallback) {
|
|
|
29
28
|
}
|
|
30
29
|
exports.environmentVariable = environmentVariable;
|
|
31
30
|
function currentTraceId() {
|
|
32
|
-
return
|
|
31
|
+
return api_1.trace.getSpanContext(api_1.context.active())?.traceId;
|
|
33
32
|
}
|
|
34
33
|
exports.currentTraceId = currentTraceId;
|
|
35
34
|
const emailAddressMaxLength = 254; // https://stackoverflow.com/a/574698
|
|
@@ -49,6 +48,7 @@ function isValidEmail(email) {
|
|
|
49
48
|
return false;
|
|
50
49
|
}
|
|
51
50
|
return (!localAddr.startsWith(".") &&
|
|
51
|
+
!localAddr.endsWith(".") &&
|
|
52
52
|
!localAddr.includes(" ") &&
|
|
53
53
|
emailAddressLocalPattern.test(localAddr) &&
|
|
54
54
|
emailAddressDomainPattern.test(domain));
|
package/dist/utils.test.js
CHANGED
|
@@ -58,6 +58,7 @@ describe("isValidEmail", () => {
|
|
|
58
58
|
test("Missing local part", () => expect((0, utils_1.isValidEmail)("@moreapp.dev")).toBeFalsy());
|
|
59
59
|
test("Too long", () => expect((0, utils_1.isValidEmail)("abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-@moreapp.dev")).toBeFalsy());
|
|
60
60
|
test("Starts with '.'", () => expect((0, utils_1.isValidEmail)(".a@moreapp.dev")).toBeFalsy());
|
|
61
|
+
test("Ends with a '.'", () => expect((0, utils_1.isValidEmail)("a.@moreapp.dev")).toBeFalsy());
|
|
61
62
|
test("Local part contains whitespace", () => expect((0, utils_1.isValidEmail)("a b@moreapp.dev")).toBeFalsy());
|
|
62
63
|
});
|
|
63
64
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moreapp/common-nodejs",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.13",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,41 +21,45 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@google-cloud/logging": "10.5.0",
|
|
23
23
|
"@google-cloud/opentelemetry-cloud-trace-exporter": "2.1.0",
|
|
24
|
-
"@opentelemetry/api": "1.
|
|
25
|
-
"@opentelemetry/
|
|
26
|
-
"@opentelemetry/instrumentation
|
|
27
|
-
"@opentelemetry/instrumentation-
|
|
28
|
-
"@opentelemetry/instrumentation-
|
|
29
|
-
"@opentelemetry/instrumentation-
|
|
30
|
-
"@opentelemetry/
|
|
31
|
-
"@opentelemetry/
|
|
32
|
-
"
|
|
24
|
+
"@opentelemetry/api": "1.8.0",
|
|
25
|
+
"@opentelemetry/core": "1.22.0",
|
|
26
|
+
"@opentelemetry/instrumentation": "0.49.1",
|
|
27
|
+
"@opentelemetry/instrumentation-dns": "0.34.0",
|
|
28
|
+
"@opentelemetry/instrumentation-express": "0.36.1",
|
|
29
|
+
"@opentelemetry/instrumentation-http": "0.49.1",
|
|
30
|
+
"@opentelemetry/instrumentation-winston": "0.35.0",
|
|
31
|
+
"@opentelemetry/resources": "1.22.0",
|
|
32
|
+
"@opentelemetry/sdk-node": "0.49.1",
|
|
33
|
+
"@opentelemetry/sdk-trace-base": "1.22.0",
|
|
34
|
+
"@opentelemetry/sdk-trace-node": "1.22.0",
|
|
35
|
+
"@opentelemetry/semantic-conventions": "1.22.0",
|
|
36
|
+
"axios": "1.6.8",
|
|
33
37
|
"content-disposition-parser": "1.0.2",
|
|
34
|
-
"date-and-time": "3.
|
|
38
|
+
"date-and-time": "3.1.1",
|
|
35
39
|
"lodash": "4.17.21",
|
|
36
|
-
"winston": "3.
|
|
40
|
+
"winston": "3.13.0",
|
|
37
41
|
"zod": "3.22.4"
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
40
44
|
"@types/jest": "29.5.11",
|
|
41
|
-
"@types/lodash": "4.
|
|
42
|
-
"@types/node": "18.
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
44
|
-
"@typescript-eslint/parser": "6.
|
|
45
|
-
"eslint": "8.
|
|
45
|
+
"@types/lodash": "4.17.0",
|
|
46
|
+
"@types/node": "18.19.26",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "6.21.0",
|
|
48
|
+
"@typescript-eslint/parser": "6.21.0",
|
|
49
|
+
"eslint": "8.57.0",
|
|
46
50
|
"eslint-config-airbnb-typescript": "17.1.0",
|
|
47
51
|
"eslint-config-prettier": "9.1.0",
|
|
48
|
-
"eslint-plugin-import": "2.
|
|
52
|
+
"eslint-plugin-import": "2.29.1",
|
|
49
53
|
"eslint-plugin-prettier": "5.1.3",
|
|
50
54
|
"husky": "9.0.7",
|
|
51
|
-
"jest": "29.
|
|
55
|
+
"jest": "29.7.0",
|
|
52
56
|
"jest-mock-extended": "3.0.5",
|
|
53
57
|
"lint-staged": "15.2.1",
|
|
54
|
-
"nock": "13.
|
|
58
|
+
"nock": "13.5.4",
|
|
55
59
|
"prettier": "3.2.4",
|
|
56
60
|
"ts-jest": "29.1.2",
|
|
57
61
|
"ts-node": "10.9.2",
|
|
58
|
-
"typescript": "5.
|
|
62
|
+
"typescript": "5.4.3"
|
|
59
63
|
},
|
|
60
64
|
"prettier": {
|
|
61
65
|
"printWidth": 100,
|