Merge pull request #16627 from Snuffleupagus/rm-Node-Buffer
[api-minor] Stop "supporting" binary data provided as `Buffer` in Node.js environments (PR 16055 follow-up)
This commit is contained in:
		
						commit
						e070e730c7
					
				@ -549,10 +549,9 @@ function getDataProp(val) {
 | 
			
		||||
    typeof Buffer !== "undefined" && // eslint-disable-line no-undef
 | 
			
		||||
    val instanceof Buffer // eslint-disable-line no-undef
 | 
			
		||||
  ) {
 | 
			
		||||
    deprecated(
 | 
			
		||||
    throw new Error(
 | 
			
		||||
      "Please provide binary data as `Uint8Array`, rather than `Buffer`."
 | 
			
		||||
    );
 | 
			
		||||
    return new Uint8Array(val);
 | 
			
		||||
  }
 | 
			
		||||
  if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {
 | 
			
		||||
    // Use the data as-is when it's already a Uint8Array that completely
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user