Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remake functions #917

Merged
merged 6 commits into from
May 29, 2022
Merged

Remake functions #917

merged 6 commits into from
May 29, 2022

Conversation

DanDy1337
Copy link
Contributor

No description provided.

@atherdon atherdon requested a review from vadim9999 May 25, 2022 12:28
const map = {
'strong': {
constant: REGEXP_STRONG,
callback: strong
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will not work because you didn't import it

},
'empty': {
constant: REGEXP_HTML_COMMENTS,
callback: comments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same problem

}
}

function replaceMarkdown(callback) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the name of argument, please because it's not callback - it's a name for example just name

// console.log('helpers- replace markdown method')
// console.log(typeof callback)

const str = map.callback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while calling map.strong will return object with constant and callback not a string rename it please

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map.callback it will not work because because you have to call like this map[name] then you will get object

checkFolders.js Outdated
// isFolderExists('./src/parserMDReact/tests/_generated');

function isFolderExists(dir) {
if (!existsSync(dir)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to import function isFolderExists from utils and use it or in this case import this function from fs

// console.log('helpers- replace markdown method')
// console.log(typeof callback)

const str = map.callback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map.callback it will not work because because you have to call like this map[name] then you will get object

}
}

function Markdown(callback) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

название функции не нужно было менять нужно было просто поменять название аргумента на name

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

верните обратно название функции

// console.log('helpers- replace markdown method')
// console.log(typeof callback)

const LocalObject = map[callback]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

уже лучше но название константы сделайте другой начиная с маленькой буквы

package.json Outdated
@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"build": "rollup -c",
"parse": "npm run build && cross-env PARSE=full node ./dist/bundle",
"parse": "babel src --out-dir lib && cross-env PARSE=full node ./dist/bundle",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не будет никогда работать переделайте

checkFolders.js Outdated
isFolderExists('./src/tests/_generated');
isFolderExists('./src/parserMDReact/tests/_generated');

function isFolderExists(dir) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

удалите эти функции

@@ -0,0 +1,11 @@
const { isFolderExists } = require('./src/utils');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да правильно но проблема в том что это не будет работать потому что код написан в es6 и даст ошибку при запуске

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно придумать решение чтобы при запуске тестов это работало

@vadim9999 vadim9999 merged commit d4cab74 into LLazyEmail:main May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants