@wordpress/element
Advanced tools
Comparing version 4.8.0 to 4.9.0
/** | ||
* External dependencies | ||
*/ | ||
import { isArray, isNumber, isString } from 'lodash'; | ||
import { isNumber, isString } from 'lodash'; | ||
/** | ||
@@ -17,3 +17,3 @@ * Checks if the provided WP element is empty. | ||
if (isString(element) || isArray(element)) { | ||
if (isString(element) || Array.isArray(element)) { | ||
return !element.length; | ||
@@ -20,0 +20,0 @@ } |
@@ -25,3 +25,3 @@ "use strict"; | ||
if ((0, _lodash.isString)(element) || (0, _lodash.isArray)(element)) { | ||
if ((0, _lodash.isString)(element) || Array.isArray(element)) { | ||
return !element.length; | ||
@@ -28,0 +28,0 @@ } |
@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. --> | ||
## 4.9.0 (2022-06-15) | ||
## 4.8.0 (2022-06-01) | ||
@@ -7,0 +9,0 @@ |
{ | ||
"name": "@wordpress/element", | ||
"version": "4.8.0", | ||
"version": "4.9.0", | ||
"description": "Element React module for WordPress.", | ||
@@ -34,3 +34,3 @@ "author": "The WordPress Contributors", | ||
"@types/react-dom": "^17.0.11", | ||
"@wordpress/escape-html": "^2.10.0", | ||
"@wordpress/escape-html": "^2.11.0", | ||
"lodash": "^4.17.21", | ||
@@ -43,3 +43,3 @@ "react": "^17.0.2", | ||
}, | ||
"gitHead": "a3e0b62091e8a8bdf5e2518e42d60d7098af48cc" | ||
"gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b" | ||
} |
@@ -172,6 +172,4 @@ /** | ||
if ( stackDepth !== 0 ) { | ||
const { | ||
leadingTextStart: stackLeadingText, | ||
tokenStart, | ||
} = stack.pop(); | ||
const { leadingTextStart: stackLeadingText, tokenStart } = | ||
stack.pop(); | ||
output.push( indoc.substr( stackLeadingText, tokenStart ) ); | ||
@@ -329,9 +327,4 @@ } | ||
function closeOuterElement( endOffset ) { | ||
const { | ||
element, | ||
leadingTextStart, | ||
prevOffset, | ||
tokenStart, | ||
children, | ||
} = stack.pop(); | ||
const { element, leadingTextStart, prevOffset, tokenStart, children } = | ||
stack.pop(); | ||
@@ -338,0 +331,0 @@ const text = endOffset |
@@ -569,6 +569,5 @@ /** | ||
const { | ||
type, | ||
props, | ||
} = /** @type {{type?: any, props?: any}} */ ( element ); | ||
const { type, props } = /** @type {{type?: any, props?: any}} */ ( | ||
element | ||
); | ||
@@ -700,6 +699,5 @@ switch ( type ) { | ||
) { | ||
const instance = new /** @type {import('react').ComponentClass} */ ( Component )( | ||
props, | ||
legacyContext | ||
); | ||
const instance = new /** @type {import('react').ComponentClass} */ ( | ||
Component | ||
)( props, legacyContext ); | ||
@@ -715,3 +713,5 @@ if ( | ||
legacyContext, | ||
/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext() | ||
/** @type {{getChildContext?: () => unknown}} */ ( | ||
instance | ||
).getChildContext() | ||
); | ||
@@ -718,0 +718,0 @@ } |
/** | ||
* External dependencies | ||
*/ | ||
import { noop } from 'lodash'; | ||
/** | ||
* Internal dependencies | ||
@@ -27,2 +22,4 @@ */ | ||
const noop = () => {}; | ||
describe( 'serialize()', () => { | ||
@@ -29,0 +26,0 @@ it( 'should allow only valid attribute names', () => { |
/** | ||
* External dependencies | ||
*/ | ||
import { isArray, isNumber, isString } from 'lodash'; | ||
import { isNumber, isString } from 'lodash'; | ||
@@ -17,3 +17,3 @@ /** | ||
if ( isString( element ) || isArray( element ) ) { | ||
if ( isString( element ) || Array.isArray( element ) ) { | ||
return ! element.length; | ||
@@ -20,0 +20,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
378381
5238