Skip to content

Commit ddcd0fd

Browse files
jimmywartinggoto-bus-stop
authored andcommitted
remove xtend (#159)
1 parent 23a1fbe commit ddcd0fd

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const mapLimit = require('map-limit')
44
const postcss = require('postcss')
55
const assert = require('assert')
66
const crypto = require('crypto')
7-
const xtend = require('xtend')
87
const stackTrace = require('stack-trace')
98
const cssResolve = require('style-resolve').sync
109
const fs = require('fs')
@@ -64,7 +63,7 @@ function parseCss (src, filename, prefix, options, done) {
6463
assert.equal(typeof options, 'object', 'options must be a object')
6564
assert.equal(typeof done, 'function', 'done must be a function')
6665

67-
applyTransforms(filename, String(src), xtend(options), function (err, result) {
66+
applyTransforms(filename, String(src), Object.assign({}, options), function (err, result) {
6867
if (err) return done(err)
6968
var p = postcss()
7069
p = p.use(cssPrefix('.' + prefix))

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"static-eval": "^2.0.0",
4040
"style-resolve": "^1.1.0",
4141
"through2": "^2.0.0",
42-
"transform-ast": "^2.4.0",
43-
"xtend": "^4.0.1"
42+
"transform-ast": "^2.4.0"
4443
},
4544
"devDependencies": {
4645
"babel-core": "^6.26.0",

transform.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const parse = require('fast-json-parse')
66
const findup = require('@choojs/findup')
77
const mapLimit = require('map-limit')
88
const through = require('through2')
9-
const xtend = require('xtend')
109
const path = require('path')
1110
const fs = require('fs')
1211

@@ -31,7 +30,7 @@ function isBubleTemplateDefinition (node) {
3130
function transform (filename, options) {
3231
if (/\.json$/i.test(filename)) return through()
3332

34-
const opts = xtend(options || {
33+
const opts = Object.assign({}, options || {
3534
basedir: process.cwd(),
3635
transform: [],
3736
out: ''
@@ -148,7 +147,7 @@ function transform (filename, options) {
148147
nodes.push({
149148
css: css,
150149
filename: filename,
151-
opts: xtend(opts),
150+
opts: Object.assign({}, opts),
152151
node: node.parent
153152
})
154153
}
@@ -183,7 +182,7 @@ function transform (filename, options) {
183182
nodes.push({
184183
css: elements.map(function (part) { return part.value }).join(''),
185184
filename: filename,
186-
opts: xtend(opts),
185+
opts: Object.assign({}, opts),
187186
node: node
188187
})
189188
}
@@ -236,7 +235,7 @@ function transform (filename, options) {
236235
}
237236

238237
const iOpts = node.arguments[1]
239-
? xtend(opts, staticEval(node.arguments[1]))
238+
? Object.assign({}, opts, staticEval(node.arguments[1]))
240239
: opts
241240

242241
transformStream.emit('file', resolvePath)

0 commit comments

Comments
 (0)