MCPcopy
hub / github.com/vuejs/core / castValue

Function castValue

packages/runtime-dom/src/directives/vModel.ts:48–52  ·  view source on GitHub ↗
(value: string, trim?: boolean, number?: boolean | null)

Source from the content-addressed store, hash-verified

46>
47
48function castValue(value: string, trim?: boolean, number?: boolean | null) {
49 if (trim) value = value.trim()
50 if (number) value = looseToNumber(value)
51 return value
52}
53
54// We are exporting the v-model runtime directly as vnode hooks so that it can
55// be tree-shaken in case v-model is never used.

Callers 1

createdFunction · 0.85

Calls 1

looseToNumberFunction · 0.90

Tested by

no test coverage detected