Fixes for js
This commit is contained in:
parent
f1444c497a
commit
86c0aede34
3 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
|
|
@ -4,7 +4,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.thundernetwork.permissionchecker"
|
group = "org.thundernetwork.permissionchecker"
|
||||||
version = "2.0"
|
version = "2.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
package org.thundernetwork.permissionchecker
|
package org.thundernetwork.permissionchecker
|
||||||
|
|
||||||
|
import kotlin.js.ExperimentalJsExport
|
||||||
|
import kotlin.js.JsExport
|
||||||
|
|
||||||
|
@OptIn(ExperimentalJsExport::class)
|
||||||
|
@JsExport
|
||||||
fun checkSingle(permission: String, requiredPermission: String): Boolean {
|
fun checkSingle(permission: String, requiredPermission: String): Boolean {
|
||||||
var answer = false
|
var answer = false
|
||||||
if (permission === "*") answer = true
|
if (permission === "*") answer = true
|
||||||
|
@ -19,6 +24,8 @@ fun checkSingle(permission: String, requiredPermission: String): Boolean {
|
||||||
return answer
|
return answer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalJsExport::class)
|
||||||
|
@JsExport
|
||||||
fun checkList(permission: Array<String>, requiredPermission: Array<String>): Boolean {
|
fun checkList(permission: Array<String>, requiredPermission: Array<String>): Boolean {
|
||||||
var actualLength = 0
|
var actualLength = 0
|
||||||
val requiredLength = requiredPermission.size
|
val requiredLength = requiredPermission.size
|
||||||
|
|
Loading…
Reference in a new issue