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

rheactor-value-objects

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rheactor-value-objects - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

2

domain.js

@@ -32,4 +32,4 @@ 'use strict'

DomainValue.Type = t.irreducible('DomainValue', (x) => x instanceof DomainValue)
DomainValue.Type = t.irreducible('DomainValue', (x) => x.constructor.name === DomainValue.name)
module.exports = DomainValue

@@ -29,4 +29,4 @@ 'use strict'

EmailValue.Type = t.irreducible('EmailValue', (x) => x instanceof EmailValue)
EmailValue.Type = t.irreducible('EmailValue', (x) => x.constructor.name === EmailValue.name)
module.exports = EmailValue

@@ -43,3 +43,3 @@ {

},
"version": "1.5.0"
"version": "1.5.1"
}

@@ -14,4 +14,22 @@ # rheactor-value-objects

## Common API
### .Type()
This method exposes a [tcomb](https://github.com/gcanti/tcomb) type validation base on the **name of the type**.
Note that instanceof can't be used because having this check will return false, because the application using
the value-objects package will create an instance that Node.js thinks to be from a different location that the
one referenced in this package's `uri.js`
# app.js
const URIValue = require('rheactor-value-objects/uri')
let u = new URIValue(…)
URIValue.Type(u) // will fail
# uri.js
URIValue.Type = t.irreducible('URIValue', (x) => x instanceof URIValue)
## TODO
- Replace HAPI Joi validation with tcomb validation

@@ -29,4 +29,4 @@ 'use strict'

SlugValue.Type = t.irreducible('SlugValue', (x) => x instanceof SlugValue)
SlugValue.Type = t.irreducible('SlugValue', (x) => x.constructor.name === SlugValue.name)
module.exports = SlugValue

@@ -45,4 +45,4 @@ 'use strict'

TimeOfDayValue.Type = t.irreducible('TimeOfDayValueValue', (x) => x instanceof TimeOfDayValue)
TimeOfDayValue.Type = t.irreducible('TimeOfDayValueValue', (x) => x.constructor.name === TimeOfDayValue.name)
module.exports = TimeOfDayValue

@@ -38,4 +38,4 @@ 'use strict'

TimestampValue.Type = t.irreducible('TimestampValue', (x) => x instanceof TimestampValue)
TimestampValue.Type = t.irreducible('TimestampValue', (x) => x.constructor.name === TimestampValue.name)
module.exports = TimestampValue

@@ -28,4 +28,4 @@ 'use strict'

URIValue.Type = t.irreducible('URIValue', (x) => x instanceof URIValue)
URIValue.Type = t.irreducible('URIValue', (x) => x.constructor.name === URIValue.name)
module.exports = URIValue
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