Giter Club home page Giter Club logo

schema-cleaner's Introduction

Description

This app will deduplicate any objects and fields within the provided JSON file. Duplicates are identified by all matching fields/values except for any _id values. It will output a file named clean_application.json with the cleaned schema.

I opted to use a recursive technique for this solution, which can help with performance and scalability. However, the potential downside is that it can make it more difficult to maintain. An alternate way to solve this problem would be to "hard-code" different paths to inspect, but the largest downside there is scaling when other fields need de-duplication. I added more documentation that would help me and other developers when this code needs to be changed to assist in maintainability.

How to Run

This requires an argument to be passed in and can be run using a command like the one below. The argument must be a JSON file the has a versions field.

npm install
npm run dedupFile ./mock_application.json

How to Test

Tests are written and executed in Jest.

npm test

TODO

  • Handle cases where we want children to de-duplicate, but not the parent entity
  • Make the _id field a configurable argument

schema-cleaner's People

Contributors

mustangjaro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.