@kizmann/pico-js 2.1.0 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -53,7 +53,7 @@ export class PicoFormatParam
53
53
  }
54
54
 
55
55
  let result = Arr.each(value, (v : any, k : any) => {
56
- return this.castParam(Mix.isArr(value) ? '' : k, v, key);
56
+ return this.castParam(Mix.isArr(value) && ! Mix.isObj(v) ? '' : k, v, key);
57
57
  });
58
58
 
59
59
  return result.join('&');
@@ -96,7 +96,7 @@ export class PicoCookie
96
96
  return Mix.bool(this.$cookie[key]);
97
97
  }
98
98
 
99
- if ( /^obj(ext)?$/.test(decode) ) {
99
+ if ( /^obj(ect)?$/.test(decode) ) {
100
100
  return For.parseOptions(this.$cookie[key]);
101
101
  }
102
102
 
@@ -43,6 +43,27 @@ export class PicoMixed
43
43
  return this.len(value) === 0;
44
44
  }
45
45
 
46
+ /**
47
+ * Check if the value is true
48
+ *
49
+ * @example Mix.isTrue('') // => false
50
+ * @example Mix.isTrue('foobar') // => true
51
+ * @example Mix.isTrue([]) // => false
52
+ * @example Mix.isTrue(['foobar']) // => true
53
+ * @example Mix.isTrue(false) // => false
54
+ *
55
+ * @param {any} value The value to test
56
+ * @returns {boolean} Returns true if value is true
57
+ */
58
+ static isTrue(value : any) : boolean
59
+ {
60
+ if ( this.isBool(value) ) {
61
+ return this.bool(value) === true;
62
+ }
63
+
64
+ return ! this.isEmpty(value);
65
+ }
66
+
46
67
  /**
47
68
  * Check if the value is null
48
69
  *
@@ -16,6 +16,19 @@ export declare class PicoMixed {
16
16
  * @returns {boolean} Returns true if value is not empty
17
17
  */
18
18
  static isEmpty(value: any): boolean;
19
+ /**
20
+ * Check if the value is true
21
+ *
22
+ * @example Mix.isTrue('') // => false
23
+ * @example Mix.isTrue('foobar') // => true
24
+ * @example Mix.isTrue([]) // => false
25
+ * @example Mix.isTrue(['foobar']) // => true
26
+ * @example Mix.isTrue(false) // => false
27
+ *
28
+ * @param {any} value The value to test
29
+ * @returns {boolean} Returns true if value is true
30
+ */
31
+ static isTrue(value: any): boolean;
19
32
  /**
20
33
  * Check if the value is null
21
34
  *