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

@endeo/types

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@endeo/types

Common types for values in @endeo/special objects.

  • 0.1.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@endeo/types

Build Status Dependency Status npm version

Common types for values in @endeo/specials objects.

These are used when creating an "object spec" to encode a "special object" in a compressed format. They are specified as the 'type' in the enhancers object.

When endeo's enbyte encodes a "special object" it must test each key's value to determine which type it is so it knows how to encode it. Specify its exact type to skip that work.

See packages:

  1. endeo
  2. enbyte
  3. debyte

Install

npm install --save @endeo/types

Usage

var types = require('@endeo/types')

var enhancers = {
  key: {
    type: types.day
  }
}

// OR, when specials has the type
specials.addType('day', types.day)

var enhancers = {
  key: 'day'
}

Extra Types

There are two extra types available for optional use:

  1. day - A Date requires many bytes to encode because it has a lot of info. If you only want to store the year, month, and day (in month) then you may use this type and it'll encode it in four bytes instead.
  2. time - As mentioned above, a Date requires many bytes. If you only want the hours and minutes (24-hour style) then use this type to encode it in two bytes.

MIT License

FAQs

Package last updated on 18 May 2017

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