@wener/console
Version:
Base console UI toolkit
20 lines (17 loc) • 398 B
text/typescript
import { assert, test } from 'vitest';
import { DynamicStore } from './DynamicStore';
import type { ModuleStore } from './types';
test('DynamicStore', () => {
let store: ModuleStore = new DynamicStore();
{
const s = store.as<Val>();
s.add('a.b', '1');
s.add('a.b', ['2']);
assert.deepEqual(s.collect('a.b'), ['1', '2']);
}
});
interface Val {
a: {
b: string[];
};
}