perimeterx-js-core 0.12.0 → 0.12.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.
@@ -5,7 +5,7 @@ var FormDataImpl = /** @class */ (function () {
5
5
  function FormDataImpl(data) {
6
6
  this.data = data !== null && data !== void 0 ? data : {};
7
7
  }
8
- FormDataImpl.prototype.append = function (name, value, fileName) {
8
+ FormDataImpl.prototype.append = function (name, value) {
9
9
  this.data[name] = (this.data[name] || []).concat(value);
10
10
  };
11
11
  FormDataImpl.prototype.delete = function (name) {
@@ -30,13 +30,10 @@ var FormDataImpl = /** @class */ (function () {
30
30
  FormDataImpl.prototype.has = function (name) {
31
31
  return this.get(name) !== null;
32
32
  };
33
- FormDataImpl.prototype.set = function (name, value, filename) {
33
+ FormDataImpl.prototype.set = function (name, value) {
34
34
  if (typeof value === 'string') {
35
35
  this.data[name] = [value];
36
36
  }
37
- else if (File) {
38
- this.data[name] = [new File([value], filename)];
39
- }
40
37
  };
41
38
  return FormDataImpl;
42
39
  }());
@@ -13,4 +13,4 @@ exports.PUSH_DATA_HMAC_HEADER_NAME = 'x-px-pushdata';
13
13
  exports.PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
14
14
  exports.EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
15
15
  exports.URL_REGEX = /^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/;
16
- exports.CORE_MODULE_VERSION = 'JS Core 0.12.0';
16
+ exports.CORE_MODULE_VERSION = 'JS Core 0.12.1';
@@ -3,7 +3,7 @@ export class FormDataImpl {
3
3
  constructor(data) {
4
4
  this.data = data ?? {};
5
5
  }
6
- append(name, value, fileName) {
6
+ append(name, value) {
7
7
  this.data[name] = (this.data[name] || []).concat(value);
8
8
  }
9
9
  delete(name) {
@@ -25,12 +25,9 @@ export class FormDataImpl {
25
25
  has(name) {
26
26
  return this.get(name) !== null;
27
27
  }
28
- set(name, value, filename) {
28
+ set(name, value) {
29
29
  if (typeof value === 'string') {
30
30
  this.data[name] = [value];
31
31
  }
32
- else if (File) {
33
- this.data[name] = [new File([value], filename)];
34
- }
35
32
  }
36
33
  }
@@ -10,4 +10,4 @@ export const PUSH_DATA_HMAC_HEADER_NAME = 'x-px-pushdata';
10
10
  export const PUSH_DATA_FEATURE_HEADER_NAME = 'x-px-feature';
11
11
  export const EMAIL_ADDRESS_REGEX = /^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,7}$/;
12
12
  export const URL_REGEX = /^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/;
13
- export const CORE_MODULE_VERSION = 'JS Core 0.12.0';
13
+ export const CORE_MODULE_VERSION = 'JS Core 0.12.1';
@@ -1,9 +1,3 @@
1
1
  export interface IFormData {
2
- append(name: string, value: string | Blob, fileName?: string): void;
3
- delete(name: string): void;
4
- get(name: string): FormDataEntryValue | null;
5
- getAll(name: string): FormDataEntryValue[];
6
- has(name: string): boolean;
7
- set(name: string, value: string | Blob, fileName?: string): void;
8
- forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: IFormData) => void, thisArg?: any): void;
2
+ get(name: string): string;
9
3
  }
@@ -1,12 +1,12 @@
1
1
  import { IFormData } from '../interfaces';
2
2
  export declare class FormDataImpl implements IFormData {
3
- protected data: Record<string, FormDataEntryValue[]>;
4
- constructor(data?: Record<string, FormDataEntryValue[]>);
5
- append(name: string, value: string, fileName?: string): void;
3
+ protected data: Record<string, string[]>;
4
+ constructor(data?: Record<string, string[]>);
5
+ append(name: string, value: string): void;
6
6
  delete(name: string): void;
7
- forEach(callbackfn: (value: string | FormDataEntryValue, key: string, parent: IFormData) => void, thisArg?: any): void;
8
- get(name: string): FormDataEntryValue | null;
9
- getAll(name: string): FormDataEntryValue[];
7
+ forEach(callbackfn: (value: string, key: string, parent: IFormData) => void, thisArg?: any): void;
8
+ get(name: string): string;
9
+ getAll(name: string): string[];
10
10
  has(name: string): boolean;
11
- set(name: string, value: string | Blob, filename?: string): void;
11
+ set(name: string, value: string): void;
12
12
  }
@@ -10,4 +10,4 @@ export declare const PUSH_DATA_HMAC_HEADER_NAME = "x-px-pushdata";
10
10
  export declare const PUSH_DATA_FEATURE_HEADER_NAME = "x-px-feature";
11
11
  export declare const EMAIL_ADDRESS_REGEX: RegExp;
12
12
  export declare const URL_REGEX: RegExp;
13
- export declare const CORE_MODULE_VERSION = "JS Core 0.12.0";
13
+ export declare const CORE_MODULE_VERSION = "JS Core 0.12.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perimeterx-js-core",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "typesVersions": {