Skip to content

Commit

Permalink
Merge pull request #4 from ozgurg/dev
Browse files Browse the repository at this point in the history
release: v1.1.0
  • Loading branch information
ozgurg authored Jul 2, 2022
2 parents 6e5a570 + 62b9cde commit 56c58f3
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"sourceType": "module"
},
"rules": {
"require-jsdoc": "off",
"quotes": [
"error",
"double"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ padCenter({

All options are required.

| Option | Type |
|-----------|-----------------------------|
| startWith | `string | number` |
| endWith | `string | number` |
| fillWith | `string | number` |
| length | `number` (positive integer) |
| Option | Type |
|-----------|----------------------------------------|
| startWith | <code>string &#124; number</code> |
| endWith | <code>string &#124; number</code> |
| fillWith | <code>string &#124; number</code> |
| length | <code>number</code> (positive integer) |

## License

Expand Down
26 changes: 23 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pad-center",
"version": "1.0.1",
"version": "1.1.0",
"description": "pad-center fills between start and end characters with whatever character you want while keeping the length constant.",
"license": "MIT",
"type": "module",
Expand All @@ -15,26 +15,31 @@
"lint:fix": "npm run lint -- --fix",
"lint": "eslint --ext .js .",
"lint-staged": "lint-staged",
"generate-types": "tsc",
"prepare": "husky install"
},
"author": {
"email": "ozgurgorgulu54@gmail.com",
"name": "Özgür Görgülü",
"url": "https://github.com/ozgurg"
},
"types": "./src/types/pad-center.d.ts",
"keywords": [
"pad-center",
"pad",
"pad-middle",
"string"
"barcode",
"generator",
"masking"
],
"devDependencies": {
"@types/jest": "^28.1.4",
"eslint": "^8.18.0",
"eslint-config-google": "^0.14.0",
"husky": "^8.0.1",
"jest": "^28.1.2",
"lint-staged": "^13.0.3"
"lint-staged": "^13.0.3",
"typescript": "^4.7.4"
},
"lint-staged": {
"*.js": [
Expand Down
10 changes: 10 additions & 0 deletions src/types/pad-center.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @param {{startWith: (string|number), endWith: (string|number), fillWith: (string|number), length: number}} options
* @return {string}
*/
export function padCenter(options: {
startWith: (string | number);
endWith: (string | number);
fillWith: (string | number);
length: number;
}): string;
14 changes: 14 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"include": [
"./src/*js"
],
"exclude": [
"./src/*.test.js"
],
"compilerOptions": {
"outDir": "./src/types",
"declaration": true,
"emitDeclarationOnly": true,
"allowJs": true
}
}

0 comments on commit 56c58f3

Please sign in to comment.