module-definition
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -16,3 +16,3 @@ var Walker = require('node-source-walk'), | ||
function fromSource(source) { | ||
if (! source) throw new Error('source not supplied'); | ||
if (typeof source === 'undefined') throw new Error('source not supplied'); | ||
@@ -19,0 +19,0 @@ var type = 'none', |
{ | ||
"name": "module-definition", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Determines if a file is using a CommonJS or AMD module definition", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,3 @@ | ||
# module-definition [![npm](http://img.shields.io/npm/v/module-definition.svg)](https://npmjs.org/package/module-definition) [![npm](http://img.shields.io/npm/dm/module-definition.svg)](https://npmjs.org/package/module-definition) | ||
Determines the module definition type (CommonJS, AMD, or none) for a given JavaScript file | ||
@@ -2,0 +4,0 @@ by walking through the AST. |
@@ -43,2 +43,3 @@ var getModuleType = require('../'); | ||
asyncTest("./g.js", "commonjs"); | ||
asyncTest("./h.js", "none"); | ||
@@ -66,2 +67,3 @@ it('throws if the filename is not supplied', function() { | ||
syncTest("./g.js", "commonjs"); | ||
syncTest("./h.js", "none"); | ||
@@ -81,2 +83,3 @@ it('throws if the filename is not supplied', function() { | ||
sourceTest("./g.js", "commonjs"); | ||
sourceTest("./h.js", "none"); | ||
@@ -83,0 +86,0 @@ it('throws if source code is not supplied', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6409
13
163
32