Change from js to ts
This commit is contained in:
parent
3b757476e0
commit
046e27c737
|
@ -11,7 +11,7 @@ const production = !process.env.ROLLUP_WATCH
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
input: "src/index.js",
|
input: "src/index.ts",
|
||||||
output: {
|
output: {
|
||||||
sourcemap: !production,
|
sourcemap: !production,
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { create } from "handlebars"
|
||||||
import { registerAll, registerMinimum } from "./helpers/index"
|
import { registerAll, registerMinimum } from "./helpers/index"
|
||||||
import { preprocess, postprocess } from "./processors"
|
import { preprocess, postprocess } from "./processors"
|
||||||
import { atob, btoa, isBackendService } from "./utilities"
|
import { atob, btoa, isBackendService } from "./utilities"
|
||||||
import manifest from "../manifest.json"
|
const manifest = require("../manifest.json")
|
||||||
import {
|
import {
|
||||||
FIND_HBS_REGEX,
|
FIND_HBS_REGEX,
|
||||||
FIND_ANY_HBS_REGEX,
|
FIND_ANY_HBS_REGEX,
|
|
@ -11,12 +11,15 @@ export const PreprocessorNames = {
|
||||||
|
|
||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
class Preprocessor {
|
class Preprocessor {
|
||||||
|
private name: string
|
||||||
|
private fn: any
|
||||||
|
|
||||||
constructor(name, fn) {
|
constructor(name, fn) {
|
||||||
this.name = name
|
this.name = name
|
||||||
this.fn = fn
|
this.fn = fn
|
||||||
}
|
}
|
||||||
|
|
||||||
process(fullString, statement, opts) {
|
process(fullString: string, statement: string, opts: Object) {
|
||||||
const output = this.fn(statement, opts)
|
const output = this.fn(statement, opts)
|
||||||
const idx = fullString.indexOf(statement)
|
const idx = fullString.indexOf(statement)
|
||||||
return swapStrings(fullString, idx, statement.length, output)
|
return swapStrings(fullString, idx, statement.length, output)
|
Loading…
Reference in New Issue