refactor(core): use native String.prototype.trim if available