MCPcopy Index your code
hub / github.com/nodejs/node / showFlaggedDeprecation

Function showFlaggedDeprecation

lib/buffer.js:205–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203 'Buffer.allocUnsafe(), or Buffer.from() methods instead.';
204
205function showFlaggedDeprecation() {
206 if (bufferWarningAlreadyEmitted ||
207 ++nodeModulesCheckCounter > 10000 ||
208 (!require('internal/options').getOptionValue('--pending-deprecation') &&
209 isInsideNodeModules(3))) {
210 // We don't emit a warning, because we either:
211 // - Already did so, or
212 // - Already checked too many times whether a call is coming
213 // from node_modules and want to stop slowing down things, or
214 // - We aren't running with `--pending-deprecation` enabled,
215 // and the code is inside `node_modules`.
216 // - If the topmost non-internal frame is not inside `node_modules`.
217 return;
218 }
219
220 process.emitWarning(bufferWarning, 'DeprecationWarning', 'DEP0005');
221 bufferWarningAlreadyEmitted = true;
222}
223
224function toInteger(n, defaultVal) {
225 n = +n;

Callers 1

BufferFunction · 0.85

Calls 2

isInsideNodeModulesFunction · 0.85
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…