MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / parseValue

Function parseValue

src/xmlparser/OrderedObjParser.js:802–816  ·  view source on GitHub ↗
(val, shouldParse, options)

Source from the content-addressed store, hash-verified

800}
801
802function parseValue(val, shouldParse, options) {
803 if (shouldParse && typeof val === 'string') {
804 //console.log(options)
805 const newval = val.trim();
806 if (newval === 'true') return true;
807 else if (newval === 'false') return false;
808 else return toNumber(val, options);
809 } else {
810 if (isExist(val)) {
811 return val;
812 } else {
813 return '';
814 }
815 }
816}
817
818function fromCodePoint(str, base, prefix) {
819 const codePoint = Number.parseInt(str, base);

Callers 2

parseTextDataFunction · 0.85
buildAttributesMapFunction · 0.85

Calls 1

isExistFunction · 0.90

Tested by

no test coverage detected