UNPKG

705 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.decorateDeriveSections = void 0;
4const api_derive_1 = require("@polkadot/api-derive");
5/**
6 * This is a section decorator which keeps all type information.
7 */
8function decorateDeriveSections(decorateMethod, derives) {
9 const getKeys = (s) => Object.keys(derives[s]);
10 const creator = (s, m) => decorateMethod(derives[s][m]);
11 const result = {};
12 const names = Object.keys(derives);
13 for (let i = 0, count = names.length; i < count; i++) {
14 (0, api_derive_1.lazyDeriveSection)(result, names[i], getKeys, creator);
15 }
16 return result;
17}
18exports.decorateDeriveSections = decorateDeriveSections;