Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strikethrough-js

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strikethrough-js - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

test/get-strikethrough-chars.test.js

26

index.js

@@ -18,6 +18,6 @@ /**

*/
module.exports = function removeStrikethroughChars(str) {
function removeStrikethroughChars(str) {
if (str && typeof str === 'string') return str.replace(regexStrikethroughChars, '');
return str
};
}

@@ -29,6 +29,6 @@ /**

*/
module.exports = function removeStrikethrough(str) {
function removeStrikethrough(str) {
if (str && typeof str === 'string') return str.replace(regexStrikethrough, '');
return str
};
}

@@ -40,5 +40,19 @@ /**

*/
module.exports = function getStrikethroughChars(str) {
if (str && typeof str === 'string') return str.match(regexStrikethroughChars);
function getStrikethroughChars(str) {
if (str && typeof str === 'string') {
var result = str.match(regexStrikethroughChars);
return result ? result : [];
}
return []
}
/**
* Exports modules
* @type {{removeStrikethroughChars: removeStrikethroughChars, removeStrikethrough: removeStrikethrough, getStrikethroughChars: getStrikethroughChars}}
*/
module.exports = {
removeStrikethroughChars,
removeStrikethrough,
getStrikethroughChars
};
{
"name": "strikethrough-js",
"version": "1.0.0",
"version": "1.1.0",
"description": "Manipulate strikethrough chars in Javascript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,2 +0,31 @@

# strikethrough-js
# StrikethroughJS
Manipulate strikethrough chars in Javascript
[![npm version](https://badge.fury.io/js/strikethrough-js.svg)](https://badge.fury.io/js/strikethrough-js)
## Install
```npm
npm install @ntltd/strikethrough-js
```
## Usage
### Remove strikethrough
```javascript
var str = removeStrikethrough('1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
// 123789€
```
### Remove strikethrough chars
```javascript
var str = removeStrikethroughChars('456€ 1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
// 456€
```
### Get strikethrough chars
```javascript
var str = getStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// ["1̶", "2̶", "3̶", "7̶", "8̶", "9̶", "€̶"]
```
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