/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/item-registry.js
22 строки
407 B
Rafael Oleza
Reformat all JS files using prettier
31 май 2019, 19:33
31 май 2019, 19:33
7f3f040
Код
Авторство
О чём код?
module.exports = class ItemRegistry { constructor() { this.items = new WeakSet(); } addItem(item) { if (this.hasItem(item)) { throw new Error( `The workspace can only contain one instance of item ${item}` ); } return this.items.add(item); } removeItem(item) { return this.items.delete(item); } hasItem(item) { return this.items.has(item); } };