@lightsparkdev/core 1.2.4 → 1.2.5

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
@@ -1,5 +1,11 @@
1
1
  # @lightsparkdev/core
2
2
 
3
+ ## 1.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - f148f37: - add RequiredKeys type utility
8
+
3
9
  ## 1.2.4
4
10
 
5
11
  ### Patch Changes
@@ -145,6 +145,15 @@ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
145
145
  type Complete<T> = {
146
146
  [P in keyof T]-?: NonNullable<T[P]>;
147
147
  };
148
+ /**
149
+ * RequiredKeys utility extracts all the keys of T that are required.
150
+ * For each key K in T, it checks if Pick<T, K> extends {} (an empty object). If it does, that
151
+ * means K is optional; otherwise, it's required.
152
+ * The resulting type is a union of all required keys in T.
153
+ */
154
+ type RequiredKeys<T> = {
155
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
156
+ }[keyof T];
148
157
 
149
158
  declare const isError: (e: unknown) => e is Error;
150
159
  type ErrorWithMessage = {
@@ -257,4 +266,4 @@ declare function lsidToUUID(lsid: string): string;
257
266
  declare function isUint8Array(value: unknown): value is Uint8Array;
258
267
  declare function isObject(value: unknown): value is Record<string, unknown>;
259
268
 
260
- export { isUint8Array as $, isTest as A, isError as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, isErrorWithMessage as E, getErrorMsg as F, isErrorMsg as G, errorToJSON as H, bytesToHex as I, hexToBytes as J, getCurrentLocale as K, countryCodesToCurrencyCodes as L, type CurrencyLocales as M, type CurrencyCodes as N, localeToCurrencyCode as O, getLocalStorageConfigItem as P, getLocalStorageBoolean as Q, setLocalStorageBoolean as R, type SDKCurrencyAmountType as S, deleteLocalStorageItem as T, clamp as U, linearInterpolate as V, round as W, isNumber as X, pollUntil as Y, sleep as Z, lsidToUUID as _, b64encode as a, isObject as a0, type Maybe as a1, type ExpandRecursively as a2, type ById as a3, type OmitTypename as a4, isType as a5, type DeepPartial as a6, type JSONLiteral as a7, type JSONType as a8, type JSONObject as a9, type NN as aa, notNullUndefined as ab, type PartialBy as ac, type Complete as ad, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountObj as k, type CurrencyAmountPreferenceObj as l, type CurrencyAmountArg as m, isDeprecatedCurrencyAmountObj as n, isCurrencyAmountObj as o, isCurrencyAmountPreferenceObj as p, isSDKCurrencyAmount as q, mapCurrencyAmount as r, isCurrencyMap as s, abbrCurrencyUnit as t, urlsafe_b64decode as u, formatCurrencyStr as v, separateCurrencyStrParts as w, localeToCurrencySymbol as x, isBrowser as y, isNode as z };
269
+ export { isUint8Array as $, isTest as A, isError as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, isErrorWithMessage as E, getErrorMsg as F, isErrorMsg as G, errorToJSON as H, bytesToHex as I, hexToBytes as J, getCurrentLocale as K, countryCodesToCurrencyCodes as L, type CurrencyLocales as M, type CurrencyCodes as N, localeToCurrencyCode as O, getLocalStorageConfigItem as P, getLocalStorageBoolean as Q, setLocalStorageBoolean as R, type SDKCurrencyAmountType as S, deleteLocalStorageItem as T, clamp as U, linearInterpolate as V, round as W, isNumber as X, pollUntil as Y, sleep as Z, lsidToUUID as _, b64encode as a, isObject as a0, type Maybe as a1, type ExpandRecursively as a2, type ById as a3, type OmitTypename as a4, isType as a5, type DeepPartial as a6, type JSONLiteral as a7, type JSONType as a8, type JSONObject as a9, type NN as aa, notNullUndefined as ab, type PartialBy as ac, type Complete as ad, type RequiredKeys as ae, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountObj as k, type CurrencyAmountPreferenceObj as l, type CurrencyAmountArg as m, isDeprecatedCurrencyAmountObj as n, isCurrencyAmountObj as o, isCurrencyAmountPreferenceObj as p, isSDKCurrencyAmount as q, mapCurrencyAmount as r, isCurrencyMap as s, abbrCurrencyUnit as t, urlsafe_b64decode as u, formatCurrencyStr as v, separateCurrencyStrParts as w, localeToCurrencySymbol as x, isBrowser as y, isNode as z };
@@ -145,6 +145,15 @@ type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
145
145
  type Complete<T> = {
146
146
  [P in keyof T]-?: NonNullable<T[P]>;
147
147
  };
148
+ /**
149
+ * RequiredKeys utility extracts all the keys of T that are required.
150
+ * For each key K in T, it checks if Pick<T, K> extends {} (an empty object). If it does, that
151
+ * means K is optional; otherwise, it's required.
152
+ * The resulting type is a union of all required keys in T.
153
+ */
154
+ type RequiredKeys<T> = {
155
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
156
+ }[keyof T];
148
157
 
149
158
  declare const isError: (e: unknown) => e is Error;
150
159
  type ErrorWithMessage = {
@@ -257,4 +266,4 @@ declare function lsidToUUID(lsid: string): string;
257
266
  declare function isUint8Array(value: unknown): value is Uint8Array;
258
267
  declare function isObject(value: unknown): value is Record<string, unknown>;
259
268
 
260
- export { isUint8Array as $, isTest as A, isError as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, isErrorWithMessage as E, getErrorMsg as F, isErrorMsg as G, errorToJSON as H, bytesToHex as I, hexToBytes as J, getCurrentLocale as K, countryCodesToCurrencyCodes as L, type CurrencyLocales as M, type CurrencyCodes as N, localeToCurrencyCode as O, getLocalStorageConfigItem as P, getLocalStorageBoolean as Q, setLocalStorageBoolean as R, type SDKCurrencyAmountType as S, deleteLocalStorageItem as T, clamp as U, linearInterpolate as V, round as W, isNumber as X, pollUntil as Y, sleep as Z, lsidToUUID as _, b64encode as a, isObject as a0, type Maybe as a1, type ExpandRecursively as a2, type ById as a3, type OmitTypename as a4, isType as a5, type DeepPartial as a6, type JSONLiteral as a7, type JSONType as a8, type JSONObject as a9, type NN as aa, notNullUndefined as ab, type PartialBy as ac, type Complete as ad, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountObj as k, type CurrencyAmountPreferenceObj as l, type CurrencyAmountArg as m, isDeprecatedCurrencyAmountObj as n, isCurrencyAmountObj as o, isCurrencyAmountPreferenceObj as p, isSDKCurrencyAmount as q, mapCurrencyAmount as r, isCurrencyMap as s, abbrCurrencyUnit as t, urlsafe_b64decode as u, formatCurrencyStr as v, separateCurrencyStrParts as w, localeToCurrencySymbol as x, isBrowser as y, isNode as z };
269
+ export { isUint8Array as $, isTest as A, isError as B, ConfigKeys as C, type DeprecatedCurrencyAmountObj as D, isErrorWithMessage as E, getErrorMsg as F, isErrorMsg as G, errorToJSON as H, bytesToHex as I, hexToBytes as J, getCurrentLocale as K, countryCodesToCurrencyCodes as L, type CurrencyLocales as M, type CurrencyCodes as N, localeToCurrencyCode as O, getLocalStorageConfigItem as P, getLocalStorageBoolean as Q, setLocalStorageBoolean as R, type SDKCurrencyAmountType as S, deleteLocalStorageItem as T, clamp as U, linearInterpolate as V, round as W, isNumber as X, pollUntil as Y, sleep as Z, lsidToUUID as _, b64encode as a, isObject as a0, type Maybe as a1, type ExpandRecursively as a2, type ById as a3, type OmitTypename as a4, isType as a5, type DeepPartial as a6, type JSONLiteral as a7, type JSONType as a8, type JSONObject as a9, type NN as aa, notNullUndefined as ab, type PartialBy as ac, type Complete as ad, type RequiredKeys as ae, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, ensureArray as e, CurrencyUnit as f, type CurrencyUnitType as g, convertCurrencyAmountValue as h, convertCurrencyAmount as i, type CurrencyMap as j, type CurrencyAmountObj as k, type CurrencyAmountPreferenceObj as l, type CurrencyAmountArg as m, isDeprecatedCurrencyAmountObj as n, isCurrencyAmountObj as o, isCurrencyAmountPreferenceObj as p, isSDKCurrencyAmount as q, mapCurrencyAmount as r, isCurrencyMap as s, abbrCurrencyUnit as t, urlsafe_b64decode as u, formatCurrencyStr as v, separateCurrencyStrParts as w, localeToCurrencySymbol as x, isBrowser as y, isNode as z };
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { a3 as ById, ad as Complete, C as ConfigKeys, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from './index-DIJ9IVY1.cjs';
1
+ export { a3 as ById, ad as Complete, C as ConfigKeys, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, ae as RequiredKeys, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from './index-COxEW2dD.cjs';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  type Headers = Record<string, string>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { a3 as ById, ad as Complete, C as ConfigKeys, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from './index-DIJ9IVY1.js';
1
+ export { a3 as ById, ad as Complete, C as ConfigKeys, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, ae as RequiredKeys, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from './index-COxEW2dD.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  type Headers = Record<string, string>;
@@ -1 +1 @@
1
- export { a3 as ById, ad as Complete, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from '../index-DIJ9IVY1.cjs';
1
+ export { a3 as ById, ad as Complete, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, ae as RequiredKeys, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from '../index-COxEW2dD.cjs';
@@ -1 +1 @@
1
- export { a3 as ById, ad as Complete, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from '../index-DIJ9IVY1.js';
1
+ export { a3 as ById, ad as Complete, m as CurrencyAmountArg, k as CurrencyAmountObj, l as CurrencyAmountPreferenceObj, N as CurrencyCodes, M as CurrencyLocales, j as CurrencyMap, f as CurrencyUnit, g as CurrencyUnitType, a6 as DeepPartial, D as DeprecatedCurrencyAmountObj, a2 as ExpandRecursively, a7 as JSONLiteral, a9 as JSONObject, a8 as JSONType, a1 as Maybe, aa as NN, a4 as OmitTypename, ac as PartialBy, ae as RequiredKeys, S as SDKCurrencyAmountType, t as abbrCurrencyUnit, b as b64decode, a as b64encode, I as bytesToHex, U as clamp, i as convertCurrencyAmount, h as convertCurrencyAmountValue, L as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, T as deleteLocalStorageItem, e as ensureArray, H as errorToJSON, v as formatCurrencyStr, K as getCurrentLocale, F as getErrorMsg, Q as getLocalStorageBoolean, P as getLocalStorageConfigItem, J as hexToBytes, y as isBrowser, o as isCurrencyAmountObj, p as isCurrencyAmountPreferenceObj, s as isCurrencyMap, n as isDeprecatedCurrencyAmountObj, B as isError, G as isErrorMsg, E as isErrorWithMessage, z as isNode, X as isNumber, a0 as isObject, q as isSDKCurrencyAmount, A as isTest, a5 as isType, $ as isUint8Array, V as linearInterpolate, O as localeToCurrencyCode, x as localeToCurrencySymbol, _ as lsidToUUID, r as mapCurrencyAmount, ab as notNullUndefined, Y as pollUntil, W as round, w as separateCurrencyStrParts, R as setLocalStorageBoolean, Z as sleep, u as urlsafe_b64decode } from '../index-COxEW2dD.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/core",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -45,3 +45,13 @@ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
45
45
 
46
46
  /* Opposite of Partial - make all keys required with NonNullable values */
47
47
  export type Complete<T> = { [P in keyof T]-?: NonNullable<T[P]> };
48
+
49
+ /**
50
+ * RequiredKeys utility extracts all the keys of T that are required.
51
+ * For each key K in T, it checks if Pick<T, K> extends {} (an empty object). If it does, that
52
+ * means K is optional; otherwise, it's required.
53
+ * The resulting type is a union of all required keys in T.
54
+ */
55
+ export type RequiredKeys<T> = {
56
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
57
+ }[keyof T];