Skip to content

WebForgeOSS/transmuter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transmuter

Transform an object content based on defined criteria

Build Status Coverage Status Maintainability Language grade: JavaScript tested with jest code style: prettier

Install

$ npm install transmuter

Usage

const transmuter = require('transmuter');

const alterations = [
  { key: "password", val: "(.*)", replacement: "xxxxx" },
  { key: "token", val: "(.*)", replacement: "xxxxx" },
];

const account = {
  email: "john.doe@gmail.com",
  password: "T%dt4e5x;2!",
  token: "eyJhbGciOiJIUzI1NiIsInR5cCI6Ikp"
}

transmuter(alterations, account);
//=> { email: "john.doe@gmail.com", password: "xxxxx", token: "xxxxx" }

API

transmuter ⇒ Object

Transform an object content based on defined criteria

Returns: Object - new object with alterations
Curriable:

Param Type Description
alterations Object[] describe changes to apply depanding on filters
object Object object to apply alterations on

License

MIT © muceres

About

Transform object content based on defined criteria

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •