@salsita-ai/common 0.50.0-develop.d87b28256e → 0.50.0-develop.d9534cf412
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/README.md +6 -6
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/zod-types.d.ts +0 -6
- package/dist/utils/zod-types.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,12 +13,12 @@ import { Branded } from '@salsita-ai/sdk/common/utils'
|
|
|
13
13
|
|
|
14
14
|
There is no package-root export. Import from one of the paths declared in `package.json`.
|
|
15
15
|
|
|
16
|
-
| Entry point | Contents
|
|
17
|
-
| ----------- |
|
|
18
|
-
| `utils` | General-purpose helpers for browser and Node: branded types, assertions, equality and nullish checks, cache and selector helpers, localization shapes, color parsing, Zod
|
|
19
|
-
| `env` | `createEnvReader`, which loads environment variables into an `envalid` specification, `resolveGeneratedEnvFile`, and the `envalid` validators `bool`, `num`, `str` and `url`.
|
|
20
|
-
| `eslint` | Shared flat ESLint configurations: `eslintrc`, `eslintrcReactWithStoryBook`, and the optional `devLinguiEslintrcRules`.
|
|
21
|
-
| `prettier` | `prettierrc`, the shared Prettier configuration with its import-order plugin setup.
|
|
16
|
+
| Entry point | Contents |
|
|
17
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `utils` | General-purpose helpers for browser and Node: branded types, assertions, equality and nullish checks, cache and selector helpers, localization shapes, color parsing, and the Zod transforms `usingType` and `usingOptionalType`. |
|
|
19
|
+
| `env` | `createEnvReader`, which loads environment variables into an `envalid` specification, `resolveGeneratedEnvFile`, and the `envalid` validators `bool`, `num`, `str` and `url`. |
|
|
20
|
+
| `eslint` | Shared flat ESLint configurations: `eslintrc`, `eslintrcReactWithStoryBook`, and the optional `devLinguiEslintrcRules`. |
|
|
21
|
+
| `prettier` | `prettierrc`, the shared Prettier configuration with its import-order plugin setup. |
|
|
22
22
|
|
|
23
23
|
### Environment loading
|
|
24
24
|
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { type ValueOf } from './value-of.js';
|
|
|
12
12
|
export { Brand, Branded, type WithBrand } from './branded-types.js';
|
|
13
13
|
export { type Empty } from './empty.js';
|
|
14
14
|
export { assertExistence, AssertionError } from './assert-existence.js';
|
|
15
|
-
export { usingType,
|
|
15
|
+
export { usingType, usingOptionalType } from './zod-types.js';
|
|
16
16
|
export { type Logger, type LogLevel, isLogLevelEnabled } from './logger.js';
|
|
17
17
|
export { initConsoleLogger, type ConsoleLoggerOptions } from './console-logger.js';
|
|
18
18
|
export { isNonEmptyString } from './is-non-empty-string.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{isArray}from"./is-array.js";export{isNonNullish}from"./is-non-nullish.js";export{isShallowEqual}from"./is-shallow-equal.js";export{isEqualArray}from"./is-equal-array.js";export{isEqualNullish}from"./is-equal-nullish.js";export{canonicalStringify}from"./canonical-stringify.js";export{getStickyCache,createCacheToken}from"./sticky-cache.js";export{isColor,isSimpleColor,isHexColor,isRalColor,simpleColorToHex}from"./colors.js";export{Brand,Branded}from"./branded-types.js";export{assertExistence,AssertionError}from"./assert-existence.js";export{usingType,
|
|
1
|
+
export{isArray}from"./is-array.js";export{isNonNullish}from"./is-non-nullish.js";export{isShallowEqual}from"./is-shallow-equal.js";export{isEqualArray}from"./is-equal-array.js";export{isEqualNullish}from"./is-equal-nullish.js";export{canonicalStringify}from"./canonical-stringify.js";export{getStickyCache,createCacheToken}from"./sticky-cache.js";export{isColor,isSimpleColor,isHexColor,isRalColor,simpleColorToHex}from"./colors.js";export{Brand,Branded}from"./branded-types.js";export{assertExistence,AssertionError}from"./assert-existence.js";export{usingType,usingOptionalType}from"./zod-types.js";export{isLogLevelEnabled}from"./logger.js";export{initConsoleLogger}from"./console-logger.js";export{isNonEmptyString}from"./is-non-empty-string.js";export{isMessageDescriptor,isMultilingualString,resolveLocalizable,MessageDescriptorSchema,EnhancedMessageDescriptorSchema,MultilingualStringSchema,LocalizableSchema,EnhancedLocalizableSchema}from"./localizable.js";export{InfoError}from"./info-error.js";export{CompositeKeyMap}from"./composite-key-map.js";export{memoOnce}from"./memo-once.js";export{toObservableWithLastValue}from"./observable-with-last-value.js";export{ObjectWithKeySchema}from"./object-with-key.js";export{tryOrDefault}from"./try-or-default.js";export*from"./create-selector.js";
|
|
@@ -10,9 +10,3 @@ export declare function usingType<T, V>(typeFactory: (arg: V) => T): (arg: V, ct
|
|
|
10
10
|
* It allows the input to be undefined.
|
|
11
11
|
*/
|
|
12
12
|
export declare function usingOptionalType<T, V>(typeFactory: (arg: V) => T): (arg: V | undefined, ctx: RefinementCtx) => T | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Utility function to run zod validation on custom type factor, use effectType: 'input' in openapi metadata
|
|
15
|
-
* to use the input type as a type to generate the openapi schema.
|
|
16
|
-
* It allows the input to be undefined.
|
|
17
|
-
*/
|
|
18
|
-
export declare function usingNullishType<T, V>(typeFactory: (arg: V) => T): (arg: V | undefined | null, ctx: RefinementCtx) => T | null | undefined;
|
package/dist/utils/zod-types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";export function usingType(s){return(r
|
|
1
|
+
import{z as e}from"zod";export function usingType(s){return(o,r)=>{try{return s(o)}catch(s){return s instanceof Error?r.addIssue({code:e.ZodIssueCode.custom,message:s.message}):r.addIssue({code:e.ZodIssueCode.custom,message:"An unknown error occurred."}),e.NEVER}}}export function usingOptionalType(s){return(o,r)=>{if(void 0!==o)try{return s(o)}catch(s){return s instanceof Error?r.addIssue({code:e.ZodIssueCode.custom,message:s.message}):r.addIssue({code:e.ZodIssueCode.custom,message:"An unknown error occurred."}),e.NEVER}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salsita-ai/common",
|
|
3
|
-
"version": "0.50.0-develop.
|
|
3
|
+
"version": "0.50.0-develop.d9534cf412",
|
|
4
4
|
"description": "Shared Phoenix utilities, environment loading, and lint and formatting configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salsita",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
67
67
|
"vite": "6.4.3",
|
|
68
68
|
"vitest": "4.1.11",
|
|
69
|
-
"@salsita-ai/common": "0.50.0-develop.
|
|
69
|
+
"@salsita-ai/common": "0.50.0-develop.d9534cf412"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"envalid": "8.1.1",
|