Skip to content

Commit

Permalink
chore: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Sep 24, 2024
1 parent c3e770f commit 009966d
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/win32-api/demo/EnumDisplayDevicesW.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ try {

console.info({ res, DeviceID, DeviceKey, DeviceName, DeviceString })

assert(DeviceID.startsWith('PCI\\VEN_') || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(DeviceID.startsWith(String.raw`PCI\VEN_`) || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(typeof DeviceKey === 'string', DeviceKey)
assert(DeviceName === '\\\\.\\DISPLAY1', DeviceName)
assert(DeviceName === String.raw`\\.\DISPLAY1`, DeviceName)
assert(DeviceString.length > 0)
const flag = ['Microsoft Hyper-V', 'Intel', 'AMD', 'Radeon'].some(val => DeviceString.includes(val))
assert(flag, DeviceString)
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/demo/create_window.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author waiting
* @link https://github.com/waitingsong/node-win32-api
*/
import assert from 'assert'
import assert from 'node:assert'

import { sleep } from '@waiting/shared-core'
import { ffi, User32, Kernel32 } from 'win32-api'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import type { FlattenNestedTuple } from '@waiting/shared-types'
import { WString } from 'win32-def/def'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import type { FlattenNestedTuple } from '@waiting/shared-types'
import { getPRINTER_INFO_X_Ptr } from 'win32-def/struct'
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/util/user32/FindWindowEx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import { load } from '##/lib/user32/index.js'
import type { LibUser32 } from '##/lib/user32/index.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/util/user32/GetWindowText.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import { ucsBufferToString } from 'win32-def'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-api/src/util/user32/MessageBox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* c8 ignore start */
import assert from 'assert'
import assert from 'node:assert'

import { load } from '##/lib/user32/index.js'
import type { LibUser32 } from '##/lib/user32/index.js'
Expand Down
4 changes: 2 additions & 2 deletions packages/win32-def/demo/EnumDisplayDevicesW.mts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ try {

console.info({ res, DeviceID, DeviceKey, DeviceName, DeviceString })

assert(DeviceID.startsWith('PCI\\VEN_') || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(DeviceID.startsWith(String.raw`PCI\VEN_`) || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(typeof DeviceKey === 'string', DeviceKey)
assert(DeviceName === '\\\\.\\DISPLAY1', DeviceName)
assert(DeviceName === String.raw`\\.\DISPLAY1`, DeviceName)
assert(DeviceString.length > 0)
const flag = ['Microsoft Hyper-V', 'Intel', 'AMD', 'Radeon'].some(val => DeviceString.includes(val))
assert(flag, DeviceString)
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/loader/loader.cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class LoaderCache {
const cacheMap = LoaderCache.regCacheMap.get(lib)
const map = cacheMap?.get(fnName)
if (map?.size) {
const arr = map.entries().next().value as [FnDefArgs, KoffiFunction] | undefined
const arr = map.entries().next().value
const ret = arr?.[1]
return ret
}
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/struct/struct.helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import ffi from 'koffi'
import type { IKoffiCType } from 'koffi'
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/struct/struct.simple.helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import ffi from 'koffi'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/struct/struct.util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import type { StructFactoryResult } from '##/lib/types.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/src/lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import ffi from 'koffi'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ describe(fileShortPath(import.meta.url), () => {

console.info({ res, DeviceID, DeviceKey, DeviceName, DeviceString })

assert(DeviceID.startsWith('PCI\\VEN_') || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(DeviceID.startsWith(String.raw`PCI\VEN_`) || DeviceID.includes('VMBUS') || DeviceID === '', DeviceID)
assert(typeof DeviceKey === 'string', DeviceKey)
assert(DeviceName === '\\\\.\\DISPLAY1', DeviceName)
assert(DeviceName === String.raw`\\.\DISPLAY1`, DeviceName)
assert(DeviceString.length > 0)
const flag = ['Microsoft Hyper-V', 'Intel', 'AMD', 'Radeon'].some(val => DeviceString.includes(val))
assert(flag, DeviceString)
Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/test/mapper/EnumPrintersW.mapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import type { FlattenNestedTuple } from '@waiting/shared-types'

Expand Down
2 changes: 1 addition & 1 deletion packages/win32-def/test/mapper/GetPrinterW.mapper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'assert'
import assert from 'node:assert'

import type { FlattenNestedTuple } from '@waiting/shared-types'
import { getPRINTER_INFO_X_Ptr } from 'win32-def/struct'
Expand Down

0 comments on commit 009966d

Please sign in to comment.