Skip to content

Commit 2c48ee1

Browse files
committed
Update dev-dependencies
1 parent ca65b89 commit 2c48ee1

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
var trim = require('trim')
44

5-
module.exports = toJSON
5+
module.exports = toJson
66

77
var own = {}.hasOwnProperty
88

99
// Transform a string into an array or object of values.
10-
function toJSON(value, options) {
10+
function toJson(value, options) {
1111
var propertyOrValues = {}
1212
var lines
1313
var isPropertyValuePair
@@ -146,7 +146,7 @@ function stripComments(token) {
146146
var index = value.indexOf(token)
147147

148148
if (index !== -1) {
149-
value = value.substr(0, index)
149+
value = value.slice(0, index)
150150
}
151151

152152
return value

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
},
2727
"devDependencies": {
2828
"browserify": "^16.0.0",
29-
"cept": "^1.0.1",
30-
"nyc": "^14.0.0",
31-
"prettier": "^1.12.1",
32-
"remark-cli": "^6.0.0",
33-
"remark-preset-wooorm": "^4.0.0",
29+
"cept": "^1.0.0",
30+
"nyc": "^15.0.0",
31+
"prettier": "^1.0.0",
32+
"remark-cli": "^7.0.0",
33+
"remark-preset-wooorm": "^6.0.0",
3434
"tape": "^4.0.0",
35-
"tinyify": "^2.5.0",
36-
"xo": "^0.24.0"
35+
"tinyify": "^2.0.0",
36+
"xo": "^0.25.0"
3737
},
3838
"scripts": {
3939
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",

test.js

+30-30
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@
22

33
var test = require('tape')
44
var cept = require('cept')
5-
var toJSON = require('.')
5+
var toJson = require('.')
66

7-
test('toJSON', function(t) {
8-
t.equal(typeof toJSON, 'function', 'should be a `function`')
7+
test('toJson', function(t) {
8+
t.equal(typeof toJson, 'function', 'should be a `function`')
99
t.end()
1010
})
1111

1212
test('Comments', function(t) {
1313
t.deepEqual(
14-
toJSON(['% This is a completely commented line.', 'unicorn'].join('\n')),
14+
toJson(['% This is a completely commented line.', 'unicorn'].join('\n')),
1515
['unicorn'],
1616
'should strip line comments'
1717
)
1818

1919
t.deepEqual(
20-
toJSON('unicorn % This is a partially commented line.'),
20+
toJson('unicorn % This is a partially commented line.'),
2121
['unicorn'],
2222
'should strip partial line comments'
2323
)
2424

2525
t.deepEqual(
26-
toJSON('unicorn % This is a partially commented line.', {
26+
toJson('unicorn % This is a partially commented line.', {
2727
comment: false
2828
}),
2929
['unicorn % This is a partially commented line.'],
3030
'should honour `comment: false`'
3131
)
3232

3333
t.deepEqual(
34-
toJSON(['# This is a completely commented line.', 'unicorn'].join('\n'), {
34+
toJson(['# This is a completely commented line.', 'unicorn'].join('\n'), {
3535
comment: '#'
3636
}),
3737
['unicorn'],
3838
'should strip line comments based on a given token'
3939
)
4040

4141
t.deepEqual(
42-
toJSON('unicorn # This is a partially commented line.', {
42+
toJson('unicorn # This is a partially commented line.', {
4343
comment: '#'
4444
}),
4545
['unicorn'],
@@ -51,7 +51,7 @@ test('Comments', function(t) {
5151

5252
test('White space', function(t) {
5353
t.deepEqual(
54-
toJSON(' \tunicorn \t'),
54+
toJson(' \tunicorn \t'),
5555
['unicorn'],
5656
'should trim prefixed and suffixed white space'
5757
)
@@ -61,7 +61,7 @@ test('White space', function(t) {
6161

6262
test('Blank lines', function(t) {
6363
t.deepEqual(
64-
toJSON('\n \t \ndoge\n\nunicorn\r\n'),
64+
toJson('\n \t \ndoge\n\nunicorn\r\n'),
6565
['doge', 'unicorn'],
6666
'should remove empty / blank lines'
6767
)
@@ -70,22 +70,22 @@ test('Blank lines', function(t) {
7070
})
7171

7272
test('EOF', function(t) {
73-
t.deepEqual(toJSON('unicorn'), ['unicorn'], 'No EOL')
74-
t.deepEqual(toJSON('unicorn\n'), ['unicorn'], 'LF')
75-
t.deepEqual(toJSON('unicorn\r\n'), ['unicorn'], 'CR+LF')
73+
t.deepEqual(toJson('unicorn'), ['unicorn'], 'No EOL')
74+
t.deepEqual(toJson('unicorn\n'), ['unicorn'], 'LF')
75+
t.deepEqual(toJson('unicorn\r\n'), ['unicorn'], 'CR+LF')
7676

7777
t.end()
7878
})
7979

8080
test('Property-value pairs', function(t) {
8181
t.deepEqual(
82-
toJSON('unicorn: magic creature'),
82+
toJson('unicorn: magic creature'),
8383
{unicorn: 'magic creature'},
8484
'should support pair delimiters'
8585
)
8686

8787
t.deepEqual(
88-
toJSON(
88+
toJson(
8989
[
9090
'unicorn : magic creature',
9191
'\trainbow:double\t',
@@ -101,7 +101,7 @@ test('Property-value pairs', function(t) {
101101
)
102102

103103
t.deepEqual(
104-
toJSON('unicorn\tmagic creature', {delimiter: '\t'}),
104+
toJson('unicorn\tmagic creature', {delimiter: '\t'}),
105105
{unicorn: 'magic creature'},
106106
'given delimiters'
107107
)
@@ -110,10 +110,10 @@ test('Property-value pairs', function(t) {
110110
})
111111

112112
test('Values', function(t) {
113-
t.deepEqual(toJSON('unicorn'), ['unicorn'], 'one value')
113+
t.deepEqual(toJson('unicorn'), ['unicorn'], 'one value')
114114

115115
t.deepEqual(
116-
toJSON('unicorn \n doge\n\trainbow'),
116+
toJson('unicorn \n doge\n\trainbow'),
117117
['doge', 'rainbow', 'unicorn'],
118118
'multiple values'
119119
)
@@ -124,7 +124,7 @@ test('Values', function(t) {
124124
test('Mixed values', function(t) {
125125
t.throws(
126126
function() {
127-
toJSON('unicorn\nrainbow: double')
127+
toJson('unicorn\nrainbow: double')
128128
},
129129
/^Error: Error at `rainbow,double`/,
130130
'should throw when both property-value pairs and values are provided'
@@ -136,14 +136,14 @@ test('Mixed values', function(t) {
136136
test('Invalid lists', function(t) {
137137
t.throws(
138138
function() {
139-
toJSON('unicorn\nrainbow\nunicorn')
139+
toJson('unicorn\nrainbow\nunicorn')
140140
},
141141
/^Error: Error at `unicorn`: Duplicate data found/,
142142
'should throw when duplicate values exist'
143143
)
144144

145145
t.deepEqual(
146-
toJSON('unicorn\nrainbow\nunicorn', {forgiving: true}),
146+
toJson('unicorn\nrainbow\nunicorn', {forgiving: true}),
147147
['rainbow', 'unicorn', 'unicorn'],
148148
'should honour forgiving'
149149
)
@@ -152,7 +152,7 @@ test('Invalid lists', function(t) {
152152
var stop = cept(console, 'log', hoist)
153153
var params
154154

155-
toJSON('unicorn\nrainbow\nunicorn', {forgiving: true})
155+
toJson('unicorn\nrainbow\nunicorn', {forgiving: true})
156156

157157
stop()
158158

@@ -168,7 +168,7 @@ test('Invalid lists', function(t) {
168168
var stop = cept(console, 'log', hoist)
169169
var params
170170

171-
toJSON('unicorn\nrainbow\nunicorn', {forgiving: true, log: false})
171+
toJson('unicorn\nrainbow\nunicorn', {forgiving: true, log: false})
172172

173173
stop()
174174

@@ -186,14 +186,14 @@ test('Invalid lists', function(t) {
186186
test('Invalid objects', function(t) {
187187
t.throws(
188188
function() {
189-
toJSON('doge: so scare\nunicorn: magic\ndoge: double')
189+
toJson('doge: so scare\nunicorn: magic\ndoge: double')
190190
},
191191
/^Error: Error at `doge,double`: Duplicate data found/,
192192
'should throw when duplicate values exist'
193193
)
194194

195195
t.deepEqual(
196-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
196+
toJson('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
197197
forgiving: true
198198
}),
199199
{doge: 'so scare', unicorn: 'magic creature'},
@@ -204,7 +204,7 @@ test('Invalid objects', function(t) {
204204
var stop = cept(console, 'log', hoist)
205205
var params
206206

207-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
207+
toJson('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
208208
forgiving: true
209209
})
210210

@@ -222,7 +222,7 @@ test('Invalid objects', function(t) {
222222
var stop = cept(console, 'log', hoist)
223223
var params
224224

225-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
225+
toJson('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
226226
forgiving: true,
227227
log: false
228228
})
@@ -238,15 +238,15 @@ test('Invalid objects', function(t) {
238238
})
239239

240240
t.deepEqual(
241-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
241+
toJson('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
242242
forgiving: 'fix'
243243
}),
244244
{doge: 'so scare', unicorn: 'magic creature'},
245245
"should honour `forgiving: 'fix'`"
246246
)
247247

248248
t.deepEqual(
249-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: rainbows\n', {
249+
toJson('doge: so scare\nunicorn: magic creature\ndoge: rainbows\n', {
250250
forgiving: 'fix'
251251
}),
252252
{doge: 'rainbows', unicorn: 'magic creature'},
@@ -259,7 +259,7 @@ test('Invalid objects', function(t) {
259259
var stop = cept(console, 'log', hoist)
260260
var params
261261

262-
toJSON('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
262+
toJson('doge: so scare\nunicorn: magic creature\ndoge: so scare\n', {
263263
forgiving: true
264264
})
265265

0 commit comments

Comments
 (0)