deno.land / x / shacl_to_type@v0.0.9 / frontend / castValue.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
import { RdfJsonTerm } from './types.ts'import { Context } from './Context.ts'
export const castValue = (value: RdfJsonTerm, propertyConfig: { singular: boolean, type: string }, context: Context) => { if (propertyConfig.type === 'Date') return new Date(value.value)
if (value.type === 'uri') { return context.compactIri(value.value) }
return value.value}
shacl_to_type

Version Info

Tagged at
a year ago