Skip to content

Commit

Permalink
minor change to exports
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolfoviolac committed Apr 23, 2022
1 parent fd65d50 commit f921e9b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ $ yarn add blur-sensitive-data
## How to use

```typescript
import Obfuscator from 'blur-sensitive-data';
const ob = require('blur-sensitive-data');

const obf = new Obfuscator();
obf.blur("Credit Card Number 4024-0071-4571-8614");
const obf = new ob.Obfuscator().blur("Credit Card Number 4024-0071-4571-8614");

//output: Credit Card Number NOT_VISIBLE_SECURITY_REASON
```
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {stringPatterns} from "./utils/stringsPatterns";
import {EStringPatterns} from "./typings/enums";
const sensitiveFields = require('sensitive-fields');

export default class Obfuscator {
export class Obfuscator {
static readonly EStringLookUpFields = EStringPatterns;
readonly EStringLookUpFields = Obfuscator.EStringLookUpFields;

Expand Down Expand Up @@ -51,3 +51,7 @@ export default class Obfuscator {
return lookUpFields;
}
}

module.exports = {
Obfuscator
}
2 changes: 1 addition & 1 deletion test/module.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Obfuscator from "../dist/cjs";
import {Obfuscator} from "../dist/cjs";
import {TTargetFieldType} from "../src/typings/interfaces";

describe('Testing Obfuscator module and structures', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/object.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Obfuscator from "../dist/cjs";
import {Obfuscator} from "../dist/cjs";

const replacerText = `NOT_VISIBLE`

Expand Down
2 changes: 1 addition & 1 deletion test/string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Obfuscator from "../dist/cjs/index";
import {Obfuscator} from "../dist/cjs/index";
import {EStringPatterns} from "../src/typings/enums";


Expand Down

0 comments on commit f921e9b

Please sign in to comment.