@esm2cjs/human-signals
Advanced tools
Comparing version 4.2.1-cjs.0 to 4.3.1
@@ -25,10 +25,10 @@ "use strict"; | ||
module.exports = __toCommonJS(main_exports); | ||
var import_os = require("os"); | ||
var import_node_os = require("node:os"); | ||
var import_realtime = require("./realtime.js"); | ||
var import_signals = require("./signals.js"); | ||
const getSignalsByName = function() { | ||
const getSignalsByName = () => { | ||
const signals = (0, import_signals.getSignals)(); | ||
return Object.fromEntries(signals.map(getSignalByName)); | ||
}; | ||
const getSignalByName = function({ | ||
const getSignalByName = ({ | ||
name, | ||
@@ -41,10 +41,5 @@ number, | ||
standard | ||
}) { | ||
return [ | ||
name, | ||
{ name, number, description, supported, action, forced, standard } | ||
]; | ||
}; | ||
}) => [name, { name, number, description, supported, action, forced, standard }]; | ||
const signalsByName = getSignalsByName(); | ||
const getSignalsByNumber = function() { | ||
const getSignalsByNumber = () => { | ||
const signals = (0, import_signals.getSignals)(); | ||
@@ -55,3 +50,3 @@ const length = import_realtime.SIGRTMAX + 1; | ||
}; | ||
const getSignalByNumber = function(number, signals) { | ||
const getSignalByNumber = (number, signals) => { | ||
const signal = findSignalByNumber(number, signals); | ||
@@ -74,4 +69,4 @@ if (signal === void 0) { | ||
}; | ||
const findSignalByNumber = function(number, signals) { | ||
const signal = signals.find(({ name }) => import_os.constants.signals[name] === number); | ||
const findSignalByNumber = (number, signals) => { | ||
const signal = signals.find(({ name }) => import_node_os.constants.signals[name] === number); | ||
if (signal !== void 0) { | ||
@@ -78,0 +73,0 @@ return signal; |
@@ -25,15 +25,13 @@ "use strict"; | ||
module.exports = __toCommonJS(realtime_exports); | ||
const getRealtimeSignals = function() { | ||
const getRealtimeSignals = () => { | ||
const length = SIGRTMAX - SIGRTMIN + 1; | ||
return Array.from({ length }, getRealtimeSignal); | ||
}; | ||
const getRealtimeSignal = function(value, index) { | ||
return { | ||
name: `SIGRT${index + 1}`, | ||
number: SIGRTMIN + index, | ||
action: "terminate", | ||
description: "Application-specific signal (realtime)", | ||
standard: "posix" | ||
}; | ||
}; | ||
const getRealtimeSignal = (value, index) => ({ | ||
name: `SIGRT${index + 1}`, | ||
number: SIGRTMIN + index, | ||
action: "terminate", | ||
description: "Application-specific signal (realtime)", | ||
standard: "posix" | ||
}); | ||
const SIGRTMIN = 34; | ||
@@ -40,0 +38,0 @@ const SIGRTMAX = 64; |
@@ -24,6 +24,6 @@ "use strict"; | ||
module.exports = __toCommonJS(signals_exports); | ||
var import_os = require("os"); | ||
var import_node_os = require("node:os"); | ||
var import_core = require("./core.js"); | ||
var import_realtime = require("./realtime.js"); | ||
const getSignals = function() { | ||
const getSignals = () => { | ||
const realtimeSignals = (0, import_realtime.getRealtimeSignals)(); | ||
@@ -33,3 +33,3 @@ const signals = [...import_core.SIGNALS, ...realtimeSignals].map(normalizeSignal); | ||
}; | ||
const normalizeSignal = function({ | ||
const normalizeSignal = ({ | ||
name, | ||
@@ -41,6 +41,6 @@ number: defaultNumber, | ||
standard | ||
}) { | ||
}) => { | ||
const { | ||
signals: { [name]: constantSignal } | ||
} = import_os.constants; | ||
} = import_node_os.constants; | ||
const supported = constantSignal !== void 0; | ||
@@ -47,0 +47,0 @@ const number = supported ? constantSignal : defaultNumber; |
@@ -9,4 +9,4 @@ | ||
description:"Terminal closed", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -17,4 +17,4 @@ name:"SIGINT", | ||
description:"User interruption with CTRL-C", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -25,4 +25,4 @@ name:"SIGQUIT", | ||
description:"User interruption with CTRL-\\", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -33,4 +33,4 @@ name:"SIGILL", | ||
description:"Invalid machine instruction", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -41,4 +41,4 @@ name:"SIGTRAP", | ||
description:"Debugger breakpoint", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -49,4 +49,4 @@ name:"SIGABRT", | ||
description:"Aborted", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -57,4 +57,4 @@ name:"SIGIOT", | ||
description:"Aborted", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -66,4 +66,4 @@ name:"SIGBUS", | ||
"Bus error due to misaligned, non-existing address or paging error", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -74,4 +74,4 @@ name:"SIGEMT", | ||
description:"Command should be emulated but is not implemented", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -82,4 +82,4 @@ name:"SIGFPE", | ||
description:"Floating point arithmetic error", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -91,4 +91,4 @@ name:"SIGKILL", | ||
standard:"posix", | ||
forced:true}, | ||
forced:true | ||
}, | ||
{ | ||
@@ -99,4 +99,4 @@ name:"SIGUSR1", | ||
description:"Application-specific signal", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -107,4 +107,4 @@ name:"SIGSEGV", | ||
description:"Segmentation fault", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -115,4 +115,4 @@ name:"SIGUSR2", | ||
description:"Application-specific signal", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -123,4 +123,4 @@ name:"SIGPIPE", | ||
description:"Broken pipe or socket", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -131,4 +131,4 @@ name:"SIGALRM", | ||
description:"Timeout or timer", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -139,4 +139,4 @@ name:"SIGTERM", | ||
description:"Termination", | ||
standard:"ansi"}, | ||
standard:"ansi" | ||
}, | ||
{ | ||
@@ -147,4 +147,4 @@ name:"SIGSTKFLT", | ||
description:"Stack is empty or overflowed", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -155,4 +155,4 @@ name:"SIGCHLD", | ||
description:"Child process terminated, paused or unpaused", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -163,4 +163,4 @@ name:"SIGCLD", | ||
description:"Child process terminated, paused or unpaused", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -172,4 +172,4 @@ name:"SIGCONT", | ||
standard:"posix", | ||
forced:true}, | ||
forced:true | ||
}, | ||
{ | ||
@@ -181,4 +181,4 @@ name:"SIGSTOP", | ||
standard:"posix", | ||
forced:true}, | ||
forced:true | ||
}, | ||
{ | ||
@@ -189,4 +189,4 @@ name:"SIGTSTP", | ||
description:"Paused using CTRL-Z or \"suspend\"", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -197,4 +197,4 @@ name:"SIGTTIN", | ||
description:"Background process cannot read terminal input", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -205,4 +205,4 @@ name:"SIGBREAK", | ||
description:"User interruption with CTRL-BREAK", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -213,4 +213,4 @@ name:"SIGTTOU", | ||
description:"Background process cannot write to terminal output", | ||
standard:"posix"}, | ||
standard:"posix" | ||
}, | ||
{ | ||
@@ -221,4 +221,4 @@ name:"SIGURG", | ||
description:"Socket received out-of-band data", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -229,4 +229,4 @@ name:"SIGXCPU", | ||
description:"Process timed out", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -237,4 +237,4 @@ name:"SIGXFSZ", | ||
description:"File too big", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -245,4 +245,4 @@ name:"SIGVTALRM", | ||
description:"Timeout or timer", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -253,4 +253,4 @@ name:"SIGPROF", | ||
description:"Timeout or timer", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -261,4 +261,4 @@ name:"SIGWINCH", | ||
description:"Terminal window size changed", | ||
standard:"bsd"}, | ||
standard:"bsd" | ||
}, | ||
{ | ||
@@ -269,4 +269,4 @@ name:"SIGIO", | ||
description:"I/O is available", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -277,4 +277,4 @@ name:"SIGPOLL", | ||
description:"Watched event", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -285,4 +285,4 @@ name:"SIGINFO", | ||
description:"Request for process information", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -293,4 +293,4 @@ name:"SIGPWR", | ||
description:"Device running out of power", | ||
standard:"systemv"}, | ||
standard:"systemv" | ||
}, | ||
{ | ||
@@ -301,4 +301,4 @@ name:"SIGSYS", | ||
description:"Invalid system call", | ||
standard:"other"}, | ||
standard:"other" | ||
}, | ||
{ | ||
@@ -309,3 +309,3 @@ name:"SIGUNUSED", | ||
description:"Invalid system call", | ||
standard:"other"}]; | ||
//# sourceMappingURL=core.js.map | ||
standard:"other" | ||
}]; |
@@ -23,3 +23,3 @@ /** | ||
export type Signal = { | ||
export interface Signal { | ||
/** | ||
@@ -26,0 +26,0 @@ * Standard name of the signal, for example 'SIGINT'. |
@@ -1,2 +0,2 @@ | ||
import{constants}from"os"; | ||
import{constants}from"node:os"; | ||
@@ -8,3 +8,3 @@ import{SIGRTMAX}from"./realtime.js"; | ||
const getSignalsByName=function(){ | ||
const getSignalsByName=()=>{ | ||
const signals=getSignals(); | ||
@@ -14,3 +14,3 @@ return Object.fromEntries(signals.map(getSignalByName)); | ||
const getSignalByName=function({ | ||
const getSignalByName=({ | ||
name, | ||
@@ -22,10 +22,5 @@ number, | ||
forced, | ||
standard}) | ||
{ | ||
return[ | ||
name, | ||
{name,number,description,supported,action,forced,standard}]; | ||
standard | ||
})=>[name,{name,number,description,supported,action,forced,standard}]; | ||
}; | ||
export const signalsByName=getSignalsByName(); | ||
@@ -36,3 +31,3 @@ | ||
const getSignalsByNumber=function(){ | ||
const getSignalsByNumber=()=>{ | ||
const signals=getSignals(); | ||
@@ -46,3 +41,3 @@ const length=SIGRTMAX+1; | ||
const getSignalByNumber=function(number,signals){ | ||
const getSignalByNumber=(number,signals)=>{ | ||
const signal=findSignalByNumber(number,signals); | ||
@@ -63,10 +58,10 @@ | ||
forced, | ||
standard}}; | ||
standard | ||
} | ||
}; | ||
}; | ||
const findSignalByNumber=function(number,signals){ | ||
const findSignalByNumber=(number,signals)=>{ | ||
const signal=signals.find(({name})=>constants.signals[name]===number); | ||
@@ -81,3 +76,2 @@ | ||
export const signalsByNumber=getSignalsByNumber(); | ||
//# sourceMappingURL=main.js.map | ||
export const signalsByNumber=getSignalsByNumber(); |
export const getRealtimeSignals=function(){ | ||
export const getRealtimeSignals=()=>{ | ||
const length=SIGRTMAX-SIGRTMIN+1; | ||
@@ -7,4 +7,3 @@ return Array.from({length},getRealtimeSignal); | ||
const getRealtimeSignal=function(value,index){ | ||
return{ | ||
const getRealtimeSignal=(value,index)=>({ | ||
name:`SIGRT${index+1}`, | ||
@@ -14,8 +13,6 @@ number:SIGRTMIN+index, | ||
description:"Application-specific signal (realtime)", | ||
standard:"posix"}; | ||
standard:"posix" | ||
}); | ||
}; | ||
const SIGRTMIN=34; | ||
export const SIGRTMAX=64; | ||
//# sourceMappingURL=realtime.js.map | ||
export const SIGRTMAX=64; |
@@ -1,2 +0,2 @@ | ||
import{constants}from"os"; | ||
import{constants}from"node:os"; | ||
@@ -8,3 +8,3 @@ import{SIGNALS}from"./core.js"; | ||
export const getSignals=function(){ | ||
export const getSignals=()=>{ | ||
const realtimeSignals=getRealtimeSignals(); | ||
@@ -21,3 +21,3 @@ const signals=[...SIGNALS,...realtimeSignals].map(normalizeSignal); | ||
const normalizeSignal=function({ | ||
const normalizeSignal=({ | ||
name, | ||
@@ -28,11 +28,10 @@ number:defaultNumber, | ||
forced=false, | ||
standard}) | ||
{ | ||
standard | ||
})=>{ | ||
const{ | ||
signals:{[name]:constantSignal}}= | ||
constants; | ||
signals:{[name]:constantSignal} | ||
}=constants; | ||
const supported=constantSignal!==undefined; | ||
const number=supported?constantSignal:defaultNumber; | ||
return{name,number,description,supported,action,forced,standard}; | ||
}; | ||
//# sourceMappingURL=signals.js.map | ||
}; |
{ | ||
"name": "@esm2cjs/human-signals", | ||
"version": "4.2.1-cjs.0", | ||
"version": "4.3.1", | ||
"exports": { | ||
@@ -17,2 +17,3 @@ ".": { | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
@@ -54,9 +55,8 @@ "test": "gulp test" | ||
"directories": { | ||
"lib": "src", | ||
"test": "test" | ||
"lib": "src" | ||
}, | ||
"devDependencies": { | ||
"@ehmicky/dev-tasks": "^1.0.84", | ||
"ajv": "^8.11.0", | ||
"test-each": "^5.2.0" | ||
"@ehmicky/dev-tasks": "^2.0.71", | ||
"ajv": "^8.12.0", | ||
"test-each": "^5.7.1" | ||
}, | ||
@@ -63,0 +63,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
# @esm2cjs/strip-final-newline | ||
# @esm2cjs/human-signals | ||
@@ -3,0 +3,0 @@ This is a fork of https://github.com/ehmicky/human-signals, but automatically patched to support ESM **and** CommonJS, unlike the original repository. |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
39008
16
1025
1