@coorpacademy/history
Advanced tools
Comparing version 5.3.15 to 5.3.16
@@ -1,11 +0,10 @@ | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import { parse } from 'url'; | ||
import { createBrowserHistory as _createBrowserHistory, createMemoryHistory as _createMemoryHistory, createHashHistory as _createHashHistory } from 'history'; | ||
export const useBasename = createHistory => options => { | ||
const { basename = '' } = options || {}; | ||
const { | ||
basename = '' | ||
} = options || {}; | ||
const history = createHistory(options); | ||
return _extends({}, history, { | ||
@@ -19,3 +18,2 @@ createHref: location => { | ||
}; | ||
export const createBrowserHistory = useBasename(_createBrowserHistory); | ||
@@ -22,0 +20,0 @@ export const createMemoryHistory = useBasename(_createMemoryHistory); |
@@ -1,17 +0,17 @@ | ||
'use strict'; | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.createHashHistory = exports.createMemoryHistory = exports.createBrowserHistory = exports.useBasename = undefined; | ||
exports.createHashHistory = exports.createMemoryHistory = exports.createBrowserHistory = exports.useBasename = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _url = require("url"); | ||
var _url = require('url'); | ||
var _history = require("history"); | ||
var _history = require('history'); | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
const useBasename = exports.useBasename = createHistory => options => { | ||
const { basename = '' } = options || {}; | ||
const useBasename = createHistory => options => { | ||
const { | ||
basename = '' | ||
} = options || {}; | ||
const history = createHistory(options); | ||
return _extends({}, history, { | ||
@@ -26,5 +26,9 @@ createHref: location => { | ||
const createBrowserHistory = exports.createBrowserHistory = useBasename(_history.createBrowserHistory); | ||
const createMemoryHistory = exports.createMemoryHistory = useBasename(_history.createMemoryHistory); | ||
const createHashHistory = exports.createHashHistory = useBasename(_history.createHashHistory); | ||
exports.useBasename = useBasename; | ||
const createBrowserHistory = useBasename(_history.createBrowserHistory); | ||
exports.createBrowserHistory = createBrowserHistory; | ||
const createMemoryHistory = useBasename(_history.createMemoryHistory); | ||
exports.createMemoryHistory = createMemoryHistory; | ||
const createHashHistory = useBasename(_history.createHashHistory); | ||
exports.createHashHistory = createHashHistory; | ||
//# sourceMappingURL=history.js.map |
{ | ||
"name": "@coorpacademy/history", | ||
"version": "5.3.15", | ||
"version": "5.3.16", | ||
"description": "", | ||
@@ -38,7 +38,7 @@ "main": "lib/history.js", | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"@babel/cli": "^7.4.3", | ||
"@babel/core": "^7.4.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.4.3", | ||
"@babel/preset-env": "^7.4.3", | ||
"babel-plugin-istanbul": "^4.1.4", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-preset-env": "^1.5.2", | ||
"cross-env": "^5.0.0", | ||
@@ -50,3 +50,3 @@ "eslint": "^4.18.2", | ||
"author": "CoorpAcademy", | ||
"gitHead": "804fb805b3d1f34deb314d612e73702e52639e66" | ||
"gitHead": "e453c637a5638431446e42a68c8149be9c01a9a6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12420
9
85