MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / _HandleAmpEntities

Function _HandleAmpEntities

packages/core/xml/index.ts:445–463  ·  view source on GitHub ↗
(found: string, decimalValue: string, hexValue: string, wordValue: string)

Source from the content-addressed store, hash-verified

443}
444
445function _HandleAmpEntities(found: string, decimalValue: string, hexValue: string, wordValue: string): string {
446 if (wordValue) {
447 if (!_ampCodes) {
448 _ampCodes = _generateAmpMap();
449 }
450 const res = _ampCodes.get(wordValue);
451 if (res) {
452 return String.fromCodePoint(res);
453 }
454
455 // Invalid word; so we just return it
456 return found;
457 }
458 if (decimalValue) {
459 return String.fromCodePoint(parseInt(decimalValue, 10));
460 }
461
462 return String.fromCodePoint(parseInt(hexValue, 16));
463}
464
465/**
466 * A simple non-validating SAX parser based on https://github.com/vflash/easysax version 0.1.14

Callers

nothing calls this directly

Calls 2

_generateAmpMapFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected