@xylabs/exists 5.0.34 → 5.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/exists",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.36",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"exists",
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
"types": "./dist/neutral/index.d.ts",
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
42
|
-
"src"
|
|
42
|
+
"src",
|
|
43
|
+
"!**/*.bench.*",
|
|
44
|
+
"!**/*.spec.*",
|
|
45
|
+
"!**/*.test.*"
|
|
43
46
|
],
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exists.spec.d.ts","sourceRoot":"","sources":["../../../src/spec/exists.spec.ts"],"names":[],"mappings":""}
|
package/src/spec/exists.spec.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
describe, expect, it,
|
|
3
|
-
} from 'vitest'
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line no-restricted-imports
|
|
6
|
-
import { exists } from '../index.ts'
|
|
7
|
-
|
|
8
|
-
const filterableValues = [undefined, null]
|
|
9
|
-
const nonfilterableValue = {}
|
|
10
|
-
|
|
11
|
-
describe('exists', () => {
|
|
12
|
-
describe.each(filterableValues)('with all %p', (value) => {
|
|
13
|
-
it('filters all', () => {
|
|
14
|
-
const input = [value, value]
|
|
15
|
-
const actual = input.filter(exists)
|
|
16
|
-
expect(actual.length).toBe(0)
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
describe.each(filterableValues)('with mixed %p', (value) => {
|
|
20
|
-
it('filters some', () => {
|
|
21
|
-
const input = [value, nonfilterableValue, value, nonfilterableValue]
|
|
22
|
-
const actual = input.filter(exists)
|
|
23
|
-
expect(actual.length).toBe(2)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
describe.each(filterableValues)('with no %p', () => {
|
|
27
|
-
it('filters none', () => {
|
|
28
|
-
const input = [nonfilterableValue, nonfilterableValue]
|
|
29
|
-
const actual = input.filter(exists)
|
|
30
|
-
expect(actual.length).toBe(input.length)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
it('does not filter zero', () => {
|
|
34
|
-
const input = [0, 1]
|
|
35
|
-
const actual = input.filter(exists)
|
|
36
|
-
expect(actual).toEqual(input)
|
|
37
|
-
})
|
|
38
|
-
it('does not filter false', () => {
|
|
39
|
-
const input = [true, false]
|
|
40
|
-
const actual = input.filter(exists)
|
|
41
|
-
expect(actual).toEqual(input)
|
|
42
|
-
})
|
|
43
|
-
})
|