updeep-remeda/dist/freeze.d.ts

19 lines
603 B
TypeScript
Raw Normal View History

2019-01-19 00:46:25 +00:00
/**
* Deeply freeze a plain javascript object.
*
* If `process.env.NODE_ENV === 'production'`, this returns the original object
* without freezing.
*
* Or if `process.env.UPDEEP_MODE === 'dangerously_never_freeze'`, this returns the original object
* without freezing.
*
2023-01-03 18:51:35 +00:00
* If in a browser and built without replacing process, never freeze.
*
* @function
* @sig a -> a
* @param object Object to freeze.
* @return Frozen object, unless in production, then the same object.
2019-01-19 00:46:25 +00:00
*/
2023-01-03 18:51:35 +00:00
declare function freeze<T>(object: T): Readonly<T>;
2019-01-19 00:46:25 +00:00
export default freeze;
2023-01-03 18:51:35 +00:00
//# sourceMappingURL=freeze.d.ts.map