Hashids in object
Go through object, detect id values and decode or encode them
Install
yarn
yarn add hashids-in-object
npm
npm install hashids-in-object --save
Usage
// Inputconst example = id: 123 user_id: 391 name: 'Michael' contact_id: 12 some: deep: object: in: array: id: 1 // Processconst encodedExample = // Output id: 'aMj3b' user_id: 'elpJe' name: 'Michael' contact_id: '7ax9b' some: deep: object: in: array: id: 'aMj3b' // Decode it: // Output id: 123 user_id: 391 name: 'Michael' contact_id: 12 some: deep: object: in: array: id: 1
Under the hood
At the moment it uses the hashids.js
module to encode/decode the single id's.