PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/src/clojure/monger/js.clj

http://github.com/michaelklishin/monger
Clojure | 50 lines | 9 code | 6 blank | 35 comment | 0 complexity | e2f12debf4a08889f56bc123b1c33136 MD5 | raw file
  1. ;; This source code is dual-licensed under the Apache License, version
  2. ;; 2.0, and the Eclipse Public License, version 1.0.
  3. ;;
  4. ;; The APL v2.0:
  5. ;;
  6. ;; ----------------------------------------------------------------------------------
  7. ;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team
  8. ;;
  9. ;; Licensed under the Apache License, Version 2.0 (the "License");
  10. ;; you may not use this file except in compliance with the License.
  11. ;; You may obtain a copy of the License at
  12. ;;
  13. ;; http://www.apache.org/licenses/LICENSE-2.0
  14. ;;
  15. ;; Unless required by applicable law or agreed to in writing, software
  16. ;; distributed under the License is distributed on an "AS IS" BASIS,
  17. ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. ;; See the License for the specific language governing permissions and
  19. ;; limitations under the License.
  20. ;; ----------------------------------------------------------------------------------
  21. ;;
  22. ;; The EPL v1.0:
  23. ;;
  24. ;; ----------------------------------------------------------------------------------
  25. ;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team.
  26. ;; All rights reserved.
  27. ;;
  28. ;; This program and the accompanying materials are made available under the terms of
  29. ;; the Eclipse Public License Version 1.0,
  30. ;; which accompanies this distribution and is available at
  31. ;; http://www.eclipse.org/legal/epl-v10.html.
  32. ;; ----------------------------------------------------------------------------------
  33. (ns monger.js
  34. "Kept for backwards compatibility. Please use clojurewerkz.support.js from now on."
  35. (:require [clojurewerkz.support.js :as js]))
  36. ;;
  37. ;; API
  38. ;;
  39. (defn load-resource
  40. "Loads a JavaScript resource (file from the classpath) and returns its content as a string.
  41. The .js suffix at the end may be omitted.
  42. Used primarily for map/reduce queries."
  43. (^String [^String path]
  44. (js/load-resource path)))