istextorbinary
Advanced tools
Comparing version 5.2.0-next.1592596703.e5313de67041196450043fc9f31d95c02d7c488d to 5.2.0-next.1592598153.aefa33264718e87d85dd170a442a5603e51b768b
/* eslint no-use-before-define:0 */ | ||
import pathUtil from 'path' | ||
import * as pathUtil from 'path' | ||
import textExtensions from 'textextensions' | ||
@@ -4,0 +4,0 @@ import binaryExtensions from 'binaryextensions' |
'use strict' | ||
/* eslint no-use-before-define:0 */ | ||
var __createBinding = | ||
(this && this.__createBinding) || | ||
(Object.create | ||
? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k | ||
Object.defineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k] | ||
}, | ||
}) | ||
} | ||
: function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k | ||
o[k2] = m[k] | ||
}) | ||
var __setModuleDefault = | ||
(this && this.__setModuleDefault) || | ||
(Object.create | ||
? function (o, v) { | ||
Object.defineProperty(o, 'default', { enumerable: true, value: v }) | ||
} | ||
: function (o, v) { | ||
o['default'] = v | ||
}) | ||
var __importStar = | ||
(this && this.__importStar) || | ||
function (mod) { | ||
if (mod && mod.__esModule) return mod | ||
var result = {} | ||
if (mod != null) | ||
for (var k in mod) | ||
if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) | ||
__createBinding(result, mod, k) | ||
__setModuleDefault(result, mod) | ||
return result | ||
} | ||
var __importDefault = | ||
@@ -10,3 +47,3 @@ (this && this.__importDefault) || | ||
exports.getEncoding = exports.isBinary = exports.isText = void 0 | ||
const path_1 = __importDefault(require('path')) | ||
const pathUtil = __importStar(require('path')) | ||
const textextensions_1 = __importDefault(require('textextensions')) | ||
@@ -27,3 +64,3 @@ const binaryextensions_1 = __importDefault(require('binaryextensions')) | ||
// Extract filename | ||
const parts = path_1.default.basename(filename).split('.').reverse() | ||
const parts = pathUtil.basename(filename).split('.').reverse() | ||
// Cycle extensions | ||
@@ -30,0 +67,0 @@ for (const extension of parts) { |
'use strict' | ||
/* eslint no-use-before-define:0 */ | ||
var __createBinding = | ||
(this && this.__createBinding) || | ||
(Object.create | ||
? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k | ||
Object.defineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k] | ||
}, | ||
}) | ||
} | ||
: function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k | ||
o[k2] = m[k] | ||
}) | ||
var __setModuleDefault = | ||
(this && this.__setModuleDefault) || | ||
(Object.create | ||
? function (o, v) { | ||
Object.defineProperty(o, 'default', { enumerable: true, value: v }) | ||
} | ||
: function (o, v) { | ||
o['default'] = v | ||
}) | ||
var __importStar = | ||
(this && this.__importStar) || | ||
function (mod) { | ||
if (mod && mod.__esModule) return mod | ||
var result = {} | ||
if (mod != null) | ||
for (var k in mod) | ||
if (k !== 'default' && Object.hasOwnProperty.call(mod, k)) | ||
__createBinding(result, mod, k) | ||
__setModuleDefault(result, mod) | ||
return result | ||
} | ||
var __importDefault = | ||
@@ -10,3 +47,3 @@ (this && this.__importDefault) || | ||
exports.getEncoding = exports.isBinary = exports.isText = void 0 | ||
const path_1 = __importDefault(require('path')) | ||
const pathUtil = __importStar(require('path')) | ||
const textextensions_1 = __importDefault(require('textextensions')) | ||
@@ -27,3 +64,3 @@ const binaryextensions_1 = __importDefault(require('binaryextensions')) | ||
// Extract filename | ||
const parts = path_1.default.basename(filename).split('.').reverse() | ||
const parts = pathUtil.basename(filename).split('.').reverse() | ||
// Cycle extensions | ||
@@ -30,0 +67,0 @@ for (const extension of parts) { |
{ | ||
"title": "Is Text or Binary?", | ||
"name": "istextorbinary", | ||
"version": "5.2.0-next.1592596703.e5313de67041196450043fc9f31d95c02d7c488d", | ||
"version": "5.2.0-next.1592598153.aefa33264718e87d85dd170a442a5603e51b768b", | ||
"description": "Determine if a filename and/or buffer is text or binary. Smarter detection than the other solutions.", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/bevry/istextorbinary", |
@@ -5,3 +5,3 @@ /* eslint no-use-before-define:0 */ | ||
import type Buffer from 'buffer' | ||
import pathUtil from 'path' | ||
import * as pathUtil from 'path' | ||
import textExtensions from 'textextensions' | ||
@@ -8,0 +8,0 @@ import binaryExtensions from 'binaryextensions' |
57038
599