jupyter-ijavascript-utils 1.21.0 → 1.21.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 +1 -1
- package/src/describe.js +1 -1
- package/src/format.js +8 -0
package/package.json
CHANGED
package/src/describe.js
CHANGED
|
@@ -167,7 +167,7 @@ class BooleanDescription extends SeriesDescription {
|
|
|
167
167
|
* @returns {Boolean} - true if the value matches
|
|
168
168
|
*/
|
|
169
169
|
static matchesType(value) {
|
|
170
|
-
return FormatUtils.
|
|
170
|
+
return FormatUtils.isBoolean(value);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
check(value) {
|
package/src/format.js
CHANGED
|
@@ -869,6 +869,14 @@ module.exports.parseBoolean = function parseBoolean(val) {
|
|
|
869
869
|
|| val === 'true';
|
|
870
870
|
};
|
|
871
871
|
|
|
872
|
+
module.exports.isBoolean = function isBoolean(val) {
|
|
873
|
+
return val === true || val === false
|
|
874
|
+
|| val === 1 || val === 0
|
|
875
|
+
|| val === 'TRUE' || val === 'FALSE'
|
|
876
|
+
|| val === 'True' || val === 'False'
|
|
877
|
+
|| val === 'true' || val === 'false';
|
|
878
|
+
};
|
|
879
|
+
|
|
872
880
|
/**
|
|
873
881
|
* Narrows to only fromLine - toLine (inclusive) within a string.
|
|
874
882
|
*
|