diff options
Diffstat (limited to 'app/helpers/json_helper.rb')
-rw-r--r-- | app/helpers/json_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/json_helper.rb b/app/helpers/json_helper.rb new file mode 100644 index 00000000000..e61c789fd08 --- /dev/null +++ b/app/helpers/json_helper.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module JsonHelper + # These two JSON helpers are short-form wrappers for the Gitlab::Json + # class, which should be used in place of .to_json calls or calls to + # the JSON class. + def json_generate(*args) + Gitlab::Json.generate(*args) + end + + def json_parse(*args) + Gitlab::Json.parse(*args) + end +end |