Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
f3248e21
Commit
f3248e21
authored
Sep 02, 2021
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
a9b70be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
generate.js
generate.js
+85
-0
No files found.
generate.js
0 → 100644
View file @
f3248e21
let
arr
=
[
{
type
:
"
zarib
"
,
commision
:
0.0008
,
base
:
100
,
paramStart
:
1.1
,
paramEnd
:
100
,
inidicator
:
0.1
},
{
type
:
"
plus
"
,
commision
:
0.0008
,
base
:
100
,
paramStart
:
100
,
paramEnd
:
5000
,
inidicator
:
100
},
{
type
:
"
base
"
,
commision
:
0.0008
,
base
:
100
,
paramStart
:
1.1
,
paramEnd
:
100
,
inidicator
:
0.1
}
]
let
fs
=
require
(
'
fs
'
)
run
()
async
function
run
()
{
let
obj
=
{
sort
:
'
percentage
'
}
let
all
=
[]
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
all
.
push
(
add
(
arr
[
i
]))
let
arrz
=
await
Promise
.
all
(
all
)
let
arr2
=
[]
for
(
let
i
=
0
;
i
<
arrz
.
length
;
i
++
)
{
let
inline
=
arrz
[
i
]
for
(
let
j
=
0
;
j
<
inline
.
length
;
j
++
)
arr2
.
push
(
inline
[
j
])
}
obj
.
data
=
arr2
createfile
(
JSON
.
stringify
(
obj
,
null
,
2
))
}
function
createfile
(
data
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
configs.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
async
function
add
(
data
)
{
let
arr
=
[]
while
(
true
)
{
if
(
data
.
paramStart
>
data
.
paramEnd
)
return
arr
data
.
paramStart
=
data
.
paramStart
+
data
.
inidicator
arr
.
push
({
type
:
data
.
type
,
"
commision
"
:
data
.
commision
,
base
:
data
.
base
,
param
:
data
.
paramStart
})
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment