Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-declare-generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
劳工
scilla-declare-generator
Commits
6231c232
Commit
6231c232
authored
Jun 10, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
6eb7fbc0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
scilla-declare-generator.iml
scilla-declare-generator.iml
+1
-1
index.js
src/index.js
+5
-5
No files found.
scilla-declare-generator.iml
View file @
6231c232
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<module
type=
"WEB_MODULE"
version=
"4"
>
<module
type=
"WEB_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$
/../scilla-declare-generator
"
/>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</component>
...
...
src/index.js
View file @
6231c232
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
*/
*/
const
ts
=
require
(
'typescript'
);
const
ts
=
require
(
'typescript'
);
const
fs
=
require
(
'fs-extra
'
);
const
path
=
require
(
'path
'
);
let
declareMap
;
let
declareMap
;
let
_componentsPath
;
let
_components
Src
Path
;
let
_projectPath
;
let
_projectPath
;
let
_assetsPath
;
let
_assetsPath
;
let
_filter
;
let
_filter
;
...
@@ -18,7 +18,7 @@ const showLog = false;
...
@@ -18,7 +18,7 @@ const showLog = false;
const
showVerboseLog
=
false
;
const
showVerboseLog
=
false
;
exports
.
generateDeclareMap
=
function
(
tsconfig
,
dependencies
,
file
,
componentsPath
,
projectPath
,
assetsPath
,
filter
)
{
exports
.
generateDeclareMap
=
function
(
tsconfig
,
dependencies
,
file
,
componentsPath
,
projectPath
,
assetsPath
,
filter
)
{
_components
Path
=
componentsPath
;
_components
SrcPath
=
path
.
join
(
componentsPath
,
'src'
)
;
_projectPath
=
projectPath
;
_projectPath
=
projectPath
;
_assetsPath
=
assetsPath
;
_assetsPath
=
assetsPath
;
_filter
=
filter
;
_filter
=
filter
;
...
@@ -194,7 +194,7 @@ function addProp(dataContainer, name, valueDeclaration, checker) {
...
@@ -194,7 +194,7 @@ function addProp(dataContainer, name, valueDeclaration, checker) {
defaultValue
.
push
(
value
);
defaultValue
.
push
(
value
);
}
}
}
else
if
(
typeName
===
'number'
){
}
else
if
(
typeName
===
'number'
){
defaultValue
=
initializer
&&
(
initializer
.
text
?
parseFloat
(
initializer
.
text
)
:
(
initializer
.
operand
?
-
parseFloat
(
initializer
.
operand
.
text
)
:
undefined
))
defaultValue
=
initializer
&&
(
initializer
.
text
?
initializer
.
text
:
(
initializer
.
operand
?
'-'
+
initializer
.
operand
.
text
:
undefined
))
}
else
{
}
else
{
defaultValue
=
initializer
&&
(
initializer
.
text
||
(
initializer
.
name
&&
initializer
.
name
.
escapedText
));
defaultValue
=
initializer
&&
(
initializer
.
text
||
(
initializer
.
name
&&
initializer
.
name
.
escapedText
));
}
}
...
@@ -229,7 +229,7 @@ function getFullyQualifiedNameOfType(type, checker) {
...
@@ -229,7 +229,7 @@ function getFullyQualifiedNameOfType(type, checker) {
}
else
if
(
path
.
indexOf
(
'src'
)
===
0
){
}
else
if
(
path
.
indexOf
(
'src'
)
===
0
){
path
=
path
.
replace
(
'src'
,
'components'
)
path
=
path
.
replace
(
'src'
,
'components'
)
}
else
{
}
else
{
path
=
path
.
replace
(
_componentsPath
,
'components'
)
path
=
path
.
replace
(
_components
Src
Path
,
'components'
)
.
replace
(
/
\/\d
+
\.\d
+
\.\d
+
\/
index/
,
''
)
.
replace
(
/
\/\d
+
\.\d
+
\.\d
+
\/
index/
,
''
)
}
}
fullClassName
=
`"
${
path
}
".
${
className
}
`
;
fullClassName
=
`"
${
path
}
".
${
className
}
`
;
...
...
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