use super::{HelperDef, HelperName};
pub const DEF: HelperDef = HelperDef {
name: HelperName::ts_values,
local: "_ts_values",
import_path: "@swc/helpers/_/_ts_values",
#[cfg(feature = "inline-helpers")]
source: r#"function _ts_values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) {
return m.call(o);
}
if (o && typeof o.length === "number") {
return {
next: function() {
if (o && i >= o.length) {
o = void 0;
}
return { value: o && o[i++], done: !o };
}
};
}
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
"#,
#[cfg(feature = "inline-helpers")]
deps: super::HelperBitmap::from_bits(0x00000001000000000000000000000000),
};
#[cfg(feature = "inline-helpers")]
pub fn stmts() -> &'static [swc_ecma_ast::Stmt] {
static STMTS: once_cell::sync::Lazy<Vec<swc_ecma_ast::Stmt>> =
once_cell::sync::Lazy::new(|| super::super::parse(DEF.source, DEF.import_path));
&STMTS
}