@effect/platform 0.18.7 → 0.20.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 (155) hide show
  1. package/Command/dist/effect-platform-Command.cjs.dev.js +419 -26
  2. package/Command/dist/effect-platform-Command.cjs.prod.js +419 -26
  3. package/Command/dist/effect-platform-Command.esm.js +382 -9
  4. package/CommandExecutor/dist/effect-platform-CommandExecutor.cjs.dev.js +72 -7
  5. package/CommandExecutor/dist/effect-platform-CommandExecutor.cjs.prod.js +72 -7
  6. package/CommandExecutor/dist/effect-platform-CommandExecutor.esm.js +71 -2
  7. package/Effectify/dist/effect-platform-Effectify.cjs.dev.js +55 -3
  8. package/Effectify/dist/effect-platform-Effectify.cjs.prod.js +55 -3
  9. package/Effectify/dist/effect-platform-Effectify.esm.js +38 -2
  10. package/Error/dist/effect-platform-Error.cjs.dev.js +87 -5
  11. package/Error/dist/effect-platform-Error.cjs.prod.js +87 -5
  12. package/Error/dist/effect-platform-Error.esm.js +68 -2
  13. package/FileSystem/dist/effect-platform-FileSystem.cjs.dev.js +287 -20
  14. package/FileSystem/dist/effect-platform-FileSystem.cjs.prod.js +287 -20
  15. package/FileSystem/dist/effect-platform-FileSystem.esm.js +256 -9
  16. package/Http/App/dist/effect-platform-Http-App.cjs.dev.js +15 -0
  17. package/Http/App/dist/effect-platform-Http-App.cjs.mjs +6 -1
  18. package/Http/App/dist/effect-platform-Http-App.cjs.prod.js +15 -0
  19. package/Http/App/dist/effect-platform-Http-App.esm.js +6 -1
  20. package/Http/Body/dist/effect-platform-Http-Body.cjs.dev.js +4 -4
  21. package/Http/Body/dist/effect-platform-Http-Body.cjs.prod.js +4 -4
  22. package/Http/Body/dist/effect-platform-Http-Body.esm.js +4 -4
  23. package/Http/Client/dist/effect-platform-Http-Client.cjs.dev.js +6 -6
  24. package/Http/Client/dist/effect-platform-Http-Client.cjs.prod.js +6 -6
  25. package/Http/Client/dist/effect-platform-Http-Client.esm.js +6 -6
  26. package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.cjs.dev.js +5 -5
  27. package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.cjs.prod.js +5 -5
  28. package/Http/ClientRequest/dist/effect-platform-Http-ClientRequest.esm.js +5 -5
  29. package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.cjs.dev.js +4 -4
  30. package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.cjs.prod.js +4 -4
  31. package/Http/ClientResponse/dist/effect-platform-Http-ClientResponse.esm.js +4 -4
  32. package/Http/FormData/dist/effect-platform-Http-FormData.cjs.dev.js +3 -3
  33. package/Http/FormData/dist/effect-platform-Http-FormData.cjs.prod.js +3 -3
  34. package/Http/FormData/dist/effect-platform-Http-FormData.esm.js +3 -3
  35. package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.cjs.dev.js +2 -2
  36. package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.cjs.prod.js +2 -2
  37. package/Http/IncomingMessage/dist/effect-platform-Http-IncomingMessage.esm.js +2 -2
  38. package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.dev.js +11 -11
  39. package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.mjs +0 -1
  40. package/Http/Middleware/dist/effect-platform-Http-Middleware.cjs.prod.js +11 -11
  41. package/Http/Middleware/dist/effect-platform-Http-Middleware.esm.js +11 -10
  42. package/Http/Platform/dist/effect-platform-Http-Platform.cjs.dev.js +3 -3
  43. package/Http/Platform/dist/effect-platform-Http-Platform.cjs.prod.js +3 -3
  44. package/Http/Platform/dist/effect-platform-Http-Platform.esm.js +2 -2
  45. package/Http/Router/dist/effect-platform-Http-Router.cjs.dev.js +5 -5
  46. package/Http/Router/dist/effect-platform-Http-Router.cjs.prod.js +5 -5
  47. package/Http/Router/dist/effect-platform-Http-Router.esm.js +5 -5
  48. package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.cjs.dev.js +4 -4
  49. package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.cjs.prod.js +4 -4
  50. package/Http/ServerRequest/dist/effect-platform-Http-ServerRequest.esm.js +4 -4
  51. package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.cjs.dev.js +4 -4
  52. package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.cjs.prod.js +4 -4
  53. package/Http/ServerResponse/dist/effect-platform-Http-ServerResponse.esm.js +4 -4
  54. package/HttpClient/dist/effect-platform-HttpClient.cjs.dev.js +9 -9
  55. package/HttpClient/dist/effect-platform-HttpClient.cjs.prod.js +9 -9
  56. package/HttpClient/dist/effect-platform-HttpClient.esm.js +9 -9
  57. package/HttpServer/dist/effect-platform-HttpServer.cjs.dev.js +15 -15
  58. package/HttpServer/dist/effect-platform-HttpServer.cjs.prod.js +15 -15
  59. package/HttpServer/dist/effect-platform-HttpServer.esm.js +15 -15
  60. package/KeyValueStore/dist/effect-platform-KeyValueStore.cjs.dev.js +227 -18
  61. package/KeyValueStore/dist/effect-platform-KeyValueStore.cjs.prod.js +227 -18
  62. package/KeyValueStore/dist/effect-platform-KeyValueStore.esm.js +199 -10
  63. package/Path/dist/effect-platform-Path.cjs.dev.js +142 -9
  64. package/Path/dist/effect-platform-Path.cjs.prod.js +142 -9
  65. package/Path/dist/effect-platform-Path.esm.js +122 -7
  66. package/Runtime/dist/effect-platform-Runtime.cjs.dev.js +44 -4
  67. package/Runtime/dist/effect-platform-Runtime.cjs.prod.js +44 -4
  68. package/Runtime/dist/effect-platform-Runtime.esm.js +26 -3
  69. package/dist/App-18152f12.cjs.dev.js +93 -0
  70. package/dist/App-1ca51fa7.esm.js +65 -0
  71. package/dist/App-d8b904fa.cjs.prod.js +93 -0
  72. package/dist/{Body-ec1353f9.esm.js → Body-40ced606.esm.js} +1 -1
  73. package/dist/{Body-86ef2922.cjs.dev.js → Body-4a7ad057.cjs.dev.js} +1 -1
  74. package/dist/{Body-b77eac75.cjs.prod.js → Body-c26fa93f.cjs.prod.js} +1 -1
  75. package/dist/{Client-537f76ae.cjs.prod.js → Client-03fea3d9.cjs.prod.js} +3 -3
  76. package/dist/{Client-cdbd4ff7.esm.js → Client-55ef15d5.esm.js} +3 -3
  77. package/dist/{Client-0fbb38ab.cjs.dev.js → Client-c05eadcd.cjs.dev.js} +3 -3
  78. package/dist/{ClientRequest-fc429335.esm.js → ClientRequest-490c76cd.esm.js} +1 -1
  79. package/dist/{ClientRequest-750d8d59.cjs.prod.js → ClientRequest-a729f345.cjs.prod.js} +1 -1
  80. package/dist/{ClientRequest-00e89da8.cjs.dev.js → ClientRequest-c5336a28.cjs.dev.js} +1 -1
  81. package/dist/{ClientResponse-7e4fe7b5.esm.js → ClientResponse-6e84da40.esm.js} +1 -1
  82. package/dist/{ClientResponse-f9f19afb.cjs.prod.js → ClientResponse-c19fd519.cjs.prod.js} +1 -1
  83. package/dist/{ClientResponse-75423399.cjs.dev.js → ClientResponse-df62564e.cjs.dev.js} +1 -1
  84. package/dist/{FormData-ee0b1cf2.cjs.dev.js → FormData-6d030595.cjs.prod.js} +1 -1
  85. package/dist/{FormData-902afd18.cjs.prod.js → FormData-7ea13198.cjs.dev.js} +1 -1
  86. package/dist/{FormData-f54de878.esm.js → FormData-bd727d2f.esm.js} +1 -1
  87. package/dist/{Middleware-f9a073d7.cjs.prod.js → Middleware-6de1c21d.cjs.prod.js} +14 -20
  88. package/dist/{Middleware-e2edf820.cjs.dev.js → Middleware-b1d126b4.cjs.dev.js} +14 -20
  89. package/dist/{Middleware-240f91f6.esm.js → Middleware-d38ef616.esm.js} +15 -20
  90. package/dist/{Router-bf32317a.esm.js → Router-2ee665b4.esm.js} +2 -2
  91. package/dist/{Router-bd2b3014.cjs.dev.js → Router-43e62bd9.cjs.dev.js} +2 -2
  92. package/dist/{Router-6c80a4c9.cjs.prod.js → Router-53ec1aea.cjs.prod.js} +2 -2
  93. package/dist/{ServerRequest-03161edc.esm.js → ServerRequest-a641c507.esm.js} +1 -1
  94. package/dist/{ServerRequest-8d9c2c6b.cjs.dev.js → ServerRequest-cb289dae.cjs.dev.js} +1 -1
  95. package/dist/{ServerRequest-938f3ed0.cjs.prod.js → ServerRequest-ec4da01b.cjs.prod.js} +1 -1
  96. package/dist/{ServerResponse-93038062.esm.js → ServerResponse-03c252ea.esm.js} +2 -2
  97. package/dist/{ServerResponse-b63b7192.cjs.dev.js → ServerResponse-9af42ecb.cjs.dev.js} +2 -2
  98. package/dist/{ServerResponse-eae85b08.cjs.prod.js → ServerResponse-db87bde2.cjs.prod.js} +2 -2
  99. package/dist/{body-33521da5.cjs.prod.js → body-95276637.cjs.prod.js} +3 -3
  100. package/dist/{body-c7d7a944.cjs.dev.js → body-cea7c1c9.cjs.dev.js} +3 -3
  101. package/dist/{body-20d78ec1.esm.js → body-db8cfb3d.esm.js} +1 -1
  102. package/dist/{clientRequest-3e72ec54.cjs.prod.js → clientRequest-539df396.cjs.prod.js} +1 -1
  103. package/dist/{clientRequest-1e9e0b0d.esm.js → clientRequest-6121a7f6.esm.js} +1 -1
  104. package/dist/{clientRequest-423fd562.cjs.dev.js → clientRequest-dae0c34e.cjs.dev.js} +1 -1
  105. package/dist/declarations/src/Http/App.d.ts +28 -1
  106. package/dist/declarations/src/Http/App.d.ts.map +1 -1
  107. package/dist/declarations/src/Http/Middleware.d.ts +0 -5
  108. package/dist/declarations/src/Http/Middleware.d.ts.map +1 -1
  109. package/dist/declarations/src/index.d.ts.map +1 -1
  110. package/dist/effect-platform.cjs.dev.js +49 -68
  111. package/dist/effect-platform.cjs.prod.js +49 -68
  112. package/dist/effect-platform.esm.js +20 -58
  113. package/package.json +8 -5
  114. package/src/Http/App.ts +76 -3
  115. package/src/Http/Middleware.ts +0 -6
  116. package/src/index.ts +10 -10
  117. package/src/internal/http/middleware.ts +21 -19
  118. package/src/internal/http/router.ts +1 -1
  119. package/src/internal/http/serverResponse.ts +1 -1
  120. package/dist/App-0916639a.cjs.prod.js +0 -7
  121. package/dist/App-44aa3275.cjs.dev.js +0 -7
  122. package/dist/App-687366d8.esm.js +0 -5
  123. package/dist/Command-032c414c.cjs.dev.js +0 -446
  124. package/dist/Command-25ef5e94.cjs.prod.js +0 -446
  125. package/dist/Command-d8ab0c8d.esm.js +0 -403
  126. package/dist/CommandExecutor-158ea1d3.cjs.dev.js +0 -87
  127. package/dist/CommandExecutor-5807b66b.esm.js +0 -80
  128. package/dist/CommandExecutor-7fcae408.cjs.prod.js +0 -87
  129. package/dist/Effectify-2d8c3af9.cjs.dev.js +0 -66
  130. package/dist/Effectify-38757ba5.cjs.prod.js +0 -66
  131. package/dist/Effectify-e5a9d266.esm.js +0 -43
  132. package/dist/Error-09496a70.cjs.dev.js +0 -100
  133. package/dist/Error-2c4e6ce2.cjs.prod.js +0 -100
  134. package/dist/Error-3099667c.esm.js +0 -75
  135. package/dist/FileSystem-3d439a05.cjs.prod.js +0 -308
  136. package/dist/FileSystem-4c7daaf0.cjs.dev.js +0 -308
  137. package/dist/FileSystem-7e31dccd.esm.js +0 -271
  138. package/dist/HttpClient-44d9df26.cjs.prod.js +0 -26
  139. package/dist/HttpClient-5179b5b7.esm.js +0 -24
  140. package/dist/HttpClient-6782fcab.cjs.dev.js +0 -26
  141. package/dist/HttpServer-16159c3a.cjs.dev.js +0 -32
  142. package/dist/HttpServer-50f8df76.esm.js +0 -30
  143. package/dist/HttpServer-93c0fbb3.cjs.prod.js +0 -32
  144. package/dist/KeyValueStore-2f9a70bf.esm.js +0 -210
  145. package/dist/KeyValueStore-f6c5b981.cjs.prod.js +0 -244
  146. package/dist/KeyValueStore-f9c93610.cjs.dev.js +0 -244
  147. package/dist/Path-3574641f.cjs.prod.js +0 -154
  148. package/dist/Path-46f84ba7.esm.js +0 -128
  149. package/dist/Path-7ba7e370.cjs.dev.js +0 -154
  150. package/dist/Runtime-1edd577a.cjs.dev.js +0 -55
  151. package/dist/Runtime-515efccf.cjs.prod.js +0 -55
  152. package/dist/Runtime-7265fb98.esm.js +0 -31
  153. /package/dist/{clientResponse-47df36b8.esm.js → clientResponse-0ace0007.esm.js} +0 -0
  154. /package/dist/{clientResponse-2e4c45a9.cjs.dev.js → clientResponse-43bb73b9.cjs.dev.js} +0 -0
  155. /package/dist/{clientResponse-4d53f425.cjs.prod.js → clientResponse-82dae5d8.cjs.prod.js} +0 -0
