mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-17 16:38:18 +00:00
feature: common: entity: encode {,}
This commit is contained in:
parent
7ef134f46f
commit
b20539ef2b
3 changed files with 11 additions and 1 deletions
|
|
@ -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: [{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ const Entities = {
|
|||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'{': '{',
|
||||
'}': '}',
|
||||
};
|
||||
|
||||
const keys = Object.keys(Entities);
|
||||
|
|
|
|||
|
|
@ -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 = '<hello> ';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue