@budibase/string-templates 2.22.1 → 2.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/bundle.cjs +1 -0
  2. package/dist/bundle.mjs +1 -1
  3. package/dist/conversion/index.d.ts +2 -2
  4. package/dist/errors.d.ts +1 -2
  5. package/dist/helpers/Helper.d.ts +9 -8
  6. package/dist/helpers/constants.d.ts +8 -8
  7. package/dist/helpers/date.d.ts +2 -2
  8. package/dist/helpers/external.d.ts +8 -15
  9. package/dist/helpers/index.d.ts +5 -6
  10. package/dist/helpers/javascript.d.ts +7 -4
  11. package/dist/helpers/list.d.ts +2 -2
  12. package/dist/iife.d.ts +1 -1
  13. package/dist/index.d.ts +1078 -20
  14. package/dist/processors/index.d.ts +3 -2
  15. package/dist/processors/postprocessor.d.ts +7 -7
  16. package/dist/processors/preprocessor.d.ts +10 -10
  17. package/dist/tsconfig.tsbuildinfo +1 -0
  18. package/dist/types.d.ts +8 -0
  19. package/dist/utilities.d.ts +11 -11
  20. package/package.json +13 -13
  21. package/src/conversion/{index.js → index.ts} +13 -11
  22. package/src/errors.ts +3 -0
  23. package/src/helpers/Helper.ts +34 -0
  24. package/src/helpers/{constants.js → constants.ts} +3 -3
  25. package/src/helpers/{date.js → date.ts} +26 -16
  26. package/src/helpers/{external.js → external.ts} +13 -11
  27. package/src/helpers/index.ts +103 -0
  28. package/src/helpers/{javascript.js → javascript.ts} +20 -18
  29. package/src/helpers/{list.js → list.ts} +11 -11
  30. package/src/iife.ts +3 -0
  31. package/src/{index.js → index.ts} +100 -85
  32. package/src/processors/{index.js → index.ts} +7 -6
  33. package/src/processors/postprocessor.ts +56 -0
  34. package/src/processors/preprocessor.ts +82 -0
  35. package/src/types.ts +8 -0
  36. package/src/{utilities.js → utilities.ts} +22 -17
  37. package/dist/index.d.mts +0 -23
  38. package/src/errors.js +0 -11
  39. package/src/helpers/Helper.js +0 -29
  40. package/src/helpers/index.js +0 -100
  41. package/src/iife.js +0 -3
  42. package/src/index.mjs +0 -26
  43. package/src/processors/postprocessor.js +0 -49
  44. package/src/processors/preprocessor.js +0 -78
  45. /package/{manifest.json → src/manifest.json} +0 -0
@@ -1,2 +1,3 @@
1
- export function preprocess(string: any, opts: any): any;
2
- export function postprocess(string: any): any;
1
+ import { ProcessOptions } from "../types";
2
+ export declare function preprocess(string: string, opts: ProcessOptions): string;
3
+ export declare function postprocess(string: string): string;
@@ -1,11 +1,11 @@
1
- export const processors: Postprocessor[];
2
- export namespace PostProcessorNames {
3
- let CONVERT_LITERALS: string;
4
- }
1
+ export declare const PostProcessorNames: {
2
+ CONVERT_LITERALS: string;
3
+ };
5
4
  declare class Postprocessor {
6
- constructor(name: any, fn: any);
7
- name: any;
8
- fn: any;
5
+ name: string;
6
+ private fn;
7
+ constructor(name: string, fn: any);
9
8
  process(statement: any): any;
10
9
  }
10
+ export declare const processors: Postprocessor[];
11
11
  export {};
@@ -1,13 +1,13 @@
1
- export const processors: Preprocessor[];
1
+ export declare const PreprocessorNames: {
2
+ SWAP_TO_DOT: string;
3
+ FIX_FUNCTIONS: string;
4
+ FINALISE: string;
5
+ };
2
6
  declare class Preprocessor {
3
- constructor(name: any, fn: any);
4
- name: any;
5
- fn: any;
6
- process(fullString: any, statement: any, opts: any): any;
7
- }
8
- export namespace PreprocessorNames {
9
- let SWAP_TO_DOT: string;
10
- let FIX_FUNCTIONS: string;
11
- let FINALISE: string;
7
+ name: string;
8
+ private fn;
9
+ constructor(name: string, fn: any);
10
+ process(fullString: string, statement: string, opts: Object): string;
12
11
  }
12
+ export declare const processors: Preprocessor[];
13
13
  export {};
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/errors.ts","../src/iife.ts","../../../node_modules/handlebars/types/index.d.ts","../src/helpers/Helper.ts","../../../node_modules/dayjs/locale/types.d.ts","../../../node_modules/dayjs/locale/index.d.ts","../../../node_modules/dayjs/index.d.ts","../../../node_modules/dayjs/plugin/duration.d.ts","../../../node_modules/dayjs/plugin/advancedFormat.d.ts","../../../node_modules/dayjs/plugin/isoWeek.d.ts","../../../node_modules/dayjs/plugin/weekYear.d.ts","../../../node_modules/dayjs/plugin/weekOfYear.d.ts","../../../node_modules/dayjs/plugin/relativeTime.d.ts","../../../node_modules/dayjs/plugin/utc.d.ts","../../../node_modules/dayjs/plugin/timezone.d.ts","../src/helpers/date.ts","../src/helpers/constants.ts","../src/helpers/external.ts","../src/utilities.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash/fp.d.ts","../../../node_modules/@types/lodash/fp/cloneDeep.d.ts","../src/helpers/list.ts","../src/helpers/javascript.ts","../src/helpers/index.ts","../src/processors/preprocessor.ts","../src/processors/postprocessor.ts","../src/types.ts","../src/processors/index.ts","../src/conversion/index.ts","../src/manifest.json","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"2ac9cdcfb8f8875c18d14ec5796a8b029c426f73ad6dc3ffb580c228b58d1c44","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"0075fa5ceda385bcdf3488e37786b5a33be730e8bc4aa3cf1e78c63891752ce8","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"09226e53d1cfda217317074a97724da3e71e2c545e18774484b61562afc53cd2","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"8b41361862022eb72fcc8a7f34680ac842aca802cf4bc1f915e8c620c9ce4331","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"f35a831e4f0fe3b3697f4a0fe0e3caa7624c92b78afbecaf142c0f93abfaf379","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"7a1971efcba559ea9002ada4c4e3c925004fb67a755300d53b5edf9399354900",{"version":"101a5d2b6cb7b5500052a42dade0090833c6ec18f587a3e52f9d932796c2d2cb","signature":"930b8530275fd082c29af6f65523902775e5a1604fa7477676587fb9899a45bd"},{"version":"723c40015eef4c59b2c099f472160bdf283be7a829ee013911f60e68547700b1","signature":"e9c75226885725165dc38bd0606a65beb452794f1ef6200877de28a6322f2d31"},{"version":"f3a68054f682f21cec1eb6bc37d3c4c7f73b7723c7256f8a1ccc75873024aaa6","affectsGlobalScope":true},{"version":"e8a58f79a6c93e72a3dd41288f01822407c818da1147a6710e2b78ac7855b771","signature":"7d4d03abff2e558cef6f532e83d6b7d700116b9f83f6369e1882595061813b8a"},{"version":"73a0ee6395819b063df4b148211985f2e1442945c1a057204cf4cf6281760dc3","affectsGlobalScope":true},"d05d8c67116dceafc62e691c47ac89f8f10cf7313cd1b2fb4fe801c2bf1bb1a7","ccff6a039925da0bbddce77e8fe06865bb4bc144f8ca2f729b4390015044183b","112dc31db3c5f45551532c2f0ddd2b55c98762c3cb5fd113f7c255825e6e04b2","49123f65d0f1270a60f5cdb7220dea12d9fcbff320447c933511cb1f7168a11b","9ff194a196707954313c197ff74831edf396ee89f6b6e50cd5fe9e07b8d7d46b","e07e8ad944e11080473becbc5129b162302dd991b438f97dbff930e59d94ff98","da1de218850a5710c84587f9ceecac7106c62f92a75a121cb1106fca10aed46b","f684f2969931de8fb9a5164f8c8f51aaea4025f4eede98406a17642a605c2842","c868f50837eedd81fa9f61bd42de6665f74e7eb7a459135c6a14ac33ddc86798","56b2090352084289a1d572dfbddeed948906c0a0317a547ceb0ae6436ae44037",{"version":"8e4e1881895b80cc7154eb1e31595e0784ec11cc0930f0589c25dc502f071650","signature":"9041bc1bfa4e56b13e37cacea5f61f8155bb36345f369496fab6c5f4f15108e5"},{"version":"4e6cf591bc5aea7bede9128c0b5c5a02fa6581928c3e0c6c84632ab6f862a204","signature":"058a65c8dfef724e8bd7e56c624c6a6d9897478f39a2be5f00ceced31ebee25d"},{"version":"efd157d1397ba67912ada9c1a978d72d8b23bc523b277c381f14f67f52fc4fbf","signature":"deb1c3ad903b5040d72f25d7465c6ab18154636611d8eac79e5c378f970d96a6"},{"version":"af1745fe6489bb07a9c310cd4bff858ace38829ec3b0f276a0ae744d61042cd8","signature":"0e8a99dc2372ce91ce22ee79755b79396c28ad2484e6f37733a4dbcf6a6b379e"},"32ab25b7b28b24a138d879ca371b18c8fdfdd564ad5107e1333c5aa5d5fea494","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","da2b6356b84a40111aaecb18304ea4e4fcb43d70efb1c13ca7d7a906445ee0d3","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","6f294731b495c65ecf46a5694f0082954b961cf05463bea823f8014098eaffa0","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","b03afe4bec768ae333582915146f48b161e567a81b5ebc31c4d78af089770ac9","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","b82fc740467e59abe3d6170417e461527d2a95610f55915fc59557c4b7be55ba","07f4a3755c28e85f366e753c73a1b447f691e11d0edf2d97af216343842699ac","164c9cda5f835244f0ce1de5d4874cf91bfb49141d0daf71fef8f3ee2caeaee2",{"version":"23a7fe19ba79792d5a23b77f7089bc6b277e7a217e79c7e67d3eecd8969751b0","signature":"98a5d38d7f4e434bb6e45f9042f6d6f573d0551238d8466fdc410a6c65572dab"},{"version":"9110891845555709654260b9f426fc2c78b6fea57d6858c6ef7a88bbdda1d249","signature":"0ec46beeed75e26cec533759fe98273bb5bbb4c4cb7969f47212fbfcf014d1ee"},{"version":"47b297799559c49543506ed1615fa3b15b7641165dbf0d7739b322870adaec76","signature":"9ba2f9566ee89776839d5dd735346a12b32eb2835d34de07919a4acf9cdf4727"},{"version":"7b859f03329c201c0b6f74dc5adfa2f19e89453f28cce4f0316b75bf2828ee63","signature":"f69b23a28cd6047c6d7db0fadfa6361fa0f33c2dfa4524330de3e4d5d4ad8dda"},{"version":"15f71fac8c4746d7b9bb364809f0c08a91483b04ce35f5fc8b468b7816e3f125","signature":"0f838f208efe25839f9c3f7b357fd52a1f2ecfceceffe4fa177b089d420eb2cc"},{"version":"dde1e6a0048c29bdc81dbf6fc13576de5bdba0c03770a75f88458becaf1d8b6b","signature":"467892304baffcfa900842d6619a4900430da8a7595f19e7b5b30cd49e027c87"},{"version":"44f85e4def539a9681e67fe428a76f01584550037837d92ddb4504433a44cc76","signature":"d39711fe7e811e2eacb8afca02ead1a2731a2fc26c24163d4772a8beffd6ab10"},{"version":"397b3f81ff0d841de6d758e673042b5006f68782d1f8db88786b402436a0e083","signature":"65806d7ad4ebdc86e595451fd79df972c58730f71c2158af9cc3b581aeb7f6ee"},"475cf6d8e4837489ff588dc40f01cf14453644baf76c0c6157f800b77caef536",{"version":"2b41cef576e70215501b4c8a6d556e8925c556c86f23bb400946b5b41260ff9c","signature":"c54fea08fa6c8d17d2b3445a4cef725dd55131ea151baca307274a179aae8398"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"4d719cfab49ae4045d15cb6bed0f38ad3d7d6eb7f277d2603502a0f862ca3182","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true},{"version":"b7eadc0b0cba14ab854122810f330314132c5cfdb7800fceb82d521997a1f5b0","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"0ed13c80faeb2b7160bffb4926ff299c468e67a37a645b3ae0917ba0db633c1b","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec",{"version":"c8950367d1812758e9e354c695c60c3e6311bf2cd98b9f9eb469a19df8a9a486","affectsGlobalScope":true}],"root":[47,48,50,[62,65],[81,88],90],"options":{"declaration":true,"emitDeclarationOnly":false,"esModuleInterop":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitHelpers":true,"noImplicitAny":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"target":2},"fileIdsList":[[170],[170,180],[170,182,185],[66,68,69,70,71,72,73,74,75,76,77,78,170],[66,67,69,70,71,72,73,74,75,76,77,78,170],[67,68,69,70,71,72,73,74,75,76,77,78,170],[66,67,68,70,71,72,73,74,75,76,77,78,170],[66,67,68,69,71,72,73,74,75,76,77,78,170],[66,67,68,69,70,72,73,74,75,76,77,78,170],[66,67,68,69,70,71,73,74,75,76,77,78,170],[66,67,68,69,70,71,72,74,75,76,77,78,170],[66,67,68,69,70,71,72,73,75,76,77,78,170],[66,67,68,69,70,71,72,73,74,76,77,78,170],[66,67,68,69,70,71,72,73,74,75,77,78,170],[66,67,68,69,70,71,72,73,74,75,76,78,170],[78,170],[79,170],[66,67,68,69,70,71,72,73,74,75,76,77,170],[91,170],[127,170],[128,133,161,170],[129,140,141,148,158,169,170],[129,130,140,148,170],[131,170],[132,133,141,149,170],[133,158,166,170],[134,136,140,148,170],[135,170],[136,137,170],[140,170],[138,140,170],[127,140,170],[140,141,142,158,169,170],[140,141,142,155,158,161,170],[125,170,174],[136,140,143,148,158,169,170],[140,141,143,144,148,158,166,169,170],[143,145,158,166,169,170],[91,92,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176],[140,146,170],[147,169,170,174],[136,140,148,158,170],[149,170],[150,170],[127,151,170],[152,168,170,174],[153,170],[154,170],[140,155,156,170],[155,157,170,172],[128,140,158,159,160,161,170],[128,158,160,170],[158,159,170],[161,170],[162,170],[127,158,170],[140,164,165,170],[164,165,170],[133,148,158,166,170],[167,170],[148,168,170],[128,143,154,169,170],[133,170],[158,170,171],[147,170,172],[170,173],[128,133,140,142,151,158,169,170,172,174],[158,170,175],[52,170],[51,170],[53,170],[53,56,57,58,59,60,61,170],[53,54,57,58,59,60,61,170],[53,54,56,57,58,60,61,170],[53,54,56,57,58,59,60,170],[53,54,56,57,58,59,61,170],[53,54,56,57,59,60,61,170],[53,54,56,58,59,60,61,170],[170,178,184],[170,182],[170,179,183],[170,181],[102,106,169,170],[102,158,169,170],[97,170],[99,102,166,169,170],[148,166,170],[170,177],[97,170,177],[99,102,148,169,170],[94,95,98,101,128,140,158,169,170],[94,100,170],[98,102,128,161,169,170,177],[128,170,177],[118,128,170,177],[96,97,170,177],[102,170],[96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112,113,114,115,116,117,119,120,121,122,123,124,170],[102,109,110,170],[100,102,110,111,170],[101,170],[94,97,102,170],[102,106,110,111,170],[106,170],[100,102,105,169,170],[94,99,100,102,106,109,170],[128,158,170],[97,102,118,128,170,174,177],[46,83,170],[46,170],[46,53,54,55,56,57,58,59,60,61,170],[46,62,63,170],[46,49,50,63,64,81,82,170],[46,48,63,65,80,81,170],[46,62,170],[46,47,48,49,65,81,82,83,86,87,88,89,170,172],[46,65,84,85,86,170],[46,63,170],[46,65,83,170],[81],[47,48,82,86],[86]],"referencedMap":[[178,1],[181,2],[180,1],[186,3],[67,4],[68,5],[66,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,14],[77,15],[79,16],[80,17],[78,18],[91,19],[92,19],[127,20],[128,21],[129,22],[130,23],[131,24],[132,25],[133,26],[134,27],[135,28],[136,29],[137,29],[139,30],[138,31],[140,32],[141,33],[142,34],[126,35],[176,1],[143,36],[144,37],[145,38],[177,39],[146,40],[147,41],[148,42],[149,43],[150,44],[151,45],[152,46],[153,47],[154,48],[155,49],[156,49],[157,50],[158,51],[160,52],[159,53],[161,54],[162,55],[163,56],[164,57],[165,58],[166,59],[167,60],[168,61],[169,62],[170,63],[171,64],[172,65],[173,66],[174,67],[175,68],[93,1],[179,1],[53,69],[52,70],[51,1],[55,71],[54,72],[56,73],[59,74],[61,75],[60,76],[58,77],[57,78],[185,79],[49,1],[183,80],[184,81],[182,82],[46,1],[44,1],[45,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[19,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[109,83],[116,84],[108,83],[123,85],[100,86],[99,87],[122,88],[117,89],[120,90],[102,91],[101,92],[97,93],[96,94],[119,95],[98,96],[103,97],[104,1],[107,97],[94,1],[125,98],[124,97],[111,99],[112,100],[114,101],[110,102],[113,103],[118,88],[105,104],[106,105],[115,106],[95,107],[121,108],[88,109],[47,110],[50,110],[63,110],[62,111],[64,112],[83,113],[82,114],[81,115],[48,110],[90,116],[89,1],[87,117],[85,118],[84,119],[86,110],[65,110]],"exportedModulesMap":[[178,1],[181,2],[180,1],[186,3],[67,4],[68,5],[66,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,14],[77,15],[79,16],[80,17],[78,18],[91,19],[92,19],[127,20],[128,21],[129,22],[130,23],[131,24],[132,25],[133,26],[134,27],[135,28],[136,29],[137,29],[139,30],[138,31],[140,32],[141,33],[142,34],[126,35],[176,1],[143,36],[144,37],[145,38],[177,39],[146,40],[147,41],[148,42],[149,43],[150,44],[151,45],[152,46],[153,47],[154,48],[155,49],[156,49],[157,50],[158,51],[160,52],[159,53],[161,54],[162,55],[163,56],[164,57],[165,58],[166,59],[167,60],[168,61],[169,62],[170,63],[171,64],[172,65],[173,66],[174,67],[175,68],[93,1],[179,1],[53,69],[52,70],[51,1],[55,71],[54,72],[56,73],[59,74],[61,75],[60,76],[58,77],[57,78],[185,79],[49,1],[183,80],[184,81],[182,82],[46,1],[44,1],[45,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[19,1],[23,1],[20,1],[21,1],[22,1],[24,1],[25,1],[26,1],[5,1],[27,1],[28,1],[29,1],[30,1],[6,1],[34,1],[31,1],[32,1],[33,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[1,1],[43,1],[109,83],[116,84],[108,83],[123,85],[100,86],[99,87],[122,88],[117,89],[120,90],[102,91],[101,92],[97,93],[96,94],[119,95],[98,96],[103,97],[104,1],[107,97],[94,1],[125,98],[124,97],[111,99],[112,100],[114,101],[110,102],[113,103],[118,88],[105,104],[106,105],[115,106],[95,107],[121,108],[83,120],[90,121],[89,1],[87,122]],"semanticDiagnosticsPerFile":[178,181,180,186,67,68,66,69,70,71,72,73,74,75,76,77,79,80,78,91,92,127,128,129,130,131,132,133,134,135,136,137,139,138,140,141,142,126,176,143,144,145,177,146,147,148,149,150,151,152,153,154,155,156,157,158,160,159,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,93,179,53,52,51,55,54,56,59,61,60,58,57,185,49,183,184,182,46,44,45,8,10,9,2,11,12,13,14,15,16,17,18,3,4,19,23,20,21,22,24,25,26,5,27,28,29,30,6,34,31,32,33,35,7,36,41,42,37,38,39,40,1,43,109,116,108,123,100,99,122,117,120,102,101,97,96,119,98,103,104,107,94,125,124,111,112,114,110,113,118,105,106,115,95,121,88,47,50,63,62,64,83,82,81,48,90,89,87,85,84,86,65]},"version":"5.2.2"}
@@ -0,0 +1,8 @@
1
+ export interface ProcessOptions {
2
+ cacheTemplates?: boolean;
3
+ noEscaping?: boolean;
4
+ noHelpers?: boolean;
5
+ noFinalise?: boolean;
6
+ escapeNewlines?: boolean;
7
+ onlyFound?: boolean;
8
+ }
@@ -1,11 +1,11 @@
1
- export const FIND_HBS_REGEX: RegExp;
2
- export const FIND_ANY_HBS_REGEX: RegExp;
3
- export const FIND_TRIPLE_HBS_REGEX: RegExp;
4
- export function isBackendService(): boolean;
5
- export function isJSAllowed(): boolean;
6
- export function findDoubleHbsInstances(string: any): any;
7
- export function isAlphaNumeric(char: any): any;
8
- export function swapStrings(string: any, start: any, length: any, swap: any): any;
9
- export function removeHandlebarsStatements(string: any, replacement?: string): any;
10
- export function btoa(plainText: any): string;
11
- export function atob(base64: any): string;
1
+ export declare const FIND_HBS_REGEX: RegExp;
2
+ export declare const FIND_ANY_HBS_REGEX: RegExp;
3
+ export declare const FIND_TRIPLE_HBS_REGEX: RegExp;
4
+ export declare const isBackendService: () => boolean;
5
+ export declare const isJSAllowed: () => boolean;
6
+ export declare const findDoubleHbsInstances: (string: string) => string[];
7
+ export declare const isAlphaNumeric: (char: string) => RegExpMatchArray;
8
+ export declare const swapStrings: (string: string, start: number, length: number, swap: string) => string;
9
+ export declare const removeHandlebarsStatements: (string: string, replacement?: string) => string;
10
+ export declare const btoa: (plainText: string) => string;
11
+ export declare const atob: (base64: string) => string;
package/package.json CHANGED
@@ -1,30 +1,29 @@
1
1
  {
2
2
  "name": "@budibase/string-templates",
3
- "version": "2.22.1",
3
+ "version": "2.22.2",
4
4
  "description": "Handlebars wrapper for Budibase templating.",
5
- "main": "src/index.js",
5
+ "main": "dist/bundle.cjs",
6
6
  "module": "dist/bundle.mjs",
7
+ "types": "src/index.ts",
7
8
  "license": "MPL-2.0",
8
- "types": "dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "require": "./src/index.js",
11
+ "require": "./dist/bundle.cjs",
12
12
  "import": "./dist/bundle.mjs"
13
13
  },
14
14
  "./package.json": "./package.json",
15
- "./test/utils": "./test/utils.js",
16
15
  "./iife": "./src/iife.js"
17
16
  },
18
17
  "files": [
19
18
  "dist",
20
- "src",
21
- "manifest.json"
19
+ "src"
22
20
  ],
23
21
  "scripts": {
24
- "build": "tsc && rollup -c",
25
- "dev": "concurrently \"tsc --watch\" \"rollup -cw\"",
22
+ "build": "tsc --emitDeclarationOnly && rollup -c",
23
+ "dev": "rollup -cw",
24
+ "check:types": "tsc -p tsconfig.json --noEmit --paths null",
26
25
  "test": "jest",
27
- "manifest": "node ./scripts/gen-collection-info.js"
26
+ "manifest": "ts-node ./scripts/gen-collection-info.ts"
28
27
  },
29
28
  "dependencies": {
30
29
  "@budibase/handlebars-helpers": "^0.13.1",
@@ -34,8 +33,8 @@
34
33
  },
35
34
  "devDependencies": {
36
35
  "@rollup/plugin-commonjs": "^17.1.0",
37
- "@rollup/plugin-json": "^4.1.0",
38
- "concurrently": "^8.2.2",
36
+ "@rollup/plugin-inject": "^5.0.5",
37
+ "@rollup/plugin-typescript": "8.3.0",
39
38
  "doctrine": "^3.0.0",
40
39
  "jest": "29.7.0",
41
40
  "marked": "^4.0.10",
@@ -45,7 +44,8 @@
45
44
  "rollup-plugin-node-globals": "^1.4.0",
46
45
  "rollup-plugin-node-resolve": "^5.2.0",
47
46
  "rollup-plugin-terser": "^7.0.2",
47
+ "ts-jest": "29.1.1",
48
48
  "typescript": "5.2.2"
49
49
  },
50
- "gitHead": "b91392adfadf5e27c40a78102046cb3e51a7a792"
50
+ "gitHead": "ae1d0c57770298b70f02234d493b7b603783e0b3"
51
51
  }
@@ -1,11 +1,11 @@
1
- const { getJsHelperList } = require("../helpers")
1
+ import { getJsHelperList } from "../helpers"
2
2
 
3
- function getLayers(fullBlock) {
3
+ function getLayers(fullBlock: string): string[] {
4
4
  let layers = []
5
5
  while (fullBlock.length) {
6
6
  const start = fullBlock.lastIndexOf("("),
7
7
  end = fullBlock.indexOf(")")
8
- let layer
8
+ let layer: string
9
9
  if (start === -1 || end === -1) {
10
10
  layer = fullBlock.trim()
11
11
  fullBlock = ""
@@ -21,7 +21,7 @@ function getLayers(fullBlock) {
21
21
  return layers
22
22
  }
23
23
 
24
- function getVariable(variableName) {
24
+ function getVariable(variableName: string) {
25
25
  if (!variableName || typeof variableName !== "string") {
26
26
  return variableName
27
27
  }
@@ -47,10 +47,12 @@ function getVariable(variableName) {
47
47
  return `$("${variableName}")`
48
48
  }
49
49
 
50
- function buildList(parts, value) {
50
+ function buildList(parts: string[], value: any) {
51
51
  function build() {
52
52
  return parts
53
- .map(part => (part.startsWith("helper") ? part : getVariable(part)))
53
+ .map((part: string) =>
54
+ part.startsWith("helper") ? part : getVariable(part)
55
+ )
54
56
  .join(", ")
55
57
  }
56
58
  if (!value) {
@@ -60,12 +62,12 @@ function buildList(parts, value) {
60
62
  }
61
63
  }
62
64
 
63
- function splitBySpace(layer) {
64
- const parts = []
65
+ function splitBySpace(layer: string) {
66
+ const parts: string[] = []
65
67
  let started = null,
66
68
  endChar = null,
67
69
  last = 0
68
- function add(str) {
70
+ function add(str: string) {
69
71
  const startsWith = ["]"]
70
72
  while (startsWith.indexOf(str.substring(0, 1)) !== -1) {
71
73
  str = str.substring(1, str.length)
@@ -103,7 +105,7 @@ function splitBySpace(layer) {
103
105
  return parts
104
106
  }
105
107
 
106
- module.exports.convertHBSBlock = (block, blockNumber) => {
108
+ export function convertHBSBlock(block: string, blockNumber: number) {
107
109
  const braceLength = block[2] === "{" ? 3 : 2
108
110
  block = block.substring(braceLength, block.length - braceLength).trim()
109
111
  const layers = getLayers(block)
@@ -114,7 +116,7 @@ module.exports.convertHBSBlock = (block, blockNumber) => {
114
116
  const parts = splitBySpace(layer)
115
117
  if (value || parts.length > 1 || list[parts[0]]) {
116
118
  // first of layer should always be the helper
117
- const helper = parts.splice(0, 1)
119
+ const [helper] = parts.splice(0, 1)
118
120
  if (list[helper]) {
119
121
  value = `helpers.${helper}(${buildList(parts, value)})`
120
122
  }
package/src/errors.ts ADDED
@@ -0,0 +1,3 @@
1
+ export class JsErrorTimeout extends Error {
2
+ code = "ERR_SCRIPT_EXECUTION_TIMEOUT"
3
+ }
@@ -0,0 +1,34 @@
1
+ export default class Helper {
2
+ private name: any
3
+ private fn: any
4
+ private useValueFallback: boolean
5
+
6
+ constructor(name: string, fn: any, useValueFallback = true) {
7
+ this.name = name
8
+ this.fn = fn
9
+ this.useValueFallback = useValueFallback
10
+ }
11
+
12
+ register(handlebars: typeof Handlebars) {
13
+ // wrap the function so that no helper can cause handlebars to break
14
+ handlebars.registerHelper(
15
+ this.name,
16
+ (value: any, info: { data: { root: {} } }) => {
17
+ let context = {}
18
+ if (info && info.data && info.data.root) {
19
+ context = info.data.root
20
+ }
21
+ const result = this.fn(value, context)
22
+ if (result == null) {
23
+ return this.useValueFallback ? value : null
24
+ } else {
25
+ return result
26
+ }
27
+ }
28
+ )
29
+ }
30
+
31
+ unregister(handlebars: { unregisterHelper: any }) {
32
+ handlebars.unregisterHelper(this.name)
33
+ }
34
+ }
@@ -1,4 +1,4 @@
1
- module.exports.HelperFunctionBuiltin = [
1
+ export const HelperFunctionBuiltin = [
2
2
  "#if",
3
3
  "#unless",
4
4
  "#each",
@@ -15,11 +15,11 @@ module.exports.HelperFunctionBuiltin = [
15
15
  "with",
16
16
  ]
17
17
 
18
- module.exports.HelperFunctionNames = {
18
+ export const HelperFunctionNames = {
19
19
  OBJECT: "object",
20
20
  ALL: "all",
21
21
  LITERAL: "literal",
22
22
  JS: "js",
23
23
  }
24
24
 
25
- module.exports.LITERAL_MARKER = "%LITERAL%"
25
+ export const LITERAL_MARKER = "%LITERAL%"
@@ -1,12 +1,22 @@
1
- const dayjs = require("dayjs")
2
- dayjs.extend(require("dayjs/plugin/duration"))
3
- dayjs.extend(require("dayjs/plugin/advancedFormat"))
4
- dayjs.extend(require("dayjs/plugin/isoWeek"))
5
- dayjs.extend(require("dayjs/plugin/weekYear"))
6
- dayjs.extend(require("dayjs/plugin/weekOfYear"))
7
- dayjs.extend(require("dayjs/plugin/relativeTime"))
8
- dayjs.extend(require("dayjs/plugin/utc"))
9
- dayjs.extend(require("dayjs/plugin/timezone"))
1
+ import dayjs from "dayjs"
2
+
3
+ import dayjsDurationPlugin from "dayjs/plugin/duration"
4
+ import dayjsAdvancedFormatPlugin from "dayjs/plugin/advancedFormat"
5
+ import dayjsIsoWeekPlugin from "dayjs/plugin/isoWeek"
6
+ import dayjsWeekYearPlugin from "dayjs/plugin/weekYear"
7
+ import dayjsWeekOfYearPlugin from "dayjs/plugin/weekOfYear"
8
+ import dayjsRelativeTimePlugin from "dayjs/plugin/relativeTime"
9
+ import dayjsUtcPlugin from "dayjs/plugin/utc"
10
+ import dayjsTimezonePlugin from "dayjs/plugin/timezone"
11
+
12
+ dayjs.extend(dayjsDurationPlugin)
13
+ dayjs.extend(dayjsAdvancedFormatPlugin)
14
+ dayjs.extend(dayjsIsoWeekPlugin)
15
+ dayjs.extend(dayjsWeekYearPlugin)
16
+ dayjs.extend(dayjsWeekOfYearPlugin)
17
+ dayjs.extend(dayjsRelativeTimePlugin)
18
+ dayjs.extend(dayjsUtcPlugin)
19
+ dayjs.extend(dayjsTimezonePlugin)
10
20
 
11
21
  /**
12
22
  * This file was largely taken from the helper-date package - we did this for two reasons:
@@ -17,11 +27,11 @@ dayjs.extend(require("dayjs/plugin/timezone"))
17
27
  * https://github.com/helpers/helper-date
18
28
  */
19
29
 
20
- function isOptions(val) {
30
+ function isOptions(val: any) {
21
31
  return typeof val === "object" && typeof val.hash === "object"
22
32
  }
23
33
 
24
- function isApp(thisArg) {
34
+ function isApp(thisArg: any) {
25
35
  return (
26
36
  typeof thisArg === "object" &&
27
37
  typeof thisArg.options === "object" &&
@@ -29,7 +39,7 @@ function isApp(thisArg) {
29
39
  )
30
40
  }
31
41
 
32
- function getContext(thisArg, locals, options) {
42
+ function getContext(thisArg: any, locals: any, options: any) {
33
43
  if (isOptions(thisArg)) {
34
44
  return getContext({}, locals, thisArg)
35
45
  }
@@ -58,7 +68,7 @@ function getContext(thisArg, locals, options) {
58
68
  return context
59
69
  }
60
70
 
61
- function initialConfig(str, pattern, options) {
71
+ function initialConfig(str: any, pattern: any, options?: any) {
62
72
  if (isOptions(pattern)) {
63
73
  options = pattern
64
74
  pattern = null
@@ -72,7 +82,7 @@ function initialConfig(str, pattern, options) {
72
82
  return { str, pattern, options }
73
83
  }
74
84
 
75
- function setLocale(str, pattern, options) {
85
+ function setLocale(this: any, str: any, pattern: any, options?: any) {
76
86
  // if options is null then it'll get updated here
77
87
  const config = initialConfig(str, pattern, options)
78
88
  const defaults = { lang: "en", date: new Date(config.str) }
@@ -83,7 +93,7 @@ function setLocale(str, pattern, options) {
83
93
  dayjs.locale(opts.lang || opts.language)
84
94
  }
85
95
 
86
- module.exports.date = (str, pattern, options) => {
96
+ export const date = (str: any, pattern: any, options: any) => {
87
97
  const config = initialConfig(str, pattern, options)
88
98
 
89
99
  // if no args are passed, return a formatted date
@@ -109,7 +119,7 @@ module.exports.date = (str, pattern, options) => {
109
119
  return date.format(config.pattern)
110
120
  }
111
121
 
112
- module.exports.duration = (str, pattern, format) => {
122
+ export const duration = (str: any, pattern: any, format: any) => {
113
123
  const config = initialConfig(str, pattern)
114
124
 
115
125
  setLocale(config.str, config.pattern)
@@ -1,6 +1,8 @@
1
- const helpers = require("@budibase/handlebars-helpers")
2
- const { date, duration } = require("./date")
3
- const { HelperFunctionBuiltin } = require("./constants")
1
+ // @ts-ignore we don't have types for it
2
+ import helpers from "@budibase/handlebars-helpers"
3
+
4
+ import { date, duration } from "./date"
5
+ import { HelperFunctionBuiltin } from "./constants"
4
6
 
5
7
  /**
6
8
  * full list of supported helpers can be found here:
@@ -24,10 +26,10 @@ const ADDED_HELPERS = {
24
26
  duration: duration,
25
27
  }
26
28
 
27
- exports.externalCollections = EXTERNAL_FUNCTION_COLLECTIONS
28
- exports.addedHelpers = ADDED_HELPERS
29
+ export const externalCollections = EXTERNAL_FUNCTION_COLLECTIONS
30
+ export const addedHelpers = ADDED_HELPERS
29
31
 
30
- exports.registerAll = handlebars => {
32
+ export function registerAll(handlebars: typeof Handlebars) {
31
33
  for (let [name, helper] of Object.entries(ADDED_HELPERS)) {
32
34
  handlebars.registerHelper(name, helper)
33
35
  }
@@ -52,17 +54,17 @@ exports.registerAll = handlebars => {
52
54
  })
53
55
  }
54
56
  // add date external functionality
55
- exports.externalHelperNames = externalNames.concat(Object.keys(ADDED_HELPERS))
57
+ externalHelperNames = externalNames.concat(Object.keys(ADDED_HELPERS))
56
58
  }
57
59
 
58
- exports.unregisterAll = handlebars => {
60
+ export function unregisterAll(handlebars: typeof Handlebars) {
59
61
  for (let name of Object.keys(ADDED_HELPERS)) {
60
62
  handlebars.unregisterHelper(name)
61
63
  }
62
- for (let name of module.exports.externalHelperNames) {
64
+ for (let name of externalHelperNames) {
63
65
  handlebars.unregisterHelper(name)
64
66
  }
65
- exports.externalHelperNames = []
67
+ externalHelperNames = []
66
68
  }
67
69
 
68
- exports.externalHelperNames = []
70
+ export let externalHelperNames: any[] = []
@@ -0,0 +1,103 @@
1
+ import Helper from "./Helper"
2
+ import { SafeString } from "handlebars"
3
+ import * as externalHandlebars from "./external"
4
+ import { processJS } from "./javascript"
5
+ import {
6
+ HelperFunctionNames,
7
+ HelperFunctionBuiltin,
8
+ LITERAL_MARKER,
9
+ } from "./constants"
10
+
11
+ export { getJsHelperList } from "./list"
12
+
13
+ const HTML_SWAPS = {
14
+ "<": "&lt;",
15
+ ">": "&gt;",
16
+ }
17
+
18
+ function isObject(value: string | any[]) {
19
+ if (value == null || typeof value !== "object") {
20
+ return false
21
+ }
22
+ return (
23
+ value.toString() === "[object Object]" ||
24
+ (value.length > 0 && typeof value[0] === "object")
25
+ )
26
+ }
27
+
28
+ const HELPERS = [
29
+ // external helpers
30
+ new Helper(HelperFunctionNames.OBJECT, (value: any) => {
31
+ return new SafeString(JSON.stringify(value))
32
+ }),
33
+ // javascript helper
34
+ new Helper(HelperFunctionNames.JS, processJS, false),
35
+ // this help is applied to all statements
36
+ new Helper(
37
+ HelperFunctionNames.ALL,
38
+ (value: string, inputs: { __opts: any }) => {
39
+ const { __opts } = inputs
40
+ if (isObject(value)) {
41
+ return new SafeString(JSON.stringify(value))
42
+ }
43
+ // null/undefined values produce bad results
44
+ if (__opts && __opts.onlyFound && value == null) {
45
+ return __opts.input
46
+ }
47
+ if (value == null || typeof value !== "string") {
48
+ return value == null ? "" : value
49
+ }
50
+ // TODO: check, this should always be false
51
+ if (value && (value as any).string) {
52
+ value = (value as any).string
53
+ }
54
+ let text: any = value
55
+ if (__opts && __opts.escapeNewlines) {
56
+ text = value.replace(/\n/g, "\\n")
57
+ }
58
+ text = new SafeString(text.replace(/&amp;/g, "&"))
59
+ if (text == null || typeof text !== "string") {
60
+ return text
61
+ }
62
+ return text.replace(/[<>]/g, (tag: string) => {
63
+ return HTML_SWAPS[tag as keyof typeof HTML_SWAPS] || tag
64
+ })
65
+ }
66
+ ),
67
+ // adds a note for post-processor
68
+ new Helper(HelperFunctionNames.LITERAL, (value: any) => {
69
+ if (value === undefined) {
70
+ return ""
71
+ }
72
+ const type = typeof value
73
+ const outputVal = type === "object" ? JSON.stringify(value) : value
74
+ return `{{${LITERAL_MARKER} ${type}-${outputVal}}}`
75
+ }),
76
+ ]
77
+
78
+ export function HelperNames() {
79
+ return Object.values(HelperFunctionNames).concat(
80
+ HelperFunctionBuiltin,
81
+ externalHandlebars.externalHelperNames
82
+ )
83
+ }
84
+
85
+ export function registerMinimum(handlebars: typeof Handlebars) {
86
+ for (let helper of HELPERS) {
87
+ helper.register(handlebars)
88
+ }
89
+ }
90
+
91
+ export function registerAll(handlebars: typeof Handlebars) {
92
+ registerMinimum(handlebars)
93
+ // register imported helpers
94
+ externalHandlebars.registerAll(handlebars)
95
+ }
96
+
97
+ export function unregisterAll(handlebars: any) {
98
+ for (let helper of HELPERS) {
99
+ helper.unregister(handlebars)
100
+ }
101
+ // unregister all imported helpers
102
+ externalHandlebars.unregisterAll(handlebars)
103
+ }