UNPKG

pricing4ts

Version:

![NPM Version](https://img.shields.io/npm/v/pricing4ts) Pricing4TS is a TypeScript-based toolkit designed to enhance the server-side functionality of a pricing-driven SaaS by enabling the seamless integration of pricing plans into the application logic. T

11 lines (8 loc) 420 B
import yaml from 'js-yaml'; import { Pricing, ExtractedPricing } from '../models/pricing2yaml/pricing'; import { parsePricing } from './pricing-formatting/pricing-parser'; export function retrievePricingFromYaml(strigifiedYaml: string): Pricing { const extractedPricing: ExtractedPricing = yaml.load(strigifiedYaml) as ExtractedPricing; const pricing: Pricing = parsePricing(extractedPricing); return pricing; }