Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
808 B
Text
25 lines
808 B
Text
const format = /^-?\d*(\.\d+)?$/;
|
|
export class NumericValue {
|
|
string;
|
|
type;
|
|
constructor(string, type) {
|
|
this.string = string;
|
|
this.type = type;
|
|
if (!format.test(string)) {
|
|
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
}
|
|
}
|
|
toString() {
|
|
return this.string;
|
|
}
|
|
static [Symbol.hasInstance](object) {
|
|
if (!object || typeof object !== "object") {
|
|
return false;
|
|
}
|
|
const _nv = object;
|
|
return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === "bigDecimal" && format.test(_nv.string));
|
|
}
|
|
}
|
|
export function nv(input) {
|
|
return new NumericValue(String(input), "bigDecimal");
|
|
}
|