Skip to content

Commit 77b8134

Browse files
committed
reduce process-result.js & objectifier.js
1 parent 7a650cd commit 77b8134

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

objectifier.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ function camelcase(property) {
3939

4040
// Microsoft vendor-prefixes are uniquely cased
4141
if (property.startsWith('-ms-')) {
42-
property = property.substring(1)
42+
property = property.slice(1)
4343
index = property.indexOf('-')
4444
}
4545

4646
let cursor = 0
4747
let result = ''
4848

4949
do {
50-
result += property.substring(cursor, index) + property[index + 1].toUpperCase()
50+
result += property.slice(cursor, index) + property[index + 1].toUpperCase()
5151
cursor = index + 2
5252
index = property.indexOf('-', cursor)
5353
} while (index !== -1)
5454

55-
return result + property.substring(cursor)
55+
return result + property.slice(cursor)
5656
}
5757

5858
function process(node, options = {}) {
@@ -80,7 +80,9 @@ function process(node, options = {}) {
8080
typeof object[i] === 'string' &&
8181
object[i].endsWith('!important')
8282
) {
83-
if (typeof body[i] === 'string' && body[i].endsWith('!important')) object[i] = body[i]
83+
if (typeof body[i] === 'string' && body[i].endsWith('!important')) {
84+
object[i] = body[i]
85+
}
8486
} else {
8587
object[i] = body[i]
8688
}

process-result.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ let objectify = require('./objectifier')
33
module.exports = function processResult(result) {
44
if (console && console.warn) {
55
result.warnings().forEach(warn => {
6-
let source = warn.plugin || 'PostCSS'
7-
console.warn(source + ': ' + warn.text)
6+
console.warn((warn.plugin || 'PostCSS') + ': ' + warn.text)
87
})
98
}
109
return objectify(result.root)

0 commit comments

Comments
 (0)