mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
style: change inline ifs to code blocks
This commit is contained in:
@@ -11,19 +11,20 @@ export class MetadataScanner {
|
|||||||
prototype: object | null,
|
prototype: object | null,
|
||||||
callback: (name: string) => R,
|
callback: (name: string) => R,
|
||||||
): R[] {
|
): R[] {
|
||||||
if (!prototype) return [];
|
if (!prototype) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const visitedNames = new Map<string, boolean>();
|
const visitedNames = new Map<string, boolean>();
|
||||||
const result: R[] = [];
|
const result: R[] = [];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
for (const property of Object.getOwnPropertyNames(prototype)) {
|
for (const property of Object.getOwnPropertyNames(prototype)) {
|
||||||
if (visitedNames.has(property)) continue;
|
if (visitedNames.has(property)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
visitedNames.set(property, true);
|
visitedNames.set(property, true);
|
||||||
|
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(prototype, property);
|
const descriptor = Object.getOwnPropertyDescriptor(prototype, property);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
descriptor.set ||
|
descriptor.set ||
|
||||||
descriptor.get ||
|
descriptor.get ||
|
||||||
@@ -34,7 +35,6 @@ export class MetadataScanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const value = callback(property);
|
const value = callback(property);
|
||||||
|
|
||||||
if (isNil(value)) {
|
if (isNil(value)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -52,19 +52,20 @@ export class MetadataScanner {
|
|||||||
*getAllFilteredMethodNames(
|
*getAllFilteredMethodNames(
|
||||||
prototype: object | null,
|
prototype: object | null,
|
||||||
): IterableIterator<string> {
|
): IterableIterator<string> {
|
||||||
if (!prototype) return [];
|
if (!prototype) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
const visitedNames = new Map<string, boolean>();
|
const visitedNames = new Map<string, boolean>();
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
for (const property of Object.getOwnPropertyNames(prototype)) {
|
for (const property of Object.getOwnPropertyNames(prototype)) {
|
||||||
if (visitedNames.has(property)) continue;
|
if (visitedNames.has(property)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
visitedNames.set(property, true);
|
visitedNames.set(property, true);
|
||||||
|
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(prototype, property);
|
const descriptor = Object.getOwnPropertyDescriptor(prototype, property);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
descriptor.set ||
|
descriptor.set ||
|
||||||
descriptor.get ||
|
descriptor.get ||
|
||||||
|
|||||||
Reference in New Issue
Block a user