1.1.0 • Published 7 years ago

valueless v1.1.0

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

valueless

Replace values with paths, for use in test fixtures

NPM version NPM downloads Dependency Status Gitter Chat for valueless Donate via PayPal Donate via Gratipay Analytics Follow JamieMason on GitHub Follow fold_left on Twitter

Installation

npm install --save-dev valueless

Usage

Node.js

import valueless from 'valueless';

const data = [{
  id: 1,
  name: 'Marloes'
}, {
  id: 2,
  name: 'Rutger'
}];

valueless(data);
// => [{ id: '0.id', name: '0.name' }, { id: '1.id', name: '1.name' }]

valueless(data, { excludes: ['id'] });
// => [{ id: 1, name: '0.name' }, { id: 2, name: '1.name' }]

valueless(data, { prefix: 'API' });
// => [{ id: 'API:0.id', name: 'API:0.name' }, { id: 'API:1.id', name: 'API:1.name' }]

valueless(data, { excludes: ['id'], prefix: 'API' });
// => [{ id: 1, name: 'API:0.name' }, { id: 2, name: 'API:1.name' }]

Command Line

echo '[["Serialised"],["JSON"]]' | valueless
echo '[["Serialised"],["JSON"]]' | valueless --prefix CMS
echo '[["Serialised"],["JSON"]]' | valueless --excludes foo,bar,baz

See valueless --help for more information.

Background

Not a common use-case at all, but created to see if it could reduce some of the overhead we have when managing test fixtures for JSON returned by contentstack, which we are transforming using reselect.

1.1.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago