fix(core): update
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartobject from '../ts/index';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartobject from '../ts/index.js';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
const result = smartobject.compareObjects(
|
||||
@ -28,7 +28,7 @@ tap.test('childObject should now be in parentObject', async () => {
|
||||
|
||||
tap.test('should be able to deepAdd an childParam', async () => {
|
||||
const parentObject = {
|
||||
hello: 'there'
|
||||
hello: 'there',
|
||||
};
|
||||
const parentObject2 = smartobject.smartAdd(parentObject, 'wow.za', 'yes');
|
||||
console.log(parentObject2);
|
||||
@ -39,9 +39,9 @@ tap.test('should be able to deep get an item', async () => {
|
||||
const testObject = {
|
||||
hey: {
|
||||
there: {
|
||||
so: 'cool'
|
||||
}
|
||||
}
|
||||
so: 'cool',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const item = smartobject.smartGet(testObject, 'hey.there.so');
|
||||
@ -52,11 +52,11 @@ tap.test('should call properties for minimatched properties', async () => {
|
||||
let testObject = {
|
||||
matchedOne: 'Hey!',
|
||||
matchedTwo: 'this works!',
|
||||
notmatched: 'NOT!'
|
||||
notmatched: 'NOT!',
|
||||
};
|
||||
|
||||
const matchedStrings: string[] = [];
|
||||
await smartobject.forEachMinimatch(testObject, 'matched*', matchedProperty => {
|
||||
await smartobject.forEachMinimatch(testObject, 'matched*', (matchedProperty) => {
|
||||
matchedStrings.push(matchedProperty);
|
||||
console.log(matchedProperty);
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { expect, expectAsync, tap} from '@pushrocks/tapbundle';
|
||||
import * as smartobject from '../ts';
|
||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartobject from '../ts/index.js';
|
||||
|
||||
let testSmartobject: smartobject.SmartObject;
|
||||
|
||||
@ -10,15 +10,15 @@ tap.test('should create a smartobject', async () => {
|
||||
yeah: 'so deep',
|
||||
evendeeper: {
|
||||
sodeep: 2,
|
||||
deepArray: ['one array', 'two array']
|
||||
}
|
||||
}
|
||||
}
|
||||
deepArray: ['one array', 'two array'],
|
||||
},
|
||||
},
|
||||
};
|
||||
testSmartobject = new smartobject.SmartObject(originalObject);
|
||||
testSmartobject.addValueAtFlatPathString('deep.nice', 'yeah that has been added');
|
||||
console.log(testSmartobject.originalObject);
|
||||
console.log(testSmartobject.toFlatObject())
|
||||
console.log(testSmartobject.toFlatObject());
|
||||
expect(testSmartobject.getValueAtFlatPathString('deep.yeah')).toEqual('so deep');
|
||||
});
|
||||
|
||||
tap.start();
|
||||
tap.start();
|
||||
|
Reference in New Issue
Block a user