-
-
Notifications
You must be signed in to change notification settings - Fork 519
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently path is being monkey patched
orval/packages/core/src/utils/path.ts
Lines 26 to 44 in c658fa3
| for (const [propName, propValue] of Object.entries(basepath)) { | |
| if (isFunction(propValue)) { | |
| // @ts-ignore | |
| path[propName] = ((propName) => { | |
| return (...args: any[]) => { | |
| args = args.map((p) => { | |
| return isString(p) ? toUnix(p) : p; | |
| }); | |
| // @ts-ignore | |
| const result = basepath[propName](...args); | |
| return isString(result) ? toUnix(result) : result; | |
| }; | |
| })(propName); | |
| } else { | |
| // @ts-ignore | |
| path[propName] = propValue; | |
| } | |
| } |
While this works, it muddy the waters
Example:
// example A
import path from 'node:path';// example B
import path from 'node:path';
import { upath } from '../utils';Using path will do different things in example A and B.
I took a stab at it a while back, but it's non-obvious (to me) where the real path and the monkey patched path is being used so I focused on other things 😄
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request