@labdigital/commercetools-mock 2.22.1 → 2.23.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/dist/index.cjs CHANGED
@@ -1239,6 +1239,9 @@ var generateMatchFunc = (predicate) => {
1239
1239
  } else {
1240
1240
  const value = resolveValue(obj, left);
1241
1241
  if (value) {
1242
+ if (Array.isArray(value)) {
1243
+ return value.some((item) => expr(item, vars));
1244
+ }
1242
1245
  return expr(value, vars);
1243
1246
  }
1244
1247
  return false;
@@ -3262,7 +3265,11 @@ var CustomObjectRepository = class extends AbstractResourceRepository {
3262
3265
  ...params,
3263
3266
  where: whereClause
3264
3267
  });
3265
- result.results = result.results.map(this.postProcessResource);
3268
+ result.results = result.results.map(
3269
+ (r) => this.postProcessResource(context, r, {
3270
+ expand: params.expand
3271
+ })
3272
+ );
3266
3273
  return result;
3267
3274
  }
3268
3275
  };
@@ -3431,10 +3438,12 @@ var CustomerRepository = class extends AbstractResourceRepository {
3431
3438
  }
3432
3439
  const expiresAt = new Date(Date.now() + 30 * 60);
3433
3440
  const customer = results.results[0];
3434
- const { version: _, ...rest } = getBaseResourceProperties();
3441
+ const rest = getBaseResourceProperties();
3435
3442
  const token = createPasswordResetToken(customer);
3436
3443
  return {
3437
- ...rest,
3444
+ id: rest.id,
3445
+ createdAt: rest.createdAt,
3446
+ lastModifiedAt: rest.lastModifiedAt,
3438
3447
  customerId: customer.id,
3439
3448
  expiresAt: expiresAt.toISOString(),
3440
3449
  value: token