stencila-js
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "stencila-js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Stencila components for Javascript", | ||
@@ -48,4 +48,5 @@ "main": "index.js", | ||
"tape": "^4.6.3", | ||
"testling": "^1.7.1" | ||
"testling": "^1.7.1", | ||
"xmlhttprequest": "^1.8.0" | ||
} | ||
} |
@@ -88,4 +88,4 @@ const buble = require('buble') | ||
for (let index = 0; index < lines.length; index++) { | ||
if ((index === lines.length - 1) && (lines[index].trim().length > 0)) body += 'return ' + lines[index] + ';\n' | ||
else body += lines[index] + ';\n' | ||
if ((index === lines.length - 1) && (lines[index].trim().length > 0)) body += 'return ' + lines[index] + '\n' | ||
else body += lines[index] + '\n' | ||
} | ||
@@ -92,0 +92,0 @@ body += '}}\n' |
@@ -0,1 +1,6 @@ | ||
// So we can run tests in Node.js, when not in the browser, use a XMLHttpRequest emulator | ||
if (typeof window === 'undefined') { | ||
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest | ||
} | ||
let cache = {} | ||
@@ -2,0 +7,0 @@ |
@@ -22,2 +22,5 @@ const {pack} = require('../src/packing') | ||
t.deepEqual(s.execute('let x = 3\n\n'), {errors: {}, output: null}, 'assign') | ||
t.deepEqual(s.execute('// Multiple lines and comments\nlet x = {\na:1\n\n}\n\n'), {errors: {}, output: null}, 'assign') | ||
t.end() | ||
@@ -24,0 +27,0 @@ }) |
@@ -5,12 +5,14 @@ const need = require('../src/need') | ||
if (typeof window !== 'undefined') { | ||
test('need', t => { | ||
let isNumber = need('is-number') | ||
test('need() can fetch a NPM module', t => { | ||
let isNumber = need('is-number') | ||
t.equal(isNumber(1), true) | ||
t.equal(isNumber('foo'), false) | ||
t.equal(isNumber(1), true) | ||
t.equal(isNumber('foo'), false) | ||
t.end() | ||
}) | ||
} | ||
let isNumberCached = need('is-number') | ||
t.deepEqual(isNumber, isNumberCached) | ||
t.throws(() => need('a-non-existent-npm-module')) | ||
t.end() | ||
}) |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1067803
30221
6
11