Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 14.x]
node-version: [12.x, 16.x, lts/*]

steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions demo/src/components/demo-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default class DemoForm {
protected $errorContainer: HTMLDivElement;
protected $errorMessage: HTMLPreElement;

// eslint-disable-next-line @typescript-eslint/no-empty-function
// eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
public onSubmit: () => void = () => {};
// eslint-disable-next-line @typescript-eslint/no-empty-function
// eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
public onCancel: () => void = () => {};

private onInputKeydown(event: KeyboardEvent): boolean {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"*.scss"
],
"engines": {
"node": ">=10"
"node": ">=12"
},
"scripts": {
"build": "run-s build:*",
Expand All @@ -44,15 +44,15 @@
"@types/jest": "^27.0.1",
"@types/jest-when": "^2.4.1",
"@types/lodash": "^4.14.140",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.1.0",
"eslint": "^7.22.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint": "^8.4.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.1.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jest": "^25.2.1",
"husky": "7.0.4",
"jest": "^27.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/Expansion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export default class Expansion {
/**
* A single blank string Expansion
*/
// eslint-disable-next-line no-use-before-define
public static Blank: Expansion = new Expansion([''], 1);

/**
* Zero string expansions
*/
// eslint-disable-next-line no-use-before-define
public static Empty: Expansion = new Expansion([], 0);

/**
Expand Down
26 changes: 16 additions & 10 deletions src/pattern.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('count', () => {
});

it.each<[RegExp | string, number]>([
[new RegExp(''), 1],
[new RegExp(''), 1], // eslint-disable-line prefer-regex-literals
[/abc/, 1],
[/\d/, 10],
[/ab?/, 2],
Expand Down Expand Up @@ -1384,20 +1384,18 @@ describe('expand', () => {
'Halfwidth_and_Fullwidth_Forms',
'Specials',
].forEach((unicodeBlock) => {
function testUnicodeBlock(_: string, input: string) {
const result = expandAll(input);
expect(result).toHaveLength(1);
expect(result[0]).toMatch(/^p{/);
}

it.each([
['', `\p{${unicodeBlock}}`],
['', `\p{Is${unicodeBlock}}`],
['', `\p{In${unicodeBlock}}`],
['lowercase', `\p{In${unicodeBlock.toLowerCase()}}`],
])(
`does not recognize RegEx syntax: ${unicodeBlock} Unicode block %s /%s/`,
testUnicodeBlock
(_, input) => {
const result = expandAll(input);
expect(result).toHaveLength(1);
expect(result[0]).toMatch(/^p{/);
}
);

if (unicodeBlock.includes('_')) {
Expand All @@ -1407,7 +1405,11 @@ describe('expand', () => {
['spaces for underscores', `\p{${unicodeBlock.replace('_', ' ')}}`],
])(
`does not recognize RegEx syntax: ${unicodeBlock} Unicode block %s /%s/`,
testUnicodeBlock
(_, input) => {
const result = expandAll(input);
expect(result).toHaveLength(1);
expect(result[0]).toMatch(/^p{/);
}
);
}

Expand All @@ -1418,7 +1420,11 @@ describe('expand', () => {
['spaces for hyphens', `\p{${unicodeBlock.replace('-', ' ')}}`],
])(
`does not recognize RegEx syntax: ${unicodeBlock} Unicode block %s /%s/`,
testUnicodeBlock
(_, input) => {
const result = expandAll(input);
expect(result).toHaveLength(1);
expect(result[0]).toMatch(/^p{/);
}
);
}
});
Expand Down