@@ -1,244 +0,0 @@
1
- 'use strict';
2
-
3
- var Schema = require('@effect/schema/Schema');
4
- var Context = require('effect/Context');
5
- var Effect = require('effect/Effect');
6
- var Function = require('effect/Function');
7
- var Layer = require('effect/Layer');
8
- var Option = require('effect/Option');
9
- var FileSystem_dist_effectPlatformFileSystem = require('./FileSystem-4c7daaf0.cjs.dev.js');
10
- var Path_dist_effectPlatformPath = require('./Path-7ba7e370.cjs.dev.js');
11
-
12
- function _interopNamespace(e) {
13
- if (e && e.__esModule) return e;
14
- var n = Object.create(null);
15
- if (e) {
16
- Object.keys(e).forEach(function (k) {
17
- if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- }
26
- n["default"] = e;
27
- return Object.freeze(n);
28
- }
29
-
30
- var Schema__namespace = /*#__PURE__*/_interopNamespace(Schema);
31
- var Context__namespace = /*#__PURE__*/_interopNamespace(Context);
32
- var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
33
- var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
34
- var Option__namespace = /*#__PURE__*/_interopNamespace(Option);
35
-
36
- /** @internal */
37
- const TypeId$1 = /*#__PURE__*/Symbol.for("@effect/platform/KeyValueStore");
38
-
39
- /** @internal */
40
- const keyValueStoreTag = /*#__PURE__*/Context__namespace.Tag(TypeId$1);
41
-
42
- /** @internal */
43
- const make$1 = impl => keyValueStoreTag.of({
44
- [TypeId$1]: TypeId$1,
45
- has: key => Effect__namespace.map(impl.get(key), Option__namespace.isSome),
46
- isEmpty: Effect__namespace.map(impl.size, size => size === 0),
47
- modify: (key, f) => Effect__namespace.flatMap(impl.get(key), o => {
48
- if (Option__namespace.isNone(o)) {
49
- return Effect__namespace.succeedNone;
50
- }
51
- const newValue = f(o.value);
52
- return Effect__namespace.as(impl.set(key, newValue), Option__namespace.some(newValue));
53
- }),
54
- forSchema(schema) {
55
- return makeSchemaStore(this, schema);
56
- },
57
- ...impl
58
- });
59
-
60
- /** @internal */
61
- const prefix$1 = /*#__PURE__*/Function.dual(2, (self, prefix) => ({
62
- ...self,
63
- get: key => self.get(`${prefix}${key}`),
64
- set: (key, value) => self.set(`${prefix}${key}`, value),
65
- remove: key => self.remove(`${prefix}${key}`),
66
- has: key => self.has(`${prefix}${key}`),
67
- modify: (key, f) => self.modify(`${prefix}${key}`, f)
68
- }));
69
-
70
- /** @internal */
71
- const SchemaStoreTypeId$1 = /*#__PURE__*/Symbol.for("@effect/platform/KeyValueStore/SchemaStore");
72
-
73
- /** @internal */
74
- const makeSchemaStore = (store, schema) => {
75
- const jsonSchema = Schema__namespace.compose(Schema__namespace.ParseJson, schema);
76
- const parse = Schema__namespace.parse(jsonSchema);
77
- const encode = Schema__namespace.encode(jsonSchema);
78
- const get = key => Effect__namespace.flatMap(store.get(key), Option__namespace.match({
79
- onNone: () => Effect__namespace.succeedNone,
80
- onSome: value => Effect__namespace.asSome(parse(value))
81
- }));
82
- const set = (key, value) => Effect__namespace.flatMap(encode(value), json => store.set(key, json));
83
- const modify = (key, f) => Effect__namespace.flatMap(get(key), o => {
84
- if (Option__namespace.isNone(o)) {
85
- return Effect__namespace.succeedNone;
86
- }
87
- const newValue = f(o.value);
88
- return Effect__namespace.as(set(key, newValue), Option__namespace.some(newValue));
89
- });
90
- return {
91
- [SchemaStoreTypeId$1]: SchemaStoreTypeId$1,
92
- get,
93
- set,
94
- modify,
95
- remove: store.remove,
96
- clear: store.clear,
97
- size: store.size,
98
- has: store.has,
99
- isEmpty: store.isEmpty
100
- };
101
- };
102
-
103
- /** @internal */
104
- const layerMemory$1 = /*#__PURE__*/Layer__namespace.sync(keyValueStoreTag, () => {
105
- const store = new Map();
106
- return make$1({
107
- get: key => Effect__namespace.sync(() => Option__namespace.fromNullable(store.get(key))),
108
- set: (key, value) => Effect__namespace.sync(() => store.set(key, value)),
109
- remove: key => Effect__namespace.sync(() => store.delete(key)),
110
- clear: Effect__namespace.sync(() => store.clear()),
111
- size: Effect__namespace.sync(() => store.size)
112
- });
113
- });
114
-
115
- /** @internal */
116
- const layerFileSystem$1 = directory => Layer__namespace.effect(keyValueStoreTag, Effect__namespace.gen(function* (_) {
117
- const fs = yield* _(FileSystem_dist_effectPlatformFileSystem.FileSystem$1);
118
- const path = yield* _(Path_dist_effectPlatformPath.Path$1);
119
- const keyPath = key => path.join(directory, encodeURIComponent(key));
120
- if (!(yield* _(fs.exists(directory)))) {
121
- yield* _(fs.makeDirectory(directory, {
122
- recursive: true
123
- }));
124
- }
125
- return make$1({
126
- get: key => Function.pipe(Effect__namespace.map(fs.readFileString(keyPath(key)), Option__namespace.some), Effect__namespace.catchTag("SystemError", sysError => sysError.reason === "NotFound" ? Effect__namespace.succeed(Option__namespace.none()) : Effect__namespace.fail(sysError))),
127
- set: (key, value) => fs.writeFileString(keyPath(key), value),
128
- remove: key => fs.remove(keyPath(key)),
129
- has: key => fs.exists(keyPath(key)),
130
- clear: Effect__namespace.zipRight(fs.remove(directory, {
131
- recursive: true
132
- }), fs.makeDirectory(directory, {
133
- recursive: true
134
- })),
135
- size: Effect__namespace.map(fs.readDirectory(directory), files => files.length)
136
- });
137
- }));
138
-
139
- /** @internal */
140
- const layerSchema$1 = (schema, tagIdentifier) => {
141
- const tag = Context__namespace.Tag(tagIdentifier);
142
- const layer = Layer__namespace.effect(tag, Effect__namespace.map(keyValueStoreTag, store => store.forSchema(schema)));
143
- return {
144
- tag,
145
- layer
146
- };
147
- };
148
-
149
- /**
150
- * @since 1.0.0
151
- */
152
- /**
153
- * @since 1.0.0
154
- * @category type id
155
- */
156
- const TypeId = TypeId$1;
157
-
158
- /**
159
- * @since 1.0.0
160
- * @category type id
161
- */
162
-
163
- /**
164
- * @since 1.0.0
165
- * @category models
166
- */
167
-
168
- /**
169
- * @since 1.0.0
170
- */
171
-
172
- /**
173
- * @since 1.0.0
174
- * @category tags
175
- */
176
- const KeyValueStore = keyValueStoreTag;
177
-
178
- /**
179
- * @since 1.0.0
180
- * @category constructors
181
- */
182
- const make = make$1;
183
-
184
- /**
185
- * @since 1.0.0
186
- * @category combinators
187
- */
188
- const prefix = prefix$1;
189
-
190
- /**
191
- * @since 1.0.0
192
- * @category layers
193
- */
194
- const layerMemory = layerMemory$1;
195
-
196
- /**
197
- * @since 1.0.0
198
- * @category layers
199
- */
200
- const layerFileSystem = layerFileSystem$1;
201
-
202
- /**
203
- * @since 1.0.0
204
- * @category type id
205
- */
206
- const SchemaStoreTypeId = SchemaStoreTypeId$1;
207
-
208
- /**
209
- * @since 1.0.0
210
- * @category type id
211
- */
212
-
213
- /**
214
- * @since 1.0.0
215
- * @category models
216
- */
217
-
218
- /**
219
- * @since 1.0.0
220
- * @category layers
221
- */
222
- const layerSchema = layerSchema$1;
223
-
224
- var KeyValueStore$1 = /*#__PURE__*/Object.freeze({
225
- __proto__: null,
226
- TypeId: TypeId,
227
- KeyValueStore: KeyValueStore,
228
- make: make,
229
- prefix: prefix,
230
- layerMemory: layerMemory,
231
- layerFileSystem: layerFileSystem,
232
- SchemaStoreTypeId: SchemaStoreTypeId,
233
- layerSchema: layerSchema
234
- });
235
-
236
- exports.KeyValueStore = KeyValueStore$1;
237
- exports.KeyValueStore$1 = KeyValueStore;
238
- exports.SchemaStoreTypeId = SchemaStoreTypeId;
239
- exports.TypeId = TypeId;
240
- exports.layerFileSystem = layerFileSystem;
241
- exports.layerMemory = layerMemory;
242
- exports.layerSchema = layerSchema;
243
- exports.make = make;
244
- exports.prefix = prefix;
@@ -1,154 +0,0 @@
1
- 'use strict';
2
-
3
- var Context = require('effect/Context');
4
- var Effect = require('effect/Effect');
5
- var Function = require('effect/Function');
6
- var Layer = require('effect/Layer');
7
- var PathB = require('path-browserify');
8
- var Error_dist_effectPlatformError = require('./Error-2c4e6ce2.cjs.prod.js');
9
-
10
- function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n["default"] = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
29
- var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
30
- var PathB__namespace = /*#__PURE__*/_interopNamespace(PathB);
31
-
32
- /** @internal */
33
- const Path$2 = /*#__PURE__*/Context.Tag("@effect/platform/Path");
34
-
35
- /** @internal */
36
- const layer$1 = /*#__PURE__*/Layer__namespace.succeed(Path$2, /*#__PURE__*/Path$2.of({
37
- ...PathB__namespace,
38
- fromFileUrl,
39
- toFileUrl,
40
- toNamespacedPath: Function.identity
41
- }));
42
-
43
- /**
44
- * The following functions are adapted from the Node.js source code:
45
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js
46
- *
47
- * The following license applies to these functions:
48
- * - MIT
49
- */
50
-
51
- function fromFileUrl(url) {
52
- if (url.protocol !== "file:") {
53
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
54
- module: "Path",
55
- method: "fromFileUrl",
56
- message: "URL must be of scheme file"
57
- }));
58
- } else if (url.hostname !== "") {
59
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
60
- module: "Path",
61
- method: "fromFileUrl",
62
- message: "Invalid file URL host"
63
- }));
64
- }
65
- const pathname = url.pathname;
66
- for (let n = 0; n < pathname.length; n++) {
67
- if (pathname[n] === "%") {
68
- const third = pathname.codePointAt(n + 2) | 0x20;
69
- if (pathname[n + 1] === "2" && third === 102) {
70
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
71
- module: "Path",
72
- method: "fromFileUrl",
73
- message: "must not include encoded / characters"
74
- }));
75
- }
76
- }
77
- }
78
- return Effect__namespace.succeed(decodeURIComponent(pathname));
79
- }
80
- const CHAR_FORWARD_SLASH = 47;
81
- function toFileUrl(filepath) {
82
- const outURL = new URL("file://");
83
- let resolved = PathB__namespace.resolve(filepath);
84
- // path.resolve strips trailing slashes so we must add them back
85
- const filePathLast = filepath.charCodeAt(filepath.length - 1);
86
- if (filePathLast === CHAR_FORWARD_SLASH && resolved[resolved.length - 1] !== "/") {
87
- resolved += "/";
88
- }
89
- outURL.pathname = encodePathChars(resolved);
90
- return Effect__namespace.succeed(outURL);
91
- }
92
- const percentRegEx = /%/g;
93
- const backslashRegEx = /\\/g;
94
- const newlineRegEx = /\n/g;
95
- const carriageReturnRegEx = /\r/g;
96
- const tabRegEx = /\t/g;
97
- function encodePathChars(filepath) {
98
- if (filepath.includes("%")) {
99
- filepath = filepath.replace(percentRegEx, "%25");
100
- }
101
- if (filepath.includes("\\")) {
102
- filepath = filepath.replace(backslashRegEx, "%5C");
103
- }
104
- if (filepath.includes("\n")) {
105
- filepath = filepath.replace(newlineRegEx, "%0A");
106
- }
107
- if (filepath.includes("\r")) {
108
- filepath = filepath.replace(carriageReturnRegEx, "%0D");
109
- }
110
- if (filepath.includes("\t")) {
111
- filepath = filepath.replace(tabRegEx, "%09");
112
- }
113
- return filepath;
114
- }
115
-
116
- /**
117
- * @since 1.0.0
118
- */
119
-
120
- /**
121
- * @since 1.0.0
122
- * @category model
123
- */
124
-
125
- /**
126
- * @since 1.0.0
127
- */
128
-
129
- /**
130
- * @since 1.0.0
131
- * @category tag
132
- */
133
- const Path = Path$2;
134
-
135
- /**
136
- * An implementation of the Path interface that can be used in all environments
137
- * (including browsers).
138
- *
139
- * It uses the POSIX standard for paths.
140
- *
141
- * @since 1.0.0
142
- * @category layer
143
- */
144
- const layer = layer$1;
145
-
146
- var Path$1 = /*#__PURE__*/Object.freeze({
147
- __proto__: null,
148
- Path: Path,
149
- layer: layer
150
- });
151
-
152
- exports.Path = Path$1;
153
- exports.Path$1 = Path;
154
- exports.layer = layer;
@@ -1,128 +0,0 @@
1
- import { Tag } from 'effect/Context';
2
- import * as Effect from 'effect/Effect';
3
- import { identity } from 'effect/Function';
4
- import * as Layer from 'effect/Layer';
5
- import * as PathB from 'path-browserify';
6
- import { B as BadArgument } from './Error-3099667c.esm.js';
7
-
8
- /** @internal */
9
- const Path$2 = /*#__PURE__*/Tag("@effect/platform/Path");
10
-
11
- /** @internal */
12
- const layer$1 = /*#__PURE__*/Layer.succeed(Path$2, /*#__PURE__*/Path$2.of({
13
- ...PathB,
14
- fromFileUrl,
15
- toFileUrl,
16
- toNamespacedPath: identity
17
- }));
18
-
19
- /**
20
- * The following functions are adapted from the Node.js source code:
21
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js
22
- *
23
- * The following license applies to these functions:
24
- * - MIT
25
- */
26
-
27
- function fromFileUrl(url) {
28
- if (url.protocol !== "file:") {
29
- return Effect.fail(BadArgument({
30
- module: "Path",
31
- method: "fromFileUrl",
32
- message: "URL must be of scheme file"
33
- }));
34
- } else if (url.hostname !== "") {
35
- return Effect.fail(BadArgument({
36
- module: "Path",
37
- method: "fromFileUrl",
38
- message: "Invalid file URL host"
39
- }));
40
- }
41
- const pathname = url.pathname;
42
- for (let n = 0; n < pathname.length; n++) {
43
- if (pathname[n] === "%") {
44
- const third = pathname.codePointAt(n + 2) | 0x20;
45
- if (pathname[n + 1] === "2" && third === 102) {
46
- return Effect.fail(BadArgument({
47
- module: "Path",
48
- method: "fromFileUrl",
49
- message: "must not include encoded / characters"
50
- }));
51
- }
52
- }
53
- }
54
- return Effect.succeed(decodeURIComponent(pathname));
55
- }
56
- const CHAR_FORWARD_SLASH = 47;
57
- function toFileUrl(filepath) {
58
- const outURL = new URL("file://");
59
- let resolved = PathB.resolve(filepath);
60
- // path.resolve strips trailing slashes so we must add them back
61
- const filePathLast = filepath.charCodeAt(filepath.length - 1);
62
- if (filePathLast === CHAR_FORWARD_SLASH && resolved[resolved.length - 1] !== "/") {
63
- resolved += "/";
64
- }
65
- outURL.pathname = encodePathChars(resolved);
66
- return Effect.succeed(outURL);
67
- }
68
- const percentRegEx = /%/g;
69
- const backslashRegEx = /\\/g;
70
- const newlineRegEx = /\n/g;
71
- const carriageReturnRegEx = /\r/g;
72
- const tabRegEx = /\t/g;
73
- function encodePathChars(filepath) {
74
- if (filepath.includes("%")) {
75
- filepath = filepath.replace(percentRegEx, "%25");
76
- }
77
- if (filepath.includes("\\")) {
78
- filepath = filepath.replace(backslashRegEx, "%5C");
79
- }
80
- if (filepath.includes("\n")) {
81
- filepath = filepath.replace(newlineRegEx, "%0A");
82
- }
83
- if (filepath.includes("\r")) {
84
- filepath = filepath.replace(carriageReturnRegEx, "%0D");
85
- }
86
- if (filepath.includes("\t")) {
87
- filepath = filepath.replace(tabRegEx, "%09");
88
- }
89
- return filepath;
90
- }
91
-
92
- /**
93
- * @since 1.0.0
94
- */
95
-
96
- /**
97
- * @since 1.0.0
98
- * @category model
99
- */
100
-
101
- /**
102
- * @since 1.0.0
103
- */
104
-
105
- /**
106
- * @since 1.0.0
107
- * @category tag
108
- */
109
- const Path = Path$2;
110
-
111
- /**
112
- * An implementation of the Path interface that can be used in all environments
113
- * (including browsers).
114
- *
115
- * It uses the POSIX standard for paths.
116
- *
117
- * @since 1.0.0
118
- * @category layer
119
- */
120
- const layer = layer$1;
121
-
122
- var Path$1 = /*#__PURE__*/Object.freeze({
123
- __proto__: null,
124
- Path: Path,
125
- layer: layer
126
- });
127
-
128
- export { Path$1 as P, Path as a, layer as l };
@@ -1,154 +0,0 @@
1
- 'use strict';
2
-
3
- var Context = require('effect/Context');
4
- var Effect = require('effect/Effect');
5
- var Function = require('effect/Function');
6
- var Layer = require('effect/Layer');
7
- var PathB = require('path-browserify');
8
- var Error_dist_effectPlatformError = require('./Error-09496a70.cjs.dev.js');
9
-
10
- function _interopNamespace(e) {
11
- if (e && e.__esModule) return e;
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n["default"] = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var Effect__namespace = /*#__PURE__*/_interopNamespace(Effect);
29
- var Layer__namespace = /*#__PURE__*/_interopNamespace(Layer);
30
- var PathB__namespace = /*#__PURE__*/_interopNamespace(PathB);
31
-
32
- /** @internal */
33
- const Path$2 = /*#__PURE__*/Context.Tag("@effect/platform/Path");
34
-
35
- /** @internal */
36
- const layer$1 = /*#__PURE__*/Layer__namespace.succeed(Path$2, /*#__PURE__*/Path$2.of({
37
- ...PathB__namespace,
38
- fromFileUrl,
39
- toFileUrl,
40
- toNamespacedPath: Function.identity
41
- }));
42
-
43
- /**
44
- * The following functions are adapted from the Node.js source code:
45
- * https://github.com/nodejs/node/blob/main/lib/internal/url.js
46
- *
47
- * The following license applies to these functions:
48
- * - MIT
49
- */
50
-
51
- function fromFileUrl(url) {
52
- if (url.protocol !== "file:") {
53
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
54
- module: "Path",
55
- method: "fromFileUrl",
56
- message: "URL must be of scheme file"
57
- }));
58
- } else if (url.hostname !== "") {
59
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
60
- module: "Path",
61
- method: "fromFileUrl",
62
- message: "Invalid file URL host"
63
- }));
64
- }
65
- const pathname = url.pathname;
66
- for (let n = 0; n < pathname.length; n++) {
67
- if (pathname[n] === "%") {
68
- const third = pathname.codePointAt(n + 2) | 0x20;
69
- if (pathname[n + 1] === "2" && third === 102) {
70
- return Effect__namespace.fail(Error_dist_effectPlatformError.BadArgument({
71
- module: "Path",
72
- method: "fromFileUrl",
73
- message: "must not include encoded / characters"
74
- }));
75
- }
76
- }
77
- }
78
- return Effect__namespace.succeed(decodeURIComponent(pathname));
79
- }
80
- const CHAR_FORWARD_SLASH = 47;
81
- function toFileUrl(filepath) {
82
- const outURL = new URL("file://");
83
- let resolved = PathB__namespace.resolve(filepath);
84
- // path.resolve strips trailing slashes so we must add them back
85
- const filePathLast = filepath.charCodeAt(filepath.length - 1);
86
- if (filePathLast === CHAR_FORWARD_SLASH && resolved[resolved.length - 1] !== "/") {
87
- resolved += "/";
88
- }
89
- outURL.pathname = encodePathChars(resolved);
90
- return Effect__namespace.succeed(outURL);
91
- }
92
- const percentRegEx = /%/g;
93
- const backslashRegEx = /\\/g;
94
- const newlineRegEx = /\n/g;
95
- const carriageReturnRegEx = /\r/g;
96
- const tabRegEx = /\t/g;
97
- function encodePathChars(filepath) {
98
- if (filepath.includes("%")) {
99
- filepath = filepath.replace(percentRegEx, "%25");
100
- }
101
- if (filepath.includes("\\")) {
102
- filepath = filepath.replace(backslashRegEx, "%5C");
103
- }
104
- if (filepath.includes("\n")) {
105
- filepath = filepath.replace(newlineRegEx, "%0A");
106
- }
107
- if (filepath.includes("\r")) {
108
- filepath = filepath.replace(carriageReturnRegEx, "%0D");
109
- }
110
- if (filepath.includes("\t")) {
111
- filepath = filepath.replace(tabRegEx, "%09");
112
- }
113
- return filepath;
114
- }
115
-
116
- /**
117
- * @since 1.0.0
118
- */
119
-
120
- /**
121
- * @since 1.0.0
122
- * @category model
123
- */
124
-
125
- /**
126
- * @since 1.0.0
127
- */
128
-
129
- /**
130
- * @since 1.0.0
131
- * @category tag
132
- */
133
- const Path = Path$2;
134
-
135
- /**
136
- * An implementation of the Path interface that can be used in all environments
137
- * (including browsers).
138
- *
139
- * It uses the POSIX standard for paths.
140
- *
141
- * @since 1.0.0
142
- * @category layer
143
- */
144
- const layer = layer$1;
145
-
146
- var Path$1 = /*#__PURE__*/Object.freeze({
147
- __proto__: null,
148
- Path: Path,
149
- layer: layer
150
- });
151
-
152
- exports.Path = Path$1;
153
- exports.Path$1 = Path;
154
- exports.layer = layer;