pax_global_header00006660000000000000000000000064127405435320014517gustar00rootroot0000000000000052 comment=90d90c6fe45eb7d5fa317c50af03ebac1b7b281f redent-2.0.0/000077500000000000000000000000001274054353200127775ustar00rootroot00000000000000redent-2.0.0/.editorconfig000066400000000000000000000002761274054353200154610ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 redent-2.0.0/.gitattributes000066400000000000000000000000141274054353200156650ustar00rootroot00000000000000* text=auto redent-2.0.0/.gitignore000066400000000000000000000000151274054353200147630ustar00rootroot00000000000000node_modules redent-2.0.0/.travis.yml000066400000000000000000000000531274054353200151060ustar00rootroot00000000000000language: node_js node_js: - '6' - '4' redent-2.0.0/index.js000066400000000000000000000003101274054353200144360ustar00rootroot00000000000000'use strict'; const stripIndent = require('strip-indent'); const indentString = require('indent-string'); module.exports = (str, count, indent) => indentString(stripIndent(str), count || 0, indent); redent-2.0.0/license000066400000000000000000000021371274054353200143470ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. redent-2.0.0/package.json000066400000000000000000000014071274054353200152670ustar00rootroot00000000000000{ "name": "redent", "version": "2.0.0", "description": "Strip redundant indentation and indent the string", "license": "MIT", "repository": "sindresorhus/redent", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "string", "str", "strip", "trim", "indent", "indentation", "add", "reindent", "normalize", "remove", "whitespace", "space" ], "dependencies": { "indent-string": "^3.0.0", "strip-indent": "^2.0.0" }, "devDependencies": { "ava": "*", "xo": "*" }, "xo": { "esnext": true } } redent-2.0.0/readme.md000066400000000000000000000013571274054353200145640ustar00rootroot00000000000000# redent [![Build Status](https://travis-ci.org/sindresorhus/redent.svg?branch=master)](https://travis-ci.org/sindresorhus/redent) > [Strip redundant indentation](https://github.com/sindresorhus/strip-indent) and [indent the string](https://github.com/sindresorhus/indent-string) ## Install ``` $ npm install --save redent ``` ## Usage ```js const redent = require('redent'); redent('\n foo\n bar\n', 1); //=> '\n foo\n bar\n' ``` ## API ### redent(input, [count], [indent]) #### input Type: `string` #### count Type: `number`
Default: `0` How many times you want `indent` repeated. #### indent Type: `string`
Default: `' '` String to use for the indent. ## License MIT © [Sindre Sorhus](https://sindresorhus.com) redent-2.0.0/test.js000066400000000000000000000002641274054353200143160ustar00rootroot00000000000000import test from 'ava'; import m from './'; test(t => { t.is(m('\n foo\n bar\n', 1), '\n foo\n bar\n'); t.is(m('\n foo\n bar\n', 5, '-'), '\n-----foo\n----- bar\n'); });