qmwts 1.1.9 → 1.1.10

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.
@@ -1,6 +1,4 @@
1
1
  declare const _default: {
2
- isPrototypeObject(o: any): boolean;
3
- isPrototypeArray(o: any): boolean;
4
2
  isObject(o: any): boolean;
5
3
  isArray(o: any): boolean;
6
4
  parseObject<T>(o: any): T;
@@ -1,39 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var prototype_utils_1 = require("./prototype-utils");
3
4
  exports.default = {
4
- isPrototypeObject: function (o) {
5
- return Object.prototype.toString.call(o) === '[object Object]';
6
- },
7
- isPrototypeArray: function (o) {
8
- return Object.prototype.toString.call(o) === '[object Array]';
9
- },
10
5
  isObject: function (o) {
11
- if (this.isPrototypeObject(o))
6
+ if (prototype_utils_1.default.isObject(o))
12
7
  return true;
13
8
  try {
14
- return this.isPrototypeObject(JSON.parse(o));
9
+ return prototype_utils_1.default.isObject(JSON.parse(o));
15
10
  }
16
11
  catch (e) {
17
12
  return false;
18
13
  }
19
14
  },
20
15
  isArray: function (o) {
21
- if (this.isPrototypeArray(o))
16
+ if (prototype_utils_1.default.isArray(o))
22
17
  return true;
23
18
  try {
24
- return this.isPrototypeArray(JSON.parse(o));
19
+ return prototype_utils_1.default.isArray(JSON.parse(o));
25
20
  }
26
21
  catch (e) {
27
22
  return false;
28
23
  }
29
24
  },
30
25
  parseObject: function (o) {
31
- if (this.isPrototypeObject(o))
26
+ if (prototype_utils_1.default.isObject(o))
32
27
  return o;
33
28
  return this.isObject(o) ? JSON.parse(o) : {};
34
29
  },
35
30
  parseArray: function (o) {
36
- if (this.isPrototypeArray(o))
31
+ if (prototype_utils_1.default.isArray(o))
37
32
  return o;
38
33
  return this.isArray(o) ? JSON.parse(o) : [];
39
34
  },
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ isObject(o: any): boolean;
3
+ isArray(o: any): boolean;
4
+ isFile(o: any): boolean;
5
+ isNumber(o: any): boolean;
6
+ isDate(o: any): boolean;
7
+ isFunction(o: any): boolean;
8
+ isBoolean(o: any): boolean;
9
+ isString(o: any): boolean;
10
+ };
11
+ export default _default;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ isObject: function (o) {
5
+ return Object.prototype.toString.call(o) === '[object Object]';
6
+ },
7
+ isArray: function (o) {
8
+ return Object.prototype.toString.call(o) === '[object Array]';
9
+ },
10
+ isFile: function (o) {
11
+ return Object.prototype.toString.call(o) === '[object File]';
12
+ },
13
+ isNumber: function (o) {
14
+ return Object.prototype.toString.call(o) === '[object Number]';
15
+ },
16
+ isDate: function (o) {
17
+ return Object.prototype.toString.call(o) === '[object Date]';
18
+ },
19
+ isFunction: function (o) {
20
+ return Object.prototype.toString.call(o) === '[object Function]';
21
+ },
22
+ isBoolean: function (o) {
23
+ return Object.prototype.toString.call(o) === '[object Boolean]';
24
+ },
25
+ isString: function (o) {
26
+ return Object.prototype.toString.call(o) === '[object String]';
27
+ },
28
+ };
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "qmwts",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "test": "jest",
10
- "publish": "npm publish"
9
+ "test": "jest"
11
10
  },
12
11
  "author": "qmw",
13
12
  "license": "ISC",