@contrail/types
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
import { TypeProperty } from "../propeties"; | ||
import { TypeProperty } from "../properties"; | ||
export declare class FormulaProcessor { | ||
@@ -3,0 +3,0 @@ static processFormula(formula: string | undefined, data: any): number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FormulaProcessor = void 0; | ||
const propeties_1 = require("../propeties"); | ||
const properties_1 = require("../properties"); | ||
class FormulaProcessor { | ||
@@ -29,3 +29,3 @@ static processFormula(formula = '', data) { | ||
properties.forEach(property => { | ||
if (property.propertyType === propeties_1.PropertyType.Formula) { | ||
if (property.propertyType === properties_1.PropertyType.Formula) { | ||
entity[property.slug] = this.processFormula(property.formula, entity); | ||
@@ -32,0 +32,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const propeties_1 = require("../propeties"); | ||
const properties_1 = require("../properties"); | ||
const formula_processor_1 = require("./formula-processor"); | ||
@@ -26,4 +26,4 @@ describe('FormulaProcessor', () => { | ||
const properties = [ | ||
{ label: "Computed 1", slug: 'computed', formula: '{retailPrice}*{volume}-{retailPrice}', propertyType: propeties_1.PropertyType.Formula }, | ||
{ label: "Computed 2", slug: 'computed2', formula: '{retailPrice}*{volume}', propertyType: propeties_1.PropertyType.Formula }, | ||
{ label: "Computed 1", slug: 'computed', formula: '{retailPrice}*{volume}-{retailPrice}', propertyType: properties_1.PropertyType.Formula }, | ||
{ label: "Computed 2", slug: 'computed2', formula: '{retailPrice}*{volume}', propertyType: properties_1.PropertyType.Formula }, | ||
]; | ||
@@ -30,0 +30,0 @@ const entitiy = { |
export * from './formatter'; | ||
export * from './propeties'; | ||
export * from './properties'; | ||
export * from './formulas'; | ||
export * from './types'; |
@@ -14,4 +14,4 @@ "use strict"; | ||
__exportStar(require("./formatter"), exports); | ||
__exportStar(require("./propeties"), exports); | ||
__exportStar(require("./properties"), exports); | ||
__exportStar(require("./formulas"), exports); | ||
__exportStar(require("./types"), exports); |
@@ -1,2 +0,2 @@ | ||
import { TypeProperty } from "../propeties"; | ||
import { TypeProperty } from "../properties"; | ||
export interface Type { | ||
@@ -3,0 +3,0 @@ slug?: string; |
{ | ||
"name": "@contrail/types", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Types Utility module", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14386
346