Skip to content

Commit

Permalink
Fixed code format
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienCastex committed May 21, 2017
1 parent 0f9bbf1 commit 60f521b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/helper/XML.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export declare abstract class XML {
name: string;
attributes: any;
elements: any[];
ele: (name: string, attributes?: any) => any;
add: (element: any) => any;
ele(name: string, attributes?: any): any;
add(element: any): any;
eleFn: (name: string, attributes?: any, text?: string) => any;
};
}
2 changes: 1 addition & 1 deletion lib/manager/VirtualFSManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var VirtualFSManager = (function () {
return this._instance;
};
VirtualFSManager.prototype.serialize = function (resource) {
var obj;
var obj = {};
obj.name = resource.name;
if (resource.children)
obj.children = resource.children;
Expand Down
2 changes: 1 addition & 1 deletion lib/server/WebDAVServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var WebDAVServer = (function () {
};
WebDAVServer.prototype.stop = function (callback) {
if (this.server) {
this.server.close(function () { return callback(); });
this.server.close(callback);
this.server = null;
}
else
Expand Down
6 changes: 3 additions & 3 deletions lib/server/commands/Put.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function default_1(arg, callback) {
});
}
else {
var data = new Buffer(arg.data);
var data_1 = new Buffer(arg.data);
if (e) {
createResource(arg, callback, function (r) {
r.write(data, function (e) {
r.write(data_1, function (e) {
if (e)
arg.setCode(WebDAVRequest_1.HTTPCodes.InternalServerError);
else
Expand All @@ -72,7 +72,7 @@ function default_1(arg, callback) {
return;
}
arg.requirePrivilege(['canWrite'], r, function () {
r.write(data, function (e) {
r.write(data_1, function (e) {
if (e)
arg.setCode(WebDAVRequest_1.HTTPCodes.InternalServerError);
else
Expand Down
12 changes: 6 additions & 6 deletions src/helper/XML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ function seekForNS(node : any, parentNS : any) : any

function mutateNodeNS(node : any, parentNS = { _default: 'DAV' })
{
var nss = seekForNS(node, parentNS);
const nss = seekForNS(node, parentNS);

if(node.name)
{
for(var ns in nss)
for(const ns in nss)
{
if(ns === '_default')
continue;
Expand Down Expand Up @@ -143,16 +143,16 @@ export abstract class XML

const result = {
type: 'element',
name: name,
attributes: attributes,
name,
attributes,
elements: [],
ele: function(name : string, attributes ?: any)
ele(name : string, attributes ?: any)
{
const el = result.eleFn(name, attributes);
result.elements.push(el);
return el;
},
add: function(element : any)
add(element : any)
{
if(element.constructor === String || element.constructor === Number || element.constructor === Boolean)
element = {
Expand Down
4 changes: 2 additions & 2 deletions src/manager/VirtualFSManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export class VirtualFSManager implements FSManager

serialize(resource : any) : object
{
let obj : {
const obj : {
name,
children,
content
};
} = { } as any;

obj.name = resource.name;
if(resource.children)
Expand Down
2 changes: 1 addition & 1 deletion src/server/WebDAVServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class WebDAVServer
{
if(this.server)
{
this.server.close(() => callback());
this.server.close(callback);
this.server = null;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/server/commands/Put.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function(arg : MethodCallArgs, callback)
}
else
{ // Write to a file
var data = new Buffer(arg.data);
const data = new Buffer(arg.data);

if(e)
{ // Resource not found
Expand Down
1 change: 0 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"quotemark": [ true, "single" ],
"return-undefined": true,
"space-before-function-paren": [true, "never"],
"variable-name": [ true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-trailing-underscore", "allow-snake-case" ],
"whitespace": [ true, "check-decl", "check-operator", "check-module", "check-separator", "check-typecast", "check-preblock" ]
}
}

0 comments on commit 60f521b

Please sign in to comment.