ctx-core 5.18.4 → 5.18.7
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/all/eq/index.d.ts +3 -3
- package/all/eq/index.js +1 -1
- package/all/eq/index.test.ts +20 -0
- package/all/eql/index.d.ts +3 -2
- package/all/eql/index.js +3 -5
- package/all/eql/index.test.ts +20 -0
- package/all/neq/index.d.ts +3 -3
- package/all/neq/index.js +3 -5
- package/all/neq/index.test.ts +20 -0
- package/all/neql/index.d.ts +4 -1
- package/all/neql/index.js +5 -6
- package/all/neql/index.test.ts +20 -0
- package/package.json +2 -2
package/all/eq/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import type { a_nowrap_T } from '../a_nowrap/index.js'
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns `==` operator to all values in `a_nowrap`.
|
|
4
4
|
*/
|
|
5
|
-
export declare function eq<
|
|
5
|
+
export declare function eq<I>(a_nowrap:a_nowrap_T<I>):boolean
|
|
6
6
|
export declare type eq_T<I> = (a_nowrap:I)=>boolean
|
|
7
7
|
/**
|
|
8
8
|
* Returns function that returns `==` operator to all values in `in_value_aS`.
|
|
9
9
|
*/
|
|
10
|
-
export declare function eq_<
|
|
10
|
+
export declare function eq_<I>(a_nowrap:a_nowrap_T<unknown>):eq_fn_T<I>
|
|
11
11
|
export {
|
|
12
12
|
eq_ as _eq,
|
|
13
13
|
eq_ as _fn__eq,
|
|
14
14
|
}
|
|
15
|
-
export declare type eq_fn_T<
|
|
15
|
+
export declare type eq_fn_T<I> = (value:I)=>boolean
|
package/all/eq/index.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { eq, eq_ } from './index.js'
|
|
4
|
+
test('eq', ()=>{
|
|
5
|
+
equal(eq([0, 0]), true)
|
|
6
|
+
equal(eq([0, 1]), false)
|
|
7
|
+
equal(eq([{}, {}]), false)
|
|
8
|
+
equal(eq([undefined, {}]), false)
|
|
9
|
+
equal(eq([undefined, null]), true)
|
|
10
|
+
equal(eq([undefined, undefined]), true)
|
|
11
|
+
})
|
|
12
|
+
test('eq_', ()=>{
|
|
13
|
+
equal(eq_(0)(0), true)
|
|
14
|
+
equal(eq_(0)(1), false)
|
|
15
|
+
equal(eq_({})({}), false)
|
|
16
|
+
equal(eq_(undefined)({}), false)
|
|
17
|
+
equal(eq_(undefined)(null), true)
|
|
18
|
+
equal(eq_(undefined)(undefined), true)
|
|
19
|
+
})
|
|
20
|
+
test.run()
|
package/all/eql/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { a_nowrap_T } from '../a_nowrap/index.js'
|
|
1
2
|
/**
|
|
2
3
|
* Returns `===` operator to all values in `a_unwrap`.
|
|
3
4
|
*/
|
|
@@ -5,12 +6,12 @@ export declare function eql<I>(a_unwrap:I):boolean
|
|
|
5
6
|
/**
|
|
6
7
|
* Returns function that returns `===` operator to all values in `in_value_a`.
|
|
7
8
|
*/
|
|
8
|
-
export declare function eql_<
|
|
9
|
+
export declare function eql_<I>(in_value_a:a_nowrap_T<unknown>):(val:I)=>boolean
|
|
9
10
|
export { eql_ as _eql, }
|
|
10
11
|
/**
|
|
11
12
|
* Returns function that applies `===` operator to `compare` & `value`.
|
|
12
13
|
*/
|
|
13
|
-
export declare function eql_2<
|
|
14
|
+
export declare function eql_2<I>(compare:I):(val:I)=>boolean
|
|
14
15
|
export {
|
|
15
16
|
eql_2 as _eql_fn,
|
|
16
17
|
eql_2 as _fn__eql,
|
package/all/eql/index.js
CHANGED
|
@@ -6,11 +6,9 @@ import { wrap_concat } from '../wrap_concat/index.js'
|
|
|
6
6
|
* @returns {boolean}
|
|
7
7
|
*/
|
|
8
8
|
export function eql(a_unwrap) {
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
const value = value_a[i]
|
|
13
|
-
if (current_value !== value) return false
|
|
9
|
+
let [cmp_val, ...rest] = wrap_a_(a_unwrap)
|
|
10
|
+
for (let val of rest) {
|
|
11
|
+
if (cmp_val !== val) return false
|
|
14
12
|
}
|
|
15
13
|
return true
|
|
16
14
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { eql, eql_ } from './index.js'
|
|
4
|
+
test('eql', ()=>{
|
|
5
|
+
equal(eql([0, 0]), true)
|
|
6
|
+
equal(eql([0, 1]), false)
|
|
7
|
+
equal(eql([{}, {}]), false)
|
|
8
|
+
equal(eql([undefined, {}]), false)
|
|
9
|
+
equal(eql([undefined, null]), false)
|
|
10
|
+
equal(eql([undefined, undefined]), true)
|
|
11
|
+
})
|
|
12
|
+
test('eql_', ()=>{
|
|
13
|
+
equal(eql_(0)(0), true)
|
|
14
|
+
equal(eql_(0)(1), false)
|
|
15
|
+
equal(eql_({})({}), false)
|
|
16
|
+
equal(eql_(undefined)({}), false)
|
|
17
|
+
equal(eql_(undefined)(null), false)
|
|
18
|
+
equal(eql_(undefined)(undefined), true)
|
|
19
|
+
})
|
|
20
|
+
test.run()
|
package/all/neq/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { a_nowrap_T } from '../a_nowrap/index.js'
|
|
2
2
|
/**
|
|
3
3
|
* Returns `!=` operator to all values in `in_value_a`.
|
|
4
4
|
*/
|
|
5
|
-
export declare function neq<I>(
|
|
5
|
+
export declare function neq<I>(a_unwrap:I):boolean
|
|
6
6
|
/**
|
|
7
7
|
* Return function that Returns `!=` operator to all values in `in_value_a`.
|
|
8
8
|
*/
|
|
9
|
-
export declare function neq_<I>(in_value_a:
|
|
9
|
+
export declare function neq_<I>(in_value_a:a_nowrap_T<unknown>):(val:I)=>boolean
|
|
10
10
|
export { neq_ as _neq, }
|
package/all/neq/index.js
CHANGED
|
@@ -7,11 +7,9 @@ import { wrap_concat } from '../wrap_concat/index.js'
|
|
|
7
7
|
* @returns {boolean}
|
|
8
8
|
*/
|
|
9
9
|
export function neq(in_value_a) {
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
const value = value_a[i]
|
|
14
|
-
if (current_value == value) return false
|
|
10
|
+
let [cmp_val, ...rest] = wrap_a_(in_value_a)
|
|
11
|
+
for (let val of rest) {
|
|
12
|
+
if (cmp_val == val) return false
|
|
15
13
|
}
|
|
16
14
|
return true
|
|
17
15
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { neq, neq_ } from './index.js'
|
|
4
|
+
test('neq', ()=>{
|
|
5
|
+
equal(neq([0, 0]), false)
|
|
6
|
+
equal(neq([0, 1]), true)
|
|
7
|
+
equal(neq([{}, {}]), true)
|
|
8
|
+
equal(neq([undefined, {}]), true)
|
|
9
|
+
equal(neq([undefined, null]), false)
|
|
10
|
+
equal(neq([undefined, undefined]), false)
|
|
11
|
+
})
|
|
12
|
+
test('neq_', ()=>{
|
|
13
|
+
equal(neq_(0)(0), false)
|
|
14
|
+
equal(neq_(0)(1), true)
|
|
15
|
+
equal(neq_({})({}), true)
|
|
16
|
+
equal(neq_(undefined)({}), true)
|
|
17
|
+
equal(neq_(undefined)(null), false)
|
|
18
|
+
equal(neq_(undefined)(undefined), false)
|
|
19
|
+
})
|
|
20
|
+
test.run()
|
package/all/neql/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { a_nowrap_T } from '../a_nowrap/index.js'
|
|
1
2
|
/**
|
|
2
3
|
* Returns `!==` operator to all values in `a_unwrap`.
|
|
3
4
|
*/
|
|
@@ -7,5 +8,7 @@ export declare function neql<I>(a_unwrap:I):boolean
|
|
|
7
8
|
* @param in_value_a
|
|
8
9
|
* @returns {function(*=): boolean}
|
|
9
10
|
*/
|
|
10
|
-
export declare function neql_<
|
|
11
|
+
export declare function neql_<I>(
|
|
12
|
+
in_value_a:a_nowrap_T<unknown>
|
|
13
|
+
):(value:I)=>boolean
|
|
11
14
|
export { neql_ as _neql, }
|
package/all/neql/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { wrap_a_ } from '../wrap_a/index.js'
|
|
2
|
+
import { wrap_concat } from '../wrap_concat/index.js'
|
|
2
3
|
/**
|
|
3
4
|
* Returns `!==` operator to all values in `a_unwrap`.
|
|
4
5
|
* @param {unknown}a_unwrap
|
|
5
6
|
* @returns {boolean}
|
|
6
7
|
*/
|
|
7
8
|
export function neql(a_unwrap) {
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
const value = value_a[i]
|
|
12
|
-
if (current_value === value) return false
|
|
9
|
+
let [cmp_val, ...rest] = wrap_a_(a_unwrap)
|
|
10
|
+
for (let val of rest) {
|
|
11
|
+
if (cmp_val === val) return false
|
|
13
12
|
}
|
|
14
13
|
return true
|
|
15
14
|
}
|
|
@@ -19,6 +18,6 @@ export function neql(a_unwrap) {
|
|
|
19
18
|
* @returns {(value:unknown)=>boolean}
|
|
20
19
|
*/
|
|
21
20
|
export function neql_(in_value_a) {
|
|
22
|
-
return
|
|
21
|
+
return value=>neql(wrap_concat(in_value_a, value))
|
|
23
22
|
}
|
|
24
23
|
export { neql_ as _neql, }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { neql, neql_ } from './index.js'
|
|
4
|
+
test('neql', ()=>{
|
|
5
|
+
equal(neql([0, 0]), false)
|
|
6
|
+
equal(neql([0, 1]), true)
|
|
7
|
+
equal(neql([{}, {}]), true)
|
|
8
|
+
equal(neql([undefined, {}]), true)
|
|
9
|
+
equal(neql([undefined, null]), true)
|
|
10
|
+
equal(neql([undefined, undefined]), false)
|
|
11
|
+
})
|
|
12
|
+
test('neql_', ()=>{
|
|
13
|
+
equal(neql_(0)(0), false)
|
|
14
|
+
equal(neql_(0)(1), true)
|
|
15
|
+
equal(neql_({})({}), true)
|
|
16
|
+
equal(neql_(undefined)({}), true)
|
|
17
|
+
equal(neql_(undefined)(null), true)
|
|
18
|
+
equal(neql_(undefined)(undefined), false)
|
|
19
|
+
})
|
|
20
|
+
test.run()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctx-core",
|
|
3
|
-
"version": "5.18.
|
|
3
|
+
"version": "5.18.7",
|
|
4
4
|
"description": "ctx-core core library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"@arethetypeswrong/cli": "^0.13.5",
|
|
135
135
|
"@ctx-core/preprocess": "^0.1.0",
|
|
136
136
|
"@size-limit/preset-small-lib": "^11.0.1",
|
|
137
|
-
"@types/node": "^20.11.
|
|
137
|
+
"@types/node": "^20.11.2",
|
|
138
138
|
"@types/sinon": "^17.0.3",
|
|
139
139
|
"c8": "^9.1.0",
|
|
140
140
|
"check-dts": "^0.7.2",
|