MCPcopy
hub / github.com/chartjs/Chart.js / valueOrDefault

Function valueOrDefault

src/helpers/helpers.core.ts:82–84  ·  view source on GitHub ↗
(value: T | undefined, defaultValue: T)

Source from the content-addressed store, hash-verified

80 * @param defaultValue - The value to return if `value` is undefined.
81 */
82export function valueOrDefault<T>(value: T | undefined, defaultValue: T) {
83 return typeof value === 'undefined' ? defaultValue : value;
84}
85
86export const toPercentage = (value: number | string, dimension: number) =>
87 typeof value === 'string' && value.endsWith('%') ?

Callers 15

test.jsFile · 0.90
test-auto.jsFile · 0.85
test.jsFile · 0.85
test.cjsFile · 0.85
_getRingWeightMethod · 0.85
parseArrayDataMethod · 0.85
parseObjectDataMethod · 0.85
_getAxisMethod · 0.85
_createDescriptorsMethod · 0.85
buildOrUpdateScalesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…