npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

@remy/muto

1.0.0

@remy

npmSnykSocket
Downloads:0
$ npm install @remy/muto
DailyWeeklyMonthlyYearly

muto

Transforms object structure to new structure based on simplistic formatting.

Note that this module is only to simplify reoccurring use of something like o.map(({ a, b }) => ({ a, b })) where o contains many properties but the user only wants a and b.

Usage

const muto = require('@remy/muto');

const template = muto(`{ id: publicId, url }`);

const res = template({ private: 1234, publicId: 'p1', url: 'example.com' });
// res = { id: 'p1', url: 'example.com' }

Limitations

This was a quick hack, so it only works on shallow objects.

Name

act of transforming.

Greek. Sounds neat too. ¯\(ツ)/¯