ssh-config 5.0.0 → 5.0.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ssh-config",
3
3
  "description": "SSH config parser and stringifier",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "author": "Chen Yangjian (https://www.cyj.me)",
6
6
  "repository": {
7
7
  "type": "git",
package/src/ssh-config.js CHANGED
@@ -115,18 +115,20 @@ class SSHConfig extends Array {
115
115
  };
116
116
  const obj = {};
117
117
  const setProperty = (name, value) => {
118
+ const val = Array.isArray(value) ? value.map(({ val }) => val) : value;
119
+ const val0 = Array.isArray(val) ? val[0] : val;
118
120
  if (MULTIPLE_VALUE_PROPS.includes(name)) {
119
- const list = obj[name] || (obj[name] = []);
120
- list.push(value);
121
+ const list = (obj[name] || (obj[name] = []));
122
+ list.push(...[].concat(val));
121
123
  }
122
124
  else if (obj[name] == null) {
123
125
  if (name === 'HostName') {
124
- context.params.HostName = value;
126
+ context.params.HostName = val0;
125
127
  }
126
128
  else if (name === 'User') {
127
- context.params.User = value;
129
+ context.params.User = val0;
128
130
  }
129
- obj[name] = value;
131
+ obj[name] = val;
130
132
  }
131
133
  };
132
134
  if (opts.User !== undefined) {