@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/dist/pico-js.browser.js +1 -1
- package/dist/pico-js.browser.js.map +1 -1
- package/dist/pico-js.esm.js +1 -1
- package/dist/pico-js.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/format/FormatParam.ts +1 -1
- package/src/utils/Cookie.ts +1 -1
- package/src/utils/Mixed.ts +21 -0
- package/types/utils/Mixed.d.ts +13 -0
package/package.json
CHANGED
|
@@ -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('&');
|
package/src/utils/Cookie.ts
CHANGED
package/src/utils/Mixed.ts
CHANGED
|
@@ -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
|
*
|
package/types/utils/Mixed.d.ts
CHANGED
|
@@ -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
|
*
|