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

quanstructor

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quanstructor - npm Package Compare versions

Comparing version 0.4.20 to 0.4.21

2

package.json
{
"name": "quanstructor",
"version": "0.4.20",
"version": "0.4.21",
"description": "Exceptionally powerful object model builder for complex architectures",

@@ -5,0 +5,0 @@ "keywords": [

@@ -248,2 +248,25 @@ let { defined } = require('./lib/Statics')

},
async schema ( name, projection = 'complete', options = {} ) {
let res = await this.proto( projection, options )
function walk (object, embedded = false) {
if ( !defined(object) ) return { type: 'object' }
if ( _.isNumber( object ) ) return { type: 'number' }
if ( _.isString( object ) ) return { type: 'integer' }
if ( _.isBoolean( object ) ) return { type: 'boolean' }
if ( _.isArray( object ) ) return { type: 'array' }
if ( _.isObject( object ) ) {
let sd = embedded ? { } : { title: name, type: 'object', properties: { } }
let props = embedded ? sd : sd.properties
for (let key in object)
props[ key ] = walk( object[key], true )
return sd
}
else return { type: 'object' }
}
return walk( res, false )
},
async derive ( obj, projection = 'complete', options = {} ) {

@@ -250,0 +273,0 @@ return this.bridge( obj, projection, options.view || projection, options )

@@ -68,2 +68,4 @@ const Quastructor = require( '../Quanstructor' )

} )
console.log( 'SCHEMA::::::', await Absoluter.schema( 'Emp' ) )
console.log( JSON.stringify( await Absoluter.build( {

@@ -70,0 +72,0 @@ employeeID: '121212',

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