Skip to content

Commit bf5d4e8

Browse files
committed
pretty project
1 parent dc69974 commit bf5d4e8

7 files changed

Lines changed: 26 additions & 18 deletions

File tree

.github/workflows/develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: ubuntu-18.04
1111
steps:
1212
- uses: actions/checkout@v1
13-
13+
1414
- name: install dependencies
1515
run: npm install
16-
16+
1717
- name: Test
1818
run: npm run test

.github/workflows/prtitle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
steps:
1313
- uses: amannn/action-semantic-pull-request@v1.1.1
1414
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v2
@@ -21,4 +21,4 @@ jobs:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
- run: npm publish --access public
2323
env:
24-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
24+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.releaserc.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"branches": [
3-
"main"
4-
],
2+
"branches": ["main"],
53
"plugins": [
64
[
75
"@semantic-release/commit-analyzer",
@@ -21,9 +19,12 @@
2119
}
2220
}
2321
],
24-
["@semantic-release/npm", {
25-
"npmPublish": false
26-
}],
22+
[
23+
"@semantic-release/npm",
24+
{
25+
"npmPublish": false
26+
}
27+
],
2728
"@semantic-release/github",
2829
[
2930
"@semantic-release/git",
@@ -33,4 +34,4 @@
3334
}
3435
]
3536
]
36-
}
37+
}

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ const dateParser = (pattern, string) => {
5252
/(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) ([0-9]{1,2})/.exec(
5353
string
5454
);
55-
const monthMatch = string.match(/(\d+)? (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/g);
55+
const monthMatch = string.match(
56+
/(\d+)? (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/g
57+
);
5658
const months = [
5759
'',
5860
'jan',
@@ -73,9 +75,9 @@ const dateParser = (pattern, string) => {
7375
pattern[3] = full[2];
7476
pattern[4] = months.indexOf(full[1]);
7577
} else if (monthMatch) {
76-
const mon = monthMatch.map((i) =>
77-
months.indexOf(i.trim())
78-
).sort((a, b) => a - b);
78+
const mon = monthMatch
79+
.map((i) => months.indexOf(i.trim()))
80+
.sort((a, b) => a - b);
7981
if (mon.length) {
8082
pattern[4] = mon.join(',');
8183
}

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can also write the full words like `on saturday at 9:30`
4848
Examples:
4949

5050
```
51-
on mon tue wed every 15 minutes
51+
on mon tue wed every 15 minutes
5252
in december on mondays and saturdays at 9:30
5353
on mondays at 10:30
5454
```
@@ -58,6 +58,7 @@ on mondays at 10:30
5858
You can either use exact dates like `in dec 9 at 9:30` or only months `in dec at 9:30`
5959
You can also write the full words like `in december at 9:30`
6060
Multiple Months are supported
61+
6162
### Tokens
6263

6364
`jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec`
@@ -68,6 +69,7 @@ Examples:
6869
on jan feb mar only mondays tuesdays and saturdays at 9:30
6970
on dec mar apr at 13:37
7071
```
72+
7173
## Times:
7274

7375
Times will get sanitized and seconds are optional, to use times the token _at_ is needed. Timeformat is 24 hours and not AM/PM.

test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ test('at 9:10 every year on saturdays', '0 10 9 1 1 *');
4040
test('every fri mon wed in oct at 10:30', '0 30 10 * 10 1,3,5');
4141
test('very mondays in december all 15 minutes', '0 */15 * * 12 1');
4242
test('on jan feb mar at 9:30', '0 30 9 * 1,2,3 *');
43-
test('on jan feb mar only mondays tuesdays and saturdays at 9:30', '0 30 9 * 1,2,3 1,2,6');
43+
test(
44+
'on jan feb mar only mondays tuesdays and saturdays at 9:30',
45+
'0 30 9 * 1,2,3 1,2,6'
46+
);
4447
test('on jan feb every 45 minutes', '0 */45 * * 1,2 *');
4548

4649
if (process.env.TESTWATCH) {

0 commit comments

Comments
 (0)