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

@sindresorhus/slugify

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

@sindresorhus/slugify - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

6

index.js

@@ -7,4 +7,4 @@ 'use strict';

return string
.replace(/([a-z\d])([A-Z])/g, `$1 $2`)
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1 $2`);
.replace(/([a-z\d])([A-Z])/g, '$1 $2')
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1 $2');
};

@@ -20,3 +20,3 @@

for (const [key, value] of replacements) {
string = string.replace(new RegExp(escapeStringRegexp(key), 'g'), ` ${value} `);
string = string.replace(new RegExp(escapeStringRegexp(key), 'g'), value.length > 0 ? ` ${value} ` : value);
}

@@ -23,0 +23,0 @@

{
"name": "@sindresorhus/slugify",
"version": "0.3.0",
"version": "0.4.0",
"description": "Slugify a string",

@@ -5,0 +5,0 @@ "license": "MIT",

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