Skip to content

Commit 81cd3cc

Browse files
committedMar 18, 2019
Meta tweaks
1 parent 89dc7f6 commit 81cd3cc

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed
 

‎index.d.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
/**
2-
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
2+
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
3+
4+
@example
5+
```
6+
import stripAnsi from 'strip-ansi';
7+
8+
stripAnsi('\u001B[4mUnicorn\u001B[0m');
9+
//=> 'Unicorn'
10+
11+
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
12+
//=> 'Click'
13+
```
314
*/
4-
export default function stripAnsi(str: string): string;
15+
export default function stripAnsi(string: string): string;

‎index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const ansiRegex = require('ansi-regex');
33

4-
const stripAnsi = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
4+
const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
55

66
module.exports = stripAnsi;
77
module.exports.default = stripAnsi;

‎index.test-d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import {expectType} from 'tsd-check';
22
import stripAnsi from '.';
33

4-
expectType<string>(stripAnsi('\u001b[4mcake\u001b[0m'));
4+
expectType<string>(stripAnsi('\u001B[4mcake\u001B[0m'));

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "strip-ansi",
33
"version": "5.1.0",
4-
"description": "Strip ANSI escape codes",
4+
"description": "Strip ANSI escape codes from a string",
55
"license": "MIT",
66
"repository": "chalk/strip-ansi",
77
"author": {

‎readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
22

3-
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
3+
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
44
55
---
66

0 commit comments

Comments
 (0)
Please sign in to comment.