A simple library for swapping property values to each other within an object
Assume that we have a simple object (literal) in JS:
let obj = {
a: 'b',
b: 'a'
}
And want to exchange the values between properties as swapping the value of a with the value of b properties:
obj = swapProps(obj, [a], [b])
// result :
// let obj = {
// a: 'a',
// b: 'b'
// }
MIT