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

json-rel

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-rel - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "json-rel",
"version": "0.0.6",
"version": "0.0.7",
"description": "Transparent references in JSON",

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

@@ -60,9 +60,7 @@ # json-rel

```javascript
import query from 'json-rel'
import path from 'json-rel'
import pointer from 'json-rel'
import {query, path, pointer} from 'json-rel'
let query1 = query('foo[bar]', data).get() // true
let path2 = path('$.foo.bar', data).get() // true
let pointer2 = pointer('/foo/bar', data).get() // true
query('foo[bar]', data).get() // true
path('$.foo.bar', data).get() // true
pointer('/foo/bar', data).get() // true
```

@@ -69,0 +67,0 @@

@@ -39,2 +39,16 @@ export const _specs = {}

count(obj = this.value) {
const results = this.get(obj)
if (results instanceof Array) {
return results.length
}
return results ? 1 : 0
}
any(obj = this.value) {
return !!this.count(obj)
}
set(obj = this.value, data) {

@@ -41,0 +55,0 @@ return this.spec.update(this.path, obj, data)

import 'blanket'
import {$, which, AbstractRel, AbstractRelSpec} from '../src/abstract'
import PathRelSpec from '../src/path'

@@ -11,3 +12,24 @@ import chai from 'chai'

describe('AbstractRel', () => {
it('should prevent initialization of abstract members if a spec is not provided', () => {
// FIXME
// (() => {
// new AbstractRel
// }).should.throw(TypeError)
(() => {
new AbstractRel({spec: PathRelSpec})
}).should.not.throw(TypeError)
})
})
describe('AbstractRelSpec', () => {
it('should prevent initialization of abstract members', () => {
(() => {
new AbstractRelSpec()
}).should.throw(TypeError)
})

@@ -14,0 +36,0 @@ it('should be able to identify arbitrary relations', () => {

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