Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lib-ical
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
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
SRCT
lib-ical
Commits
398e1a1b
Commit
398e1a1b
authored
Feb 17, 2017
by
Mark Stenglein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few fixes as well as adding the generated js
parent
cda27382
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
9 deletions
+61
-9
dist/ContentLine.js
dist/ContentLine.js
+49
-0
dist/main.js
dist/main.js
+1
-1
dist/src/greet.js
dist/src/greet.js
+0
-5
dist/util.js
dist/util.js
+5
-0
src/ContentLine.ts
src/ContentLine.ts
+2
-2
tsconfig.json
tsconfig.json
+4
-1
No files found.
dist/ContentLine.js
0 → 100644
View file @
398e1a1b
"
use strict
"
;
const
util_1
=
require
(
"
./util
"
);
/**
* Implementation of a Content Line from RFC 5545
*
* @author Mark Stenglein <mark@stengle.in>
*
* Chapter 3.1 defines the content line. This implementation will use it as an
* abstract class which can be extended later by the specific content types.
*
* This class defines all of the general features specified by the chapter,
* while leaving the specific features required by individual component objects
* unfilled.
*/
class
ContentLine
{
constructor
(
inName
,
inParam
,
inValue
)
{
this
.
name
=
inName
;
this
.
param
=
inParam
;
this
.
value
=
inValue
;
}
/* Getters */
get
name
()
{
return
this
.
_name
;
}
get
param
()
{
return
this
.
_param
;
}
get
value
()
{
return
this
.
_value
;
}
/* Setters */
set
name
(
newName
)
{
if
(
util_1
.
isAlpha
(
newName
))
{
this
.
_name
=
newName
;
}
else
{
throw
new
TypeError
(
"
'name' must be alphabetic!
"
);
}
}
set
param
(
newParam
)
{
this
.
_param
=
newParam
;
}
set
value
(
newValue
)
{
if
(
util_1
.
isAlpha
(
newValue
))
{
this
.
_value
=
newValue
;
}
}
}
exports
.
ContentLine
=
ContentLine
;
dist/
src/
main.js
→
dist/main.js
View file @
398e1a1b
"
use strict
"
;
var
greet_1
=
require
(
"
./greet
"
);
const
greet_1
=
require
(
"
./greet
"
);
console
.
log
(
greet_1
.
sayHello
(
"
TypeScript
"
));
dist/src/greet.js
deleted
100644 → 0
View file @
cda27382
"
use strict
"
;
function
sayHello
(
name
)
{
return
"
Hello from
"
+
name
;
}
exports
.
sayHello
=
sayHello
;
dist/util.js
0 → 100644
View file @
398e1a1b
"
use strict
"
;
function
isAlpha
(
input
)
{
return
/^
[
a-zA-Z
]
+$/
.
test
(
input
);
}
exports
.
isAlpha
=
isAlpha
;
src/ContentLine.ts
View file @
398e1a1b
...
...
@@ -44,7 +44,7 @@ export class ContentLine {
this
.
_name
=
newName
;
}
else
{
throw
new
TypeError
(
"
'name' must be alphabetic!
"
)
throw
new
TypeError
(
"
'name' must be alphabetic!
"
)
;
}
}
...
...
@@ -57,4 +57,4 @@ export class ContentLine {
this
.
_value
=
newValue
;
}
}
}
\ No newline at end of file
}
tsconfig.json
View file @
398e1a1b
{
"files"
:
[
"src/**/*.ts"
"src/ContentLine.ts"
,
"src/util.ts"
,
"src/main.ts"
,
"src/greeter.ts"
],
"compilerOptions"
:
{
"module"
:
"commonjs"
,
...
...
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