fix: minor typo in interpolator (#7473)

This commit is contained in:
pimothyxd 2024-06-03 04:10:22 +02:00 committed by GitHub
parent 41911f00b0
commit 109258db41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,5 @@
import { getIntepolator } from './interpolator';
import { getInterpolator } from './interpolator';
export class Environment {
private _name: string;
private kvs = new Map<string, boolean | number | string>();
@ -33,7 +34,7 @@ export class Environment {
};
replaceIn = (template: string) => {
return getIntepolator().render(template, this.toObject());
return getInterpolator().render(template, this.toObject());
};
toObject = () => {
@ -98,7 +99,7 @@ export class Variables {
replaceIn = (template: string) => {
const context = this.toObject();
return getIntepolator().render(template, context);
return getInterpolator().render(template, context);
};
toObject = () => {

View File

@ -1,7 +1,7 @@
import { fakerFunctions } from 'insomnia/src/ui/components/templating/faker-functions';
import { configure, type ConfigureOptions, type Environment as NunjuncksEnv } from 'nunjucks';
class Intepolator {
class Interpolator {
private engine: NunjuncksEnv;
constructor(config: ConfigureOptions) {
@ -50,7 +50,7 @@ class Intepolator {
};
}
const intepolator = new Intepolator({
const interpolator = new Interpolator({
autoescape: false,
// Don't escape HTML
throwOnUndefined: true,
@ -65,6 +65,6 @@ const intepolator = new Intepolator({
},
});
export function getIntepolator() {
return intepolator;
export function getInterpolator() {
return interpolator;
}