Files
Laca-City/backend/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts
PhongPham c65cc97a33 🎯 MapView v2.0 - Global Deployment Ready
 MAJOR FEATURES:
• Auto-zoom intelligence với smart bounds fitting
• Enhanced 3D GPS markers với pulsing effects
• Professional route display với 6-layer rendering
• Status-based parking icons với availability indicators
• Production-ready build optimizations

🗺️ AUTO-ZOOM FEATURES:
• Smart bounds fitting cho GPS + selected parking
• Adaptive padding (50px) cho visual balance
• Max zoom control (level 16) để tránh quá gần
• Dynamic centering khi không có selection

🎨 ENHANCED VISUALS:
• 3D GPS marker với multi-layer pulse effects
• Advanced parking icons với status colors
• Selection highlighting với animation
• Dimming system cho non-selected items

🛣️ ROUTE SYSTEM:
• OpenRouteService API integration
• Multi-layer route rendering (glow, shadow, main, animated)
• Real-time distance & duration calculation
• Visual route info trong popup

📱 PRODUCTION READY:
• SSR safe với dynamic imports
• Build errors resolved
• Global deployment via Vercel
• Optimized performance

🌍 DEPLOYMENT:
• Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app
• Bundle size: 22.8 kB optimized
• Global CDN distribution
• HTTPS enabled

💾 VERSION CONTROL:
• MapView-v2.0.tsx backup created
• MAPVIEW_VERSIONS.md documentation
• Full version history tracking
2025-07-20 19:52:16 +07:00

86 lines
2.4 KiB
TypeScript

import type {
CodeKeywordDefinition,
KeywordErrorDefinition,
ErrorObject,
AnySchema,
} from "../../types"
import {_, not, and, Name, Code} from "../../compile/codegen"
import {alwaysValidSchema, Type} from "../../compile/util"
import N from "../../compile/names"
export type UnevaluatedPropertiesError = ErrorObject<
"unevaluatedProperties",
{unevaluatedProperty: string},
AnySchema
>
const error: KeywordErrorDefinition = {
message: "must NOT have unevaluated properties",
params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`,
}
const def: CodeKeywordDefinition = {
keyword: "unevaluatedProperties",
type: "object",
schemaType: ["boolean", "object"],
trackErrors: true,
error,
code(cxt) {
const {gen, schema, data, errsCount, it} = cxt
/* istanbul ignore if */
if (!errsCount) throw new Error("ajv implementation error")
const {allErrors, props} = it
if (props instanceof Name) {
gen.if(_`${props} !== true`, () =>
gen.forIn("key", data, (key: Name) =>
gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))
)
)
} else if (props !== true) {
gen.forIn("key", data, (key: Name) =>
props === undefined
? unevaluatedPropCode(key)
: gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))
)
}
it.props = true
cxt.ok(_`${errsCount} === ${N.errors}`)
function unevaluatedPropCode(key: Name): void {
if (schema === false) {
cxt.setParams({unevaluatedProperty: key})
cxt.error()
if (!allErrors) gen.break()
return
}
if (!alwaysValidSchema(it, schema)) {
const valid = gen.name("valid")
cxt.subschema(
{
keyword: "unevaluatedProperties",
dataProp: key,
dataPropType: Type.Str,
},
valid
)
if (!allErrors) gen.if(not(valid), () => gen.break())
}
}
function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code {
return _`!${evaluatedProps} || !${evaluatedProps}[${key}]`
}
function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code {
const ps: Code[] = []
for (const p in evaluatedProps) {
if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`)
}
return and(...ps)
}
},
}
export default def