Socket
Book a DemoInstallSign in
Socket

@remy/muto

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remy/muto

Transforms object structure to new structure based on simplistic formatting.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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. ¯\(ツ)

FAQs

Package last updated on 19 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts