Skip to content

Commit

Permalink
fix: npm audit vulnerabilities warning (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
L2jLiga authored and dbanksdesign committed Oct 28, 2019
1 parent 99b636a commit c44cc76
Show file tree
Hide file tree
Showing 17 changed files with 7,065 additions and 6,200 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = Object.assign({}, require('./models'), require('./utils'));
module.exports = { ...require('./models'), ...require('./utils') };
5 changes: 3 additions & 2 deletions models/Artboard/Artboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Artboard extends Group {
* @property {Color.Model} backgroundColor
*/
static get Model() {
return Object.assign({}, Group.Model, {
return {
...Group.Model,
_class: 'artboard',
shouldBreakMaskChain: true,
backgroundColor: {},
Expand All @@ -49,7 +50,7 @@ class Artboard extends Group {
includeInCloudUpload: true,
isFlowHome: false,
resizesContent: false,
});
};
}

/**
Expand Down
9 changes: 1 addition & 8 deletions models/AttributedString/AttributedString.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ class AttributedString {
Object.assign(this, {
_class: 'attributedString',
string: args.string || '',
attributes: args.attributes || [
new StringAttribute(
Object.assign({}, args, {
location: 0,
length: args.string.length,
})
),
],
attributes: args.attributes || [new StringAttribute({ ...args, location: 0, length: args.string.length })],
});
}
}
Expand Down
5 changes: 3 additions & 2 deletions models/Bitmap/Bitmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class Bitmap extends Layer {
* @property {Object} image
*/
static get Model() {
return Object.assign({}, Layer.Model, {
return {
...Layer.Model,
_class: 'bitmap',
fillReplacesImage: false,
hasClippingMask: false,
Expand All @@ -54,7 +55,7 @@ class Bitmap extends Layer {
_ref_class: 'MSImageData',
_ref: '',
},
});
};
}

/**
Expand Down
5 changes: 3 additions & 2 deletions models/Group/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ class Group extends Layer {
* @mixes Layer.Model
*/
static get Model() {
return Object.assign({}, Layer.Model, {
return {
...Layer.Model,
_class: 'group',
layerListExpandedType: 2,
resizingConstraint: 63,
hasClickThrough: false,
});
};
}

/**
Expand Down
8 changes: 1 addition & 7 deletions models/Oval/Oval.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ class Oval extends Layer {
* @property {String[]} points
*/
static get Model() {
return Object.assign({}, Layer.Model, {
_class: 'oval',
edited: false,
isClosed: true,
pointRadiusBehaviour: 1,
points: [],
});
return { ...Layer.Model, _class: 'oval', edited: false, isClosed: true, pointRadiusBehaviour: 1, points: [] };
}

/**
Expand Down
4 changes: 1 addition & 3 deletions models/Page/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class Page extends Group {
* @mixes Group.Model
*/
static get Model() {
return Object.assign({}, Group.Model, {
_class: 'page',
});
return { ...Group.Model, _class: 'page' };
}

/**
Expand Down
5 changes: 3 additions & 2 deletions models/Rectangle/Rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ class Rectangle extends Layer {
* @property {boolean} hasConvertedToNewRoundCorners
*/
static get Model() {
return Object.assign({}, Layer.Model, {
return {
...Layer.Model,
_class: 'rectangle',
edited: false,
isClosed: true,
pointRadiusBehaviour: 1,
points: [],
fixedRadius: 0,
hasConvertedToNewRoundCorners: true,
});
};
}

/**
Expand Down
5 changes: 3 additions & 2 deletions models/ShapeGroup/ShapeGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ const Style = require('../Style');

class ShapeGroup extends Layer {
static get Model() {
return Object.assign({}, Layer.Model, {
return {
...Layer.Model,
_class: 'shapeGroup',
layerListExpandedType: 1,
clippingMaskMode: 0,
hasClippingMask: false,
windingRule: 1,
});
};
}

constructor(args, json) {
Expand Down
8 changes: 1 addition & 7 deletions models/ShapePath/ShapePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ class ShapePath extends Layer {
* @property {String[]} points
*/
static get Model() {
return Object.assign({}, Layer.Model, {
_class: 'shapePath',
edited: true,
isClosed: false,
pointRadiusBehaviour: 1,
points: [],
});
return { ...Layer.Model, _class: 'shapePath', edited: true, isClosed: false, pointRadiusBehaviour: 1, points: [] };
}

/**
Expand Down
6 changes: 1 addition & 5 deletions models/SymbolInstance/SymbolInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ class SymbolInstance extends Layer {
* @property {overrideValue[]} overrideValues
*/
static get Model() {
return Object.assign({}, Layer.Model, {
_class: 'symbolInstance',
symbolID: '',
overrideValues: [],
});
return { ...Layer.Model, _class: 'symbolInstance', symbolID: '', overrideValues: [] };
}

/**
Expand Down
6 changes: 1 addition & 5 deletions models/SymbolMaster/SymbolMaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ class SymbolMaster extends Artboard {
}

createInstance(args) {
const symbolInstance = new SymbolInstance(
Object.assign({}, args, {
symbolID: this.symbolID,
})
);
const symbolInstance = new SymbolInstance({ ...args, symbolID: this.symbolID });

symbolInstance.overrideValues = this.overrideProperties.map(prop => ({
_class: 'overrideValue',
Expand Down
5 changes: 3 additions & 2 deletions models/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ class Text extends Layer {
* @property {boolean} dontSynchroniseWithSymbol
*/
static get Model() {
return Object.assign({}, Layer.Model, {
return {
...Layer.Model,
automaticallyDrawOnUnderlyingPath: false,
dontSynchroniseWithSymbol: false,
attributedString: AttributedString.Model,
glyphBounds: '{{5, 15}, {122, 55}}',
lineSpacingBehaviour: 2,
textBehaviour: 2,
});
};
}

/**
Expand Down
13 changes: 5 additions & 8 deletions models/User/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@ class User {
* @returns {this}
*/
addPage(pageID, opts = {}) {
this[pageID] = Object.assign(
{},
{
scrollOrigin: '{100, 100}',
zoomValue: 1,
},
opts
);
this[pageID] = {
scrollOrigin: '{100, 100}',
zoomValue: 1,
...opts,
};
return this;
}
}
Expand Down
Loading

0 comments on commit c44cc76

Please sign in to comment.