MCPcopy Create free account
hub / github.com/SplootCode/splootcode / isValidNumber

Function isValidNumber

packages/language-python/src/nodes/literals.ts:81–83  ·  view source on GitHub ↗
(textValue: string)

Source from the content-addressed store, hash-verified

79const validNumberRegex = /^-?[0-9]+(\.[0-9]*)?$/
80
81function isValidNumber(textValue: string): boolean {
82 return textValue.length > 0 && !!textValue.match(validNumberRegex)
83}
84
85export class PythonNumberLiteral extends PythonNode {
86 constructor(parentReference: ParentReference, value: string) {

Callers 2

dynamicSuggestionsMethod · 0.85
sanitiseNumberOnSaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected