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 4.0.13 to 4.0.14

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## 4.0.14 (2022-05-04)
### Bug Fixes
- improve types ([53262e1](https://github.com/codsen/codsen/commit/53262e1e4ba7cd9ea8aad9ce3a07a5aed5d1fdc2))
## 4.0.0 (2021-09-09)

@@ -8,0 +14,0 @@

4

dist/arrayiffy-if-string.esm.js
/**
* @name arrayiffy-if-string
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* @version 4.0.13
* @version 4.0.14
* @author Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * @license MIT

function n(r){return typeof r=="string"?r.length?[r]:[]:r}export{n as arrayiffy};
function r(n){return typeof n!="string"?n:n.length?[n]:[]}export{r as arrayiffy};
/**
* @name arrayiffy-if-string
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* @version 4.0.13
* @version 4.0.14
* @author Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * @license MIT

var arrayiffyIfString=(()=>{var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var e=Object.prototype.hasOwnProperty;var g=(r,n)=>{for(var t in n)i(r,t,{get:n[t],enumerable:!0})},o=(r,n,t,y)=>{if(n&&typeof n=="object"||typeof n=="function")for(let f of u(n))!e.call(r,f)&&f!==t&&i(r,f,{get:()=>n[f],enumerable:!(y=a(n,f))||y.enumerable});return r};var c=r=>o(i({},"__esModule",{value:!0}),r);var p={};g(p,{arrayiffy:()=>s});function s(r){return typeof r=="string"?r.length?[r]:[]:r}return c(p);})();
var arrayiffyIfString=(()=>{var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var x=(n,r)=>{for(var T in r)e(n,T,{get:r[T],enumerable:!0})},y=(n,r,T,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of g(r))!s.call(n,t)&&t!==T&&e(n,t,{get:()=>r[t],enumerable:!(i=f(r,t))||i.enumerable});return n};var u=n=>y(e({},"__esModule",{value:!0}),n);var o={};x(o,{arrayiffy:()=>a});function a(n){return typeof n!="string"?n:n.length?[n]:[]}return u(o);})();
{
"name": "arrayiffy-if-string",
"version": "4.0.13",
"version": "4.0.14",
"description": "Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.",

@@ -68,3 +68,4 @@ "keywords": [

"extras": [
""
"",
"Thanks to KRyan for types https://stackoverflow.com/a/71834598/3943954"
]

@@ -71,0 +72,0 @@ }

@@ -65,2 +65,4 @@ # arrayiffy-if-string

Thanks to KRyan for types https://stackoverflow.com/a/71834598/3943954
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">

@@ -1,4 +0,10 @@

declare function arrayiffy(something: string): [string];
declare function arrayiffy(something: string): [];
declare type StringInABox<T> = T extends ""
? []
: string extends T
? [] | [string]
: T extends string
? [T]
: T;
declare function arrayiffy<T>(something: T): StringInABox<T>;
export { arrayiffy };
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