Fixes for js

This commit is contained in:
KillerBossOriginal 2024-07-04 22:12:23 +02:00
parent f1444c497a
commit 86c0aede34
3 changed files with 9 additions and 1 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>

View file

@ -4,7 +4,7 @@ plugins {
}
group = "org.thundernetwork.permissionchecker"
version = "2.0"
version = "2.1"
repositories {
mavenCentral()

View file

@ -1,5 +1,10 @@
package org.thundernetwork.permissionchecker
import kotlin.js.ExperimentalJsExport
import kotlin.js.JsExport
@OptIn(ExperimentalJsExport::class)
@JsExport
fun checkSingle(permission: String, requiredPermission: String): Boolean {
var answer = false
if (permission === "*") answer = true
@ -19,6 +24,8 @@ fun checkSingle(permission: String, requiredPermission: String): Boolean {
return answer
}
@OptIn(ExperimentalJsExport::class)
@JsExport
fun checkList(permission: Array<String>, requiredPermission: Array<String>): Boolean {
var actualLength = 0
val requiredLength = requiredPermission.size