open-bot-avatar 0.1.1 → 0.2.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/src/types.ts CHANGED
@@ -44,7 +44,10 @@ export interface RenderOptions {
44
44
  color?: string;
45
45
  /** Eye color as #rgb or #rrggbb. Defaults to a plain near-black ink. */
46
46
  eyeColor?: string;
47
- /** Rendered width/height in CSS pixels. Omit for a fluid SVG. */
47
+ /**
48
+ * Rendered width/height in CSS pixels. Omit for a fluid SVG. In sceneFrame it lets small
49
+ * live avatars skip cross-sections that would sit less than a pixel apart.
50
+ */
48
51
  size?: number;
49
52
  /** Volume amount 0..14 (default 6 = natural depth; 0 = flat). Scales every part's inferred depth. */
50
53
  depth?: number;
package/src/validate.ts CHANGED
@@ -211,7 +211,7 @@ export function validateAvatar(input: unknown): ValidationResult {
211
211
  errors.push('name must be 1-40 printable characters without < or >');
212
212
  }
213
213
 
214
- let path = '';
214
+ let path: string | null = null;
215
215
  if (!isRecord(input.body)) errors.push('body must be an object { "path": "..." }');
216
216
  else {
217
217
  for (const k of Object.keys(input.body)) if (k !== 'path') errors.push(`unknown field "body.${k}" (only "path" is allowed)`);
@@ -238,7 +238,7 @@ export function validateAvatar(input: unknown): ValidationResult {
238
238
 
239
239
  let normalized = '';
240
240
  let body: BodyAnalysis | null = null;
241
- if (path) {
241
+ if (path !== null) {
242
242
  try {
243
243
  const segs = parsePath(path);
244
244
  normalized = serializePath(segs);