1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00

Change from js to ts

This commit is contained in:
Adria Navarro 2024-02-21 20:50:57 +01:00
parent 3b757476e0
commit 046e27c737
15 changed files with 6 additions and 3 deletions

View file

@ -11,7 +11,7 @@ const production = !process.env.ROLLUP_WATCH
export default [
{
input: "src/index.js",
input: "src/index.ts",
output: {
sourcemap: !production,
format: "cjs",

View file

@ -3,7 +3,7 @@ import { create } from "handlebars"
import { registerAll, registerMinimum } from "./helpers/index"
import { preprocess, postprocess } from "./processors"
import { atob, btoa, isBackendService } from "./utilities"
import manifest from "../manifest.json"
const manifest = require("../manifest.json")
import {
FIND_HBS_REGEX,
FIND_ANY_HBS_REGEX,

View file

@ -11,12 +11,15 @@ export const PreprocessorNames = {
/* eslint-disable no-unused-vars */
class Preprocessor {
private name: string
private fn: any
constructor(name, fn) {
this.name = name
this.fn = fn
}
process(fullString, statement, opts) {
process(fullString: string, statement: string, opts: Object) {
const output = this.fn(statement, opts)
const idx = fullString.indexOf(statement)
return swapStrings(fullString, idx, statement.length, output)