Socket
Socket
Sign inDemoInstall

arrayiffy-if-string

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrayiffy-if-string - npm Package Compare versions

Comparing version 3.11.34 to 3.11.35

4

dist/arrayiffy-if-string.cjs.js
/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.11.34
* Version: 3.11.35
* Author: Roy Revelt, Codsen Ltd
* License: MIT
* Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
* Homepage: https://codsen.com/os/arrayiffy-if-string/
*/

@@ -9,0 +9,0 @@

/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.11.34
* Version: 3.11.35
* Author: Roy Revelt, Codsen Ltd
* License: MIT
* Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
* Homepage: https://codsen.com/os/arrayiffy-if-string/
*/

@@ -9,0 +9,0 @@

/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.11.34
* Version: 3.11.35
* Author: Roy Revelt, Codsen Ltd
* License: MIT
* Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
* Homepage: https://codsen.com/os/arrayiffy-if-string/
*/

@@ -9,0 +9,0 @@

/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.11.34
* Version: 3.11.35
* Author: Roy Revelt, Codsen Ltd
* License: MIT
* Homepage: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
* Homepage: https://codsen.com/os/arrayiffy-if-string/
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).arrayiffyIfString=n()}(this,(function(){"use strict";return function(e){return"string"==typeof e?e.length>0?[e]:[]:e}}));
{
"name": "arrayiffy-if-string",
"version": "3.11.34",
"version": "3.11.35",
"description": "Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.",
"license": "MIT",
"repository": "https://gitlab.com/codsen/codsen/",
"homepage": "https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string",
"homepage": "https://codsen.com/os/arrayiffy-if-string/",
"author": {

@@ -42,3 +42,3 @@ "email": "roy@codsen.com",

"prepare": "npm run build",
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md}' --write --loglevel silent",
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
"republish": "npm publish || :",

@@ -48,2 +48,3 @@ "tap": "tap",

"test": "npm run lint && npm run unittest && npm run clean_cov && npm run format",
"tsd": "tsd",
"unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md && npm run clean_cov && npm run perf",

@@ -58,24 +59,3 @@ "version": "npm run build && git add ."

"lect": {
"babelrc": {
"override": false,
"set": false
},
"badges": {
"cov": true,
"deps": true,
"deps2d": true,
"dev": true,
"downloads": true,
"license": true,
"node": true,
"npm": true,
"overall": true,
"runkit": true,
"travis": true,
"vulnerabilities": true
},
"eslintrc": {
"add": [],
"remove": []
},
"defaultExported": true,
"files": {

@@ -96,6 +76,2 @@ "delete": [],

},
"header": {
"dontQuoteDescription": false,
"rightFloatedBadge": []
},
"licence": {

@@ -113,11 +89,7 @@ "extras": [

"req": "arrayiffy",
"typeSriptDefinitions": false,
"various": {
"back_to_top": {
"enabled": true,
"label": ""
},
"devDependencies": [
"benchmark"
],
"travisVersionsOverride": []
]
}

@@ -137,3 +109,3 @@ },

"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",

@@ -143,3 +115,3 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",

"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/preset-env": "^7.11.5",
"@rollup/plugin-babel": "^5.2.0",

@@ -150,11 +122,12 @@ "@rollup/plugin-commonjs": "^15.0.0",

"benchmark": "^2.1.4",
"eslint": "^7.7.0",
"lect": "^0.13.9",
"rollup": "^2.26.2",
"eslint": "^7.8.1",
"lect": "^0.13.11",
"rollup": "^2.26.10",
"rollup-plugin-ascii": "^0.0.3",
"rollup-plugin-banner": "^0.2.1",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-terser": "^7.0.0",
"tap": "^14.10.8"
"rollup-plugin-terser": "^7.0.2",
"tap": "^14.10.8",
"tsd": "^0.13.1"
}
}

@@ -5,17 +5,4 @@ # arrayiffy-if-string

