mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 (#1228)
* chore(deps): replace dependency eslint-config-standard-with-typescript with eslint-config-love 43.1.0 * actually apply the rules lol * rebuild --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
@@ -134,7 +134,7 @@ export function textRecord(
|
||||
): NFCRecord {
|
||||
const payload = Array.from(new TextEncoder().encode(language + text));
|
||||
payload.unshift(language.length);
|
||||
return record(NFCTypeNameFormat.NfcWellKnown, RTD_TEXT, id || [], payload);
|
||||
return record(NFCTypeNameFormat.NfcWellKnown, RTD_TEXT, id ?? [], payload);
|
||||
}
|
||||
|
||||
const protocols = [
|
||||
@@ -180,12 +180,15 @@ function encodeURI(uri: string): number[] {
|
||||
let prefix = "";
|
||||
|
||||
protocols.slice(1).forEach(function (protocol) {
|
||||
if ((!prefix || prefix === "urn:") && uri.indexOf(protocol) === 0) {
|
||||
if (
|
||||
(prefix.length === 0 || prefix === "urn:") &&
|
||||
uri.indexOf(protocol) === 0
|
||||
) {
|
||||
prefix = protocol;
|
||||
}
|
||||
});
|
||||
|
||||
if (!prefix) {
|
||||
if (prefix.length === 0) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
@@ -203,7 +206,7 @@ export function uriRecord(uri: string, id?: string | number[]): NFCRecord {
|
||||
return record(
|
||||
NFCTypeNameFormat.NfcWellKnown,
|
||||
RTD_URI,
|
||||
id || [],
|
||||
id ?? [],
|
||||
encodeURI(uri),
|
||||
);
|
||||
}
|
||||
@@ -256,12 +259,12 @@ export async function write(
|
||||
records: NFCRecord[],
|
||||
options?: WriteOptions,
|
||||
): Promise<void> {
|
||||
const { kind, ...opts } = options || {};
|
||||
if (kind) {
|
||||
const { kind, ...opts } = options ?? {};
|
||||
if (kind != null) {
|
||||
// @ts-expect-error map the property
|
||||
opts.kind = mapScanKind(kind);
|
||||
}
|
||||
return await invoke("plugin:nfc|write", {
|
||||
await invoke("plugin:nfc|write", {
|
||||
records,
|
||||
...opts,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user