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

clownface

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clownface - npm Package Compare versions

Comparing version 0.12.2 to 0.12.3

10

lib/Clownface.js

@@ -79,5 +79,13 @@ const rdf = require('@rdfjs/data-model')

const value = item.out(this.namespace.first)
if (value.terms.length > 1) {
throw new Error(`Invalid list: multiple values for rdf:first on ${item.value}`)
}
item = item.out(this.namespace.rest)
const rest = item.out(this.namespace.rest)
if (rest.terms.length > 1) {
throw new Error(`Invalid list: multiple values for rdf:rest on ${item.value}`)
}
item = rest
return { done: false, value }

@@ -84,0 +92,0 @@ }

2

package.json
{
"name": "clownface",
"version": "0.12.2",
"version": "0.12.3",
"description": "Simple but powerful graph traversing library",

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

@@ -73,2 +73,35 @@ /* global describe, it */

})
it('should throw when a list node has multiple rdf:first', () => {
const start = rdf.blankNode()
const listNode = rdf.blankNode()
const dataset = rdf.dataset([
rdf.quad(start, ns.list, listNode),
rdf.quad(listNode, ns.first, rdf.literal('1')),
rdf.quad(listNode, ns.first, rdf.literal('3')),
rdf.quad(listNode, ns.rest, ns.nil)
])
const cf = clownface({ dataset })
assert.throws(() => {
[...cf.out(ns.list).list()] // eslint-disable-line no-unused-expressions
})
})
it('should throw when a list node has multiple rdf:rest', () => {
const start = rdf.blankNode()
const listNode = rdf.blankNode()
console.log(rdf.nil)
const dataset = rdf.dataset([
rdf.quad(start, ns.list, listNode),
rdf.quad(listNode, ns.first, rdf.literal('1')),
rdf.quad(listNode, ns.rest, rdf.blankNode()),
rdf.quad(listNode, ns.rest, ns.nil)
])
const cf = clownface({ dataset })
assert.throws(() => {
[...cf.out(ns.list).list()] // eslint-disable-line no-unused-expressions
})
})
})
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