mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-29 08:14:28 +08:00
13 lines
310 B
JavaScript
13 lines
310 B
JavaScript
const HAS_EMPTY_LINE = /\n[\r\t ]*\n/;
|
|
|
|
/**
|
|
* Check if a string contains at least one empty line
|
|
*
|
|
* @param {string | undefined} string
|
|
* @returns {boolean}
|
|
*/
|
|
export default function hasEmptyLine(string) {
|
|
if (string === '' || string === undefined) return false;
|
|
|
|
return HAS_EMPTY_LINE.test(string);
|
|
}
|