Socket
Socket
Sign inDemoInstall

mw-dict

Package Overview
Dependencies
5
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

__mocks__/TEST_INEXIST.xml

11

__tests__/index.test.js

@@ -1,2 +0,2 @@

const { CollegiateDictionary } = require('../')
const { CollegiateDictionary, WordNotFoundError } = require('../')

@@ -55,1 +55,10 @@ const dict = new CollegiateDictionary('')

})
describe('error handling', () => {
it('throws error when word could not be found', () => {
return dict.lookup('TEST_INEXIST').catch(e => {
expect(e).toBeInstanceOf(WordNotFoundError)
expect(e.suggestions).toBeInstanceOf(Array)
})
})
})

2

lib/index.js

@@ -216,3 +216,3 @@ /*

if (!entries.length) {
let suggestions = doc.getElementsByTagName('suggestions')
let suggestions = doc.getElementsByTagName('suggestion')
throw new WordNotFoundError(

@@ -219,0 +219,0 @@ slice.call(suggestions).map(s => textContent(s))

{
"name": "mw-dict",
"version": "1.0.1",
"version": "1.0.2",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc