rdf-validate-datatype
Advanced tools
Comparing version 0.1.3 to 0.1.4
# Changelog | ||
## 0.1.4 (2021-08-02) | ||
* Enforce leading "--" for `xsd:gMonth` | ||
## 0.1.3 (2021-01-19) | ||
@@ -5,0 +9,0 @@ |
{ | ||
"name": "rdf-validate-datatype", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Validate literal value of an RDF term based on its datatype.", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"@rdfjs/data-model": "~1.2.0", | ||
"mocha": "~8.2.1", | ||
"mocha": "~8.4.0", | ||
"nyc": "~15.1.0", | ||
@@ -35,0 +35,0 @@ "standard": "~16.0.0" |
@@ -19,6 +19,8 @@ | ||
```javascript | ||
import { validateTerm } from 'rdf-validate-datatype' | ||
import validateDatatype from 'rdf-validate-datatype' | ||
import rdf from '@rdfjs/data-model' | ||
import { xsd } from '@tpluscode/rdf-ns-builders' | ||
const { validateTerm } = validateDatatype | ||
const term = rdf.literal('test') | ||
@@ -40,6 +42,8 @@ const isValid = validateTerm(term) // -> true | ||
```javascript | ||
import { validateQuad } from 'rdf-validate-datatype' | ||
import validateDatatype from 'rdf-validate-datatype' | ||
import rdf from '@rdfjs/data-model' | ||
import { schema, xsd } from '@tpluscode/rdf-ns-builders' | ||
const { validateQuad } = validateDatatype | ||
const quad = rdf.quad( | ||
@@ -65,6 +69,8 @@ rdf.namedNode('bob'), | ||
```javascript | ||
import { validators, validateTerm } from 'rdf-validate-datatype' | ||
import validateDatatype from 'rdf-validate-datatype' | ||
import rdf from '@rdfjs/data-model' | ||
import { xsd } from '@tpluscode/rdf-ns-builders' | ||
const { validators, validateTerm } = validateDatatype | ||
// Register a new datatype | ||
@@ -71,0 +77,0 @@ const myDatatype = rdf.namedNode('my-datatype') |
@@ -206,3 +206,3 @@ /* global BigInt */ | ||
const monthPattern = new RegExp(`^${monthSeg}${timezoneSeg}?$`) | ||
const monthPattern = new RegExp(`^--${monthSeg}${timezoneSeg}?$`) | ||
validators.register(xsd.gMonth, value => monthPattern.test(value)) | ||
@@ -209,0 +209,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14514
83