Skip to content

Commit b070ca5

Browse files
Update 'os' module import
1 parent e06c342 commit b070ca5

File tree

8 files changed

+25
-23
lines changed

8 files changed

+25
-23
lines changed

CHANGES.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
10.26.1 (June XX, 2024)
2+
- Updated the internal import of the 'os' module in NodeJS to use ES modules when bundling and running a .mjs file with the SDK code.
3+
- Updated @splitsoftware/splitio-commons package to version 1.15.1 that includes updates on input validation logs.
4+
15
10.26.0 (May 6, 2024)
26
- Updated @splitsoftware/splitio-commons package to version 1.14.0 that includes minor updates:
37
- Added support for targeting rules based on semantic versions (https://semver.org/).
@@ -80,7 +84,7 @@
8084
- Bugfixing - Moved js-yaml dependency from @splitsoftware/splitio-commons to avoid resolution to an incompatible version on certain npm versions when installing third-party dependencies that also define js-yaml as transitive dependency (Related to issue https://github.com/splitio/javascript-client/issues/662).
8185

8286
10.20.0 (June 29, 2022)
83-
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
87+
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config `sync.enabled`. Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
8488
- Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown.
8589
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
8690

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio",
3-
"version": "10.26.0",
3+
"version": "10.26.1-rc.0",
44
"description": "Split SDK",
55
"files": [
66
"README.md",
@@ -40,7 +40,7 @@
4040
"node": ">=6"
4141
},
4242
"dependencies": {
43-
"@splitsoftware/splitio-commons": "1.14.0",
43+
"@splitsoftware/splitio-commons": "1.15.1-rc.0",
4444
"@types/google.analytics": "0.0.40",
4545
"@types/ioredis": "^4.28.0",
4646
"bloom-filters": "^3.0.0",

src/__tests__/nodeSuites/ip-addresses-setting.debug.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import osFunction from 'os';
2-
import ipFunction from '../../utils/ip';
2+
import * as ipFunction from '../../utils/ip';
33
import { SplitFactory } from '../../';
44
import { settingsFactory } from '../../settings';
55
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';

src/__tests__/nodeSuites/ip-addresses-setting.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import osFunction from 'os';
2-
import ipFunction from '../../utils/ip';
2+
import * as ipFunction from '../../utils/ip';
33
import { SplitFactory } from '../../';
44
import { settingsFactory } from '../../settings';
55
import splitChangesMock1 from '../mocks/splitchanges.since.-1.json';

src/settings/defaults/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const packageVersion = '10.26.0';
1+
export const packageVersion = '10.26.1-rc.0';

src/settings/runtime/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import osFunction from 'os';
2-
import ipFunction from '../../utils/ip';
2+
import { address } from '../../utils/ip';
33

44
import { UNKNOWN, NA, CONSUMER_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
55

@@ -8,7 +8,7 @@ export function validateRuntime(settings) {
88
const isConsumerMode = settings.mode === CONSUMER_MODE;
99

1010
// If the values are not available, default to false (for standalone) or "unknown" (for consumer mode, to be used on Redis keys)
11-
let ip = ipFunction.address() || (isConsumerMode ? UNKNOWN : false);
11+
let ip = address() || (isConsumerMode ? UNKNOWN : false);
1212
let hostname = osFunction.hostname() || (isConsumerMode ? UNKNOWN : false);
1313

1414
if (!isIPAddressesEnabled) { // If IPAddresses setting is not enabled, set as false (for standalone) or "NA" (for consumer mode, to be used on Redis keys)

src/utils/ip.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ The above copyright notice and this permission notice shall be included in all c
1212
1313
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1414
*/
15-
'use strict';
16-
17-
var ip = exports;
18-
var os = require('os');
15+
import os from 'os';
1916

2017
function _resolveFamily(family) {
2118
return typeof family === 'number' ? 'ipv' + family : family.toLowerCase();
@@ -79,7 +76,8 @@ function loopback(family) {
7976
// * 'private': the first private ip address of family.
8077
// * undefined: First address with `ipv4` or loopback address `127.0.0.1`.
8178
//
82-
ip.address = function (name, family) {
79+
80+
export function address(name, family) {
8381
var interfaces = os.networkInterfaces();
8482
var all;
8583

@@ -123,4 +121,4 @@ ip.address = function (name, family) {
123121
}).filter(Boolean);
124122

125123
return !all.length ? loopback(family) : all[0];
126-
};
124+
}

0 commit comments

Comments
 (0)