fix(core): update

This commit is contained in:
2022-03-07 15:28:32 +01:00
parent 2c1440082e
commit 0f2003d0bc
10 changed files with 275 additions and 200 deletions

23
test/test.smartobject.ts Normal file
View File

@ -0,0 +1,23 @@
import { expect, expectAsync, tap} from '@pushrocks/tapbundle';
import * as smartobject from '../ts';
let testSmartobject: smartobject.SmartObject;
tap.test('should create a smartobject', async () => {
const originalObject = {
test: 'hey',
deep: {
yeah: 'so deep',
evendeeper: {
sodeep: 2,
}
}
}
testSmartobject = new smartobject.SmartObject(originalObject);
testSmartobject.addValueAtFlatPathString('deep.nice', 'yeah that has been added');
console.log(testSmartobject.originalObject);
console.log(testSmartobject.toFlatObject())
expect(testSmartobject.getValueAtFlatPathString('deep.yeah')).toEqual('so deep');
});
tap.start();