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

Function parseStringToNum

packages/language-web/types/js/literals.ts:117–126  ·  view source on GitHub ↗
(textValue: string | number)

Source from the content-addressed store, hash-verified

115}
116
117function parseStringToNum(textValue: string | number): number {
118 if (typeof textValue === 'string') {
119 let val = parseInt(textValue)
120 if (textValue.includes('.')) {
121 val = parseFloat(textValue)
122 }
123 return val
124 }
125 return textValue
126}
127
128export class NumericLiteral extends JavaScriptSplootNode {
129 constructor(parentReference: ParentReference, value: number) {

Callers 3

dynamicSuggestionsMethod · 0.85
deserializerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected