-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use array to store paths (#303)
* feat: use array to store paths * refactor: change reverse loops to normal loops * test: add override members test
- Loading branch information
1 parent
f7e89d6
commit d201093
Showing
49 changed files
with
715 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
packages/classes/src/lib/utils/is-destination-path-on-source.util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export function isDestinationPathOnSource( | ||
sourceProto: Record<string, unknown> | ||
) { | ||
return (sourceObj: any, sourcePath: string) => { | ||
return !( | ||
!sourceObj.hasOwnProperty(sourcePath) && | ||
!sourceProto.hasOwnProperty(sourcePath) && | ||
!Object.getPrototypeOf(sourceObj).hasOwnProperty(sourcePath) | ||
return (sourceObj: any, sourcePath: string[]) => { | ||
return sourcePath.length === 1 && !( | ||
!sourceObj.hasOwnProperty(sourcePath[0]) && | ||
!sourceProto.hasOwnProperty(sourcePath[0]) && | ||
!Object.getPrototypeOf(sourceObj).hasOwnProperty(sourcePath[0]) | ||
); | ||
}; | ||
} |
10 changes: 5 additions & 5 deletions
10
packages/classes/src/lib/utils/is-multipart-source-paths-in-source.util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { isClass } from './is-class.util'; | ||
|
||
export function isMultipartSourcePathsInSource( | ||
dottedSourcePaths: string[], | ||
sourcePaths: string[], | ||
sourceInstance: Record<string, unknown> | ||
) { | ||
return !( | ||
dottedSourcePaths.length > 1 && | ||
(!sourceInstance.hasOwnProperty(dottedSourcePaths[0]) || | ||
(sourceInstance[dottedSourcePaths[0]] && | ||
sourcePaths.length > 1 && | ||
(!sourceInstance.hasOwnProperty(sourcePaths[0]) || | ||
(sourceInstance[sourcePaths[0]] && | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
isClass((sourceInstance[dottedSourcePaths[0]] as unknown) as Function))) | ||
isClass((sourceInstance[sourcePaths[0]]) as Function))) | ||
); | ||
} |
Oops, something went wrong.