arrayiffy-if-string

Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.

MIT 148 个版本
安装
npm install arrayiffy-if-string
yarn add arrayiffy-if-string
pnpm add arrayiffy-if-string
bun add arrayiffy-if-string
README

arrayiffy-if-string

Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.

page on codsen.com page on npm page on github Downloads per month changelog MIT Licence

Install

This package is pure ESM. If you're not ready yet, install an older version of this program, 3.14.0 (npm i arrayiffy-if-string@3.14.0).

npm i arrayiffy-if-string

Quick Take

import { strict as assert } from "assert";

import { arrayiffy } from "arrayiffy-if-string";

assert.deepEqual(arrayiffy("aaa"), ["aaa"]);

assert.deepEqual(arrayiffy(""), []);

assert.equal(arrayiffy(true), true);

assert.equal(arrayiffy(), undefined);

Documentation

Please visit codsen.com for a full description of the API.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License

Copyright © 2010-2025 Roy Revelt and other contributors

Thanks to KRyan for types https://stackoverflow.com/a/71834598/3943954

ok codsen star

版本列表
5.1.3 2026-01-15
5.1.0 2025-10-15
5.0.21 2025-10-12
5.0.20 2025-10-08
5.0.19 2025-10-07
5.0.10 2025-03-02
5.0.8 2024-01-05
5.0.7 2023-12-20
5.0.6 2023-07-14
5.0.5 2023-04-12
5.0.4 2023-03-12
5.0.3 2022-12-22
5.0.2 2022-12-06
5.0.1 2022-12-06
5.0.0 2022-12-01
4.1.6 2022-11-03
4.1.5 2022-11-02
4.1.4 2022-10-31
4.1.3 2022-10-23
4.1.2 2022-10-22
4.1.1 2022-08-18
4.1.0 2022-08-12
4.0.15 2022-07-05
4.0.14 2022-05-04
4.0.13 2022-04-18
4.0.12 2022-01-22
4.0.11 2022-01-11
4.0.10 2021-12-24
4.0.7 2021-11-30
4.0.6 2021-11-22
4.0.5 2021-11-08
4.0.4 2021-11-04
4.0.3 2021-11-02
4.0.2 2021-09-20
4.0.1 2021-09-13
4.0.0 2021-09-09
3.14.0 2021-05-24
3.13.16 2021-04-14
3.13.15 2021-04-11
3.13.14 2021-04-04
3.13.13 2021-04-03
3.13.12 2021-03-31
3.13.11 2021-03-28
3.13.10 2021-03-25
3.13.9 2021-03-23
3.13.8 2021-03-14
3.13.7 2021-03-07
3.13.6 2021-02-27
3.13.5 2021-02-14
3.13.4 2021-02-09
3.13.3 2021-02-07
3.13.2 2021-01-28
3.13.1 2021-01-28
3.13.0 2021-01-23
3.12.0 2020-11-28
3.11.39 2020-11-10
3.11.38 2020-09-27
3.11.37 2020-09-25
3.11.36 2020-09-24
3.11.35 2020-09-07
3.11.34 2020-08-16
3.11.33 2020-08-08
3.11.32 2020-05-08
3.11.31 2020-05-06
3.11.30 2020-04-26
3.11.29 2020-04-13
3.11.28 2020-04-04
3.11.27 2020-01-27
3.11.26 2019-12-14
3.11.25 2019-12-09
3.11.24 2019-11-27
3.11.23 2019-11-18
3.11.22 2019-11-11
3.11.21 2019-10-25
3.11.20 2019-10-23
3.11.19 2019-10-21
3.11.18 2019-10-05
3.11.17 2019-10-02
3.11.16 2019-09-17
3.11.15 2019-09-11
3.11.14 2019-09-04
3.11.13 2019-08-26
3.11.12 2019-08-24
3.11.11 2019-08-18
3.11.10 2019-08-15
3.11.9 2019-08-08
3.11.8 2019-07-29
3.11.7 2019-07-25
3.11.5 2019-07-24
3.11.4 2019-07-19
3.11.2 2019-07-15
3.11.1 2019-07-06
3.11.0 2019-06-29
3.10.26 2019-06-21
3.10.25 2019-06-18
3.10.24 2019-06-01
3.10.23 2019-06-01
3.10.22 2019-06-01
3.10.21 2019-04-10
3.10.20 2019-04-06
3.10.19 2019-03-22
3.10.18 2019-03-22
3.10.17 2019-03-17
3.10.16 2019-03-17
3.10.15 2019-03-17
3.10.14 2019-03-17
3.10.13 2019-03-17
3.10.12 2019-03-10
3.10.9 2019-03-04
3.10.8 2019-02-26
3.10.7 2019-02-10
3.10.6 2019-02-05
3.10.5 2019-02-01
3.10.4 2019-01-31
3.10.3 2019-01-28
3.10.2 2019-01-27
3.10.0 2019-01-20
3.9.3 2019-01-16
3.9.2 2019-01-16
3.9.1 2019-01-13
3.9.0 2019-01-11
3.5.0 2019-01-08
3.4.8 2019-01-02
3.4.7 2019-01-01
3.4.6 2018-12-29
3.4.5 2018-12-29
3.4.4 2018-12-27
3.4.3 2018-12-27
3.4.2 2018-12-26
3.4.1 2018-10-15
3.4.0 2018-10-12
3.3.3 2018-06-24
3.3.2 2018-06-19
3.3.1 2018-06-15
3.3.0 2018-06-15
3.2.1 2018-05-26
3.2.0 2018-05-14
3.1.1 2018-05-01
3.1.0 2018-04-29
3.0.6 2018-01-27
3.0.5 2018-01-14
3.0.4 2017-12-24
3.0.3 2017-12-08
3.0.2 2017-11-22
3.0.1 2017-11-22
3.0.0 2017-11-22
1.0.2 2017-07-29
1.0.1 2017-05-22