@ui-autotools/registry
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -9,3 +9,8 @@ "use strict"; | ||
addSim(sim) { | ||
this.simulations.push(sim); | ||
if (this.simulations.every((simulation) => simulation.title !== sim.title)) { | ||
this.simulations.push(sim); | ||
} | ||
else { | ||
throw new Error(`There's already a simulation with the title ${sim.title}. Titles should be unique.`); | ||
} | ||
} | ||
@@ -12,0 +17,0 @@ addStyle(style, description) { |
import Registry from './registry'; | ||
export { ComponentMetadata } from './component-metadata'; | ||
export * from './types'; | ||
export default Registry; |
@@ -20,3 +20,4 @@ import { ComponentType } from 'react'; | ||
export interface ISimulation<Props> { | ||
title: string; | ||
props: Props; | ||
} |
@@ -7,3 +7,8 @@ export class ComponentMetadata { | ||
addSim(sim) { | ||
this.simulations.push(sim); | ||
if (this.simulations.every((simulation) => simulation.title !== sim.title)) { | ||
this.simulations.push(sim); | ||
} | ||
else { | ||
throw new Error(`There's already a simulation with the title ${sim.title}. Titles should be unique.`); | ||
} | ||
} | ||
@@ -10,0 +15,0 @@ addStyle(style, description) { |
import Registry from './registry'; | ||
export { ComponentMetadata } from './component-metadata'; | ||
export * from './types'; | ||
export default Registry; |
@@ -20,3 +20,4 @@ import { ComponentType } from 'react'; | ||
export interface ISimulation<Props> { | ||
title: string; | ||
props: Props; | ||
} |
{ | ||
"name": "@ui-autotools/registry", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "cjs/index.js", | ||
@@ -33,3 +33,3 @@ "module": "esm/index.js", | ||
}, | ||
"gitHead": "cd8e44c994c0b61f5fa8ac6e7fd53b64a9d1d615" | ||
"gitHead": "9912700199c99a4c852c1460a7c974e9d4e05e39" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
13076
187