scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
65 lines • 3.04 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var registry_exports = {};
__export(registry_exports, {
GLOBAL_CLASSES: () => GLOBAL_CLASSES,
GLOBAL_VARIABLES: () => GLOBAL_VARIABLES,
SCRIPTABLE_IMPLEMENTATIONS: () => SCRIPTABLE_IMPLEMENTATIONS
});
module.exports = __toCommonJS(registry_exports);
var ScriptableAbstracts = __toESM(require("scriptable-abstract"));
var import_scriptable_abstract = require("scriptable-abstract");
var MockImplementations = __toESM(require("."));
const isScriptableImplementation = (implementation) => {
return typeof implementation === "function" && implementation.prototype instanceof import_scriptable_abstract.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"
);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GLOBAL_CLASSES,
GLOBAL_VARIABLES,
SCRIPTABLE_IMPLEMENTATIONS
});
//# sourceMappingURL=registry.js.map