Ensure camelCase names appear in inspect (#4554)

This commit is contained in:
Jaco
2022-02-09 14:01:47 +02:00
committed by GitHub
parent e66cc0fb45
commit 3b991ce8c7
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -223,7 +223,10 @@ export class Struct<
const inner = new Array<Inspect>();
for (const [k, v] of this.entries()) {
inner.push({ ...v.inspect(), name: k.toString() });
inner.push({
...v.inspect(),
name: stringCamelCase(k as string)
});
}
return {
@@ -129,10 +129,10 @@ function createKey (registry: Registry, itemFn: CreateItemFn, args: RawArgs): Ui
function createStorageInspect (registry: Registry, itemFn: CreateItemFn, options: CreateItemOptions): (...args: unknown[]) => Inspect {
const { meta: { type } } = itemFn;
return (...args: unknown[]) => {
return (...args: unknown[]): Inspect => {
if (type.isPlain) {
return options.skipHashing
? { inner: [], name: 'encoded', value: u8aToU8a(options.key) }
? { inner: [], name: 'wellKnown', outer: [u8aToU8a(options.key)] }
: createKeyInspect(registry, itemFn, NO_RAW_ARGS);
}