|
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:
259 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | var reg = /[\'\"]/
|
|---|
| 2 |
|
|---|
| 3 | module.exports = function unquote(str) {
|
|---|
| 4 | if (!str) {
|
|---|
| 5 | return ''
|
|---|
| 6 | }
|
|---|
| 7 | if (reg.test(str.charAt(0))) {
|
|---|
| 8 | str = str.substr(1)
|
|---|
| 9 | }
|
|---|
| 10 | if (reg.test(str.charAt(str.length - 1))) {
|
|---|
| 11 | str = str.substr(0, str.length - 1)
|
|---|
| 12 | }
|
|---|
| 13 | return str
|
|---|
| 14 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.