@byline/core 5.2.0 → 6.0.1
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Infonomic Company Limited
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This Source Code is subject to the terms of the Mozilla Public
|
|
3
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Infonomic Company Limited
|
|
7
|
+
*/
|
|
8
|
+
import { describe, expect, it } from 'vitest';
|
|
9
|
+
import { resolveItemViewColumns } from './config.js';
|
|
10
|
+
const itemViewCols = [{ fieldName: 'title', label: 'Title' }];
|
|
11
|
+
const pickerCols = [{ fieldName: 'name', label: 'Name' }];
|
|
12
|
+
const cfg = (over) => ({ slug: 'x', ...over });
|
|
13
|
+
describe('resolveItemViewColumns', () => {
|
|
14
|
+
it('returns itemView when present', () => {
|
|
15
|
+
expect(resolveItemViewColumns(cfg({ itemView: itemViewCols }))).toBe(itemViewCols);
|
|
16
|
+
});
|
|
17
|
+
it('falls back to the deprecated picker alias', () => {
|
|
18
|
+
expect(resolveItemViewColumns(cfg({ picker: pickerCols }))).toBe(pickerCols);
|
|
19
|
+
});
|
|
20
|
+
it('prefers itemView over picker when both are present', () => {
|
|
21
|
+
expect(resolveItemViewColumns(cfg({ itemView: itemViewCols, picker: pickerCols }))).toBe(itemViewCols);
|
|
22
|
+
});
|
|
23
|
+
it('returns undefined when neither is set', () => {
|
|
24
|
+
expect(resolveItemViewColumns(cfg({}))).toBeUndefined();
|
|
25
|
+
});
|
|
26
|
+
it('tolerates null / undefined config', () => {
|
|
27
|
+
expect(resolveItemViewColumns(null)).toBeUndefined();
|
|
28
|
+
expect(resolveItemViewColumns(undefined)).toBeUndefined();
|
|
29
|
+
});
|
|
30
|
+
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@byline/core",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.1",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.9.0"
|
|
8
8
|
},
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"sharp": "^0.35.4",
|
|
88
88
|
"uuid": "^14.0.2",
|
|
89
89
|
"zod": "^4.6.2",
|
|
90
|
-
"@byline/auth": "
|
|
90
|
+
"@byline/auth": "6.0.1"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@biomejs/biome": "2.5.13",
|