@visulima/fs 5.0.0-alpha.8 → 5.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.
- package/CHANGELOG.md +491 -0
- package/LICENSE.md +236 -5
- package/README.md +65 -0
- package/dist/eol.d.ts +31 -30
- package/dist/eol.js +3 -26
- package/dist/error.d.ts +273 -7
- package/dist/error.js +1 -7
- package/dist/glob-parent.d.ts +35 -0
- package/dist/glob-parent.js +1 -0
- package/dist/glob.d.ts +4 -0
- package/dist/glob.js +1 -0
- package/dist/index.d.ts +930 -36
- package/dist/index.js +1 -33
- package/dist/ini.d.ts +70 -0
- package/dist/ini.js +1 -0
- package/dist/is-glob.d.ts +34 -0
- package/dist/is-glob.js +1 -0
- package/dist/json5.d.ts +36 -0
- package/dist/json5.js +1 -0
- package/dist/jsonc.d.ts +65 -0
- package/dist/jsonc.js +1 -0
- package/dist/match.d.ts +80 -0
- package/dist/match.js +1 -0
- package/dist/packem_shared/AlreadyExistsError-DEb3UWja.js +1 -0
- package/dist/packem_shared/DirectoryError-BtwSTLmT.js +1 -0
- package/dist/packem_shared/FIND_UP_STOP-CAwY1qU7.js +1 -0
- package/dist/packem_shared/JSONError-Cvp9ycba.js +4 -0
- package/dist/packem_shared/NotEmptyError-DZ1Ix089.js +1 -0
- package/dist/packem_shared/NotFoundError-CnRY6lVp.js +1 -0
- package/dist/packem_shared/PermissionError-DJ_2VWEj.js +1 -0
- package/dist/packem_shared/WalkError-B8qTd-v-.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-CWAkuNXM.js +1 -0
- package/dist/packem_shared/assertValidFileContents-CbIN7sy7.js +1 -0
- package/dist/packem_shared/assertValidFileOrDirectoryPath-BTlt945W.js +1 -0
- package/dist/packem_shared/build-rm-options-avnusYx-.js +1 -0
- package/dist/packem_shared/collect-CIKDOMiD.js +1 -0
- package/dist/packem_shared/collectSync-D0FRLLqg.js +1 -0
- package/dist/packem_shared/copy-Beb64BYG.js +1 -0
- package/dist/packem_shared/copySync-CagcIEBi.js +1 -0
- package/dist/packem_shared/emptyDir-C7lyd1lW.js +1 -0
- package/dist/packem_shared/emptyDirSync-B8EYpmO9.js +1 -0
- package/dist/packem_shared/ensureDir-DGarVZw8.js +1 -0
- package/dist/packem_shared/ensureDirSync-CsgPrsDH.js +1 -0
- package/dist/packem_shared/ensureFile-CMugWljp.js +1 -0
- package/dist/packem_shared/ensureFileSync-CJYTEx2r.js +1 -0
- package/dist/packem_shared/ensureLink-ChShf3lf.js +1 -0
- package/dist/packem_shared/ensureLinkSync-DPpq0I2Z.js +1 -0
- package/dist/packem_shared/ensureSymlink-y4FZjfxA.js +1 -0
- package/dist/packem_shared/ensureSymlinkSync-TcHssCH7.js +1 -0
- package/dist/packem_shared/findUp-Cii5ATt5.js +1 -0
- package/dist/packem_shared/findUpSync-C9Lkh7-v.js +1 -0
- package/dist/packem_shared/get-file-info-type-DzWpohDB.js +1 -0
- package/dist/packem_shared/glob-fqg4KepW.js +1 -0
- package/dist/packem_shared/glob-sync.d-hXe38TnZ.d.ts +54 -0
- package/dist/packem_shared/globSync-B8_ne93E.js +1 -0
- package/dist/packem_shared/index-B2MhYg3r.js +1 -0
- package/dist/packem_shared/index-BHy3Kcr7.js +11 -0
- package/dist/packem_shared/index-BLg3XWiD.js +1 -0
- package/dist/packem_shared/index-D8MDd0tv.js +1 -0
- package/dist/packem_shared/ini-preserve-D1DopDLd.js +4 -0
- package/dist/packem_shared/is-stats-identical-l1GRN4Qu.js +1 -0
- package/dist/packem_shared/isAccessible-PmWJhV6I.js +1 -0
- package/dist/packem_shared/isAccessibleSync-BrbOtwdr.js +1 -0
- package/dist/packem_shared/json-error.d-DVILOyHc.d.ts +52 -0
- package/dist/packem_shared/jsonc-merge-Bkw73TLW.js +2 -0
- package/dist/packem_shared/map-read-error-CR3rQUxx.js +1 -0
- package/dist/packem_shared/move-DopmzT-2.js +1 -0
- package/dist/packem_shared/parseJson-EASgP4J9.js +1 -0
- package/dist/packem_shared/readFile-BswaBgM0.js +1 -0
- package/dist/packem_shared/readFileSync-_fDF6Oj1.js +1 -0
- package/dist/packem_shared/readIni-BsXudu2r.js +1 -0
- package/dist/packem_shared/readIniSync-DKwRbbs9.js +1 -0
- package/dist/packem_shared/readJson-CcAsHxE5.js +1 -0
- package/dist/packem_shared/readJson5-CM1TIiHd.js +1 -0
- package/dist/packem_shared/readJson5Sync-Bc26c3Fy.js +1 -0
- package/dist/packem_shared/readJsonSync-DuMMeB3s.js +1 -0
- package/dist/packem_shared/readJsonc-BZjMw_0f.js +1 -0
- package/dist/packem_shared/readJsoncSync-C-xzeZz4.js +1 -0
- package/dist/packem_shared/readToml-D4jpe9q_.js +1 -0
- package/dist/packem_shared/readTomlSync-B5PIYT9z.js +1 -0
- package/dist/packem_shared/readYaml-DvPxndW_.js +1 -0
- package/dist/packem_shared/readYamlSync-DZ-0hSbZ.js +1 -0
- package/dist/packem_shared/remove-CSbrd0dl.js +1 -0
- package/dist/packem_shared/removeSync-BoLAzRQE.js +1 -0
- package/dist/packem_shared/renderError-B3ePOoBG-Bi9WKMjv.js +6 -0
- package/dist/packem_shared/resolve-symlink-target-CWrn0v4P.js +1 -0
- package/dist/packem_shared/sanitize-DGZ3w-_w.js +1 -0
- package/dist/packem_shared/stripJsonComments-Bfcn2PKv.js +1 -0
- package/dist/packem_shared/to-uint-8-array-BImOQNXm.js +1 -0
- package/dist/packem_shared/types.d-BMdL_ygj.d.ts +1773 -0
- package/dist/packem_shared/walk-OX4-6oCP.js +1 -0
- package/dist/packem_shared/walk-include-BXhGSn6t.js +1 -0
- package/dist/packem_shared/walkSync-BPs6czIM.js +1 -0
- package/dist/packem_shared/writeFile-BrMtsJY7.js +1 -0
- package/dist/packem_shared/writeFileSync-W7Mf4BNy.js +1 -0
- package/dist/packem_shared/writeIni-BWX3cP1K.js +4 -0
- package/dist/packem_shared/writeIniSync-fOdgPFfL.js +4 -0
- package/dist/packem_shared/writeJson-bEVi25gX.js +4 -0
- package/dist/packem_shared/writeJson5-Ch8TpNPI.js +4 -0
- package/dist/packem_shared/writeJson5Sync-BrctV_Mk.js +4 -0
- package/dist/packem_shared/writeJsonSync-DkGnd416.js +4 -0
- package/dist/packem_shared/writeJsonc-CefrwsOc.js +4 -0
- package/dist/packem_shared/writeJsoncSync-BskDjn8o.js +4 -0
- package/dist/packem_shared/writeToml-IuMO-yDu.js +1 -0
- package/dist/packem_shared/writeTomlSync-DhL7hHzB.js +1 -0
- package/dist/packem_shared/writeYaml-ClQgvQID.js +1 -0
- package/dist/packem_shared/writeYamlSync-DrXtHQQq.js +1 -0
- package/dist/size.d.ts +246 -246
- package/dist/size.js +1 -146
- package/dist/toml.d.ts +63 -0
- package/dist/toml.js +1 -0
- package/dist/utils.d.ts +103 -6
- package/dist/utils.js +1 -6
- package/dist/yaml.d.ts +13 -5
- package/dist/yaml.js +1 -4
- package/package.json +68 -17
- package/dist/constants.d.ts +0 -42
- package/dist/ensure/ensure-dir-sync.d.ts +0 -14
- package/dist/ensure/ensure-dir.d.ts +0 -14
- package/dist/ensure/ensure-file-sync.d.ts +0 -15
- package/dist/ensure/ensure-file.d.ts +0 -27
- package/dist/ensure/ensure-link-sync.d.ts +0 -16
- package/dist/ensure/ensure-link.d.ts +0 -16
- package/dist/ensure/ensure-symlink-sync.d.ts +0 -23
- package/dist/ensure/ensure-symlink.d.ts +0 -23
- package/dist/ensure/utils/get-file-info-type.d.ts +0 -7
- package/dist/ensure/utils/is-stats-identical.d.ts +0 -3
- package/dist/ensure/utils/resolve-symlink-target.d.ts +0 -2
- package/dist/error/already-exists-error.d.ts +0 -39
- package/dist/error/directory-error.d.ts +0 -47
- package/dist/error/json-error.d.ts +0 -52
- package/dist/error/not-empty-error.d.ts +0 -51
- package/dist/error/not-found-error.d.ts +0 -44
- package/dist/error/permission-error.d.ts +0 -45
- package/dist/error/walk-error.d.ts +0 -51
- package/dist/find/collect-sync.d.ts +0 -31
- package/dist/find/collect.d.ts +0 -35
- package/dist/find/find-up-sync.d.ts +0 -42
- package/dist/find/find-up.d.ts +0 -46
- package/dist/find/utils/glob-to-regexp.d.ts +0 -2
- package/dist/find/utils/walk-include.d.ts +0 -2
- package/dist/find/walk-sync.d.ts +0 -34
- package/dist/find/walk.d.ts +0 -37
- package/dist/is-accessible-sync.d.ts +0 -3
- package/dist/is-accessible.d.ts +0 -29
- package/dist/move/index.d.ts +0 -68
- package/dist/move/types.d.ts +0 -36
- package/dist/move/utils/internal-move-file-sync.d.ts +0 -3
- package/dist/move/utils/internal-move-file.d.ts +0 -3
- package/dist/move/utils/validate-same-directory.d.ts +0 -2
- package/dist/packem_shared/AlreadyExistsError-6Y9hjgMn.js +0 -27
- package/dist/packem_shared/DirectoryError-BfYPkIYP.js +0 -27
- package/dist/packem_shared/F_OK-MldBaGxb.js +0 -8
- package/dist/packem_shared/JSONError-BkHRnInH.js +0 -26
- package/dist/packem_shared/NotEmptyError-B21RUlVr.js +0 -27
- package/dist/packem_shared/NotFoundError-BIp61X6k.js +0 -27
- package/dist/packem_shared/PermissionError-CjoiJgip.js +0 -27
- package/dist/packem_shared/WalkError-DER5A43G.js +0 -24
- package/dist/packem_shared/assertValidFileContents-BmcLtsGd.js +0 -7
- package/dist/packem_shared/assertValidFileOrDirectoryPath-8HANmVjk.js +0 -7
- package/dist/packem_shared/collect-CqQ3eVab.js +0 -14
- package/dist/packem_shared/collectSync-noE08NNv.js +0 -14
- package/dist/packem_shared/emptyDir-Df4Tfjtk.js +0 -44
- package/dist/packem_shared/emptyDirSync-BD8-1Ytl.js +0 -41
- package/dist/packem_shared/ensureDir-DNlPftys.js +0 -53
- package/dist/packem_shared/ensureDirSync-DcPZFMy5.js +0 -53
- package/dist/packem_shared/ensureFile-BRQpUOUM.js +0 -47
- package/dist/packem_shared/ensureFileSync-SBY7A9-C.js +0 -47
- package/dist/packem_shared/ensureLink-DJQeauEn.js +0 -55
- package/dist/packem_shared/ensureLinkSync-D9RVAglV.js +0 -55
- package/dist/packem_shared/ensureSymlink-CoRYDRwr.js +0 -80
- package/dist/packem_shared/ensureSymlinkSync-CFimFlgh.js +0 -81
- package/dist/packem_shared/findUp-YcNLKdfV.js +0 -84
- package/dist/packem_shared/findUpSync-BfA5fheN.js +0 -83
- package/dist/packem_shared/get-file-info-type-FD4-jsyg.js +0 -14
- package/dist/packem_shared/index-CHM-in-V.js +0 -100
- package/dist/packem_shared/is-stats-identical-D8FxpvQU.js +0 -3
- package/dist/packem_shared/isAccessible-DuVrTNFV.js +0 -38
- package/dist/packem_shared/isAccessibleSync-DI8mM0fA.js +0 -38
- package/dist/packem_shared/isFsCaseSensitive-D-ayleCy.js +0 -62
- package/dist/packem_shared/move-DbpW5_vA.js +0 -134
- package/dist/packem_shared/parseJson-BedVi91S.js +0 -232
- package/dist/packem_shared/readFile-Iz7kvCCk.js +0 -65
- package/dist/packem_shared/readFileSync-gm9yfIhh.js +0 -54
- package/dist/packem_shared/readJson-D0G0ndHL.js +0 -22
- package/dist/packem_shared/readJsonSync-B7oicPaL.js +0 -22
- package/dist/packem_shared/readYaml-D5q2a0e1.js +0 -10
- package/dist/packem_shared/readYamlSync-BKX-PAfq.js +0 -10
- package/dist/packem_shared/remove-CNkjFFkQ.js +0 -38
- package/dist/packem_shared/removeSync-AnawYpPv.js +0 -38
- package/dist/packem_shared/resolve-symlink-target-Kh4GovFf.js +0 -16
- package/dist/packem_shared/sanitize-BZoLN9Fg.js +0 -205
- package/dist/packem_shared/stripJsonComments-vo4k0mpF.js +0 -19
- package/dist/packem_shared/to-uint-8-array-Dz2nF1y1.js +0 -19
- package/dist/packem_shared/walk-CSZgCuDx.js +0 -124
- package/dist/packem_shared/walk-include-CZco7BvN.js +0 -16
- package/dist/packem_shared/walkSync-C4Cy28xb.js +0 -123
- package/dist/packem_shared/writeFile-B8HX0JIQ.js +0 -81
- package/dist/packem_shared/writeFileSync-DB8vv8xR.js +0 -81
- package/dist/packem_shared/writeJson-Bo7C2UHw.js +0 -50
- package/dist/packem_shared/writeJsonSync-BKZ_9Acr.js +0 -50
- package/dist/packem_shared/writeYaml-BWCOome-.js +0 -24
- package/dist/packem_shared/writeYamlSync-DBVnXmuY.js +0 -24
- package/dist/read/read-file-sync.d.ts +0 -37
- package/dist/read/read-file.d.ts +0 -41
- package/dist/read/read-json-sync.d.ts +0 -5
- package/dist/read/read-json.d.ts +0 -5
- package/dist/read/read-yaml-sync.d.ts +0 -4
- package/dist/read/read-yaml.d.ts +0 -4
- package/dist/remove/empty-dir-sync.d.ts +0 -23
- package/dist/remove/empty-dir.d.ts +0 -28
- package/dist/remove/remove-sync.d.ts +0 -27
- package/dist/remove/remove.d.ts +0 -32
- package/dist/sanitize.d.ts +0 -31
- package/dist/types.d.ts +0 -304
- package/dist/utils/assert-valid-file-contents.d.ts +0 -27
- package/dist/utils/assert-valid-file-or-directory-path.d.ts +0 -26
- package/dist/utils/parse-json.d.ts +0 -5
- package/dist/utils/strip-json-comments.d.ts +0 -44
- package/dist/write/utils/to-uint-8-array.d.ts +0 -2
- package/dist/write/write-file-sync.d.ts +0 -30
- package/dist/write/write-file.d.ts +0 -30
- package/dist/write/write-json-sync.d.ts +0 -29
- package/dist/write/write-json.d.ts +0 -30
- package/dist/write/write-yaml-sync.d.ts +0 -4
- package/dist/write/write-yaml.d.ts +0 -4
package/LICENSE.md
CHANGED
|
@@ -24,7 +24,7 @@ SOFTWARE.
|
|
|
24
24
|
|
|
25
25
|
# Licenses of bundled dependencies
|
|
26
26
|
The published @visulima/fs artifact additionally contains code with the following licenses:
|
|
27
|
-
MIT
|
|
27
|
+
ISC, MIT
|
|
28
28
|
|
|
29
29
|
# Bundled dependencies:
|
|
30
30
|
## @visulima/error
|
|
@@ -57,11 +57,14 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
57
57
|
>
|
|
58
58
|
>
|
|
59
59
|
> # Licenses of bundled dependencies
|
|
60
|
+
>
|
|
60
61
|
> The published @visulima/error artifact additionally contains code with the following licenses:
|
|
61
62
|
> MIT
|
|
62
63
|
>
|
|
63
64
|
> # Bundled dependencies:
|
|
65
|
+
>
|
|
64
66
|
> ## is-plain-obj
|
|
67
|
+
>
|
|
65
68
|
> License: MIT
|
|
66
69
|
> By: Sindre Sorhus
|
|
67
70
|
> Repository: sindresorhus/is-plain-obj
|
|
@@ -75,6 +78,33 @@ Repository: git+https://github.com/visulima/visulima.git
|
|
|
75
78
|
> > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
76
79
|
> >
|
|
77
80
|
> > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
81
|
+
>
|
|
82
|
+
>
|
|
83
|
+
>
|
|
84
|
+
>
|
|
85
|
+
>
|
|
86
|
+
> # Licenses of bundled types
|
|
87
|
+
> The published @visulima/error artifact additionally contains code with the following licenses:
|
|
88
|
+
> Apache-2.0
|
|
89
|
+
>
|
|
90
|
+
> # Bundled types:
|
|
91
|
+
> ## ai
|
|
92
|
+
> License: Apache-2.0
|
|
93
|
+
> Repository: https://github.com/vercel/ai
|
|
94
|
+
>
|
|
95
|
+
> > Copyright 2023 Vercel, Inc.
|
|
96
|
+
> >
|
|
97
|
+
> > Licensed under the Apache License, Version 2.0 (the "License");
|
|
98
|
+
> > you may not use this file except in compliance with the License.
|
|
99
|
+
> > You may obtain a copy of the License at
|
|
100
|
+
> >
|
|
101
|
+
> > http://www.apache.org/licenses/LICENSE-2.0
|
|
102
|
+
> >
|
|
103
|
+
> > Unless required by applicable law or agreed to in writing, software
|
|
104
|
+
> > distributed under the License is distributed on an "AS IS" BASIS,
|
|
105
|
+
> > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
|
+
> > See the License for the specific language governing permissions and
|
|
107
|
+
> > limitations under the License.
|
|
78
108
|
|
|
79
109
|
---------------------------------------
|
|
80
110
|
|
|
@@ -95,6 +125,73 @@ Repository: sindresorhus/detect-indent
|
|
|
95
125
|
|
|
96
126
|
---------------------------------------
|
|
97
127
|
|
|
128
|
+
## fdir
|
|
129
|
+
License: MIT
|
|
130
|
+
By: thecodrr
|
|
131
|
+
Repository: git+https://github.com/thecodrr/fdir.git
|
|
132
|
+
|
|
133
|
+
> Copyright 2023 Abdullah Atta
|
|
134
|
+
>
|
|
135
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
136
|
+
>
|
|
137
|
+
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
138
|
+
>
|
|
139
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
140
|
+
|
|
141
|
+
---------------------------------------
|
|
142
|
+
|
|
143
|
+
## glob-parent
|
|
144
|
+
License: ISC
|
|
145
|
+
By: Gulp Team, Elan Shanker, Blaine Bublitz
|
|
146
|
+
Repository: gulpjs/glob-parent
|
|
147
|
+
|
|
148
|
+
> The ISC License
|
|
149
|
+
>
|
|
150
|
+
> Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
|
|
151
|
+
>
|
|
152
|
+
> Permission to use, copy, modify, and/or distribute this software for any
|
|
153
|
+
> purpose with or without fee is hereby granted, provided that the above
|
|
154
|
+
> copyright notice and this permission notice appear in all copies.
|
|
155
|
+
>
|
|
156
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
157
|
+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
158
|
+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
159
|
+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
160
|
+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
161
|
+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
162
|
+
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
163
|
+
|
|
164
|
+
---------------------------------------
|
|
165
|
+
|
|
166
|
+
## is-extglob
|
|
167
|
+
License: MIT
|
|
168
|
+
By: Jon Schlinkert
|
|
169
|
+
Repository: jonschlinkert/is-extglob
|
|
170
|
+
|
|
171
|
+
> The MIT License (MIT)
|
|
172
|
+
>
|
|
173
|
+
> Copyright (c) 2014-2016, Jon Schlinkert
|
|
174
|
+
>
|
|
175
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
176
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
177
|
+
> in the Software without restriction, including without limitation the rights
|
|
178
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
179
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
180
|
+
> furnished to do so, subject to the following conditions:
|
|
181
|
+
>
|
|
182
|
+
> The above copyright notice and this permission notice shall be included in
|
|
183
|
+
> all copies or substantial portions of the Software.
|
|
184
|
+
>
|
|
185
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
186
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
187
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
188
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
189
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
190
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
191
|
+
> THE SOFTWARE.
|
|
192
|
+
|
|
193
|
+
---------------------------------------
|
|
194
|
+
|
|
98
195
|
## is-fs-case-sensitive
|
|
99
196
|
License: MIT
|
|
100
197
|
By: Hiroki Osame
|
|
@@ -122,19 +219,103 @@ Repository: privatenumber/is-fs-case-sensitive
|
|
|
122
219
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
123
220
|
> SOFTWARE.
|
|
124
221
|
|
|
222
|
+
---------------------------------------
|
|
223
|
+
|
|
224
|
+
## is-glob
|
|
225
|
+
License: MIT
|
|
226
|
+
By: Jon Schlinkert, Brian Woodward, Daniel Perez
|
|
227
|
+
Repository: micromatch/is-glob
|
|
228
|
+
|
|
229
|
+
> The MIT License (MIT)
|
|
230
|
+
>
|
|
231
|
+
> Copyright (c) 2014-2017, Jon Schlinkert.
|
|
232
|
+
>
|
|
233
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
234
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
235
|
+
> in the Software without restriction, including without limitation the rights
|
|
236
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
237
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
238
|
+
> furnished to do so, subject to the following conditions:
|
|
239
|
+
>
|
|
240
|
+
> The above copyright notice and this permission notice shall be included in
|
|
241
|
+
> all copies or substantial portions of the Software.
|
|
242
|
+
>
|
|
243
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
244
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
245
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
246
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
247
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
248
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
249
|
+
> THE SOFTWARE.
|
|
250
|
+
|
|
251
|
+
---------------------------------------
|
|
252
|
+
|
|
253
|
+
## picomatch
|
|
254
|
+
License: MIT
|
|
255
|
+
By: Jon Schlinkert
|
|
256
|
+
Repository: micromatch/picomatch
|
|
257
|
+
|
|
258
|
+
> The MIT License (MIT)
|
|
259
|
+
>
|
|
260
|
+
> Copyright (c) 2017-present, Jon Schlinkert.
|
|
261
|
+
>
|
|
262
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
263
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
264
|
+
> in the Software without restriction, including without limitation the rights
|
|
265
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
266
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
267
|
+
> furnished to do so, subject to the following conditions:
|
|
268
|
+
>
|
|
269
|
+
> The above copyright notice and this permission notice shall be included in
|
|
270
|
+
> all copies or substantial portions of the Software.
|
|
271
|
+
>
|
|
272
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
273
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
274
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
275
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
276
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
277
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
278
|
+
> THE SOFTWARE.
|
|
279
|
+
|
|
280
|
+
---------------------------------------
|
|
281
|
+
|
|
282
|
+
## tinyglobby
|
|
283
|
+
License: MIT
|
|
284
|
+
By: Superchupu
|
|
285
|
+
Repository: git+https://github.com/SuperchupuDev/tinyglobby.git
|
|
286
|
+
|
|
287
|
+
> MIT License
|
|
288
|
+
>
|
|
289
|
+
> Copyright (c) 2024 Madeline Gurriarán
|
|
290
|
+
>
|
|
291
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
292
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
293
|
+
> in the Software without restriction, including without limitation the rights
|
|
294
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
295
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
296
|
+
> furnished to do so, subject to the following conditions:
|
|
297
|
+
>
|
|
298
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
299
|
+
> copies or substantial portions of the Software.
|
|
300
|
+
>
|
|
301
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
302
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
303
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
304
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
305
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
306
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
307
|
+
> SOFTWARE.
|
|
308
|
+
|
|
125
309
|
<!-- /DEPENDENCIES -->
|
|
126
310
|
|
|
127
311
|
<!-- TYPE_DEPENDENCIES -->
|
|
128
312
|
|
|
129
313
|
# Licenses of bundled types
|
|
130
|
-
|
|
131
314
|
The published @visulima/fs artifact additionally contains code with the following licenses:
|
|
132
|
-
MIT
|
|
315
|
+
ISC, MIT
|
|
133
316
|
|
|
134
317
|
# Bundled types:
|
|
135
|
-
|
|
136
318
|
## is-fs-case-sensitive
|
|
137
|
-
|
|
138
319
|
License: MIT
|
|
139
320
|
By: Hiroki Osame
|
|
140
321
|
Repository: privatenumber/is-fs-case-sensitive
|
|
@@ -161,4 +342,54 @@ Repository: privatenumber/is-fs-case-sensitive
|
|
|
161
342
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
162
343
|
> SOFTWARE.
|
|
163
344
|
|
|
345
|
+
---------------------------------------
|
|
346
|
+
|
|
347
|
+
## tinyglobby
|
|
348
|
+
License: MIT
|
|
349
|
+
By: Superchupu
|
|
350
|
+
Repository: git+https://github.com/SuperchupuDev/tinyglobby.git
|
|
351
|
+
|
|
352
|
+
> MIT License
|
|
353
|
+
>
|
|
354
|
+
> Copyright (c) 2024 Madeline Gurriarán
|
|
355
|
+
>
|
|
356
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
357
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
358
|
+
> in the Software without restriction, including without limitation the rights
|
|
359
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
360
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
361
|
+
> furnished to do so, subject to the following conditions:
|
|
362
|
+
>
|
|
363
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
364
|
+
> copies or substantial portions of the Software.
|
|
365
|
+
>
|
|
366
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
367
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
368
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
369
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
370
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
371
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
372
|
+
> SOFTWARE.
|
|
373
|
+
|
|
374
|
+
---------------------------------------
|
|
375
|
+
|
|
376
|
+
## yaml
|
|
377
|
+
License: ISC
|
|
378
|
+
By: Eemeli Aro
|
|
379
|
+
Repository: github:eemeli/yaml
|
|
380
|
+
|
|
381
|
+
> Copyright Eemeli Aro <eemeli@gmail.com>
|
|
382
|
+
>
|
|
383
|
+
> Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
384
|
+
> with or without fee is hereby granted, provided that the above copyright notice
|
|
385
|
+
> and this permission notice appear in all copies.
|
|
386
|
+
>
|
|
387
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
388
|
+
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
389
|
+
> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
390
|
+
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
391
|
+
> OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
392
|
+
> TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
393
|
+
> THIS SOFTWARE.
|
|
394
|
+
|
|
164
395
|
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -66,6 +66,71 @@ pnpm add yaml
|
|
|
66
66
|
|
|
67
67
|
## Usage
|
|
68
68
|
|
|
69
|
+
### Quickstart by subpath
|
|
70
|
+
|
|
71
|
+
`@visulima/fs` ships one entry per concern. Import from the narrowest subpath you
|
|
72
|
+
need so the optional parser peers (`yaml`, `smol-toml`, `jsonc-parser`, `json5`,
|
|
73
|
+
`ini`) stay tree-shaken.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// Core fs surface: walk, glob, findUp, ensure*, read/writeFile, copy, move, remove, emptyDir, isAccessible, sanitize, EOL.
|
|
77
|
+
import { copy, ensureDir, findUp, readFile, walk, writeFile } from "@visulima/fs";
|
|
78
|
+
|
|
79
|
+
// Typed error classes (NotFoundError, AlreadyExistsError, PermissionError, …).
|
|
80
|
+
import { NotFoundError } from "@visulima/fs/error";
|
|
81
|
+
|
|
82
|
+
// Parser-backed helpers — each needs its peer dependency installed.
|
|
83
|
+
import { readYaml, writeYaml } from "@visulima/fs/yaml";
|
|
84
|
+
import { readJsonc, writeJsonc } from "@visulima/fs/jsonc";
|
|
85
|
+
|
|
86
|
+
// Glob primitives and size/eol helpers.
|
|
87
|
+
import { glob } from "@visulima/fs/glob";
|
|
88
|
+
import { gzipSize } from "@visulima/fs/size";
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Copy a file or directory
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { copy } from "@visulima/fs";
|
|
95
|
+
|
|
96
|
+
// Copy a template directory, skipping node_modules and overwriting existing files.
|
|
97
|
+
await copy("templates/app", "out/app", {
|
|
98
|
+
filter: (source) => !source.includes("node_modules"),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Refuse to overwrite an existing destination.
|
|
102
|
+
import { AlreadyExistsError } from "@visulima/fs/error";
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
await copy("a.txt", "b.txt", { overwrite: false });
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (error instanceof AlreadyExistsError) {
|
|
108
|
+
console.error("destination already exists");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Coming from `fs-extra`?
|
|
114
|
+
|
|
115
|
+
| `fs-extra` | `@visulima/fs` |
|
|
116
|
+
| ------------------------------ | ----------------------------------------------------------------------- |
|
|
117
|
+
| `copy` / `copySync` | `copy` / `copySync` |
|
|
118
|
+
| `move` / `moveSync` | `move` / `moveSync` |
|
|
119
|
+
| `remove` / `removeSync` | `remove` / `removeSync` (real `EACCES`/`EBUSY` errors propagate) |
|
|
120
|
+
| `emptyDir` / `emptyDirSync` | `emptyDir` / `emptyDirSync` |
|
|
121
|
+
| `ensureFile` / `ensureDir` / … | `ensureFile` / `ensureDir` / `ensureLink` / `ensureSymlink` (+ `*Sync`) |
|
|
122
|
+
| `readJson` / `writeJson` | `readJson` / `writeJson` (+ `*Sync`) |
|
|
123
|
+
| `pathExists` | `isAccessible` / `isAccessibleSync` |
|
|
124
|
+
|
|
125
|
+
> **`writeFile` notes:** `overwrite` defaults to `true`. With `overwrite: false`,
|
|
126
|
+
> `writeFile` throws `AlreadyExistsError` if the target exists instead of
|
|
127
|
+
> overwriting it. To keep a copy of the previous file before overwriting, pass
|
|
128
|
+
> `{ backup: true }` — the old contents are renamed to `${path}.bak`.
|
|
129
|
+
>
|
|
130
|
+
> **`readFile` errors:** a missing file throws `NotFoundError` (`ENOENT`); a file
|
|
131
|
+
> that cannot be read for permission reasons throws `PermissionError`
|
|
132
|
+
> (`EACCES`/`EPERM`).
|
|
133
|
+
|
|
69
134
|
## walk
|
|
70
135
|
|
|
71
136
|
```typescript
|
package/dist/eol.d.ts
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
/** End-of-line character for POSIX platforms such as macOS and Linux. */
|
|
2
|
-
|
|
2
|
+
declare const LF: "\n";
|
|
3
3
|
/** End-of-line character for Windows platforms. */
|
|
4
|
-
|
|
4
|
+
declare const CRLF: "\r\n";
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
* End-of-line character evaluated for the current platform.
|
|
7
|
+
*/
|
|
8
|
+
declare const EOL: "\n" | "\r\n";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
* Detect the EOL character for string input.
|
|
11
|
+
* Returns null if no newline.
|
|
12
|
+
* @param content The string content to detect the EOL from.
|
|
13
|
+
* @example
|
|
14
|
+
* ```javascript
|
|
15
|
+
* import { detect } from "@visulima/fs/eol";
|
|
16
|
+
*
|
|
17
|
+
* detect("Hello\r\nWorld"); // "\r\n"
|
|
18
|
+
* detect("Hello\nWorld"); // "\n"
|
|
19
|
+
* detect("HelloWorld"); // null
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const detect: (content: string) => typeof EOL | null;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
* Format the file to the targeted EOL.
|
|
25
|
+
* @param content The string content to format.
|
|
26
|
+
* @param eol The target EOL character.
|
|
27
|
+
* @example
|
|
28
|
+
* ```javascript
|
|
29
|
+
* import { format, LF, CRLF } from "@visulima/fs/eol";
|
|
30
|
+
*
|
|
31
|
+
* format("Hello\r\nWorld\nUnix", LF); // "Hello\nWorld\nUnix"
|
|
32
|
+
* format("Hello\nWorld\r\nWindows", CRLF); // "Hello\r\nWorld\r\nWindows"
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const format: (content: string, eol: typeof EOL) => string;
|
|
36
|
+
export { CRLF, EOL, LF, detect, format };
|
package/dist/eol.js
CHANGED
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
platform
|
|
9
|
-
} = __cjs_getProcess;
|
|
10
|
-
|
|
11
|
-
const regDetect = /\r?\n/g;
|
|
12
|
-
const LF = "\n";
|
|
13
|
-
const CRLF = "\r\n";
|
|
14
|
-
const EOL = platform === "win32" ? CRLF : LF;
|
|
15
|
-
const detect = (content) => {
|
|
16
|
-
const matched = content.match(regDetect);
|
|
17
|
-
if (!matched || matched.length === 0) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const crlf = matched.filter((newline) => newline === CRLF).length;
|
|
21
|
-
const lf = matched.length - crlf;
|
|
22
|
-
return crlf > lf ? CRLF : LF;
|
|
23
|
-
};
|
|
24
|
-
const format = (content, eol) => content.replaceAll(regDetect, eol);
|
|
25
|
-
|
|
26
|
-
export { CRLF, EOL, LF, detect, format };
|
|
1
|
+
import{createRequire as i}from"node:module";const u=i(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:p}=a,s=/\r?\n/g,c=`
|
|
2
|
+
`,r=`\r
|
|
3
|
+
`,_=p==="win32"?r:c,g=t=>{const e=t.match(s);if(!e||e.length===0)return null;const o=e.filter(l=>l===r).length,n=e.length-o;return o>n?r:c},h=(t,e)=>t.replaceAll(s,e);export{r as CRLF,_ as EOL,c as LF,g as detect,h as format};
|