@e-mc/core 0.6.15 → 0.6.17

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 +7 -4
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -132,7 +132,7 @@ function setPermission(name, pathname, enabled) {
132
132
  break;
133
133
  }
134
134
  }
135
- this[name] = Object.freeze({ enabled, value: enabled ? pathname : '' });
135
+ this[name] = Object.freeze({ enabled, value: enabled ? Object.freeze(pathname) : '' });
136
136
  }
137
137
  }
138
138
  function getFunctions(values) {
@@ -231,8 +231,11 @@ function updateHostQueue(host, position, priority, broadcast) {
231
231
  }
232
232
  }
233
233
  function asPosix(value) {
234
- value = path.normalize(value.trim());
235
- return PLATFORM_WIN32 ? value.replace(/\\/g, '/') : value;
234
+ if (PLATFORM_WIN32) {
235
+ value = path.normalize(value.trim());
236
+ return value.replace(/(?:^\\|\\+)/g, '/');
237
+ }
238
+ return path.normalize(value);
236
239
  }
237
240
  const readable = (value) => (0, types_1.isString)(value) || (0, types_1.isArray)(value);
238
241
  const expireTime = (value) => Date.now() + value * 1000;
@@ -354,7 +357,7 @@ class Host extends module_1.default {
354
357
  return permission;
355
358
  }
356
359
  static isPermission(value) {
357
- return value instanceof Permission;
360
+ return value instanceof Permission || (0, types_1.isObject)(value) && !!value[kDiskRead] && !!value[kDiskWrite];
358
361
  }
359
362
  static kill(username, iv, pid) {
360
363
  let result = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/core",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
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.6.15",
24
- "@e-mc/types": "0.6.15",
23
+ "@e-mc/module": "0.6.17",
24
+ "@e-mc/types": "0.6.17",
25
25
  "picomatch": "^2.3.1"
26
26
  }
27
27
  }