DefinitelyTyped/types/simple-diff/simple-diff-tests.ts
Nathan Bierema 523b733dbe
[simple-diff] Add simple-diff types (#47956)
* [simple-diff] Add simple-diff types

* Fix

* More lint

* Rename

* Fix
2020-09-23 12:05:06 -07:00

18 lines
391 B
TypeScript

import diff = require('simple-diff');
declare const oldObject: unknown;
declare const newObject: unknown;
const changes = diff(oldObject, newObject, {
idProp: '_id',
idProps: {
"prop1.prop2.*.prop3": "cid"
},
comparators: [
[Date, (a, b, ops) => true]
],
ignore: (a, b, { oldPath }) => {
return oldPath.join('.') === 'prop.test1';
}
});