https://github.com/ioncache/data-sanitization
Sanitization library for obfuscating/removing/securing data.
https://github.com/ioncache/data-sanitization
Last synced: about 1 year ago
JSON representation
Sanitization library for obfuscating/removing/securing data.
- Host: GitHub
- URL: https://github.com/ioncache/data-sanitization
- Owner: ioncache
- License: mit
- Created: 2022-08-08T05:53:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-15T14:32:54.000Z (about 2 years ago)
- Last Synced: 2024-01-15T18:50:08.230Z (about 2 years ago)
- Language: TypeScript
- Size: 488 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# data-sanitization
## Overview
This package takes a pattern based approach to matching field names in data and then replacing the associated fields by either masking the field value or removing the field.
Objects are first converted to strings via `JSON.stringify`. This is done to have a consistent interface for text and non-text data.
NOTE: Since `JSON.stringify` might not be performant on large data sets, or when being run repeatedly, `v2` might take a different approach for non-string data.
After the pattern replacement, the new string is either returned or is converted back into an object via `JSON.parse` and then returned.
In any case where the data cannot be parsed, an error object is thrown.
## Table of Contents
- [data-sanitization](#data-sanitization)
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- [Documentation](#documentation)
- [TODO: Version 2](#todo-version-2)
## Documentation
TODO
## TODO: Version 2
Possibly take a different approach to data parsing for version 2.
- take an approach where instead of first converting all data to strings with `JSON.stringify`, instead attempt to convert all data to objects if it isn't already
- use `cloneDeepWith` from `lodash` to copy the object and modify/remove strings within the data