|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
360 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | /**
|
|---|
| 3 | * @param {string} data
|
|---|
| 4 | * @return {string}
|
|---|
| 5 | */
|
|---|
| 6 | function encode(data) {
|
|---|
| 7 | return data
|
|---|
| 8 | .replace(/"/g, "'")
|
|---|
| 9 | .replace(/%/g, '%25')
|
|---|
| 10 | .replace(/</g, '%3C')
|
|---|
| 11 | .replace(/>/g, '%3E')
|
|---|
| 12 | .replace(/&/g, '%26')
|
|---|
| 13 | .replace(/#/g, '%23')
|
|---|
| 14 | .replace(/\s+/g, ' ');
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | const decode = decodeURIComponent;
|
|---|
| 18 | module.exports = { encode, decode };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.