Skip to content

Commit f26f7fe

Browse files
committedOct 4, 2019
Meta tweaks
1 parent e77ea17 commit f26f7fe

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed
 

‎fixtures/view-codes.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
'use strict';
2-
const ansiRegex = require('..');
32
const ansiCodes = require('./ansi-codes');
3+
const ansiRegex = require('..');
44

55
const allCodes = {};
66
const supported = [];
77
const unsupported = [];
88

99
function addCodesToTest(codes) {
10-
for (const code of Object.keys(codes)) {
11-
allCodes[code] = codes[code];
10+
for (const [key, value] of Object.entries(codes)) {
11+
allCodes[key] = value;
1212
}
1313
}
1414

1515
function identifySupportedCodes() {
1616
let codeSupport = {};
1717

18-
for (const code of Object.keys(allCodes)) {
18+
for (const [code, value] of Object.keys(allCodes)) {
1919
codeSupport = {
2020
code,
2121
matches: `\u001B${code}`.match(ansiRegex()),
22-
description: allCodes[code][0]
22+
description: value[0]
2323
};
2424

2525
if (codeSupport.matches !== null && codeSupport.matches[0] === `\u001B${code}`) {
@@ -34,15 +34,15 @@ function displaySupport() {
3434
process.stdout.write('\u001B[32m');
3535

3636
console.log('SUPPORTED');
37-
for (const el of supported) {
38-
console.log(el);
37+
for (const element of supported) {
38+
console.log(element);
3939
}
4040

4141
process.stdout.write('\u001B[31m');
4242
console.log('UNSUPPORTED');
4343

44-
for (const el of unsupported) {
45-
console.log(el);
44+
for (const element of unsupported) {
45+
console.log(element);
4646
}
4747

4848
process.stdout.write('\u001B[0m');

‎index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {expectType} from 'tsd';
2-
import ansiRegex from '.';
2+
import ansiRegex = require('.');
33

44
expectType<RegExp>(ansiRegex());
55
expectType<RegExp>(ansiRegex({onlyFirst: true}));

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"pattern"
4949
],
5050
"devDependencies": {
51-
"ava": "^1.4.1",
51+
"ava": "^2.4.0",
5252
"tsd": "^0.9.0",
53-
"xo": "^0.24.0"
53+
"xo": "^0.25.3"
5454
}
5555
}

‎readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ ansiRegex().test('cake');
3434

3535
## API
3636

37-
### ansiRegex([options])
37+
### ansiRegex(options?)
3838

3939
Returns a regex for matching ANSI escape codes.
4040

4141
#### options
4242

43+
Type: `object`
44+
4345
##### onlyFirst
4446

4547
Type: `boolean`<br>

0 commit comments

Comments
 (0)
Please sign in to comment.