@e-mc/core 0.7.19 → 0.7.20

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 (2) hide show
  1. package/index.js +6 -3
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -217,8 +217,11 @@ function updateHostQueue(host, position, priority, broadcast) {
217
217
  }
218
218
  }
219
219
  function asPosix(value) {
220
- value = path.normalize(value.trim());
221
- return PLATFORM_WIN32 ? value.replace(/\\/g, '/') : value;
220
+ if (PLATFORM_WIN32) {
221
+ value = path.normalize(value.trim());
222
+ return value.replace(/(?:^\\|\\+)/g, '/');
223
+ }
224
+ return path.normalize(value);
222
225
  }
223
226
  const readable = (value) => (0, types_1.isString)(value) || (0, types_1.isArray)(value);
224
227
  const expireTime = (value) => Date.now() + value * 1000;
@@ -340,7 +343,7 @@ class Host extends module_1.default {
340
343
  return permission;
341
344
  }
342
345
  static isPermission(value) {
343
- return value instanceof Permission;
346
+ return value instanceof Permission || (0, types_1.isObject)(value) && !!value[kDiskRead] && !!value[kDiskWrite];
344
347
  }
345
348
  static kill(username, iv, pid) {
346
349
  let result = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/core",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
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.7.19",
24
- "@e-mc/types": "0.7.19",
23
+ "@e-mc/module": "0.7.20",
24
+ "@e-mc/types": "0.7.20",
25
25
  "picomatch": "^3.0.1"
26
26
  }
27
27
  }