- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스) - Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포 - 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
739 B
TypeScript
23 lines
739 B
TypeScript
import type {AnySchemaObject} from "../../types"
|
|
import type {SchemaObjCxt} from ".."
|
|
import type {JSONType, RuleGroup, Rule} from "../rules"
|
|
|
|
export function schemaHasRulesForType(
|
|
{schema, self}: SchemaObjCxt,
|
|
type: JSONType
|
|
): boolean | undefined {
|
|
const group = self.RULES.types[type]
|
|
return group && group !== true && shouldUseGroup(schema, group)
|
|
}
|
|
|
|
export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean {
|
|
return group.rules.some((rule) => shouldUseRule(schema, rule))
|
|
}
|
|
|
|
export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined {
|
|
return (
|
|
schema[rule.keyword] !== undefined ||
|
|
rule.definition.implements?.some((kwd) => schema[kwd] !== undefined)
|
|
)
|
|
}
|