Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

data-scheme

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-scheme

Data Model framework based on ECMAScript Decorator proposal

Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

Data Scheme

Data Model framework based on ECMAScript Decorator proposal

NPM Dependency

NPM

Usage

Installation

npm install data-scheme
npm install @babel/cli \
    @babel/core \
    @babel/preset-env \
    @babel/plugin-proposal-decorators

Configuration

{
    "presets": [
        "@babel/preset-env"
    ],
    "plugins": [
        [
            "@babel/plugin-proposal-decorators",
            {
                "decoratorsBeforeExport": true
            }
        ]
    ]
}

Coding

import DataScheme, { schemeOf, Email, Phone } from 'data-scheme';

@schemeOf({
    email:  Email,
    phone:  Phone
})
export class User extends DataScheme { }

const user = new User();

user.name = 'test';
user.email = 'test@example.com';
user.phone = '+86-028-88888888';

Test cases

Scheme Helper

https://techquery.github.io/DataScheme/file/source/index.js.html

Learn more

Keywords

data

FAQs

Package last updated on 29 Sep 2018

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