Skip to content

Commit

Permalink
add cell metadata delete compatibility wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Oct 19, 2023
1 parent c613823 commit ba97130
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/jupyterlab-fonts/src/labcompat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ export function setCellMetadata(cellModel: ICellModel, key: string, value: any):
console.error('cell', cellModel);
throw new Error('no metadata for cell');
}

export function deleteMetadata(cellModel: ICellModel, key: string): void {
if (typeof cellModel.metadata.delete === 'function') {
return (cellModel as any).metadata.delete(key);
}

if (cellModel.sharedModel) {
return cellModel.sharedModel.deleteMetadata(key);
}

console.error('cell', cellModel);
throw new Error('no metadata for cell');
}

0 comments on commit ba97130

Please sign in to comment.