11# Keyset
22
3- Tool for representation of BEM i18n keyset.
3+ The tool for representation of BEM i18n keyset.
44
55[ ![ NPM Status] [ npm-img ]] [ npm ]
66
@@ -28,7 +28,7 @@ An example is available in the [RunKit editor](https://runkit.com/godfreyd/5c333
2828To run the ` @bem/sdk.keyset ` package:
2929
30301 . [ Install keyset] ( #installing-the-bemsdkkeyset-package ) .
31- 2 . [ Declaration keyset] ( #declaration-keyset ) .
31+ 1 . [ Declaration keyset] ( #declaration-keyset ) .
3232
3333### Installing the ` @bem/sdk.keyset ` package
3434
@@ -47,9 +47,9 @@ Specify the Keyset name, path, and format for keyset. The `Keyset` class is a co
4747``` js
4848const { Keyset } = require (' @bem/sdk.keyset' );
4949const keyset = new Keyset (' Time' , ' src/features/Time/Time.i18n' );
50- keyset .name ; // => 'Time'
51- keyset .path ; // => 'src/features/Time/Time.i18n'
52- keyset .format ; // => 'taburet' — default format, see Formats
50+ keyset .name ; // => 'Time'.
51+ keyset .path ; // => 'src/features/Time/Time.i18n'.
52+ keyset .format ; // => 'taburet' — default format, see Formats.
5353```
5454
5555[ RunKit live editor] ( https://runkit.com/godfreyd/5c3339d802ce8e00124ead3f ) .
@@ -59,7 +59,7 @@ keyset.format; // => 'taburet' — default format, see Formats
5959Keyset has two default formats:
6060
6161| Format | Extension |
62- | ----------- | -- -----------|
62+ | --------| -----------|
6363| ` enb ` | ` .js ` |
6464| ` taburet ` | ` .ts ` |
6565
@@ -153,8 +153,8 @@ Gets keys from found keyset.
153153/**
154154* Gets keys.
155155*
156- * @param {string} lang — the language to traverse
157- * @return {string[]} — keys
156+ * @param {string} lang — The language to traverse.
157+ * @return {string[]} — Keys.
158158*/
159159keyset .getLangKeysForLang (lang);
160160```
@@ -210,8 +210,8 @@ Adds keys for language.
8000
Use with `keyset.save()` method.
210210/**
211211* Adds keys.
212212*
213- * @param {string} lang — the language to add
214- * @return {object[]} — keys
213+ * @param {string} lang — The language to add.
214+ * @return {object[]} — Keys.
215215*/
216216keyset .addKeysForLang (lang, langKeys);
217217```
@@ -299,9 +299,9 @@ Converts a JavaScript object to a special string ready to save on the project's
299299/**
300300 * Converts a JavaScript object to a string.
301301 *
302- * @param {Object} value — the value to convert
303- * @param {string} formatName — the name of format
304- * @returns {string} — the string to save
302+ * @param {Object} value — The value to convert.
303+ * @param {string} formatName — The name of format.
304+ * @returns {string} — The string to save.
305305 */
306306LangKeys .stringify (value, formatName);
307307```
@@ -333,9 +333,9 @@ Parses a string, constructing the JavaScript object described by the string.
333333/**
334334 * Parses a string to JavaScript object.
335335 *
336- * @param {Object} str — the string to parse
337- * @param {string} formatName — the name of format
338- * @returns {string} — the JavaScript object
336+ * @param {Object} str — The string to parse.
337+ * @param {string} formatName — The name of format.
338+ * @returns {string} — The JavaScript object.
339339 */
340340await LangKeys .parse (str, formatName);
341341```
@@ -363,3 +363,6 @@ langKeys;
363363
364364[ RunKit live editor] ( https://runkit.com/godfreyd/5c348f9ec236980012045540 ) .
365365
366+ ## License
367+
368+ © 2019 [ Yandex] ( https://yandex.com/company/ ) . Code released under [ Mozilla Public License 2.0] ( LICENSE.txt ) .
0 commit comments