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

@tpluscode/rdf-string

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tpluscode/rdf-string - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

lib/syntax/turtle.d.ts

@@ -10,5 +10,5 @@ import { BlankNode, Literal, NamedNode } from '@rdfjs/types';

}
export declare function namedNode(term: NamedNode, { base, prefixes, noPrefixedNames }: NamedNodeOptions): PartialString;
export declare function namedNode(term: Pick<NamedNode, 'value'>, { base, prefixes, noPrefixedNames }: NamedNodeOptions): PartialString;
export declare function literal(term: Literal, { base, prefixes }: NamedNodeOptions): PartialString;
export {};
//# sourceMappingURL=turtle.d.ts.map
import { shrink } from '@zazuko/prefixes';
import { xsd } from '@tpluscode/rdf-ns-builders';
import TermMap from '@rdfjs/term-map';
import { mapBuilders } from '../prefixes.js';

@@ -25,8 +26,11 @@ import * as ntriples from './ntriples.js';

}
function isBuiltInType(datatype) {
return datatype.equals(xsd.integer) || datatype.equals(xsd.boolean) || datatype.equals(xsd.decimal);
}
const buildInTypes = new TermMap([
[xsd.integer, /^-?[0-9]+$/],
[xsd.decimal, /^-?[0-9]+\.[0-9]+$/],
[xsd.boolean, /^(true|false)$/],
]);
export function literal(term, { base = '', prefixes = {} }) {
if (!term.language && term.datatype) {
if (isBuiltInType(term.datatype)) {
const shorthandSyntax = buildInTypes.get(term.datatype);
if (shorthandSyntax && shorthandSyntax.test(term.value)) {
return {

@@ -33,0 +37,0 @@ value: term.value,

{
"name": "@tpluscode/rdf-string",
"version": "1.3.3",
"version": "1.3.4",
"description": "Simplifies creating of RDF strings using ECMAscript templates",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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