@soleil-se/app-util 5.6.2 → 5.6.4

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 CHANGED
@@ -7,6 +7,14 @@ 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.6.4] - 2024-01-18
11
+
12
+ - Cast `Packages.java.util.UUID.randomUUID()` to `string`.
13
+
14
+ ## [5.6.3] - 2024-01-15
15
+
16
+ - Only remove values in `stringifyParams` if they are `undefined`, `null` or an empty string.
17
+
10
18
  ## [5.6.2] - 2023-12-14
11
19
 
12
20
  - Update to correct homepage in `package.json`.
@@ -112,14 +120,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112
120
  ## [4.0.0] - 2021-01-27
113
121
 
114
122
  A much needed major overhaul of the package.
115
- See [MIGRATION](./MIGRATION.md).
123
+ See [MIGRATION](/packages/soleil-api/webapp-util/migration/).
116
124
 
117
125
  - Major refactoring of package.
118
126
  - Exports for render functions are moved.
119
127
  - All documented constants and functions from base import (`@soleil-api/webapp-util`) now works both in a server and client context.
120
128
  - Settings for selector is moved from server to client rendering functions.
121
129
  - Removed `noScript` option in `render` (formerly `renderApp`) has been removed. If a no script message is needed use the `html` option wrapped in `<noscript>`.
122
- - Removed `@soleil-api/webapp-util/app-data` has been removed, use [getAppData](./README.md#getAppData) from `@soleil-api/webapp-util`.
130
+ - Removed `@soleil-api/webapp-util/app-data` has been removed, use getAppData from `@soleil-api/webapp-util`.
123
131
 
124
132
  ## [3.0.3] - 2020-11-03
125
133
 
package/common/index.js CHANGED
@@ -63,7 +63,9 @@ export function getNamespace(prefix = 'app') {
63
63
  * @returns {string} Unique identifier.
64
64
  */
65
65
  export function generateId(prefix = 'id') {
66
- const uuid = isServer ? Packages.java.util.UUID.randomUUID() : window.crypto.randomUUID();
66
+ const uuid = isServer
67
+ ? Packages.java.util.UUID.randomUUID().toString()
68
+ : window.crypto.randomUUID();
67
69
  return `${prefix}_${uuid}`.replace(/-/g, '');
68
70
  }
69
71
 
@@ -77,7 +79,7 @@ export function generateId(prefix = 'id') {
77
79
  export function stringifyParams(params = {}, { addQueryPrefix = false } = {}) {
78
80
  const qs = Object.keys(params).map((key) => {
79
81
  const value = params[key];
80
- if (!value) return undefined;
82
+ if (value === undefined || value === null || value === '') return undefined;
81
83
  if (Array.isArray(value)) {
82
84
  return value.map((v) => `${encodeURIComponent(`${key}[]`)}=${encodeURIComponent(v)}`).join('&');
83
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleil-se/app-util",
3
- "version": "5.6.2",
3
+ "version": "5.6.4",
4
4
  "description": "Utility and rendering functions for WebApps.",
5
5
  "main": "./common/index.js",
6
6
  "author": "Soleil AB",
@@ -14,6 +14,6 @@
14
14
  "peerDependencies": {
15
15
  "@sitevision/api": "*"
16
16
  },
17
- "gitHead": "454db615bcb04eb8f1475f0f8ab9a9fee5fce15f",
17
+ "gitHead": "a0b6562f68aa56e089f547d7c3d85ac18a367367",
18
18
  "dependencies": {}
19
19
  }