2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-05-06 12:32:58 +00:00
This commit is contained in:
Ahmed Zamil 2020-01-14 02:40:13 +03:00
parent 2a99d4c04a
commit b74d236ca3
11 changed files with 14335 additions and 57 deletions

6
.babelrc Normal file
View File

@ -0,0 +1,6 @@
{
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/transform-runtime"]
]
}

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
src/node_modules/
node_modules/
test.js

9257
build/esyur.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
exports.printMsg = function() {
console.log("Esyur 1.1");
console.log("Esyur");
}
module.exports = { wh };

5017
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View 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
View File

@ -1 +0,0 @@
node_modules/

View File

@ -53,8 +53,8 @@ export default
//Array = 0x80,
VarArray: 0x80,
BoolArray: 0x81,
UInt8Array: 0x82,
Int8Array: 0x83,
Int8Array: 0x82,
UInt8Array: 0x83,
CharArray: 0x84,
Int16Array: 0x85,
UInt16Array: 0x86,

View File

@ -51,6 +51,8 @@ export class WH extends IEventHandler
this.protocols = new KeyList();
this._register("connected");
this._register("disconnected");
///this._urlRegex = /^(?:([\S]*):\/\/([^\/]*)\/?)/;
this._urlRegex = /^(?:([^\s|:]*):\/\/([^\/]*)\/?)/;
}
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 ?
if (path.includes("://"))
{
var url = path.split("://", 2);
var hostname = url[1].split("/", 2)[0];
var pathname = url[1].split("/").splice(1).join("/");
if (path.match(this._urlRegex))
//if (path.includes("://"))
{
// 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;
if (handler = this.protocols.item(url[0]))
if (handler = this.protocols.item(url[1]))
{
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 => {
this.warehouseIsOpen = true;
if (pathname.length > 0 && pathname != "")
store.get(pathname).then(r => {
if (url[3].length > 0 && url[3] != "")
store.get(url[3]).then(r => {
rt.trigger(r);
}).error(e => rt.triggerError(e));
else

21
src/package-lock.json generated
View File

@ -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"
}
}
}
}

View File

@ -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"
}
}