Skip to content

fix: %f{depth} filename separator#1061

Closed
crgmz wants to merge 1 commit intolog4js-node:masterfrom
crgmz:fix/filename-depth
Closed

fix: %f{depth} filename separator#1061
crgmz wants to merge 1 commit intolog4js-node:masterfrom
crgmz:fix/filename-depth

Conversation

@crgmz
Copy link
Copy Markdown

@crgmz crgmz commented Feb 22, 2021

Changed the split parameter to capture both \ and / separators inside array, and then modified the join expression to account for the extra elements in the array. Also removed path import as it's not longer needed.

Related to #1060

@crgmz crgmz changed the title fix: f%{depth} filename separator fix: %f{depth} filename separator Feb 22, 2021
@crgmz crgmz force-pushed the fix/filename-depth branch from 27b2ec3 to 6be872a Compare February 22, 2021 18:51
@crgmz crgmz force-pushed the fix/filename-depth branch from 6268846 to be7c6ba Compare February 22, 2021 20:25
@lamweili
Copy link
Copy Markdown
Contributor

lamweili commented Jan 4, 2022

As explained in #1060, I am unable to replicate the issue to warrant this PR.

There shouldn't be any need to hardcode the pattern \ and / as it is handled by path.sep.

path.sep

Added in: v0.7.9

Provides the platform-specific path segment separator:

  • \ on Windows
  • / on POSIX

For example, on POSIX:

'foo/bar/baz'.split(path.sep);
// Returns: ['foo', 'bar', 'baz']

On Windows:

'foo\\bar\\baz'.split(path.sep);
// Returns: ['foo', 'bar', 'baz']

On Windows, both the forward slash (/) and backward slash (\) are accepted as path segment separators; however, the path methods only add backward slashes (\).

(src: https://nodejs.org/api/path.html#pathsep)

@lamweili
Copy link
Copy Markdown
Contributor

This PR has been superseded by #1224.

@lamweili lamweili closed this Apr 10, 2022
@lamweili lamweili linked an issue Apr 10, 2022 that may be closed by this pull request
@lamweili lamweili added this to the 6.4.5 milestone Apr 12, 2022
@lamweili lamweili added the bug Something isn't working label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

%f{depth} filename separator

2 participants