New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

larvitslugify

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitslugify - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

11

index.js

@@ -31,2 +31,13 @@ 'use strict';

// Shorthand for saving characters
if (options.save) {
if ( ! Array.isArray(options.save)) {
options.save = [options.save];
}
for (let i = 0; options.save[i] !== undefined; i ++) {
charmap[options.save[i]] = options.save[i];
}
}
// Set whitespace characters that is no in the charmap

@@ -33,0 +44,0 @@ // We do this since we'd like to handle explicit whitecharacters separately

2

package.json
{
"name": "larvitslugify",
"description": "Slugify string to make them url safe and more",
"version": "0.11.1",
"version": "0.11.2",
"homepage": "https://github.com/larvit/larvitslugify",

@@ -6,0 +6,0 @@ "author": "Lilleman <lilleman@larvit.se>",

@@ -51,2 +51,3 @@ [![Build Status](https://travis-ci.org/larvit/larvitslugify.svg?branch=master)](https://travis-ci.org/larvit/larvitslugify)

'whitespaces': = [' ', '\t', '\xa0'] // A list of characters identified as whitespaces
'save': = undefined // Adds a character to the charmap to "save" from being changed or removed. Takes a string of one character or an array of single caracter strings

@@ -53,0 +54,0 @@ //'wordLimit': 5 // Limits the amount of words to this number (Currently not supported)

@@ -383,2 +383,18 @@ 'use strict';

it('should save some character method 2', function (done) {
const text = 'It\'s Your Jöurney We Guide You Through!',
expected = 'Its-Your-Jöurney-We-Guide-You-Through';
assert.strictEqual(slug(text, {'save': 'ö'}), expected);
done();
});
it('should save some character method 2 multiple characters', function (done) {
const text = 'It\'s Your Jöurney We Guide You Through!',
expected = 'Its-Your-Jöurney-We-Guide-You-Through!';
assert.strictEqual(slug(text, {'save': ['ö', '!']}), expected);
done();
});
it('should save the dot character', function (done) {

@@ -385,0 +401,0 @@ const text = 'It\'s Your Jöurney We Guide You Through.',

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