MCPcopy Index your code
hub / github.com/codex-team/editor.js / getBlockByIndex

Method getBlockByIndex

src/components/modules/blockManager.ts:655–661  ·  view source on GitHub ↗

* Returns Block by passed index * * @param {number} index - index to get. -1 to get last * @returns {Block}

(index: number)

Source from the content-addressed store, hash-verified

653 * @returns {Block}
654 */
655 public getBlockByIndex(index: number): Block | undefined {
656 if (index === -1) {
657 index = this._blocks.length - 1;
658 }
659
660 return this._blocks[index];
661 }
662
663 /**
664 * Returns an index for passed Block

Callers 1

insertMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected