Skip to content

如果是字符串,并且非空(`''`),则返回 `true`,否则 `false`。

License

Notifications You must be signed in to change notification settings

iyowei/not-empty-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notEmptyString(str)

如果是字符串,并且非空(''),则返回 true,否则 false

使用

import notEmptyString from '@iyowei/esm-not-empty-string';

console.log('notEmptyString("")', notEmptyString("")); // false
console.log('notEmptyString("text")', notEmptyString("text")); // true

console.log("notEmptyString(true)", notEmptyString(true)); // false
console.log("notEmptyString(1)", notEmptyString(1)); // false
console.log('notEmptyString(NaN)', notEmptyString(NaN)); // false
console.log('notEmptyString(null)', notEmptyString(null)); // false

安装

Node version

# Pnpm
pnpm add @iyowei/not-empty-string

# yarn
yarn add @iyowei/not-empty-string

# npm
npm add @iyowei/not-empty-string

参与贡献

PRs Welcome

About

如果是字符串,并且非空(`''`),则返回 `true`,否则 `false`。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published