keq 1.8.7 → 1.8.8

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/.nycrc.yml CHANGED
@@ -1,10 +1,12 @@
1
- extends: '@istanbuljs/nyc-config-typescript'
2
1
  all: true
3
2
  check-coverage: false
4
3
  include:
5
- - src/**/*.ts
4
+ - lib/src
5
+ - src
6
6
  exclude:
7
7
  - node_modules
8
+ - "**/*.d.ts"
9
+ sourceMap: true
8
10
  extension:
9
11
  - .ts
10
12
  - .js
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.8.8](https://www.github.com/keq-request/keq/compare/v1.8.7...v1.8.8) (2022-06-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * not working when response include null ([e98ea2b](https://www.github.com/keq-request/keq/commit/e98ea2bb831b8e94f531342bb53e0bb1e313c44b))
11
+
5
12
  ### [1.8.7](https://www.github.com/keq-request/keq/compare/v1.8.6...v1.8.7) (2022-06-22)
6
13
 
7
14
 
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../lib",
5
+ "module": "commonjs",
6
+ "target": "es6",
7
+ "sourceMap": true,
8
+ },
9
+ "include": [
10
+ "../src/**/*.ts",
11
+ "../tests/**/*.ts"
12
+ ],
13
+ }
14
+
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class FileExpectedException extends Exception {
5
+ constructor() {
6
+ super('File/Blob (Browser) or Buffer (NodeJS) expected')
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class OverwriteArrayBodyException extends Exception {
5
+ constructor() {
6
+ super('Cannot merge or overwrite body. Because it has been set as an array.')
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class UnknownContentTypeException extends Exception {
5
+ constructor() {
6
+ super('Unknow Content-Type')
7
+ }
8
+ }
@@ -6,6 +6,9 @@ export function clone(obj) {
6
6
  if (Array.isArray(obj)) {
7
7
  return obj.map(item => isBlob(item) ? item : clone(item));
8
8
  }
9
+ else if (obj === null) {
10
+ return null;
11
+ }
9
12
  else if (typeof obj === 'object') {
10
13
  const entries = Object.entries(obj)
11
14
  .map(([key, value]) => ([
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class FileExpectedException extends Exception {
5
+ constructor() {
6
+ super('File/Blob (Browser) or Buffer (NodeJS) expected')
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class OverwriteArrayBodyException extends Exception {
5
+ constructor() {
6
+ super('Cannot merge or overwrite body. Because it has been set as an array.')
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception'
2
+
3
+
4
+ export class UnknownContentTypeException extends Exception {
5
+ constructor() {
6
+ super('Unknow Content-Type')
7
+ }
8
+ }
@@ -21,6 +21,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
21
21
  if (Array.isArray(obj)) {
22
22
  return obj.map(item => (0, is_1.isBlob)(item) ? item : clone(item));
23
23
  }
24
+ else if (obj === null) {
25
+ return null;
26
+ }
24
27
  else if (typeof obj === 'object') {
25
28
  const entries = Object.entries(obj)
26
29
  .map(([key, value]) => ([
package/package.json CHANGED
@@ -1,32 +1,37 @@
1
1
  {
2
2
  "name": "keq",
3
- "main": "lib/index.js",
4
- "module": "es/index.js",
5
- "version": "1.8.7",
3
+ "main": "lib/src/index.js",
4
+ "module": "es/src/index.js",
5
+ "types": "lib/src/index.d.ts",
6
+ "version": "1.8.8",
6
7
  "license": "MIT",
7
- "types": "lib/index.d.ts",
8
8
  "scripts": {
9
- "test": "ava",
9
+ "test": "npm run clean && npm run build:test && nyc ava",
10
10
  "test:debug": "ava --verbose",
11
11
  "test:update": "ava -u",
12
- "report": "nyc --reporter=html --reporter=text-summary --skip-full ava",
13
- "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
12
+ "report": "npm run build:test && nyc --reporter=html --reporter=text-summary --skip-full ava",
13
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
14
14
  "ci": "git-cz",
15
15
  "ca": "git add -A && git-cz -av",
16
16
  "release": "standard-version",
17
17
  "release:alpha": "standard-version --prerelease alpha",
18
18
  "release:first": "standard-version --first-release",
19
19
  "prepublishOnly": "npm run build",
20
- "clean": "rm -rf ./lib/*",
20
+ "clean": "rm -rf ./lib/* && rm -rf ./es/*",
21
21
  "prebuild": "npm run clean",
22
- "build:es": "ttsc -p build/tsconfig.es.json",
23
- "build:lib": "ttsc -p build/tsconfig.lib.json",
22
+ "build:es": "ttsc -p build/tsconfig.es.json && npm run copyfile:es",
23
+ "build:lib": "ttsc -p build/tsconfig.lib.json && npm run copyfile:lib",
24
+ "build:test": "ttsc -p build/tsconfig.test.json && npm run copyfile:lib",
24
25
  "build": "npm run build:lib && npm run build:es",
26
+ "prewatch": "npm run copyfile:lib",
25
27
  "watch": "NODE_ENV=development ttsc -p build/tsconfig.lib.json -w",
26
- "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --fix --quiet",
28
+ "copyfile:es": "copyfiles -u 1 \"src/**/*.!(ts)\" es/src",
29
+ "copyfile:lib": "copyfiles -u 1 \"src/**/*.!(ts)\" lib/src",
30
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --fix",
27
31
  "prepare": "is-ci || husky install"
28
32
  },
29
33
  "devDependencies": {
34
+ "@ava/typescript": "^3.0.1",
30
35
  "@commitlint/cli": "^17.0.2",
31
36
  "@commitlint/config-conventional": "^17.0.2",
32
37
  "@istanbuljs/nyc-config-typescript": "^1.0.1",
@@ -36,6 +41,7 @@
36
41
  "ajv": "^8",
37
42
  "ava": "^4.2.0",
38
43
  "commitizen": "^4.2.4",
44
+ "copyfiles": "^2.4.1",
39
45
  "coveralls": "^3.1.0",
40
46
  "cz-conventional-changelog": "^3.3.0",
41
47
  "eslint": "7",
package/ava.config.mjs DELETED
@@ -1,5 +0,0 @@
1
- export default {
2
- files: ['tests/**/*.ts', '!tests/**/*.before-each.ts'],
3
- extensions: ['ts'],
4
- require: ['ts-node/register'],
5
- }
package/es/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src/index';
package/es/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './src/index';
package/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src/index'
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './src/index';
package/lib/index.js DELETED
@@ -1,27 +0,0 @@
1
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
- if (k2 === undefined) k2 = k;
3
- var desc = Object.getOwnPropertyDescriptor(m, k);
4
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
- desc = { enumerable: true, get: function() { return m[k]; } };
6
- }
7
- Object.defineProperty(o, k2, desc);
8
- }) : (function(o, m, k, k2) {
9
- if (k2 === undefined) k2 = k;
10
- o[k2] = m[k];
11
- }));
12
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
13
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
14
- };
15
- (function (factory) {
16
- if (typeof module === "object" && typeof module.exports === "object") {
17
- var v = factory(require, exports);
18
- if (v !== undefined) module.exports = v;
19
- }
20
- else if (typeof define === "function" && define.amd) {
21
- define(["require", "exports", "./src/index"], factory);
22
- }
23
- })(function (require, exports) {
24
- "use strict";
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- __exportStar(require("./src/index"), exports);
27
- });