From 318a7a941f411304216914632e98d515141ab362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Mon, 9 Oct 2023 22:01:49 +0200 Subject: [PATCH] feat(jslib): :recycle: eav helper getters for uplisting --- tools/upend_js/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/upend_js/index.ts b/tools/upend_js/index.ts index 8e49d63..de5fc44 100644 --- a/tools/upend_js/index.ts +++ b/tools/upend_js/index.ts @@ -27,6 +27,18 @@ export class UpListing { } return this._objects[address]; } + + public get entities(): string[] { + return Array.from(new Set(this.entries.map((e) => `@${e.entity}`))); + } + + public get attributes(): string[] { + return Array.from(new Set(this.entries.map((e) => e.attribute))); + } + + public get values(): IValue[] { + return Array.from(new Set(this.entries.map((e) => e.value))); + } } export class UpObject {