Skip to content

Commit

Permalink
Minor type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
repalash committed Jan 5, 2025
1 parent c6009a4 commit becd4e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uiconfig.js",
"version": "0.1.1",
"version": "0.1.2",
"description": "A framework for building user interface layouts with JSON configuration.",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/UiConfigMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class UiConfigMethods {
let sameType = !!lastCommand && (lastCommand as SetValueCommand).type === 'UiConfigMethods_set' && (lastCommand as SetValueCommand).config === c.config
if (sameType) {
const cLast = lastCommand as SetValueCommand
if (!cLast.final && c.time - cLast.time < 2000) {
if (!cLast.final && (c.time - cLast.time) < 2000) {
// replace cLast with c using lastVal from cLast
c.lastVal = cLast.lastVal
c.val = clonePrimitive(c.val)
Expand Down
2 changes: 1 addition & 1 deletion src/decorator_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function generateUiConfig(obj: any): Required<UiObjectConfig>['children']
export function generateUiFolder(label: string, obj: any, params: any = {}, type = 'folder', dynamic = false): UiObjectConfig {
return {
type, label,
children: !dynamic ? generateUiConfig(obj) : [()=> generateUiConfig(obj)],
children: !dynamic ? generateUiConfig(obj) : ()=> generateUiConfig(obj),
uuid: uuidV4(),
...params,
}
Expand Down
6 changes: 3 additions & 3 deletions src/primitive_value.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

export interface PrimitiveValObject {
clone(): PrimitiveValObject
equals(other: PrimitiveValObject|PrimitiveVal): boolean
copy(other: PrimitiveValObject): void
clone(): this
equals(other: this|any): boolean
copy(other: this|any): void|this|any
}
// note that arbitrary objects are not allowed
export type PrimitiveVal = string | number | boolean | null | PrimitiveValObject | PrimitiveVal[]
Expand Down

0 comments on commit becd4e4

Please sign in to comment.