Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

fix: de/normalise all file separators in a string #92

Merged
merged 3 commits into from
May 26, 2019

Conversation

Shesekino
Copy link
Contributor

@Shesekino Shesekino commented May 23, 2019

  • Ready for review
  • Follows CONTRIBUTING rules
  • Any changes involving paths support all path separators
  • Reviewed by Snyk internal team

What does this PR do?

  • fix the way we normalise/denormalise path separators to be global
  • bundling the latest functions snapshot into the repo.
  • adjusting the e2e test as we're loading another package that is apparently vulnerable during the test.

@Shesekino Shesekino self-assigned this May 23, 2019
according to their docs (https://www.appveyor.com/docs/how-to/repository-shallow-clone/)
"If both clone_depth and shallow_clone exist in the config, clone_depth is ignored."
we're apparently mentioning both, so clone_depth is ignored - might as well remove it.
- copied the latest published snapshot
- adjusted tests as apparently there's another vulnerable package we're using in our tests
currently our tests fail on Windows because we neglect to normalise/denormalise all path separators.
when interacting with the local filesystem, we need to make sure to use the native separator (slash on linux, backslash on windows).
our normalising function used `string.prototype.replace(str, str)` which replaces only the first occurrence in a string.
this commit fixes it to the `string.prototype.replace(regex, str)` signature which, coupled with a global regex, replaces all occurences.

this commit isn't accompanied with a test since an existing test is already broken, and that test passing will be the proof of correctness.
@Shesekino Shesekino changed the title chore: bundling the latest functions snapshot into the repo fix: de/normalise all file separators in a string May 26, 2019
Copy link
Contributor

@talik077 talik077 left a comment

Choose a reason for hiding this comment

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

Looking good 👍 🥚 👍

@Shesekino Shesekino merged commit eee4a01 into master May 26, 2019
@Shesekino Shesekino deleted the chore/update_func_snapshot branch May 26, 2019 10:46
@snyksec
Copy link

snyksec commented May 26, 2019

🎉 This PR is included in version 1.45.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants