New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@interweave/interweave

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interweave/interweave

Interweave is a platform for creating user interfaces from static JSON. The Interweave configuration objects are meant to be checked into version control and tied closely to database and API changes.

  • 0.0.34
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Interweave

Interweave is a platform for creating user interfaces from static JSON. The Interweave configuration objects are meant to be checked into version control and tied closely to database and API changes.

validate

The `validate()' function is a good way to test an object against your configuration. This is useful for validating user input from forms and requests.

import { validate } from "@interweave/interweave";

// Validate and throw any errors to a console immediately
// Good for using in a build pipeline
validate(object, schema);

// Run and collect errors to an object
// Good for forms and handling form errors
const errorsObject = validate(object, schema, { returnErrors: true });

Architecture

Flattening and expanding

We will take nested objects, flatten them down into their keys

{
    title: "Some Title",
    description: "some description",
    author: {
        name: "mike"
    }
}

Error and form object becomes:

{
    title: "Some Title",
    description: "some description",
    "author.name": "mike"
}

Then we use those keys to expand back into a wider object before submission:

{
    title: "Some Title",
    description: "some description",
    author: {
        name: "mike"
    }
}

FAQs

Package last updated on 05 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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