MCPcopy Create free account
hub / github.com/adobe/react-spectrum / prefixKeys

Function prefixKeys

scripts/migrateIntl.mjs:52–62  ·  view source on GitHub ↗
(obj, prefix)

Source from the content-addressed store, hash-verified

50]);
51
52function prefixKeys(obj, prefix) {
53 let newObj = {};
54 for (let [key, value] of Object.entries(obj)) {
55 let newKey = `${prefix}.${key}`;
56 if (mapToNewKeys[newKey]) {
57 newKey = mapToNewKeys[newKey];
58 }
59 newObj[newKey] = value;
60 }
61 return newObj;
62}
63
64// remove properties from an object if they are not in the set of strings to allow
65function filterKeys(obj) {

Callers 1

migrateIntl.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected