Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koffi

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koffi - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

src/koffi/build/2.3.1/koffi_darwin_arm64.tar.gz

10

CHANGELOG.md

@@ -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 @@

5

doc/calls.md

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc