MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / interpretDict

Function interpretDict

libraries/p5.js:3094–3114  ·  view source on GitHub ↗
(dict, meta, strings)

Source from the content-addressed store, hash-verified

3092// Interpret a dictionary and return a new dictionary with readable keys and values for missing entries.
3093// This function takes `meta` which is a list of objects containing `operand`, `name` and `default`.
3094function interpretDict(dict, meta, strings) {
3095 var newDict = {};
3096
3097 // Because we also want to include missing values, we start out from the meta list
3098 // and lookup values in the dict.
3099 for (var i = 0; i < meta.length; i += 1) {
3100 var m = meta[i];
3101 var value = dict[m.op];
3102 if (value === undefined) {
3103 value = m.value !== undefined ? m.value : null;
3104 }
3105
3106 if (m.type === 'SID') {
3107 value = getCFFString(strings, value);
3108 }
3109
3110 newDict[m.name] = value;
3111 }
3112
3113 return newDict;
3114}
3115
3116// Parse the CFF header.
3117function parseCFFHeader(data, start) {

Callers 2

parseCFFTopDictFunction · 0.85
parseCFFPrivateDictFunction · 0.85

Calls 1

getCFFStringFunction · 0.85

Tested by

no test coverage detected