Skip to content

Parser identifies ~lib/rt/index-full as SourceKind.USER_ENTRY #889

Closed
@sampaioletti

Description

@sampaioletti

While playing with the transform option I noticed the ~lib/rt/index-full source is recognized as SourceKind.USER_ENTRY as is my user generated entry file, I would have thought it would be SourceKind.LIBRARY

If that is the intended classification how would one determine the difference between a user file in this scenario

It is classified as such due to the following

//taken from src/parser.ts:140
//path= ~lib/rt/index-full
path.indexOf(PATH_DELIMITER, LIBRARY_PREFIX.length) < 0 
//results in 7<0=false

var source = new Source(
normalizedPath,
text,
isEntry
? SourceKind.USER_ENTRY
: path.startsWith(LIBRARY_PREFIX)
? path.indexOf(PATH_DELIMITER, LIBRARY_PREFIX.length) < 0
? SourceKind.LIBRARY_ENTRY
: SourceKind.LIBRARY
: SourceKind.USER
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions