Socket
Socket
Sign inDemoInstall

@tauri-apps/api

Package Overview
Dependencies
Maintainers
5
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tauri-apps/api - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

7

CHANGELOG.md
# Changelog
## \[1.5.4]
### Bug Fixes
- [`e3b6d38d2`](https://www.github.com/tauri-apps/tauri/commit/e3b6d38d26d27b292f98d6c0e8603a15265a5b43)([#9166](https://www.github.com/tauri-apps/tauri/pull/9166)) Fix `basename(path, 'ext')` JS API when removing all occurances of `ext` where it should only remove the last one.
- [`705da977a`](https://www.github.com/tauri-apps/tauri/commit/705da977a9c941a4b2d90219b34925498f507ab2)([#9529](https://www.github.com/tauri-apps/tauri/pull/9529)) Do not use JS optional chaining to prevent script errors on older webviews such as macOS 10.14.
## \[1.5.3]

@@ -4,0 +11,0 @@

25

dialog.js

@@ -149,2 +149,3 @@ import { invokeTauriCommand } from './helpers/tauri.js';

async function message(message, options) {
var _a, _b;
const opts = typeof options === 'string' ? { title: options } : options;

@@ -156,5 +157,5 @@ return invokeTauriCommand({

message: message.toString(),
title: opts?.title?.toString(),
type: opts?.type,
buttonLabel: opts?.okLabel?.toString()
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type: opts === null || opts === void 0 ? void 0 : opts.type,
buttonLabel: (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()
}

@@ -180,2 +181,3 @@ });

async function ask(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === 'string' ? { title: options } : options;

@@ -187,7 +189,7 @@ return invokeTauriCommand({

message: message.toString(),
title: opts?.title?.toString(),
type: opts?.type,
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type: opts === null || opts === void 0 ? void 0 : opts.type,
buttonLabels: [
opts?.okLabel?.toString() ?? 'Yes',
opts?.cancelLabel?.toString() ?? 'No'
(_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'Yes',
(_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : 'No'
]

@@ -214,2 +216,3 @@ }

async function confirm(message, options) {
var _a, _b, _c, _d, _e;
const opts = typeof options === 'string' ? { title: options } : options;

@@ -221,7 +224,7 @@ return invokeTauriCommand({

message: message.toString(),
title: opts?.title?.toString(),
type: opts?.type,
title: (_a = opts === null || opts === void 0 ? void 0 : opts.title) === null || _a === void 0 ? void 0 : _a.toString(),
type: opts === null || opts === void 0 ? void 0 : opts.type,
buttonLabels: [
opts?.okLabel?.toString() ?? 'Ok',
opts?.cancelLabel?.toString() ?? 'Cancel'
(_c = (_b = opts === null || opts === void 0 ? void 0 : opts.okLabel) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'Ok',
(_e = (_d = opts === null || opts === void 0 ? void 0 : opts.cancelLabel) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : 'Cancel'
]

@@ -228,0 +231,0 @@ }

@@ -173,3 +173,3 @@ import { invokeTauriCommand } from './helpers/tauri.js';

if (typeof contents === 'string') {
file.contents = contents ?? '';
file.contents = contents !== null && contents !== void 0 ? contents : '';
}

@@ -217,3 +217,3 @@ else {

// @ts-expect-error in this case `contents` is always a BinaryFileContents
file.contents = contents ?? [];
file.contents = contents !== null && contents !== void 0 ? contents : [];
}

@@ -220,0 +220,0 @@ return invokeTauriCommand({

@@ -245,2 +245,3 @@ import { invokeTauriCommand } from './helpers/tauri.js';

async request(options) {
var _a;
const jsonResponse = !options.responseType || options.responseType === ResponseType.JSON;

@@ -250,3 +251,3 @@ if (jsonResponse) {

}
if (options.body?.type === 'Form') {
if (((_a = options.body) === null || _a === void 0 ? void 0 : _a.type) === 'Form') {
options.body.payload = await formBody(options.body.payload);

@@ -424,2 +425,3 @@ }

async function fetch(url, options) {
var _a;
if (defaultClient === null) {

@@ -430,3 +432,3 @@ defaultClient = await getClient();

url,
method: options?.method ?? 'GET',
method: (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'GET',
...options

@@ -433,0 +435,0 @@ });

@@ -146,3 +146,4 @@ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy

function mockConvertFileSrc(osName, windowsProtocolScheme = 'https') {
window.__TAURI__ = window.__TAURI__ ?? {};
var _a;
window.__TAURI__ = (_a = window.__TAURI__) !== null && _a !== void 0 ? _a : {};
window.__TAURI__.convertFileSrc = function (filePath, protocol = 'asset') {

@@ -182,4 +183,5 @@ const path = encodeURIComponent(filePath);

function clearMocks() {
var _a;
// @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case
if (window.__TAURI__?.convertFileSrc)
if ((_a = window.__TAURI__) === null || _a === void 0 ? void 0 : _a.convertFileSrc)
delete window.__TAURI__.convertFileSrc;

@@ -186,0 +188,0 @@ // @ts-expect-error "The operand of a 'delete' operator must be optional' does not matter in this case

{
"name": "@tauri-apps/api",
"version": "1.5.3",
"version": "1.5.4",
"description": "Tauri API definitions",

@@ -48,9 +48,9 @@ "funding": {

"@rollup/plugin-typescript": "11.1.5",
"@types/node": "20.9.0",
"@types/node": "20.10.5",
"@typescript-eslint/eslint-plugin": "5.62.0",
"eslint-config-standard-with-typescript": "34.0.1",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.53.0",
"eslint": "8.56.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "15.7.0",

@@ -61,5 +61,5 @@ "eslint-plugin-node": "11.1.0",

"fast-glob": "3.3.2",
"prettier": "3.0.3",
"prettier": "3.1.1",
"rollup": "3.29.4",
"typescript": "5.2.2"
"typescript": "5.3.3"
},

@@ -66,0 +66,0 @@ "engines": {

@@ -436,5 +436,5 @@ import { BaseDirectory } from './fs';

* ```typescript
* import { dirname, appDataDir } from '@tauri-apps/api/path';
* const appDataDirPath = await appDataDir();
* const dir = await dirname(appDataDirPath);
* import { dirname } from '@tauri-apps/api/path';
* const dir = await dirname('/path/to/somedir/');
* assert(dir === 'somedir');
* ```

@@ -449,6 +449,5 @@ *

* ```typescript
* import { extname, resolveResource } from '@tauri-apps/api/path';
* const resourcePath = await resolveResource('app.conf');
* const ext = await extname(resourcePath);
* assert(ext === 'conf');
* import { extname } from '@tauri-apps/api/path';
* const ext = await extname('/path/to/file.html');
* assert(ext === 'html');
* ```

@@ -463,5 +462,4 @@ *

* ```typescript
* import { basename, resolveResource } from '@tauri-apps/api/path';
* const resourcePath = await resolveResource('app.conf');
* const base = await basename(resourcePath);
* import { basename } from '@tauri-apps/api/path';
* const base = await basename('path/to/app.conf');
* assert(base === 'app.conf');

@@ -468,0 +466,0 @@ * ```

@@ -697,5 +697,5 @@ import { invokeTauriCommand } from './helpers/tauri.js';

* ```typescript
* import { dirname, appDataDir } from '@tauri-apps/api/path';
* const appDataDirPath = await appDataDir();
* const dir = await dirname(appDataDirPath);
* import { dirname } from '@tauri-apps/api/path';
* const dir = await dirname('/path/to/somedir/');
* assert(dir === 'somedir');
* ```

@@ -718,6 +718,5 @@ *

* ```typescript
* import { extname, resolveResource } from '@tauri-apps/api/path';
* const resourcePath = await resolveResource('app.conf');
* const ext = await extname(resourcePath);
* assert(ext === 'conf');
* import { extname } from '@tauri-apps/api/path';
* const ext = await extname('/path/to/file.html');
* assert(ext === 'html');
* ```

@@ -740,5 +739,4 @@ *

* ```typescript
* import { basename, resolveResource } from '@tauri-apps/api/path';
* const resourcePath = await resolveResource('app.conf');
* const base = await basename(resourcePath);
* import { basename } from '@tauri-apps/api/path';
* const base = await basename('path/to/app.conf');
* assert(base === 'app.conf');

@@ -745,0 +743,0 @@ * ```

@@ -352,3 +352,3 @@ import { invokeTauriCommand } from './helpers/tauri.js';

this.args = typeof args === 'string' ? [args] : args;
this.options = options ?? {};
this.options = options !== null && options !== void 0 ? options : {};
}

@@ -355,0 +355,0 @@ /**

@@ -24,3 +24,3 @@ // Copyright 2019-2023 Tauri Programme within The Commons Conservancy

}
return callback?.(result);
return callback === null || callback === void 0 ? void 0 : callback(result);
},

@@ -27,0 +27,0 @@ writable: false,

@@ -32,3 +32,3 @@ import { listen, TauriEvent, emit, once } from './event.js';

return listen(TauriEvent.STATUS_UPDATE, (data) => {
handler(data?.payload);
handler(data === null || data === void 0 ? void 0 : data.payload);
});

@@ -136,3 +136,3 @@ }

once(TauriEvent.UPDATE_AVAILABLE, (data) => {
onUpdateAvailable(data?.payload);
onUpdateAvailable(data === null || data === void 0 ? void 0 : data.payload);
}).catch((e) => {

@@ -139,0 +139,0 @@ cleanListener();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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