@wrongstack/primitives 0.316.2 → 0.317.0

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/dist/index.js CHANGED
@@ -86,7 +86,7 @@ function hasAmbiguousQuantifiedAlternation(pattern) {
86
86
  }
87
87
  return false;
88
88
  }
89
- function compileUserRegex(pattern, flags) {
89
+ function compileUserRegex(pattern, flags = "") {
90
90
  if (typeof pattern !== "string") {
91
91
  return { ok: false, reason: "pattern must be a string" };
92
92
  }
@@ -144,7 +144,7 @@ function systemSessionId(actor) {
144
144
  return `${SYSTEM_SESSION_PREFIX}${actor}`;
145
145
  }
146
146
  function isSystemSessionId(sessionId) {
147
- return sessionId.startsWith(SYSTEM_SESSION_PREFIX);
147
+ return typeof sessionId === "string" && sessionId.startsWith(SYSTEM_SESSION_PREFIX);
148
148
  }
149
149
 
150
150
  // src/time.ts
@@ -30,7 +30,7 @@ export interface CompileFail {
30
30
  reason: string;
31
31
  }
32
32
  export type CompileUserRegexResult = CompileResult | CompileFail;
33
- export declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail;
33
+ export declare function compileUserRegex(pattern: string, flags?: string): CompileResult | CompileFail;
34
34
  /**
35
35
  * Maximum subject length handed to a user-supplied regex before matching.
36
36
  * A linear-time pattern over a multi-megabyte line is still a stall; tools
@@ -25,5 +25,5 @@ export declare const SYSTEM_SESSION_PREFIX: 'system:';
25
25
  */
26
26
  export declare function systemSessionId(actor: string): string;
27
27
  /** Whether this id names a daemon rather than a user session. */
28
- export declare function isSystemSessionId(sessionId: string): boolean;
28
+ export declare function isSystemSessionId(sessionId: string | null | undefined): boolean;
29
29
  //# sourceMappingURL=session-id.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/primitives",
3
- "version": "0.316.2",
3
+ "version": "0.317.0",
4
4
  "license": "MIT",
5
5
  "description": "Dependency-leaf primitives shared across WrongStack packages (regex guard, slugs, timestamps).",
6
6
  "repository": {