handlebars.runtime.js 971 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import * as base from './handlebars/base';
  2. // Each of these augment the Handlebars object. No need to setup here.
  3. // (This is done to easily share code between commonjs and browse envs)
  4. import SafeString from './handlebars/safe-string';
  5. import Exception from './handlebars/exception';
  6. import * as Utils from './handlebars/utils';
  7. import * as runtime from './handlebars/runtime';
  8. import noConflict from './handlebars/no-conflict';
  9. // For compatibility and usage outside of module systems, make the Handlebars object a namespace
  10. function create() {
  11. let hb = new base.HandlebarsEnvironment();
  12. Utils.extend(hb, base);
  13. hb.SafeString = SafeString;
  14. hb.Exception = Exception;
  15. hb.Utils = Utils;
  16. hb.escapeExpression = Utils.escapeExpression;
  17. hb.VM = runtime;
  18. hb.template = function(spec) {
  19. return runtime.template(spec, hb);
  20. };
  21. return hb;
  22. }
  23. let inst = create();
  24. inst.create = create;
  25. noConflict(inst);
  26. inst['default'] = inst;
  27. export default inst;