Skip to content

Commit

Permalink
Merge pull request #1129 from Fdawgs/patch-1
Browse files Browse the repository at this point in the history
fix(plugins/dates): validate days and months in `mm/dd` format
  • Loading branch information
spencermountain authored Jul 25, 2024
2 parents 9537bd2 + a15e444 commit 59a93ae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [pull_request]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
permissions:
contents: read

strategy:
matrix:
Expand All @@ -13,13 +15,14 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: package-lock.json

- name: install
run: |
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ on:
jobs:
getCoverage:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: package-lock.json

- run: npm ci
- run: npm i -g c8 codecov
Expand Down
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
"import": "./src/three.js",
"require": "./builds/three/compromise-three.cjs",
"types": "./types/three.d.ts"
},
"./misc": {
"types": "./types/misc.d.ts"
},
"./view/one": {
"types": "./types/view/one.d.ts"
},
"./view/two": {
"types": "./types/view/two.d.ts"
},
"./view/three": {
"types": "./types/view/three.d.ts"
}
},
"typesVersions": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/dates/src/model/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default [
// @4pm
[/^@[1-9]+(am|pm)$/, 'Time', '@5pm'],
// 03/02
[/^[0-9]{2}\/[0-9]{2}$/, 'Date', '03/02'],
[/^(?:0[1-9]|1[0-2])\/(?:0[1-9]|[12]\d|3[01])$/, 'Date', '03/02'],
// iso-time
// [/^[0-9]{4}[:-][0-9]{2}[:-][0-9]{2}T[0-9]/i, 'Time', 'iso-time-tag']

Expand Down

0 comments on commit 59a93ae

Please sign in to comment.