UNPKG

552 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.batchDelegateToSchema = void 0;
4const getLoader_js_1 = require("./getLoader.js");
5function batchDelegateToSchema(options) {
6 const key = options.key;
7 if (key == null) {
8 return null;
9 }
10 else if (Array.isArray(key) && !key.length) {
11 return [];
12 }
13 const loader = (0, getLoader_js_1.getLoader)(options);
14 return Array.isArray(key) ? loader.loadMany(key) : loader.load(key);
15}
16exports.batchDelegateToSchema = batchDelegateToSchema;