Skip to content

Commit f2d5b01

Browse files
committed
fix "link.rel.push is not a function"
1 parent dbc80d0 commit f2d5b01

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/plugins/validators/async/22_imageSize.js

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ export default {
9898

9999
// Special case: add rel image for image file with specific size.
100100
if (link.rel.indexOf(CONFIG.R.image) === -1 && link.rel.indexOf(CONFIG.R.file) > -1 && data.width >= 100 && data.height >= 100) {
101+
if (!Array.isArray(link.rel)) {
102+
link.rel = [link.rel];
103+
}
101104
link.rel.push(CONFIG.R.image);
102105
}
103106

0 commit comments

Comments
 (0)