-
Notifications
You must be signed in to change notification settings - Fork 13
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
Remake functions #917
Conversation
const map = { | ||
'strong': { | ||
constant: REGEXP_STRONG, | ||
callback: strong |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
src/callbacks/replace-md.js
Outdated
// console.log('helpers- replace markdown method') | ||
// console.log(typeof callback) | ||
|
||
const str = map.callback |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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
src/callbacks/replace-md.js
Outdated
// console.log('helpers- replace markdown method') | ||
// console.log(typeof callback) | ||
|
||
const str = map.callback |
There was a problem hiding this comment.
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
src/callbacks/replace-md.js
Outdated
} | ||
} | ||
|
||
function Markdown(callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
название функции не нужно было менять нужно было просто поменять название аргумента на name
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да правильно но проблема в том что это не будет работать потому что код написан в es6 и даст ошибку при запуске
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужно придумать решение чтобы при запуске тестов это работало
No description provided.