UNPKG

ravendb

Version:
29 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CountersIndexDefinitionBuilder = void 0; const CountersIndexDefinition_js_1 = require("./CountersIndexDefinition.js"); const AbstractIndexDefinitionBuilder_js_1 = require("../AbstractIndexDefinitionBuilder.js"); const index_js_1 = require("../../../Exceptions/index.js"); class CountersIndexDefinitionBuilder extends AbstractIndexDefinitionBuilder_js_1.AbstractIndexDefinitionBuilder { map; constructor(indexName) { super(indexName); } _newIndexDefinition() { return new CountersIndexDefinition_js_1.CountersIndexDefinition(); } toIndexDefinition(conventions, validateMap = true) { if (!this.map && validateMap) { (0, index_js_1.throwError)("InvalidArgumentException", "Map is required to generate an index, you cannot create an index without a valid Map property (in index " + this._indexName + ")."); } return super.toIndexDefinition(conventions, validateMap); } _toIndexDefinition(indexDefinition, conventions) { if (!this.map) { return; } indexDefinition.maps.add(this.map); } } exports.CountersIndexDefinitionBuilder = CountersIndexDefinitionBuilder; //# sourceMappingURL=CountersIndexDefinitionBuilder.js.map