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

@miyauci/isx

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miyauci/isx - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0-beta.1

esm/is_array.js

4

esm/iterable/is_empty.js
// Copyright 2023-latest Tomoki Miyauchi. All rights reserved. MIT license.
// This module is browser compatible.
export function isEmpty(input) {
return ![...input].length;
for (const _ of input)
return false;
return true;
}
// Copyright 2023-latest Tomoki Miyauchi. All rights reserved. MIT license.
// This module is browser compatible.
export function isNotEmpty(input) {
return !![...input].length;
for (const _ of input)
return true;
return false;
}
// Copyright 2023-latest Tomoki Miyauchi. All rights reserved. MIT license.
// This module is browser compatible.
export function isSingle(input) {
return [...input].length === 1;
const iterator = input[Symbol.iterator]();
return !iterator.next().done && (iterator.next().done ?? false);
}
{
"name": "@miyauci/isx",
"version": "1.1.1",
"version": "1.2.0-beta.1",
"description": "Collection of validation functions for JavaScript data",

@@ -37,2 +37,5 @@ "license": "MIT",

],
"is_array": [
"types/is_array.d.ts"
],
"is_async_iterable": [

@@ -127,2 +130,7 @@ "types/is_async_iterable.d.ts"

},
"./is_array": {
"import": "./esm/is_array.js",
"require": "./script/is_array.js",
"types": "./types/is_array.d.ts"
},
"./is_async_iterable": {

@@ -129,0 +137,0 @@ "import": "./esm/is_async_iterable.js",

@@ -195,2 +195,22 @@ # isx

## isArray
[![badge](https://deno.bundlejs.com/?q=https://deno.land/x/isx/is_array.ts&badge=)](https://bundlejs.com/?q=https%3A%2F%2Fdeno.land%2Fx%2Fisx%2Fis_array.ts)
Whether the input is array or not.
_**Use only if input contains `ReadOnlyArray`**_. It improves type inference.
Otherwise, use `Array.isArray`.
This exists only because of TypeScript bug
[#17002](https://github.com/microsoft/TypeScript/issues/17002). When this is
fixed, this function will no longer be provided.
```ts
import { isArray } from "https://deno.land/x/isx@$VERSION/is_array.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(isArray([]), true);
assertEquals(isArray({}), false);
```
## isPromise

@@ -197,0 +217,0 @@

@@ -7,4 +7,6 @@ "use strict";

function isEmpty(input) {
return ![...input].length;
for (const _ of input)
return false;
return true;
}
exports.isEmpty = isEmpty;

@@ -7,4 +7,6 @@ "use strict";

function isNotEmpty(input) {
return !![...input].length;
for (const _ of input)
return true;
return false;
}
exports.isNotEmpty = isNotEmpty;

@@ -7,4 +7,5 @@ "use strict";

function isSingle(input) {
return [...input].length === 1;
const iterator = input[Symbol.iterator]();
return !iterator.next().done && (iterator.next().done ?? false);
}
exports.isSingle = isSingle;
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