From 10d6be5f82fdfb9270f7561d20c0d788679aa479 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 17 Aug 2024 15:00:54 +0200 Subject: [PATCH] Platform independent path validation --- src/index.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.test.ts b/src/index.test.ts index a94c4c1..b4831ce 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -17,4 +17,8 @@ describe('safe path', () => { it('accept happy path', () => { expect(safePath('./uplodas', 'foobar')).toBe(true); }); + + it('accept names starting with `..`', () => { + expect(safePath('./uplodas', '..foobar')).toBe(true); + }); });