Skip to content

Commit bc395c1

Browse files
committed
Remove unnecessary code
1 parent 0c8be2d commit bc395c1

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

packages/snaps-rpc-methods/jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module.exports = deepmerge(baseConfig, {
1010
],
1111
coverageThreshold: {
1212
global: {
13-
branches: 93.33,
13+
branches: 93.3,
1414
functions: 97.46,
1515
lines: 98.03,
16-
statements: 97.62,
16+
statements: 97.61,
1717
},
1818
},
1919
});

packages/snaps-rpc-methods/src/permitted/setState.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,6 @@ describe('set', () => {
461461
});
462462
});
463463

464-
it('overwrites the state in an existing object', () => {
465-
const object = {
466-
nested: {
467-
key: 'oldValue',
468-
},
469-
};
470-
471-
expect(set(object, undefined, { foo: 'bar' })).toStrictEqual({
472-
foo: 'bar',
473-
});
474-
});
475-
476464
it('overwrites the nested state in an existing object', () => {
477465
const object = {
478466
nested: {

packages/snaps-rpc-methods/src/permitted/setState.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,9 @@ async function getNewState(
220220
export function set(
221221
// eslint-disable-next-line @typescript-eslint/default-param-last
222222
object: Record<string, Json> | null,
223-
key: string | undefined,
223+
key: string,
224224
value: Json,
225225
): JsonObject {
226-
if (key === undefined) {
227-
assert(isObject(value));
228-
return value;
229-
}
230-
231226
const keys = key.split('.');
232227
const requiredObject = object ?? {};
233228
let currentObject: Record<string, Json> = requiredObject;

0 commit comments

Comments
 (0)