-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Non activé car cela pose un problème bizarre avec la première animation. Sans doute lié à sveltejs/kit#2301
- Loading branch information
1 parent
1508510
commit 1de5a27
Showing
6 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import publicodes, { | ||
formatValue as formatValueImport, | ||
reduceAST as reduceASTImport | ||
} from 'publicodes'; | ||
import aides from '$lib/../aides.yaml'; | ||
|
||
// HACK : Côté client Le paquet publicodes ne peut pas être importé normalement | ||
// avec un `import publicodes from "publicodes"`, vraisemblablement car le | ||
// paquet n'est pas sous le bon format ES Module. Pour contourner le problème | ||
// temporairement on passe par `unpkg.com` qui ajoute une variable globale côté | ||
// client. | ||
const Publicodes = typeof window !== 'undefined' ? window.publicodes.default : publicodes; | ||
|
||
export const engine = new Publicodes(aides); | ||
|
||
export const formatValue = | ||
typeof window !== 'undefined' ? window.publicodes.formatValue : formatValueImport; | ||
export const reduceAST = | ||
typeof window !== 'undefined' ? window.publicodes.reduceAST : reduceASTImport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters