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

github-slugger

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-slugger - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

9

index.js

@@ -15,7 +15,9 @@ var emoji = require('emoji-regex')

* @param {string} value String of text to slugify
* @param {boolean} [false] Keep the current case, otherwise make all lowercase
* @return {string} A unique slug string
*/
BananaSlug.prototype.slug = function (value) {
BananaSlug.prototype.slug = function (value, maintainCase) {
maintainCase = maintainCase === true
var self = this
var slug = slugger(value)
var slug = slugger(value, maintainCase)
var occurrences = self.occurrences[slug]

@@ -52,5 +54,4 @@

function slugger (string) {
function slugger (string, maintainCase) {
var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g
var maintainCase = false
var replacement = '-'

@@ -57,0 +58,0 @@

{
"name": "github-slugger",
"description": "Generate a slug just like GitHub does for markdown headings.",
"version": "1.1.3",
"version": "1.2.0",
"author": "Dan Flettre <fletd01@yahoo.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -13,2 +13,4 @@ var test = require('tape')

t.equals('foo', slugger.slug('foo'))
t.equals('fooCamelCase', slugger.slug('fooCamelCase', true))
t.equals('foocamelcase', slugger.slug('fooCamelCase'))

@@ -15,0 +17,0 @@ t.end()

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