@lowdefy/build 0.0.0-experimental-20260113081624 → 0.0.0-experimental-20260113090459

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.
@@ -16,7 +16,7 @@
16
16
  function buildJs({ components, context }) {
17
17
  components.pages = components.pages.map((page)=>{
18
18
  const pageRequests = [
19
- ...page.requests
19
+ ...page.requests ?? []
20
20
  ];
21
21
  delete page.requests;
22
22
  const cleanPage = jsMapParser({
@@ -12,9 +12,18 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ import { serializer } from '@lowdefy/helpers';
15
+ */ import { serializer, type } from '@lowdefy/helpers';
16
+ import formatConfigError from '../utils/formatConfigError.js';
16
17
  async function writeRequestsOnPage({ page, context }) {
17
- return Promise.all(page.requests.map(async (request)=>{
18
+ const requests = page.requests ?? [];
19
+ if (!type.isArray(requests)) {
20
+ throw new Error(formatConfigError({
21
+ message: `Page requests must be an array. Received ${JSON.stringify(requests)}.`,
22
+ configKey: page['~k'],
23
+ context
24
+ }));
25
+ }
26
+ return Promise.all(requests.map(async (request)=>{
18
27
  await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, serializer.serializeToString(request ?? {}));
19
28
  delete request.properties;
20
29
  delete request.type;