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

github-slugid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-slugid - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

index.js

@@ -5,3 +5,3 @@

'$', '%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
'>', '?', '@', '', '', '^', '_', '`', '{', '|', '}', '~', '-',
'>', '?', '@', '', '', '^', '_', '`', '{', '|', '}', '~',
'©', '∑', '®', '†', '“', '”', '‘', '’', '∂', 'ƒ', '™', '℠', '…',

@@ -8,0 +8,0 @@ 'œ', 'Œ','˚', 'º', 'ª', '•', '∆', '∞', '♥', '&', '|'

{
"name": "github-slugid",
"version": "1.0.0",
"version": "1.0.1",
"description": "Slugify like GitHub",

@@ -11,3 +11,3 @@ "main": "index.js",

"scripts": {
"test": "export TESTING=true; mocha --reporter list"
"test": "export TESTING=true; mocha --reporter list --bail"
},

@@ -14,0 +14,0 @@ "repository": {

@@ -22,2 +22,3 @@ # github-slugid

[Examples on GitHub](https://gist.github.com/SamyPesse/b3594cc813f026b3fd42)
[Examples on GitHub](https://gist.github.com/SamyPesse/b3594cc813f026b3fd42)
[Reference](https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/toc_filter.rb)
var slug = require('../');
var should = require('should');
describe('slug', function () {
it('should replace whitespaces', function() {
slug('hello').should.equal('hello');
slug('hello world').should.equal('hello-world');
});
var MATCHES = {
'hello': 'hello',
'hello world': 'hello-world',
'!weird + id/for headings': 'weird--idfor-heading',
'您好': '您好',
'I ♥ you': 'i--you',
'a > b': 'a--b',
'Schöner Titel läßt grüßen!? Bel été !': 'schöner-titel-läßt-grüßen-bel-été-'
}
it('should replace with lowercase', function() {
slug('Hello World').should.equal('hello-world');
});
it('should remove leading separator', function() {
slug('!weird + id/for headings').should.equal('weird--idfor-headings');
});
it('should accept chinese', function() {
slug('您好').should.equal('您好');
});
describe('slug', function () {
for (var value in MATCHES) {
var expected = MATCHES[value];
it('should remove symbols', function() {
slug('I ♥ you').should.equal('i--you');
slug('a > b').should.equal('a--b');
});
it('should handle '+ JSON.stringify(value), function() {
slug(value).should.equal(expected);
});
it('should follow github', function() {
slug('Schöner Titel läßt grüßen!? Bel été !').should.equal('schöner-titel-läßt-grüßen-bel-été-');
})
it('should handle '+ JSON.stringify(expected), function() {
slug(expected).should.equal(expected);
});
}
});
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