arrayiffy-if-string
Advanced tools
Comparing version 4.0.7 to 4.0.10
/** | ||
* @name arrayiffy-if-string | ||
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else. | ||
* @version 4.0.7 | ||
* @version 4.0.10 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,12 +10,2 @@ * @license MIT | ||
function arrayiffy(something) { | ||
if (typeof something === "string") { | ||
if (something.length) { | ||
return [something]; | ||
} | ||
return []; | ||
} | ||
return something; | ||
} | ||
export { arrayiffy }; | ||
function n(r){return typeof r=="string"?r.length?[r]:[]:r}export{n 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.7 | ||
* @version 4.0.10 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -10,2 +10,2 @@ * @license MIT | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arrayiffyIfString={})}(this,(function(e){"use strict";e.arrayiffy=function(e){return"string"==typeof e?e.length?[e]:[]:e},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
var arrayiffyIfString=(()=>{var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var e=Object.prototype.hasOwnProperty;var g=r=>i(r,"__esModule",{value:!0});var o=(r,n)=>{for(var f in n)i(r,f,{get:n[f],enumerable:!0})},c=(r,n,f,y)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of u(n))!e.call(r,t)&&(f||t!=="default")&&i(r,t,{get:()=>n[t],enumerable:!(y=a(n,t))||y.enumerable});return r};var s=(r=>(n,f)=>r&&r.get(n)||(f=c(g({}),n,1),r&&r.set(n,f),f))(typeof WeakMap!="undefined"?new WeakMap:0);var l={};o(l,{arrayiffy:()=>p});function p(r){return typeof r=="string"?r.length?[r]:[]:r}return s(l);})(); |
// Quick Take | ||
import { strict as assert } from "assert"; | ||
import { arrayiffy } from "../dist/arrayiffy-if-string.esm.js"; | ||
@@ -5,0 +6,0 @@ |
{ | ||
"name": "arrayiffy-if-string", | ||
"version": "4.0.7", | ||
"version": "4.0.10", | ||
"description": "Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.", | ||
@@ -39,31 +39,24 @@ "keywords": [ | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build:esbuild": "node '../../scripts/esbuild.js'", | ||
"build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'", | ||
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent", | ||
"clean_types": "../../scripts/cleanTypes.js", | ||
"dev": "rollup -c --dev", | ||
"devunittest": "npm run dev && tap --only -R 'base'", | ||
"format": "npm run lect && npm run prettier && npm run lint", | ||
"lect": "lect", | ||
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet", | ||
"perf": "node perf/check", | ||
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent", | ||
"republish": "npm publish || :", | ||
"tap": "tap", | ||
"pretest": "npm run build", | ||
"test": "npm run test:ci && npm run perf", | ||
"test:ci": "npm run unittest && npm run test:examples && npm run format", | ||
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier", | ||
"tsc": "tsc", | ||
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit" | ||
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts", | ||
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts", | ||
"dts": "rollup -c", | ||
"examples": "node '../../ops/scripts/run-examples.js'", | ||
"lect": "node '../../ops/lect/lect.js'", | ||
"letspublish": "yarn publish || :", | ||
"lint": "eslint . --fix", | ||
"perf": "node perf/check.js", | ||
"prepare": "echo 'ready'", | ||
"pretest": "yarn run lect && yarn run build", | ||
"test": "c8 yarn run unit && yarn run examples && yarn run lint", | ||
"unit": "uvu test" | ||
}, | ||
"tap": { | ||
"check-coverage": false, | ||
"node-arg": [ | ||
"--no-warnings", | ||
"--experimental-loader", | ||
"@istanbuljs/esm-loader-hook" | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
"c8": { | ||
"check-coverage": true, | ||
"exclude": [ | ||
"**/test/**/*.*" | ||
], | ||
"timeout": 0 | ||
"lines": 100 | ||
}, | ||
@@ -75,51 +68,4 @@ "lect": { | ||
] | ||
}, | ||
"req": "{ arrayiffy }", | ||
"various": { | ||
"devDependencies": [] | ||
} | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.16.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.16.0", | ||
"@babel/core": "^7.16.0", | ||
"@babel/node": "^7.16.0", | ||
"@babel/plugin-external-helpers": "^7.16.0", | ||
"@babel/plugin-proposal-class-properties": "^7.16.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.16.0", | ||
"@babel/plugin-proposal-optional-chaining": "^7.16.0", | ||
"@babel/plugin-transform-runtime": "^7.16.4", | ||
"@babel/preset-env": "^7.16.4", | ||
"@babel/preset-typescript": "^7.16.0", | ||
"@babel/register": "^7.16.0", | ||
"@istanbuljs/esm-loader-hook": "^0.1.2", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"@rollup/plugin-strip": "^2.1.0", | ||
"@rollup/plugin-typescript": "^8.3.0", | ||
"@types/node": "^16.11.10", | ||
"@types/tap": "^15.0.5", | ||
"@typescript-eslint/eslint-plugin": "^5.5.0", | ||
"@typescript-eslint/parser": "^5.5.0", | ||
"core-js": "^3.19.2", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.3.0", | ||
"lect": "^0.18.7", | ||
"rollup": "^2.60.1", | ||
"rollup-plugin-ascii": "^0.0.3", | ||
"rollup-plugin-banner": "^0.2.1", | ||
"rollup-plugin-cleanup": "^3.2.1", | ||
"rollup-plugin-dts": "^4.0.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"tap": "^15.1.5", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.5.2" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
} | ||
} |
@@ -41,2 +41,3 @@ # arrayiffy-if-string | ||
import { strict as assert } from "assert"; | ||
import { arrayiffy } from "arrayiffy-if-string"; | ||
@@ -55,3 +56,3 @@ | ||
Please [visit codsen.com](https://codsen.com/os/arrayiffy-if-string/) for a full description of the API and examples. | ||
Please [visit codsen.com](https://codsen.com/os/arrayiffy-if-string/) for a full description of the API. | ||
@@ -68,2 +69,4 @@ ## Contributing | ||
<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"> | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
0
70
10099
8
30
- Removed@babel/runtime@^7.16.3
- Removed@babel/runtime@7.26.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)