Skip to content

Commit

Permalink
chore(all): prepare release 0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 28, 2015
1 parent 4b816b3 commit 970efe3
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-path",
"version": "0.4.3",
"version": "0.4.4",
"description": "Utilities for path manipulation.",
"keywords": [
"aurelia",
Expand Down
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ System.config({
"paths": {
"*": "*.js"
}
});
});

24 changes: 22 additions & 2 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ define(["exports"], function (exports) {
ary.splice(i, 1);
i -= 1;
} else if (part === "..") {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || i == 1 && ary[2] === ".." || ary[i - 1] === "..") {
continue;
} else if (i > 0) {
Expand All @@ -31,6 +36,11 @@ define(["exports"], function (exports) {
name = name.split("/");

if (name[0].charAt(0) === "." && fileParts) {
//Convert file to array, and lop off the last part,
//so that . matches that 'directory' and not name of the file's
//module. For instance, file of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = fileParts.slice(0, fileParts.length - 1);
name = normalizedBaseParts.concat(name);
}
Expand Down Expand Up @@ -93,13 +103,15 @@ define(["exports"], function (exports) {
return obj + "";
}

// Support: Android<4.0 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
}

function buildQueryString(a, traditional) {
var prefix,
s = [],
add = function (key, value) {
add = function add(key, value) {
// If value is a function, invoke it and return its value
value = typeof value === "function" ? value() : value == null ? "" : value;
s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
Expand All @@ -108,27 +120,35 @@ define(["exports"], function (exports) {
_buildQueryString(prefix, a[prefix], traditional, add);
}

// Return the resulting serialization
return s.join("&").replace(r20, "+");
}

function _buildQueryString(prefix, obj, traditional, add) {
var name;

if (Array.isArray(obj)) {
// Serialize array item.
obj.forEach(function (v, i) {
if (traditional || rbracket.test(prefix)) {
// Treat each array item as a scalar.
add(prefix, v);
} else {
// Item is non-scalar (array or object), encode its numeric index.
_buildQueryString(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
}
});
} else if (!traditional && type(obj) === "object") {
// Serialize object item.
for (name in obj) {
_buildQueryString(prefix + "[" + name + "]", obj[name], traditional, add);
}
} else {
// Serialize scalar item.
add(prefix, obj);
}
}
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
});
24 changes: 22 additions & 2 deletions dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ function trimDots(ary) {
ary.splice(i, 1);
i -= 1;
} else if (part === "..") {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || i == 1 && ary[2] === ".." || ary[i - 1] === "..") {
continue;
} else if (i > 0) {
Expand All @@ -30,6 +35,11 @@ function relativeToFile(name, file) {
name = name.split("/");

if (name[0].charAt(0) === "." && fileParts) {
//Convert file to array, and lop off the last part,
//so that . matches that 'directory' and not name of the file's
//module. For instance, file of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = fileParts.slice(0, fileParts.length - 1);
name = normalizedBaseParts.concat(name);
}
Expand Down Expand Up @@ -92,13 +102,15 @@ function type(obj) {
return obj + "";
}

// Support: Android<4.0 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
}

function buildQueryString(a, traditional) {
var prefix,
s = [],
add = function (key, value) {
add = function add(key, value) {
// If value is a function, invoke it and return its value
value = typeof value === "function" ? value() : value == null ? "" : value;
s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
Expand All @@ -107,26 +119,34 @@ function buildQueryString(a, traditional) {
_buildQueryString(prefix, a[prefix], traditional, add);
}

// Return the resulting serialization
return s.join("&").replace(r20, "+");
}

function _buildQueryString(prefix, obj, traditional, add) {
var name;

if (Array.isArray(obj)) {
// Serialize array item.
obj.forEach(function (v, i) {
if (traditional || rbracket.test(prefix)) {
// Treat each array item as a scalar.
add(prefix, v);
} else {
// Item is non-scalar (array or object), encode its numeric index.
_buildQueryString(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
}
});
} else if (!traditional && type(obj) === "object") {
// Serialize object item.
for (name in obj) {
_buildQueryString(prefix + "[" + name + "]", obj[name], traditional, add);
}
} else {
// Serialize scalar item.
add(prefix, obj);
}
}
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
26 changes: 22 additions & 4 deletions dist/system/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
System.register([], function (_export) {
"use strict";

var r20, rbracket, class2type;

_export("relativeToFile", relativeToFile);

_export("join", join);
Expand All @@ -16,6 +15,11 @@ System.register([], function (_export) {
ary.splice(i, 1);
i -= 1;
} else if (part === "..") {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || i == 1 && ary[2] === ".." || ary[i - 1] === "..") {
continue;
} else if (i > 0) {
Expand All @@ -35,6 +39,11 @@ System.register([], function (_export) {
name = name.split("/");

if (name[0].charAt(0) === "." && fileParts) {
//Convert file to array, and lop off the last part,
//so that . matches that 'directory' and not name of the file's
//module. For instance, file of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = fileParts.slice(0, fileParts.length - 1);
name = normalizedBaseParts.concat(name);
}
Expand Down Expand Up @@ -89,13 +98,15 @@ System.register([], function (_export) {
return obj + "";
}

// Support: Android<4.0 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
}

function buildQueryString(a, traditional) {
var prefix,
s = [],
add = function (key, value) {
add = function add(key, value) {
// If value is a function, invoke it and return its value
value = typeof value === "function" ? value() : value == null ? "" : value;
s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
Expand All @@ -104,36 +115,43 @@ System.register([], function (_export) {
_buildQueryString(prefix, a[prefix], traditional, add);
}

// Return the resulting serialization
return s.join("&").replace(r20, "+");
}

function _buildQueryString(prefix, obj, traditional, add) {
var name;

if (Array.isArray(obj)) {
// Serialize array item.
obj.forEach(function (v, i) {
if (traditional || rbracket.test(prefix)) {
// Treat each array item as a scalar.
add(prefix, v);
} else {
// Item is non-scalar (array or object), encode its numeric index.
_buildQueryString(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
}
});
} else if (!traditional && type(obj) === "object") {
// Serialize object item.
for (name in obj) {
_buildQueryString(prefix + "[" + name + "]", obj[name], traditional, add);
}
} else {
// Serialize scalar item.
add(prefix, obj);
}
}
return {
setters: [],
execute: function () {
"use strict";

r20 = /%20/g;
rbracket = /\[\]$/;
class2type = {};


"Boolean Number String Function Array Date RegExp Object Error".split(" ").forEach(function (name, i) {
class2type["[object " + name + "]"] = name.toLowerCase();
});
Expand Down
5 changes: 4 additions & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.4.4 (2015-02-27)

* Update compiler.

### 0.4.3 (2015-02-11)


Expand Down Expand Up @@ -46,4 +50,3 @@
#### Features

* **join:** add a utility for joining paths ([9342f179](http://github.com/aurelia/path/commit/9342f179e548847f6c27d7e8a5b7fbb275f9c5b2))

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-path",
"version": "0.4.3",
"version": "0.4.4",
"description": "Utilities for path manipulation.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 970efe3

Please sign in to comment.