concordancejs / concordance

Compare, format, diff and serialize any JavaScript value
ISC License
207 stars 15 forks source link

Support plugins #10

Closed novemberborn closed 7 years ago

novemberborn commented 7 years ago

It should be possible to provide an array of plugins when describing, comparing, formatting or diffing values. Each plugin should be called when describing a complex object, before objects are mapped to the internal classes by their tag. If a plugin returns null the next plugin should be tried (if any). Otherwise the return value is used.

Plugins should be provided the Complex base class so it can extend it. Perhaps we should also provide kathryn's version so it can handle compatibility issues.

The returned value should implement all the necessary methods for comparing, formatting and diffing.

novemberborn commented 7 years ago

Landed in a648a6aa99c6e65ada50f293cbd425a96fba4d05.