@jdeighan/coffee-utils 7.0.26 → 7.0.27

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "7.0.26",
4
+ "version": "7.0.27",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -396,8 +396,20 @@ export replaceVars = (line, hVars={}, rx=/__(env\.)?([A-Za-z_]\w*)__/g) ->
396
396
 
397
397
  # ---------------------------------------------------------------------------
398
398
 
399
- export isIterable = (object) ->
399
+ export defined = (obj) ->
400
400
 
401
- if (object == undef) || (object == null)
401
+ return (obj != undef) && (obj != null)
402
+
403
+ # ---------------------------------------------------------------------------
404
+
405
+ export notdefined = (obj) ->
406
+
407
+ return (obj == undef) || (obj == null)
408
+
409
+ # ---------------------------------------------------------------------------
410
+
411
+ export isIterable = (obj) ->
412
+
413
+ if (obj == undef) || (obj == null)
402
414
  return false
403
- return typeof object[Symbol.iterator] == 'function'
415
+ return typeof obj[Symbol.iterator] == 'function'
@@ -430,9 +430,19 @@ export var replaceVars = function(line, hVars = {}, rx = /__(env\.)?([A-Za-z_]\w
430
430
  };
431
431
 
432
432
  // ---------------------------------------------------------------------------
433
- export var isIterable = function(object) {
434
- if ((object === undef) || (object === null)) {
433
+ export var defined = function(obj) {
434
+ return (obj !== undef) && (obj !== null);
435
+ };
436
+
437
+ // ---------------------------------------------------------------------------
438
+ export var notdefined = function(obj) {
439
+ return (obj === undef) || (obj === null);
440
+ };
441
+
442
+ // ---------------------------------------------------------------------------
443
+ export var isIterable = function(obj) {
444
+ if ((obj === undef) || (obj === null)) {
435
445
  return false;
436
446
  }
437
- return typeof object[Symbol.iterator] === 'function';
447
+ return typeof obj[Symbol.iterator] === 'function';
438
448
  };