freeCodeCamp/curriculum/challenges/arabic/05-apis-and-microservices/managing-packages-with-npm/use-the-caret-character-to-...

2.3 KiB

id title localeTitle challengeType
587d7fb5367417b2b2512c03 Use the Caret-Character to Use the Latest Minor Version of a Dependency استخدم حرف الإقحام لاستخدام أحدث إصدار ثانوي من التبعية 2

Description

شبيه بالكيفية التي سمعت بها التلدة (~) التي تعلمناها في التحدي الأخير لـ npm لتثبيت أحدث PATCH للتبعية ، تسمح علامة الإقحام (^) لـ npm لتثبيت التحديثات المستقبلية أيضًا. الفرق هو أن حرف الإقحام سيسمح بتحديثات MINOR و PATCHes. في الوقت الحالي ، يجب أن يكون الإصدار الحالي من اللحظة ~ 2.10.2 والذي يسمح لـ npm بالتثبيت على أحدث إصدار 2.10.x. إذا استخدمنا بدلاً من ذلك علامة الإقحام (^) كبادئة للإصدار ، فسيتم السماح لـ npm بالتحديث إلى أي إصدار 2.xx. مثال "some-package-name": "^1.3.8" allows updates to any 1.xx version. تعليمات استخدم حرف الإقحام (^) لبدء إصدار اللحظة في تبعياتك والسماح لـ npm بتحديثه إلى أي إصدار جديد صغير. لاحظ أنه لا يجب تغيير أرقام الإصدارات نفسها.

Instructions

Tests

tests:
  - text: يجب أن تتضمن "التبعيات" "لحظة"
    testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.property(packJson.dependencies, ''moment'', ''"dependencies" does not include "moment"''); }, xhr => { throw new Error(xhr.responseText); })'
  - text: يجب أن يتطابق إصدار "اللحظة" مع "^ 2.x.x"
    testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.match(packJson.dependencies.moment, /^\^2\./, ''Wrong version of "moment". It should be ^2.10.2''); }, xhr => { throw new Error(xhr.responseText); })'

Challenge Seed

Solution

// solution required