Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
cordis-decorators
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
cordis-decorators
Commits
8c765efd
Commit
8c765efd
authored
Jul 18, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix export
parent
c0ed61e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
index.ts
index.ts
+2
-2
tests/if.spec.ts
tests/if.spec.ts
+18
-1
No files found.
index.ts
View file @
8c765efd
export
*
from
'
./src/decorators
'
;
export
*
from
'
./src/def
'
;
export
*
from
'
./src/decorators
'
;
export
*
from
'
./src/def
'
;
export
*
from
'
./src/registrar
'
;
export
*
from
'
./src/registrar-aspect
'
;
export
*
from
'
./src/plugin-factory
'
;
export
*
from
'
./src/utility/get-schema
'
;
tests/if.spec.ts
View file @
8c765efd
import
{
DefinePlugin
,
StarterPlugin
,
UseEvent
}
from
'
./utility/decorators
'
;
import
{
SchemaProperty
}
from
'
schemastery-gen
'
;
import
{
If
}
from
'
../src/decorators
'
;
import
{
For
,
If
}
from
'
../src/decorators
'
;
import
{
Context
}
from
'
cordis
'
;
class
MyConfig
{
@
SchemaProperty
()
foo
:
boolean
;
@
SchemaProperty
({
type
:
String
})
colors
:
string
[];
}
declare
module
'
cordis
'
{
...
...
@@ -21,6 +24,13 @@ class MyPlugin extends StarterPlugin(MyConfig) {
onFoo
()
{
return
'
bar
'
;
}
@
For
<
MyPlugin
>
(({
config
})
=>
config
.
colors
.
map
((
color
)
=>
({
color
})))
@
If
<
MyPlugin
>
((
_
,
def
)
=>
def
.
color
!==
'
badthing
'
)
@
UseEvent
(
'
{{color}}
'
as
any
)
onColor
()
{
return
'
good
'
;
}
}
describe
(
'
Caller
'
,
()
=>
{
...
...
@@ -39,4 +49,11 @@ describe('Caller', () => {
app
.
plugin
(
MyPlugin
,
{
foo
:
false
});
expect
(
app
.
bail
(
'
foo
'
)).
toBeUndefined
();
});
it
(
'
register with array
'
,
async
()
=>
{
app
.
plugin
(
MyPlugin
,
{
colors
:
[
'
red
'
,
'
blue
'
,
'
badthing
'
]
});
expect
(
app
.
bail
(
'
red
'
as
any
)).
toBe
(
'
good
'
);
expect
(
app
.
bail
(
'
blue
'
as
any
)).
toBe
(
'
good
'
);
expect
(
app
.
bail
(
'
badthing
'
as
any
)).
toBeUndefined
();
});
});
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