Skip to content

Commit

Permalink
use \U form for ⬢
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Feb 3, 2024
1 parent 40a04c3 commit 569b418
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(fun)
export(informant)
export(pkg)
importFrom(utils,capture.output)
importFrom(utils,ls.str)
14 changes: 8 additions & 6 deletions R/peek.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

#' @export
#' @importFrom utils ls.str capture.output
informant <- function() {
hex_pink <- cli::make_ansi_style("pink")("")
hex_pink <- cli::make_ansi_style("pink")("\U2B22")

env <- parent.frame()
calls <- sys.calls()
Expand All @@ -22,21 +21,24 @@ informant <- function() {

#' Peek function inputs
#'
#' @param what Function to snitch on
#'
#' @examples
#' fun(rnorm)
#'
#' @export
fun <- function(fun, tracer = snitch::informant, where = topenv(parent.frame())) {
fun <- function(what) {
call <- sys.call()
call[[1L]] <- quote(trace)
call$where <- where
call$tracer <- tracer
call$where <- topenv(parent.frame())
call$tracer <- informant
eval.parent(call)
}

#' Peek all functions from a package
#'
#' @param pkg The package to snitch on
#' @param pattern filter functions
#'
#' @examples
#' pkg("dplyr")
Expand Down
5 changes: 4 additions & 1 deletion man/fun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/pkg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 569b418

Please sign in to comment.