drapcode-utility 2.3.6 → 2.3.8
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/build/utils/util.js +5 -6
- package/package.json +4 -4
package/build/utils/util.js
CHANGED
|
@@ -17,7 +17,7 @@ const moment_1 = __importDefault(require("moment"));
|
|
|
17
17
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
18
18
|
const uuid_2 = require("uuid");
|
|
19
19
|
const aws4_1 = require("aws4");
|
|
20
|
-
const mysql = require(
|
|
20
|
+
const mysql = require("mysql2/promise");
|
|
21
21
|
exports.nonFindQuery = ["COUNT", "SUM", "AVG", "MIN", "MAX"];
|
|
22
22
|
// Constants
|
|
23
23
|
const DERIVED_FIELD_EXCLUDES = [
|
|
@@ -170,10 +170,9 @@ exports.dynamicSort = dynamicSort;
|
|
|
170
170
|
* @returns True if the email is valid
|
|
171
171
|
*/
|
|
172
172
|
const validateEmail = (email) => {
|
|
173
|
-
if (!email)
|
|
173
|
+
if (!email)
|
|
174
174
|
return false;
|
|
175
|
-
}
|
|
176
|
-
const regexCode = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/;
|
|
175
|
+
const regexCode = /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,24})+$/;
|
|
177
176
|
return regexCode.test(email);
|
|
178
177
|
};
|
|
179
178
|
exports.validateEmail = validateEmail;
|
|
@@ -1235,8 +1234,8 @@ const createMySqlConnection = async (config) => {
|
|
|
1235
1234
|
database: database,
|
|
1236
1235
|
port: port,
|
|
1237
1236
|
});
|
|
1238
|
-
const [rows] = await connection.execute(
|
|
1239
|
-
console.log(
|
|
1237
|
+
const [rows] = await connection.execute("select ?+? as sum", [2, 2]);
|
|
1238
|
+
console.log("==> MySQL createMySqlConnection ~ Testing connection...", rows);
|
|
1240
1239
|
return connection;
|
|
1241
1240
|
}
|
|
1242
1241
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drapcode-utility",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "2.3.8",
|
|
4
|
+
"description": "DrapCode Utility",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"axios": "^1.1.2",
|
|
43
43
|
"date-fns": "^4.1.0",
|
|
44
44
|
"dompurify": "^3.1.7",
|
|
45
|
-
"drapcode-constant": "^1.9.
|
|
45
|
+
"drapcode-constant": "^1.9.7",
|
|
46
46
|
"drapcode-logger": "^1.3.5",
|
|
47
|
-
"drapcode-redis": "^1.4.
|
|
47
|
+
"drapcode-redis": "^1.4.1",
|
|
48
48
|
"exiftool-vendored": "^28.2.1",
|
|
49
49
|
"express": "^4.17.1",
|
|
50
50
|
"gm": "^1.25.0",
|