@visulima/fs 4.1.0 → 5.0.0-alpha.10

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 (156) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE.md +157 -128
  3. package/README.md +32 -14
  4. package/dist/eol.d.ts +6 -35
  5. package/dist/error.d.ts +43 -7
  6. package/dist/error.js +1 -1
  7. package/dist/glob-parent.d.ts +5 -0
  8. package/dist/glob-parent.js +90 -0
  9. package/dist/glob.d.ts +5 -0
  10. package/dist/glob.js +2 -0
  11. package/dist/index.d.ts +81 -36
  12. package/dist/index.js +37 -32
  13. package/dist/ini.d.ts +10 -0
  14. package/dist/ini.js +4 -0
  15. package/dist/is-glob.d.ts +5 -0
  16. package/dist/is-glob.js +9 -0
  17. package/dist/json5.d.ts +12 -0
  18. package/dist/json5.js +4 -0
  19. package/dist/jsonc.d.ts +10 -0
  20. package/dist/jsonc.js +4 -0
  21. package/dist/match.d.ts +5 -0
  22. package/dist/match.js +15 -0
  23. package/dist/packem_shared/{F_OK-BalxCn9n.js → F_OK-MldBaGxb.js} +1 -1
  24. package/dist/packem_shared/{WalkError-DUdQd6FT.js → WalkError-DER5A43G.js} +1 -1
  25. package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +5 -0
  26. package/dist/packem_shared/build-rm-options-Cl3VDY4O.js +12 -0
  27. package/dist/packem_shared/{collect-DcBwsYYd.js → collect-CqQ3eVab.js} +1 -1
  28. package/dist/packem_shared/{collectSync-Bkjf9Dbm.js → collectSync-noE08NNv.js} +1 -1
  29. package/dist/packem_shared/{emptyDir-CYB5Tict.js → emptyDir-DnwENOaV.js} +5 -2
  30. package/dist/packem_shared/{emptyDirSync-BD8-1Ytl.js → emptyDirSync-6WiHBo8a.js} +3 -1
  31. package/dist/packem_shared/{ensureDir-C_kuQ5Ik.js → ensureDir-DNlPftys.js} +2 -2
  32. package/dist/packem_shared/{ensureDirSync-CI5g-uBI.js → ensureDirSync-DcPZFMy5.js} +2 -2
  33. package/dist/packem_shared/{ensureFile-BUtXGlGT.js → ensureFile-BRQpUOUM.js} +2 -2
  34. package/dist/packem_shared/{ensureFileSync-C8hASR-1.js → ensureFileSync-SBY7A9-C.js} +2 -2
  35. package/dist/packem_shared/{ensureLink-BPnAG5-P.js → ensureLink-DJQeauEn.js} +4 -3
  36. package/dist/packem_shared/{ensureLinkSync-B-Z7X0ub.js → ensureLinkSync-D9RVAglV.js} +4 -3
  37. package/dist/packem_shared/{ensureSymlink-U5B6J0BN.js → ensureSymlink-CoRYDRwr.js} +10 -3
  38. package/dist/packem_shared/{ensureSymlinkSync-DHnZj-9F.js → ensureSymlinkSync-CFimFlgh.js} +10 -3
  39. package/dist/packem_shared/{findUp-Lv9mZCIQ.js → findUp-YcNLKdfV.js} +4 -5
  40. package/dist/packem_shared/{findUpSync-BsK4Nrrq.js → findUpSync-BfA5fheN.js} +2 -4
  41. package/dist/packem_shared/glob-DY8l7izD.js +5 -0
  42. package/dist/packem_shared/glob-sync.d-CYiamQIr.d.ts +4 -0
  43. package/dist/packem_shared/globSync-5P2KJf_g.js +5 -0
  44. package/dist/packem_shared/index-C8W8sfzP.js +830 -0
  45. package/dist/packem_shared/index-bhgnhm4u.js +167 -0
  46. package/dist/packem_shared/index-xe4o3cYi.js +1784 -0
  47. package/dist/packem_shared/{parseJson-C8xb-3LR.js → indexToLineColumn-BUb0GPKl-BF770uX7.js} +8 -68
  48. package/dist/packem_shared/ini-preserve-Dq_Q_Jgb.js +251 -0
  49. package/dist/packem_shared/{isAccessible-iOp0Bou6.js → isAccessible-DuVrTNFV.js} +1 -1
  50. package/dist/packem_shared/{isAccessibleSync-38BmiIcx.js → isAccessibleSync-DI8mM0fA.js} +1 -1
  51. package/dist/packem_shared/{isFsCaseSensitive-D-ayleCy.js → isFsCaseSensitive-DunL7Iry.js} +6 -6
  52. package/dist/packem_shared/json-error.d-DgKaeuIf.d.ts +10 -0
  53. package/dist/packem_shared/jsonc-merge-C6jWcfWh.js +72 -0
  54. package/dist/packem_shared/{move-BD6JbYSu.js → move-DbpW5_vA.js} +2 -2
  55. package/dist/packem_shared/parseJson-BIp89Xjo.js +63 -0
  56. package/dist/packem_shared/{readFile-BcK0rkht.js → readFile-Iz7kvCCk.js} +2 -2
  57. package/dist/packem_shared/{readFileSync-BDgEnnqT.js → readFileSync-gm9yfIhh.js} +4 -3
  58. package/dist/packem_shared/readIni-CJ2xfpjB.js +10 -0
  59. package/dist/packem_shared/readIniSync-9LUjaSSp.js +10 -0
  60. package/dist/packem_shared/{readJson-ac6N9-5G.js → readJson-C_rwm-wq.js} +2 -2
  61. package/dist/packem_shared/readJson5-mBoTZppy.js +15 -0
  62. package/dist/packem_shared/readJson5Sync-8WS2yUok.js +15 -0
  63. package/dist/packem_shared/{readJsonSync-BTlwqLNV.js → readJsonSync-BMEmCcJ6.js} +2 -2
  64. package/dist/packem_shared/readJsonc-j-OS-APg.js +28 -0
  65. package/dist/packem_shared/readJsoncSync-Aw6EMlWO.js +16 -0
  66. package/dist/packem_shared/readToml-B2MHaSes.js +9 -0
  67. package/dist/packem_shared/readTomlSync-DNbK8NEb.js +9 -0
  68. package/dist/packem_shared/{readYaml-Cj6HxRoa.js → readYaml-D5q2a0e1.js} +1 -1
  69. package/dist/packem_shared/{readYamlSync-D3_iAKVv.js → readYamlSync-BKX-PAfq.js} +1 -1
  70. package/dist/packem_shared/{remove-_oDY3uKo.js → remove-C8_gl3jF.js} +2 -1
  71. package/dist/packem_shared/{removeSync-DETRj7Qn.js → removeSync-BJR_wTwN.js} +2 -1
  72. package/dist/packem_shared/{sanitize-lOzE6k2A.js → sanitize-BZoLN9Fg.js} +3 -3
  73. package/dist/packem_shared/{stripJsonComments-21XWVDwP.js → stripJsonComments-vo4k0mpF.js} +1 -1
  74. package/dist/packem_shared/types.d-BrSrwTmO.d.ts +145 -0
  75. package/dist/packem_shared/{walk-BhTbpr3y.js → walk-CSZgCuDx.js} +19 -10
  76. package/dist/packem_shared/{walkSync-DDBq95s8.js → walkSync-C4Cy28xb.js} +25 -16
  77. package/dist/packem_shared/{writeFile-NT1fLEEe.js → writeFile-B8HX0JIQ.js} +3 -5
  78. package/dist/packem_shared/{writeFileSync-Bj5UDSf0.js → writeFileSync-DB8vv8xR.js} +3 -5
  79. package/dist/packem_shared/writeIni-i55QrL8y.js +65 -0
  80. package/dist/packem_shared/writeIniSync-CLqJE5t3.js +64 -0
  81. package/dist/packem_shared/{writeJson-DQLdAi0d.js → writeJson-Bo7C2UHw.js} +3 -3
  82. package/dist/packem_shared/writeJson5-vVmHUQOd.js +53 -0
  83. package/dist/packem_shared/writeJson5Sync-oJ546h5k.js +53 -0
  84. package/dist/packem_shared/{writeJsonSync-DvTCjVUi.js → writeJsonSync-BKZ_9Acr.js} +3 -3
  85. package/dist/packem_shared/writeJsonc-BufH_oC5.js +60 -0
  86. package/dist/packem_shared/writeJsoncSync-DB9be1YL.js +59 -0
  87. package/dist/packem_shared/writeToml-DgTW_-7F.js +8 -0
  88. package/dist/packem_shared/writeTomlSync-DiBiE9ja.js +8 -0
  89. package/dist/packem_shared/{writeYaml-BMY0kOPf.js → writeYaml-BWCOome-.js} +3 -3
  90. package/dist/packem_shared/{writeYamlSync-DqPu8cCd.js → writeYamlSync-DBVnXmuY.js} +3 -3
  91. package/dist/size.d.ts +10 -254
  92. package/dist/size.js +6 -4
  93. package/dist/toml.d.ts +9 -0
  94. package/dist/toml.js +4 -0
  95. package/dist/utils.d.ts +15 -6
  96. package/dist/utils.js +2 -2
  97. package/dist/yaml.d.ts +14 -5
  98. package/dist/yaml.js +4 -4
  99. package/package.json +61 -7
  100. package/dist/constants.d.ts +0 -42
  101. package/dist/ensure/ensure-dir-sync.d.ts +0 -14
  102. package/dist/ensure/ensure-dir.d.ts +0 -14
  103. package/dist/ensure/ensure-file-sync.d.ts +0 -15
  104. package/dist/ensure/ensure-file.d.ts +0 -27
  105. package/dist/ensure/ensure-link-sync.d.ts +0 -16
  106. package/dist/ensure/ensure-link.d.ts +0 -16
  107. package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
  108. package/dist/ensure/ensure-symlink.d.ts +0 -23
  109. package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
  110. package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
  111. package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
  112. package/dist/error/already-exists-error.d.ts +0 -39
  113. package/dist/error/directory-error.d.ts +0 -47
  114. package/dist/error/json-error.d.ts +0 -52
  115. package/dist/error/not-empty-error.d.ts +0 -51
  116. package/dist/error/not-found-error.d.ts +0 -44
  117. package/dist/error/permission-error.d.ts +0 -45
  118. package/dist/error/walk-error.d.ts +0 -51
  119. package/dist/find/collect-sync.d.ts +0 -31
  120. package/dist/find/collect.d.ts +0 -35
  121. package/dist/find/find-up-sync.d.ts +0 -42
  122. package/dist/find/find-up.d.ts +0 -46
  123. package/dist/find/utils/glob-to-regexp.d.ts +0 -2
  124. package/dist/find/utils/walk-include.d.ts +0 -2
  125. package/dist/find/walk-sync.d.ts +0 -34
  126. package/dist/find/walk.d.ts +0 -37
  127. package/dist/is-accessible-sync.d.ts +0 -3
  128. package/dist/is-accessible.d.ts +0 -29
  129. package/dist/move/index.d.ts +0 -68
  130. package/dist/move/types.d.ts +0 -36
  131. package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
  132. package/dist/move/utils/internal-move-file.d.ts +0 -3
  133. package/dist/move/utils/validate-same-directory.d.ts +0 -2
  134. package/dist/read/read-file-sync.d.ts +0 -37
  135. package/dist/read/read-file.d.ts +0 -41
  136. package/dist/read/read-json-sync.d.ts +0 -5
  137. package/dist/read/read-json.d.ts +0 -5
  138. package/dist/read/read-yaml-sync.d.ts +0 -4
  139. package/dist/read/read-yaml.d.ts +0 -4
  140. package/dist/remove/empty-dir-sync.d.ts +0 -23
  141. package/dist/remove/empty-dir.d.ts +0 -28
  142. package/dist/remove/remove-sync.d.ts +0 -27
  143. package/dist/remove/remove.d.ts +0 -32
  144. package/dist/sanitize.d.ts +0 -31
  145. package/dist/types.d.ts +0 -304
  146. package/dist/utils/assert-valid-file-contents.d.ts +0 -27
  147. package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
  148. package/dist/utils/parse-json.d.ts +0 -5
  149. package/dist/utils/strip-json-comments.d.ts +0 -44
  150. package/dist/write/utils/to-uint-8-array.d.ts +0 -2
  151. package/dist/write/write-file-sync.d.ts +0 -30
  152. package/dist/write/write-file.d.ts +0 -30
  153. package/dist/write/write-json-sync.d.ts +0 -29
  154. package/dist/write/write-json.d.ts +0 -30
  155. package/dist/write/write-yaml-sync.d.ts +0 -4
  156. package/dist/write/write-yaml.d.ts +0 -4
