MCPcopy Create free account
hub / github.com/witheve/Eve / getDecodeCache

Function getDecodeCache

src/commonmark.js:3071–3088  ·  view source on GitHub ↗
(exclude)

Source from the content-addressed store, hash-verified

3069var decodeCache = {};
3070
3071function getDecodeCache(exclude) {
3072 var i, ch, cache = decodeCache[exclude];
3073 if (cache) { return cache; }
3074
3075 cache = decodeCache[exclude] = [];
3076
3077 for (i = 0; i < 128; i++) {
3078 ch = String.fromCharCode(i);
3079 cache.push(ch);
3080 }
3081
3082 for (i = 0; i < exclude.length; i++) {
3083 ch = exclude.charCodeAt(i);
3084 cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
3085 }
3086
3087 return cache;
3088}
3089
3090
3091// Decode percent-encoded string.

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected