diff --git a/README.md b/README.md index 49c0014..72ff8e7 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,16 @@ For JSPM users: } ``` +## Deployment + +- Choose your new version number +- Set it in `package.json` and `bower.json` +- Create a tag: `git tag [version]` +- Push the tag: `git push --tags` +- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) +- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow + +Done. # Contribute diff --git a/bower.json b/bower.json index 6d08ad4..d79bd0f 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "Microsoft Corp." ], "homepage": "http://typescriptlang.org/", - "version": "2.2.0", + "version": "2.3.0", "license": "0BSD", "description": "Runtime library for TypeScript helper functions", "keywords": [ diff --git a/package.json b/package.json index b04c3cd..dfeaeba 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tslib", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "2.2.0", + "version": "2.3.0", "license": "0BSD", "description": "Runtime library for TypeScript helper functions", "keywords": [ diff --git a/tslib.d.ts b/tslib.d.ts index a6aea8b..76e89d1 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -27,7 +27,7 @@ export declare function __read(o: any, n?: number): any[]; export declare function __spread(...args: any[][]): any[]; /** @deprecated since TypeScript 4.2 */ export declare function __spreadArrays(...args: any[][]): any[]; -export declare function __spreadArray(to: any[], from: any[]): any[]; +export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[]; export declare function __await(v: any): any; export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; export declare function __asyncDelegator(o: any): any; diff --git a/tslib.es6.js b/tslib.es6.js index 5de1e31..93311d3 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -162,10 +162,14 @@ export function __spreadArrays() { return r; } -export function __spreadArray(to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; +export function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); } export function __await(v) { diff --git a/tslib.js b/tslib.js index e462859..62639f0 100644 --- a/tslib.js +++ b/tslib.js @@ -203,10 +203,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) {