Socket
Socket
Sign inDemoInstall

convert-to-spaces

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-to-spaces - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

index.js
'use strict';
const repeating = require('repeating');
module.exports = (str, spaces) => {
spaces = spaces || 2;
return str.replace(/^\t+/gm, $1 => repeating($1.match(/\t/g).length * spaces));
return str.replace(/^\t+/gm, $1 => ' '.repeat($1.length * (spaces || 2)));
};

5

package.json
{
"name": "convert-to-spaces",
"version": "1.0.0",
"version": "1.0.1",
"description": "Convert tabs to spaces in a string",

@@ -25,5 +25,2 @@ "license": "MIT",

],
"dependencies": {
"repeating": "^3.0.0"
},
"devDependencies": {

@@ -30,0 +27,0 @@ "ava": "^0.16.0",

@@ -42,4 +42,9 @@ # convert-to-spaces [![Build Status](https://travis-ci.org/vdemedes/convert-to-spaces.svg?branch=master)](https://travis-ci.org/vdemedes/convert-to-spaces)

## Related
- [convert-to-tabs](https://github.com/vdemedes/convert-to-tabs) - Convert spaces to tabs.
## License
MIT © [vdemedes](https://github.com/vdemedes)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc