-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ozgurg/dev
release: v1.0.0
- Loading branch information
Showing
12 changed files
with
8,681 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"google" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"indent": [ | ||
"error", | ||
4, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"max-len": [ | ||
"off" | ||
], | ||
"object-curly-spacing": [ | ||
"error", | ||
"always" | ||
], | ||
"comma-dangle": [ | ||
"error", | ||
"never" | ||
], | ||
"arrow-parens": [ | ||
"error", | ||
"as-needed" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,6 @@ dist | |
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# IDE / Editor | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
# pad-center | ||
![Downloads](https://img.shields.io/npm/dm/pad-center) | ||
![Version](https://img.shields.io/github/package-json/v/ozgurg/pad-center) | ||
|
||
# pad-center | ||
|
||
pad-center fills between start and end characters with whatever character you want while keeping the length constant. | ||
|
||
## Install | ||
|
||
```bash | ||
npm install pad-center | ||
``` | ||
|
||
## Usage | ||
|
||
```javascript | ||
import padCenter from "pad-center"; | ||
|
||
padCenter({ | ||
startWith: "053", | ||
endWith: "0", | ||
fillWith: "*", | ||
length: 11 | ||
}); | ||
// Returns: "053*******0" | ||
|
||
padCenter({ | ||
startWith: "O", | ||
endWith: "G", | ||
fillWith: "_", | ||
length: 8 | ||
}); | ||
// Returns: "O______G" | ||
``` | ||
|
||
## API | ||
|
||
### padCenter({ startWith, endWith, fillWith, length }) | ||
|
||
| Option | Is required? | Type | | ||
|-----------|--------------|---------------------| | ||
| startWith | true | `string` `number` | | ||
| endWith | true | `string` `number` | | ||
| fillWith | true | `string` `number` | | ||
| length | true | `integer`(positive) | | ||
|
||
## License | ||
|
||
[![License](https://img.shields.io/github/license/ozgurg/pad-center)](https://github.com/ozgurg/pad-center/blob/main/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { padCenter } from "./src/pad-center.js"; | ||
|
||
export default padCenter; |
Oops, something went wrong.