Skip to content

Commit

Permalink
fix(4map,cmds): strict mode errors
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed May 8, 2024
1 parent 4ae3032 commit d1ea1bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 4mat/4mat.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export function assignCamelCase <T extends {}> (
for (const property of allowed) {
if (property in properties) {
if (typeof property === 'string') {
object[Case.camel(property)] = properties[property]
(object as any)[Case.camel(property)] = properties[property]
} else {
object[property] = properties[property]
(object as any)[property] = properties[property]
}
}
}
Expand Down
14 changes: 8 additions & 6 deletions cmds/cmds-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export default class Command<C extends object> extends Timed<C, Error> {
steps: Step<C, unknown>[]
log: Console

constructor (parameters: Partial<Command<C>> = {}) {
constructor (
parameters: Pick<Command<C>, 'name'|'steps'> &
Partial<Pick<Command<C>, 'args'|'info'|'log'>>
) {
super()
this.name = parameters.name
this.args = parameters.args
this.info = parameters.info
this.name = parameters.name
this.steps = parameters.steps
this.log = parameters.log || new Console(this.name)
this.args = parameters.args || ''
this.info = parameters.info || ''
this.log = parameters.log || new Console(this.name)
Object.defineProperty(this, 'log', { enumerable: false, writable: true })
this.args = parameters.args
}

/** Run the command with the specified arguments. */
Expand Down

0 comments on commit d1ea1bb

Please sign in to comment.