Socket
Socket
Sign inDemoInstall

@tauri-apps/api

Package Overview
Dependencies
Maintainers
5
Versions
75
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.0 to 1.5.1

6

CHANGELOG.md
# Changelog
## \[1.5.1]
### New Features
- [`2b0212af`](https://www.github.com/tauri-apps/tauri/commit/2b0212af49c386e52bb2357381813d6d435ec4af)([#7961](https://www.github.com/tauri-apps/tauri/pull/7961)) Add `mockConvertFileSrc` in `mocks` module, to mock `convertFileSrc` function.
## \[1.5.0]

@@ -4,0 +10,0 @@

22

mocks.d.ts

@@ -105,2 +105,22 @@ /**

/**
* Mock `convertFileSrc` function
*
*
* @example
* ```js
* import { mockConvertFileSrc } from "@tauri-apps/api/mocks";
* import { convertFileSrc } from "@tauri-apps/api/tauri";
*
* mockConvertFileSrc("windows")
*
* const url = convertFileSrc("C:\\Users\\user\\file.txt")
* ```
*
* @param osName The operating system to mock, can be one of linux, macos, or windows
* @param windowsProtocolScheme The scheme to use on Windows, can be either `http` or `https` and defaults to `https`
*
* @since 1.6.0
*/
declare function mockConvertFileSrc(osName: string, windowsProtocolScheme?: string): void;
/**
* Clears mocked functions/data injected by the other functions in this module.

@@ -133,2 +153,2 @@ * When using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.

export { clearMocks, mockIPC, mockWindows };
export { clearMocks, mockConvertFileSrc, mockIPC, mockWindows };

2

mocks.js

@@ -1,1 +0,1 @@

import"./chunk-FEIY7W7S.js";function w(n){window.__TAURI_IPC__=async({cmd:o,callback:_,error:e,...i})=>{try{window[`_${_}`](await n(o,i))}catch(r){window[`_${e}`](r)}}}function t(n,...o){window.__TAURI_METADATA__={__windows:[n,...o].map(_=>({label:_})),__currentWindow:{label:n}}}function d(){delete window.__TAURI_IPC__,delete window.__TAURI_METADATA__}export{d as clearMocks,w as mockIPC,t as mockWindows};
import"./chunk-FEIY7W7S.js";function r(n){window.__TAURI_IPC__=async({cmd:o,callback:_,error:e,...i})=>{try{window[`_${_}`](await n(o,i))}catch(t){window[`_${e}`](t)}}}function w(n,...o){window.__TAURI_METADATA__={__windows:[n,...o].map(_=>({label:_})),__currentWindow:{label:n}}}function c(n,o="https"){window.__TAURI__=window.__TAURI__??{},window.__TAURI__.convertFileSrc=function(_,e="asset"){let i=encodeURIComponent(_);return n==="windows"?`${o}://${e}.localhost/${i}`:`${e}://localhost/${i}`}}function d(){delete window.__TAURI__.convertFileSrc,delete window.__TAURI_IPC__,delete window.__TAURI_METADATA__}export{d as clearMocks,c as mockConvertFileSrc,r as mockIPC,w as mockWindows};
{
"name": "@tauri-apps/api",
"version": "1.5.0",
"version": "1.5.1",
"description": "Tauri API definitions",

@@ -5,0 +5,0 @@ "type": "module",

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