Comparing version 2.3.0 to 2.3.1
@@ -7,2 +7,10 @@ # Changelog | ||
#### Koffi 2.3.1 | ||
**Main changes:** | ||
- Error out when trying to use ambiguous `void *` arguments (input and/or output) | ||
- Adjust TypeScript definitions ([@insraq](https://github.com/insraq)) | ||
- Fix possible crash when parsing invalid prototype | ||
#### Koffi 2.3.0 | ||
@@ -13,3 +21,3 @@ | ||
- Allow buffers (TypedArray or ArrayBuffer) values for input and/or output pointer arguments (for polymorphic arguments) | ||
- Support opaque buffers (TypedArray or ArrayBuffer) values in `koffi.decode()` to [decode output buffers](calls.md#output-parameters) | ||
- Support opaque buffers (TypedArray or ArrayBuffer) values in `koffi.decode()` to [decode output buffers](calls.md#output-buffers) | ||
- Decode non-string types as arrays when an [explicit length is passed to koffi.decode()](callbacks.md#pointer-arguments) | ||
@@ -16,0 +24,0 @@ |
@@ -162,3 +162,3 @@ # Function calls | ||
### Input parameters | ||
### Input polymorphism | ||
@@ -225,3 +225,3 @@ *New in Koffi 2.1* | ||
### Output parameters | ||
### Output buffers | ||
@@ -292,3 +292,2 @@ *New in Koffi 2.3* | ||
// You can also use: const strdup = lib.func('const char *! strdup(const char *str)') | ||
const HeapStr = koffi.disposable('str'); | ||
@@ -295,0 +294,0 @@ const strdup = lib.cdecl('strdup', HeapStr, ['str']); |
{ | ||
"name": "koffi", | ||
"version": "2.3.0", | ||
"stable": "2.3.0", | ||
"version": "2.3.1", | ||
"stable": "2.3.1", | ||
"description": "Fast and simple C FFI (foreign function interface) for Node.js", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -24,11 +24,11 @@ // This program is free software: you can redistribute it and/or modify | ||
type TypeInfo = { | ||
name: string, | ||
primitive: string, | ||
size: number, | ||
alignment: number, | ||
length: number, | ||
ref: IKoffiCType, | ||
members: Record<string, { name: string, type: {}, offset: number }> | ||
name: string; | ||
primitive: string; | ||
size: number; | ||
alignment: number; | ||
length: number; | ||
ref: IKoffiCType; | ||
members: Record<string, { name: string, type: IKoffiCType, offset: number }>; | ||
}; | ||
type KoffiFunction = Function | { async: Function }; | ||
type KoffiFunction = Function & { async: Function }; | ||
@@ -68,3 +68,3 @@ export interface IKoffiLib { | ||
export function as(value: {}, type: TypeSpec): IKoffiPointerCast; | ||
export function as(value: any, type: TypeSpec): IKoffiPointerCast; | ||
@@ -78,3 +78,2 @@ export function disposable(type: TypeSpec): IKoffiCType; | ||
interface IKoffiRegisteredCallback { __brand: 'IKoffiRegisteredCallback' } | ||
export function register(callback: Function, type: TypeSpec): IKoffiRegisteredCallback; | ||
@@ -84,6 +83,6 @@ export function register(thisValue: any, callback: Function, type: TypeSpec): IKoffiRegisteredCallback; | ||
export function decode(value: {}, type: TypeSpec): {}; | ||
export function decode(value: {}, type: TypeSpec, len: number): {}; | ||
export function decode(value: {}, offset: number, type: TypeSpec): {}; | ||
export function decode(value: {}, offset: number, type: TypeSpec, len: number): {}; | ||
export function decode(value: any, type: TypeSpec): any; | ||
export function decode(value: any, type: TypeSpec, len: number): any; | ||
export function decode(value: any, offset: number, type: TypeSpec): any; | ||
export function decode(value: any, offset: number, type: TypeSpec, len: number): any; | ||
@@ -98,4 +97,4 @@ export function sizeof(type: TypeSpec): number; | ||
export function config(): {} | ||
export function config({}): {} | ||
export function config(): Record<string, unknown>; | ||
export function config(cfg: Record<string, unknown>): Record<string, unknown>; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 15 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 15 instances in 1 package
26757754
5170