From 861c8ed4ffdf65a704a1e18533ff40163c72fcc4 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:44:08 -0700 Subject: [PATCH] Distribute an ESM version --- index.js => index.cjs | 0 index.mjs | 11 +++++++++++ package.json | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) rename index.js => index.cjs (100%) create mode 100644 index.mjs diff --git a/index.js b/index.cjs similarity index 100% rename from index.js rename to index.cjs diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..8d2f55d --- /dev/null +++ b/index.mjs @@ -0,0 +1,11 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +export default function isBuffer (obj) { + return obj != null && obj.constructor != null && + typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} diff --git a/package.json b/package.json index 7cd70d4..4b5928e 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "uint32array" ], "license": "MIT", - "main": "index.js", + "main": "index.cjs", + "module": "index.mjs", "repository": { "type": "git", "url": "git://github.com/feross/is-buffer.git"