Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve Alias Path #33

Closed
wants to merge 7 commits into from
Closed

Retrieve Alias Path #33

wants to merge 7 commits into from

Conversation

codewith-luke
Copy link

Change

Added a method that will take a alias as a string, validate that it exists in the moduleAliase's object. and that it is of type string. This will then return the relevant path for that alias.

Reason

We came across the need in our express/typescript environment to create dynamic imports as well as fs read processes. These file paths are not imported and change depending on the environment. This will you to use the registered aliases outside of a import or require.

Luke Babich added 2 commits September 18, 2018 16:24
This will retrieve an alias's path from the moduleAliases object
@barkdoll
Copy link

I would love to see this merged. I used it to debug and it worked great.

@codewith-luke
Copy link
Author

codewith-luke commented Dec 17, 2018

I would love to see this merged too. Any update on this?

@ilearnio ilearnio self-requested a review February 10, 2019 18:59
test/specs.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
test/specs.js Outdated Show resolved Hide resolved
test/specs.js Outdated
})

it('should throw when alias is not a string', function () {
var expected = '[123]: is not of type string';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var expected = '[123]: is not of type string';
var expected = '"123" is not of type string'

@codewith-luke
Copy link
Author

On a note I think the travis linting is going to cause more issues than good. As we are running different IDE styleguides. It may be beneficial for you to run your proffered settings over the project

@ghost
Copy link

ghost commented Sep 25, 2020

@LukeInTheCloud, The time has passed and nothing changed. I think in that case is easier create another module called reverse-module-alias and make reverse alias/realpath conversions. :)

@codewith-luke codewith-luke closed this by deleting the head repository Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants