mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
- definition file - tests https://www.npmjs.com/package/github-slugger https://github.com/Flet/github-slugger#readme Thanks!
27 lines
650 B
TypeScript
27 lines
650 B
TypeScript
import GithubSlugger = require('github-slugger');
|
|
|
|
const slugger = new GithubSlugger();
|
|
const slug = GithubSlugger.slug;
|
|
|
|
slugger.slug('foo'); // $ExpectType string
|
|
// returns 'foo'
|
|
|
|
slugger.slug('foo'); // $ExpectType string
|
|
// returns 'foo-1'
|
|
|
|
slugger.slug('bar'); // $ExpectType string
|
|
// returns 'bar'
|
|
|
|
slugger.slug('foo'); // $ExpectType string
|
|
// returns 'foo-2'
|
|
|
|
slugger.reset(); // $ExpectType void
|
|
|
|
slugger.slug('foo'); // $ExpectType string
|
|
// returns 'foo'
|
|
slug('foo bar baz'); // $ExpectType string
|
|
// returns 'foo-bar-baz'
|
|
|
|
slug('foo bar baz'); // $ExpectType string
|
|
// returns the same slug 'foo-bar-baz' because it does not keep track
|