2.2 KiB
2.2 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
587d7fb4367417b2b2512bfd | Додати ключові слова до вашого package.json | 2 | 301526 | add-keywords-to-your-package-json |
--description--
Значення keywords
- це місце, де ви можете описати ваш проєкт, використовуючи відповідні ключові слова. Ось приклад:
"keywords": [ "descriptive", "related", "words" ],
Як бачите, це поле структуровано як масив подвійних цитованих рядків.
--instructions--
Додайте масив відповідних рядків у keywords
у файлі package.json вашого проєкту.
Одне з ключових слів має бути "freecodecamp".
--hints--
package.json повинен мати допустимий ключ "ключові слова"
(getUserInput) =>
$.get(getUserInput('url') + '/_api/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert(packJson.keywords, '"keywords" is missing');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
Поле "ключові слова" має бути масивом
(getUserInput) =>
$.get(getUserInput('url') + '/_api/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert.isArray(packJson.keywords, '"keywords" is not an array');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
"ключові слова" мають включати "freecodecamp"
(getUserInput) =>
$.get(getUserInput('url') + '/_api/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert.include(
packJson.keywords,
'freecodecamp',
'"keywords" does not include "freecodecamp"'
);
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
--solutions--
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/