Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rdf-validate-datatype

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rdf-validate-datatype - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "rdf-validate-datatype",
"version": "0.2.0",
"version": "0.2.1",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Validate literal value of an RDF term based on its datatype.",

@@ -83,3 +83,3 @@ import { csvw, rdf, xsd } from '@tpluscode/rdf-ns-builders';

value === 'false'));
const decimalSeg = `${signSeg}\\d+(\\.\\d+)?`;
const decimalSeg = `${signSeg}(\\d+\\.?\\d*|\\.\\d+)`;
const decimalPattern = new RegExp(`^${signSeg}${decimalSeg}$`);

@@ -86,0 +86,0 @@ validators.register(xsd.decimal, value => decimalPattern.test(value));

@@ -166,8 +166,18 @@ import assert from 'assert';

['test', xsd.boolean, false],
['0.4', xsd.decimal, true],
['244.14', xsd.decimal, true],
['0', xsd.decimal, true, 'zero'],
['0.4', xsd.decimal, true, 'decimal point'],
['244.14', xsd.decimal, true, 'with decimal digits'],
['244', xsd.decimal, true, 'without decimal digits'],
['-24.4', xsd.decimal, true, 'minus sign'],
['+24.4', xsd.decimal, true, 'plus sign'],
['test', xsd.decimal, false],
['test', xsd.decimal, false, 'non-numeric characters'],
['NaN', xsd.decimal, false, 'NaN'],
['.4', xsd.decimal, true, 'leading decimal point'],
['4.', xsd.decimal, true, 'trailing decimal point'],
['003.500', xsd.decimal, true, 'leading zeros'],
['-003.500', xsd.decimal, true, 'negative number with leading zeros'],
['+003.500', xsd.decimal, true, 'positive number with leading zeros'],
['3.0000', xsd.decimal, true, 'trailing zeros'],
['3,5', xsd.decimal, false, 'comma instead of decimal point'],
['24.4.4', xsd.decimal, false, 'two decimal points'],
['-1E4', xsd.float, true],

@@ -174,0 +184,0 @@ ['1267.43233E12', xsd.float, true],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc