Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть 03 - Add new ObjectProperty to an ObjectExpression

  • Ryan Stelly
  • 2020-08-15
  • 109
03 - Add new ObjectProperty to an ObjectExpression
  • ok logo

Скачать 03 - Add new ObjectProperty to an ObjectExpression бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно 03 - Add new ObjectProperty to an ObjectExpression или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку 03 - Add new ObjectProperty to an ObjectExpression бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео 03 - Add new ObjectProperty to an ObjectExpression

@egghead I would love to teach on your platform :)

We create a new ObjectProperty AST node and add it to an ObjectExpression.

Previously, we created our `marginTop` rule by simply renaming the `marginVertical` rule. For an additional rule, however, we need a new AST node.

To achieve this, we first create the node using the helpers from `@babel/types`. (https://babeljs.io/docs/en/babel-type...)

const objectProperty = t.ObjectProperty(
t.Identifier('marginBottom'),
node.value
);

With this node created, we need to add it to the property list. The path argument to our `ObjectProperty` visitor method provides data about the current node's position in the state tree, including access to its parent nodes. The parent node of our `ObjectProperty` is an `ObjectExpression` with the property list we need to modify.

We call `Array.splice` to inject the new property into the properties array one position after the `marginTop` rule by using `path.key + 1`.

AST Explorer: https://astexplorer.net/#/gist/889b93...

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]