filehound 2.0.0-beta.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/README.md +39 -11
  2. package/dist/arrays.d.ts +1 -0
  3. package/dist/arrays.js +4 -0
  4. package/dist/file.d.ts +108 -0
  5. package/dist/file.js +184 -0
  6. package/dist/filehound.d.ts +356 -0
  7. package/dist/filehound.js +498 -0
  8. package/dist/files.d.ts +4 -0
  9. package/dist/files.js +37 -0
  10. package/dist/filetype.d.ts +10 -0
  11. package/dist/filetype.js +9 -0
  12. package/dist/index.d.ts +5 -0
  13. package/dist/index.js +6 -0
  14. package/dist/matchers.d.ts +324 -0
  15. package/dist/matchers.js +419 -0
  16. package/dist/walker/async.d.ts +4 -0
  17. package/dist/walker/async.js +237 -0
  18. package/dist/walker/heap.d.ts +7 -0
  19. package/dist/walker/heap.js +49 -0
  20. package/dist/walker/sync.d.ts +4 -0
  21. package/dist/walker/sync.js +66 -0
  22. package/dist/walker/walk.d.ts +33 -0
  23. package/dist/walker/walk.js +80 -0
  24. package/package.json +45 -48
  25. package/.github/stale.yml +0 -42
  26. package/.travis.yml +0 -8
  27. package/.vscode/launch.json +0 -21
  28. package/.vscode/settings.json +0 -3
  29. package/CONTRIBUTING.md +0 -8
  30. package/_config.yml +0 -1
  31. package/coverage/coverage.raw.json +0 -1
  32. package/coverage/lcov-report/arrays.ts.html +0 -98
  33. package/coverage/lcov-report/base.css +0 -212
  34. package/coverage/lcov-report/filehound.ts.html +0 -2078
  35. package/coverage/lcov-report/files.ts.html +0 -260
  36. package/coverage/lcov-report/functions.ts.html +0 -122
  37. package/coverage/lcov-report/index.html +0 -132
  38. package/coverage/lcov-report/prettify.css +0 -1
  39. package/coverage/lcov-report/prettify.js +0 -1
  40. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  41. package/coverage/lcov-report/sorter.js +0 -158
  42. package/coverage/lcov.info +0 -378
  43. package/dist/src/arrays.js +0 -15
  44. package/dist/src/arrays.js.map +0 -1
  45. package/dist/src/asyncWalker.js +0 -59
  46. package/dist/src/asyncWalker.js.map +0 -1
  47. package/dist/src/bind.js +0 -15
  48. package/dist/src/bind.js.map +0 -1
  49. package/dist/src/filehound.js +0 -597
  50. package/dist/src/filehound.js.map +0 -1
  51. package/dist/src/files.js +0 -60
  52. package/dist/src/files.js.map +0 -1
  53. package/dist/src/matcher.js +0 -51
  54. package/dist/src/matcher.js.map +0 -1
  55. package/dist/src/syncWalker.js +0 -47
  56. package/dist/src/syncWalker.js.map +0 -1
  57. package/dist/src/walkAsync.js +0 -33
  58. package/dist/src/walkAsync.js.map +0 -1
  59. package/dist/src/walkSync.js +0 -21
  60. package/dist/src/walkSync.js.map +0 -1
  61. package/dist/src/walker/walk.js +0 -68
  62. package/dist/src/walker/walk.js.map +0 -1
  63. package/dist/src/walker/walkAsync.js +0 -33
  64. package/dist/src/walker/walkAsync.js.map +0 -1
  65. package/dist/src/walker/walkSync.js +0 -21
  66. package/dist/src/walker/walkSync.js.map +0 -1
  67. package/dist/test/filehound.js +0 -872
  68. package/dist/test/filehound.js.map +0 -1
  69. package/dist/test/files.js +0 -29
  70. package/dist/test/files.js.map +0 -1
  71. package/docconfig/jsdoc.json +0 -26
  72. package/docconfig/template/LICENSE +0 -61
  73. package/docconfig/template/README.md +0 -86
  74. package/docconfig/template/package.json +0 -22
  75. package/docconfig/template/publish.js +0 -676
  76. package/docconfig/template/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  77. package/docconfig/template/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
  78. package/docconfig/template/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  79. package/docconfig/template/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  80. package/docconfig/template/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  81. package/docconfig/template/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  82. package/docconfig/template/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  83. package/docconfig/template/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
  84. package/docconfig/template/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  85. package/docconfig/template/static/fonts/OpenSans-Light-webfont.eot +0 -0
  86. package/docconfig/template/static/fonts/OpenSans-Light-webfont.svg +0 -1831
  87. package/docconfig/template/static/fonts/OpenSans-Light-webfont.woff +0 -0
  88. package/docconfig/template/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  89. package/docconfig/template/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  90. package/docconfig/template/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  91. package/docconfig/template/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  92. package/docconfig/template/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
  93. package/docconfig/template/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  94. package/docconfig/template/static/fonts/OpenSans-Semibold-webfont.eot +0 -0
  95. package/docconfig/template/static/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  96. package/docconfig/template/static/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  97. package/docconfig/template/static/fonts/OpenSans-Semibold-webfont.woff +0 -0
  98. package/docconfig/template/static/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  99. package/docconfig/template/static/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  100. package/docconfig/template/static/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  101. package/docconfig/template/static/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  102. package/docconfig/template/static/scripts/linenumber.js +0 -25
  103. package/docconfig/template/static/scripts/prettify/Apache-License-2.0.txt +0 -202
  104. package/docconfig/template/static/scripts/prettify/lang-css.js +0 -2
  105. package/docconfig/template/static/scripts/prettify/prettify.js +0 -28
  106. package/docconfig/template/static/styles/jsdoc-default.css +0 -605
  107. package/docconfig/template/static/styles/prettify-jsdoc.css +0 -111
  108. package/docconfig/template/static/styles/prettify-tomorrow.css +0 -132
  109. package/docconfig/template/tmpl/augments.tmpl +0 -10
  110. package/docconfig/template/tmpl/container.tmpl +0 -183
  111. package/docconfig/template/tmpl/details.tmpl +0 -143
  112. package/docconfig/template/tmpl/example.tmpl +0 -2
  113. package/docconfig/template/tmpl/examples.tmpl +0 -13
  114. package/docconfig/template/tmpl/exceptions.tmpl +0 -32
  115. package/docconfig/template/tmpl/layout.tmpl +0 -47
  116. package/docconfig/template/tmpl/mainpage.tmpl +0 -10
  117. package/docconfig/template/tmpl/members.tmpl +0 -38
  118. package/docconfig/template/tmpl/method.tmpl +0 -105
  119. package/docconfig/template/tmpl/params.tmpl +0 -124
  120. package/docconfig/template/tmpl/properties.tmpl +0 -108
  121. package/docconfig/template/tmpl/returns.tmpl +0 -19
  122. package/docconfig/template/tmpl/source.tmpl +0 -8
  123. package/docconfig/template/tmpl/tutorial.tmpl +0 -19
  124. package/docconfig/template/tmpl/type.tmpl +0 -7
  125. package/docs/FileHound.html +0 -3079
  126. package/docs/FileHound_modified.html +0 -245
  127. package/docs/_config.yml +0 -1
  128. package/docs/filehound.js.html +0 -697
  129. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  130. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  131. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  132. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  133. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  134. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  135. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  136. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  137. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  138. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  139. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  140. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  141. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  142. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  143. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  144. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  145. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  146. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  147. package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
  148. package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  149. package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  150. package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
  151. package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  152. package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  153. package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  154. package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  155. package/docs/global.html +0 -288
  156. package/docs/index.html +0 -154
  157. package/docs/scripts/linenumber.js +0 -25
  158. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  159. package/docs/scripts/prettify/lang-css.js +0 -2
  160. package/docs/scripts/prettify/prettify.js +0 -28
  161. package/docs/styles/jsdoc-default.css +0 -605
  162. package/docs/styles/prettify-jsdoc.css +0 -111
  163. package/docs/styles/prettify-tomorrow.css +0 -132
  164. package/docs.md +0 -164
  165. package/index.js +0 -1
  166. package/issue_template.md +0 -6
  167. package/test/filehound.ts +0 -1076
  168. package/test/files.ts +0 -29
  169. package/test/fixtures/custom/failed.txt +0 -0
  170. package/test/fixtures/custom/passed.txt +0 -0
  171. package/test/fixtures/deeplyNested/c.json +0 -0
  172. package/test/fixtures/deeplyNested/d.json +0 -0
  173. package/test/fixtures/deeplyNested/mydir/e.json +0 -0
  174. package/test/fixtures/deeplyNested/mydir/mydir2/f.json +0 -0
  175. package/test/fixtures/deeplyNested/mydir/mydir2/mydir3/mydir4/failed.json +0 -0
  176. package/test/fixtures/deeplyNested/mydir/mydir2/mydir3/z.json +0 -0
  177. package/test/fixtures/deeplyNested/mydir/mydir2/y.json +0 -0
  178. package/test/fixtures/deeplyNestedWithHiddenDir/c.json +0 -0
  179. package/test/fixtures/deeplyNestedWithHiddenDir/d.json +0 -0
  180. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/e.json +0 -0
  181. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/mydir2/f.json +0 -0
  182. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/mydir2/mydir3/mydir4/.mydir5/.keep +0 -0
  183. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/mydir2/mydir3/mydir4/failed.json +0 -0
  184. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/mydir2/mydir3/z.json +0 -0
  185. package/test/fixtures/deeplyNestedWithHiddenDir/mydir/mydir2/y.json +0 -0
  186. package/test/fixtures/ext/Dummy.java +0 -0
  187. package/test/fixtures/ext/Dumpy.go +0 -0
  188. package/test/fixtures/ext/dummy.json +0 -0
  189. package/test/fixtures/ext/dummy.txt +0 -0
  190. package/test/fixtures/justFiles/a.json +0 -0
  191. package/test/fixtures/justFiles/b.json +0 -0
  192. package/test/fixtures/justFiles/dummy.txt +0 -0
  193. package/test/fixtures/mixed/a.json +0 -0
  194. package/test/fixtures/mixed/aabbcc.json +0 -0
  195. package/test/fixtures/mixed/ab.json +0 -0
  196. package/test/fixtures/mixed/z.json +0 -0
  197. package/test/fixtures/nested/.hidden1/bad.txt +0 -0
  198. package/test/fixtures/nested/c.json +0 -0
  199. package/test/fixtures/nested/d.json +0 -0
  200. package/test/fixtures/nested/mydir/e.json +0 -0
  201. package/test/fixtures/sizes/10b.txt +0 -0
  202. package/test/fixtures/sizes/1b.txt +0 -0
  203. package/test/fixtures/sizes/1k.txt +0 -0
  204. package/test/fixtures/sizes/2k.txt +0 -0
  205. package/test/fixtures/visibility/.hidden/.hidden.json +0 -0
  206. package/test/fixtures/visibility/.hidden/visible.json +0 -3
  207. package/test/fixtures/visibility/.hidden.json +0 -3
  208. package/test/fixtures/visibility/visible/.hidden.json +0 -3
  209. package/test/fixtures/visibility/visible.json +0 -3
  210. package/test/mocha.opts +0 -4
  211. package/tsconfig.json +0 -16
  212. package/tslint.json +0 -44
@@ -1,597 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const _ = require("lodash");
12
- const path = require("path");
13
- const files_1 = require("./files");
14
- const arrays_1 = require("./arrays");
15
- const unit_compare_1 = require("unit-compare");
16
- const events_1 = require("events");
17
- const matcher_1 = require("./matcher");
18
- const walker = require("./walker/walk");
19
- const bind_1 = require("./bind");
20
- function isDefined(value) {
21
- return value !== undefined;
22
- }
23
- function flatten(a, b) {
24
- return a.concat(b);
25
- }
26
- function cleanExtension(ext) {
27
- if (_.startsWith(ext, '.')) {
28
- return ext.slice(1);
29
- }
30
- return ext;
31
- }
32
- /** @class */
33
- class FileHound extends events_1.EventEmitter {
34
- constructor() {
35
- super();
36
- this.matcher = new matcher_1.Matcher();
37
- this.searchPaths = [];
38
- this.searchPaths.push(process.cwd());
39
- this.ignoreDirs = false;
40
- this.directoriesOnly = false;
41
- bind_1.default(this);
42
- }
43
- // tslint:disable-next-line:valid-jsdoc
44
- /**
45
- * Static factory method to create an instance of FileHound
46
- *
47
- * @static
48
- * @memberOf FileHound
49
- * @method
50
- * create
51
- * @example
52
- * @return FileHound instance
53
- * import FileHound from 'filehound';
54
- *
55
- * const filehound = FileHound.create();
56
- */
57
- static create() {
58
- return new FileHound();
59
- }
60
- // tslint:disable-next-line:valid-jsdoc
61
- /**
62
- * Returns all matches from one of more FileHound instances
63
- *
64
- * @static
65
- * @memberOf FileHound
66
- * @method
67
- * any
68
- * @return a promise containing all matches. If the Promise fulfils,
69
- * the fulfilment value is an array of all matching files.
70
- * @example
71
- * import FileHound from 'filehound';
72
- *
73
- * const filehound = FileHound.any(fh1, fh2);
74
- */
75
- static any(...args) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- const pending = args.map(fh => fh.find());
78
- const files = yield Promise.all(pending);
79
- return files.reduce(flatten, []);
80
- });
81
- }
82
- // tslint:disable-next-line:valid-jsdoc
83
- /**
84
- * Filters by modifiction time
85
- *
86
- * @memberOf FileHound
87
- * @method
88
- * modified
89
- * @param {string} dateExpression - date expression
90
- * @return a FileHound instance
91
- * @example
92
- * import FileHound from 'filehound';
93
- *
94
- * const filehound = FileHound.create();
95
- * filehound
96
- * .modified("< 2 days")
97
- * .find()
98
- * .each(console.log);
99
- */
100
- modified(pattern) {
101
- return this.addFilter((file) => {
102
- const modified = file.lastModifiedSync();
103
- return unit_compare_1.isDate(modified)
104
- .assert(pattern);
105
- });
106
- }
107
- // tslint:disable-next-line:valid-jsdoc
108
- /**
109
- * Filters by file access time
110
- *
111
- * @memberOf FileHound
112
- * @method
113
- * accessed
114
- * @param {string} dateExpression - date expression
115
- * @return a FileHound instance
116
- * @example
117
- * import FileHound from 'filehound';
118
- *
119
- * const filehound = FileHound.create();
120
- * filehound
121
- * .accessed("< 10 minutes")
122
- * .find()
123
- * .each(console.log);
124
- */
125
- accessed(pattern) {
126
- return this.addFilter((file) => {
127
- const accessed = file.lastAccessedSync();
128
- return unit_compare_1.isDate(accessed)
129
- .assert(pattern);
130
- });
131
- }
132
- // tslint:disable-next-line:valid-jsdoc
133
- /**
134
- * Filters change time
135
- *
136
- * @memberOf FileHound
137
- * @instance
138
- * @method
139
- * changed
140
- * @param {string} dateExpression - date expression
141
- * @return a FileHound instance
142
- * @example
143
- * import FileHound from 'filehound';
144
- *
145
- * const filehound = FileHound.create();
146
- * filehound
147
- * .changed("< 10 minutes")
148
- * .find()
149
- * .each(console.log);
150
- */
151
- changed(pattern) {
152
- return this.addFilter((file) => {
153
- const changed = file.lastChangedSync();
154
- return unit_compare_1.isDate(changed)
155
- .assert(pattern);
156
- });
157
- }
158
- // tslint:disable-next-line:valid-jsdoc
159
- /**
160
- *
161
- * @memberOf FileHound
162
- * @instance
163
- * @method
164
- * addFilter
165
- * @param {function} function - custom filter function
166
- * @return a FileHound instance
167
- * @example
168
- * import FileHound from 'filehound';
169
- *
170
- * const filehound = FileHound.create();
171
- * filehound
172
- * .addFilter(customFilter)
173
- * .find()
174
- * .each(consoe.log);
175
- */
176
- addFilter(filter) {
177
- this.matcher.on(filter);
178
- return this;
179
- }
180
- // tslint:disable-next-line:valid-jsdoc
181
- /**
182
- * Defines the search paths
183
- *
184
- * @memberOf FileHound
185
- * @instance
186
- * @method
187
- * paths
188
- * @param {array} path - array of paths
189
- * @return a FileHound instance
190
- * @example
191
- * import FileHound from 'filehound';
192
- *
193
- * const filehound = FileHound.create();
194
- * filehound
195
- * .paths("/tmp", "/etc") // or ["/tmp", "/etc"]
196
- * .find()
197
- * .each(console.log);
198
- */
199
- paths(...args) {
200
- this.searchPaths = _.uniq(arrays_1.from(args))
201
- .map(path.normalize);
202
- return this;
203
- }
204
- // tslint:disable-next-line:valid-jsdoc
205
- /**
206
- * Define the search path
207
- *
208
- * @memberOf FileHound
209
- * @instance
210
- * @method
211
- * path
212
- * @param {string} path - path
213
- * @return a FileHound instance
214
- * @example
215
- * import FileHound from 'filehound';
216
- *
217
- * const filehound = FileHound.create();
218
- * filehound
219
- * .path("/tmp")
220
- * .find()
221
- * .each(console.log);
222
- */
223
- path(path) {
224
- return this.paths(path);
225
- }
226
- // tslint:disable-next-line:valid-jsdoc
227
- /**
228
- * Ignores files or sub-directories matching pattern
229
- *
230
- * @memberOf FileHound
231
- * @instance
232
- * @method
233
- * discard
234
- * @param {string|array} regex - regex or array of regex
235
- * @return a FileHound instance
236
- * @example
237
- * import FileHound from 'filehound';
238
- *
239
- * const filehound = FileHound.create();
240
- * filehound
241
- * .discard("*.tmp*")
242
- * .find()
243
- * .each(console.log);
244
- */
245
- discard(...args) {
246
- const patterns = arrays_1.from(args);
247
- patterns.forEach((pattern) => {
248
- this.addFilter(matcher_1.Matcher.negate(matcher_1.Matcher.isMatch(pattern)));
249
- });
250
- return this;
251
- }
252
- // tslint:disable-next-line:valid-jsdoc
253
- /**
254
- * Filter on file extension
255
- *
256
- * @memberOf FileHound
257
- * @instance
258
- * @method
259
- * ext
260
- * @param {string|array} extensions - extension or an array of extensions
261
- * @return a FileHound instance
262
- * @example
263
- * import FileHound from 'filehound';
264
- *
265
- * let filehound = FileHound.create();
266
- * filehound
267
- * .ext(".json")
268
- * .find()
269
- * .each(console.log);
270
- *
271
- * // array of extensions to filter by
272
- * filehound = FileHound.create();
273
- * filehound
274
- * .ext([".json", ".txt"])
275
- * .find()
276
- * .each(console.log);
277
- *
278
- * // supports var args
279
- * filehound = FileHound.create();
280
- * filehound
281
- * .ext(".json", ".txt")
282
- * .find()
283
- * .each(console.log);
284
- */
285
- ext(...args) {
286
- const extensions = arrays_1.from(args)
287
- .map(cleanExtension);
288
- return this.addFilter(file => _.includes(extensions, file.getPathExtension()));
289
- }
290
- // tslint:disable-next-line:valid-jsdoc
291
- /**
292
- * Filter by file size
293
- *
294
- * @memberOf FileHound
295
- * @instance
296
- * @method
297
- * size
298
- * @param {string} sizeExpression - a size expression
299
- * @return a FileHound instance
300
- * @example
301
- * import FileHound from 'filehound';
302
- *
303
- * const filehound = FileHound.create();
304
- * filehound
305
- * .size("<10kb")
306
- * .find()
307
- * .each(console.log);
308
- */
309
- size(sizeExpression) {
310
- return this.addFilter((file) => {
311
- const size = file.sizeSync();
312
- return unit_compare_1.isNumber(size)
313
- .assert(sizeExpression);
314
- });
315
- }
316
- // tslint:disable-next-line:valid-jsdoc
317
- /**
318
- * Filter by zero length files
319
- *
320
- * @memberOf FileHound
321
- * @instance
322
- * @method
323
- * isEmpty
324
- * @param {string} path - path
325
- * @return a FileHound instance
326
- * @example
327
- * import FileHound from 'filehound';
328
- *
329
- * const filehound = FileHound.create();
330
- * filehound
331
- * .size("<10kb")
332
- * .find()
333
- * .each(console.log);
334
- */
335
- isEmpty() {
336
- return this.size(0);
337
- }
338
- // tslint:disable-next-line:valid-jsdoc
339
- /**
340
- * Filter by a file glob
341
- *
342
- * @memberOf FileHound
343
- * @instance
344
- * @method
345
- * glob
346
- * @param {string} glob - file glob
347
- * @return a FileHound instance
348
- * @example
349
- * import FileHound from 'filehound';
350
- *
351
- * const filehound = FileHound.create();
352
- * filehound
353
- * .glob("*tmp*")
354
- * .find()
355
- * .each(console.log); // array of files names all containing 'tmp'
356
- */
357
- glob(globPattern) {
358
- return this.match(globPattern);
359
- }
360
- // tslint:disable-next-line:valid-jsdoc
361
- /**
362
- * Same as glob
363
- * @see glob
364
- */
365
- match(globPattern) {
366
- return this.addFilter(file => file.isMatch(globPattern));
367
- }
368
- // tslint:disable-next-line:valid-jsdoc
369
- /**
370
- * Negates filters
371
- *
372
- * @memberOf FileHound
373
- * @instance
374
- * @method
375
- * not
376
- * @param {string} glob - file glob
377
- * @return a FileHound instance
378
- * @example
379
- * import FileHound from 'filehound';
380
- *
381
- * const filehound = FileHound.create();
382
- * filehound
383
- * .not()
384
- * .glob("*tmp*")
385
- * .find()
386
- * .each(console.log); // array of files names NOT containing 'tmp'
387
- */
388
- not() {
389
- this.matcher.negateAll();
390
- return this;
391
- }
392
- // tslint:disable-next-line:valid-jsdoc
393
- /**
394
- * Filter to ignore hidden files
395
- *
396
- * @memberOf FileHound
397
- * @instance
398
- * @method
399
- * ignoreHiddenFiles
400
- * @return a FileHound instance
401
- * @example
402
- * import FileHound from 'filehound';
403
- *
404
- * const filehound = FileHound.create();
405
- * filehound
406
- * .ignoreHiddenFiles()
407
- * .find()
408
- * .each(console.log); // array of files names that are not hidden files
409
- */
410
- ignoreHiddenFiles() {
411
- return this.addFilter(file => !file.isHiddenSync());
412
- }
413
- // tslint:disable-next-line:valid-jsdoc
414
- /**
415
- * Ignore hidden directories
416
- *
417
- * @memberOf FileHound
418
- * @instance
419
- * @method
420
- * ignoreHiddenDirectories
421
- * @return a FileHound instance
422
- * @example
423
- * import FileHound from 'filehound';
424
- *
425
- * const filehound = FileHound.create();
426
- * filehound
427
- * .ignoreHiddenDirectories()
428
- * .find()
429
- * .each(console.log); // array of files names that are not hidden directories
430
- */
431
- ignoreHiddenDirectories() {
432
- this.ignoreDirs = true;
433
- return this;
434
- }
435
- // tslint:disable-next-line:valid-jsdoc
436
- /**
437
- * Find sub-directories
438
- *
439
- * @memberOf FileHound
440
- * @instance
441
- * @method
442
- * directory
443
- * @return a FileHound instance
444
- * @example
445
- * import FileHound from 'filehound';
446
- *
447
- * const filehound = FileHound.create();
448
- * filehound
449
- * .directory()
450
- * .find()
451
- * .each(console.log); // array of matching sub-directories
452
- */
453
- directory() {
454
- this.directoriesOnly = true;
455
- return this;
456
- }
457
- // tslint:disable-next-line:valid-jsdoc
458
- /**
459
- * Find sockets
460
- *
461
- * @memberOf FileHound
462
- * @instance
463
- * @method
464
- * socket
465
- * @return a FileHound instance
466
- * @example
467
- * import FileHound from 'filehound';
468
- *
469
- * const filehound = FileHound.create();
470
- * filehound
471
- * .socket()
472
- * .find()
473
- * .each(console.log); // array of matching sockets
474
- */
475
- socket() {
476
- return this.addFilter(file => file.isSocket());
477
- }
478
- // tslint:disable-next-line:valid-jsdoc
479
- /**
480
- * Specify the directory search depth. If set to zero, recursive searching
481
- * will be disabled
482
- *
483
- * @memberOf FileHound
484
- * @instance
485
- * @method
486
- * depth
487
- * @return a FileHound instance
488
- * @example
489
- * import FileHound from 'filehound';
490
- *
491
- * const filehound = FileHound.create();
492
- * filehound
493
- * .depth(0)
494
- * .find()
495
- * .each(console.log); // array of files names only in the current directory
496
- */
497
- depth(depth) {
498
- this.maxDepth = depth;
499
- return this;
500
- }
501
- // tslint:disable-next-line:valid-jsdoc
502
- /**
503
- * Asynchronously executes a file search.
504
- *
505
- * @memberOf FileHound
506
- * @instance
507
- * @method
508
- * find
509
- * @param {function} function - Optionally accepts a callback function
510
- * @return Returns a Promise of all matches. If the Promise fulfils,
511
- * the fulfilment value is an array of all matching files
512
- * @example
513
- * import FileHound from 'filehound';
514
- *
515
- * const filehound = FileHound.create();
516
- * filehound
517
- * .find()
518
- * .each(console.log);
519
- *
520
- * // using a callback
521
- * filehound
522
- * .find((err, files) => {
523
- * if (err) return console.error(err);
524
- *
525
- * console.log(files);
526
- * });
527
- */
528
- find() {
529
- return __awaiter(this, void 0, void 0, function* () {
530
- const paths = this.getSearchPaths();
531
- const searches = [];
532
- for (const path of paths) {
533
- searches.push(this.searchAsync(path));
534
- }
535
- try {
536
- const results = yield Promise.all(searches);
537
- return results
538
- .reduce(flatten)
539
- .map((file) => {
540
- this.emit('match', file);
541
- return file;
542
- });
543
- }
544
- catch (e) {
545
- this.emit('error', e);
546
- }
547
- finally {
548
- this.emit('end');
549
- }
550
- });
551
- }
552
- // tslint:disable-next-line:valid-jsdoc
553
- /**
554
- * Synchronously executes a file search.
555
- *
556
- * @memberOf FileHound
557
- * @instance
558
- * @method
559
- * findSync
560
- * @return Returns an array of all matching files
561
- * @example
562
- * import FileHound from 'filehound';
563
- *
564
- * const filehound = FileHound.create();
565
- * const files = filehound.findSync();
566
- * console.log(files);
567
- *
568
- */
569
- findSync() {
570
- return this.getSearchPaths()
571
- .map(this.searchSync)
572
- .reduce(flatten);
573
- }
574
- getSearchPaths() {
575
- const paths = isDefined(this.maxDepth)
576
- ? this.searchPaths
577
- : files_1.reducePaths(this.searchPaths);
578
- return arrays_1.copy(paths);
579
- }
580
- createSearchOpts() {
581
- return {
582
- ignoreDirs: this.ignoreDirs,
583
- maxDepth: this.maxDepth,
584
- directoriesOnly: this.directoriesOnly
585
- };
586
- }
587
- searchSync(dir) {
588
- return walker.sync(dir, this.matcher.create(), this.createSearchOpts());
589
- }
590
- searchAsync(dir) {
591
- return __awaiter(this, void 0, void 0, function* () {
592
- return yield walker.async(dir, this.matcher.create(), this.createSearchOpts());
593
- });
594
- }
595
- }
596
- exports.default = FileHound;
597
- //# sourceMappingURL=filehound.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filehound.js","sourceRoot":"","sources":["../../src/filehound.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,4BAA4B;AAC5B,6BAA6B;AAG7B,mCAAsC;AACtC,qCAAsC;AACtC,+CAAgD;AAChD,mCAAsC;AACtC,uCAAoC;AACpC,wCAAwC;AAExC,iCAA0B;AAE1B,mBAAmB,KAAU;IAC3B,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC;AAED,iBAAiB,CAAS,EAAE,CAAS;IACnC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC;AAED,wBAAwB,GAAW;IACjC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;QAC1B,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACrB;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,aAAa;AACb,eAAgB,SAAQ,qBAAY;IAOlC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,cAAI,CAAC,IAAI,CAAC,CAAC;IACb,CAAC;IAED,uCAAuC;IACvC;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,MAAM;QAClB,OAAO,IAAI,SAAS,EAAE,C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AC,cAAc,EAAE;aACzB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAEM,cAAc;QACnB,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;YACpC,CAAC,CAAC,IAAI,CAAC,WAAW;YAClB,CAAC,CAAC,mBAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAElC,OAAO,aAAI,CAAW,KAAK,CAAC,CAAC;IAC/B,CAAC;IAEO,gBAAgB;QACtB,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,GAAW;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC1E,CAAC;IAEa,WAAW,CAAC,GAAW;;YACnC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACjF,CAAC;KAAA;CACF;AAED,kBAAe,SAAS,CAAC"}
package/dist/src/files.js DELETED
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _ = require("lodash");
4
- const path = require("path");
5
- const os = require("os");
6
- function flatten(a, b) {
7
- return a.concat(b);
8
- }
9
- function hasParent(parent) {
10
- const root = getRoot(parent);
11
- return parent && (parent !== root && parent !== '.');
12
- }
13
- function getParent(dir) {
14
- return path.dirname(dir);
15
- }
16
- function getRoot(dir) {
17
- return os.platform() === 'win32'
18
- ? dir.split(path.sep)[0] + path.sep
19
- : path.sep;
20
- }
21
- exports.getRoot = getRoot;
22
- function getSubDirectories(base, allPaths) {
23
- return allPaths.filter((candidate) => {
24
- return base !== candidate && isSubDirectory(base, candidate);
25
- });
26
- }
27
- function findSubDirectories(paths) {
28
- return paths
29
- .map((path) => {
30
- return getSubDirectories(path, paths);
31
- })
32
- .reduce(flatten, []);
33
- }
34
- exports.findSubDirectories = findSubDirectories;
35
- function notSubDirectory(subDirs) {
36
- return (path) => {
37
- return !_.includes(subDirs, path);
38
- };
39
- }
40
- exports.notSubDirectory = notSubDirectory;
41
- function isSubDirectory(base, candidate) {
42
- let parent = candidate;
43
- while (hasParent(parent)) {
44
- if (base === parent) {
45
- return true;
46
- }
47
- parent = getParent(parent);
48
- }
49
- return false;
50
- }
51
- exports.isSubDirectory = isSubDirectory;
52
- function reducePaths(searchPaths) {
53
- if (searchPaths.length === 1) {
54
- return searchPaths;
55
- }
56
- const subDirs = findSubDirectories(searchPaths.sort());
57
- return searchPaths.filter(notSubDirectory(subDirs));
58
- }
59
- exports.reducePaths = reducePaths;
60
- //# sourceMappingURL=files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":";;AAAA,4BAA4B;AAC5B,6BAA6B;AAC7B,yBAAyB;AAEzB,iBAAiB,CAAC,EAAE,CAAC;IACnB,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC;AAED,mBAAmB,MAAc;IAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,MAAM,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC;AACvD,CAAC;AAED,mBAAmB,GAAW;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,iBAAwB,GAAW;IACjC,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO;QAC9B,CAAC,CAAC,GAAG,CAA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