{"pageProps":{"code":{"2.1_date_fns.js":{"name":"2.1_date_fns.js","content":"import { isValid } from 'date-fns';\n\nfunction dateIsValid(year, month, day) {\n  return isValid(new Date(year, month, day));\n}\n\nconsole.log(dateIsValid('2022', '14', '02'));\n","path":"code/1531/22T3/env1/src/2.1_date_fns.js","fileext":"js"},"2.1_package_simple.json":{"name":"2.1_package_simple.json","content":"{\n  \"name\": \"example\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"type\": \"module\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n  },\n  \"author\": \"\",\n  \"license\": \"ISC\"\n}","path":"code/1531/22T3/env1/src/2.1_package_simple.json","fileext":"json"},"2.2_multi_export_lib_p_1.js":{"name":"2.2_multi_export_lib_p_1.js","content":"function manyString(repeat, str) {\n  let outString = '';\n  for (let i = 0; i < repeat; i++) {\n    outString += str;\n  }\n  return outString;\n}\n\nfunction addBrackets(string) {\n  return `(${string})`;\n}\n\nexport default manyString; // How do we add more??\n","path":"code/1531/22T3/env1/src/2.2_multi_export_lib_p_1.js","fileext":"js"},"2.2_multi_export_lib_p_2.js":{"name":"2.2_multi_export_lib_p_2.js","content":"function manyString(repeat, str) {\n  let outString = '';\n  for (let i = 0; i < repeat; i++) {\n    outString += str;\n  }\n  return outString;\n}\n\nfunction addBrackets(string) {\n  return `(${string})`;\n}\n\nexport {\n  manyString,\n  addBrackets,\n};\n","path":"code/1531/22T3/env1/src/2.2_multi_export_lib_p_2.js","fileext":"js"},"2.2_multi_export_main_p_1.js":{"name":"2.2_multi_export_main_p_1.js","content":"import all from './2.2_multi_export_lib_p_1.js';\n\nconst b = all.brackets('hello ');\nconst many = all.manyString(5, b);\nconsole.log(many);\n","path":"code/1531/22T3/env1/src/2.2_multi_export_main_p_1.js","fileext":"js"},"2.2_multi_export_main_p_2.js":{"name":"2.2_multi_export_main_p_2.js","content":"import { addBrackets, manyString } from './2.2_multi_export_lib_p_2.js';\n\nconst b = addBrackets('hello ');\nconst many = manyString(5, b);\nconsole.log(many);\n","path":"code/1531/22T3/env1/src/2.2_multi_export_main_p_2.js","fileext":"js"},"2.2_split_after_lib.js":{"name":"2.2_split_after_lib.js","content":"function manyString(repeat, str) {\n  let outString = '';\n  for (let i = 0; i < repeat; i++) {\n    outString += str;\n  }\n  return outString;\n}\n\nexport default manyString;\n","path":"code/1531/22T3/env1/src/2.2_split_after_lib.js","fileext":"js"},"2.2_split_after_main.js":{"name":"2.2_split_after_main.js","content":"import manyString from './2.2_split_after_lib.js';\n\nconsole.log(manyString(5, 'hello '));\n","path":"code/1531/22T3/env1/src/2.2_split_after_main.js","fileext":"js"},"2.2_split_before.js":{"name":"2.2_split_before.js","content":"function manyString(repeat, str) {\n  let outString = '';\n  for (let i = 0; i < repeat; i++) {\n    outString += str;\n  }\n  return outString;\n}\n\nconsole.log(manyString(5, 'hello '));\n","path":"code/1531/22T3/env1/src/2.2_split_before.js","fileext":"js"},"2.3_blackbox.js":{"name":"2.3_blackbox.js","content":"// Returns a new string with vowels removed\nfunction removeVowels(string) {\n  return 0;\n}\n\n// Calculates the factorial of a number\nfunction factorial(num) {\n  return 0;\n}\n","path":"code/1531/22T3/env1/src/2.3_blackbox.js","fileext":"js"},"2.3_blackbox2.js":{"name":"2.3_blackbox2.js","content":"// Returns a new string with vowels removed\nfunction removeVowels(string) {\n  return 0;\n}\n\n// Calculates the factorial of a number\nfunction factorial(num) {\n  return 0;\n}\n\nconsole.log(removeVowels('abcde') === 'bcd');\nconsole.log(removeVowels('frog') === 'frg');\nconsole.log(factorial(3) === 6);\nconsole.log(factorial(5) === 120);\n","path":"code/1531/22T3/env1/src/2.3_blackbox2.js","fileext":"js"},"2.3_design_contract.js":{"name":"2.3_design_contract.js","content":"// Returns a new string with vowels removed\n// Input is a non-empty string type\n// Return type is another string\nfunction removeVowels(string) {\n  return 0;\n}\n\n// Calculates the factorial of a number\n// Input is a number between 1 and 10\n// Output is a positive number\nfunction factorial(num) {\n  return 0;\n}\n","path":"code/1531/22T3/env1/src/2.3_design_contract.js","fileext":"js"},"2.3_even_testing1.js":{"name":"2.3_even_testing1.js","content":"function getEven(nums) {\n  const evens = [];\n  for (const number of nums) {\n    if (number % 2 === 0) {\n      evens.push(number);\n    }\n  }\n  return evens;\n}\n","path":"code/1531/22T3/env1/src/2.3_even_testing1.js","fileext":"js"},"2.3_even_testing2.js":{"name":"2.3_even_testing2.js","content":"function getEven(nums) {\n  const evens = [];\n  for (const number of nums) {\n    if (number % 2 === 0) {\n      evens.push(number);\n    }\n  }\n  return evens;\n}\n\nconsole.log(getEven([1, 2, 3]));\nconsole.log(getEven([4, 5, 6]));\nconsole.log(getEven([7]));\n","path":"code/1531/22T3/env1/src/2.3_even_testing2.js","fileext":"js"},"2.3_even_testing3.js":{"name":"2.3_even_testing3.js","content":"function getEven(nums) {\n  const evens = [];\n  for (const number of nums) {\n    if (number % 2 === 0) {\n      evens.push(number);\n    }\n  }\n  return evens;\n}\n\nif (getEven([1, 2, 3]).toString() !== [2].toString()) {\n  console.log(\"Doesn't work 1\");\n}\nif (getEven([4, 5, 6]).toString() !== [4, 6].toString()) {\n  console.log(\"Doesn't work 2\");\n}\nif (getEven([7]).toString() !== [].toString()) {\n  console.log(\"Doesn't work 3\");\n}\n","path":"code/1531/22T3/env1/src/2.3_even_testing3.js","fileext":"js"},"2.3_jest_lib.js":{"name":"2.3_jest_lib.js","content":"// Returns a new string with vowels removed\nfunction removeVowels(string) {\n  return 0;\n}\n\nexport { removeVowels };\n","path":"code/1531/22T3/env1/src/2.3_jest_lib.js","fileext":"js"},"2.3_jest_lib.test.js":{"name":"2.3_jest_lib.test.js","content":"import { removeVowels } from './2.3_jest_lib';\n\ndescribe('removeVowels', () => {\n  test('deals with no vowels', () => {\n    const example1 = removeVowels('bcd');\n    const example2 = removeVowels('lkj');\n    expect(example1).toEqual('bcd');\n    expect(example2).toEqual('lkj');\n  });\n  test('deals with only vowels', () => {\n    expect(removeVowels('aei')).toEqual('');\n    expect(removeVowels('oiu')).toEqual('');\n  });\n  test('deals with starting vowels', () => {\n    expect(removeVowels('ant')).toEqual('nt');\n    expect(removeVowels('old')).toEqual('old');\n  });\n  test('deals with ending vowels', () => {\n    expect(removeVowels('bee')).toEqual('b');\n    expect(removeVowels('hi')).toEqual('h');\n  });\n  test('deals with complex words', () => {\n    expect(removeVowels('cannot')).toEqual('cnnt');\n    expect(removeVowels('delicious')).toEqual('dlcs}');\n  });\n});\n","path":"code/1531/22T3/env1/src/2.3_jest_lib.test.js","fileext":"js"},"3.1_json_it.js":{"name":"3.1_json_it.js","content":"import fs from 'fs';\n\nconst DATA_STRUCTURE = {\n  names: [\n    {\n      first: 'Bob',\n      last: 'Carr',\n    },\n    {\n      first: 'Julia',\n      last: 'Gillard',\n    },\n    {\n      first: 'Ken',\n      last: 'Henry',\n    },\n  ],\n};\n\nconst data = JSON.stringify(DATA_STRUCTURE);\nfs.writeFileSync('export.json', data, { flag: 'w' });\n","path":"code/1531/22T3/env1/src/3.1_json_it.js","fileext":"js"},"3.1_unjson_it.js":{"name":"3.1_unjson_it.js","content":"import fs from 'fs';\n\nconst json = fs.readFileSync('export.json', { flag: 'r' });\nconst data = JSON.parse(json);\nconsole.log(data);\n","path":"code/1531/22T3/env1/src/3.1_unjson_it.js","fileext":"js"},"3.2_gitlab-ci_basic.yml":{"name":"3.2_gitlab-ci_basic.yml","content":"image: comp1531/basic:latest\n\ncache:\n  paths:\n    - node_modules\n\nstages:\n  - checks\n\nsanity:\n  stage: checks\n  script:\n    - echo 'Hello!'","path":"code/1531/22T3/env1/src/3.2_gitlab-ci_basic.yml","fileext":"yml"},"3.2_gitlab-ci_test.yml":{"name":"3.2_gitlab-ci_test.yml","content":"image: comp1531/basic:latest\n\ncache:\n  paths:\n    - node_modules\n\nstages:\n  - checks\n\ntesting:\n  stage: checks\n  script:\n    - npm run test\n","path":"code/1531/22T3/env1/src/3.2_gitlab-ci_test.yml","fileext":"yml"}}},"__N_SSG":true}