* @memberOf module:zrender/core/util * @param {string} str string to be trimed * @return {string} trimed string
(str)
| 817 | * @return {string} trimed string |
| 818 | */ |
| 819 | function trim(str) { |
| 820 | if (str == null) { |
| 821 | return null; |
| 822 | } |
| 823 | else if (typeof str.trim === 'function') { |
| 824 | return str.trim(); |
| 825 | } |
| 826 | else { |
| 827 | return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); |
| 828 | } |
| 829 | } |
| 830 | |
| 831 | var primitiveKey = '__ec_primitive__'; |
| 832 | /** |
no test coverage detected