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
4e9ff5b7
Commit
4e9ff5b7
authored
Apr 13, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
c5a6bd72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
uniq-blocker.js
uniq-blocker.js
+60
-0
No files found.
uniq-blocker.js
0 → 100644
View file @
4e9ff5b7
let
fs
=
require
(
'
fs
'
)
let
_
=
require
(
'
lodash
'
)
let
moment
=
require
(
'
moment-timezone
'
)
run
()
async
function
run
()
{
let
configs
=
await
fs
.
readdirSync
(
'
uniq/
'
)
let
types
=
[]
for
(
let
i
=
0
;
i
<
configs
.
length
;
i
++
)
{
let
config
=
await
fs
.
readFileSync
(
'
./uniq/
'
+
configs
[
i
]
+
'
/default/compound1000.json
'
,
'
utf8
'
)
config
=
JSON
.
parse
(
config
)
for
(
let
j
=
0
;
j
<
config
.
length
;
j
++
)
{
if
(
config
[
j
].
maxLevel
>=
15
)
types
.
push
(
config
[
j
].
type
.
split
(
'
targetPercentage:false
'
)[
1
])
}
}
let
uniqType
=
_
.
uniq
(
types
);
createConfileADV
(
uniqType
)
}
function
getDaysDiff
(
start
,
closed
)
{
//2019-05-25T05:34:27+04:30
var
now
=
moment
(
moment
(
closed
,
'
YYYY-MM-DD
'
).
format
());
var
end
=
moment
.
duration
(
now
.
diff
(
moment
(
start
,
'
YYYY-MM-DD
'
)));
// console.log(parseInt(end.asDays()))
return
parseInt
(
end
.
asDays
())
}
function
createfileADV
(
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
date.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
function
createConfileADV
(
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
con2.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
\ 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