@tmagic/utils 1.0.0-beta.12 → 1.0.0-beta.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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-beta.12",
2
+ "version": "1.0.0-beta.13",
3
3
  "name": "@tmagic/utils",
4
4
  "main": "dist/tmagic-utils.umd.js",
5
5
  "module": "dist/tmagic-utils.es.js",
@@ -10,8 +10,11 @@
10
10
  "require": "./dist/tmagic-utils.umd.js"
11
11
  }
12
12
  },
13
+ "license": "Apache-2.0",
13
14
  "scripts": {
14
- "build": "vite build"
15
+ "build": "vite build",
16
+ "test": "jest --maxWorkers=8",
17
+ "test:coverage": "jest --maxWorkers=16 --coverage"
15
18
  },
16
19
  "engines": {
17
20
  "node": ">=14"
@@ -21,14 +24,19 @@
21
24
  "url": "https://github.com/Tencent/tmagic-editor.git"
22
25
  },
23
26
  "dependencies": {
24
- "@tmagic/schema": "^1.0.0-beta.12",
25
- "moment": "^2.29.1"
27
+ "@tmagic/schema": "^1.0.0-beta.13",
28
+ "moment": "^2.29.2"
26
29
  },
27
30
  "devDependencies": {
31
+ "@types/jest": "^26.0.23",
28
32
  "@types/node": "^15.12.4",
33
+ "jest": "^27.5.1",
34
+ "jest-serializer-vue": "^2.0.2",
35
+ "jest-transform-stub": "^2.0.0",
36
+ "ts-jest": "^27.1.4",
29
37
  "typescript": "^4.3.4",
30
38
  "vite": "^2.3.7",
31
39
  "vite-plugin-dts": "^0.9.6"
32
40
  },
33
- "gitHead": "ae00dd242d593ac8f57ffcd34e10e99399c7d00b"
41
+ "gitHead": "ca2b203614cbdaff580e5cb6f35630f50b827451"
34
42
  }
package/src/index.ts CHANGED
@@ -207,4 +207,4 @@ export const isPop = (node: MNode): boolean => Boolean(node.type?.toLowerCase().
207
207
 
208
208
  export const isPage = (node: MNode): boolean => Boolean(node.type?.toLowerCase() === NodeType.PAGE);
209
209
 
210
- export const isNumber = (value: string) => /^(\d|\.)+$/.test(value);
210
+ export const isNumber = (value: string) => /^(-?\d+)(\.\d+)?$/.test(value);
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "baseUrl": "../..",
5
- },
6
- "exclude": [
7
- "**/dist/**/*"
8
- ],
9
- }
package/vite.config.ts DELETED
@@ -1,45 +0,0 @@
1
- /*
2
- * Tencent is pleased to support the open source community by making TMagicEditor available.
3
- *
4
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- import { defineConfig } from 'vite';
20
- import dts from 'vite-plugin-dts';
21
-
22
- export default defineConfig({
23
- plugins: [
24
- dts({
25
- outputDir: 'dist/types',
26
- include: ['src/**/*'],
27
- staticImport: true,
28
- insertTypesEntry: true,
29
- logDiagnostics: true,
30
- }),
31
- ],
32
-
33
- build: {
34
- cssCodeSplit: false,
35
- sourcemap: true,
36
- minify: false,
37
- target: 'esnext',
38
-
39
- lib: {
40
- entry: 'src/index.ts',
41
- name: 'TMagicUtils',
42
- fileName: 'tmagic-utils',
43
- },
44
- },
45
- });