Skip to content

Commit

Permalink
Replace deepClone.js with @jsbits/deep-clone
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarCruz committed Dec 13, 2018
1 parent a95878b commit ca51f24
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 31 deletions.
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ const genPugSourceMap = require('gen-pug-source-map')
const sysPath = require('path')
const pug = require('pug')
const clonePugOpts = require('./utils/clonePugOpts')
const deepClone = require('./utils/deepClone')
const deepClone = require('@jsbits/deep-clone')
const parseOptions = require('./utils/parseOptions')

/**
* @template T
* @param {T} src - Object to clone
*/
const dup = (src) => Object.assign({}, src)

/*
THE PLUGIN
*/
Expand Down Expand Up @@ -119,7 +113,7 @@ class PugCompiler {
* @param {boolean} [asset] Is this an html file
*/
_precompile (data, path, config, asset) {
const locals = dup(config.locals)
const locals = deepClone(config.locals)
const options = clonePugOpts(config, path)

// by no inlining functions, pug uses own `require('pug-runtime')`
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"pug-runtime": "^2.0.4"
},
"devDependencies": {
"@jsbits/deep-clone": "^1.1.0",
"eslint": "^5.9.0",
"jasmine": "^3.2.0",
"jasmine-console-reporter": "^3.1.0"
Expand Down
2 changes: 1 addition & 1 deletion utils/clonePugOpts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const deepClone = require('./deepClone')
const deepClone = require('@jsbits/deep-clone')

// used pug options, note this list does not include 'name' nor `filename`
const PUGPROPS = [
Expand Down
22 changes: 0 additions & 22 deletions utils/deepClone.js

This file was deleted.

0 comments on commit ca51f24

Please sign in to comment.