@soleil-se/app-util 5.12.0 → 5.12.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.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/server/app-data/index.js +1 -0
- package/server/global-app-data/index.js +1 -0
- package/server/index.d.ts +52 -52
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [5.12.1] - 2025-10-15
|
|
11
|
+
|
|
12
|
+
- Return identifier for Node instances in `toString` function in `app-data` and `global-app-data`.
|
|
13
|
+
|
|
10
14
|
## [5.12.0] - 2025-10-09
|
|
11
15
|
|
|
12
16
|
- Add `iteratorToArray`, `nodeIteratorToArray`, `listToArray` and `setToArray` utility functions to convert these data structures into arrays.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.1",
|
|
4
4
|
"description": "Utility functions for WebApps, RESTApps and Widgets in Sitevision.",
|
|
5
5
|
"main": "./common/index.js",
|
|
6
6
|
"author": "Soleil AB",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"create-type-definitions": "node ../../utils/createTypeDefinitions.js ./common/index.js ./client/index.js ./client/svelte/index.js ./client/svelte/3/index.js ./client/svelte/4/index.js ./client/svelte/5/index.js ./server/index.js ./server/svelte/index.js ./server/svelte/3/index.js ./server/svelte/4/index.js ./server/svelte/5/index.js ./server/app-data/index.js ./server/global-app-data/index.js"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "a0f04b22e5c5262f1c270f69485a22bbb6638d3e"
|
|
29
29
|
}
|
package/server/app-data/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import InstanceTypeUtil from '@sitevision/api/server/InstanceTypeUtil';
|
|
|
9
9
|
*/
|
|
10
10
|
function toString(value) {
|
|
11
11
|
if (value === null || value === undefined) return undefined;
|
|
12
|
+
if (InstanceTypeUtil.isNode(value)) return value.getIdentifier();
|
|
12
13
|
return value.toString();
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -9,6 +9,7 @@ import InstanceTypeUtil from '@sitevision/api/server/InstanceTypeUtil';
|
|
|
9
9
|
*/
|
|
10
10
|
function toString(value) {
|
|
11
11
|
if (value === null || value === undefined) return undefined;
|
|
12
|
+
if (InstanceTypeUtil.isNode(value)) return value.getIdentifier();
|
|
12
13
|
return value.toString();
|
|
13
14
|
}
|
|
14
15
|
|
package/server/index.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Require a module natively, bypassing Webpack bundling.
|
|
3
|
-
* This function behaves like CommonJS require() and is used to import
|
|
4
|
-
* system packages in the Rhino runtime environment where Webpack bundling interferes
|
|
5
|
-
* with native module resolution.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} module - The module identifier
|
|
8
|
-
* @returns {any} The exported module
|
|
9
|
-
* @example
|
|
10
|
-
* // Import a Sitevision API package
|
|
11
|
-
* const PortletContextUtil = nativeRequire('PortletContextUtil');
|
|
12
|
-
*/
|
|
13
|
-
export function nativeRequire(module: string): any;
|
|
14
|
-
/**
|
|
15
|
-
* @typedef {import('@sitevision/api/types/javax/jcr/Node').Node} Node
|
|
16
|
-
* @typedef {import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator} NodeIterator
|
|
17
|
-
* @typedef {import('@sitevision/api/types/java/util/Iterator').Iterator} Iterator
|
|
18
|
-
* @typedef {import('@sitevision/api/types/java/util/List').List} List
|
|
19
|
-
* @typedef {import('@sitevision/api/types/java/util/Set').Set} Set
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Converts an Iterator to an array
|
|
23
|
-
* @template T
|
|
24
|
-
* @param {Iterator} iterator - The Iterator to convert
|
|
25
|
-
* @returns {T[]} Array containing all items from the iterator
|
|
26
|
-
*/
|
|
27
|
-
export function iteratorToArray<T>(iterator: Iterator): T[];
|
|
28
|
-
/**
|
|
29
|
-
* Converts a NodeIterator to an array of Nodes
|
|
30
|
-
* @param {NodeIterator} nodeIterator - The NodeIterator to convert
|
|
31
|
-
* @returns {Node[]} Array containing all nodes from the iterator
|
|
32
|
-
*/
|
|
33
|
-
export function nodeIteratorToArray(nodeIterator: NodeIterator): Node[];
|
|
34
|
-
/**
|
|
35
|
-
* Converts a List to an array
|
|
36
|
-
* @template T
|
|
37
|
-
* @param {List} list - The List to convert
|
|
38
|
-
* @returns {T[]} Array containing all items from the list
|
|
39
|
-
*/
|
|
40
|
-
export function listToArray<T>(list: List): T[];
|
|
41
|
-
/**
|
|
42
|
-
* Converts a Set to an array
|
|
43
|
-
* @template T
|
|
44
|
-
* @param {Set} set - The Set to convert
|
|
45
|
-
* @returns {T[]} Array containing all items from the set
|
|
46
|
-
*/
|
|
47
|
-
export function setToArray<T>(set: Set): T[];
|
|
48
|
-
export type Node = import('@sitevision/api/types/javax/jcr/Node').Node;
|
|
49
|
-
export type NodeIterator = import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator;
|
|
50
|
-
export type Iterator = import('@sitevision/api/types/java/util/Iterator').Iterator;
|
|
51
|
-
export type List = import('@sitevision/api/types/java/util/List').List;
|
|
52
|
-
export type Set = import('@sitevision/api/types/java/util/Set').Set;
|
|
1
|
+
/**
|
|
2
|
+
* Require a module natively, bypassing Webpack bundling.
|
|
3
|
+
* This function behaves like CommonJS require() and is used to import
|
|
4
|
+
* system packages in the Rhino runtime environment where Webpack bundling interferes
|
|
5
|
+
* with native module resolution.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} module - The module identifier
|
|
8
|
+
* @returns {any} The exported module
|
|
9
|
+
* @example
|
|
10
|
+
* // Import a Sitevision API package
|
|
11
|
+
* const PortletContextUtil = nativeRequire('PortletContextUtil');
|
|
12
|
+
*/
|
|
13
|
+
export function nativeRequire(module: string): any;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {import('@sitevision/api/types/javax/jcr/Node').Node} Node
|
|
16
|
+
* @typedef {import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator} NodeIterator
|
|
17
|
+
* @typedef {import('@sitevision/api/types/java/util/Iterator').Iterator} Iterator
|
|
18
|
+
* @typedef {import('@sitevision/api/types/java/util/List').List} List
|
|
19
|
+
* @typedef {import('@sitevision/api/types/java/util/Set').Set} Set
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Converts an Iterator to an array
|
|
23
|
+
* @template T
|
|
24
|
+
* @param {Iterator} iterator - The Iterator to convert
|
|
25
|
+
* @returns {T[]} Array containing all items from the iterator
|
|
26
|
+
*/
|
|
27
|
+
export function iteratorToArray<T>(iterator: Iterator): T[];
|
|
28
|
+
/**
|
|
29
|
+
* Converts a NodeIterator to an array of Nodes
|
|
30
|
+
* @param {NodeIterator} nodeIterator - The NodeIterator to convert
|
|
31
|
+
* @returns {Node[]} Array containing all nodes from the iterator
|
|
32
|
+
*/
|
|
33
|
+
export function nodeIteratorToArray(nodeIterator: NodeIterator): Node[];
|
|
34
|
+
/**
|
|
35
|
+
* Converts a List to an array
|
|
36
|
+
* @template T
|
|
37
|
+
* @param {List} list - The List to convert
|
|
38
|
+
* @returns {T[]} Array containing all items from the list
|
|
39
|
+
*/
|
|
40
|
+
export function listToArray<T>(list: List): T[];
|
|
41
|
+
/**
|
|
42
|
+
* Converts a Set to an array
|
|
43
|
+
* @template T
|
|
44
|
+
* @param {Set} set - The Set to convert
|
|
45
|
+
* @returns {T[]} Array containing all items from the set
|
|
46
|
+
*/
|
|
47
|
+
export function setToArray<T>(set: Set): T[];
|
|
48
|
+
export type Node = import('@sitevision/api/types/javax/jcr/Node').Node;
|
|
49
|
+
export type NodeIterator = import('@sitevision/api/types/javax/jcr/NodeIterator').NodeIterator;
|
|
50
|
+
export type Iterator = import('@sitevision/api/types/java/util/Iterator').Iterator;
|
|
51
|
+
export type List = import('@sitevision/api/types/java/util/List').List;
|
|
52
|
+
export type Set = import('@sitevision/api/types/java/util/Set').Set;
|