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

@jp-postal-code/address-data-generator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jp-postal-code/address-data-generator - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

34

lib/actions/generate/api-action.js

@@ -25,2 +25,4 @@ "use strict";

const _path = require("path");
const _rxjs = require("rxjs");
const _operators = require("rxjs/operators");
const defaultOptions = {

@@ -73,3 +75,3 @@ pretty: false

title: 'Write addresses json',
async task ({ postalCodeAddressesMap , distPath , pretty }, task) {
task ({ postalCodeAddressesMap , distPath , pretty }, task) {
if (postalCodeAddressesMap == null) {

@@ -79,12 +81,22 @@ task.skip();

}
let completedCount = 0;
await (0, _writeAddressesJson.writeAddressesJson)({
postalCodeAddressesMap,
distPath,
pretty,
onOutput () {
++completedCount;
task.output = `${completedCount}/${postalCodeAddressesMap.size}`;
}
});
return new _rxjs.Observable((observer)=>{
(async ()=>{
try {
await (0, _writeAddressesJson.writeAddressesJson)({
postalCodeAddressesMap,
distPath,
pretty,
onOutput () {
observer.next();
}
});
observer.complete();
} catch (error) {
observer.error(error);
}
})();
}).pipe((0, _operators.map)((_, i)=>{
const percent = i / postalCodeAddressesMap.size * 100;
return `${i}/${postalCodeAddressesMap.size} ${percent.toFixed(1)}%`;
}), (0, _operators.throttleTime)(1000));
}

@@ -91,0 +103,0 @@ },

@@ -12,2 +12,4 @@ "use strict";

const _minify = require("../minify/minify");
const _rxjs = require("rxjs");
const _operators = require("rxjs/operators");
function _interopRequireDefault(obj) {

@@ -37,3 +39,3 @@ return obj && obj.__esModule ? obj : {

title: 'Minify',
async task ({ paths }, task) {
task ({ paths }, task) {
if (paths == null || paths.length === 0) {

@@ -43,10 +45,20 @@ task.skip('Skip because file not found.');

}
let completedCount = 0;
await (0, _minify.minify)({
paths,
onMinified () {
++completedCount;
task.output = `${completedCount}/${paths.length}`;
}
});
return new _rxjs.Observable((observer)=>{
(async ()=>{
try {
await (0, _minify.minify)({
paths,
onMinified () {
observer.next();
}
});
observer.complete();
} catch (error) {
observer.error(error);
}
})();
}).pipe((0, _operators.map)((_, i)=>{
const percent = i / paths.length * 100;
return `${i}/${paths.length} ${percent.toFixed(1)}%`;
}), (0, _operators.throttleTime)(1000));
}

@@ -53,0 +65,0 @@ },

{
"name": "@jp-postal-code/address-data-generator",
"description": "Generate japan address data",
"version": "0.1.0",
"version": "0.1.1",
"repository": "git@github.com:jp-postal-code/address-data-generator.git",

@@ -24,4 +24,5 @@ "publishConfig": {

"listr2": "^5.0.5",
"progress": "^2.0.3"
"progress": "^2.0.3",
"rxjs": "^7.5.6"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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