Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
scalars / 0.1.0

scalars 0.1.0

Install from the command line:
Learn more about npm packages
$ npm install @neuledge/scalars@0.1.0
Install via package.json:
"@neuledge/scalars": "0.1.0"

About this version

Neuledge Scalars

A set of Neuledge Engine scalars that can be used on the schema definition.

This library is not intended to be used directly. It is a dependency of the main package.

πŸ“¦ Installation

npm install @neuledge/scalars

πŸš€ Getting started

import { Integer, String, DateTime } from '@neuledge/scalars';

// define the state scalars
const stateScalars = {
  id: { type: Integer, index: 1 },
  name: { type: String, index: 2 },
  description: { type: String, index: 3, nullable: true },
};

// validate a scalar value
const value: ScalarValue<typeof DateTime> = DateTime.encode(
  new Date('2020-01-01'),
); // 1577836800000

// decode a scalar value
const decodedValue: DateTime = DateTime.decode(value); // Date('2020-01-01')

πŸ“„ License

Neuledge is Apache 2.0 licensed.

Details


Assets

  • scalars-0.1.0.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0