@@ -0,0 +1,167 @@
1
+ var isExtglob;
2
+ var hasRequiredIsExtglob;
3
+
4
+ function requireIsExtglob () {
5
+ if (hasRequiredIsExtglob) return isExtglob;
6
+ hasRequiredIsExtglob = 1;
7
+ /*!
8
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
9
+ *
10
+ * Copyright (c) 2014-2016, Jon Schlinkert.
11
+ * Licensed under the MIT License.
12
+ */
13
+ isExtglob = function isExtglob(str) {
14
+ if (typeof str !== "string" || str === "") {
15
+ return false;
16
+ }
17
+ var match;
18
+ while (match = /(\\).|([@?!+*]\(.*\))/g.exec(str)) {
19
+ if (match[2]) return true;
20
+ str = str.slice(match.index + match[0].length);
21
+ }
22
+ return false;
23
+ };
24
+ return isExtglob;
25
+ }
26
+
27
+ var isGlob;
28
+ var hasRequiredIsGlob;
29
+
30
+ function requireIsGlob () {
31
+ if (hasRequiredIsGlob) return isGlob;
32
+ hasRequiredIsGlob = 1;
33
+ /*!
34
+ * is-glob <https://github.com/jonschlinkert/is-glob>
35
+ *
36
+ * Copyright (c) 2014-2017, Jon Schlinkert.
37
+ * Released under the MIT License.
38
+ */
39
+ var isExtglob = requireIsExtglob();
40
+ var chars = { "{": "}", "(": ")", "[": "]" };
41
+ var strictCheck = function(str) {
42
+ if (str[0] === "!") {
43
+ return true;
44
+ }
45
+ var index = 0;
46
+ var pipeIndex = -2;
47
+ var closeSquareIndex = -2;
48
+ var closeCurlyIndex = -2;
49
+ var closeParenIndex = -2;
50
+ var backSlashIndex = -2;
51
+ while (index < str.length) {
52
+ if (str[index] === "*") {
53
+ return true;
54
+ }
55
+ if (str[index + 1] === "?" && /[\].+)]/.test(str[index])) {
56
+ return true;
57
+ }
58
+ if (closeSquareIndex !== -1 && str[index] === "[" && str[index + 1] !== "]") {
59
+ if (closeSquareIndex < index) {
60
+ closeSquareIndex = str.indexOf("]", index);
61
+ }
62
+ if (closeSquareIndex > index) {
63
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
64
+ return true;
65
+ }
66
+ backSlashIndex = str.indexOf("\\", index);
67
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
68
+ return true;
69
+ }
70
+ }
71
+ }
72
+ if (closeCurlyIndex !== -1 && str[index] === "{" && str[index + 1] !== "}") {
73
+ closeCurlyIndex = str.indexOf("}", index);
74
+ if (closeCurlyIndex > index) {
75
+ backSlashIndex = str.indexOf("\\", index);
76
+ if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
77
+ return true;
78
+ }
79
+ }
80
+ }
81
+ if (closeParenIndex !== -1 && str[index] === "(" && str[index + 1] === "?" && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ")") {
82
+ closeParenIndex = str.indexOf(")", index);
83
+ if (closeParenIndex > index) {
84
+ backSlashIndex = str.indexOf("\\", index);
85
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
86
+ return true;
87
+ }
88
+ }
89
+ }
90
+ if (pipeIndex !== -1 && str[index] === "(" && str[index + 1] !== "|") {
91
+ if (pipeIndex < index) {
92
+ pipeIndex = str.indexOf("|", index);
93
+ }
94
+ if (pipeIndex !== -1 && str[pipeIndex + 1] !== ")") {
95
+ closeParenIndex = str.indexOf(")", pipeIndex);
96
+ if (closeParenIndex > pipeIndex) {
97
+ backSlashIndex = str.indexOf("\\", pipeIndex);
98
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
99
+ return true;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ if (str[index] === "\\") {
105
+ var open = str[index + 1];
106
+ index += 2;
107
+ var close = chars[open];
108
+ if (close) {
109
+ var n = str.indexOf(close, index);
110
+ if (n !== -1) {
111
+ index = n + 1;
112
+ }
113
+ }
114
+ if (str[index] === "!") {
115
+ return true;
116
+ }
117
+ } else {
118
+ index++;
119
+ }
120
+ }
121
+ return false;
122
+ };
123
+ var relaxedCheck = function(str) {
124
+ if (str[0] === "!") {
125
+ return true;
126
+ }
127
+ var index = 0;
128
+ while (index < str.length) {
129
+ if (/[*?{}()[\]]/.test(str[index])) {
130
+ return true;
131
+ }
132
+ if (str[index] === "\\") {
133
+ var open = str[index + 1];
134
+ index += 2;
135
+ var close = chars[open];
136
+ if (close) {
137
+ var n = str.indexOf(close, index);
138
+ if (n !== -1) {
139
+ index = n + 1;
140
+ }
141
+ }
142
+ if (str[index] === "!") {
143
+ return true;
144
+ }
145
+ } else {
146
+ index++;
147
+ }
148
+ }
149
+ return false;
150
+ };
151
+ isGlob = function isGlob(str, options) {
152
+ if (typeof str !== "string" || str === "") {
153
+ return false;
154
+ }
155
+ if (isExtglob(str)) {
156
+ return true;
157
+ }
158
+ var check = strictCheck;
159
+ if (options && options.strict === false) {
160
+ check = relaxedCheck;
161
+ }
162
+ return check(str);
163
+ };
164
+ return isGlob;
165
+ }
166
+
167
+ export { requireIsGlob as r };