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

Function parseValue

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

Source from the content-addressed store, hash-verified

864}
865
866function parseValue(val, shouldParse, options) {
867 if (shouldParse && typeof val === 'string') {
868 //console.log(options)
869 const newval = val.trim();
870 if (newval === 'true') return true;
871 else if (newval === 'false') return false;
872 else return toNumber(val, options);
873 } else {
874 if (isExist(val)) {
875 return val;
876 } else {
877 return '';
878 }
879 }
880}
881
882function fromCodePoint(str, base, prefix) {
883 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