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.2.4 to 1.3.0

test/get-chars.test.js

30

index.js

@@ -47,7 +47,17 @@ /**

/**
* Get strikethrough chars of a string
* Get strikethrough string of a string
* @param {String} str - The string
* @returns {String} The price
*/
function getStrikethroughString(str) {
var arr = getStrikethroughChars(str);
return arr.join('');
}
/**
* Get chars removing strikethrough of a string
* @param {String} str - The string
* @returns {Array} The price
*/
function getRemoveStrikethroughChars(str) {
function getChars(str) {
const strikethroughChars = getStrikethroughChars(str);

@@ -63,4 +73,14 @@ if (strikethroughChars.length > 0) {

/**
* Get strikethrough string of a string
* @param {String} str - The string
* @returns {String} The price
*/
function getString(str) {
var arr = getChars(str);
return arr.join('');
}
/**
* Exports modules
* @type {{removeStrikethroughChars: removeStrikethroughChars, removeStrikethrough: removeStrikethrough, getStrikethroughChars: getStrikethroughChars}}
* @type {{removeStrikethroughChars: removeStrikethroughChars, removeStrikethrough: removeStrikethrough, getChars: getChars}}
*/

@@ -71,4 +91,6 @@ module.exports = {

getStrikethroughChars,
getRemoveStrikethroughChars
getStrikethroughString,
getChars,
getString
};

10

package.json
{
"name": "strikethrough-js",
"version": "1.2.4",
"version": "1.3.0",
"description": "Manipulate strikethrough chars in Javascript",

@@ -25,4 +25,8 @@ "main": "index.js",

"devDependencies": {
"jest": "^23.6.0"
}
"jest": "^23.6.0",
"pre-commit": "^1.2.2"
},
"pre-commit": [
"test"
]
}

@@ -19,10 +19,6 @@ # StrikethroughJS

var lib = require('strikethrough-js');
lib.removeStrikethrough(...);
// or
import {
removeStrikethrough,
removeStrikethroughChars,
getStrikethroughChars,
getRemoveStrikethroughChars
removeStrikethrough
} from 'strikethrough-js';

@@ -52,8 +48,23 @@ ```

### Get remove strikethrough chars
### Get strikethrough string
```javascript
var str = getRemoveStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
var str = getStrikethroughString('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// 1̶2̶3̶7̶8̶9̶€̶
```
### Get chars
```javascript
var str = getChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// ["1", "2", "3", "7", "8", "9", "€"]
```
### Get string
```javascript
var str = getChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// 123789€
```
## Testing

@@ -63,2 +74,2 @@ ```npm

```
Will use [Jest](https://jestjs.io/) test suites.
Will use [Jest](https://jestjs.io/) test suites and [pre-commit](https://pre-commit.com/) hook.
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