@bufbuild/cel
Version:
A CEL evaluator for ECMAScript
38 lines (37 loc) • 1.1 kB
JavaScript
// Copyright 2024-2025 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
var _a;
const privateSymbol = Symbol.for("@bufbuild/cel/uint");
/**
* Creates a new CelUint from bigint.
*/
export function celUint(v) {
return new Uint(v);
}
/**
* Returns true if the given value is a CelUint.
*/
export function isCelUint(v) {
return typeof v === "object" && v !== null && privateSymbol in v;
}
class Uint {
constructor(_value) {
this._value = _value;
this[_a] = {};
}
get value() {
return this._value;
}
}
_a = privateSymbol;