als-layout 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/layout.js +5 -3
  2. package/package.json +1 -1
package/layout.js CHANGED
@@ -11,16 +11,18 @@ class Layout {
11
11
  `
12
12
  constructor(options={}) {
13
13
  if(Layout.minify) this.tab = this.n = ''
14
- options = Object.assign(this.defaults,options)
14
+ options = {...this.defaults,...options}
15
15
  for(let key in options) {
16
16
  this[key] = options[key]
17
17
  }
18
18
  }
19
19
 
20
20
  get(options={}) {
21
- options = Object.assign(this.defaults,options)
22
21
  for(let key in options) {
23
- if(key == 'scripts' || key == 'links') this[key] = [...this[key],...options[key]]
22
+ if(key == 'scripts' || key == 'links') {
23
+ if(!Array.isArray(options[key])) options[key] = []
24
+ this[key] = [...this[key],...options[key]]
25
+ }
24
26
  else this[key] = options[key]
25
27
  }
26
28
  return this.template()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "als-layout",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Create html layout",
5
5
  "main": "layout.js",
6
6
  "keywords": [],