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

@agencebio/rosetta-cultures

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agencebio/rosetta-cultures - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

6

dist/cjs/index.js

@@ -105,5 +105,9 @@ "use strict";

var _a;
if (typeof code !== 'string') {
return null;
}
var cleanCode = code.trim().replace(/\s+/g, ' ');
return (_a = cpf_json_1.default.find(function (_a) {
var codes_geofolia = _a.codes_geofolia;
return codes_geofolia.includes(code);
return codes_geofolia.includes(cleanCode);
})) !== null && _a !== void 0 ? _a : null;

@@ -110,0 +114,0 @@ }

@@ -95,3 +95,8 @@ /**

export function fromCodeGeofolia (code) {
return cpf.find(({ codes_geofolia }) => codes_geofolia.includes(code)) ?? null
if (typeof code !== 'string') {
return null
}
const cleanCode = code.trim().replace(/\s+/g, ' ')
return cpf.find(({ codes_geofolia }) => codes_geofolia.includes(cleanCode)) ?? null
}

@@ -98,0 +103,0 @@

@@ -127,2 +127,11 @@ import { describe, it } from 'node:test'

})
it('returns a single matching code, even with multiple spaces', () => {
deepEqual(fromCodeGeofolia('ZAR ZFB').code_cpf, '01.11.12')
deepEqual(fromCodeGeofolia('ZAR ZFB').code_cpf, '01.11.12')
deepEqual(fromCodeGeofolia('ZAQ ZFA').code_cpf, '01.11.11')
deepEqual(fromCodeGeofolia('ZAQ ZFA').code_cpf, '01.11.11')
deepEqual(fromCodeGeofolia('ZAR ZFAI01').code_cpf, '01.11.12')
deepEqual(fromCodeGeofolia('ZAR ZFAI01').code_cpf, '01.11.12')
})
})

@@ -129,0 +138,0 @@

2

package.json
{
"name": "@agencebio/rosetta-cultures",
"version": "1.7.0",
"version": "1.7.1",
"description": "Traduction des codes cultures de la CPF vers la PAC vers des nomenclatures d'organismes de certification, et vice-versa.",

@@ -5,0 +5,0 @@ "main": "index.js",

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