[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | const {sep} = require('path');
|
---|
| 4 | const {platform} = process;
|
---|
| 5 | const os = require('os');
|
---|
| 6 |
|
---|
| 7 | exports.EV_ALL = 'all';
|
---|
| 8 | exports.EV_READY = 'ready';
|
---|
| 9 | exports.EV_ADD = 'add';
|
---|
| 10 | exports.EV_CHANGE = 'change';
|
---|
| 11 | exports.EV_ADD_DIR = 'addDir';
|
---|
| 12 | exports.EV_UNLINK = 'unlink';
|
---|
| 13 | exports.EV_UNLINK_DIR = 'unlinkDir';
|
---|
| 14 | exports.EV_RAW = 'raw';
|
---|
| 15 | exports.EV_ERROR = 'error';
|
---|
| 16 |
|
---|
| 17 | exports.STR_DATA = 'data';
|
---|
| 18 | exports.STR_END = 'end';
|
---|
| 19 | exports.STR_CLOSE = 'close';
|
---|
| 20 |
|
---|
| 21 | exports.FSEVENT_CREATED = 'created';
|
---|
| 22 | exports.FSEVENT_MODIFIED = 'modified';
|
---|
| 23 | exports.FSEVENT_DELETED = 'deleted';
|
---|
| 24 | exports.FSEVENT_MOVED = 'moved';
|
---|
| 25 | exports.FSEVENT_CLONED = 'cloned';
|
---|
| 26 | exports.FSEVENT_UNKNOWN = 'unknown';
|
---|
| 27 | exports.FSEVENT_TYPE_FILE = 'file';
|
---|
| 28 | exports.FSEVENT_TYPE_DIRECTORY = 'directory';
|
---|
| 29 | exports.FSEVENT_TYPE_SYMLINK = 'symlink';
|
---|
| 30 |
|
---|
| 31 | exports.KEY_LISTENERS = 'listeners';
|
---|
| 32 | exports.KEY_ERR = 'errHandlers';
|
---|
| 33 | exports.KEY_RAW = 'rawEmitters';
|
---|
| 34 | exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW];
|
---|
| 35 |
|
---|
| 36 | exports.DOT_SLASH = `.${sep}`;
|
---|
| 37 |
|
---|
| 38 | exports.BACK_SLASH_RE = /\\/g;
|
---|
| 39 | exports.DOUBLE_SLASH_RE = /\/\//;
|
---|
| 40 | exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/;
|
---|
| 41 | exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
---|
| 42 | exports.REPLACER_RE = /^\.[/\\]/;
|
---|
| 43 |
|
---|
| 44 | exports.SLASH = '/';
|
---|
| 45 | exports.SLASH_SLASH = '//';
|
---|
| 46 | exports.BRACE_START = '{';
|
---|
| 47 | exports.BANG = '!';
|
---|
| 48 | exports.ONE_DOT = '.';
|
---|
| 49 | exports.TWO_DOTS = '..';
|
---|
| 50 | exports.STAR = '*';
|
---|
| 51 | exports.GLOBSTAR = '**';
|
---|
| 52 | exports.ROOT_GLOBSTAR = '/**/*';
|
---|
| 53 | exports.SLASH_GLOBSTAR = '/**';
|
---|
| 54 | exports.DIR_SUFFIX = 'Dir';
|
---|
| 55 | exports.ANYMATCH_OPTS = {dot: true};
|
---|
| 56 | exports.STRING_TYPE = 'string';
|
---|
| 57 | exports.FUNCTION_TYPE = 'function';
|
---|
| 58 | exports.EMPTY_STR = '';
|
---|
| 59 | exports.EMPTY_FN = () => {};
|
---|
| 60 | exports.IDENTITY_FN = val => val;
|
---|
| 61 |
|
---|
| 62 | exports.isWindows = platform === 'win32';
|
---|
| 63 | exports.isMacos = platform === 'darwin';
|
---|
| 64 | exports.isLinux = platform === 'linux';
|
---|
| 65 | exports.isIBMi = os.type() === 'OS400';
|
---|