@stackbit/sdk 0.2.28 → 0.2.31
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/dist/analyzer/analyze-schema-types.d.ts +3 -2
- package/dist/analyzer/analyze-schema-types.js.map +1 -1
- package/dist/analyzer/schema-generator.js +4 -1
- package/dist/analyzer/schema-generator.js.map +1 -1
- package/dist/config/config-loader.js +17 -20
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-schema.js +5 -0
- package/dist/config/config-schema.js.map +1 -1
- package/dist/config/config-types.d.ts +9 -3
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +2 -1
- package/dist/consts.js.map +1 -1
- package/dist/content/content-loader.js +1 -1
- package/dist/content/content-loader.js.map +1 -1
- package/dist/content/content-validator.js +5 -5
- package/dist/content/content-validator.js.map +1 -1
- package/dist/utils/model-iterators.d.ts +5 -0
- package/dist/utils/model-matcher.js +5 -5
- package/dist/utils/model-matcher.js.map +1 -1
- package/dist/utils/model-utils.d.ts +6 -1
- package/package.json +4 -3
- package/src/analyzer/analyze-schema-types.ts +3 -0
- package/src/analyzer/schema-generator.ts +4 -1
- package/src/config/config-loader.ts +20 -27
- package/src/config/config-schema.ts +6 -0
- package/src/config/config-types.ts +10 -3
- package/src/consts.ts +1 -0
- package/src/content/content-loader.ts +13 -6
- package/src/content/content-validator.ts +4 -4
- package/src/utils/model-matcher.ts +6 -6
- package/src/.DS_Store +0 -0
|
@@ -69,7 +69,7 @@ export function getModelsByQuery(query: ModelQuery, models: Model[]): Model[] {
|
|
|
69
69
|
(
|
|
70
70
|
modelGroups: {
|
|
71
71
|
byFile: Model[];
|
|
72
|
-
|
|
72
|
+
byType: Model[];
|
|
73
73
|
byGlob: Model[];
|
|
74
74
|
},
|
|
75
75
|
model
|
|
@@ -77,7 +77,7 @@ export function getModelsByQuery(query: ModelQuery, models: Model[]): Model[] {
|
|
|
77
77
|
if (_.has(model, 'file')) {
|
|
78
78
|
modelGroups.byFile.push(model);
|
|
79
79
|
} else if (objectType && _.has(model, modelTypeKeyPath)) {
|
|
80
|
-
modelGroups.
|
|
80
|
+
modelGroups.byType.push(model);
|
|
81
81
|
} else {
|
|
82
82
|
modelGroups.byGlob.push(model);
|
|
83
83
|
}
|
|
@@ -85,7 +85,7 @@ export function getModelsByQuery(query: ModelQuery, models: Model[]): Model[] {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
byFile: [],
|
|
88
|
-
|
|
88
|
+
byType: [],
|
|
89
89
|
byGlob: []
|
|
90
90
|
}
|
|
91
91
|
);
|
|
@@ -105,13 +105,13 @@ export function getModelsByQuery(query: ModelQuery, models: Model[]): Model[] {
|
|
|
105
105
|
return fileMatchedModels;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const
|
|
108
|
+
const typeMatchedModels = _.filter(modelMatchGroups.byType, (model) => {
|
|
109
109
|
const modelType = _.get(model, modelTypeKeyPath);
|
|
110
110
|
return objectType === modelType;
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
if (!_.isEmpty(
|
|
114
|
-
return
|
|
113
|
+
if (!_.isEmpty(typeMatchedModels)) {
|
|
114
|
+
return typeMatchedModels;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
return _.filter(modelMatchGroups.byGlob, (model) => {
|
package/src/.DS_Store
DELETED
|
Binary file
|