Skip to content

Commit

Permalink
refactor: Switch === to == in a few places where not needed (#4157)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Oct 9, 2023
1 parent 600d8cf commit 4b1a7e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ export function Fragment(props) {
* @returns {vnode is import('./internal').VNode}
*/
export const isValidElement = vnode =>
vnode != null && vnode.constructor === undefined;
vnode != null && vnode.constructor == undefined;
2 changes: 1 addition & 1 deletion src/diff/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function diffChildren(
// or we are rendering a component (e.g. setState) copy the oldVNodes so it can have
// it's own DOM & etc. pointers
else if (
childVNode.constructor === String ||
childVNode.constructor == String ||
typeof childVNode == 'number' ||
// eslint-disable-next-line valid-typeof
typeof childVNode == 'bigint'
Expand Down
2 changes: 1 addition & 1 deletion src/diff/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function setProperty(dom, name, value, oldValue, isSvg) {
// amount of exceptions would cost too many bytes. On top of
// that other frameworks generally stringify `false`.

if (typeof value === 'function') {
if (typeof value == 'function') {
// never serialize functions as attribute values
} else if (value != null && (value !== false || name[4] === '-')) {
dom.setAttribute(name, value);
Expand Down
2 changes: 1 addition & 1 deletion src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function render(vnode, parentDom, replaceNode) {
// We abuse the `replaceNode` parameter in `hydrate()` to signal if we are in
// hydration mode or not by passing the `hydrate` function instead of a DOM
// element..
let isHydrating = typeof replaceNode === 'function';
let isHydrating = typeof replaceNode == 'function';

// To be able to support calling `render()` multiple times on the same
// DOM node, we need to obtain a reference to the previous tree. We do
Expand Down

0 comments on commit 4b1a7e9

Please sign in to comment.