1.0.3 • Published 7 years ago

ref-replace v1.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

Ref Replace npm version

A module that converts $ref in JSON objects and replaces it with _ref so that it can be stored in Mongo, and vice versa.

I made this module because $ref is a standard in JSON and in Mongo.

Usage

import {replaceRefsJSON, replaceRefsMongo} from 'ref-replace';

const someJSON = {
  $ref: 'test',
  test: {
    $ref: 'test',
    test: {
      $ref: 'test'
    }
  }
};

console.log(replaceRefsJSON(someJSON))
/**
Output:
{
  _ref: 'test',
  test: {
    _ref: 'test',
    test: {
      _ref: 'test'
    }
  }
}
 */

License

MIT © Hugo Müller-Downing

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago