french-contractions
Advanced tools
Comparing version 2.16.9 to 2.16.10
export * from './hmuet'; | ||
export * from './vowel'; | ||
export declare function contracts(word: string): boolean; | ||
interface ContractData { | ||
contracts: boolean; | ||
} | ||
export interface ContractsData { | ||
[key: string]: ContractData; | ||
} | ||
export declare function contracts(word: string, contractsData: ContractsData): boolean; |
@@ -18,4 +18,7 @@ "use strict"; | ||
const vowel_1 = require("./vowel"); | ||
function contracts(word) { | ||
if (vowel_1.beginsWithVowel(word) && vowel_1.isContractedVowelWord(word)) { | ||
function contracts(word, contractsData) { | ||
if (contractsData && contractsData[word] && contractsData[word].contracts != null) { | ||
return contractsData[word].contracts; | ||
} | ||
else if (vowel_1.beginsWithVowel(word) && vowel_1.isContractedVowelWord(word)) { | ||
return true; | ||
@@ -22,0 +25,0 @@ } |
{ | ||
"name": "french-contractions", | ||
"version": "2.16.9", | ||
"version": "2.16.10", | ||
"description": "French contractions: le hérisson, l'homme, ce yaourt, cet arbre", | ||
@@ -56,3 +56,3 @@ "main": "dist/index.js", | ||
"license": "MIT", | ||
"gitHead": "cad6ab45154f6680478ace7af2b4eb3b233f9392" | ||
"gitHead": "c4be3bba693b9c5e1564b6da828850c26c7e030f" | ||
} |
@@ -26,2 +26,7 @@ # french-contractions | ||
One function `contracts` that take 2 arguments: | ||
- the word (noun or adjective) | ||
- a map of custom exceptions (optional): the word is the key, the value must be an object having a `contracts` property with a boolean value | ||
```javascript | ||
@@ -28,0 +33,0 @@ const lib = require('french-contractions'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
273163
1567
47