From b20539ef2b5b1c71cacf2dfa587785409158a43a Mon Sep 17 00:00:00 2001 From: coderiaser Date: Wed, 18 Feb 2026 19:40:55 +0200 Subject: [PATCH] feature: common: entity: encode {,} --- common/cloudfunc.spec.js | 2 +- common/entity.js | 2 ++ common/entity.spec.js | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/cloudfunc.spec.js b/common/cloudfunc.spec.js index 4df48712..ec991f16 100644 --- a/common/cloudfunc.spec.js +++ b/common/cloudfunc.spec.js @@ -172,7 +172,7 @@ test('cloudfunc: buildFromJSON: showDotFiles: false', (t) => { t.end(); }); -test('cloudfunc: buildFromJSON: showDotFiles: false', (t) => { +test('cloudfunc: buildFromJSON: name: {{ }}', (t) => { const data = { path: '/media/', files: [{ diff --git a/common/entity.js b/common/entity.js index d8f4a214..690bbd7a 100644 --- a/common/entity.js +++ b/common/entity.js @@ -2,6 +2,8 @@ const Entities = { '<': '<', '>': '>', '"': '"', + '{': '{', + '}': '}', }; const keys = Object.keys(Entities); diff --git a/common/entity.spec.js b/common/entity.spec.js index ca62d705..a9f2e7d1 100644 --- a/common/entity.spec.js +++ b/common/entity.spec.js @@ -9,6 +9,14 @@ test('cloudcmd: entity: encode', (t) => { t.end(); }); +test('cloudcmd: entity: {{}}', (t) => { + const result = entity.encode('{{}}'); + const expected = '{{}}'; + + t.equal(result, expected, 'should encode entity'); + t.end(); +}); + test('cloudcmd: entity: decode', (t) => { const result = entity.decode('<hello> '); const expected = ' ';