mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(utils): 判断是否为number不够严谨
This commit is contained in:
parent
1c8829fac9
commit
2647ace396
@ -207,4 +207,4 @@ export const isPop = (node: MNode): boolean => Boolean(node.type?.toLowerCase().
|
|||||||
|
|
||||||
export const isPage = (node: MNode): boolean => Boolean(node.type?.toLowerCase() === NodeType.PAGE);
|
export const isPage = (node: MNode): boolean => Boolean(node.type?.toLowerCase() === NodeType.PAGE);
|
||||||
|
|
||||||
export const isNumber = (value: string) => /^(\d|\.)+$/.test(value);
|
export const isNumber = (value: string) => /^(-?\d+)(\.\d+)?$/.test(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user