source:
frontend/node_modules/unquote/index.js
| Last change on this file was 9af201e, checked in by , 12 days ago | |
|---|---|
|
|
| File size: 259 bytes | |
| Line | |
|---|---|
| 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.
