Skip to content

Commit

Permalink
Merge branch 'release/v2.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ant1mas committed Nov 7, 2020
2 parents 8779259 + 1117171 commit 4796c91
Show file tree
Hide file tree
Showing 8 changed files with 3,288 additions and 5,593 deletions.
20 changes: 13 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,16 @@ declare module 'number-to-words-ru' {
*/
fractionalPartMinLength?: number
}

/**
* Convert options
*/
export interface ConvertOptions{
export interface ConvertOptions {
/**
* Select currency\
* 'rub' Russian ruble 124 рубля 42 копейки\
* 'usd' Dollar 124 доллара 42 цента\
* 'eur' Euro 124 евро 42 цента\
* 'number' Number without currency 124 целых 42 сотых\
* `'rub'`: Russian ruble 124 рубля 42 копейки\
* `'usd'`: Dollar 124 доллара 42 цента\
* `'eur'`: Euro 124 евро 42 цента\
* `'number'`: Number without currency 124 целых 42 сотых\
* Default: `rub`
*/
currency?: 'rub' | 'usd' | 'eur' | 'number' | CurrencySettings;
Expand All @@ -77,6 +76,9 @@ declare module 'number-to-words-ru' {
fractional?: boolean;
},
}
export interface numberToWordsRuFunctions {
convert: typeof convert,
}
/**
* Convert number to words\
* If typed as `number` max value is `9'007'199'254'740'991` (limit of Javascript).\
Expand All @@ -86,6 +88,10 @@ declare module 'number-to-words-ru' {
* @param options The convert options
*/
export function convert(number: string | number, options?: ConvertOptions): string;

/**
* Object of functions:\
* `convert`: Convert number to words.
*/
const numberToWordsRu: numberToWordsRuFunctions;
export default numberToWordsRu;
}
5,558 changes: 1,965 additions & 3,593 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "number-to-words-ru",
"version": "2.2.3",
"version": "2.2.4",
"description": "Convert a number to words on russian language.",
"license": "MIT",
"repository": "Ant1mas/number-to-words-ru",
Expand All @@ -19,17 +19,18 @@
"@types/html-webpack-plugin": "^3.2.3",
"@types/lodash": "^4.14.154",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^3.0.0",
"eslint": "^7.1.0",
"eslint-config-google": "^0.14.0",
"html-webpack-plugin": "^4.3.0",
"jest": "^26.0.1",
"lodash": "^4.17.20",
"ts-loader": "^8.0.2",
"typescript": "^4.0.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"ts-loader": "^8.0.10",
"typescript": "^4.0.5",
"webpack": "^5.4.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.1.2"
"webpack-merge": "^5.3.0"
},
"keywords": [
"convert",
Expand Down
9 changes: 9 additions & 0 deletions webpack/paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require('path');

const rootPath = path.resolve(__dirname, '../');
const distPath = path.resolve(rootPath, 'dist');

module.exports = {
rootPath,
distPath,
};
6 changes: 4 additions & 2 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const path = require('path');

const rootPath = path.resolve(__dirname, '../');
const distPath = path.resolve(rootPath, 'dist');
const {
rootPath,
distPath,
} = require('./paths.js');

const config = {
entry: {
Expand Down
4 changes: 1 addition & 3 deletions webpack/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const path = require('path');
const {merge} = require('webpack-merge');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const {distPath} = require('./paths.js');
const common = require('./webpack.common.js');
const rootPath = path.resolve(__dirname, '../');
const distPath = path.resolve(rootPath, 'dist');

const config = merge(common, {
mode: 'development',
Expand Down
13 changes: 13 additions & 0 deletions webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
const {merge} = require('webpack-merge');
const TerserPlugin = require('terser-webpack-plugin');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');

const common = require('./webpack.common.js');

const config = merge(common, {
mode: 'production',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
plugins: [
new CleanWebpackPlugin(),
],
});

module.exports = config;
Loading

0 comments on commit 4796c91

Please sign in to comment.