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

Method validateIndex

src/components/modules/blockManager.ts:990–992  ·  view source on GitHub ↗

* Validates that the given index is not lower than 0 or higher than the amount of blocks * * @param {number} index - index of blocks array to validate * @returns {boolean}

(index: number)

Source from the content-addressed store, hash-verified

988 * @returns {boolean}
989 */
990 private validateIndex(index: number): boolean {
991 return !(index < 0 || index >= this._blocks.length);
992 }
993
994 /**
995 * Block mutation callback

Callers 2

removeBlockMethod · 0.95
moveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected