Initial commit
This commit is contained in:
18
node_modules/strip-final-newline/index.d.ts
generated
vendored
Normal file
18
node_modules/strip-final-newline/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string or Uint8Array.
|
||||
|
||||
@returns The input without any final newline.
|
||||
|
||||
@example
|
||||
```
|
||||
import stripFinalNewline from 'strip-final-newline';
|
||||
|
||||
stripFinalNewline('foo\nbar\n\n');
|
||||
//=> 'foo\nbar\n'
|
||||
|
||||
const uint8Array = new TextEncoder().encode('foo\nbar\n\n')
|
||||
new TextDecoder().decode(stripFinalNewline(uint8Array));
|
||||
//=> 'foo\nbar\n'
|
||||
```
|
||||
*/
|
||||
export default function stripFinalNewline<T extends string | Uint8Array>(input: T): T;
|
||||
Reference in New Issue
Block a user