new PathRetriever()

Members


<static> DEFAULT_RESOURCE

Properties
Name Type Description
DEFAULT_RESOURCE string

<static> PATH_RESOURCE_MATCHER

Description
Uri path resource matcher
Properties
Name Type Description
PATH_RESOURCE_MATCHER RegExp

Methods


<static> find( settings, prefix [, cwd ] ) → {string}

Description
Find first possible existing path for the given settings
Parameters
Name Type Attributes Default Description
settings Object Path Seek Settings Object
Name Type Attributes Default Description
target string <optional>
'' Target resource path
ext string | Array.<string> <optional>
'json' Mock target extension to find
prefix string Mock prefix: {PATH}.{PREFIX}.{EXT}
cwd string <optional>
process.cwd() Current Working Directory: Path to seek for resources
Returns
Existing resource path

<generator, static> partialSearch( relativePath ) → {Array.<Array.<string>>}

Description
Returns a list of all possible paths, for the given resource, sorted by priority
Parameters
Name Type Description
relativePath Array.<string> Target resource path array
Returns
List of possible paths

<generator, static> seekPathList( settings, prefix ) → {Array.<string>}

Description
Returns a list of all possible paths, for the given resource settings, sorted by priority
Parameters
Name Type Description
settings Object Path Seek Settings Object
Name Type Attributes Default Description
target string Target resource path
ext string | Array.<string> <optional>
'json' Mock target extension to find
prefix string Mock prefix: {PATH}.{PREFIX}.{EXT}
Returns
List of possible paths