source: trip-planner-front/node_modules/fast-glob/out/providers/transformers/entry.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 845 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const utils = require("../../utils");
4class EntryTransformer {
5 constructor(_settings) {
6 this._settings = _settings;
7 }
8 getTransformer() {
9 return (entry) => this._transform(entry);
10 }
11 _transform(entry) {
12 let filepath = entry.path;
13 if (this._settings.absolute) {
14 filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
15 filepath = utils.path.unixify(filepath);
16 }
17 if (this._settings.markDirectories && entry.dirent.isDirectory()) {
18 filepath += '/';
19 }
20 if (!this._settings.objectMode) {
21 return filepath;
22 }
23 return Object.assign(Object.assign({}, entry), { path: filepath });
24 }
25}
26exports.default = EntryTransformer;
Note: See TracBrowser for help on using the repository browser.