UNPKG
wordreference-definition-api
Version:
latest (3.0.2)
3.0.2
3.0.1
3.0.0
2.0.3
2.0.2
2.0.1
2.0.0
1.0.0
Scrap word definitions from http://www.wordreference.com
wordreference-definition-api
/
src
/
index.js
11 lines
(9 loc)
•
283 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
Definition = require(
'./classes/Definition.js'
)
const
definitionFactory = (
data
) => {
if
(
data
&&
data
.
constructor
.name ===
'Object'
) {
return
new Definition(
data
) }
else
{
return
new Definition({}) } } module.exports = definitionFactory