mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-26 10:15:46 +00:00
Copy react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 (upstream software-mansion/enriched-markdown 766fc0e67) into packages/react-native-enriched-markdown, with patches/react-native-enriched-markdown+1.2.0-nightly-20261014-766fc0e67.patch applied. Nothing else changes in this commit; the package is not a workspace yet. Reproduce: npm pack react-native-enriched-markdown@1.2.0-nightly-20261014-766fc0e67 tar xzf react-native-enriched-markdown-*.tgz mkdir -p t/node_modules && mv package t/node_modules/react-native-enriched-markdown (cd t && git init -q && git apply ../patches/react-native-enriched-markdown+*.patch) diff -r t/node_modules/react-native-enriched-markdown packages/react-native-enriched-markdown The diff is empty.
31 lines
804 B
JavaScript
31 lines
804 B
JavaScript
"use strict";
|
|
|
|
const OFF = {
|
|
heading: false,
|
|
unorderedList: false,
|
|
orderedList: false
|
|
};
|
|
|
|
// Validated per leaf rather than trusted from the prop type: `getBoolean` on the
|
|
// Android side throws on a missing or non-boolean field, and a null root would
|
|
// crash JS on property access.
|
|
const flag = raw => typeof raw === 'boolean' ? raw : false;
|
|
export const normalizeMarkdownShortcuts = raw => {
|
|
if (typeof raw === 'boolean') {
|
|
return {
|
|
heading: raw,
|
|
unorderedList: raw,
|
|
orderedList: raw
|
|
};
|
|
}
|
|
if (typeof raw !== 'object' || raw === null) {
|
|
return OFF;
|
|
}
|
|
const obj = raw;
|
|
return {
|
|
heading: flag(obj.heading),
|
|
unorderedList: flag(obj.unorderedList),
|
|
orderedList: flag(obj.orderedList)
|
|
};
|
|
};
|
|
//# sourceMappingURL=normalizeMarkdownShortcuts.js.map
|