id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abe33/atom-pigments:lib/renderers/region-renderer.coffee:2:raw_corpus | raw_corpus | class RegionRenderer
includeTextInRegion: false
renderRegions: (colorMarker) ->
range = colorMarker.getScreenRange()
return [] if range.isEmpty()
rowSpan = range.end.row - range.start.row
regions = []
displayBuffer = colorMarker.marker.displayBuffer
if rowSpan is 0
regions.push @cr... | CoffeeScript | abe33/atom-pigments | lib/renderers/region-renderer.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/renderers/region-renderer.coffee | 2 | 51 | ||
abe33/atom-pigments:lib/renderers/region-renderer.coffee:2:completion | completion | class RegionRenderer
includeTextInRegion: false
renderRegions: (colorMarker) ->
range = colorMarker.getScreenRange()
return [] if range.isEmpty()
rowSpan = range.end.row - range.start.row
regions = []
displayBuffer = colorMarker.marker.displayBuffer
if rowSpan is 0
regions.push @cr... | for row in [range.start.row + 1...range.end.row]
regions.push @createRegion(
{row, column: 0},
{row, column: Infinity},
colorMarker,
displayBuffer.screenLines[row]
)
regions.push @createRegion(
{row: range.end.row, column: 0},
ra... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/renderers/region-renderer.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/renderers/region-renderer.coffee | 2 | 51 |
abe33/atom-pigments:lib/renderers/region-renderer.coffee:3:raw_corpus | raw_corpus | }
clippedEnd = {
row: end.row
column: screenLine?.clipScreenColumn(end.column) ? end.column
}
bufferRange = displayBuffer.bufferRangeForScreenRange({
start: clippedStart
end: clippedEnd
})
needAdjustment = screenLine?.isSoftWrapped() and end.column >= screenLine?.text.lengt... | CoffeeScript | abe33/atom-pigments | lib/renderers/region-renderer.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/renderers/region-renderer.coffee | 52 | 88 | ||
abe33/atom-pigments:lib/renderers/region-renderer.coffee:3:completion | completion | }
clippedEnd = {
row: end.row
column: screenLine?.clipScreenColumn(end.column) ? end.column
}
bufferRange = displayBuffer.bufferRangeForScreenRange({
start: clippedStart
end: clippedEnd
})
needAdjustment = screenLine?.isSoftWrapped() and end.column >= screenLine?.text.lengt... | text = displayBuffer.buffer.getTextInRange(bufferRange)
css = {}
css.left = startPosition.left
css.top = startPosition.top
css.width = endPosition.left - startPosition.left
css.width += charWidth if needAdjustment
css.height = lineHeight
region = document.createElement('div')
region.cl... | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/renderers/region-renderer.coffee | MIT | 6b9b5368e8a617bbb73ccdb1da96350aba9fd444 | 518 | https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/renderers/region-renderer.coffee | 52 | 88 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 1 | 39 | ||
dodo/node-slug:test/slug.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.e... | var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', function() {
[slug('foo bar baz')].should.eql(['foo-ba... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', fun... | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | it 'should leave allowed chars', ->
allowed = ['.', '_', '~']
for a in allowed
[slug "foo #{a} bar baz"].should.eql ["foo-#{a}-bar-baz"]
it 'should replace latin chars', ->
char_map = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:2:raw_corpus | raw_corpus | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 41 | 81 | ||
dodo/node-slug:test/slug.test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t',... | it('should replace greek chars', function() {
var char, char_map, replacement, results;
char_map = {
'α': 'a',
'β': 'b',
'γ': 'g',
'δ': 'd',
'ε': 'e',
'ζ': 'z',
'η': 'h',
'θ': '8',
'ι': 'i',
'κ': 'k',
'λ': 'l',
'μ': 'm',
'ν': 'n',
'ξ': '3',
'ο': 'o',
'... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace greek chars', function() {
var char, char_map, replacement, results;
char_map = {
'α': 'a',
'β': 'b',
'γ': 'g',
'δ': 'd',
'ε': 'e',
'ζ': 'z',
'η': 'h',
'θ': '8',
'ι': 'i',
'κ': 'k',
'λ': 'l',
'μ... | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:2:completion | completion | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | }
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz".toLowerCase()]
it 'should replace cyrillic chars', ->
char_map = {
'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh',
'з':'z', 'и':'i'... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:3:raw_corpus | raw_corpus | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 83 | 122 | ||
dodo/node-slug:test/slug.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
... | it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě': 'E',
'Ň': 'N',
'Ř': 'R',
'Š': 'S',
'... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě... | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:completion | completion | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'I',
'Ķ':'K', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'U', 'Ž':'Z'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 124 | 162 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infini... | it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': 'c',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': 'r',
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...',
'˚': 'o',
'º': 'o',
'ª': 'a',
'∆': 'delta',
'∞': 'i... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 124 | 162 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': 'c',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': 'r',
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...',
'˚': 'o',
... | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 124 | 162 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | char_map = {
'☢':"radioactive",'☠':"skull-and-bones",'☤':"caduceus",
'☣':"biohazard",'☭':"hammer-and-sickle", '☯':"yin-yang",'☮':"peace",
'☏':"telephone",'☔':"umbrella-with-rain-drops",'☎':"telephone",
'☀':"sun-with-rays",'★':"star",'☂':"umbrella",'☃':"snowman",
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 124 | 162 |
dodo/node-slug:test/slug.test.coffee:5:raw_corpus | raw_corpus | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzaceeisuuz'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
text = "It's your journey ... we... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 164 | 183 | ||
dodo/node-slug:test/slug.test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzaceeisuuz'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be ... | it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzaceeisuuz');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bones']);
});
it('should be flavourable', function() {
v... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 164 | 183 |
dodo/node-slug:test/slug.test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzaceeisuuz');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bone... | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzaceeisuuz'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
text = "It's your journey ... we... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 164 | 183 |
dodo/node-slug:test/slug.test.coffee:5:completion | completion | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzaceeisuuz'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
text = "It's your journey ... we... | it 'should default to lowercase', ->
text = "It's Your Journey We Guide You Through."
expected = "its-your-journey-we-guide-you-through"
[slug(text)].should.eql [expected]
it 'should allow disabling of lowercase', ->
text = "It's Your Journey We Guide You Through."
expected = "Its-You... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 3fce2fa8852fc493c81515c284e0659715196357 | 1,072 | https://github.com/dodo/node-slug/blob/3fce2fa8852fc493c81515c284e0659715196357/test/slug.test.coffee | 164 | 183 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 1 | 39 | ||
dodo/node-slug:test/slug.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.e... | var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', function() {
[slug('foo bar baz')].should.eql(['foo-ba... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', fun... | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | it 'should leave allowed chars', ->
allowed = ['.', '_', '~']
for a in allowed
[slug "foo #{a} bar baz"].should.eql ["foo-#{a}-bar-baz"]
it 'should replace latin chars', ->
char_map = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:2:raw_corpus | raw_corpus | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 41 | 81 | ||
dodo/node-slug:test/slug.test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t',... | it('should replace greek chars', function() {
var char, char_map, replacement, results;
char_map = {
'α': 'a',
'β': 'b',
'γ': 'g',
'δ': 'd',
'ε': 'e',
'ζ': 'z',
'η': 'h',
'θ': '8',
'ι': 'i',
'κ': 'k',
'λ': 'l',
'μ': 'm',
'ν': 'n',
'ξ': '3',
'ο': 'o',
'... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace greek chars', function() {
var char, char_map, replacement, results;
char_map = {
'α': 'a',
'β': 'b',
'γ': 'g',
'δ': 'd',
'ε': 'e',
'ζ': 'z',
'η': 'h',
'θ': '8',
'ι': 'i',
'κ': 'k',
'λ': 'l',
'μ... | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:2:completion | completion | it 'should replace greek chars', ->
char_map = {
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
... | }
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace cyrillic chars', ->
char_map = {
'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh',
'з':'z', 'и':'i', 'й':'j', 'к'... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 41 | 81 |
dodo/node-slug:test/slug.test.coffee:3:raw_corpus | raw_corpus | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 83 | 122 | ||
dodo/node-slug:test/slug.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
... | it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě': 'E',
'Ň': 'N',
'Ř': 'R',
'Š': 'S',
'... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě... | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:completion | completion | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'I',
'Ķ':'K', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'U', 'Ž':'Z'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 124 | 166 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infini... | it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': 'c',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': 'r',
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...',
'˚': 'o',
'º': 'o',
'ª': 'a',
'∆': 'delta',
'∞': 'i... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 124 | 166 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': 'c',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': 'r',
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...',
'˚': 'o',
... | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 124 | 166 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace symbols', ->
char_map = {
'©':'c', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': 'r',
'∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a'
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
'<':... | '☣':"biohazard",'☭':"hammer-and-sickle", '☯':"yin-yang",'☮':"peace",
'☏':"telephone",'☔':"umbrella-with-rain-drops",'☎':"telephone",
'☀':"sun-with-rays",'★':"star",'☂':"umbrella",'☃':"snowman",
'✈':"airplane",'✉':"envelope",'✊':"raised-fist"
}
for char, replacement of... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 124 | 166 |
dodo/node-slug:test/slug.test.coffee:5:raw_corpus | raw_corpus | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
text = "It's your journey ... we... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 168 | 177 | ||
dodo/node-slug:test/slug.test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be ... | it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bones']);
});
it('should be flavourable', function() {
v... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 168 | 177 |
dodo/node-slug:test/slug.test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bone... | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
text = "It's your journey ... we... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 168 | 177 |
dodo/node-slug:test/slug.test.coffee:5:completion | completion | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones'] | it 'should be flavourable', ->
text = "It's your journey ... we guide you through."
expected = "Its-your-journey-we-guide-you-through"
[slug(text, mode:'pretty')].should.eql [expected] | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | fa44ca0ce742abb34c2c5c4fb83299665d48411c | 1,072 | https://github.com/dodo/node-slug/blob/fa44ca0ce742abb34c2c5c4fb83299665d48411c/test/slug.test.coffee | 168 | 177 |
dodo/node-slug:test/slug.test.coffee:5:raw_corpus | raw_corpus | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
remove = /[.'"]/g
text =... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8 | 1,072 | https://github.com/dodo/node-slug/blob/cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8/test/slug.test.coffee | 168 | 178 | ||
dodo/node-slug:test/slug.test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be ... | it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bones']);
});
it('should be flavourable', function() {
v... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8 | 1,072 | https://github.com/dodo/node-slug/blob/cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8/test/slug.test.coffee | 168 | 178 |
dodo/node-slug:test/slug.test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bone... | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
it 'should be flavourable', ->
remove = /[.'"]/g
text =... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8 | 1,072 | https://github.com/dodo/node-slug/blob/cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8/test/slug.test.coffee | 168 | 178 |
dodo/node-slug:test/slug.test.coffee:5:completion | completion | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones'] | it 'should be flavourable', ->
remove = /[.'"]/g
text = "It's your journey ... we guide you through."
expected = "Its-your-journey-we-guide-you-through"
[slug(text, {remove})].should.eql [expected] | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8 | 1,072 | https://github.com/dodo/node-slug/blob/cbfa8f67caa1dfff4ed02c1bf3fef4ee6503f3f8/test/slug.test.coffee | 168 | 178 |
dodo/node-slug:test/slug.test.coffee:5:raw_corpus | raw_corpus | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones'] | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9c706c5534e425a280d5a4cf1547cba3c8832301 | 1,072 | https://github.com/dodo/node-slug/blob/9c706c5534e425a280d5a4cf1547cba3c8832301/test/slug.test.coffee | 168 | 172 | ||
dodo/node-slug:test/slug.test.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones']
``` | it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bones']);
}); | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 9c706c5534e425a280d5a4cf1547cba3c8832301 | 1,072 | https://github.com/dodo/node-slug/blob/9c706c5534e425a280d5a4cf1547cba3c8832301/test/slug.test.coffee | 168 | 172 |
dodo/node-slug:test/slug.test.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace lithuanian characters', function() {
return slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql('aceeisuuzACEEISUUZ');
});
it('should replace multichars', function() {
return [slug("w/ <3 && sugar || ☠")].should.eql(['with-love-and-sugar-or-skull-and-bone... | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ'
it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones'] | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9c706c5534e425a280d5a4cf1547cba3c8832301 | 1,072 | https://github.com/dodo/node-slug/blob/9c706c5534e425a280d5a4cf1547cba3c8832301/test/slug.test.coffee | 168 | 172 |
dodo/node-slug:test/slug.test.coffee:5:completion | completion | it 'should replace lithuanian characters', ->
slug('ąčęėįšųūžĄČĘĖĮŠŲŪŽ').should.eql 'aceeisuuzACEEISUUZ' | it 'should replace multichars', ->
[slug "w/ <3 && sugar || ☠"].should.eql ['with-love-and-sugar-or-skull-and-bones'] | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9c706c5534e425a280d5a4cf1547cba3c8832301 | 1,072 | https://github.com/dodo/node-slug/blob/9c706c5534e425a280d5a4cf1547cba3c8832301/test/slug.test.coffee | 168 | 172 |
dodo/node-slug:test/slug.test.coffee:3:raw_corpus | raw_corpus | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9b6834eb648f18fb2dcecc4933ef3bb2e26b5093 | 1,072 | https://github.com/dodo/node-slug/blob/9b6834eb648f18fb2dcecc4933ef3bb2e26b5093/test/slug.test.coffee | 83 | 122 | ||
dodo/node-slug:test/slug.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
... | it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě': 'E',
'Ň': 'N',
'Ř': 'R',
'Š': 'S',
'... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 9b6834eb648f18fb2dcecc4933ef3bb2e26b5093 | 1,072 | https://github.com/dodo/node-slug/blob/9b6834eb648f18fb2dcecc4933ef3bb2e26b5093/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace czech chars', function() {
var char, char_map, replacement, results;
char_map = {
'č': 'c',
'ď': 'd',
'ě': 'e',
'ň': 'n',
'ř': 'r',
'š': 's',
'ť': 't',
'ů': 'u',
'ž': 'z',
'Č': 'C',
'Ď': 'D',
'Ě... | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9b6834eb648f18fb2dcecc4933ef3bb2e26b5093 | 1,072 | https://github.com/dodo/node-slug/blob/9b6834eb648f18fb2dcecc4933ef3bb2e26b5093/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:3:completion | completion | it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
'Ů':'U', 'Ž':'Z'
}
for char, replacement of char_map
... | 'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 9b6834eb648f18fb2dcecc4933ef3bb2e26b5093 | 1,072 | https://github.com/dodo/node-slug/blob/9b6834eb648f18fb2dcecc4933ef3bb2e26b5093/test/slug.test.coffee | 83 | 122 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 1 | 39 | ||
dodo/node-slug:test/slug.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.e... | var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', function() {
[slug('foo bar baz')].should.eql(['foo-ba... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var slug;
slug = require('../slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', fun... | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].shou... | it 'should leave allowed chars', ->
allowed = ['*', '+', '~', '.', '(', ')', "'", '"', '!', ':', '@']
for a in allowed
[slug "foo #{a} bar baz"].should.eql ["foo-#{a}-bar-baz"]
it 'should replace latin chars', ->
char_map = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', '... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 124 | 159 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º'... | it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': '(c)',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': '(r)',
'†': '+',
'“': '"',
'”': '"',
'‘': "'",
'’': "'",
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 124 | 159 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': '(c)',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': '(r)',
'†': '+',
'“': '"',
'”': '"',
'‘': "'",
'’': "'",
'∂': 'd',
... | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 124 | 159 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | }
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace no unicode when disabled', ->
char_map = '😹☢☠☤☣☭☯☮☏☔☎☀★☂☃✈✉✊'.split ''
for char in char_map
[slug "foo #{char} bar baz", symbols:no].should.... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | a05d00ccb0e107166c4298b1b35c83918e1a94af | 1,072 | https://github.com/dodo/node-slug/blob/a05d00ccb0e107166c4298b1b35c83918e1a94af/test/slug.test.coffee | 124 | 159 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b95cf1f9135e90ffa50da8b8db684ad73794cf04 | 1,072 | https://github.com/dodo/node-slug/blob/b95cf1f9135e90ffa50da8b8db684ad73794cf04/test/slug.test.coffee | 124 | 143 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º'... | it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': '(c)',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': '(r)',
'†': '+',
'“': '"',
'”': '"',
'‘': "'",
'’': "'",
'∂': 'd',
'ƒ': 'f',
'™': 'tm',
'℠': 'sm',
'…': '...... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | b95cf1f9135e90ffa50da8b8db684ad73794cf04 | 1,072 | https://github.com/dodo/node-slug/blob/b95cf1f9135e90ffa50da8b8db684ad73794cf04/test/slug.test.coffee | 124 | 143 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace symbols', function() {
var char, char_map, replacement, results;
char_map = {
'©': '(c)',
'œ': 'oe',
'Œ': 'OE',
'∑': 'sum',
'®': '(r)',
'†': '+',
'“': '"',
'”': '"',
'‘': "'",
'’': "'",
'∂': 'd',
... | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b95cf1f9135e90ffa50da8b8db684ad73794cf04 | 1,072 | https://github.com/dodo/node-slug/blob/b95cf1f9135e90ffa50da8b8db684ad73794cf04/test/slug.test.coffee | 124 | 143 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
'∆': 'delta', '∞':... | it 'should allow forcing lowercase slugs', ->
[slug('FOO Bar baZ').toLowerCase()].should.eql ['foo-bar-baz']
[slug('FOO Bar baZ', replacement:'_').toLowerCase()].should.eql ['foo_bar_baz']
it 'should allow altering the charmap', ->
charmap = {
'f': 'ph', 'o':'0', 'b':'8', 'a':'4... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b95cf1f9135e90ffa50da8b8db684ad73794cf04 | 1,072 | https://github.com/dodo/node-slug/blob/b95cf1f9135e90ffa50da8b8db684ad73794cf04/test/slug.test.coffee | 124 | 143 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../src/slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | e61c1fe4fc88c1661251f5a70c5448d3b9a8edab | 1,072 | https://github.com/dodo/node-slug/blob/e61c1fe4fc88c1661251f5a70c5448d3b9a8edab/test/slug.test.coffee | 1 | 39 | ||
dodo/node-slug:test/slug.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
slug = require '../src/slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].shou... | var slug;
slug = require('../src/slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement', function() {
[slug('foo bar baz')].should.eql(['fo... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | e61c1fe4fc88c1661251f5a70c5448d3b9a8edab | 1,072 | https://github.com/dodo/node-slug/blob/e61c1fe4fc88c1661251f5a70c5448d3b9a8edab/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var slug;
slug = require('../src/slug');
describe('slug', function() {
it('should convert input to string', function() {
[slug(1)].should.eql(['1']);
return [slug(567890)].should.eql(['567890']);
});
it('should replace whitespaces with replacement',... | slug = require '../src/slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | e61c1fe4fc88c1661251f5a70c5448d3b9a8edab | 1,072 | https://github.com/dodo/node-slug/blob/e61c1fe4fc88c1661251f5a70c5448d3b9a8edab/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../src/slug'
describe 'slug', ->
it 'should convert input to string', ->
[slug 1].should.eql ['1']
[slug 567890].should.eql ['567890']
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].... | it 'should leave allowed chars', ->
allowed = ['*', '+', '~', '.', '(', ')', "'", '"', '!', ':', '@']
for a in allowed
[slug "foo #{a} bar baz"].should.eql ["foo-#{a}-bar-baz"]
it 'should replace latin chars', ->
char_map = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', '... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | e61c1fe4fc88c1661251f5a70c5448d3b9a8edab | 1,072 | https://github.com/dodo/node-slug/blob/e61c1fe4fc88c1661251f5a70c5448d3b9a8edab/test/slug.test.coffee | 1 | 39 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].should.eql ['foo_bar_baz']
it 'should remove trailing space if any', ->
[slug ' foo bar baz '].should.eql ['fo... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 1 | 50 | ||
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].should.eql ['foo_bar_baz']
it 'should remove trailing space if any', ->
[slug ' foo bar baz '].should.eql ['fo... | 'Õ': 'O', 'Ö': 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U',
'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a',
'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e',
'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 1 | 50 |
dodo/node-slug:test/slug.test.coffee:3:raw_corpus | raw_corpus | it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-b... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 53 | 95 | ||
dodo/node-slug:test/slug.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
[slug "fo... | it('should replace turkish chars', function() {
var char, char_map, replacement, results;
char_map = {
'ş': 's',
'Ş': 'S',
'ı': 'i',
'İ': 'I',
'ç': 'c',
'Ç': 'C',
'ü': 'u',
'Ü': 'U',
'ö': 'o',
'Ö': 'O',
'ğ': 'g',
'Ğ': 'G'
};
results = [];
for (char in char_map) ... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 53 | 95 |
dodo/node-slug:test/slug.test.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace turkish chars', function() {
var char, char_map, replacement, results;
char_map = {
'ş': 's',
'Ş': 'S',
'ı': 'i',
'İ': 'I',
'ç': 'c',
'Ç': 'C',
'ü': 'u',
'Ü': 'U',
'ö': 'o',
'Ö': 'O',
'ğ': 'g',
... | it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-b... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 53 | 95 |
dodo/node-slug:test/slug.test.coffee:3:completion | completion | it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-b... | for char, replacement of char_map
expected = "foo-#{replacement}-bar-baz"
expected = "foo-bar-baz" if not replacement
[slug "foo #{char} bar baz"].should.eql [expected]
it 'should replace czech chars', ->
char_map = {
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 53 | 95 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 97 | 139 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N... | it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
'Ā': 'A',
'Č': 'C',
'Ē': 'E',
'Ģ': 'G',
... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
... | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | [slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6 | 1,072 | https://github.com/dodo/node-slug/blob/d8ad18cdf42e3554b7b9e2523b768dc7b8efe9f6/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 03dbd38220c0573b4349ca803ee75441dcaa282e | 1,072 | https://github.com/dodo/node-slug/blob/03dbd38220c0573b4349ca803ee75441dcaa282e/test/slug.test.coffee | 97 | 139 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N... | it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
'Ā': 'A',
'Č': 'C',
'Ē': 'E',
'Ģ': 'G',
... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 03dbd38220c0573b4349ca803ee75441dcaa282e | 1,072 | https://github.com/dodo/node-slug/blob/03dbd38220c0573b4349ca803ee75441dcaa282e/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
... | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 03dbd38220c0573b4349ca803ee75441dcaa282e | 1,072 | https://github.com/dodo/node-slug/blob/03dbd38220c0573b4349ca803ee75441dcaa282e/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | [slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
'℠': 'sm', '…': '... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 03dbd38220c0573b4349ca803ee75441dcaa282e | 1,072 | https://github.com/dodo/node-slug/blob/03dbd38220c0573b4349ca803ee75441dcaa282e/test/slug.test.coffee | 97 | 139 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 697b96ef59a2ba4aa64999af3a7b696a7dd166b7 | 1,072 | https://github.com/dodo/node-slug/blob/697b96ef59a2ba4aa64999af3a7b696a7dd166b7/test/slug.test.coffee | 97 | 133 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N... | it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
'Ā': 'A',
'Č': 'C',
'Ē': 'E',
'Ģ': 'G',
... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 697b96ef59a2ba4aa64999af3a7b696a7dd166b7 | 1,072 | https://github.com/dodo/node-slug/blob/697b96ef59a2ba4aa64999af3a7b696a7dd166b7/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
... | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 697b96ef59a2ba4aa64999af3a7b696a7dd166b7 | 1,072 | https://github.com/dodo/node-slug/blob/697b96ef59a2ba4aa64999af3a7b696a7dd166b7/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | }
for char, replacement of char_map
replacement = replacement.replace ' ', '-'
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 697b96ef59a2ba4aa64999af3a7b696a7dd166b7 | 1,072 | https://github.com/dodo/node-slug/blob/697b96ef59a2ba4aa64999af3a7b696a7dd166b7/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:4:raw_corpus | raw_corpus | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b210e3f80dec4af18f39aec0abf0933b7213c511 | 1,072 | https://github.com/dodo/node-slug/blob/b210e3f80dec4af18f39aec0abf0933b7213c511/test/slug.test.coffee | 97 | 133 | ||
dodo/node-slug:test/slug.test.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N... | it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
'Ā': 'A',
'Č': 'C',
'Ē': 'E',
'Ģ': 'G',
... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | b210e3f80dec4af18f39aec0abf0933b7213c511 | 1,072 | https://github.com/dodo/node-slug/blob/b210e3f80dec4af18f39aec0abf0933b7213c511/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should replace latvian chars', function() {
var char, char_map, replacement, results;
char_map = {
'ā': 'a',
'č': 'c',
'ē': 'e',
'ģ': 'g',
'ī': 'i',
'ķ': 'k',
'ļ': 'l',
'ņ': 'n',
'š': 's',
'ū': 'u',
'ž': 'z',
... | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | JavaScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b210e3f80dec4af18f39aec0abf0933b7213c511 | 1,072 | https://github.com/dodo/node-slug/blob/b210e3f80dec4af18f39aec0abf0933b7213c511/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:4:completion | completion | it 'should replace latvian chars', ->
char_map = {
'ā':'a', 'č':'c', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
'š':'s', 'ū':'u', 'ž':'z', 'Ā':'A', 'Č':'C', 'Ē':'E', 'Ģ':'G', 'Ī':'i',
'Ķ':'k', 'Ļ':'L', 'Ņ':'N', 'Š':'S', 'Ū':'u', 'Ž':'Z'
}
for char, ... | }
for char, replacement of char_map
replacement = replacement.replace ' ', '-'
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]
it 'should replace symbols', ->
char_map = {
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | b210e3f80dec4af18f39aec0abf0933b7213c511 | 1,072 | https://github.com/dodo/node-slug/blob/b210e3f80dec4af18f39aec0abf0933b7213c511/test/slug.test.coffee | 97 | 133 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].should.eql ['foo_bar_baz']
it 'should remove trailing space if any', ->
[slug ' foo bar baz '].should.eql ['fo... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | c82c0ac908fa9b9e936a9f4f96ee56cbdad5dcbc | 1,072 | https://github.com/dodo/node-slug/blob/c82c0ac908fa9b9e936a9f4f96ee56cbdad5dcbc/test/slug.test.coffee | 1 | 50 | ||
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
[slug 'foo bar baz'].should.eql ['foo-bar-baz']
[slug 'foo bar baz', '_'].should.eql ['foo_bar_baz']
it 'should remove trailing space if any', ->
[slug ' foo bar baz '].should.eql ['fo... | 'Õ': 'O', 'Ö': 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U',
'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a',
'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e',
'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | c82c0ac908fa9b9e936a9f4f96ee56cbdad5dcbc | 1,072 | https://github.com/dodo/node-slug/blob/c82c0ac908fa9b9e936a9f4f96ee56cbdad5dcbc/test/slug.test.coffee | 1 | 50 |
dodo/node-slug:test/slug.test.coffee:1:raw_corpus | raw_corpus | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
slug('foo bar baz').should.eql 'foo-bar-baz'
slug('foo bar baz', '_').should.eql 'foo_bar_baz'
it 'should remove trailing space if any', ->
slug(' foo bar baz ').should.eql 'foo-bar-ba... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 401bb4845e38f6d3588e12494247207182f07cf1 | 1,072 | https://github.com/dodo/node-slug/blob/401bb4845e38f6d3588e12494247207182f07cf1/test/slug.test.coffee | 1 | 50 | ||
dodo/node-slug:test/slug.test.coffee:1:completion | completion | slug = require '../src/slug'
describe 'slug', ->
it 'should replace whitespaces with replacement', ->
slug('foo bar baz').should.eql 'foo-bar-baz'
slug('foo bar baz', '_').should.eql 'foo_bar_baz'
it 'should remove trailing space if any', ->
slug(' foo bar baz ').should.eql 'foo-bar-ba... | 'Õ': 'O', 'Ö': 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U',
'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a',
'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e',
'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
... | CoffeeScript | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 401bb4845e38f6d3588e12494247207182f07cf1 | 1,072 | https://github.com/dodo/node-slug/blob/401bb4845e38f6d3588e12494247207182f07cf1/test/slug.test.coffee | 1 | 50 |
dodo/node-slug:test/slug.test.coffee:3:raw_corpus | raw_corpus | it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
slug("foo #{char} bar baz").should.eql "foo-#{replacement}-bar-baz... | CoffeeScript | dodo/node-slug | test/slug.test.coffee | MIT | 401bb4845e38f6d3588e12494247207182f07cf1 | 1,072 | https://github.com/dodo/node-slug/blob/401bb4845e38f6d3588e12494247207182f07cf1/test/slug.test.coffee | 53 | 95 | ||
dodo/node-slug:test/slug.test.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should replace turkish chars', ->
char_map = {
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I', 'ç':'c', 'Ç':'C', 'ü':'u', 'Ü':'U',
'ö':'o', 'Ö':'O', 'ğ':'g', 'Ğ':'G'
}
for char, replacement of char_map
slug("foo... | it('should replace turkish chars', function() {
var char, char_map, replacement, results;
char_map = {
'ş': 's',
'Ş': 'S',
'ı': 'i',
'İ': 'I',
'ç': 'c',
'Ç': 'C',
'ü': 'u',
'Ü': 'U',
'ö': 'o',
'Ö': 'O',
'ğ': 'g',
'Ğ': 'G'
};
results = [];
for (char in char_map) ... | CoffeeScript | JavaScript | dodo/node-slug | test/slug.test.coffee | MIT | 401bb4845e38f6d3588e12494247207182f07cf1 | 1,072 | https://github.com/dodo/node-slug/blob/401bb4845e38f6d3588e12494247207182f07cf1/test/slug.test.coffee | 53 | 95 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.