MCPcopy Create free account
hub / github.com/adobe/react-spectrum / formatValue

Function formatValue

packages/dev/s2-docs/scripts/generateMarkdownDocs.mjs:860–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858 };
859
860 const formatValue = value => {
861 if (typeof value === 'number') {
862 return `\`${value}\``;
863 }
864 const str = String(value);
865 if (BARE_VALUE_TOKENS.has(str) || str.includes('${')) {
866 return `\`${str}\``;
867 }
868 return `\`'${str}'\``;
869 };
870
871 values.forEach(value => {
872 if (value === undefined || value === null) {

Callers 1

buildTokensFunction · 0.70

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected