UNPKG

@maggioli-design-system/design-tokens

Version:

This is the Design Token library of Maggioli Design System, here you'll find all the visual data used around the libraries.

28 lines (27 loc) 1.21 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.jsonCoolorsFormat = void 0; const handlebars_1 = __importDefault(require("handlebars")); const fs_1 = __importDefault(require("fs")); const path_1 = __importDefault(require("path")); const package_json_1 = require("../../../package.json"); const helpers_1 = require("../helpers"); const templatePath = path_1.default.resolve(__dirname, './template.hbs'); const template = handlebars_1.default.compile(fs_1.default.readFileSync(templatePath).toString()); handlebars_1.default.registerHelper('coolorizeName', helpers_1.humanCase); handlebars_1.default.registerHelper('leadZero', helpers_1.leadZero); handlebars_1.default.registerHelper('ifEquals', helpers_1.ifEquals); exports.jsonCoolorsFormat = { name: 'json/coolors', formatter: ({ dictionary, platform }) => { return template({ properties: dictionary.properties, date: new Date().toUTCString(), options: platform, version: package_json_1.version, }); }, };