Skip to content

Commit cf8eafd

Browse files
committed
fix: fix build errors for TypeScript 4.7.x
Signed-off-by: Raymond Feng <[email protected]>
1 parent fa71a4b commit cf8eafd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/repository-json-schema/src/build-schema.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ function getDescriptionSuffix<T extends object>(
397397
tsType = `Partial<${tsType}>`;
398398
}
399399
if (options.exclude) {
400-
const excludedProps = options.exclude.map(p => `'${p}'`);
400+
const excludedProps = options.exclude.map(p => `'${String(p)}'`);
401401
tsType = `Omit<${tsType}, ${excludedProps.join(' | ')}>`;
402402
}
403403
if (options.optional) {
404-
const optionalProps = options.optional.map(p => `'${p}'`);
404+
const optionalProps = options.optional.map(p => `'${String(p)}'`);
405405
tsType = `@loopback/repository-json-schema#Optional<${tsType}, ${optionalProps.join(
406406
' | ',
407407
)}>`;

packages/repository/src/__tests__/unit/model/model.unit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ describe('model', () => {
359359
const aDate = new Date();
360360
const customer = createCustomerWithContactAndDate(aDate);
361361
Object.assign(customer, {unknown: 'abc'});
362-
Object.assign(customer.address, {unknown: 'xyz'});
362+
Object.assign(customer.address!, {unknown: 'xyz'});
363363
expect(customer.toObject()).to.eql({
364364
id: '123',
365365

0 commit comments

Comments
 (0)