mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Dev: Expose snippets run api
This commit is contained in:
@@ -49,6 +49,15 @@ export default class Snippets extends Tool
|
||||
|
||||
return this;
|
||||
}
|
||||
run(name)
|
||||
{
|
||||
let snippets = this._snippets;
|
||||
|
||||
for (let i = 0, len = snippets.length; i < len; i++)
|
||||
{
|
||||
if (snippets[i].name === name) this._run(i);
|
||||
}
|
||||
}
|
||||
clear()
|
||||
{
|
||||
this._snippets = [];
|
||||
|
||||
Reference in New Issue
Block a user