diff --git a/.github/workflows/publish-package-npm.yml b/.github/workflows/publish-package-npm.yml index 674483d..ca7b448 100644 --- a/.github/workflows/publish-package-npm.yml +++ b/.github/workflows/publish-package-npm.yml @@ -63,13 +63,7 @@ jobs: run: npm ci --ignore-scripts --audit=false - name: Build - run: | - if jq --exit-status '(.scripts // {}) | has("build")' package.json > /dev/null; then - echo "Running npm run build..." - npm run build - else - echo "No build script; skipping." - fi + run: npm run build --if-present - name: Publish dry run if: github.event_name == 'workflow_dispatch' diff --git a/index.d.ts b/index.d.ts index 57a46c8..3384135 100644 --- a/index.d.ts +++ b/index.d.ts @@ -82,7 +82,7 @@ declare module "@athombv/data-types" { // ToD // date - // UTC + UTC: DataType; // clusterId // attribId diff --git a/lib/DataTypes.js b/lib/DataTypes.js index 4a8d2f2..726ed9c 100644 --- a/lib/DataTypes.js +++ b/lib/DataTypes.js @@ -496,7 +496,7 @@ const DataTypes = { // ToD : new DataType(224, 'ToD' , 4 , ), // date : new DataType(225, 'date' , 4 , ), -// UTC : new DataType(226, 'UTC' , 4 , ), + UTC : new DataType(226, 'UTC' , 4 , uintToBuf , uintFromBuf ), // clusterId : new DataType(232, 'clusterId' , 2 , ), // attribId : new DataType(233, 'attribId' , 2 , ), diff --git a/package-lock.json b/package-lock.json index 3fb2fe2..cf62f56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@athombv/data-types", - "version": "1.2.2", + "version": "1.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6d79103..50374ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athombv/data-types", - "version": "1.2.2", + "version": "1.3.0", "description": "Binary Data Parsers", "main": "index.js", "types": "index.d.ts", diff --git a/test/types-test.ts b/test/types-test.ts index 1bf4dfa..ae1d451 100644 --- a/test/types-test.ts +++ b/test/types-test.ts @@ -42,6 +42,7 @@ const ints = Struct("Ints", { i8: DataTypes.int8, i32: DataTypes.int32, u4: DataTypes.uint4, + utc: DataTypes.UTC, sng: DataTypes.single, dbl: DataTypes.double, }).fromBuffer(emptyBuf()); @@ -51,6 +52,7 @@ const _intU32: number = ints.u32; const _intI8: number = ints.i8; const _intI32: number = ints.i32; const _intU4: number = ints.u4; +const _intUtc: number = ints.utc; const _intSng: number = ints.sng; const _intDbl: number = ints.dbl;