Skip to content

Commit

Permalink
rename getProperty method
Browse files Browse the repository at this point in the history
  • Loading branch information
shimataro committed Jan 2, 2025
1 parent 661799b commit 2094a4d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist-deno/libs/applySchemaObjectCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function applySchemaObjectCore<S extends SchemaObject>(schemaObject: S, d
for (const key of Object.keys(schemaObject)) {
const schema = schemaObject[key];
// A trick to call non-public properties/methods from the outside (like "friend" in C++)
const prop = schema["_getProperty"](key);
const prop = schema["_getPropertyName"](key);
appliedObject[key] = schema["_applyTo"](data[prop], errorHandler, [...keyStack, prop]);
}
if (hasError) {
Expand Down
2 changes: 1 addition & 1 deletion dist-deno/schemaClasses/BaseSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class BaseSchema<T = unknown> {
* @see Rules (appliers/map.ts)
* @protected in order to repress TS6133 error
*/
protected _getProperty(defaultProperty: string): string {
protected _getPropertyName(defaultProperty: string): string {
if (propName in this.rules) {
if (typeof this.rules[propName] === "string") {
return this.rules[propName];
Expand Down
2 changes: 1 addition & 1 deletion src/libs/applySchemaObjectCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function applySchemaObjectCore<S extends SchemaObject>(schemaObject: S, d
const schema = schemaObject[key];

// A trick to call non-public properties/methods from the outside (like "friend" in C++)
const prop = schema["_getProperty"](key);
const prop = schema["_getPropertyName"](key);
appliedObject[key] = schema["_applyTo"](data[prop], errorHandler, [...keyStack, prop]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/schemaClasses/BaseSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class BaseSchema<T = unknown>
* @see Rules (appliers/map.ts)
* @protected in order to repress TS6133 error
*/
protected _getProperty(defaultProperty: string): string
protected _getPropertyName(defaultProperty: string): string
{
if(propName in this.rules)
{
Expand Down

0 comments on commit 2094a4d

Please sign in to comment.