@smart-link/rn-im 1.0.6 → 1.0.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.
@@ -28,7 +28,7 @@ exports.mix = exports.mixWithReg = exports.mixUrl = exports.mixPhone = void 0;
28
28
  // mixEmoji(text, textEmojiItems);
29
29
  // }
30
30
  function mixPhone(text) {
31
- const phoneReg = /(1[3|4|5|7|8][\d]{9}|0[\d]{2,3}-[\d]{7,8}|400[-]?[\d]{3}[-]?[\d]{4})/g;
31
+ const phoneReg = /(1[\d]{10}|0\d{2,3}-\d{7,8}|400-?\d{3}-?\d{4})/g;
32
32
  return mixWithReg(text, 'phone', phoneReg);
33
33
  }
34
34
  exports.mixPhone = mixPhone;
@@ -44,10 +44,10 @@ function mixWithReg(text, type, reg) {
44
44
  let leftIndex = text.indexOf(tag);
45
45
  let rightIndex = leftIndex + tag.length;
46
46
  const leftText = text.substring(0, leftIndex);
47
- items.push({ type: 'text', value: leftText + ' ' });
47
+ items.push({ type: 'text', value: leftText + '' });
48
48
  const tagText = text.substring(leftIndex, rightIndex);
49
49
  items.push({ type: type, value: tagText });
50
- text = ' ' + text.substring(rightIndex);
50
+ text = '' + text.substring(rightIndex);
51
51
  });
52
52
  items.push({ type: 'text', value: text });
53
53
  return items;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@smart-link/rn-im",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "dependencies": {
7
7
  "color": "^5.0.0",
8
8
  "lodash-es": "^4.17.21",
9
9
  "emoji-regex": "^10.4.0",
10
- "@smart-link/im-base": "^1.0.6"
10
+ "@smart-link/im-base": "^1.0.8"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@react-native/eslint-config": "0.73.2",
@@ -63,8 +63,8 @@
63
63
  "react-redux": "^8.1.3",
64
64
  "redux": "^4.2.1",
65
65
  "redux-thunk": "^2.4.2",
66
- "@smart-link/rn-base": "^1.0.7",
67
- "@smart-link/rn-ui": "^1.0.6"
66
+ "@smart-link/rn-ui": "^1.0.6",
67
+ "@smart-link/rn-base": "^1.0.7"
68
68
  },
69
69
  "files": [
70
70
  "dist/**",