UNPKG

ottoman

Version:
18 lines 681 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.canBePopulated = void 0; const is_debug_mode_1 = require("../is-debug-mode"); /** * Determine if a given field can be populated. */ const canBePopulated = (populate, fields) => { if (populate === '*' || fields.some((field) => populate === field || field === `\`${populate}\``)) { return true; } if ((0, is_debug_mode_1.isDebugMode)()) { console.warn(`Unable to populate field "${populate}", it is not available on select clause [${fields.join(', ')}]`); } return false; }; exports.canBePopulated = canBePopulated; //# sourceMappingURL=can-be-populated.js.map