Skip to content

Commit

Permalink
Version 3.4.0-b23
Browse files Browse the repository at this point in the history
Changes to support ES2015
  • Loading branch information
chrishamm committed Sep 5, 2022
1 parent bb8ab10 commit 9996218
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@duet3d/objectmodel",
"version": "3.4.0-b22",
"version": "3.4.0-b23",
"description": "TypeScript implementation of the Duet3D Object Model",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/ModelObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export abstract class ModelObject implements IModelObject {
console.warn(`Incompatible bool target type ${typeof value} for property ${key}`);
}
} else if (propType === "number") {
if (typeof value === "number") {
if (typeof value === "number" || typeof value === "bigint") {
this[ownKey] = value as any;
} else if (process.env.NODE_ENV !== "production") {
console.warn(`Incompatible number target type ${typeof value} for property ${key}`);
Expand Down
2 changes: 1 addition & 1 deletion src/inputs/InputChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class InputChannel extends ModelObject {
name: string = "";
stackDepth: number = 0;
state: InputChannelState = InputChannelState.idle;
lineNumber: bigint = 0n;
lineNumber: number | bigint = 0;
volumetric: boolean = false;
}

Expand Down
6 changes: 3 additions & 3 deletions src/job/GCodeFileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export class GCodeFileInfo extends ModelObject {
lastModified: string | null = null;
layerHeight: number = 0;
numLayers: number = 0;
printTime: bigint | null = null;
simulatedTime: bigint | null = null;
size: bigint = 0n;
printTime: number | bigint | null = null;
simulatedTime: number | bigint | null = null;
size: number | bigint = 0;
readonly thumbnails: ModelCollection<ThumbnailInfo> = new ModelCollection(ThumbnailInfo);
}

Expand Down
2 changes: 1 addition & 1 deletion src/job/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Job extends ModelObject {
build: Build = new Build();
duration: number | null = null;
file: GCodeFileInfo | null = null;
filePosition: bigint | null = null;
filePosition: number | bigint | null = null;
lastDuration: number | null = null;
lastFileName: string | null = null;
lastFileAborted: boolean = false;
Expand Down
4 changes: 2 additions & 2 deletions src/volumes/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ModelObject from "../ModelObject";

export class Volume extends ModelObject {
capacity: bigint | null = null;
freeSpace: bigint | null = null;
capacity: number | bigint | null = null;
freeSpace: number | bigint | null = null;
mounted: boolean = false;
name: string | null = null;
openFiles: number | null = null;
Expand Down
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"compilerOptions": {
"target": "es2020",
"target": "ES2015",
"module": "CommonJS",
"declaration": true,
"outDir": "./dist",
"strict": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
"include": [
"src"
],
"exclude": [
"node_modules",
"**/__tests__/*"
]
}

0 comments on commit 9996218

Please sign in to comment.