MCPcopy Index your code
hub / github.com/adobe/react-spectrum / insertObject

Function insertObject

packages/dev/eslint-plugin-rsp-rules/rules/imports.js:129–138  ·  view source on GitHub ↗
(obj, key, value)

Source from the content-addressed store, hash-verified

127
128// Insert a key into an object and sort it.
129function insertObject(obj, key, value) {
130 obj[key] = value;
131
132 let res = {};
133 for (let key of Object.keys(obj).sort()) {
134 res[key] = obj[key];
135 }
136
137 return res;
138}
139
140export default plugin;

Callers 1

fixFunction · 0.85

Calls 1

sortMethod · 0.65

Tested by

no test coverage detected