aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/abc/28b2710e-38bb-4bad-bf40-dde2480e464611
-rw-r--r--files/abc/52f7bb86-f385-4bc1-aea5-38e32363e4df.jpgbin0 -> 4279 bytes
-rw-r--r--files/abc/d124ef49-e9e3-4794-bf50-76f40797b5d5bin0 -> 6785 bytes
-rw-r--r--src/FileRouter.ts3
-rw-r--r--src/db/model/User.ts2
-rw-r--r--src/matcher/options.ts11
-rw-r--r--test/unit/options.unit.test.ts6
7 files changed, 27 insertions, 6 deletions
diff --git a/files/abc/28b2710e-38bb-4bad-bf40-dde2480e4646 b/files/abc/28b2710e-38bb-4bad-bf40-dde2480e4646
new file mode 100644
index 0000000..b00f005
--- /dev/null
+++ b/files/abc/28b2710e-38bb-4bad-bf40-dde2480e4646
@@ -0,0 +1,11 @@
+------WebKitFormBoundary4I0l9vAyn9AB6jO8
+Content-Disposition: form-data; name="pres"; filename="config"
+Content-Type: application/octet-stream
+
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = false
+ logallrefupdates = true
+
+------WebKitFormBoundary4I0l9vAyn9AB6jO8--
diff --git a/files/abc/52f7bb86-f385-4bc1-aea5-38e32363e4df.jpg b/files/abc/52f7bb86-f385-4bc1-aea5-38e32363e4df.jpg
new file mode 100644
index 0000000..dd86d56
--- /dev/null
+++ b/files/abc/52f7bb86-f385-4bc1-aea5-38e32363e4df.jpg
Binary files differ
diff --git a/files/abc/d124ef49-e9e3-4794-bf50-76f40797b5d5 b/files/abc/d124ef49-e9e3-4794-bf50-76f40797b5d5
new file mode 100644
index 0000000..d7a00af
--- /dev/null
+++ b/files/abc/d124ef49-e9e3-4794-bf50-76f40797b5d5
Binary files differ
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index 9a7dcac..f7a1809 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -689,6 +689,7 @@ export class FileRouter {
// TODO Rewrite using sub-queries instead of repeated queries.
while (fileNames.length > 2) {
const fileOrNull: File | null = await File.findOne({
+ include: [{all: true}],
where: {
name: fileNames[0],
parentFolder: file
@@ -703,7 +704,7 @@ export class FileRouter {
}
const parentFolder: File | null = await File.findOne({
include: [
- { model: File, as: 'containedFilesInternal'},
+ { model: File, as: 'containedFilesInternal'}
],
where: {
//parentFolder: file,
diff --git a/src/db/model/User.ts b/src/db/model/User.ts
index 3a0ef26..73d2356 100644
--- a/src/db/model/User.ts
+++ b/src/db/model/User.ts
@@ -126,14 +126,12 @@ export default class User extends Model<User> {
}
public get fullInfo(): UserFullInfo {
- console.log("fullinfo called")
// FIXME: Fetch these things if they aren't already present
if (this.userGroups === undefined) {
this.userGroups = [];
} else if (this.projects === undefined) {
this.projects = [];
}
- console.log("2")
return {
username : this.username,
privileges: this.userGroups!
diff --git a/src/matcher/options.ts b/src/matcher/options.ts
index 0513eb3..967a6f9 100644
--- a/src/matcher/options.ts
+++ b/src/matcher/options.ts
@@ -15,13 +15,20 @@ export type Value =
const matchNoCurry:
(template: TemplateValue, value: Value | undefined) => boolean =
(template: TemplateValue, value: Value | undefined): boolean => {
+ console.log("matchNoCurry()")
+ console.log(template)
+ console.log(value)
if (types.atom(template)) {
+ console.log("atom")
return template === value;
} else if (types.function(template)) {
+ console.log("function")
return template(value);
} else if (types.atom(value) || value === undefined) {
+ console.log("atom2")
return false;
} else if (types.object(template)) {
+ console.log("object")
return Object.keys(template)
.every((key: string): boolean => {
const v: Value | undefined = value[key];
@@ -34,7 +41,11 @@ const matchNoCurry:
// tslint:disable-next-line:typedef
export const match = (template: TemplateValue, value?: Value) => {
+ console.log("match()")
+ console.log(template)
+ console.log(value)
if (value === undefined) {
+ console.log("is undefined")
return matchNoCurry.bind(null, template);
}
return matchNoCurry(template, value);
diff --git a/test/unit/options.unit.test.ts b/test/unit/options.unit.test.ts
index 4a85c2f..fd88ca6 100644
--- a/test/unit/options.unit.test.ts
+++ b/test/unit/options.unit.test.ts
@@ -209,10 +209,10 @@ describe('Matching:', () => {
options.match(template)(matchee).should.be.true;
});
- it('$$ Buy now: unit tests cheap and chearful. only £9.99', () => {
+ it.only('Matching Arrays', () => {
/* tslint:disable:align */
- const matchee: any = [ 'test' ];
- const template = types.array(types.anything);
+ const matchee: any = ['ss'];
+ const template: any = types.array;
/* tslint:enable:align */
options.match(template)(matchee).should.be.true;