redent
Advanced tools
Comparing version 3.0.0 to 4.0.0
@@ -1,7 +0,3 @@ | ||
import {Options as IndentStringOptions} from 'indent-string'; | ||
import {Options} from 'indent-string'; | ||
declare namespace redent { | ||
type Options = IndentStringOptions; | ||
} | ||
/** | ||
@@ -15,3 +11,3 @@ [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string). | ||
``` | ||
import redent = require('redent'); | ||
import redent from 'redent'; | ||
@@ -22,8 +18,8 @@ redent('\n foo\n bar\n', 1); | ||
*/ | ||
declare function redent( | ||
export default function redent( | ||
string: string, | ||
count?: number, | ||
options?: redent.Options | ||
options?: Options | ||
): string; | ||
export = redent; | ||
export {Options}; |
@@ -1,5 +0,6 @@ | ||
'use strict'; | ||
const stripIndent = require('strip-indent'); | ||
const indentString = require('indent-string'); | ||
import stripIndent from 'strip-indent'; | ||
import indentString from 'indent-string'; | ||
module.exports = (string, count = 0, options) => indentString(stripIndent(string), count, options); | ||
export default function redent(string, count = 0, options = {}) { | ||
return indentString(stripIndent(string), count, options); | ||
} |
{ | ||
"name": "redent", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Strip redundant indentation and indent the string", | ||
"license": "MIT", | ||
"repository": "sindresorhus/redent", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=12" | ||
}, | ||
@@ -36,10 +39,10 @@ "scripts": { | ||
"dependencies": { | ||
"indent-string": "^4.0.0", | ||
"strip-indent": "^3.0.0" | ||
"indent-string": "^5.0.0", | ||
"strip-indent": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.39.1" | ||
} | ||
} |
@@ -1,6 +0,5 @@ | ||
# redent [![Build Status](https://travis-ci.org/sindresorhus/redent.svg?branch=master)](https://travis-ci.org/sindresorhus/redent) | ||
# redent | ||
> [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string) | ||
## Install | ||
@@ -12,7 +11,6 @@ | ||
## Usage | ||
```js | ||
const redent = require('redent'); | ||
import redent from 'redent'; | ||
@@ -23,6 +21,5 @@ redent('\n foo\n bar\n', 1); | ||
## API | ||
### redent(string, [count], [options]) | ||
### redent(string, count?, options?) | ||
@@ -37,3 +34,3 @@ #### string | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `0` | ||
@@ -49,3 +46,3 @@ | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: `' '` | ||
@@ -57,3 +54,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -63,5 +60,12 @@ | ||
--- | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-redent?utm_source=npm-redent&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> |
Sorry, the diff of this file is not supported yet
3853
66
Yes
23
+ Addedindent-string@5.0.0(transitive)
+ Addedstrip-indent@4.0.0(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedstrip-indent@3.0.0(transitive)
Updatedindent-string@^5.0.0
Updatedstrip-indent@^4.0.0