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

grpc-web-from-object

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-web-from-object

fromObject method for grpc-web

  • 2.6.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by40.91%
Maintainers
1
Weekly downloads
 
Created
Source

⛔️ DEPRECATED

Use from-protobuf-object instead.

grpc-web-from-object

fromObject method for grpc-web

In general that is opposite for 'toObject' method in protobufjs.

Supports:

  • Simple keys
  • Repeated
  • OneOf
  • Protobuf Map
  • Recursive messages
  • Type validation (at runtime)
  • TypeScript
  • Missing keys validation

Installation

npm i grpc-web-from-object

Usage

import { createFromObject } from 'grpc-web-from-object';
import { MyMessage } from './my-message_pb';
import { MyInnerMessage } from './my-inner-message_pb';

const fromMyMessage = createFromObject(MyMessage, {
    keyThree: createFromObject(MyInnerMessage),
});

const myMessage = fromMyMessage({
    keyOne: 1,
    keyTwo: 'foo',
    keyThree: {
        keyA: 2,
        keyB: 'bar',
    },
});
For recursive message:
import { createFromObject, createFromObjectRecursive } from 'grpc-web-from-object';
import { MyMessage } from './my-message_pb';

const fromMyMessage = createFromObject(MyMessage, {
    message: createFromObjectRecursive(MyMessage),
});

Authors

Contributing

Contributions are always welcome!

License

Apache-2.0

Keywords

FAQs

Package last updated on 04 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