@esri/arcgis-rest-form-data 4.0.0-beta.1

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/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # `@esri/arcgis-rest-form-data`
2
+
3
+ This package exists to expose the `formdata-node` package in a consistent way for both Node JS 12.16+ and various bundlers with consistent TypeScript types based on the browser types.
4
+
5
+ The `package.json` contains fields for the following:
6
+
7
+ - `main` - `undefined`, Node JS should use the `exports` field and [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports).
8
+ - `module` - Exposes a ESM module that exposes `FormData`, `File` and `Blob` from the global object. Used by Rollup and Parcel v2.
9
+ - `browser` - Exposes a CJS module that exposes `FormData`, `File` and `Blob` from the global object. Used by Parcel v1 and Browserify.
10
+ - `exports` - exposes [conditional exports](https://nodejs.org/api/packages.html#packages_conditional_exports) config with the following conditions. Used by Webpack and [soon to be others](https://github.com/parcel-bundler/parcel/issues/4155#issuecomment-756457121):
11
+ - `module` - ESM module exposing browser globals.
12
+ - `browser` - CJS module exposing browser globals.
13
+ - `import` - ESM module exposing `formdata-node`.
14
+ - `require` - CJS module exposing `formdata-node`.
15
+ - `default` - ESM module exposing browser globals.
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ FormData: globalThis.FormData,
3
+ File: globalThis.File,
4
+ Blob: globalThis.Blob
5
+ };
@@ -0,0 +1,3 @@
1
+ export const FormData = globalThis.FormData;
2
+ export const File = globalThis.File;
3
+ export const Blob = globalThis.Blob;
@@ -0,0 +1,9 @@
1
+ declare const _FormData: typeof FormData;
2
+ declare const _File: typeof File;
3
+ declare const _Blob: typeof Blob;
4
+
5
+ declare module "@esri/arcgis-rest-form-data" {
6
+ export const FormData: typeof _FormData;
7
+ export const File: typeof _File;
8
+ export const Blob: typeof _Blob;
9
+ }
@@ -0,0 +1,7 @@
1
+ const NodeFormData = require("formdata-node");
2
+
3
+ module.exports = {
4
+ FormData: NodeFormData.FormData,
5
+ File: NodeFormData.File,
6
+ Blob: NodeFormData.Blob
7
+ };
@@ -0,0 +1,5 @@
1
+ import * as NodeFormData from "formdata-node";
2
+
3
+ export const FormData = NodeFormData.FormData;
4
+ export const File = NodeFormData.File;
5
+ export const Blob = NodeFormData.Blob;
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@esri/arcgis-rest-form-data",
3
+ "version": "4.0.0-beta.1",
4
+ "type": "commonjs",
5
+ "module": "browser-ponyfill.mjs",
6
+ "browser": "browser-ponyfill.js",
7
+ "exports": {
8
+ ".": {
9
+ "module": "./browser-ponyfill.mjs",
10
+ "browser": "./browser-ponyfill.js",
11
+ "import": "./node-ponyfill.mjs",
12
+ "require": "./node-ponyfill.js",
13
+ "default": "./browser-ponyfill.mjs"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
17
+ "types": "index.types.d.ts",
18
+ "dependencies": {
19
+ "formdata-node": "^4.1.0"
20
+ }
21
+ }