@khanacademy/perseus-core 19.0.0 → 19.0.2

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.
@@ -1,2 +1,9 @@
1
1
  import type { Parser } from "../parser-types";
2
2
  export declare function defaulted<T>(parser: Parser<T>, fallback: (missingValue: null | undefined) => NoInfer<T>): Parser<T>;
3
+ /**
4
+ * Similar to defaulted, but specifically handles empty strings as invalid.
5
+ *
6
+ * @param fallback Function that generates a fallback value for empty/missing strings
7
+ * @returns Parser that validates non-empty strings or uses fallback
8
+ */
9
+ export declare function defaultedNonEmptyString(fallback: () => string): Parser<string>;
@@ -2,6 +2,7 @@ export * from "./any";
2
2
  export * from "./array";
3
3
  export * from "./boolean";
4
4
  export * from "./constant";
5
+ export * from "./defaulted";
5
6
  export * from "./enumeration";
6
7
  export * from "./is-plain-object";
7
8
  export * from "./nullable";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Shared Perseus infrastructure",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "19.0.0",
6
+ "version": "19.0.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },