Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
lib-ical
Commits
a6ba1926
Commit
a6ba1926
authored
Apr 05, 2017
by
Mark Stenglein
Committed by
GitHub
Apr 05, 2017
Browse files
Merge pull request #38 from ocelotsloth/parameter-organization
Parameters: organize parameters into directory
parents
3c8adb25
af006a2b
Pipeline
#1231
passed with stage
in 42 seconds
Changes
17
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
a6ba1926
...
...
@@ -35,3 +35,4 @@ tags
coverage/
.#*.ts
src/ContentLine.ts
View file @
a6ba1926
...
...
@@ -17,7 +17,7 @@
*/
import
{
isAlpha
}
from
"
./util
"
;
import
{
ICalElement
}
from
"
./ICalElement
"
;
import
Parameter
from
"
./Parameter
"
;
import
Parameter
from
"
./Parameter
/Parameter
"
;
const
CRLF
:
string
=
"
\r\n
"
;
/**
...
...
src/AltRepParam.ts
→
src/
Parameter/
AltRepParam.ts
View file @
a6ba1926
File moved
src/CalUserTypeParam.ts
→
src/
Parameter/
CalUserTypeParam.ts
View file @
a6ba1926
File moved
src/CommonNameParam.ts
→
src/
Parameter/
CommonNameParam.ts
View file @
a6ba1926
File moved
src/DelegateesParam.ts
→
src/
Parameter/
DelegateesParam.ts
View file @
a6ba1926
File moved
src/DelegatorsParam.ts
→
src/
Parameter/
DelegatorsParam.ts
View file @
a6ba1926
File moved
src/
Directory
EntryRef
erence
.ts
→
src/
Parameter/Dir
EntryRef.ts
View file @
a6ba1926
...
...
@@ -20,7 +20,7 @@ import * as url from "url";
const
URL
=
url
.
URL
;
/**
* D
elegatorsParam
Class (Chapter 3.2.4)
* D
irEntryRef
Class (Chapter 3.2.4)
*
* - Purpose: To specify reference to a directory entry associated with the
* calendar user specified by the property.
...
...
@@ -47,7 +47,7 @@ const URL = url.URL;
* @since 0.1.0
* @author Mark Stenglein <mark@stengle.in>
*/
export
default
class
Dir
ectory
EntryRef
erence
extends
Parameter
{
export
default
class
DirEntryRef
extends
Parameter
{
/** @access private */
public
_uri
:
url
.
URL
;
...
...
src/Parameter.ts
→
src/Parameter
/Parameter
.ts
View file @
a6ba1926
...
...
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
{
isAlpha
}
from
"
./util
"
;
import
{
ICalElement
}
from
"
./ICalElement
"
;
import
{
isAlpha
}
from
"
.
.
/util
"
;
import
{
ICalElement
}
from
"
.
.
/ICalElement
"
;
/**
* Implementation of a Content Line Parameter from RFC 5545
...
...
test/ContentLine.spec.ts
View file @
a6ba1926
...
...
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
ContentLine
from
"
../src/ContentLine
"
;
import
Parameter
from
"
../src/Parameter
"
;
import
Parameter
from
"
../src/Parameter
/Parameter
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
test/AltRepParam.spec.ts
→
test/
Parameter/
AltRepParam.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
AltRepParam
from
"
../
src
/AltRepParam
"
;
import
AltRepParam
from
"
../
../src/Parameter
/AltRepParam
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
test/CalUserTypeParam.spec.ts
→
test/
Parameter/
CalUserTypeParam.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
CalUserTypeParam
from
"
../
src
/CalUserTypeParam
"
;
import
CalUserTypeParam
from
"
../
../src/Parameter
/CalUserTypeParam
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
test/CommonNameParam.spec.ts
→
test/
Parameter/
CommonNameParam.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
CommonNameParam
from
"
../
src
/CommonNameParam
"
;
import
CommonNameParam
from
"
../
../src/Parameter
/CommonNameParam
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
@@ -76,4 +76,4 @@ describe("CommonNameParam", () => {
expect
(
param
.
generate
()).
to
.
equal
(
expected
);
});
});
});
\ No newline at end of file
});
test/DelegateesParam.spec.ts
→
test/
Parameter/
DelegateesParam.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
DelegateesParam
from
"
../
src
/DelegateesParam
"
;
import
DelegateesParam
from
"
../
../src/Parameter
/DelegateesParam
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
test/DelegatorsParam.spec.ts
→
test/
Parameter/
DelegatorsParam.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
DelegatorsParam
from
"
../
src
/DelegatorsParam
"
;
import
DelegatorsParam
from
"
../
../src/Parameter
/DelegatorsParam
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
test/
Directory
EntryRef
erence
.spec.ts
→
test/
Parameter/Dir
EntryRef.spec.ts
View file @
a6ba1926
...
...
@@ -15,28 +15,28 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
Dir
ectory
EntryRef
erence
from
"
../src/
Directory
EntryRef
erence
"
;
import
DirEntryRef
from
"
../
../
src/
Parameter/Dir
EntryRef
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
/**
* Test the D
elegatorsParam
class.
* Test the D
irEntryRef
class.
*/
describe
(
"
Dir
ectory
EntryRef
erence
:
"
,
()
=>
{
describe
(
"
DirEntryRef:
"
,
()
=>
{
it
(
"
Should exist
"
,
()
=>
{
expect
(
Dir
ectory
EntryRef
erence
).
to
.
exist
;
expect
(
DirEntryRef
).
to
.
exist
;
});
describe
(
"
constructor:
"
,
()
=>
{
it
(
"
should create an object
"
,
()
=>
{
const
param
=
new
Dir
ectory
EntryRef
erence
(
"
ldap://valid.com:444
"
);
const
param
=
new
DirEntryRef
(
"
ldap://valid.com:444
"
);
expect
(
param
).
to
.
exist
;
});
it
(
"
should complain on empty uri
"
,
()
=>
{
expect
(()
=>
{
const
param
=
new
Dir
ectory
EntryRef
erence
(
""
);
const
param
=
new
DirEntryRef
(
""
);
}).
to
.
throw
(
"
uri must be defined for DirectoryEntryReference
"
);
});
});
...
...
@@ -46,7 +46,7 @@ describe("DirectoryEntryReference:", () => {
it
(
"
should properly set the URI and give the same return
"
,
()
=>
{
const
URI
=
"
ldap://me@example.com:6666/0=ABC%20Industries,c=US???
"
+
"
(cn=Jim%20Dolittle)
"
;
const
param
=
new
Dir
ectory
EntryRef
erence
(
URI
);
const
param
=
new
DirEntryRef
(
URI
);
param
.
uri
=
URI
;
expect
(
param
.
uri
).
to
.
be
.
equal
(
URI
);
...
...
@@ -56,14 +56,14 @@ describe("DirectoryEntryReference:", () => {
it
(
"
leading dash
"
,
()
=>
{
expect
(()
=>
{
const
URI
=
"
-invalid://example.com:66/t/e/s/t
"
;
const
param
=
new
Dir
ectory
EntryRef
erence
(
URI
);
const
param
=
new
DirEntryRef
(
URI
);
}).
to
.
throw
(
"
Invalid URL
"
);
});
it
(
"
space
"
,
()
=>
{
expect
(()
=>
{
const
URI
=
"
in valid://example.com:66/t/e/s/t
"
;
const
param
=
new
Dir
ectory
EntryRef
erence
(
URI
);
const
param
=
new
DirEntryRef
(
URI
);
}).
to
.
throw
(
"
Invalid URL
"
);
});
...
...
@@ -75,14 +75,14 @@ describe("DirectoryEntryReference:", () => {
it
(
"
generates properly
"
,
()
=>
{
const
URI
=
"
ldap://example.com:6666/o=ABC%20Industries,c=US???
"
+
"
(cn=Jim%20Dolittle)
"
;
const
param
=
new
Dir
ectory
EntryRef
erence
(
URI
);
const
param
=
new
DirEntryRef
(
URI
);
expect
(
param
.
generate
()).
to
.
equal
(
`DIR="
${
URI
}
"`
);
});
it
(
"
escapes spaces and other special chars
"
,
()
=>
{
const
URI
=
"
http://example.com/test/with/a space/inside
"
;
const
param
=
new
Dir
ectory
EntryRef
erence
(
URI
);
const
param
=
new
DirEntryRef
(
URI
);
const
expectedURI
=
"
http://example.com/test/with/a%20space/inside
"
;
expect
(
param
.
generate
()).
to
.
equal
(
`DIR="
${
expectedURI
}
"`
);
...
...
test/Parameter.spec.ts
→
test/Parameter
/Parameter
.spec.ts
View file @
a6ba1926
...
...
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
Parameter
from
"
../
src
/Parameter
"
;
import
Parameter
from
"
../
../src/Parameter
/Parameter
"
;
import
{
expect
}
from
"
chai
"
;
import
"
mocha
"
;
...
...
@@ -472,4 +472,4 @@ describe("Parameter", () => {
});
});
});
});
\ 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