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

@cobalt-ui/core

Package Overview
Dependencies
Maintainers
0
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobalt-ui/core

Parser/validator for the Design Tokens Community Group (DTCG) standard.

  • 1.12.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@cobalt-ui/core

Parser/validator for the Design Tokens Community Group (DTCG) standard.

For the CLI, use @cobalt-ui/cli.

Install

npm install @cobalt-ui/core

Usage

Parse a tokens.json file into a JS object

import co from "@cobalt-ui/core";

const designTokens = {
  color: {
    red:   {$type: "color", $value: "#e34850"},
    green: {$type: "color", $value: "#2d9d78"},
    blue:  {$type: "color", $value: "#2680eb"},
  },
};

const {errors, warnings, result} = co.parse(designTokens);
NameTypeDescription
resultToken[]Flattened array of all parsed tokens in the schema (this may be incomplete if errors present)
errorsstring[] | undefinedIf present, unrecoverable errors were encountered (you should probably throw with these messages).
warningsstring[] | undefinedIf present, the parser found schema issues that are likely undesirable, but the schema is still usable (you should probably show the user).

Keywords

FAQs

Package last updated on 24 Nov 2024

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