mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
make protractor tests work
This commit is contained in:
29
src/util.js
29
src/util.js
@@ -28,10 +28,10 @@ export function defaults(dest) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
export let isString = val => typeof val === 'string';
|
||||
export let isFunction = val => typeof val === 'function';
|
||||
export let isDefined = val => typeof val === 'undefined';
|
||||
export let isObject = val => typeof val === 'object';
|
||||
export let isString = val => typeof val === 'string'
|
||||
export let isFunction = val => typeof val === 'function'
|
||||
export let isDefined = val => typeof val === 'undefined'
|
||||
export let isObject = val => typeof val === 'object'
|
||||
|
||||
export function pascalCaseToDashCase(str = '') {
|
||||
return str.charAt(0).toLowerCase() + str.substring(1).replace(/[A-Z]/g, match => {
|
||||
@@ -42,10 +42,10 @@ export function pascalCaseToDashCase(str = '') {
|
||||
export let array = {
|
||||
unique(array) {
|
||||
return array.filter((value, index) => {
|
||||
return array.indexOf(value) === index;
|
||||
});
|
||||
return array.indexOf(value) === index
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class Log {
|
||||
static log(...args) {
|
||||
@@ -64,3 +64,18 @@ export class Log {
|
||||
console.error.apply(console, args)
|
||||
}
|
||||
}
|
||||
|
||||
export function readQueryParams() {
|
||||
var queryParams = {}
|
||||
const startIndex = window.location.href.indexOf('?')
|
||||
if (startIndex !== -1) {
|
||||
const queries = window.location.href.slice(startIndex + 1).split('&')
|
||||
if (queries.length) {
|
||||
queries.forEach((param) => {
|
||||
var split = param.split('=')
|
||||
queryParams[split[0]] = split[1]
|
||||
})
|
||||
}
|
||||
}
|
||||
return queryParams
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user