-
Notifications
You must be signed in to change notification settings - Fork 6
Meta type ‣ isDeclTypedArray(T, name)
Chung Leong edited this page Oct 25, 2025
·
1 revision
Determine whether a decl should be a typed array.
Usage:
const std = @import("std");
pub const declaration: []const u8 = "hello";
const module = @This();
pub const @"meta(zigar)" = struct {
pub fn isDeclTypedArray(comptime T: type, comptime name: std.meta.DeclEnum(T)) bool {
return T == module and name == .declaration;
}
};import { declaration } from './meta-type-typed-array-example-1.zig';
console.log(declaration);Uint8Array(5) [ 104, 101, 108, 108, 111 ]
Arguments:
-
T:type- Namespace containing the decl -
name:std.meta.DeclEnum(T): - Name of the decl represented by an enum