UNPKG

@empathyco/x-components

Version:
20 lines (18 loc) 614 B
/** * Creates a {@link QueryOrigin} or a {@link ResultOrigin} string given a {@link QueryFeature} and * a {@link FeatureLocation}. * If it can't be created, it returns `null`. * * @param originInit - An object containing the needed properties to create a {@link QueryOrigin} or * a {@link ResultOrigin}. * @returns The composed origin, or `null` if it is not able to create the origin. * @internal */ function createOrigin({ feature, location, }) { if (feature) { return `${feature}:${location ?? 'none'}`; } return null; } export { createOrigin }; //# sourceMappingURL=origin.js.map