Skip to content

Commit e490996

Browse files
committed
chore: publish 1.3.4
1 parent 4fb9dec commit e490996

File tree

6 files changed

+106
-56
lines changed

6 files changed

+106
-56
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
],
66
"npmClient": "yarn",
77
"useWorkspaces": true,
8-
"version": "1.3.3"
8+
"version": "1.3.4"
99
}

packages/server-test-utils/dist/vue-server-test-utils.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ function isVueComponent(c) {
17501750
return true
17511751
}
17521752

1753-
if (c === null || typeof c !== 'object') {
1753+
if (!isPlainObject(c)) {
17541754
return false
17551755
}
17561756

@@ -1780,7 +1780,7 @@ function componentNeedsCompiling(component) {
17801780

17811781
function isRefSelector(refOptionsObject) {
17821782
if (
1783-
typeof refOptionsObject !== 'object' ||
1783+
!isPlainObject(refOptionsObject) ||
17841784
Object.keys(refOptionsObject || {}).length !== 1
17851785
) {
17861786
return false
@@ -1790,7 +1790,7 @@ function isRefSelector(refOptionsObject) {
17901790
}
17911791

17921792
function isNameSelector(nameOptionsObject) {
1793-
if (typeof nameOptionsObject !== 'object' || nameOptionsObject === null) {
1793+
if (!isPlainObject(nameOptionsObject)) {
17941794
return false
17951795
}
17961796

@@ -1806,7 +1806,7 @@ function isDynamicComponent(c) {
18061806
}
18071807

18081808
function isComponentOptions(c) {
1809-
return c !== null && typeof c === 'object' && (c.template || c.render)
1809+
return isPlainObject(c) && (c.template || c.render)
18101810
}
18111811

18121812
function isFunctionalComponent(c) {
@@ -8084,7 +8084,10 @@ ErrorWrapper.prototype.destroy = function destroy () {
80848084
*/
80858085

80868086
function isStyleVisible(element) {
8087-
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {
8087+
if (
8088+
!(element instanceof window.HTMLElement) &&
8089+
!(element instanceof window.SVGElement)
8090+
) {
80888091
return false
80898092
}
80908093

@@ -10187,8 +10190,7 @@ Wrapper.prototype.setProps = function setProps (data) {
1018710190
Object.keys(data).forEach(function (key) {
1018810191
// Don't let people set entire objects, because reactivity won't work
1018910192
if (
10190-
typeof data[key] === 'object' &&
10191-
data[key] !== null &&
10193+
isPlainObject(data[key]) &&
1019210194
// $FlowIgnore : Problem with possibly null this.vm
1019310195
data[key] === this$1.vm[key]
1019410196
) {
@@ -13478,10 +13480,10 @@ function resolveComponent$1(obj, component) {
1347813480
)
1347913481
}
1348013482

13481-
function getCoreProperties(componentOptions) {
13483+
function getCoreProperties(componentOptions, name) {
1348213484
return {
1348313485
attrs: componentOptions.attrs,
13484-
name: componentOptions.name,
13486+
name: componentOptions.name || name,
1348513487
model: componentOptions.model,
1348613488
props: componentOptions.props,
1348713489
on: componentOptions.on,
@@ -13542,7 +13544,7 @@ function createStubFromComponent(
1354213544
Vue__default['default'].config.ignoredElements.push(tagName);
1354313545
}
1354413546

13545-
return Object.assign({}, getCoreProperties(componentOptions),
13547+
return Object.assign({}, getCoreProperties(componentOptions, name),
1354613548
{$_vueTestUtils_original: originalComponent,
1354713549
$_doNotStubChildren: true,
1354813550
render: function render(h, context) {
@@ -13723,8 +13725,16 @@ function patchCreateElement(_Vue, stubs, stubAllComponents) {
1372313725
}
1372413726

1372513727
if (isConstructor(el) || isComponentOptions(el)) {
13728+
var componentOptions = isConstructor(el) ? el.options : el;
13729+
var elName = componentOptions.name;
13730+
13731+
var stubbedComponent = resolveComponent(elName, stubs);
13732+
if (stubbedComponent) {
13733+
return originalCreateElement.apply(void 0, [ stubbedComponent ].concat( args ))
13734+
}
13735+
1372613736
if (stubAllComponents) {
13727-
var stub = createStubFromComponent(el, el.name || 'anonymous', _Vue);
13737+
var stub = createStubFromComponent(el, elName || 'anonymous', _Vue);
1372813738
return originalCreateElement.apply(void 0, [ stub ].concat( args ))
1372913739
}
1373013740
var Constructor = shouldExtend(el) ? extend(el, _Vue) : el;

packages/test-utils/dist/vue-test-utils.esm.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ function isVueComponent(c) {
18971897
return true
18981898
}
18991899

1900-
if (c === null || typeof c !== 'object') {
1900+
if (!isPlainObject(c)) {
19011901
return false
19021902
}
19031903

@@ -1927,7 +1927,7 @@ function componentNeedsCompiling(component) {
19271927

19281928
function isRefSelector(refOptionsObject) {
19291929
if (
1930-
typeof refOptionsObject !== 'object' ||
1930+
!isPlainObject(refOptionsObject) ||
19311931
Object.keys(refOptionsObject || {}).length !== 1
19321932
) {
19331933
return false
@@ -1937,7 +1937,7 @@ function isRefSelector(refOptionsObject) {
19371937
}
19381938

19391939
function isNameSelector(nameOptionsObject) {
1940-
if (typeof nameOptionsObject !== 'object' || nameOptionsObject === null) {
1940+
if (!isPlainObject(nameOptionsObject)) {
19411941
return false
19421942
}
19431943

@@ -1953,7 +1953,7 @@ function isDynamicComponent(c) {
19531953
}
19541954

19551955
function isComponentOptions(c) {
1956-
return c !== null && typeof c === 'object' && (c.template || c.render)
1956+
return isPlainObject(c) && (c.template || c.render)
19571957
}
19581958

19591959
function isFunctionalComponent(c) {
@@ -2263,10 +2263,10 @@ function resolveComponent$1(obj, component) {
22632263
)
22642264
}
22652265

2266-
function getCoreProperties(componentOptions) {
2266+
function getCoreProperties(componentOptions, name) {
22672267
return {
22682268
attrs: componentOptions.attrs,
2269-
name: componentOptions.name,
2269+
name: componentOptions.name || name,
22702270
model: componentOptions.model,
22712271
props: componentOptions.props,
22722272
on: componentOptions.on,
@@ -2327,7 +2327,7 @@ function createStubFromComponent(
23272327
Vue.config.ignoredElements.push(tagName);
23282328
}
23292329

2330-
return Object.assign({}, getCoreProperties(componentOptions),
2330+
return Object.assign({}, getCoreProperties(componentOptions, name),
23312331
{$_vueTestUtils_original: originalComponent,
23322332
$_doNotStubChildren: true,
23332333
render: function render(h, context) {
@@ -2508,8 +2508,16 @@ function patchCreateElement(_Vue, stubs, stubAllComponents) {
25082508
}
25092509

25102510
if (isConstructor(el) || isComponentOptions(el)) {
2511+
var componentOptions = isConstructor(el) ? el.options : el;
2512+
var elName = componentOptions.name;
2513+
2514+
var stubbedComponent = resolveComponent(elName, stubs);
2515+
if (stubbedComponent) {
2516+
return originalCreateElement.apply(void 0, [ stubbedComponent ].concat( args ))
2517+
}
2518+
25112519
if (stubAllComponents) {
2512-
var stub = createStubFromComponent(el, el.name || 'anonymous', _Vue);
2520+
var stub = createStubFromComponent(el, elName || 'anonymous', _Vue);
25132521
return originalCreateElement.apply(void 0, [ stub ].concat( args ))
25142522
}
25152523
var Constructor = shouldExtend(el) ? extend(el, _Vue) : el;
@@ -9011,7 +9019,10 @@ ErrorWrapper.prototype.destroy = function destroy () {
90119019
*/
90129020

90139021
function isStyleVisible(element) {
9014-
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {
9022+
if (
9023+
!(element instanceof window.HTMLElement) &&
9024+
!(element instanceof window.SVGElement)
9025+
) {
90159026
return false
90169027
}
90179028

@@ -11114,8 +11125,7 @@ Wrapper.prototype.setProps = function setProps (data) {
1111411125
Object.keys(data).forEach(function (key) {
1111511126
// Don't let people set entire objects, because reactivity won't work
1111611127
if (
11117-
typeof data[key] === 'object' &&
11118-
data[key] !== null &&
11128+
isPlainObject(data[key]) &&
1111911129
// $FlowIgnore : Problem with possibly null this.vm
1112011130
data[key] === this$1.vm[key]
1112111131
) {

packages/test-utils/dist/vue-test-utils.iife.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
19011901
return true
19021902
}
19031903

1904-
if (c === null || typeof c !== 'object') {
1904+
if (!isPlainObject(c)) {
19051905
return false
19061906
}
19071907

@@ -1931,7 +1931,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
19311931

19321932
function isRefSelector(refOptionsObject) {
19331933
if (
1934-
typeof refOptionsObject !== 'object' ||
1934+
!isPlainObject(refOptionsObject) ||
19351935
Object.keys(refOptionsObject || {}).length !== 1
19361936
) {
19371937
return false
@@ -1941,7 +1941,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
19411941
}
19421942

19431943
function isNameSelector(nameOptionsObject) {
1944-
if (typeof nameOptionsObject !== 'object' || nameOptionsObject === null) {
1944+
if (!isPlainObject(nameOptionsObject)) {
19451945
return false
19461946
}
19471947

@@ -1957,7 +1957,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
19571957
}
19581958

19591959
function isComponentOptions(c) {
1960-
return c !== null && typeof c === 'object' && (c.template || c.render)
1960+
return isPlainObject(c) && (c.template || c.render)
19611961
}
19621962

19631963
function isFunctionalComponent(c) {
@@ -2267,10 +2267,10 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
22672267
)
22682268
}
22692269

2270-
function getCoreProperties(componentOptions) {
2270+
function getCoreProperties(componentOptions, name) {
22712271
return {
22722272
attrs: componentOptions.attrs,
2273-
name: componentOptions.name,
2273+
name: componentOptions.name || name,
22742274
model: componentOptions.model,
22752275
props: componentOptions.props,
22762276
on: componentOptions.on,
@@ -2331,7 +2331,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
23312331
Vue__default['default'].config.ignoredElements.push(tagName);
23322332
}
23332333

2334-
return Object.assign({}, getCoreProperties(componentOptions),
2334+
return Object.assign({}, getCoreProperties(componentOptions, name),
23352335
{$_vueTestUtils_original: originalComponent,
23362336
$_doNotStubChildren: true,
23372337
render: function render(h, context) {
@@ -2512,8 +2512,16 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
25122512
}
25132513

25142514
if (isConstructor(el) || isComponentOptions(el)) {
2515+
var componentOptions = isConstructor(el) ? el.options : el;
2516+
var elName = componentOptions.name;
2517+
2518+
var stubbedComponent = resolveComponent(elName, stubs);
2519+
if (stubbedComponent) {
2520+
return originalCreateElement.apply(void 0, [ stubbedComponent ].concat( args ))
2521+
}
2522+
25152523
if (stubAllComponents) {
2516-
var stub = createStubFromComponent(el, el.name || 'anonymous', _Vue);
2524+
var stub = createStubFromComponent(el, elName || 'anonymous', _Vue);
25172525
return originalCreateElement.apply(void 0, [ stub ].concat( args ))
25182526
}
25192527
var Constructor = shouldExtend(el) ? extend(el, _Vue) : el;
@@ -9015,7 +9023,10 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
90159023
*/
90169024

90179025
function isStyleVisible(element) {
9018-
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {
9026+
if (
9027+
!(element instanceof window.HTMLElement) &&
9028+
!(element instanceof window.SVGElement)
9029+
) {
90199030
return false
90209031
}
90219032

@@ -11118,8 +11129,7 @@ var VueTestUtils = (function (exports, Vue, vueTemplateCompiler) {
1111811129
Object.keys(data).forEach(function (key) {
1111911130
// Don't let people set entire objects, because reactivity won't work
1112011131
if (
11121-
typeof data[key] === 'object' &&
11122-
data[key] !== null &&
11132+
isPlainObject(data[key]) &&
1112311133
// $FlowIgnore : Problem with possibly null this.vm
1112411134
data[key] === this$1.vm[key]
1112511135
) {

packages/test-utils/dist/vue-test-utils.js

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ function isVueComponent(c) {
19051905
return true
19061906
}
19071907

1908-
if (c === null || typeof c !== 'object') {
1908+
if (!isPlainObject(c)) {
19091909
return false
19101910
}
19111911

@@ -1935,7 +1935,7 @@ function componentNeedsCompiling(component) {
19351935

19361936
function isRefSelector(refOptionsObject) {
19371937
if (
1938-
typeof refOptionsObject !== 'object' ||
1938+
!isPlainObject(refOptionsObject) ||
19391939
Object.keys(refOptionsObject || {}).length !== 1
19401940
) {
19411941
return false
@@ -1945,7 +1945,7 @@ function isRefSelector(refOptionsObject) {
19451945
}
19461946

19471947
function isNameSelector(nameOptionsObject) {
1948-
if (typeof nameOptionsObject !== 'object' || nameOptionsObject === null) {
1948+
if (!isPlainObject(nameOptionsObject)) {
19491949
return false
19501950
}
19511951

@@ -1961,7 +1961,7 @@ function isDynamicComponent(c) {
19611961
}
19621962

19631963
function isComponentOptions(c) {
1964-
return c !== null && typeof c === 'object' && (c.template || c.render)
1964+
return isPlainObject(c) && (c.template || c.render)
19651965
}
19661966

19671967
function isFunctionalComponent(c) {
@@ -2271,10 +2271,10 @@ function resolveComponent$1(obj, component) {
22712271
)
22722272
}
22732273

2274-
function getCoreProperties(componentOptions) {
2274+
function getCoreProperties(componentOptions, name) {
22752275
return {
22762276
attrs: componentOptions.attrs,
2277-
name: componentOptions.name,
2277+
name: componentOptions.name || name,
22782278
model: componentOptions.model,
22792279
props: componentOptions.props,
22802280
on: componentOptions.on,
@@ -2335,7 +2335,7 @@ function createStubFromComponent(
23352335
Vue__default['default'].config.ignoredElements.push(tagName);
23362336
}
23372337

2338-
return Object.assign({}, getCoreProperties(componentOptions),
2338+
return Object.assign({}, getCoreProperties(componentOptions, name),
23392339
{$_vueTestUtils_original: originalComponent,
23402340
$_doNotStubChildren: true,
23412341
render: function render(h, context) {
@@ -2516,8 +2516,16 @@ function patchCreateElement(_Vue, stubs, stubAllComponents) {
25162516
}
25172517

25182518
if (isConstructor(el) || isComponentOptions(el)) {
2519+
var componentOptions = isConstructor(el) ? el.options : el;
2520+
var elName = componentOptions.name;
2521+
2522+
var stubbedComponent = resolveComponent(elName, stubs);
2523+
if (stubbedComponent) {
2524+
return originalCreateElement.apply(void 0, [ stubbedComponent ].concat( args ))
2525+
}
2526+
25192527
if (stubAllComponents) {
2520-
var stub = createStubFromComponent(el, el.name || 'anonymous', _Vue);
2528+
var stub = createStubFromComponent(el, elName || 'anonymous', _Vue);
25212529
return originalCreateElement.apply(void 0, [ stub ].concat( args ))
25222530
}
25232531
var Constructor = shouldExtend(el) ? extend(el, _Vue) : el;
@@ -9019,7 +9027,10 @@ ErrorWrapper.prototype.destroy = function destroy () {
90199027
*/
90209028

90219029
function isStyleVisible(element) {
9022-
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) {
9030+
if (
9031+
!(element instanceof window.HTMLElement) &&
9032+
!(element instanceof window.SVGElement)
9033+
) {
90239034
return false
90249035
}
90259036

@@ -11122,8 +11133,7 @@ Wrapper.prototype.setProps = function setProps (data) {
1112211133
Object.keys(data).forEach(function (key) {
1112311134
// Don't let people set entire objects, because reactivity won't work
1112411135
if (
11125-
typeof data[key] === 'object' &&
11126-
data[key] !== null &&
11136+
isPlainObject(data[key]) &&
1112711137
// $FlowIgnore : Problem with possibly null this.vm
1112811138
data[key] === this$1.vm[key]
1112911139
) {

0 commit comments

Comments
 (0)