:zap:🚧 Remove internal socket and improve general structure
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"debug": false,
|
|
||||||
"port": 1571,
|
|
||||||
"maxFileSize": 99999,
|
|
||||||
"exclude":
|
|
||||||
[
|
|
||||||
"**/.DS_Store",
|
|
||||||
"node_modules/**",
|
|
||||||
"vendor/**",
|
|
||||||
".git"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// Depedencies
|
// Depedencies
|
||||||
const diff = require('diff')
|
const diff = require('diff')
|
||||||
const ids = require('../utils/ids.js')
|
const ids = require('./ids.js')
|
||||||
|
|
||||||
class File
|
class File
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
const paths = require('../utils/paths.js')
|
const paths = require('./paths.js')
|
||||||
const File = require('./file.js')
|
const File = require('./file.js')
|
||||||
|
|
||||||
class Files
|
class Files
|
||||||
+74
-12
@@ -4,6 +4,11 @@
|
|||||||
const ip = require('ip')
|
const ip = require('ip')
|
||||||
const Site = require('./site')
|
const Site = require('./site')
|
||||||
const Watcher = require('./watcher.js')
|
const Watcher = require('./watcher.js')
|
||||||
|
const Projects = require('./projects.js')
|
||||||
|
const socketIo = require('socket.io')
|
||||||
|
const util = require('util')
|
||||||
|
const colors = require('colors')
|
||||||
|
const opener = require('opener')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App class
|
* App class
|
||||||
@@ -17,6 +22,12 @@ class App
|
|||||||
{
|
{
|
||||||
this.setConfig()
|
this.setConfig()
|
||||||
// this.setSite()
|
// this.setSite()
|
||||||
|
|
||||||
|
this.socket = socketIo.listen()
|
||||||
|
|
||||||
|
this.projects = new Projects({ socket: this.socket, debug: this.config.debug })
|
||||||
|
this.project = this.projects.createProject(this.config.name)
|
||||||
|
|
||||||
this.setWatcher()
|
this.setWatcher()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,11 +112,7 @@ class App
|
|||||||
*/
|
*/
|
||||||
setSite()
|
setSite()
|
||||||
{
|
{
|
||||||
this.site = new Site({
|
this.site = new Site(this.config)
|
||||||
port: this.config.port,
|
|
||||||
domain: this.config.domain,
|
|
||||||
debug: this.config.debug
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,14 +121,69 @@ class App
|
|||||||
*/
|
*/
|
||||||
setWatcher()
|
setWatcher()
|
||||||
{
|
{
|
||||||
this.watcher = new Watcher({
|
this.watcher = new Watcher(this.config)
|
||||||
port: this.config.port,
|
|
||||||
domain: this.config.domain,
|
const url = this.config.domain + '/project/' + this.project.slug
|
||||||
debug: this.config.debug,
|
|
||||||
maxFileSize: this.config.maxFileSize,
|
console.log('server'.green.bold + ' - ' + url.cyan)
|
||||||
exclude: this.config.exclude,
|
|
||||||
name: this.config.name
|
// Open in browser
|
||||||
|
opener(url)
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if(this.config.debug)
|
||||||
|
{
|
||||||
|
console.log(util.inspect(this.project.files.describe(), { depth: null, colors: true }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update file
|
||||||
|
this.watcher.on('update_file', (data) =>
|
||||||
|
{
|
||||||
|
console.log(data)
|
||||||
|
this.project.files.createVersion(data.path, data.content)
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if(this.config.debug)
|
||||||
|
{
|
||||||
|
console.log(util.inspect(this.project.files.describe(), { depth: null, colors: true }))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Create file
|
||||||
|
this.watcher.on('create_file', (data) =>
|
||||||
|
{
|
||||||
|
this.project.files.create(data.path, data.content)
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if(this.config.debug)
|
||||||
|
{
|
||||||
|
console.log(util.inspect(this.project.files.describe(), { depth: null, colors: true }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Delete file
|
||||||
|
this.watcher.on('delete_file', (data) =>
|
||||||
|
{
|
||||||
|
this.project.files.delete(data.path)
|
||||||
|
|
||||||
|
// Debug
|
||||||
|
if(this.config.debug)
|
||||||
|
{
|
||||||
|
console.log(util.inspect(this.project.files.describe(), { depth: null, colors: true }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// // Disconnect
|
||||||
|
// this.watcher.on('disconnect', () =>
|
||||||
|
// {
|
||||||
|
// this.projects.delete_project(this.project.slug)
|
||||||
|
|
||||||
|
// // Debug
|
||||||
|
// if(this.config.debug)
|
||||||
|
// {
|
||||||
|
// console.log('socket app'.green.bold + ' - ' + 'disconnect'.cyan + ' - ' + socket.id.cyan)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
const express = require('express')
|
|
||||||
const router = express.Router()
|
|
||||||
|
|
||||||
router.get('/', function(request, response)
|
|
||||||
{
|
|
||||||
response.render('pages/index/projects.pug', {})
|
|
||||||
})
|
|
||||||
|
|
||||||
router.get(/project\/(.+)/, function(request, response)
|
|
||||||
{
|
|
||||||
response.render(
|
|
||||||
'pages/index/project.pug',
|
|
||||||
{
|
|
||||||
projectSlug: request.params['0']
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router
|
|
||||||
@@ -9,7 +9,7 @@ const colors = require('colors')
|
|||||||
const ip = require('ip')
|
const ip = require('ip')
|
||||||
const util = require('util')
|
const util = require('util')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const Projects = require('./models/projects.js')
|
const Projects = require('../projects.js')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const opener = require('opener')
|
const opener = require('opener')
|
||||||
|
|
||||||
|
|||||||
@@ -1,224 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
class EventEmitter
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
constructor()
|
|
||||||
{
|
|
||||||
this.callbacks = {}
|
|
||||||
this.callbacks.base = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* On
|
|
||||||
*/
|
|
||||||
on(_names, callback)
|
|
||||||
{
|
|
||||||
const that = this
|
|
||||||
|
|
||||||
// Errors
|
|
||||||
if(typeof _names === 'undefined' || _names === '')
|
|
||||||
{
|
|
||||||
console.warn('wrong names')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof callback === 'undefined')
|
|
||||||
{
|
|
||||||
console.warn('wrong callback')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve names
|
|
||||||
const names = this.resolveNames(names)
|
|
||||||
|
|
||||||
// Each name
|
|
||||||
names.forEach(function(_name)
|
|
||||||
{
|
|
||||||
// Resolve name
|
|
||||||
const name = that.resolveName(_name)
|
|
||||||
|
|
||||||
// Create namespace if not exist
|
|
||||||
if(!(that.callbacks[ name.namespace ] instanceof Object))
|
|
||||||
that.callbacks[ name.namespace ] = {}
|
|
||||||
|
|
||||||
// Create callback if not exist
|
|
||||||
if(!(that.callbacks[ name.namespace ][ name.value ] instanceof Array))
|
|
||||||
that.callbacks[ name.namespace ][ name.value ] = []
|
|
||||||
|
|
||||||
// Add callback
|
|
||||||
that.callbacks[ name.namespace ][ name.value ].push(callback)
|
|
||||||
})
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Off
|
|
||||||
*/
|
|
||||||
off(_names)
|
|
||||||
{
|
|
||||||
const that = this
|
|
||||||
|
|
||||||
// Errors
|
|
||||||
if(typeof _names === 'undefined' || _names === '')
|
|
||||||
{
|
|
||||||
console.warn('wrong name')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve names
|
|
||||||
const names = this.resolveNames(_names)
|
|
||||||
|
|
||||||
// Each name
|
|
||||||
names.forEach(function(_name)
|
|
||||||
{
|
|
||||||
// Resolve name
|
|
||||||
const name = that.resolveName(_name)
|
|
||||||
|
|
||||||
// Remove namespace
|
|
||||||
if(name.namespace !== 'base' && name.value === '')
|
|
||||||
{
|
|
||||||
delete that.callbacks[ name.namespace ]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove specific callback in namespace
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Default
|
|
||||||
if(name.namespace === 'base')
|
|
||||||
{
|
|
||||||
// Try to remove from each namespace
|
|
||||||
for(const namespace in that.callbacks)
|
|
||||||
{
|
|
||||||
if(that.callbacks[ namespace ] instanceof Object && that.callbacks[ namespace ][ name.value ] instanceof Array)
|
|
||||||
{
|
|
||||||
delete that.callbacks[ namespace ][ name.value ]
|
|
||||||
|
|
||||||
// Remove namespace if empty
|
|
||||||
if(Object.keys(that.callbacks[ namespace ]).length === 0)
|
|
||||||
delete that.callbacks[ namespace ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Specified namespace
|
|
||||||
else if(that.callbacks[ name.namespace ] instanceof Object && that.callbacks[ name.namespace ][ name.value ] instanceof Array)
|
|
||||||
{
|
|
||||||
delete that.callbacks[ name.namespace ][ name.value ]
|
|
||||||
|
|
||||||
// Remove namespace if empty
|
|
||||||
if(Object.keys(that.callbacks[ name.namespace ]).length === 0)
|
|
||||||
delete that.callbacks[ name.namespace ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Trigger
|
|
||||||
*/
|
|
||||||
trigger(_name, _args)
|
|
||||||
{
|
|
||||||
// Errors
|
|
||||||
if(typeof _name === 'undefined' || _name === '')
|
|
||||||
{
|
|
||||||
console.warn('wrong name')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
const that = this
|
|
||||||
let finalResult = null
|
|
||||||
let result = null
|
|
||||||
|
|
||||||
// Default args
|
|
||||||
const args = !(args instanceof Array) ? [] : _args
|
|
||||||
|
|
||||||
// Resolve names (should on have one event)
|
|
||||||
let name = this.resolveNames(_name)
|
|
||||||
|
|
||||||
// Resolve name
|
|
||||||
name = this.resolveName(name[ 0 ])
|
|
||||||
|
|
||||||
// Default namespace
|
|
||||||
if(name.namespace === 'base')
|
|
||||||
{
|
|
||||||
// Try to find callback in each namespace
|
|
||||||
for(const namespace in that.callbacks)
|
|
||||||
{
|
|
||||||
if(that.callbacks[ namespace ] instanceof Object && that.callbacks[ namespace ][ name.value ] instanceof Array)
|
|
||||||
{
|
|
||||||
that.callbacks[ namespace ][ name.value ].forEach(function(callback)
|
|
||||||
{
|
|
||||||
result = callback.apply(that,args)
|
|
||||||
|
|
||||||
if(typeof finalResult === 'undefined')
|
|
||||||
{
|
|
||||||
finalResult = result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Specified namespace
|
|
||||||
else if(this.callbacks[ name.namespace ] instanceof Object)
|
|
||||||
{
|
|
||||||
if(name.value === '')
|
|
||||||
{
|
|
||||||
console.warn('wrong name')
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
that.callbacks[ name.namespace ][ name.value ].forEach(function(callback)
|
|
||||||
{
|
|
||||||
result = callback.apply(that, args)
|
|
||||||
|
|
||||||
if(typeof finalResult === 'undefined')
|
|
||||||
finalResult = result
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return finalResult
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolve names
|
|
||||||
*/
|
|
||||||
resolveNames(_names)
|
|
||||||
{
|
|
||||||
let names = _names
|
|
||||||
names = names.replace(/[^a-zA-Z0-9 ,\/.]/g, '')
|
|
||||||
names = names.replace(/[,\/]+/g, ' ')
|
|
||||||
names = names.split(' ')
|
|
||||||
|
|
||||||
return names
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolve name
|
|
||||||
*/
|
|
||||||
resolveName(name)
|
|
||||||
{
|
|
||||||
const newName = {}
|
|
||||||
const parts = name.split('.')
|
|
||||||
|
|
||||||
newName.original = name
|
|
||||||
newName.value = parts[ 0 ]
|
|
||||||
newName.namespace = 'base' // Base namespace
|
|
||||||
|
|
||||||
// Specified namespace
|
|
||||||
if(parts.length > 1 && parts[ 1 ] !== '')
|
|
||||||
{
|
|
||||||
newName.namespace = parts[ 1 ]
|
|
||||||
}
|
|
||||||
|
|
||||||
return newName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = EventEmitter
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
| Project
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
| Projects
|
|
||||||
+26
-82
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
// Depedencies
|
// Depedencies
|
||||||
const chokidar = require('chokidar')
|
const chokidar = require('chokidar')
|
||||||
const ip = require('ip')
|
|
||||||
const socketIoClient = require('socket.io-client')
|
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const mime = require('mime')
|
const mime = require('mime')
|
||||||
const EventEmitter = require('../event-emitter.js')
|
const EventEmitter = require('../event-emitter.js')
|
||||||
@@ -16,82 +14,28 @@ class Watcher extends EventEmitter
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(_options)
|
constructor(_config)
|
||||||
{
|
{
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this.setOptions(_options)
|
this.config = _config
|
||||||
this.setWatcher()
|
|
||||||
this.setSocket()
|
this.watch()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set options
|
* Watch
|
||||||
|
* Listen to modifications on files and folders
|
||||||
*/
|
*/
|
||||||
setOptions(_options)
|
watch()
|
||||||
{
|
|
||||||
const options = typeof _options !== 'object' ? {} : _options
|
|
||||||
|
|
||||||
// Defaults
|
|
||||||
if(typeof options.debug === 'undefined')
|
|
||||||
{
|
|
||||||
options.debug = false
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof options.port === 'undefined')
|
|
||||||
{
|
|
||||||
options.port = 1571
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof options.domain === 'undefined')
|
|
||||||
{
|
|
||||||
options.domain = `http://${ip.address()}:${options.port}`
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof options.maxFileSize === 'undefined')
|
|
||||||
{
|
|
||||||
options.maxFileSize = 2000
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save
|
|
||||||
this.options = options
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set socket
|
|
||||||
* Connect to site
|
|
||||||
*/
|
|
||||||
setSocket()
|
|
||||||
{
|
|
||||||
// Set up
|
|
||||||
this.socket = socketIoClient(`${this.options.domain}/app`)
|
|
||||||
|
|
||||||
// Connect event
|
|
||||||
this.socket.on('connect', () =>
|
|
||||||
{
|
|
||||||
this.socket.emit('start_project', { name: this.options.name })
|
|
||||||
|
|
||||||
// Debug
|
|
||||||
if(this.options.debug)
|
|
||||||
{
|
|
||||||
console.log('connected'.green.bold)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set watcher
|
|
||||||
* Listen to modifications on file and folders
|
|
||||||
*/
|
|
||||||
setWatcher()
|
|
||||||
{
|
{
|
||||||
// Create ignored regex
|
// Create ignored regex
|
||||||
const regexs = []
|
const regexs = []
|
||||||
const Minimatch = require('minimatch').Minimatch
|
const Minimatch = require('minimatch').Minimatch
|
||||||
|
|
||||||
for(const _excludeKey in this.options.exclude)
|
for(const _excludeKey in this.config.exclude)
|
||||||
{
|
{
|
||||||
const _exclude = this.options.exclude[ _excludeKey ]
|
const _exclude = this.config.exclude[_excludeKey]
|
||||||
const minimatch = new Minimatch(_exclude, { dot: true })
|
const minimatch = new Minimatch(_exclude, { dot: true })
|
||||||
|
|
||||||
let regex = '' + minimatch.makeRe()
|
let regex = '' + minimatch.makeRe()
|
||||||
@@ -135,7 +79,7 @@ class Watcher extends EventEmitter
|
|||||||
fs.stat(_path, (error, stats) =>
|
fs.stat(_path, (error, stats) =>
|
||||||
{
|
{
|
||||||
// Max file size
|
// Max file size
|
||||||
if(this.options.maxFileSize < stats.size)
|
if(this.config.maxFileSize < stats.size)
|
||||||
{
|
{
|
||||||
file.canRead = false
|
file.canRead = false
|
||||||
}
|
}
|
||||||
@@ -148,13 +92,13 @@ class Watcher extends EventEmitter
|
|||||||
file.content = data.toString()
|
file.content = data.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Trigger
|
||||||
this.socket.emit('create_file', file)
|
this.trigger('create_file', [file])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if(this.options.debug)
|
if(this.config.debug)
|
||||||
{
|
{
|
||||||
console.log('add:'.green.bold, relativePath)
|
console.log('add:'.green.bold, relativePath)
|
||||||
}
|
}
|
||||||
@@ -181,7 +125,7 @@ class Watcher extends EventEmitter
|
|||||||
fs.stat(_path, (error, stats) =>
|
fs.stat(_path, (error, stats) =>
|
||||||
{
|
{
|
||||||
// Test max file size
|
// Test max file size
|
||||||
if(this.options.maxFileSize < stats.size)
|
if(this.config.maxFileSize < stats.size)
|
||||||
{
|
{
|
||||||
file.canRead = false
|
file.canRead = false
|
||||||
}
|
}
|
||||||
@@ -194,13 +138,13 @@ class Watcher extends EventEmitter
|
|||||||
file.content = data.toString()
|
file.content = data.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Trigger
|
||||||
this.socket.emit('update_file', file)
|
this.trigger('update_file', [file])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if(this.options.debug)
|
if(this.config.debug)
|
||||||
{
|
{
|
||||||
console.log('change:'.green.bold, relativePath)
|
console.log('change:'.green.bold, relativePath)
|
||||||
}
|
}
|
||||||
@@ -212,11 +156,11 @@ class Watcher extends EventEmitter
|
|||||||
// Set up
|
// Set up
|
||||||
const relativePath = _path.replace(process.cwd(), '.')
|
const relativePath = _path.replace(process.cwd(), '.')
|
||||||
|
|
||||||
// Send
|
// Trigger
|
||||||
this.socket.emit('delete_file', { path: relativePath })
|
this.trigger('delete_file', [relativePath])
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if(this.options.debug)
|
if(this.config.debug)
|
||||||
{
|
{
|
||||||
console.log('unlink:'.green.bold, relativePath)
|
console.log('unlink:'.green.bold, relativePath)
|
||||||
}
|
}
|
||||||
@@ -228,11 +172,11 @@ class Watcher extends EventEmitter
|
|||||||
// Set up
|
// Set up
|
||||||
const relativePath = _path.replace(process.cwd(), '.')
|
const relativePath = _path.replace(process.cwd(), '.')
|
||||||
|
|
||||||
// Send
|
// Trigger
|
||||||
this.socket.emit('create_folder', { path: relativePath })
|
this.trigger('create_folder', [{ path: relativePath }])
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if(this.options.debug)
|
if(this.config.debug)
|
||||||
{
|
{
|
||||||
console.log('addDir:'.green.bold, relativePath)
|
console.log('addDir:'.green.bold, relativePath)
|
||||||
}
|
}
|
||||||
@@ -244,11 +188,11 @@ class Watcher extends EventEmitter
|
|||||||
// Set up
|
// Set up
|
||||||
const relativePath = _path.replace(process.cwd(), '.')
|
const relativePath = _path.replace(process.cwd(), '.')
|
||||||
|
|
||||||
// Send
|
// Trigger
|
||||||
this.socket.emit('delete_folder', { path: relativePath })
|
this.trigger('delete_folder', [{ path: relativePath }])
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if(this.options.debug)
|
if(this.config.debug)
|
||||||
{
|
{
|
||||||
console.log('unlinkDir:'.green.bold, relativePath)
|
console.log('unlinkDir:'.green.bold, relativePath)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class EventEmitter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Resolve names
|
// Resolve names
|
||||||
const names = this.resolveNames(names)
|
const names = this.resolveNames(_names)
|
||||||
|
|
||||||
// Each name
|
// Each name
|
||||||
names.forEach(function(_name)
|
names.forEach(function(_name)
|
||||||
@@ -136,7 +136,7 @@ class EventEmitter
|
|||||||
let result = null
|
let result = null
|
||||||
|
|
||||||
// Default args
|
// Default args
|
||||||
const args = !(args instanceof Array) ? [] : _args
|
const args = !(_args instanceof Array) ? [] : _args
|
||||||
|
|
||||||
// Resolve names (should on have one event)
|
// Resolve names (should on have one event)
|
||||||
let name = this.resolveNames(_name)
|
let name = this.resolveNames(_name)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
dfsdf
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
wcwxcsfazeazes
|
||||||
|
sdfsdfoij
|
||||||
Reference in New Issue
Block a user