UNPKG

firesage

Version:

🔥 Extremely High Precision Typescript Wrapper for Firestore Web, Providing Unparalleled Type Safe and Dev Experience

22 lines (17 loc) • 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.increment = void 0; var firestore_1 = require("firebase/firestore"); /** Returns a special value that can be used with @firebase/firestore/lite#(setDoc:1) or * @firebase/firestore/lite#(updateDoc:1) that tells the server to increment the field's current value by the given value. If either the operand or the current field value uses floating point precision, all arithmetic follows IEEE 754 semantics. If both values are integers, values outside of JavaScript's safe number range (Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER) are also subject to precision loss. Furthermore, once processed by the Firestore backend, all integer operations are capped between -2^63 and 2^63-1. If the current field value is not of type number, or if the field does not yet exist, the transformation sets the field to the given value. @param n — The value to increment by. @returns The FieldValue sentinel for use in a call to setDoc() or updateDoc() */ var increment = function (n) { var ref = (0, firestore_1.increment)(n); return ref; }; exports.increment = increment;