22 lines
497 B
JavaScript
22 lines
497 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import { helper } from '@ember/component/helper';
|
|
import { serialize } from 'nomad-ui/utils/qp-serialize';
|
|
|
|
/**
|
|
* Query Param Serialize
|
|
*
|
|
* Usage: {{qp-serialize array}}
|
|
*
|
|
* Turns an array of values into a safe url encoded query param
|
|
* value. This serialization is used throughout the app for facets.
|
|
*/
|
|
export function qpSerialize([values]) {
|
|
return serialize(values);
|
|
}
|
|
|
|
export default helper(qpSerialize);
|