UNPKG

scriptable-testlab

Version:

A lightweight, efficient tool designed to manage and update scripts for Scriptable.

30 lines 1.27 kB
import * as ScriptableAbstracts from "scriptable-abstract"; import { Scriptable } from "scriptable-abstract"; import * as MockImplementations from "."; const isScriptableImplementation = (implementation) => { return typeof implementation === "function" && implementation.prototype instanceof Scriptable && "identifier" in implementation && "type" in implementation && "states" in implementation && "classInitializers" in implementation; }; const ABS_IMPLEMENTATIONS = Object.keys(ScriptableAbstracts).filter((key) => key.startsWith("Abs")).map((key) => ScriptableAbstracts[key]); const MOCK_IMPLEMENTATIONS = Object.values(MockImplementations).filter(isScriptableImplementation); const SCRIPTABLE_IMPLEMENTATIONS = [ ...ABS_IMPLEMENTATIONS, ...MOCK_IMPLEMENTATIONS ].reduce( (acc, implementation) => { acc[implementation.identifier] = implementation; return acc; }, {} ); const GLOBAL_CLASSES = Object.values(SCRIPTABLE_IMPLEMENTATIONS).filter( (implementation) => implementation.type === "class" ); const GLOBAL_VARIABLES = Object.values(SCRIPTABLE_IMPLEMENTATIONS).filter( (implementation) => implementation.type === "variable" ); export { GLOBAL_CLASSES, GLOBAL_VARIABLES, SCRIPTABLE_IMPLEMENTATIONS }; //# sourceMappingURL=registry.js.map