__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
export type Block = {
attributes?: object;
clientId?: string;
innerBlocks?: Block[];
isValid?: boolean;
name?: string;
originalContent?: string;
};
const omitClientId = ( block: Block ): Block => {
delete block.clientId;
for ( const child of block.innerBlocks ?? [] ) {
omitClientId( child );
}
return block;
};
const copyBlock = ( block: Block ): Block => JSON.parse( JSON.stringify( block ) );
const copyBlockWithoutClientId = ( block: Block ) => omitClientId( copyBlock( block ) );
/**
* Deeply compares two blocks, ignoring the clientId property.
*
* @param {Block} blockA - The first block to compare.
* @param {Block} blockB - The second block to compare.
* @returns {boolean} Whether the two blocks are equal.
*/
export function compareBlocks( blockA: Block, blockB: Block ): boolean {
const aCopy = copyBlockWithoutClientId( blockA );
const bCopy = copyBlockWithoutClientId( blockB );
return JSON.stringify( aCopy ) === JSON.stringify( bCopy );
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| block-content.ts | File | 2.31 KB | 0644 |
|
| compare-blocks.ts | File | 982 B | 0644 |
|
| fix-incomplete-html.ts | File | 154 B | 0644 |
|