Skip to content

Commit

Permalink
fix: removed code and hash
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jan 13, 2023
1 parent 2217ab9 commit 940b8f4
Show file tree
Hide file tree
Showing 22 changed files with 110 additions and 7,784 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.*.js
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto
* text=auto eol=lf
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
- push
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 14
- 16
- 18
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@
node_modules
coverage
.nyc_output
locales/
package-lock.json
yarn.lock

Thumbs.db
tmp/
temp/
*.lcov
.env
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged && npm test
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.md': (filenames) => filenames.map((filename) => `remark ${filename} -qfo`),
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
trailingComma: 'none'
};
1 change: 0 additions & 1 deletion .remarkignore

This file was deleted.

3 changes: 3 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['preset-github']
};
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .xo-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
prettier: true,
space: true,
extends: ['xo-lass']
};
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# sensitive-fields

[![build status](https://img.shields.io/travis/com/cabinjs/sensitive-fields.svg)](https://travis-ci.com/cabinjs/sensitive-fields)
[![code coverage](https://img.shields.io/codecov/c/github/cabinjs/sensitive-fields.svg)](https://codecov.io/gh/cabinjs/sensitive-fields)
[![build status](https://github.com/cabinjs/sensitive-fields/actions/workflows/ci.yml/badge.svg)](https://github.com/cabinjs/sensitive-fields/actions/workflows/ci.yml)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
Expand All @@ -28,12 +27,6 @@
npm install sensitive-fields
```

[yarn][]:

```sh
yarn add sensitive-fields
```


## Usage

Expand Down Expand Up @@ -61,8 +54,6 @@ See [index.json](index.json).
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)


##
##

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/
33 changes: 17 additions & 16 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
const path = require('path');
const fs = require('fs');
const path = require('node:path');
const fs = require('node:fs');
const _ = require('lodash');
const s = require('underscore.string');

const list = require('./sensitive-fields');

// and we also want to add a prefixed AND affixed `_field` and `_input`
list.forEach(key => {
['field', 'input'].forEach(str => {
list.push(`${str}_${key}`);
list.push(`${key}_${str}`);
});
});
const arr = [...list];
for (const key of arr) {
for (const str of ['field', 'input']) {
list.push(`${str}_${key}`, `${key}_${str}`);
}
}

const fields = _.uniq(
_.reduce(
list,
(memo, str) => {
const arr = [];
arr.push(s.titleize(str));
arr.push(s.camelize(str));
arr.push(s.camelize(str).toLowerCase());
arr.push(s.camelize(str).toUpperCase());
arr.push(s.underscored(str));
arr.push(s.humanize(str));
return memo.concat(arr);
memo.push(
s.titleize(str),
s.camelize(str),
s.camelize(str).toLowerCase(),
s.camelize(str).toUpperCase(),
s.underscored(str),
s.humanize(str)
);
return memo;
},
[]
)
Expand Down
1 change: 0 additions & 1 deletion index.js

This file was deleted.

54 changes: 0 additions & 54 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@
"Cvv",
"cvv",
"CVV",
"Hash",
"hash",
"HASH",
"Mysql_pwd",
"mysqlPwd",
"mysqlpwd",
Expand Down Expand Up @@ -300,9 +297,6 @@
"Pin",
"pin",
"PIN",
"Code",
"code",
"CODE",
"Otp",
"otp",
"OTP",
Expand Down Expand Up @@ -1224,30 +1218,6 @@
"CVVINPUT",
"cvv_input",
"Cvv input",
"Field_hash",
"fieldHash",
"fieldhash",
"FIELDHASH",
"field_hash",
"Field hash",
"Hash_field",
"hashField",
"hashfield",
"HASHFIELD",
"hash_field",
"Hash field",
"Input_hash",
"inputHash",
"inputhash",
"INPUTHASH",
"input_hash",
"Input hash",
"Hash_input",
"hashInput",
"hashinput",
"HASHINPUT",
"hash_input",
"Hash input",
"Field_mysql_pwd",
"fieldMysqlPwd",
"fieldmysqlpwd",
Expand Down Expand Up @@ -1824,30 +1794,6 @@
"PININPUT",
"pin_input",
"Pin input",
"Field_code",
"fieldCode",
"fieldcode",
"FIELDCODE",
"field_code",
"Field code",
"Code_field",
"codeField",
"codefield",
"CODEFIELD",
"code_field",
"Code field",
"Input_code",
"inputCode",
"inputcode",
"INPUTCODE",
"input_code",
"Input code",
"Code_input",
"codeInput",
"codeinput",
"CODEINPUT",
"code_input",
"Code input",
"Field_otp",
"fieldOtp",
"fieldotp",
Expand Down
96 changes: 23 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,35 @@
"description": "List of sensitive fields that should be masked, obfuscated, or purged for security purposes",
"version": "0.0.9",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"ava": {
"failFast": true,
"verbose": true
},
"bugs": {
"url": "https://github.com/cabinjs/sensitive-fields/issues",
"email": "niftylettuce@gmail.com"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"contributors": [
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
],
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"ava": "latest",
"codecov": "latest",
"cross-env": "latest",
"eslint": "latest",
"eslint-config-prettier": "latest",
"eslint-config-xo-lass": "latest",
"eslint-plugin-prettier": "latest",
"fixpack": "3.0.6",
"husky": "latest",
"lint-staged": "latest",
"lodash": "^4.17.15",
"nyc": "latest",
"prettier": "latest",
"remark-cli": "latest",
"remark-preset-github": "latest",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"ava": "^5.1.0",
"cross-env": "^7.0.3",
"eslint": "^8.31.0",
"eslint-config-xo-lass": "^2.0.1",
"fixpack": "^4.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.0",
"lodash": "^4.17.21",
"nyc": "^15.1.0",
"parse-err": "^0.0.12",
"remark-cli": "^11.0.0",
"remark-preset-github": "^4.0.4",
"underscore.string": "^3.3.5",
"xo": "latest"
"xo": "0.53"
},
"files": [
"index.json"
],
"homepage": "https://github.com/cabinjs/sensitive-fields",
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"keywords": [
"bugsnag",
"cabin",
Expand Down Expand Up @@ -75,51 +59,17 @@
"winston"
],
"license": "MIT",
"lint-staged": {
"linters": {
"*.js": [
"xo --fix",
"git add"
],
"*.md": [
"remark . -qfo",
"git add"
],
"package.json": [
"fixpack",
"git add"
]
}
},
"main": "index.json",
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
},
"remarkConfig": {
"plugins": [
"preset-github"
]
},
"repository": {
"type": "git",
"url": "https://github.com/cabinjs/sensitive-fields"
},
"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"build": "node build",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo",
"nyc": "cross-env NODE_ENV=test nyc ava",
"test": "npm run lint && npm run build && npm run ava",
"test-coverage": "npm run lint && npm run build && npm run nyc"
},
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
"lint": "xo --fix && remark . -qfo && fixpack",
"prepare": "husky install",
"pretest": "npm run lint && npm run build",
"test": "npm run test-coverage",
"test-coverage": "cross-env NODE_ENV=test nyc ava"
}
}
Loading

0 comments on commit 940b8f4

Please sign in to comment.