imodel 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.mts +1 -1
- package/index.mjs +6 -5
- package/migrate.d.mts +1 -1
- package/migrate.mjs +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* imodel v0.17.
|
|
2
|
+
* imodel v0.17.1
|
|
3
3
|
* (c) 2019-2026 undefined
|
|
4
4
|
* @license undefined
|
|
5
5
|
*/
|
|
@@ -2136,12 +2136,12 @@ function getSelectFields(select, columns, tableFields, baseFieldSet) {
|
|
|
2136
2136
|
* @param {TableConnection} conn
|
|
2137
2137
|
* @param {any[]} list
|
|
2138
2138
|
* @param {[string, FieldDefine<TableDefine>][]} fields
|
|
2139
|
-
* @param {Set<string>}
|
|
2139
|
+
* @param {Set<string>} baseParentFieldSet
|
|
2140
2140
|
* @param {Environment} env
|
|
2141
2141
|
* @param {Record<string, string[] | undefined>?} [returnFields]
|
|
2142
2142
|
* @returns {Promise<any[]>}
|
|
2143
2143
|
*/
|
|
2144
|
-
async function findSub(conn, list, fields,
|
|
2144
|
+
async function findSub(conn, list, fields, baseParentFieldSet, env, returnFields) {
|
|
2145
2145
|
if (!list.length) {
|
|
2146
2146
|
return list;
|
|
2147
2147
|
}
|
|
@@ -2163,7 +2163,7 @@ async function findSub(conn, list, fields, baseFieldSet, env, returnFields) {
|
|
|
2163
2163
|
if (returnFields && !fieldMap) {
|
|
2164
2164
|
continue;
|
|
2165
2165
|
}
|
|
2166
|
-
const mapList = getMapList(fields,
|
|
2166
|
+
const mapList = getMapList(fields, baseParentFieldSet, constraints);
|
|
2167
2167
|
if (!mapList) {
|
|
2168
2168
|
continue;
|
|
2169
2169
|
}
|
|
@@ -2172,6 +2172,7 @@ async function findSub(conn, list, fields, baseFieldSet, env, returnFields) {
|
|
|
2172
2172
|
const [columns, fieldColumns, tableFields] = toColumns(fields);
|
|
2173
2173
|
const noColumn = noField && fieldColumns ? fieldColumns[noField] : noField;
|
|
2174
2174
|
const where = [subList2where(list, mapList, fieldColumns), ...getValueWhere(constraints, columns, fieldColumns)];
|
|
2175
|
+
const baseFieldSet = new Set(Object.keys(fieldColumns || columns));
|
|
2175
2176
|
const selected = fieldMap && getSelectFields(fieldMap[''] || [], columns, tableFields, baseFieldSet) || null;
|
|
2176
2177
|
const select = select2column(columns, fieldColumns, selected && [...selected, ...mapList.map(v => v[0])]);
|
|
2177
2178
|
/** @type {SelectItem[]} */
|
|
@@ -2186,7 +2187,7 @@ async function findSub(conn, list, fields, baseFieldSet, env, returnFields) {
|
|
|
2186
2187
|
}];
|
|
2187
2188
|
/** @type {PromiseLike<object[]>} */
|
|
2188
2189
|
const result = table && typeof table === 'object' ? table.select(env, conn, selects) : conn.select(env, selects);
|
|
2189
|
-
let promise = result.then(list => findSub(conn, list, tableFields,
|
|
2190
|
+
let promise = result.then(list => findSub(conn, list, tableFields, baseFieldSet, env, fieldMap));
|
|
2190
2191
|
promises.push(array ? promise.then(subList => {
|
|
2191
2192
|
for (const item of list) {
|
|
2192
2193
|
item[key] = subList.filter(createFilter(item, mapList));
|
package/migrate.d.mts
CHANGED
package/migrate.mjs
CHANGED