mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-13 22:15:25 +00:00
update
This commit is contained in:
59
node_modules/browser-sync/dist/public/public-utils.js
generated
vendored
Normal file
59
node_modules/browser-sync/dist/public/public-utils.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
var _ = require("../lodash.custom");
|
||||
module.exports = {
|
||||
/**
|
||||
* Emit the internal `file:change` event
|
||||
* @param {EventEmitter} emitter
|
||||
* @param {string} path
|
||||
* @param {boolean} [log]
|
||||
*/
|
||||
emitChangeEvent: function emitChangeEvent(emitter, path, log) {
|
||||
emitter.emit("file:changed", {
|
||||
path: path,
|
||||
log: log,
|
||||
namespace: "core",
|
||||
event: "change"
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Emit the internal `browser:reload` event
|
||||
* @param {EventEmitter} emitter
|
||||
*/
|
||||
emitBrowserReload: function emitChangeEvent(emitter) {
|
||||
emitter.emit("_browser:reload");
|
||||
},
|
||||
/**
|
||||
* Emit the internal `stream:changed` event
|
||||
* @param {EventEmitter} emitter
|
||||
* @param {Array} changed
|
||||
*/
|
||||
emitStreamChangedEvent: function (emitter, changed) {
|
||||
emitter.emit("stream:changed", { changed: changed });
|
||||
},
|
||||
/**
|
||||
* This code handles the switch between .reload & .stream
|
||||
* since 2.6.0
|
||||
* @param name
|
||||
* @param args
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isStreamArg: function (name, args) {
|
||||
if (name === "stream") {
|
||||
return true;
|
||||
}
|
||||
if (name !== "reload") {
|
||||
return false;
|
||||
}
|
||||
var firstArg = args[0];
|
||||
/**
|
||||
* If here, it's reload with args
|
||||
*/
|
||||
if (_.isObject(firstArg)) {
|
||||
if (!Array.isArray(firstArg) && Object.keys(firstArg).length) {
|
||||
return firstArg.stream === true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=public-utils.js.map
|
Reference in New Issue
Block a user