5htp-core 0.3.6-8 → 0.3.6-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.3.6-8",
4
+ "version": "0.3.6-9",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -159,16 +159,20 @@ export default class ClientRouter<
159
159
  public url = (path: string, params: {} = {}, absolute: boolean = true) =>
160
160
  buildUrl(path, params, this.config.domains, absolute);
161
161
 
162
- public go( url: string ) {
162
+ public go( url: string, opt: {
163
+ newTab?: boolean
164
+ } = {}) {
163
165
 
164
166
  url = this.url(url, {}, false);
165
167
 
168
+ if (opt.newTab)
169
+ window.open(url)
166
170
  // Same domain = history url replacement
167
- if (url[0] === '/')
171
+ else if (url[0] === '/')
168
172
  history?.replace( url );
169
173
  // Different domain = hard navigation
170
174
  else
171
- windows.location.href = url;
175
+ window.location.href = url;
172
176
  }
173
177
 
174
178
  /*----------------------------------