@dicebear/core 10.3.0 → 10.3.1
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/lib/Validator/OptionsValidator.js +631 -464
- package/lib/Validator/StyleValidator.js +79 -6
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@ import { StyleValidationError } from '../Error/StyleValidationError.js';
|
|
|
2
2
|
function ucs2length(str) { let n = 0; for (const _ of str)
|
|
3
3
|
n++; return n; }
|
|
4
4
|
"use strict";
|
|
5
|
-
const schema11 = { "$id": "https://cdn.hopjs.net/npm/@dicebear/schema@1.1.0/dist/definition.min.json", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "camelCaseName": { "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.", "type": "string", "pattern": "^[a-z][a-zA-Z0-9]*$", "maxLength": 64 }, "colorName": { "description": "A reference to a color palette defined in the top-level `colors` section.", "allOf": [{ "$ref": "#/definitions/camelCaseName" }] }, "componentName": { "description": "A reference to a component defined in the top-level `components` section.", "allOf": [{ "$ref": "#/definitions/camelCaseName" }] }, "translateValue": { "description": "A translation value expressed as a percentage of the component's width (for `x`) or height (for `y`). Defines a range the PRNG picks from. Set `min === max` for a fixed value. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": -1000, "maximum": 1000 }, "max": { "type": "number", "minimum": -1000, "maximum": 1000 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 2000 } }, "required": ["min", "max"], "additionalProperties": false }, "hexColor": { "description": "A hex color with leading `#`, in 3, 4, 6, or 8 digit form.", "type": "string", "pattern": "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", "maxLength": 9 }, "colorValue": { "description": "A color value for `fill`, `stroke`, `stop-color`, and other color attributes. Either a plain string (any CSS color format — named color, hex, `rgb()`, `oklch()`, `color-mix()`, local paint server reference `url(#id)`, etc.) or an object referencing a named color palette defined in the top-level `colors` section. CSS color syntax is not validated; invalid colors are the browser's problem.", "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "description": "A reference to a named color palette. At render time, the PRNG selects a color value from the referenced palette.", "type": "object", "properties": { "type": { "const": "color" }, "name": { "description": "The name of the color palette to reference.", "$ref": "#/definitions/colorName" } }, "required": ["type", "name"], "additionalProperties": false }] }, "safeUrl": { "description": "A URL restricted to HTTP and HTTPS protocols.", "type": "string", "pattern": "^https?://", "maxLength": 2048 }, "filteredString": { "description": "Base definition for the filtered-string family (`attributeString`, `cssString`). Blocks a shared set of known-dangerous patterns: external `url(...)` references (local `url(#id)` is allowed), `expression()`, `behavior:`, `-moz-binding`, `javascript:` / `vbscript:` URI schemes, and backslash escape sequences. This is not a general CSS sanitizer — it is a defense-in-depth injection filter, so substring matches of blocked tokens will reject otherwise-harmless strings (e.g. a plain text containing the literal word `javascript:`). The `maxLength` here acts as an absolute ceiling for all derivatives; callers narrow it further.", "type": "string", "maxLength": 16384, "not": { "type": "string", "anyOf": [{ "type": "string", "pattern": "[uU][rR][lL]\\s*\\(\\s*[^#)\\s]" }, { "type": "string", "pattern": "[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\s*\\(" }, { "type": "string", "pattern": "[bB][eE][hH][aA][vV][iI][oO][rR]\\s*:" }, { "type": "string", "pattern": "-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]" }, { "type": "string", "pattern": "[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]\\s*:" }, { "type": "string", "pattern": "[vV][bB][sS][cC][rR][iI][pP][tT]\\s*:" }, { "type": "string", "pattern": "\\\\" }] } }, "attributeString": { "description": "The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 1024 }, "pathDataString": { "description": "Used for the `d` attribute of `<path>`. Same filter as `attributeString`, but with a much larger length budget to accommodate complex path geometry.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 16384 }, "cssString": { "description": "Used for inline `style` attribute content and `<style>` element bodies. Known-dangerous `@`-rules — `@import`, `@font-face`, `@document`, `@charset` — are rejected in addition to the common `filteredString` injection filter. Other `@`-rules (`@media`, `@keyframes`, `@supports`, `@layer`, etc.) are permitted, but the `filteredString` injection filter still applies to their contents — so external `url(...)` references inside e.g. an `@media` rule are still blocked. This is not a general CSS sanitizer.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 4096, "not": { "type": "string", "anyOf": [{ "type": "string", "pattern": "@[iI][mM][pP][oO][rR][tT]" }, { "type": "string", "pattern": "@[fF][oO][nN][tT]-[fF][aA][cC][eE]" }, { "type": "string", "pattern": "@[dD][oO][cC][uU][mM][eE][nN][tT]" }, { "type": "string", "pattern": "@[cC][hH][aA][rR][sS][eE][tT]" }] } }, "element": { "description": "An SVG node. One of four mutually exclusive forms, discriminated by `type` (and `name` for the `<style>` special case): a text element, a component reference, a `<style>` element, or any other SVG element.", "anyOf": [{ "$ref": "#/definitions/textElement" }, { "$ref": "#/definitions/componentReference" }, { "$ref": "#/definitions/styleElement" }, { "$ref": "#/definitions/genericElement" }] }, "textElement": { "description": "A raw text node. Its `value` becomes the text content rendered into the parent element.", "type": "object", "properties": { "type": { "const": "text" }, "value": { "description": "Either a plain string, or a `variable` reference resolved at render time to the seed's initials.", "anyOf": [{ "type": "string", "maxLength": 4096 }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "enum": ["initial", "initials"] } }, "required": ["type", "name"], "additionalProperties": false }] } }, "required": ["type", "value"], "additionalProperties": false }, "componentReference": { "description": "A reference to a named component defined in the top-level `components` section. At render time, the PRNG selects one of the component's variants. Optional `attributes` are applied to the generated `<use>` tag — most commonly a `transform` placing the instance, but any allowlisted attribute is accepted.", "type": "object", "properties": { "type": { "const": "component" }, "name": { "$ref": "#/definitions/componentName" }, "attributes": { "$ref": "#/definitions/attributes" } }, "required": ["type", "name"], "additionalProperties": false }, "styleElement": { "description": "An SVG `<style>` element. Its CSS content must be provided as `text` children; each child's value is validated as a CSS string with a stricter content policy than generic SVG attribute values.", "type": "object", "properties": { "type": { "const": "element" }, "name": { "const": "style" }, "attributes": { "$ref": "#/definitions/attributes" }, "children": { "type": "array", "items": { "type": "object", "properties": { "type": { "const": "text" }, "value": { "$ref": "#/definitions/cssString" } }, "required": ["type", "value"], "additionalProperties": false }, "maxItems": 64 } }, "required": ["type", "name"], "additionalProperties": false }, "genericElement": { "description": "Any SVG element other than `<style>`, which has its own stricter content policy.", "type": "object", "properties": { "type": { "const": "element" }, "name": { "description": "The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.", "enum": ["circle", "clipPath", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "g", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "use", "view"] }, "attributes": { "$ref": "#/definitions/attributes" }, "children": { "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 } }, "required": ["type", "name"], "additionalProperties": false }, "attributes": { "description": "A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.", "type": "object", "properties": { "alignment-baseline": { "$ref": "#/definitions/attributeString" }, "amplitude": { "$ref": "#/definitions/attributeString" }, "azimuth": { "$ref": "#/definitions/attributeString" }, "baseFrequency": { "$ref": "#/definitions/attributeString" }, "baseline-shift": { "$ref": "#/definitions/attributeString" }, "bias": { "$ref": "#/definitions/attributeString" }, "class": { "$ref": "#/definitions/attributeString" }, "clipPathUnits": { "$ref": "#/definitions/attributeString" }, "clip-path": { "$ref": "#/definitions/attributeString" }, "clip-rule": { "$ref": "#/definitions/attributeString" }, "color": { "$ref": "#/definitions/colorValue" }, "color-interpolation": { "$ref": "#/definitions/attributeString" }, "color-interpolation-filters": { "$ref": "#/definitions/attributeString" }, "crossorigin": { "$ref": "#/definitions/attributeString" }, "cx": { "$ref": "#/definitions/attributeString" }, "cy": { "$ref": "#/definitions/attributeString" }, "d": { "$ref": "#/definitions/pathDataString" }, "decoding": { "$ref": "#/definitions/attributeString" }, "diffuseConstant": { "$ref": "#/definitions/attributeString" }, "direction": { "$ref": "#/definitions/attributeString" }, "display": { "$ref": "#/definitions/attributeString" }, "divisor": { "$ref": "#/definitions/attributeString" }, "dominant-baseline": { "$ref": "#/definitions/attributeString" }, "dx": { "$ref": "#/definitions/attributeString" }, "dy": { "$ref": "#/definitions/attributeString" }, "edgeMode": { "$ref": "#/definitions/attributeString" }, "elevation": { "$ref": "#/definitions/attributeString" }, "exponent": { "$ref": "#/definitions/attributeString" }, "fill": { "$ref": "#/definitions/colorValue" }, "fill-opacity": { "$ref": "#/definitions/attributeString" }, "fill-rule": { "$ref": "#/definitions/attributeString" }, "filter": { "$ref": "#/definitions/attributeString" }, "filterUnits": { "$ref": "#/definitions/attributeString" }, "flood-color": { "$ref": "#/definitions/colorValue" }, "flood-opacity": { "$ref": "#/definitions/attributeString" }, "font-family": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontFamily" } }, "required": ["type", "name"], "additionalProperties": false }] }, "font-size": { "$ref": "#/definitions/attributeString" }, "font-size-adjust": { "$ref": "#/definitions/attributeString" }, "font-style": { "$ref": "#/definitions/attributeString" }, "font-variant": { "$ref": "#/definitions/attributeString" }, "font-weight": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontWeight" } }, "required": ["type", "name"], "additionalProperties": false }] }, "fx": { "$ref": "#/definitions/attributeString" }, "fy": { "$ref": "#/definitions/attributeString" }, "gradientTransform": { "$ref": "#/definitions/attributeString" }, "gradientUnits": { "$ref": "#/definitions/attributeString" }, "height": { "$ref": "#/definitions/attributeString" }, "href": { "anyOf": [{ "type": "string", "pattern": "^#[a-zA-Z_][a-zA-Z0-9_.-]*$", "maxLength": 128 }, { "type": "string", "pattern": "^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$", "maxLength": 262144 }] }, "id": { "$ref": "#/definitions/attributeString" }, "image-rendering": { "$ref": "#/definitions/attributeString" }, "in": { "$ref": "#/definitions/attributeString" }, "in2": { "$ref": "#/definitions/attributeString" }, "intercept": { "$ref": "#/definitions/attributeString" }, "k1": { "$ref": "#/definitions/attributeString" }, "k2": { "$ref": "#/definitions/attributeString" }, "k3": { "$ref": "#/definitions/attributeString" }, "k4": { "$ref": "#/definitions/attributeString" }, "kernelMatrix": { "$ref": "#/definitions/attributeString" }, "kernelUnitLength": { "$ref": "#/definitions/attributeString" }, "lang": { "$ref": "#/definitions/attributeString" }, "lengthAdjust": { "$ref": "#/definitions/attributeString" }, "letter-spacing": { "$ref": "#/definitions/attributeString" }, "lighting-color": { "$ref": "#/definitions/colorValue" }, "marker-end": { "$ref": "#/definitions/attributeString" }, "marker-mid": { "$ref": "#/definitions/attributeString" }, "marker-start": { "$ref": "#/definitions/attributeString" }, "markerHeight": { "$ref": "#/definitions/attributeString" }, "markerUnits": { "$ref": "#/definitions/attributeString" }, "markerWidth": { "$ref": "#/definitions/attributeString" }, "mask": { "$ref": "#/definitions/attributeString" }, "maskContentUnits": { "$ref": "#/definitions/attributeString" }, "maskUnits": { "$ref": "#/definitions/attributeString" }, "media": { "$ref": "#/definitions/attributeString" }, "method": { "$ref": "#/definitions/attributeString" }, "mode": { "$ref": "#/definitions/attributeString" }, "numOctaves": { "$ref": "#/definitions/attributeString" }, "offset": { "$ref": "#/definitions/attributeString" }, "opacity": { "$ref": "#/definitions/attributeString" }, "operator": { "$ref": "#/definitions/attributeString" }, "order": { "$ref": "#/definitions/attributeString" }, "orient": { "$ref": "#/definitions/attributeString" }, "overflow": { "$ref": "#/definitions/attributeString" }, "paint-order": { "$ref": "#/definitions/attributeString" }, "path": { "$ref": "#/definitions/attributeString" }, "pathLength": { "$ref": "#/definitions/attributeString" }, "patternContentUnits": { "$ref": "#/definitions/attributeString" }, "patternTransform": { "$ref": "#/definitions/attributeString" }, "patternUnits": { "$ref": "#/definitions/attributeString" }, "points": { "$ref": "#/definitions/attributeString" }, "preserveAlpha": { "$ref": "#/definitions/attributeString" }, "preserveAspectRatio": { "$ref": "#/definitions/attributeString" }, "primitiveUnits": { "$ref": "#/definitions/attributeString" }, "r": { "$ref": "#/definitions/attributeString" }, "radius": { "$ref": "#/definitions/attributeString" }, "refX": { "$ref": "#/definitions/attributeString" }, "refY": { "$ref": "#/definitions/attributeString" }, "result": { "$ref": "#/definitions/attributeString" }, "rx": { "$ref": "#/definitions/attributeString" }, "ry": { "$ref": "#/definitions/attributeString" }, "scale": { "$ref": "#/definitions/attributeString" }, "seed": { "$ref": "#/definitions/attributeString" }, "shape-rendering": { "$ref": "#/definitions/attributeString" }, "slope": { "$ref": "#/definitions/attributeString" }, "specularConstant": { "$ref": "#/definitions/attributeString" }, "specularExponent": { "$ref": "#/definitions/attributeString" }, "spreadMethod": { "$ref": "#/definitions/attributeString" }, "startOffset": { "$ref": "#/definitions/attributeString" }, "stdDeviation": { "$ref": "#/definitions/attributeString" }, "stitchTiles": { "$ref": "#/definitions/attributeString" }, "stop-color": { "$ref": "#/definitions/colorValue" }, "stop-opacity": { "$ref": "#/definitions/attributeString" }, "stroke": { "$ref": "#/definitions/colorValue" }, "stroke-dasharray": { "$ref": "#/definitions/attributeString" }, "stroke-dashoffset": { "$ref": "#/definitions/attributeString" }, "stroke-linecap": { "$ref": "#/definitions/attributeString" }, "stroke-linejoin": { "$ref": "#/definitions/attributeString" }, "stroke-miterlimit": { "$ref": "#/definitions/attributeString" }, "stroke-opacity": { "$ref": "#/definitions/attributeString" }, "stroke-width": { "$ref": "#/definitions/attributeString" }, "style": { "$ref": "#/definitions/cssString" }, "surfaceScale": { "$ref": "#/definitions/attributeString" }, "systemLanguage": { "$ref": "#/definitions/attributeString" }, "tabindex": { "$ref": "#/definitions/attributeString" }, "tableValues": { "$ref": "#/definitions/attributeString" }, "targetX": { "$ref": "#/definitions/attributeString" }, "targetY": { "$ref": "#/definitions/attributeString" }, "text-anchor": { "$ref": "#/definitions/attributeString" }, "text-decoration": { "$ref": "#/definitions/attributeString" }, "text-rendering": { "$ref": "#/definitions/attributeString" }, "textLength": { "$ref": "#/definitions/attributeString" }, "transform": { "$ref": "#/definitions/attributeString" }, "transform-origin": { "$ref": "#/definitions/attributeString" }, "type": { "$ref": "#/definitions/attributeString" }, "values": { "$ref": "#/definitions/attributeString" }, "viewBox": { "$ref": "#/definitions/attributeString" }, "visibility": { "$ref": "#/definitions/attributeString" }, "width": { "$ref": "#/definitions/attributeString" }, "word-spacing": { "$ref": "#/definitions/attributeString" }, "writing-mode": { "$ref": "#/definitions/attributeString" }, "x": { "$ref": "#/definitions/attributeString" }, "x1": { "$ref": "#/definitions/attributeString" }, "x2": { "$ref": "#/definitions/attributeString" }, "xChannelSelector": { "$ref": "#/definitions/attributeString" }, "y": { "$ref": "#/definitions/attributeString" }, "y1": { "$ref": "#/definitions/attributeString" }, "y2": { "$ref": "#/definitions/attributeString" }, "yChannelSelector": { "$ref": "#/definitions/attributeString" }, "z": { "$ref": "#/definitions/attributeString" } }, "additionalProperties": false }, "componentProbability": { "description": "The probability, expressed as a percentage, that this component is rendered at all.", "type": "number", "minimum": 0, "maximum": 100 }, "componentRotate": { "description": "A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": -360, "maximum": 360 }, "max": { "type": "number", "minimum": -360, "maximum": 360 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 720 } }, "required": ["min", "max"], "additionalProperties": false }, "componentScale": { "description": "A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": 0, "maximum": 10 }, "max": { "type": "number", "minimum": 0, "maximum": 10 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 10 } }, "required": ["min", "max"], "additionalProperties": false }, "componentTranslate": { "description": "A positional translation applied to the component after placement. Values are interpreted as a percentage of the component's size.", "type": "object", "properties": { "x": { "$ref": "#/definitions/translateValue" }, "y": { "$ref": "#/definitions/translateValue" } }, "additionalProperties": false }, "componentBase": { "description": "A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.", "type": "object", "properties": { "width": { "description": "The natural width of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "probability": { "$ref": "#/definitions/componentProbability" }, "rotate": { "$ref": "#/definitions/componentRotate" }, "scale": { "$ref": "#/definitions/componentScale" }, "translate": { "$ref": "#/definitions/componentTranslate" }, "variants": { "description": "The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "elements": { "description": "The SVG elements that make up this variant.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "weight": { "description": "A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.", "type": "number", "minimum": 0, "maximum": 1000000 } }, "required": ["elements"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["width", "height", "variants"], "additionalProperties": false }, "componentAlias": { "description": "An alias that inherits its dimensions, variants, and transforms from another component referenced by `extends`. Aliases have no per-instance overrides — they are pure references.", "type": "object", "properties": { "extends": { "description": "The name of an existing, non-alias component in this `components` map.", "$ref": "#/definitions/componentName" } }, "required": ["extends"], "additionalProperties": false } }, "type": "object", "properties": { "$id": { "type": "string", "maxLength": 256 }, "$schema": { "type": "string", "maxLength": 256 }, "$comment": { "type": "string", "maxLength": 4096 }, "meta": { "description": "Metadata about the avatar style, such as license information, creator details, and source references.", "type": "object", "properties": { "license": { "description": "License information for the avatar style.", "type": "object", "properties": { "name": { "description": "The name of the license, e.g. `CC BY 4.0`.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the full license text.", "$ref": "#/definitions/safeUrl" }, "text": { "description": "The full license text.", "type": "string", "maxLength": 32768 } }, "additionalProperties": false }, "creator": { "description": "Information about the creator of the avatar style.", "type": "object", "properties": { "name": { "description": "The name of the creator.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the creator's website or profile.", "$ref": "#/definitions/safeUrl" } }, "additionalProperties": false }, "source": { "description": "Information about the original source of the artwork.", "type": "object", "properties": { "name": { "description": "The name of the original source.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the original source.", "$ref": "#/definitions/safeUrl" } }, "additionalProperties": false } }, "additionalProperties": false }, "attributes": { "description": "Global SVG presentation attributes applied to the root `<svg>` element.", "$ref": "#/definitions/attributes" }, "canvas": { "description": "The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.", "type": "object", "properties": { "elements": { "description": "The list of SVG elements that make up the avatar.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "width": { "description": "The natural width of the avatar canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the avatar canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 } }, "required": ["elements", "width", "height"], "additionalProperties": false }, "components": { "description": "Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time, or aliases another component to render an additional, independently-randomized instance of it. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "anyOf": [{ "$ref": "#/definitions/componentBase" }, { "$ref": "#/definitions/componentAlias" }] }, "maxProperties": 512 }, "colors": { "description": "Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "values": { "description": "The list of hex color values the PRNG can choose from.", "type": "array", "items": { "$ref": "#/definitions/hexColor" }, "minItems": 1, "maxItems": 128 }, "notEqualTo": { "description": "A list of other color names. The selected color value must differ from the color values selected in those colors. The schema does not prevent cycles (e.g. `a` notEqualTo `b` and `b` notEqualTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.", "type": "array", "items": { "$ref": "#/definitions/colorName" }, "maxItems": 64 }, "contrastTo": { "description": "The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen. The schema does not prevent cycles (e.g. `a` contrastTo `b` and `b` contrastTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.", "$ref": "#/definitions/colorName" } }, "required": ["values"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["canvas"], "additionalProperties": false };
|
|
5
|
+
const schema11 = { "$id": "https://cdn.hopjs.net/npm/@dicebear/schema@1.3.0/dist/definition.min.json", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "camelCaseName": { "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.", "type": "string", "pattern": "^[a-z][a-zA-Z0-9]*$", "maxLength": 64 }, "colorName": { "description": "A reference to a color palette defined in the top-level `colors` section.", "allOf": [{ "$ref": "#/definitions/camelCaseName" }] }, "componentName": { "description": "A reference to a component defined in the top-level `components` section.", "allOf": [{ "$ref": "#/definitions/camelCaseName" }] }, "translateValue": { "description": "A translation value expressed as a percentage of the component's width (for `x`) or height (for `y`). Defines a range the PRNG picks from. Set `min === max` for a fixed value. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": -1000, "maximum": 1000 }, "max": { "type": "number", "minimum": -1000, "maximum": 1000 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 2000 } }, "required": ["min", "max"], "additionalProperties": false }, "hexColor": { "description": "A hex color with leading `#`, in 3, 4, 6, or 8 digit form.", "type": "string", "pattern": "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", "maxLength": 9 }, "colorValue": { "description": "A color value for `fill`, `stroke`, `stop-color`, and other color attributes. Either a plain string (any CSS color format — named color, hex, `rgb()`, `oklch()`, `color-mix()`, local paint server reference `url(#id)`, etc.) or an object referencing a named color palette defined in the top-level `colors` section. CSS color syntax is not validated; invalid colors are the browser's problem.", "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "description": "A reference to a named color palette. At render time, the PRNG selects a color value from the referenced palette.", "type": "object", "properties": { "type": { "const": "color" }, "name": { "description": "The name of the color palette to reference.", "$ref": "#/definitions/colorName" } }, "required": ["type", "name"], "additionalProperties": false }] }, "safeUrl": { "description": "A URL restricted to HTTP and HTTPS protocols.", "type": "string", "pattern": "^https?://", "maxLength": 2048 }, "filteredString": { "description": "Base definition for the filtered-string family (`attributeString`, `cssString`). Blocks a shared set of known-dangerous patterns: external `url(...)` references (local `url(#id)` is allowed), `expression()`, `behavior:`, `-moz-binding`, `javascript:` / `vbscript:` URI schemes, and backslash escape sequences. This is not a general CSS sanitizer — it is a defense-in-depth injection filter, so substring matches of blocked tokens will reject otherwise-harmless strings (e.g. a plain text containing the literal word `javascript:`). The `maxLength` here acts as an absolute ceiling for all derivatives; callers narrow it further.", "type": "string", "maxLength": 16384, "not": { "type": "string", "anyOf": [{ "type": "string", "pattern": "[uU][rR][lL]\\s*\\(\\s*[^#)\\s]" }, { "type": "string", "pattern": "[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\s*\\(" }, { "type": "string", "pattern": "[bB][eE][hH][aA][vV][iI][oO][rR]\\s*:" }, { "type": "string", "pattern": "-[mM][oO][zZ]-[bB][iI][nN][dD][iI][nN][gG]" }, { "type": "string", "pattern": "[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]\\s*:" }, { "type": "string", "pattern": "[vV][bB][sS][cC][rR][iI][pP][tT]\\s*:" }, { "type": "string", "pattern": "\\\\" }] } }, "attributeString": { "description": "The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 1024 }, "pathDataString": { "description": "Used for the `d` attribute of `<path>`. Same filter as `attributeString`, but with a much larger length budget to accommodate complex path geometry.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 16384 }, "cssString": { "description": "Used for inline `style` attribute content and `<style>` element bodies. Known-dangerous `@`-rules — `@import`, `@font-face`, `@document`, `@charset` — are rejected in addition to the common `filteredString` injection filter. Other `@`-rules (`@media`, `@keyframes`, `@supports`, `@layer`, etc.) are permitted, but the `filteredString` injection filter still applies to their contents — so external `url(...)` references inside e.g. an `@media` rule are still blocked. This is not a general CSS sanitizer.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 4096, "not": { "type": "string", "anyOf": [{ "type": "string", "pattern": "@[iI][mM][pP][oO][rR][tT]" }, { "type": "string", "pattern": "@[fF][oO][nN][tT]-[fF][aA][cC][eE]" }, { "type": "string", "pattern": "@[dD][oO][cC][uU][mM][eE][nN][tT]" }, { "type": "string", "pattern": "@[cC][hH][aA][rR][sS][eE][tT]" }] } }, "element": { "description": "An SVG node. One of four mutually exclusive forms, discriminated by `type` (and `name` for the `<style>` special case): a text element, a component reference, a `<style>` element, or any other SVG element.", "anyOf": [{ "$ref": "#/definitions/textElement" }, { "$ref": "#/definitions/componentReference" }, { "$ref": "#/definitions/styleElement" }, { "$ref": "#/definitions/genericElement" }] }, "textElement": { "description": "A raw text node. Its `value` becomes the text content rendered into the parent element.", "type": "object", "properties": { "type": { "const": "text" }, "value": { "description": "Either a plain string, or a `variable` reference resolved at render time to the seed's initials.", "anyOf": [{ "type": "string", "maxLength": 4096 }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "enum": ["initial", "initials"] } }, "required": ["type", "name"], "additionalProperties": false }] } }, "required": ["type", "value"], "additionalProperties": false }, "componentReference": { "description": "A reference to a named component defined in the top-level `components` section. At render time, the PRNG selects one of the component's variants. Optional `attributes` are applied to the generated `<use>` tag — most commonly a `transform` placing the instance, but any allowlisted attribute is accepted.", "type": "object", "properties": { "type": { "const": "component" }, "name": { "$ref": "#/definitions/componentName" }, "attributes": { "$ref": "#/definitions/attributes" } }, "required": ["type", "name"], "additionalProperties": false }, "styleElement": { "description": "An SVG `<style>` element. Its CSS content must be provided as `text` children; each child's value is validated as a CSS string with a stricter content policy than generic SVG attribute values.", "type": "object", "properties": { "type": { "const": "element" }, "name": { "const": "style" }, "attributes": { "$ref": "#/definitions/attributes" }, "children": { "type": "array", "items": { "type": "object", "properties": { "type": { "const": "text" }, "value": { "$ref": "#/definitions/cssString" } }, "required": ["type", "value"], "additionalProperties": false }, "maxItems": 64 } }, "required": ["type", "name"], "additionalProperties": false }, "genericElement": { "description": "Any SVG element other than `<style>`, which has its own stricter content policy.", "type": "object", "properties": { "type": { "const": "element" }, "name": { "description": "The SVG tag name. Only a safe subset of SVG elements is permitted; dangerous elements such as `script`, `foreignObject`, or `a` are excluded.", "enum": ["circle", "clipPath", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "g", "image", "line", "linearGradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "title", "tspan", "use", "view"] }, "attributes": { "$ref": "#/definitions/attributes" }, "children": { "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 } }, "required": ["type", "name"], "additionalProperties": false }, "attributes": { "description": "A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.", "type": "object", "properties": { "alignment-baseline": { "$ref": "#/definitions/attributeString" }, "amplitude": { "$ref": "#/definitions/attributeString" }, "azimuth": { "$ref": "#/definitions/attributeString" }, "baseFrequency": { "$ref": "#/definitions/attributeString" }, "baseline-shift": { "$ref": "#/definitions/attributeString" }, "bias": { "$ref": "#/definitions/attributeString" }, "class": { "$ref": "#/definitions/attributeString" }, "clipPathUnits": { "$ref": "#/definitions/attributeString" }, "clip-path": { "$ref": "#/definitions/attributeString" }, "clip-rule": { "$ref": "#/definitions/attributeString" }, "color": { "$ref": "#/definitions/colorValue" }, "color-interpolation": { "$ref": "#/definitions/attributeString" }, "color-interpolation-filters": { "$ref": "#/definitions/attributeString" }, "crossorigin": { "$ref": "#/definitions/attributeString" }, "cx": { "$ref": "#/definitions/attributeString" }, "cy": { "$ref": "#/definitions/attributeString" }, "d": { "$ref": "#/definitions/pathDataString" }, "decoding": { "$ref": "#/definitions/attributeString" }, "diffuseConstant": { "$ref": "#/definitions/attributeString" }, "direction": { "$ref": "#/definitions/attributeString" }, "display": { "$ref": "#/definitions/attributeString" }, "divisor": { "$ref": "#/definitions/attributeString" }, "dominant-baseline": { "$ref": "#/definitions/attributeString" }, "dx": { "$ref": "#/definitions/attributeString" }, "dy": { "$ref": "#/definitions/attributeString" }, "edgeMode": { "$ref": "#/definitions/attributeString" }, "elevation": { "$ref": "#/definitions/attributeString" }, "exponent": { "$ref": "#/definitions/attributeString" }, "fill": { "$ref": "#/definitions/colorValue" }, "fill-opacity": { "$ref": "#/definitions/attributeString" }, "fill-rule": { "$ref": "#/definitions/attributeString" }, "filter": { "$ref": "#/definitions/attributeString" }, "filterUnits": { "$ref": "#/definitions/attributeString" }, "flood-color": { "$ref": "#/definitions/colorValue" }, "flood-opacity": { "$ref": "#/definitions/attributeString" }, "font-family": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontFamily" } }, "required": ["type", "name"], "additionalProperties": false }] }, "font-size": { "$ref": "#/definitions/attributeString" }, "font-size-adjust": { "$ref": "#/definitions/attributeString" }, "font-style": { "$ref": "#/definitions/attributeString" }, "font-variant": { "$ref": "#/definitions/attributeString" }, "font-weight": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontWeight" } }, "required": ["type", "name"], "additionalProperties": false }] }, "fx": { "$ref": "#/definitions/attributeString" }, "fy": { "$ref": "#/definitions/attributeString" }, "gradientTransform": { "$ref": "#/definitions/attributeString" }, "gradientUnits": { "$ref": "#/definitions/attributeString" }, "height": { "$ref": "#/definitions/attributeString" }, "href": { "anyOf": [{ "type": "string", "pattern": "^#[a-zA-Z_][a-zA-Z0-9_.-]*$", "maxLength": 128 }, { "type": "string", "pattern": "^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$", "maxLength": 262144 }] }, "id": { "$ref": "#/definitions/attributeString" }, "image-rendering": { "$ref": "#/definitions/attributeString" }, "in": { "$ref": "#/definitions/attributeString" }, "in2": { "$ref": "#/definitions/attributeString" }, "intercept": { "$ref": "#/definitions/attributeString" }, "k1": { "$ref": "#/definitions/attributeString" }, "k2": { "$ref": "#/definitions/attributeString" }, "k3": { "$ref": "#/definitions/attributeString" }, "k4": { "$ref": "#/definitions/attributeString" }, "kernelMatrix": { "$ref": "#/definitions/attributeString" }, "kernelUnitLength": { "$ref": "#/definitions/attributeString" }, "lang": { "$ref": "#/definitions/attributeString" }, "lengthAdjust": { "$ref": "#/definitions/attributeString" }, "letter-spacing": { "$ref": "#/definitions/attributeString" }, "lighting-color": { "$ref": "#/definitions/colorValue" }, "marker-end": { "$ref": "#/definitions/attributeString" }, "marker-mid": { "$ref": "#/definitions/attributeString" }, "marker-start": { "$ref": "#/definitions/attributeString" }, "markerHeight": { "$ref": "#/definitions/attributeString" }, "markerUnits": { "$ref": "#/definitions/attributeString" }, "markerWidth": { "$ref": "#/definitions/attributeString" }, "mask": { "$ref": "#/definitions/attributeString" }, "maskContentUnits": { "$ref": "#/definitions/attributeString" }, "maskUnits": { "$ref": "#/definitions/attributeString" }, "media": { "$ref": "#/definitions/attributeString" }, "method": { "$ref": "#/definitions/attributeString" }, "mode": { "$ref": "#/definitions/attributeString" }, "numOctaves": { "$ref": "#/definitions/attributeString" }, "offset": { "$ref": "#/definitions/attributeString" }, "opacity": { "$ref": "#/definitions/attributeString" }, "operator": { "$ref": "#/definitions/attributeString" }, "order": { "$ref": "#/definitions/attributeString" }, "orient": { "$ref": "#/definitions/attributeString" }, "overflow": { "$ref": "#/definitions/attributeString" }, "paint-order": { "$ref": "#/definitions/attributeString" }, "path": { "$ref": "#/definitions/attributeString" }, "pathLength": { "$ref": "#/definitions/attributeString" }, "patternContentUnits": { "$ref": "#/definitions/attributeString" }, "patternTransform": { "$ref": "#/definitions/attributeString" }, "patternUnits": { "$ref": "#/definitions/attributeString" }, "points": { "$ref": "#/definitions/attributeString" }, "preserveAlpha": { "$ref": "#/definitions/attributeString" }, "preserveAspectRatio": { "$ref": "#/definitions/attributeString" }, "primitiveUnits": { "$ref": "#/definitions/attributeString" }, "r": { "$ref": "#/definitions/attributeString" }, "radius": { "$ref": "#/definitions/attributeString" }, "refX": { "$ref": "#/definitions/attributeString" }, "refY": { "$ref": "#/definitions/attributeString" }, "result": { "$ref": "#/definitions/attributeString" }, "rx": { "$ref": "#/definitions/attributeString" }, "ry": { "$ref": "#/definitions/attributeString" }, "scale": { "$ref": "#/definitions/attributeString" }, "seed": { "$ref": "#/definitions/attributeString" }, "shape-rendering": { "$ref": "#/definitions/attributeString" }, "slope": { "$ref": "#/definitions/attributeString" }, "specularConstant": { "$ref": "#/definitions/attributeString" }, "specularExponent": { "$ref": "#/definitions/attributeString" }, "spreadMethod": { "$ref": "#/definitions/attributeString" }, "startOffset": { "$ref": "#/definitions/attributeString" }, "stdDeviation": { "$ref": "#/definitions/attributeString" }, "stitchTiles": { "$ref": "#/definitions/attributeString" }, "stop-color": { "$ref": "#/definitions/colorValue" }, "stop-opacity": { "$ref": "#/definitions/attributeString" }, "stroke": { "$ref": "#/definitions/colorValue" }, "stroke-dasharray": { "$ref": "#/definitions/attributeString" }, "stroke-dashoffset": { "$ref": "#/definitions/attributeString" }, "stroke-linecap": { "$ref": "#/definitions/attributeString" }, "stroke-linejoin": { "$ref": "#/definitions/attributeString" }, "stroke-miterlimit": { "$ref": "#/definitions/attributeString" }, "stroke-opacity": { "$ref": "#/definitions/attributeString" }, "stroke-width": { "$ref": "#/definitions/attributeString" }, "style": { "$ref": "#/definitions/cssString" }, "surfaceScale": { "$ref": "#/definitions/attributeString" }, "systemLanguage": { "$ref": "#/definitions/attributeString" }, "tabindex": { "$ref": "#/definitions/attributeString" }, "tableValues": { "$ref": "#/definitions/attributeString" }, "targetX": { "$ref": "#/definitions/attributeString" }, "targetY": { "$ref": "#/definitions/attributeString" }, "text-anchor": { "$ref": "#/definitions/attributeString" }, "text-decoration": { "$ref": "#/definitions/attributeString" }, "text-rendering": { "$ref": "#/definitions/attributeString" }, "textLength": { "$ref": "#/definitions/attributeString" }, "transform": { "$ref": "#/definitions/attributeString" }, "transform-origin": { "$ref": "#/definitions/attributeString" }, "type": { "$ref": "#/definitions/attributeString" }, "values": { "$ref": "#/definitions/attributeString" }, "viewBox": { "$ref": "#/definitions/attributeString" }, "visibility": { "$ref": "#/definitions/attributeString" }, "width": { "$ref": "#/definitions/attributeString" }, "word-spacing": { "$ref": "#/definitions/attributeString" }, "writing-mode": { "$ref": "#/definitions/attributeString" }, "x": { "$ref": "#/definitions/attributeString" }, "x1": { "$ref": "#/definitions/attributeString" }, "x2": { "$ref": "#/definitions/attributeString" }, "xChannelSelector": { "$ref": "#/definitions/attributeString" }, "y": { "$ref": "#/definitions/attributeString" }, "y1": { "$ref": "#/definitions/attributeString" }, "y2": { "$ref": "#/definitions/attributeString" }, "yChannelSelector": { "$ref": "#/definitions/attributeString" }, "z": { "$ref": "#/definitions/attributeString" } }, "additionalProperties": false }, "componentProbability": { "description": "The probability, expressed as a percentage, that this component is rendered at all.", "type": "number", "minimum": 0, "maximum": 100 }, "componentRotate": { "description": "A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": -360, "maximum": 360 }, "max": { "type": "number", "minimum": -360, "maximum": 360 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 720 } }, "required": ["min", "max"], "additionalProperties": false }, "componentScale": { "description": "A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": 0, "maximum": 10 }, "max": { "type": "number", "minimum": 0, "maximum": 10 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 10 } }, "required": ["min", "max"], "additionalProperties": false }, "componentTranslate": { "description": "A positional translation applied to the component after placement. Values are interpreted as a percentage of the component's size.", "type": "object", "properties": { "x": { "$ref": "#/definitions/translateValue" }, "y": { "$ref": "#/definitions/translateValue" } }, "additionalProperties": false }, "componentBase": { "description": "A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.", "type": "object", "properties": { "width": { "description": "The natural width of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "probability": { "$ref": "#/definitions/componentProbability" }, "rotate": { "$ref": "#/definitions/componentRotate" }, "scale": { "$ref": "#/definitions/componentScale" }, "translate": { "$ref": "#/definitions/componentTranslate" }, "variants": { "description": "The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "elements": { "description": "The SVG elements that make up this variant.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "weight": { "description": "A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.", "type": "number", "minimum": 0, "maximum": 1000000 }, "tags": { "description": "Optional tags for this variant (e.g. `hairLength:long`, `facialHair:beard`). The `tags` render option uses them to filter the variant pool.", "type": "array", "items": { "description": "A tag of the form `category` or `category:value`, where the category is an axis (e.g. `hairLength`, `mouthExpression`) and the value is its setting on that axis (e.g. `hairLength:long`). Each segment is camelCase.", "type": "string", "pattern": "^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$", "maxLength": 129 }, "uniqueItems": true, "maxItems": 32 } }, "required": ["elements"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["width", "height", "variants"], "additionalProperties": false }, "componentAlias": { "description": "An alias that inherits its dimensions, variants, and transforms from another component referenced by `extends`. Aliases have no per-instance overrides — they are pure references.", "type": "object", "properties": { "extends": { "description": "The name of an existing, non-alias component in this `components` map.", "$ref": "#/definitions/componentName" } }, "required": ["extends"], "additionalProperties": false } }, "type": "object", "properties": { "$id": { "type": "string", "maxLength": 256 }, "$schema": { "type": "string", "maxLength": 256 }, "$comment": { "type": "string", "maxLength": 4096 }, "meta": { "description": "Metadata about the avatar style, such as license information, creator details, and source references.", "type": "object", "properties": { "license": { "description": "License information for the avatar style.", "type": "object", "properties": { "name": { "description": "The name of the license, e.g. `CC BY 4.0`.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the full license text.", "$ref": "#/definitions/safeUrl" }, "text": { "description": "The full license text.", "type": "string", "maxLength": 32768 } }, "additionalProperties": false }, "creator": { "description": "Information about the creator of the avatar style.", "type": "object", "properties": { "name": { "description": "The name of the creator.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the creator's website or profile.", "$ref": "#/definitions/safeUrl" } }, "additionalProperties": false }, "source": { "description": "Information about the original source of the artwork.", "type": "object", "properties": { "name": { "description": "The name of the original source.", "type": "string", "maxLength": 128 }, "url": { "description": "A link to the original source.", "$ref": "#/definitions/safeUrl" } }, "additionalProperties": false } }, "additionalProperties": false }, "attributes": { "description": "Global SVG presentation attributes applied to the root `<svg>` element.", "$ref": "#/definitions/attributes" }, "canvas": { "description": "The main content of the avatar, defining the SVG structure, canvas dimensions, and element tree.", "type": "object", "properties": { "elements": { "description": "The list of SVG elements that make up the avatar.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "width": { "description": "The natural width of the avatar canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the avatar canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 } }, "required": ["elements", "width", "height"], "additionalProperties": false }, "components": { "description": "Named, reusable SVG components. Each component defines a set of variants that the PRNG can select from at render time, or aliases another component to render an additional, independently-randomized instance of it. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "anyOf": [{ "$ref": "#/definitions/componentBase" }, { "$ref": "#/definitions/componentAlias" }] }, "maxProperties": 512 }, "colors": { "description": "Named color palettes used by the avatar. The PRNG selects colors from these groups at render time. Color groups can define constraints such as contrast or exclusion rules. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "values": { "description": "The list of hex color values the PRNG can choose from.", "type": "array", "items": { "$ref": "#/definitions/hexColor" }, "minItems": 1, "maxItems": 128 }, "notEqualTo": { "description": "A list of other color names. The selected color value must differ from the color values selected in those colors. The schema does not prevent cycles (e.g. `a` notEqualTo `b` and `b` notEqualTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.", "type": "array", "items": { "$ref": "#/definitions/colorName" }, "maxItems": 64 }, "contrastTo": { "description": "The name of another color. When specified, the PRNG is not used for selection — instead, the color value with the highest contrast against the selected color value of the referenced color is chosen. The schema does not prevent cycles (e.g. `a` contrastTo `b` and `b` contrastTo `a`); renderers resolve palettes in definition order and must reject unsatisfiable configurations at load time.", "$ref": "#/definitions/colorName" } }, "required": ["values"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["canvas"], "additionalProperties": false };
|
|
6
6
|
const schema12 = { "description": "A URL restricted to HTTP and HTTPS protocols.", "type": "string", "pattern": "^https?://", "maxLength": 2048 };
|
|
7
7
|
const schema20 = { "description": "A camelCase identifier used for named things defined in the definition (colors, components, variants). Must start with a lowercase letter and may contain letters and digits.", "type": "string", "pattern": "^[a-z][a-zA-Z0-9]*$", "maxLength": 64 };
|
|
8
8
|
const schema43 = { "description": "A hex color with leading `#`, in 3, 4, 6, or 8 digit form.", "type": "string", "pattern": "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", "maxLength": 9 };
|
|
9
9
|
const func2 = ucs2length;
|
|
10
10
|
const pattern0 = new RegExp("^https?://", "u");
|
|
11
11
|
const pattern10 = new RegExp("^[a-z][a-zA-Z0-9]*$", "u");
|
|
12
|
-
const
|
|
12
|
+
const pattern36 = new RegExp("^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$", "u");
|
|
13
13
|
const schema15 = { "description": "A map of allowed SVG presentation attributes. Only a safe subset is permitted; event handlers (e.g. `onclick`) and namespace attributes (e.g. `xlink:href`) are not allowed.", "type": "object", "properties": { "alignment-baseline": { "$ref": "#/definitions/attributeString" }, "amplitude": { "$ref": "#/definitions/attributeString" }, "azimuth": { "$ref": "#/definitions/attributeString" }, "baseFrequency": { "$ref": "#/definitions/attributeString" }, "baseline-shift": { "$ref": "#/definitions/attributeString" }, "bias": { "$ref": "#/definitions/attributeString" }, "class": { "$ref": "#/definitions/attributeString" }, "clipPathUnits": { "$ref": "#/definitions/attributeString" }, "clip-path": { "$ref": "#/definitions/attributeString" }, "clip-rule": { "$ref": "#/definitions/attributeString" }, "color": { "$ref": "#/definitions/colorValue" }, "color-interpolation": { "$ref": "#/definitions/attributeString" }, "color-interpolation-filters": { "$ref": "#/definitions/attributeString" }, "crossorigin": { "$ref": "#/definitions/attributeString" }, "cx": { "$ref": "#/definitions/attributeString" }, "cy": { "$ref": "#/definitions/attributeString" }, "d": { "$ref": "#/definitions/pathDataString" }, "decoding": { "$ref": "#/definitions/attributeString" }, "diffuseConstant": { "$ref": "#/definitions/attributeString" }, "direction": { "$ref": "#/definitions/attributeString" }, "display": { "$ref": "#/definitions/attributeString" }, "divisor": { "$ref": "#/definitions/attributeString" }, "dominant-baseline": { "$ref": "#/definitions/attributeString" }, "dx": { "$ref": "#/definitions/attributeString" }, "dy": { "$ref": "#/definitions/attributeString" }, "edgeMode": { "$ref": "#/definitions/attributeString" }, "elevation": { "$ref": "#/definitions/attributeString" }, "exponent": { "$ref": "#/definitions/attributeString" }, "fill": { "$ref": "#/definitions/colorValue" }, "fill-opacity": { "$ref": "#/definitions/attributeString" }, "fill-rule": { "$ref": "#/definitions/attributeString" }, "filter": { "$ref": "#/definitions/attributeString" }, "filterUnits": { "$ref": "#/definitions/attributeString" }, "flood-color": { "$ref": "#/definitions/colorValue" }, "flood-opacity": { "$ref": "#/definitions/attributeString" }, "font-family": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontFamily" } }, "required": ["type", "name"], "additionalProperties": false }] }, "font-size": { "$ref": "#/definitions/attributeString" }, "font-size-adjust": { "$ref": "#/definitions/attributeString" }, "font-style": { "$ref": "#/definitions/attributeString" }, "font-variant": { "$ref": "#/definitions/attributeString" }, "font-weight": { "anyOf": [{ "$ref": "#/definitions/attributeString" }, { "type": "object", "properties": { "type": { "const": "variable" }, "name": { "const": "fontWeight" } }, "required": ["type", "name"], "additionalProperties": false }] }, "fx": { "$ref": "#/definitions/attributeString" }, "fy": { "$ref": "#/definitions/attributeString" }, "gradientTransform": { "$ref": "#/definitions/attributeString" }, "gradientUnits": { "$ref": "#/definitions/attributeString" }, "height": { "$ref": "#/definitions/attributeString" }, "href": { "anyOf": [{ "type": "string", "pattern": "^#[a-zA-Z_][a-zA-Z0-9_.-]*$", "maxLength": 128 }, { "type": "string", "pattern": "^data:image/(png|gif|jpeg|webp|avif);base64,[a-zA-Z0-9+/=]+$", "maxLength": 262144 }] }, "id": { "$ref": "#/definitions/attributeString" }, "image-rendering": { "$ref": "#/definitions/attributeString" }, "in": { "$ref": "#/definitions/attributeString" }, "in2": { "$ref": "#/definitions/attributeString" }, "intercept": { "$ref": "#/definitions/attributeString" }, "k1": { "$ref": "#/definitions/attributeString" }, "k2": { "$ref": "#/definitions/attributeString" }, "k3": { "$ref": "#/definitions/attributeString" }, "k4": { "$ref": "#/definitions/attributeString" }, "kernelMatrix": { "$ref": "#/definitions/attributeString" }, "kernelUnitLength": { "$ref": "#/definitions/attributeString" }, "lang": { "$ref": "#/definitions/attributeString" }, "lengthAdjust": { "$ref": "#/definitions/attributeString" }, "letter-spacing": { "$ref": "#/definitions/attributeString" }, "lighting-color": { "$ref": "#/definitions/colorValue" }, "marker-end": { "$ref": "#/definitions/attributeString" }, "marker-mid": { "$ref": "#/definitions/attributeString" }, "marker-start": { "$ref": "#/definitions/attributeString" }, "markerHeight": { "$ref": "#/definitions/attributeString" }, "markerUnits": { "$ref": "#/definitions/attributeString" }, "markerWidth": { "$ref": "#/definitions/attributeString" }, "mask": { "$ref": "#/definitions/attributeString" }, "maskContentUnits": { "$ref": "#/definitions/attributeString" }, "maskUnits": { "$ref": "#/definitions/attributeString" }, "media": { "$ref": "#/definitions/attributeString" }, "method": { "$ref": "#/definitions/attributeString" }, "mode": { "$ref": "#/definitions/attributeString" }, "numOctaves": { "$ref": "#/definitions/attributeString" }, "offset": { "$ref": "#/definitions/attributeString" }, "opacity": { "$ref": "#/definitions/attributeString" }, "operator": { "$ref": "#/definitions/attributeString" }, "order": { "$ref": "#/definitions/attributeString" }, "orient": { "$ref": "#/definitions/attributeString" }, "overflow": { "$ref": "#/definitions/attributeString" }, "paint-order": { "$ref": "#/definitions/attributeString" }, "path": { "$ref": "#/definitions/attributeString" }, "pathLength": { "$ref": "#/definitions/attributeString" }, "patternContentUnits": { "$ref": "#/definitions/attributeString" }, "patternTransform": { "$ref": "#/definitions/attributeString" }, "patternUnits": { "$ref": "#/definitions/attributeString" }, "points": { "$ref": "#/definitions/attributeString" }, "preserveAlpha": { "$ref": "#/definitions/attributeString" }, "preserveAspectRatio": { "$ref": "#/definitions/attributeString" }, "primitiveUnits": { "$ref": "#/definitions/attributeString" }, "r": { "$ref": "#/definitions/attributeString" }, "radius": { "$ref": "#/definitions/attributeString" }, "refX": { "$ref": "#/definitions/attributeString" }, "refY": { "$ref": "#/definitions/attributeString" }, "result": { "$ref": "#/definitions/attributeString" }, "rx": { "$ref": "#/definitions/attributeString" }, "ry": { "$ref": "#/definitions/attributeString" }, "scale": { "$ref": "#/definitions/attributeString" }, "seed": { "$ref": "#/definitions/attributeString" }, "shape-rendering": { "$ref": "#/definitions/attributeString" }, "slope": { "$ref": "#/definitions/attributeString" }, "specularConstant": { "$ref": "#/definitions/attributeString" }, "specularExponent": { "$ref": "#/definitions/attributeString" }, "spreadMethod": { "$ref": "#/definitions/attributeString" }, "startOffset": { "$ref": "#/definitions/attributeString" }, "stdDeviation": { "$ref": "#/definitions/attributeString" }, "stitchTiles": { "$ref": "#/definitions/attributeString" }, "stop-color": { "$ref": "#/definitions/colorValue" }, "stop-opacity": { "$ref": "#/definitions/attributeString" }, "stroke": { "$ref": "#/definitions/colorValue" }, "stroke-dasharray": { "$ref": "#/definitions/attributeString" }, "stroke-dashoffset": { "$ref": "#/definitions/attributeString" }, "stroke-linecap": { "$ref": "#/definitions/attributeString" }, "stroke-linejoin": { "$ref": "#/definitions/attributeString" }, "stroke-miterlimit": { "$ref": "#/definitions/attributeString" }, "stroke-opacity": { "$ref": "#/definitions/attributeString" }, "stroke-width": { "$ref": "#/definitions/attributeString" }, "style": { "$ref": "#/definitions/cssString" }, "surfaceScale": { "$ref": "#/definitions/attributeString" }, "systemLanguage": { "$ref": "#/definitions/attributeString" }, "tabindex": { "$ref": "#/definitions/attributeString" }, "tableValues": { "$ref": "#/definitions/attributeString" }, "targetX": { "$ref": "#/definitions/attributeString" }, "targetY": { "$ref": "#/definitions/attributeString" }, "text-anchor": { "$ref": "#/definitions/attributeString" }, "text-decoration": { "$ref": "#/definitions/attributeString" }, "text-rendering": { "$ref": "#/definitions/attributeString" }, "textLength": { "$ref": "#/definitions/attributeString" }, "transform": { "$ref": "#/definitions/attributeString" }, "transform-origin": { "$ref": "#/definitions/attributeString" }, "type": { "$ref": "#/definitions/attributeString" }, "values": { "$ref": "#/definitions/attributeString" }, "viewBox": { "$ref": "#/definitions/attributeString" }, "visibility": { "$ref": "#/definitions/attributeString" }, "width": { "$ref": "#/definitions/attributeString" }, "word-spacing": { "$ref": "#/definitions/attributeString" }, "writing-mode": { "$ref": "#/definitions/attributeString" }, "x": { "$ref": "#/definitions/attributeString" }, "x1": { "$ref": "#/definitions/attributeString" }, "x2": { "$ref": "#/definitions/attributeString" }, "xChannelSelector": { "$ref": "#/definitions/attributeString" }, "y": { "$ref": "#/definitions/attributeString" }, "y1": { "$ref": "#/definitions/attributeString" }, "y2": { "$ref": "#/definitions/attributeString" }, "yChannelSelector": { "$ref": "#/definitions/attributeString" }, "z": { "$ref": "#/definitions/attributeString" } }, "additionalProperties": false };
|
|
14
14
|
const func12 = Object.prototype.hasOwnProperty;
|
|
15
15
|
const schema16 = { "description": "The default value type for generic SVG attribute values — transform lists, numeric values, keywords, and so on. No syntactic validation; only the common `filteredString` injection filter applies.", "type": "string", "allOf": [{ "$ref": "#/definitions/filteredString" }], "maxLength": 1024 };
|
|
@@ -3945,7 +3945,7 @@ else {
|
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
3947
|
} validate166.errors = vErrors; return errors === 0; }
|
|
3948
|
-
const schema33 = { "description": "A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.", "type": "object", "properties": { "width": { "description": "The natural width of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "probability": { "$ref": "#/definitions/componentProbability" }, "rotate": { "$ref": "#/definitions/componentRotate" }, "scale": { "$ref": "#/definitions/componentScale" }, "translate": { "$ref": "#/definitions/componentTranslate" }, "variants": { "description": "The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "elements": { "description": "The SVG elements that make up this variant.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "weight": { "description": "A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.", "type": "number", "minimum": 0, "maximum": 1000000 } }, "required": ["elements"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["width", "height", "variants"], "additionalProperties": false };
|
|
3948
|
+
const schema33 = { "description": "A base component definition with its own dimensions and variants. The PRNG selects one variant per render based on the seed.", "type": "object", "properties": { "width": { "description": "The natural width of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "height": { "description": "The natural height of the component canvas in pixels.", "type": "number", "minimum": 1, "maximum": 1000000 }, "probability": { "$ref": "#/definitions/componentProbability" }, "rotate": { "$ref": "#/definitions/componentRotate" }, "scale": { "$ref": "#/definitions/componentScale" }, "translate": { "$ref": "#/definitions/componentTranslate" }, "variants": { "description": "The available visual variants of this component. The PRNG selects one variant per render. Keys must be `camelCaseName` identifiers.", "type": "object", "propertyNames": { "$ref": "#/definitions/camelCaseName" }, "additionalProperties": { "type": "object", "properties": { "elements": { "description": "The SVG elements that make up this variant.", "type": "array", "items": { "$ref": "#/definitions/element" }, "maxItems": 1024 }, "weight": { "description": "A weight that influences how likely the PRNG is to select this variant. Higher values make the variant more likely. When omitted, defaults to 1 (equal weighting). A value of 0 means the variant is not selected unless all available variants have a weight of 0.", "type": "number", "minimum": 0, "maximum": 1000000 }, "tags": { "description": "Optional tags for this variant (e.g. `hairLength:long`, `facialHair:beard`). The `tags` render option uses them to filter the variant pool.", "type": "array", "items": { "description": "A tag of the form `category` or `category:value`, where the category is an axis (e.g. `hairLength`, `mouthExpression`) and the value is its setting on that axis (e.g. `hairLength:long`). Each segment is camelCase.", "type": "string", "pattern": "^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$", "maxLength": 129 }, "uniqueItems": true, "maxItems": 32 } }, "required": ["elements"], "additionalProperties": false }, "maxProperties": 512 } }, "required": ["width", "height", "variants"], "additionalProperties": false };
|
|
3949
3949
|
const schema34 = { "description": "The probability, expressed as a percentage, that this component is rendered at all.", "type": "number", "minimum": 0, "maximum": 100 };
|
|
3950
3950
|
const schema35 = { "description": "A rotation in degrees. Defines a range the PRNG picks from. Set `min === max` for a fixed angle. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": -360, "maximum": 360 }, "max": { "type": "number", "minimum": -360, "maximum": 360 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 720 } }, "required": ["min", "max"], "additionalProperties": false };
|
|
3951
3951
|
const schema36 = { "description": "A scale factor around the component's own center (`1` corresponds to the original size). Defines a range the PRNG picks from. Set `min === max` for a fixed scale. A positive `step` quantizes the range to multiples of `step` starting at `min`; omit for a continuous range. When `(max - min)` is not a multiple of `step`, `max` itself is unreachable — the last bucket is clamped to `≤ max`.", "type": "object", "properties": { "min": { "type": "number", "minimum": 0, "maximum": 10 }, "max": { "type": "number", "minimum": 0, "maximum": 10 }, "step": { "type": "number", "exclusiveMinimum": 0, "maximum": 10 } }, "required": ["min", "max"], "additionalProperties": false };
|
|
@@ -4203,6 +4203,7 @@ function validate181(data, { instancePath = "", parentData, parentDataProperty,
|
|
|
4203
4203
|
return false;
|
|
4204
4204
|
}
|
|
4205
4205
|
} validate181.errors = vErrors; return errors === 0; }
|
|
4206
|
+
const pattern34 = new RegExp("^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$", "u");
|
|
4206
4207
|
function validate180(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) {
|
|
4207
4208
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4208
4209
|
let missing0;
|
|
@@ -4626,7 +4627,7 @@ function validate180(data, { instancePath = "", parentData, parentDataProperty,
|
|
|
4626
4627
|
else {
|
|
4627
4628
|
const _errs38 = errors;
|
|
4628
4629
|
for (const key5 in data13) {
|
|
4629
|
-
if (!((key5 === "elements") || (key5 === "weight"))) {
|
|
4630
|
+
if (!(((key5 === "elements") || (key5 === "weight")) || (key5 === "tags"))) {
|
|
4630
4631
|
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/variants/additionalProperties/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" }];
|
|
4631
4632
|
return false;
|
|
4632
4633
|
break;
|
|
@@ -4695,6 +4696,78 @@ function validate180(data, { instancePath = "", parentData, parentDataProperty,
|
|
|
4695
4696
|
else {
|
|
4696
4697
|
var valid9 = true;
|
|
4697
4698
|
}
|
|
4699
|
+
if (valid9) {
|
|
4700
|
+
if (data13.tags !== undefined) {
|
|
4701
|
+
let data17 = data13.tags;
|
|
4702
|
+
const _errs44 = errors;
|
|
4703
|
+
if (errors === _errs44) {
|
|
4704
|
+
if (Array.isArray(data17)) {
|
|
4705
|
+
if (data17.length > 32) {
|
|
4706
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags", schemaPath: "#/properties/variants/additionalProperties/properties/tags/maxItems", keyword: "maxItems", params: { limit: 32 }, message: "must NOT have more than 32 items" }];
|
|
4707
|
+
return false;
|
|
4708
|
+
}
|
|
4709
|
+
else {
|
|
4710
|
+
var valid11 = true;
|
|
4711
|
+
const len1 = data17.length;
|
|
4712
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
4713
|
+
let data18 = data17[i1];
|
|
4714
|
+
const _errs46 = errors;
|
|
4715
|
+
if (errors === _errs46) {
|
|
4716
|
+
if (typeof data18 === "string") {
|
|
4717
|
+
if (func2(data18) > 129) {
|
|
4718
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags/" + i1, schemaPath: "#/properties/variants/additionalProperties/properties/tags/items/maxLength", keyword: "maxLength", params: { limit: 129 }, message: "must NOT have more than 129 characters" }];
|
|
4719
|
+
return false;
|
|
4720
|
+
}
|
|
4721
|
+
else {
|
|
4722
|
+
if (!pattern34.test(data18)) {
|
|
4723
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags/" + i1, schemaPath: "#/properties/variants/additionalProperties/properties/tags/items/pattern", keyword: "pattern", params: { pattern: "^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$" }, message: "must match pattern \"" + "^[a-z][a-zA-Z0-9]*(:[a-z][a-zA-Z0-9]*)?$" + "\"" }];
|
|
4724
|
+
return false;
|
|
4725
|
+
}
|
|
4726
|
+
}
|
|
4727
|
+
}
|
|
4728
|
+
else {
|
|
4729
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags/" + i1, schemaPath: "#/properties/variants/additionalProperties/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
4730
|
+
return false;
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
var valid11 = _errs46 === errors;
|
|
4734
|
+
if (!valid11) {
|
|
4735
|
+
break;
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
if (valid11) {
|
|
4739
|
+
let i2 = data17.length;
|
|
4740
|
+
let j0;
|
|
4741
|
+
if (i2 > 1) {
|
|
4742
|
+
const indices0 = {};
|
|
4743
|
+
for (; i2--;) {
|
|
4744
|
+
let item0 = data17[i2];
|
|
4745
|
+
if (typeof item0 !== "string") {
|
|
4746
|
+
continue;
|
|
4747
|
+
}
|
|
4748
|
+
if (typeof indices0[item0] == "number") {
|
|
4749
|
+
j0 = indices0[item0];
|
|
4750
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags", schemaPath: "#/properties/variants/additionalProperties/properties/tags/uniqueItems", keyword: "uniqueItems", params: { i: i2, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i2 + " are identical)" }];
|
|
4751
|
+
return false;
|
|
4752
|
+
break;
|
|
4753
|
+
}
|
|
4754
|
+
indices0[item0] = i2;
|
|
4755
|
+
}
|
|
4756
|
+
}
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
else {
|
|
4761
|
+
validate180.errors = [{ instancePath: instancePath + "/variants/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/tags", schemaPath: "#/properties/variants/additionalProperties/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
4762
|
+
return false;
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
var valid9 = _errs44 === errors;
|
|
4766
|
+
}
|
|
4767
|
+
else {
|
|
4768
|
+
var valid9 = true;
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4698
4771
|
}
|
|
4699
4772
|
}
|
|
4700
4773
|
}
|
|
@@ -4768,7 +4841,7 @@ function validate185(data, { instancePath = "", parentData, parentDataProperty,
|
|
|
4768
4841
|
return false;
|
|
4769
4842
|
}
|
|
4770
4843
|
} validate185.errors = vErrors; return errors === 0; }
|
|
4771
|
-
function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { /*# sourceURL="https://cdn.hopjs.net/npm/@dicebear/schema@1.
|
|
4844
|
+
function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { /*# sourceURL="https://cdn.hopjs.net/npm/@dicebear/schema@1.3.0/dist/definition.min.json" */ ; let vErrors = null; let errors = 0; if (errors === 0) {
|
|
4772
4845
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4773
4846
|
let missing0;
|
|
4774
4847
|
if ((data.canvas === undefined) && (missing0 = "canvas")) {
|
|
@@ -5504,7 +5577,7 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5504
5577
|
return false;
|
|
5505
5578
|
}
|
|
5506
5579
|
else {
|
|
5507
|
-
if (!
|
|
5580
|
+
if (!pattern36.test(data25)) {
|
|
5508
5581
|
validate10.errors = [{ instancePath: instancePath + "/colors/" + key9.replace(/~/g, "~0").replace(/\//g, "~1") + "/values/" + i1, schemaPath: "#/definitions/hexColor/pattern", keyword: "pattern", params: { pattern: "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$" }, message: "must match pattern \"" + "^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$" + "\"" }];
|
|
5509
5582
|
return false;
|
|
5510
5583
|
}
|