From 970efe3331f1e4af427756e6991a39d3c8ff9750 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Fri, 27 Feb 2015 23:45:31 -0500 Subject: [PATCH] chore(all): prepare release 0.4.4 --- bower.json | 2 +- config.js | 3 ++- dist/amd/index.js | 24 ++++++++++++++++++++++-- dist/commonjs/index.js | 24 ++++++++++++++++++++++-- dist/system/index.js | 26 ++++++++++++++++++++++---- doc/CHANGELOG.md | 5 ++++- package.json | 2 +- 7 files changed, 74 insertions(+), 12 deletions(-) diff --git a/bower.json b/bower.json index 45727f5..0743728 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-path", - "version": "0.4.3", + "version": "0.4.4", "description": "Utilities for path manipulation.", "keywords": [ "aurelia", diff --git a/config.js b/config.js index 0bd2a6a..6c0069b 100644 --- a/config.js +++ b/config.js @@ -2,4 +2,5 @@ System.config({ "paths": { "*": "*.js" } -}); \ No newline at end of file +}); + diff --git a/dist/amd/index.js b/dist/amd/index.js index 6fe8c4d..cbd8de1 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -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) { @@ -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); } @@ -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); }; @@ -108,6 +120,7 @@ define(["exports"], function (exports) { _buildQueryString(prefix, a[prefix], traditional, add); } + // Return the resulting serialization return s.join("&").replace(r20, "+"); } @@ -115,20 +128,27 @@ define(["exports"], function (exports) { 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 + }); }); \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 0eeebec..e7a606a 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -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) { @@ -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); } @@ -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); }; @@ -107,6 +119,7 @@ function buildQueryString(a, traditional) { _buildQueryString(prefix, a[prefix], traditional, add); } + // Return the resulting serialization return s.join("&").replace(r20, "+"); } @@ -114,19 +127,26 @@ 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; \ No newline at end of file +Object.defineProperty(exports, "__esModule", { + value: true +}); \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js index e2bfcae..d8f8af5 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,7 +1,6 @@ System.register([], function (_export) { - "use strict"; - var r20, rbracket, class2type; + _export("relativeToFile", relativeToFile); _export("join", join); @@ -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) { @@ -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); } @@ -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); }; @@ -104,6 +115,7 @@ System.register([], function (_export) { _buildQueryString(prefix, a[prefix], traditional, add); } + // Return the resulting serialization return s.join("&").replace(r20, "+"); } @@ -111,29 +123,35 @@ System.register([], function (_export) { 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(); }); diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index f6fe0f3..a395c06 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.4.4 (2015-02-27) + +* Update compiler. + ### 0.4.3 (2015-02-11) @@ -46,4 +50,3 @@ #### Features * **join:** add a utility for joining paths ([9342f179](http://github.com/aurelia/path/commit/9342f179e548847f6c27d7e8a5b7fbb275f9c5b2)) - diff --git a/package.json b/package.json index f239be6..859f8af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-path", - "version": "0.4.3", + "version": "0.4.4", "description": "Utilities for path manipulation.", "keywords": [ "aurelia",