Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Commit

Permalink
refactor: mv source/migration into src/migration
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileRolley committed May 29, 2024
1 parent f38b791 commit 096ac62
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/compilation/getModelFromSource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync, statSync } from 'fs'
import glob from 'glob'
import yaml from 'yaml'
import fs from 'fs'
import { getDoubleDefError, RawRules } from '../commons'
import { resolveImports } from './resolveImports'

Expand Down Expand Up @@ -41,15 +41,15 @@ export function getModelFromSource(
opts?: GetModelFromSourceOptions,
): RawRules {
try {
if (fs.statSync(sourcePath).isDirectory()) {
if (statSync(sourcePath).isDirectory()) {
sourcePath = sourcePath + '/**/*.publicodes'
}
} catch (e) {}
const { jsonModel, namespaces } = glob
.sync(sourcePath, { ignore: opts?.ignore })
.reduce(
({ jsonModel, namespaces }, filePath: string) => {
const rules: RawRules = yaml.parse(fs.readFileSync(filePath, 'utf-8'))
const rules: RawRules = yaml.parse(readFileSync(filePath, 'utf-8'))
if (rules == null) {
console.warn(`⚠️ ${filePath} is empty, skipping...`)
return jsonModel
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/migration/migrateSituation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { migrateSituation } from '../../source/migration/migrateSituation'
import { migrateSituation } from '../../src/migration/migrateSituation'

const migrationInstructions = {
keysToMigrate: { age: 'âge', 'année de naissance': '' },
Expand Down

0 comments on commit 096ac62

Please sign in to comment.