@jdeighan/coffee-utils 10.0.5 → 10.0.6

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": "10.0.5",
4
+ "version": "10.0.6",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -21,6 +21,13 @@ export isComment = (line) ->
21
21
 
22
22
  # ---------------------------------------------------------------------------
23
23
 
24
+ export isSubclassOf = (subClass, superClass) ->
25
+
26
+ return (subClass == superClass) \
27
+ || (subClass.prototype instanceof superClass)
28
+
29
+ # ---------------------------------------------------------------------------
30
+
24
31
  export eval_expr = (str) ->
25
32
 
26
33
  str = str.replace(/\bundef\b/g, 'undefined')
@@ -27,6 +27,11 @@ export var isComment = function(line) {
27
27
  return defined(lMatches);
28
28
  };
29
29
 
30
+ // ---------------------------------------------------------------------------
31
+ export var isSubclassOf = function(subClass, superClass) {
32
+ return (subClass === superClass) || (subClass.prototype instanceof superClass);
33
+ };
34
+
30
35
  // ---------------------------------------------------------------------------
31
36
  export var eval_expr = function(str) {
32
37
  str = str.replace(/\bundef\b/g, 'undefined');