mirror of
https://github.com/status-im/consul.git
synced 2025-01-22 03:29:43 +00:00
9d21736e9f
* Add copyright headers to UI files * Ensure copywrite file ignores external libs
13 lines
288 B
JavaScript
13 lines
288 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
export default function rightTrim(str = '', search = '') {
|
|
const pos = str.length - search.length;
|
|
if (pos >= 0) {
|
|
return str.lastIndexOf(search) === pos ? str.substr(0, pos) : str;
|
|
}
|
|
return str;
|
|
}
|