From ac0d79a0974b735491bf991b348b5c7f355e2ab9 Mon Sep 17 00:00:00 2001 From: Sukka Date: Fri, 18 Oct 2024 12:21:22 +0800 Subject: [PATCH] fix(#108): proper replacement for `safe-buffer` & `safer-buffer` (#109) --- packages/data/single-file/src/safe-buffer.ts | 3 ++- packages/data/single-file/src/safer-buffer.ts | 3 ++- packages/generated/safe-buffer/index.js | 2 +- packages/generated/safe-buffer/package.json | 2 +- packages/generated/safer-buffer/index.js | 2 +- packages/generated/safer-buffer/package.json | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/data/single-file/src/safe-buffer.ts b/packages/data/single-file/src/safe-buffer.ts index ecb2202..65ada28 100644 --- a/packages/data/single-file/src/safe-buffer.ts +++ b/packages/data/single-file/src/safe-buffer.ts @@ -1 +1,2 @@ -export default Buffer; +// eslint-disable-next-line n/no-deprecated-api -- ignore deprecation +export * from 'node:buffer'; diff --git a/packages/data/single-file/src/safer-buffer.ts b/packages/data/single-file/src/safer-buffer.ts index ecb2202..65ada28 100644 --- a/packages/data/single-file/src/safer-buffer.ts +++ b/packages/data/single-file/src/safer-buffer.ts @@ -1 +1,2 @@ -export default Buffer; +// eslint-disable-next-line n/no-deprecated-api -- ignore deprecation +export * from 'node:buffer'; diff --git a/packages/generated/safe-buffer/index.js b/packages/generated/safe-buffer/index.js index f6497d4..647d3e6 100644 --- a/packages/generated/safe-buffer/index.js +++ b/packages/generated/safe-buffer/index.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=Buffer; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(require("node:buffer"),exports); ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && (Object.assign(exports.default,exports), module.exports = exports.default); diff --git a/packages/generated/safe-buffer/package.json b/packages/generated/safe-buffer/package.json index 3a1a183..8bb5a83 100644 --- a/packages/generated/safe-buffer/package.json +++ b/packages/generated/safe-buffer/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/safe-buffer", - "version": "1.0.40", + "version": "1.0.41", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/safer-buffer/index.js b/packages/generated/safer-buffer/index.js index f6497d4..647d3e6 100644 --- a/packages/generated/safer-buffer/index.js +++ b/packages/generated/safer-buffer/index.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=Buffer; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(require("node:buffer"),exports); ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && (Object.assign(exports.default,exports), module.exports = exports.default); diff --git a/packages/generated/safer-buffer/package.json b/packages/generated/safer-buffer/package.json index 60c4dfa..b3dd48d 100644 --- a/packages/generated/safer-buffer/package.json +++ b/packages/generated/safer-buffer/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/safer-buffer", - "version": "1.0.40", + "version": "1.0.41", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill",