UNPKG

cambridge-dictionary-api

Version:

API for Cambridge Dictionary

17 lines (16 loc) 426 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractDerivedForms = extractDerivedForms; function extractDerivedForms($) { const derivedForms = { noun: [], }; const noun = $(".w.dw").first().text().trim(); if (noun) { derivedForms.noun.push(noun); } if (derivedForms.noun.length === 0) { return undefined; } return derivedForms; }