mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Set filterSeparator as constant
This commit is contained in:
parent
25708dccae
commit
a801e96511
3 changed files with 10 additions and 13 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { filterSeparator } from '~/helpers/constants.js'
|
||||
|
||||
import { isString } from '~/helpers/check-types.js'
|
||||
|
||||
|
|
@ -6,7 +7,6 @@ import {
|
|||
storkScriptURL
|
||||
} from '~/helpers/stork/config.js'
|
||||
|
||||
|
||||
export function makeHighlightedMarkup ( options = {} ) {
|
||||
const {
|
||||
text,
|
||||
|
|
@ -227,9 +227,6 @@ export class StorkClient {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
const statusFilterSeparator = '_'
|
||||
|
||||
export class StorkFilters {
|
||||
constructor({
|
||||
initialFilters = {}
|
||||
|
|
@ -243,7 +240,7 @@ export class StorkFilters {
|
|||
|
||||
get list () {
|
||||
return Object.entries( this.filters ).map( ([ filterKey, filterValue ]) => {
|
||||
return `${ filterKey }${ statusFilterSeparator }${ filterValue }`
|
||||
return `${ filterKey }${ filterSeparator }${ filterValue }`
|
||||
} )
|
||||
}
|
||||
|
||||
|
|
@ -252,12 +249,12 @@ export class StorkFilters {
|
|||
}
|
||||
|
||||
isQueryValue ( filterNameOrQueryValue ) {
|
||||
return filterNameOrQueryValue.includes( statusFilterSeparator )
|
||||
return filterNameOrQueryValue.includes( filterSeparator )
|
||||
}
|
||||
|
||||
getKeyAndValue ( filterQueryValue ) {
|
||||
const key = filterQueryValue.substring(0, filterQueryValue.indexOf( statusFilterSeparator ))
|
||||
const value = filterQueryValue.substring(filterQueryValue.indexOf( statusFilterSeparator )+1)
|
||||
const key = filterQueryValue.substring(0, filterQueryValue.indexOf( filterSeparator ))
|
||||
const value = filterQueryValue.substring(filterQueryValue.indexOf( filterSeparator )+1)
|
||||
|
||||
return { key, value }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue