biz-slide-core 1.2.17 → 1.2.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.
@@ -5,8 +5,10 @@ var mongoose_1 = require("mongoose");
5
5
  var PngSvgSchema = new mongoose_1.Schema({
6
6
  deletedAt: { type: Date, default: null },
7
7
  isLocked: { type: Boolean, default: false },
8
+ optionsDownloaded: mongoose_1.Schema.Types.Mixed,
8
9
  isDownloaded: { type: Boolean, default: false },
9
10
  isCompleted: { type: Boolean, default: false },
11
+ hasError: { type: Boolean, default: false },
10
12
  userId: { type: String, default: null },
11
13
  title: { type: String, default: null },
12
14
  styleCategory: { type: String, default: null },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz-slide-core",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,13 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasAbusiveWords = void 0;
3
+ exports.hasAbusiveWords = exports.hasSpecialCharacter = exports.hasExactMatch = void 0;
4
+ function hasExactMatch(str, word) {
5
+ // Construct a regular expression to match the word as a whole word
6
+ var regex = new RegExp('\\b' + word + '\\b', 'i'); // 'i' for case-insensitive matching
7
+ // Test if the word has an exact match in the string
8
+ return regex.test(str);
9
+ }
10
+ exports.hasExactMatch = hasExactMatch;
11
+ function hasSpecialCharacter(str) {
12
+ // Define a regular expression with a character class containing special characters
13
+ var regex = /[!@#$%^&*()_+\-=\[\]{};:\\|<>\/?]/;
14
+ // Test if the string contains any special character
15
+ return regex.test(str);
16
+ }
17
+ exports.hasSpecialCharacter = hasSpecialCharacter;
4
18
  function hasAbusiveWords(str, words) {
5
19
  // Convert the string to lowercase for case-insensitive matching
6
20
  var lowerStr = str.toLowerCase();
21
+ if (hasSpecialCharacter(lowerStr)) {
22
+ return true;
23
+ }
7
24
  // Check if any abusive word exists in the string
8
25
  for (var _i = 0, words_1 = words; _i < words_1.length; _i++) {
9
26
  var word = words_1[_i];
10
- if (lowerStr.includes(word.toLowerCase())) {
27
+ if (hasExactMatch(lowerStr, word.toLowerCase())) {
11
28
  return true;
12
29
  }
13
30
  }