Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.12.0 to 3.13.0

dist/arrayiffy-if-string.mjs

15

CHANGELOG.md

@@ -6,14 +6,19 @@ # Change Log

## 3.12.0 (2020-11-28)
## 3.13.0 (2021-01-23)
### Bug Fixes
- Fix the Create New Issue URLs ([c5ee4a6](https://git.sr.ht/~royston/codsen/commits/c5ee4a61e9436099b0e20d20bca043c1b2c93f55))
- Fix the Create New Issue URLs ([f5a41bf](https://github.com/codsen/codsen/commit/f5a41bf16fd8f43de7f8e7de68da562821ddb960))
### Features
- Add one more tag before which there will be a line break ([4f00871](https://git.sr.ht/~royston/codsen/commits/4f008715dcc2de7b2b52b67ce2e27728d5ffec37))
- Add perf measurement, recording and historical comparison ([1e70e2a](https://git.sr.ht/~royston/codsen/commits/1e70e2a92f50a388fbf621fb01d5f92519812461))
- Initial release ([4f35bfb](https://git.sr.ht/~royston/codsen/commits/4f35bfb167e54b1a0e5e8f01871293b262c67a76))
- Add one more tag before which there will be a line break ([d178203](https://github.com/codsen/codsen/commit/d1782036b134102fd552d38d2d4f39c93195620b))
- Add perf measurement, recording and historical comparison ([3643f93](https://github.com/codsen/codsen/commit/3643f9376237db8ffd61730700eeceebe32c4540))
- Initial release ([8db2df9](https://github.com/codsen/codsen/commit/8db2df9fb08d66cf6c7a75a57cdcd15a5ec12c1c))
- rewrite in TS ([41946c2](https://github.com/codsen/codsen/commit/41946c29a993366e0a4b1704f88d1ad1a0031dca))
## 3.12.0 (2020-11-28)
Accidental version bump during migration to sourcehut. Sorry about that.
## 3.11.0 (2019-06-29)

@@ -20,0 +25,0 @@

/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.12.0
* Version: 3.13.0
* Author: Roy Revelt, Codsen Ltd

@@ -12,12 +12,17 @@ * License: MIT

function arrayiffyString(something) {
Object.defineProperty(exports, '__esModule', { value: true });
/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
function arrayiffy(something) {
if (typeof something === "string") {
if (something.length > 0) {
if (something.length) {
return [something];
}
return [];
}
return something;
}
module.exports = arrayiffyString;
exports.arrayiffy = arrayiffy;
/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.12.0
* Version: 3.13.0
* Author: Roy Revelt, Codsen Ltd

@@ -11,22 +11,24 @@ * License: MIT

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.arrayiffyIfString = factory());
}(this, (function () { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.arrayiffyIfString = {}));
}(this, (function (exports) { 'use strict';
// If a string is given, put it into an array. Bypass everything else.
function arrayiffyString(something) {
if (typeof something === "string") {
if (something.length > 0) {
return [something];
}
return [];
/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
function arrayiffy(something) {
if (typeof something === "string") {
if (something.length) {
return [something];
}
return something;
return [];
}
return arrayiffyString;
return something;
}
exports.arrayiffy = arrayiffy;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.12.0
* Version: 3.13.0
* Author: Roy Revelt, Codsen Ltd

@@ -10,12 +10,15 @@ * License: MIT

function arrayiffyString(something) {
/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
function arrayiffy(something) {
if (typeof something === "string") {
if (something.length > 0) {
if (something.length) {
return [something];
}
return [];
}
return something;
}
export default arrayiffyString;
export { arrayiffy };
/**
* arrayiffy-if-string
* Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
* Version: 3.12.0
* Version: 3.13.0
* Author: Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * License: MIT

!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}}));
!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})}));

@@ -1,7 +0,5 @@

/* eslint import/extensions:0 */
// Quick Take
import { strict as assert } from "assert";
import arrayiffy from "../dist/arrayiffy-if-string.esm.js";
import { arrayiffy } from "../dist/arrayiffy-if-string.esm.js";

@@ -8,0 +6,0 @@ assert.deepEqual(arrayiffy("aaa"), ["aaa"]);

@@ -1,1 +0,1 @@

{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport arrayiffy from \"arrayiffy-if-string\";\n\nassert.deepEqual(arrayiffy(\"aaa\"), [\"aaa\"]);\n\nassert.deepEqual(arrayiffy(\"\"), []);\n\nassert.equal(arrayiffy(true), true);\n\nassert.equal(arrayiffy(), undefined);"}}
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport { arrayiffy } from \"arrayiffy-if-string\";\n\nassert.deepEqual(arrayiffy(\"aaa\"), [\"aaa\"]);\n\nassert.deepEqual(arrayiffy(\"\"), []);\n\nassert.equal(arrayiffy(true), true);\n\nassert.equal(arrayiffy(), undefined);"}}
{
"name": "arrayiffy-if-string",
"version": "3.12.0",
"version": "3.13.0",
"description": "Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.",

@@ -21,3 +21,7 @@ "keywords": [

"homepage": "https://codsen.com/os/arrayiffy-if-string/",
"repository": "https://git.sr.ht/~royston/codsen",
"repository": {
"type": "git",
"url": "https://github.com/codsen/codsen.git",
"directory": "packages/arrayiffy-if-string"
},
"license": "MIT",

@@ -32,2 +36,3 @@ "author": {

"browser": "dist/arrayiffy-if-string.umd.js",
"types": "types/index.d.ts",
"scripts": {

@@ -37,7 +42,8 @@ "build": "rollup -c",

"clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
"clean_types": "../../scripts/cleanTypes.js",
"dev": "rollup -c --dev",
"devunittest": "npm run dev && ./node_modules/.bin/tap --only -R 'base' && npm run clean_cov",
"devunittest": "npm run dev && ./node_modules/.bin/tap --only -R 'base' && npm run tsd && npm run clean_cov",
"format": "npm run lect && npm run prettier && npm run lint",
"lect": "lect",
"lint": "../../node_modules/eslint/bin/eslint.js \"**/*.js\" --fix --config \"../../.eslintrc.json\" --quiet",
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
"perf": "node perf/check",

@@ -51,11 +57,7 @@ "prepare": "npm run build",

"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
"tsd": "tsd",
"unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md && npm run clean_cov && npm run perf",
"tsc": "tsc",
"tsd": "test ! -f index.d.ts || tsd",
"unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run tsd && npm run clean_cov && npm run perf",
"version": "npm run build && git add ."
},
"husky": {
"hooks": {
"pre-commit": "npm run format && npm test"
}
},
"tap": {

@@ -73,18 +75,2 @@ "coverage-report": [

"lect": {
"defaultExported": true,
"files": {
"delete": [],
"write_hard": [
{
"contents": "",
"name": ""
}
],
"write_soft": [
{
"contents": "",
"name": ""
}
]
},
"licence": {

@@ -95,17 +81,15 @@ "extras": [

},
"npmignore": {
"badFiles": [],
"badFolders": [],
"goodFiles": [],
"goodFolders": []
},
"req": "arrayiffy",
"req": "{ arrayiffy }",
"various": {
"devDependencies": [
"benchmark"
]
"devDependencies": []
}
},
"dependencies": {
"@babel/runtime": "^7.12.5"
},
"devDependencies": {
"@babel/core": "^7.12.7",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/node": "^7.12.10",
"@babel/plugin-external-helpers": "^7.12.1",
"@babel/plugin-proposal-class-properties": "^7.12.1",

@@ -115,18 +99,29 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",

"@babel/plugin-proposal-optional-chaining": "^7.12.7",
"@babel/preset-env": "^7.12.7",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.10",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-strip": "^2.0.0",
"benchmark": "^2.1.4",
"eslint": "^7.14.0",
"lect": "^0.15.0",
"rollup": "^2.33.3",
"@rollup/plugin-typescript": "^8.1.0",
"@types/node": "^14.14.22",
"@types/tap": "^14.10.1",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"eslint": "^7.18.0",
"lect": "^0.16.0",
"rollup": "^2.38.0",
"rollup-plugin-ascii": "^0.0.3",
"rollup-plugin-banner": "^0.2.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^2.0.1",
"rollup-plugin-terser": "^7.0.2",
"tap": "^14.11.0",
"tsd": "^0.13.1"
"tsd": "^0.14.0",
"tslib": "^2.1.0",
"typescript": "^4.1.3"
}
}

@@ -12,4 +12,4 @@ # arrayiffy-if-string

</a>
<a href="https://git.sr.ht/~royston/codsen/tree/master/packages/arrayiffy-if-string" rel="nofollow noreferrer noopener">
<img src="https://img.shields.io/badge/-sourcehut-blue?style=flat-square" alt="page on sourcehut">
<a href="https://github.com/codsen/codsen/tree/main/packages/arrayiffy-if-string" rel="nofollow noreferrer noopener">
<img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
</a>

@@ -38,3 +38,3 @@ <a href="https://npmcharts.com/compare/arrayiffy-if-string?interval=30" rel="nofollow noreferrer noopener" target="_blank">

import { strict as assert } from "assert";
import arrayiffy from "arrayiffy-if-string";
import { arrayiffy } from "arrayiffy-if-string";

@@ -58,4 +58,4 @@ assert.deepEqual(arrayiffy("aaa"), ["aaa"]);

Copyright (c) 2010-2020 Roy Revelt and other contributors
Copyright (c) 2010-2021 Roy Revelt and other contributors
<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">

Sorry, the diff of this file is not supported yet

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