Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18next-scanner-typescript

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-scanner-typescript - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

32

dist-node/index.js
'use strict';
var fs = require("fs");
const fs = require("fs");
var path = require("path");
const path = require("path");
var typescript = require("typescript");
const typescript = require("typescript");
module.exports = function typescriptTransform(options) {
options = options || {};
module.exports = function typescriptTransform(options = {}) {
if (!options.extensions) {
options.extensions = [".tsx"];
options.extensions = [".ts", ".tsx"];
}
return function transform(file, enc, done) {
const extension = path.extname(file.path);
const parser = this.parser;
let content = fs.readFileSync(file.path, enc);
const {
base,
ext
} = path.parse(file.path);
if (options.extensions.indexOf(extension) !== -1) {
content = typescript.transpileModule(content, {
if (options.extensions.includes(ext) && !base.includes('.d.ts')) {
const content = fs.readFileSync(file.path, enc);
const {
outputText
} = typescript.transpileModule(content, {
compilerOptions: {

@@ -27,5 +29,5 @@ target: 'es2018'

fileName: path.basename(file.path)
}).outputText;
parser.parseTransFromString(content);
parser.parseFuncFromString(content);
});
this.parser.parseTransFromString(outputText);
this.parser.parseFuncFromString(outputText);
}

@@ -32,0 +34,0 @@

@@ -1,21 +0,23 @@

var fs = require("fs");
const fs = require("fs");
var path = require("path");
const path = require("path");
var typescript = require("typescript");
const typescript = require("typescript");
module.exports = function typescriptTransform(options) {
options = options || {};
module.exports = function typescriptTransform(options = {}) {
if (!options.extensions) {
options.extensions = [".tsx"];
options.extensions = [".ts", ".tsx"];
}
return function transform(file, enc, done) {
const extension = path.extname(file.path);
const parser = this.parser;
let content = fs.readFileSync(file.path, enc);
const {
base,
ext
} = path.parse(file.path);
if (options.extensions.indexOf(extension) !== -1) {
content = typescript.transpileModule(content, {
if (options.extensions.includes(ext) && !base.includes('.d.ts')) {
const content = fs.readFileSync(file.path, enc);
const {
outputText
} = typescript.transpileModule(content, {
compilerOptions: {

@@ -25,5 +27,5 @@ target: 'es2018'

fileName: path.basename(file.path)
}).outputText;
parser.parseTransFromString(content);
parser.parseFuncFromString(content);
});
this.parser.parseTransFromString(outputText);
this.parser.parseFuncFromString(outputText);
}

@@ -30,0 +32,0 @@

{
"name": "i18next-scanner-typescript",
"description": "i18next-scanner Typescript transform",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"files": [
"dist-*/",
"bin/"
],
"esnext": "dist-src/index.js",

@@ -10,7 +14,2 @@ "main": "dist-node/index.js",

"sideEffects": false,
"files": [
"dist-*/",
"assets/",
"bin/"
],
"repository": {

@@ -24,4 +23,4 @@ "type": "git",

"devDependencies": {
"@pika/plugin-build-node": "^0.3.11",
"@pika/plugin-standard-pkg": "^0.3.11"
"@pika/plugin-build-node": "^0.4.0",
"@pika/plugin-standard-pkg": "^0.4.0"
},

@@ -28,0 +27,0 @@ "private": false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc