Socket
Socket
Sign inDemoInstall

laravel-slug

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravel-slug - npm Package Compare versions

Comparing version 2.4.0 to 2.4.1

24

index.js

@@ -149,2 +149,6 @@ /**

// Convert all @ into separator
var ats = RegExp('@', 'ig');
s = s.replace(ats, opt.delimiter);
// Transliterate characters to ASCII

@@ -158,12 +162,15 @@ if (opt.transliterate) {

// Convert all dashes/underscores into separator
var underscores = RegExp('\_', 'ig');
s = s.replace(underscores, opt.delimiter);
// Remove all characters that are not the separator, letters, numbers, or whitespace
// Remove all characters that are not the separator, letters or numbers
var saveOldString = s;
var alnum = RegExp('[^' + opt.delimiter + '\\x20-\\x7E]+', 'u');
var alnum = RegExp('[^' + opt.delimiter + '\\d\\w\\s\\u4e00-\\u9eff]+', 'ig');
s = s.replace(alnum, '');
if (!s.length) s = saveOldString;
// to lowercase
s = s.toLowerCase();
// Convert all dashes/underscores into separator
var underscores = RegExp('\_', 'ig');
s = s.replace(underscores, opt.delimiter);
// Replace all separator characters and whitespace by a single separator

@@ -179,6 +186,3 @@ var spaces = RegExp('[' + opt.delimiter + '\\s]+', 'ig');

// Truncate slug to max characters
s = s.substring(0, opt.limit);
return opt.lowercase ? s.toLowerCase() : s;
return s;
}
{
"name": "laravel-slug",
"version": "2.4.0",
"version": "2.4.1",
"description": "Tries to mimick the slugs produced by Laravel",

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

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