[![Repository is on GitLab][gitlab-img]][gitlab-url]
[![Coverage][cov-img]][cov-url]
[![no dependencies][no-deps-img]][no-deps-url]
[![Downloads/Month][downloads-img]][downloads-url]
[![Test in browser][runkit-img]][runkit-url]
[![Code style: prettier][prettier-img]][prettier-url]
[![MIT License][license-img]][license-url]
<img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center">
## Table of Contents
- [Install](#install)
- [Idea](#idea)
- [Contributing](#contributing)
- [Licence](#licence)
## Install

@@ -27,81 +14,10 @@

The [_default_](https://exploringjs.com/es6/ch_modules.html#_default-exports-one-per-module) is exported, so instead of "`arrayiffy`" below, you can name the consumed function however you want.
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center">
Consume via a `require()`:
## Documentation
```js
const arrayiffy = require("arrayiffy-if-string");
```
Please [visit our documentation](https://codsen.com/os/arrayiffy-if-string/) for a full description of the API and examples.
or as an ES Module:
<img src="https://codsen.com/images/png-codsen-star.png" width="42" alt="star" align="center">
```js
import arrayiffy from "arrayiffy-if-string";
```
or for web pages, as a production-ready minified script file (so-called "UMD build"), straight from CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/arrayiffy-if-string/dist/arrayiffy-if-string.umd.js"></script>
```
```js
// in which case you get a global variable "arrayiffyIfString" which you consume like this:
const arrayiffy = arrayiffyIfString;
```
This package has three builds in `dist/` folder:
| Type | Key in `package.json` | Path | Size |
| ------------------------------------------------------------------------------------------------------- | --------------------- | --------------------------------- | ----- |
| Main export - **CommonJS version**, transpiled to ES5, contains `require` and `module.exports` | `main` | `dist/arrayiffy-if-string.cjs.js` | 518 B |
| **ES module** build that Webpack/Rollup understands. Untranspiled ES6 code with `import`/`export`. | `module` | `dist/arrayiffy-if-string.esm.js` | 501 B |
| **UMD build** for browsers, transpiled, minified, containing `iife`'s and has all dependencies baked-in | `browser` | `dist/arrayiffy-if-string.umd.js` | 597 B |
**[⬆ back to top](#)**
## Idea
- If it's a non-empty string, put it into an array and return it.
- If it's empty string, return an empty array.
- If it's anything else, just return it.
```js
const arrayiffy = require("arrayiffy-if-string");
var res = arrayiffy("aaa");
console.log("res = " + JSON.stringify(res, null, 4));
// => ['aaa']
```
```js
const arrayiffy = require("arrayiffy-if-string");
var res = arrayiffy("");
console.log("res = " + JSON.stringify(res, null, 4));
// => []
```
```js
const arrayiffy = require("arrayiffy-if-string");
var res = arrayiffy(true);
console.log("res = " + JSON.stringify(res, null, 4));
// => true
```
It's main purpose is to prepare the input argument options' objects. Check out `check-types-mini` on [npm](https://www.npmjs.com/package/check-types-mini), or on [GitLab](https://gitlab.com/codsen/codsen/tree/master/packages/check-types-mini).
**[⬆ back to top](#)**
## Contributing
- If you see an error, [raise an issue](<https://gitlab.com/codsen/codsen/issues/new?issue[title]=arrayiffy-if-string%20package%20-%20put%20title%20here&issue[description]=**Which%20package%20is%20this%20issue%20for**%3A%20%0Aarrayiffy-if-string%0A%0A**Describe%20the%20issue%20(if%20necessary)**%3A%20%0A%0A%0A%2Fassign%20%40revelt>).
- If you want a new feature but can't code it up yourself, also [raise an issue](<https://gitlab.com/codsen/codsen/issues/new?issue[title]=arrayiffy-if-string%20package%20-%20put%20title%20here&issue[description]=**Which%20package%20is%20this%20issue%20for**%3A%20%0Aarrayiffy-if-string%0A%0A**Describe%20the%20issue%20(if%20necessary)**%3A%20%0A%0A%0A%2Fassign%20%40revelt>). Let's discuss it.
- If you tried to use this package, but something didn't work out, also [raise an issue](<https://gitlab.com/codsen/codsen/issues/new?issue[title]=arrayiffy-if-string%20package%20-%20put%20title%20here&issue[description]=**Which%20package%20is%20this%20issue%20for**%3A%20%0Aarrayiffy-if-string%0A%0A**Describe%20the%20issue%20(if%20necessary)**%3A%20%0A%0A%0A%2Fassign%20%40revelt>). We'll try to help.
- If you want to contribute some code, fork the [monorepo](https://gitlab.com/codsen/codsen/) via GitLab, then write code, then file a pull request on GitLab. We'll merge it in and release.
In monorepo, npm libraries are located in `packages/` folder. Inside, the source code is located either in `src/` folder (normal npm library) or in the root, `cli.js` (if it's a command-line application).
The npm script "`dev`", the `"dev": "rollup -c --dev"` builds the development version retaining all `console.log`s with row numbers. It's handy to have [js-row-num-cli](https://www.npmjs.com/package/js-row-num-cli) installed globally so you can automatically update the row numbers on all `console.log`s.
**[⬆ back to top](#)**
## Licence

@@ -113,15 +29,2 @@

[gitlab-img]: https://img.shields.io/badge/repo-on%20GitLab-brightgreen.svg?style=flat-square
[gitlab-url]: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
[cov-img]: https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat-square
[cov-url]: https://gitlab.com/codsen/codsen/tree/master/packages/arrayiffy-if-string
[no-deps-img]: https://img.shields.io/badge/-no%20dependencies-brightgreen?style=flat-square
[no-deps-url]: https://www.npmjs.com/package/arrayiffy-if-string?activeTab=dependencies
[downloads-img]: https://img.shields.io/npm/dm/arrayiffy-if-string.svg?style=flat-square
[downloads-url]: https://npmcharts.com/compare/arrayiffy-if-string
[runkit-img]: https://img.shields.io/badge/runkit-test_in_browser-a853ff.svg?style=flat-square
[runkit-url]: https://npm.runkit.com/arrayiffy-if-string
[prettier-img]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[prettier-url]: https://prettier.io
[license-img]: https://img.shields.io/badge/licence-MIT-51c838.svg?style=flat-square
[license-url]: https://gitlab.com/codsen/codsen/blob/master/LICENSE
<img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc