@e-mc/core 0.8.23 → 0.8.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/index.js +6 -3
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, LogStatus } from "./squared";
@@ -165,13 +165,13 @@ interface IPermission {
165
165
 
166
166
  ## References
167
167
 
168
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/squared.d.ts
169
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/core.d.ts
170
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/db.d.ts
171
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/dom.d.ts
172
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/logger.d.ts
173
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/node.d.ts
174
- - https://www.unpkg.com/@e-mc/types@0.8.23/lib/settings.d.ts
168
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/squared.d.ts
169
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/core.d.ts
170
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/db.d.ts
171
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/dom.d.ts
172
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/logger.d.ts
173
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/node.d.ts
174
+ - https://www.unpkg.com/@e-mc/types@0.8.24/lib/settings.d.ts
175
175
 
176
176
  ## LICENSE
177
177
 
package/index.js CHANGED
@@ -221,8 +221,11 @@ function isInvalidRange(result, range) {
221
221
  return result.length <= lower || upper > 0 && result.length > upper;
222
222
  }
223
223
  function asPosix(value) {
224
- value = path.normalize(value.trim());
225
- return PLATFORM_WIN32 ? value.replace(/(?:^\\|\\+)/g, '/') : value;
224
+ if (PLATFORM_WIN32) {
225
+ value = path.normalize(value.trim());
226
+ return value.replace(/(?:^\\|\\+)/g, '/');
227
+ }
228
+ return path.normalize(value);
226
229
  }
227
230
  const readable = (value) => (0, types_1.isString)(value) || (0, types_1.isArray)(value);
228
231
  const expireTime = (value) => Date.now() + value * 1000;
@@ -344,7 +347,7 @@ class Host extends module_1.default {
344
347
  return permission;
345
348
  }
346
349
  static isPermission(value) {
347
- return value instanceof Permission;
350
+ return value instanceof Permission || (0, types_1.isObject)(value) && !!value[kDiskRead] && !!value[kDiskWrite];
348
351
  }
349
352
  static kill(username, iv, pid) {
350
353
  let result = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/core",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
4
4
  "description": "Core modules for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/module": "0.8.23",
24
- "@e-mc/types": "0.8.23",
23
+ "@e-mc/module": "0.8.24",
24
+ "@e-mc/types": "0.8.24",
25
25
  "picomatch": "^3.0.1"
26
26
  }
27
27
  }