From 9227714e90e7dd293e3d984c29d221361c15f6eb Mon Sep 17 00:00:00 2001 From: ld-codes <123950213+ld-codes@users.noreply.github.com> Date: Fri, 17 Mar 2023 21:40:05 +0800 Subject: [PATCH] fix: change member variables visibility --- src/Property.ts | 2 +- src/Resource.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Property.ts b/src/Property.ts index c44864c6..a6aff8aa 100644 --- a/src/Property.ts +++ b/src/Property.ts @@ -5,7 +5,7 @@ import { DATA_TYPES } from './utils/data-types' export class Property extends BaseProperty { public column: ColumnMetadata; - private columnPosition: number; + protected columnPosition: number; constructor(column: ColumnMetadata, columnPosition = 0) { const path = column.propertyPath diff --git a/src/Resource.ts b/src/Resource.ts index 8f3f47d2..8bfe3f0a 100644 --- a/src/Resource.ts +++ b/src/Resource.ts @@ -11,9 +11,9 @@ type ParamsType = Record; export class Resource extends BaseResource { public static validate: any; - private model: typeof BaseEntity; + protected model: typeof BaseEntity; - private propsObject: Record = {}; + protected propsObject: Record = {}; constructor(model: typeof BaseEntity) { super(model) @@ -135,7 +135,7 @@ export class Resource extends BaseResource { } } - private prepareProps() { + protected prepareProps() { const { columns } = this.model.getRepository().metadata return columns.reduce((memo, col, index) => { const property = new Property(col, index) @@ -147,7 +147,7 @@ export class Resource extends BaseResource { } /** Converts params from string to final type */ - private prepareParams(params: Record): Record { + protected prepareParams(params: Record): Record { const preparedParams: Record = { ...params } this.properties().forEach((property) => {