mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
14 lines
385 B
JavaScript
14 lines
385 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
export default function endsWith(subject: string, search: string): boolean {
|
|
const length = subject.length;
|
|
return subject.substring(length - search.length, length) === search;
|
|
}
|