mirror of
https://github.com/esiur/esiur-js.git
synced 2025-05-06 12:32:58 +00:00
Fix
This commit is contained in:
parent
2a99d4c04a
commit
b74d236ca3
6
.babelrc
Normal file
6
.babelrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"presets": ["@babel/preset-env"],
|
||||||
|
"plugins": [
|
||||||
|
["@babel/transform-runtime"]
|
||||||
|
]
|
||||||
|
}
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
src/node_modules/
|
node_modules/
|
||||||
test.js
|
test.js
|
9257
build/esyur.js
Normal file
9257
build/esyur.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
exports.printMsg = function() {
|
exports.printMsg = function() {
|
||||||
console.log("Esyur 1.1");
|
console.log("Esyur");
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { wh };
|
module.exports = { wh };
|
||||||
|
5017
package-lock.json
generated
Normal file
5017
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
package.json
Normal file
34
package.json
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "esyur",
|
||||||
|
"version": "1.3.7",
|
||||||
|
"description": "Distributed Object Framework",
|
||||||
|
"main": "esyur.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"babel": "./node_modules/.bin/babel src -d build",
|
||||||
|
"build": "browserify src/esyur.js -t babelify --outfile build/esyur.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/esyur/esyur-js.git"
|
||||||
|
},
|
||||||
|
"author": "Ahmed Zamil",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/esyur/esyur-js/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/esyur/esyur-js#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.7.7",
|
||||||
|
"ws": "^6.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/cli": "^7.7.7",
|
||||||
|
"@babel/core": "^7.7.7",
|
||||||
|
"@babel/plugin-transform-runtime": "^7.7.6",
|
||||||
|
"@babel/preset-env": "^7.7.7",
|
||||||
|
"babel-cli": "^6.0.0",
|
||||||
|
"babelify": "^10.0.0",
|
||||||
|
"browserify": "^16.5.0"
|
||||||
|
}
|
||||||
|
}
|
1
src/.gitignore
vendored
1
src/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
node_modules/
|
|
@ -53,8 +53,8 @@ export default
|
|||||||
//Array = 0x80,
|
//Array = 0x80,
|
||||||
VarArray: 0x80,
|
VarArray: 0x80,
|
||||||
BoolArray: 0x81,
|
BoolArray: 0x81,
|
||||||
UInt8Array: 0x82,
|
Int8Array: 0x82,
|
||||||
Int8Array: 0x83,
|
UInt8Array: 0x83,
|
||||||
CharArray: 0x84,
|
CharArray: 0x84,
|
||||||
Int16Array: 0x85,
|
Int16Array: 0x85,
|
||||||
UInt16Array: 0x86,
|
UInt16Array: 0x86,
|
||||||
|
@ -51,6 +51,8 @@ export class WH extends IEventHandler
|
|||||||
this.protocols = new KeyList();
|
this.protocols = new KeyList();
|
||||||
this._register("connected");
|
this._register("connected");
|
||||||
this._register("disconnected");
|
this._register("disconnected");
|
||||||
|
///this._urlRegex = /^(?:([\S]*):\/\/([^\/]*)\/?)/;
|
||||||
|
this._urlRegex = /^(?:([^\s|:]*):\/\/([^\/]*)\/?)/;
|
||||||
}
|
}
|
||||||
|
|
||||||
new(type, name, store = null, parent = null, manager = null, attributes = null)
|
new(type, name, store = null, parent = null, manager = null, attributes = null)
|
||||||
@ -72,29 +74,35 @@ export class WH extends IEventHandler
|
|||||||
|
|
||||||
// Should we create a new store ?
|
// Should we create a new store ?
|
||||||
|
|
||||||
if (path.includes("://"))
|
|
||||||
{
|
|
||||||
|
|
||||||
var url = path.split("://", 2);
|
if (path.match(this._urlRegex))
|
||||||
var hostname = url[1].split("/", 2)[0];
|
//if (path.includes("://"))
|
||||||
var pathname = url[1].split("/").splice(1).join("/");
|
{
|
||||||
|
// with port
|
||||||
|
//var url = path.split(/(?:):\/\/([^:\/]*):?(\d*)/);
|
||||||
|
// without port
|
||||||
|
let url = path.split(this._urlRegex);
|
||||||
|
|
||||||
|
//var url = path.split("://", 2);
|
||||||
|
//var hostname = url[1];// url[1].split("/", 2)[0];
|
||||||
|
//var pathname = url[2];// url[1].split("/").splice(1).join("/");
|
||||||
|
|
||||||
var handler;
|
var handler;
|
||||||
|
|
||||||
if (handler = this.protocols.item(url[0]))
|
if (handler = this.protocols.item(url[1]))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var store = handler();
|
var store = handler();
|
||||||
this.put(store, hostname, null, parent, null, 0, manager, attributes);
|
this.put(store, url[2], null, parent, null, 0, manager, attributes);
|
||||||
|
|
||||||
|
|
||||||
store.trigger(ResourceTrigger.Open).then(x => {
|
store.trigger(ResourceTrigger.Open).then(x => {
|
||||||
|
|
||||||
this.warehouseIsOpen = true;
|
this.warehouseIsOpen = true;
|
||||||
|
|
||||||
if (pathname.length > 0 && pathname != "")
|
if (url[3].length > 0 && url[3] != "")
|
||||||
store.get(pathname).then(r => {
|
store.get(url[3]).then(r => {
|
||||||
rt.trigger(r);
|
rt.trigger(r);
|
||||||
}).error(e => rt.triggerError(e));
|
}).error(e => rt.triggerError(e));
|
||||||
else
|
else
|
||||||
|
21
src/package-lock.json
generated
21
src/package-lock.json
generated
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "esyur",
|
|
||||||
"version": "1.2.2",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"async-limiter": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
|
|
||||||
},
|
|
||||||
"ws": {
|
|
||||||
"version": "6.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz",
|
|
||||||
"integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==",
|
|
||||||
"requires": {
|
|
||||||
"async-limiter": "~1.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "esyur",
|
|
||||||
"version": "1.3.5",
|
|
||||||
"description": "Distributed Object Framework",
|
|
||||||
"main": "esyur.js",
|
|
||||||
"scripts": {
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/esyur/esyur-js.git"
|
|
||||||
},
|
|
||||||
"author": "Ahmed Zamil",
|
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/esyur/esyur-js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/esyur/esyur-js#readme",
|
|
||||||
"dependencies": {
|
|
||||||
"ws": "^6.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user