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

Function parseValue

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

Source from the content-addressed store, hash-verified

822}
823
824function parseValue(val, shouldParse, options) {
825 if (shouldParse && typeof val === 'string') {
826 //console.log(options)
827 const newval = val.trim();
828 if (newval === 'true') return true;
829 else if (newval === 'false') return false;
830 else return toNumber(val, options);
831 } else {
832 if (isExist(val)) {
833 return val;
834 } else {
835 return '';
836 }
837 }
838}
839
840function fromCodePoint(str, base, prefix) {
841 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